Код: Выделить всё
#!/usr/bin/expect
set timeout -1
spawn telnet 127.0.0.1 8021
expect "Content-Type: auth/request"
send "auth ClueCon\r\r"
expect "Reply-Text: +OK accepted\r"
# myevents plain <uuid>
# myevents json <uuid>
# myevents xml <uuid>
#send "events plain all\r\r"
#event plain ALL
#event plain CHANNEL_CREATE CHANNEL_DESTROY CUSTOM conference::maintenance sofia::register sofia::expire
#event xml ALL
#event json CHANNEL_ANSWER
#event plain DTMF
#event plain CHANNEL_ANSWER
send "event plain ALL\r\r"
#send "filter Event-Name CALL_UPDATE\r\r"
#send "event plain CHANNEL_ANSWER\r\r"
#send "event plain CUSTOM sofia::register\r\r"
#send "filter Event-Name CHANNEL_EXECUTE\r\r"
expect eof