Dialing through AppleScript
While JPT includes direct support for a number of Dial Methods, it can’t natively support everything. Using the AppleScript Dial Method, however, you can extend JPT’s dialing using the easy-to-learn AppleScript programming language. AppleScript is very versatile and can also incorporate shell scripts, commands to other languages such as PERL, Python, or Ruby and makes it easy to use networked devices as extensions to JPT. For more information on AppleScript, see the AppleScript section of the Apple Computer website or the independent AppleScript resources found at MacScripter.net (you can find plenty more about AppleScript by searching online).
The AppleScript Dial Method is how you can dial through many softphones and third-party dialing services. To use JPT with Speakeasy.net VoIP, BroadVoice VoIP or softphones from the Gizmo Project, JackenIAX, LoudHush, MegaFon, or ohphoneX, or FRITZ!Box devices, see the “JPT AppleScript DM Examples” folder in the “Goodies” folder on the JPT disk image. Simply copy the script that corresponds to your desired softphone or device to your hard drive and then specify the script you copied in the “Dialing Through AppleScript” Dial Method settings. The JPT Application Support Folder is a good place to store the script:
/Users/your user name/Library/Application Support/Jon's Phone Tool/
Or perhaps the Scripts folder (you can create this folder if it doesn’t already exist):
/Users/your user name/Library/Scripts/

When using the AppleScript Dial Method, you simply select an AppleScript saved as a compiled script. This script should be a regular script with an explicit run handler that includes an argv parameter:
When run, JPT will pass the contact number, contact name (if available), the type of call (e.g., local or domestic long distance, etc.) and the number transformed by the current Dialing Rules to the script. You can then use those values in your own script to send the original or transformed number to a dial device. Using a shell script you could use the curl tool to send the data over most IP network services. In this way you can send the call information to a process that JPT does not support directly.
If your script returns a value of false then the call will be classified as unsuccessful and it will not be added to the Call Log. Any other value returned will indicate to JPT that the call was successful and the call will be added to the call log and JPT will continue with its process (such as displaying the dialog to restore the iApps to their pre-call state or starting the call timer if desired).
For examples of how to create scripts for the AppleScript Dial Method, see the “JPT AppleScript DM Examples” folder in the “Goodies” folder on the JPT disk image.
Copyright © 2004 - 2007 JNSoftware LLC. All Rights Reserved.
All other products mentioned are copyright of their respective owners.
No endorsement of or affiliation with any third-party product or service is implied.