Asterisk manager Example: Applescript
Asterisk Manager Example: Applescript
Dialing the Phone from OS X Addressbook using Applescript only!!(Well "Expect" too but that's part of the OS so we won't worry too much about that!)
copy the code below into applescript and then save it into ~/Library/Address Book Plug-Ins/ you'll have to modify some of the vars in the script to match your env and yes I could have put them in a prefs file but.. I didn't so sue me! :p
using terms from application "Address Book"
on action property
end action property
on action title for p with e
return "Dial with VOIPv2"
end action title
on should enable action for p with e
if value of e is missing value then
end should enable action
on perform action for p with e
set telephone to value of e
set resultList to DialOut(telephone)
end perform action
end using terms from
set mynumber to 2000
set callerid to telephone
set username to "zed"
set passwd to "nottelling"
set remotehost to "pbxint"
set context to "inside"
set expectscript to "set timeout 20;
spawn telnet " & remotehost & " 5038;
expect \"Asterisk Call Manager/1.0\";
send \"Action: login
username: " & username & "
secret: " & passwd & "
expect \"Message: Authentication accepted\";
send \"Action: originate
Exten: " & telephone & "
Context: " & context &"
Channel: SIP/" & mynumber & "
Callerid: " & callerid & "
send \"Action: logoff
set results to do shell script "usr/bin/expect -c '" & expectscript & "'"
-- if (results is not equal to "") then display dialog results
Created by: flobi, Last modification: Thu 25 of Aug, 2005 (14:18 UTC)
Please update this page with new information, just login and click on the "Edit" or "Discussion" tab. Get a free login here: Register Thanks! - Find us on Google+