Posted to tcl by gloin at Tue Jul 13 18:35:14 GMT 2010view raw
- function MAKECALL ()
- {
- expect -c '
- set timeout -1
- spawn telnet localhost 5038
- expect "Asterisk Call Manager/1.1"
-
- send "Action: login\r"
- send "Username: admin\r"
- send "Secret: 1Pass1\r"
- send "\r"
- expect "Message: Authentication accepted"
-
- send "Action: Originate\r"
- send "Channel: SIP/ShoreTel/'${PHONENUMBER[$count]}'\r"
- send "Variable: Data='$PROBLEM'\r"
- send "Variable: CalledNumber='${PHONENUMBER[$count]}'\r"
- send "Context: alertcall\r"
- send "Priority: 1\r"
- send "\r"
-
- expeo $? expect -c '
- set timeout -1
- spawn telnet localhost 5038
- expect "Asterisk Call Manager/1.1"
-
- send "Action: login\r"
- send "Username: admin\r"
- send "Secret: 1Pass1\r"
- send "\r"
- expect "Message: Authentication accepted"
-
- send "Action: Originate\r"
- send "Channel: SIP/ShoreTel/'${PHONENUMBER[$count]}'\r"
- send "Variable: Data='$PROBLEM'\r"
- send "Variable: CalledNumber='${PHONENUMBER[$count]}'\r"
- send "Context: alertcall\r"
- send "Priority: 1\r"
- send "\r"
-
- expect {
- "AppData: custom/thankyou" {
- exit 0
- }
- "AppData: goodbye" {
- exit 1
- }
- }
- '
- }
-
- MAKECALL
-
- echo $?
-
Comments
Posted by gloin at Tue Jul 13 18:39:58 GMT 2010 [text] [code]
Imagine lines 21-39 don't exist, sigh.