Posted to tcl by gloin at Tue Jul 13 18:31:37 GMT 2010view raw
- 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 $?t {
- "AppData: custom/thankyou" {
- exit 0
- }
- "AppData: goodbye" {
- exit 1
- }
- }
- '
-