#1
|
|||
|
|||
Suppress TAPI Connection Line Busy Pop-ups
Hello All,
I'm working on a python script to simply connect to predefined sessions using TAPI. I noticed on some other older threads that there may have been functionality added to suppress pop-ups for connections that fail. Is there a way to automatically advance when there's some failure without having to select Ok in the dialog box? I tried adding the fail silently argument to the crt.Session.Connect method without any success. I'm currently using SecureCRT v7.3.1 and Python 3. Thanks!! Tom |
#2
|
||||
|
||||
Quote:
If you want to consider an alternative to using TAPI, you can consider using a script to perform dial operations by using the Serial protocol to talk directly to the Modem. An example script is available here. SecureCRT version 7.3.1 has not been in active development since 26 Feb, 2015. It is strongly suggested that you upgrade to a version of SecureCRT that is current and in active development. --Jake
__________________
Jake Devenport VanDyke Software Technical Support YouTube Channel: https://www.youtube.com/vandykesoftware Email: support@vandyke.com Web: https://www.vandyke.com/support |
#3
|
|||
|
|||
Hi Jake!
Thanks for the response! I've upgraded one of our workstations to use 9.0 instead of v7. I've updated your script as a logon action and added the number to be dialed 1-XXX-XXX-XXXX. I've also updated the protocol to serial and switched over to COM15 which is where the modem is assigned. I'm getting an 'Init Sequence Failed' error when trying to connect to either of my predefined test sessions. I was able to switch back to TAPI and connect successfully. Any suggestions? Thanks!! --Tom |
#4
|
||||
|
||||
Quote:
Code:
' Send a generic modem init string: You may need ' to modify this to meet your specific needs. crt.Screen.Send "AT&A3&B1&D0&K0&M4&N3&U3&R1" & vbcr If Not crt.Screen.WaitForString("OK", 3) Then crt.Dialog.MessageBox _ "Init sequence failed.", _ g_strScriptTitle crt.Session.Disconnect Exit Sub End If You may want to turn on modem logging within Windows, dial with TAPI, and then take a look at the modem log file Windows wrote to and see what specific init string is being sent to the modem when Windows' TAPI is doing the dialing -- then you'll have an init string that you know would likely work for you when talking to the modem directly via its serial port. It's also possible that the init string is OK, but the modem is slow to reply with the expected OK (within 3 seconds).How do you turn on modem logging in Windows? That's typically done within Windows (outside of SecureCRT entirely) - check your control panel's Phone and Modem settings, select the "Modems" tab, select your modem and press the "Properties" button; select the Diagnostics tab and you should see a "Logging" section that you can enable. Code:
If Not crt.Screen.WaitForString("OK", 3) Then Does that help explain where you need to go next?
__________________
Jake Devenport VanDyke Software Technical Support YouTube Channel: https://www.youtube.com/vandykesoftware Email: support@vandyke.com Web: https://www.vandyke.com/support |
#5
|
|||
|
|||
Thanks for the quick reply! So I've removed that block to see if I can move forward and I'm getting a runtime error on line 99 where you have
Code:
cResponses = CreateObject("Scripting.Dictionary") "Error: Wrong number of arguments or invalid property assignment: 'cResponses'" Any feedback on what I can do to get past this error? Thank you! --Tom |
#6
|
||||
|
||||
Quote:
Try adding the keyword "Set" to the very beginning of that line, so it reads like this: Code:
nTimeout = 30 Set cResponses = CreateObject("Scripting.Dictionary") cResponses.Add "1", "CONNECT" cResponses.Add "2", "BUSY" cResponses.Add "3", "NO DIAL TONE" cResponses.Add "4", "NO CARRIER" --Jake
__________________
Jake Devenport VanDyke Software Technical Support YouTube Channel: https://www.youtube.com/vandykesoftware Email: support@vandyke.com Web: https://www.vandyke.com/support |
#7
|
|||
|
|||
That was it! Thank you Jake!!
So my next question, since I'm using python to iterate through each one of my predefined sessions, I'm going to need to do some tweaking as I was only simply looking to see if the session was connected or not. However, I'm now running into an issue while I'm trying to test that I can't run a script because there is another script that is running. Within the python script I think I'm going to simply be looking for the 'ogin:' (or something like that) string and then disconnect since I'm only looking to see if I can connect to the device or not. Every success or failure going to text file for logging. What would you recommend as a path forward? Since I don't really know much about VBScript I was thinking maybe convert it to Python and just bake everything into the one script and just have that run without any additional logon scripts? Thanks again for your help! --Tom |
#8
|
||||
|
||||
If all you're doing is looking for "ogin:", then you already have a VBScript example that shows you how that is done with a WaitForString call to the Screen object.
Depending on what you want to accomplish, you may have better luck converting to a python script. Either way you want to go, it's up to you to decide what will work best for your scenario. My suggestion would be to *not* use a logon script if you're trying to iterate over a lot of sessions. The mere act of iterating with a script that you're already running disqualifies the idea of using a logon script. I'd suggest that now you know how to drive the dialing process via Serial, you can drive it just the same through python as you could through VBScript; drop the logon script and iterate with your python code over all your existing sessions, dial each number, look for "ogin:" or some other data suggesting success/fail and move on. --Jake
__________________
Jake Devenport VanDyke Software Technical Support YouTube Channel: https://www.youtube.com/vandykesoftware Email: support@vandyke.com Web: https://www.vandyke.com/support |
![]() |
Tags |
suppress pop-up , tapi |
Thread Tools | |
Display Modes | Rate This Thread |
|
|