While Dialectic supports many devices & services for dialing, you may use a device or service that Dialectic doesn’t know about but which you can control using AppleScript (which can then, in turn, call a shell script, open a URL, etc.). To dial using an AppleScript, you’ll use the AppleScript Dial Method with your own script.
You specify the script to be used for dialing by creating a new AppleScript Dial Method configuration and choosing the script to use for that configuration. For example scripts that can be used with Dialectic as an AppleScript Dial Method script (and other items), see the Dialectic Online Resources at:
http://www.jonn8.com/dialectic/resources/
The AppleScript Dial Method script must contain the handle_dial_action handler using the following format:
The parameters of the handle_dial_action handler will be passed by Dialectic to your script when a number is dialed and the Dial Method configuration for the detected call type is set to use the AppleScript Dial Method. These parameters are:
- contact_number The number Dialectic was asked to dial as a string, in raw form, exactly as it was asked to dial it.
- contact_name The name of the contact as a string (if unavailable, this will be a blank string).
- call_type The type of call as interpreted by Dialectic: Internal, Local, Long-Distance, etc. as a plain string.
- dial_method The Dial Method used by Dialectic as a string in accordance with the type of call (see previous parameter) and your current Location; this will be “AppleScript Dial Method” (since if it were not, we would not be running this script in the first place!) followed by the name of the specific configuration.
- transformed_number The phone number to dial as a string as transformed by the current Location’s Dialing Rules. For example, if this is an external call and you have specified that Dialectic should dial “9,” to reach an outside line, “9,” will be prefixed to the original contact number as part of the transformed number.
Your script should return true if the call should be considered a success; return false if it should be considered a failure. Optionally, you can return a list of {false, the_error} where the_error is a string detailing why the call failed.