Hello,
I tried to use expect to catch information from my nagios and send me a call but i have nothing when i execute the script :
0 - add : account SIP
1 - trext : information from nagios
text2wav : conversion text to wav ( text to speech )
pjsua : connection thru the SIP
#!/usr/bin/expect --
set timeout 45
set addr [lindex $argv 0]
set text [lindex $argv 1]
send "$text\n";
expect /usr/bin/text2wave -o phone-call.wav -eval "(voice_nitech_us_rms_arctic_hts)"
spawn /usr/bin/pjsua --app-log-level=3 --config-file /etc/pjsuarc --play-file phone-call.wav --auto-play --null-audio --max-calls 1 sip:$addr
expect {
"DISCONNCTD" {
exit
}
timeout {
send "h\n"
exit
}
eof {
exit
}
}
But when i execute the script i have no follow :
]# ./phone-call.sh 000000000@SIPACCOUNT.com coucou
coucou
need help
---------- Post updated at 02:35 PM ---------- Previous update was at 12:35 PM ----------
i found the issue ...
exec /bin/echo $text | /usr/bin/text2wave -o /tmp/phone-call.wav -eval "(voice_nitech_us_rms_arctic_hts)"
thx myself ;D