Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Automatically starting a script when Procomm answers

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
I am trying to figure out how to start a script when my pc is called by a remote PBX. I would like the script to run all of the time and pause when the circuit is idle and resume when a new call arrives.
Thanks,
Fred
 
You can check the value of the $CARRIER system variable to determine if you have a connection or not. A value of 1 indicates a connection has been made, while zero means the connection is idle. You could have a script that ran all of the time that looked something like this:

proc main
when $CARRIER call check_carrier
while 1
yield
endwhile
endproc

proc check_carrier
if $CARRIER == 1
execute main_script
endif
endproc

What this script would do is sit in an endless loop until the value of $CARRIER changed. When this happened, the check_carrier procedure would be called. If the value of $CARRIER is one, indicating a connection, the script that provides the main functionality (called main_script above, but you can give it whatever name you wish) is executed. When main_script has finished executing, control would return back to the script above until the next call. You will need to do some error handling in main_script to make sure the script exits if $CARRIER is unexpectedly lost. You could use the same check_carrier script, just modified a little bit:

proc check_carrier
if $CARRIER == 0
exit
endif
endproc

Before the exit command, you may need to do some additional cleanup, such as closing any open files your main script might have open and so on.
 
knob,
Thank you for you help, it worked fine. I am just a phone guy breaking into this data world. Thanks again.
Fred Wells
 
Glad I could help out! Let us know if you run into any other problem.
 
Hello,

I would agree with Robert. The Caller ID Option could be used to Limit when the Script Runs. Think about Wrong Numbers, TeleMarketer's, Hackers, Etc. Maybe with Caller ID you could Filter the Calls that could Activate your Script ..

Hank
 
Hello,

I use procomm v4.7 and also I'm trying to run a script from the caller ID option. However I haven't been able get it to work. I enabled the "use caller ID" in the system options and the fax manager displays the info from the caller ID directory when I receive a fax. In the manual says that "the script controls are not available unless you've selected the ANSWER THIS CALL option button".

Can any body tell me what am I doing wrong and what the manual is talking about? Where is this ANSWER THIS CALL option button?

Thanks a lot for your help
 
I do not think there really is such a button. (I guess you could use the dialog editor and make one...)

Seriously though, I think that is a wording mistake in the help file. The choices are "Reject Call", "Data", "Fax", "Data and Fax". The last three are the answer options.

To troubleshoot, test your caller ID number match repeatedly. While it is not supposed to matter whether you your parentheses , hyphens, etc, to be safe, try to match the directory entry exactly to what the telco transmits. You might also find that it displays differently for each call (sometimes 7 digit, sometimes 10) so you might want to have multiple entries with the same option.

Good luck. Robert Harris
Communications Advantage
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top