Hello, I would like to run an audio message, using a speech synthesiser on the machine running Asterisk, before an incoming call is heard (rings).
I’m using the following:
exten=>7001,1,GotoIf([ "{DEVICE_STATE(SIP/line1)}" = “NOT_INUSE” ]?dial7001:7002,1)
same=>n(dial7001),System(/home/me/scripts/simple_google_tts en “Call on line 1”)
same=>n,Dial(SIP/line1,20,tT)
exten=>7002,1,GotoIf([ "{DEVICE_STATE(SIP/line2)}" = “NOT_INUSE” ]?dial7002:7003,1)
same=>n(dial7002),System(/home/me/scripts/simple_google_tts pt_BR “Call on line 2”)
same => n,Dial(SIP/line2,20,tT)
etc.
The System command appears to run, ie. there is a pause for the time it takes to say “Call on line 1”, however there is no sound. I’ve tested it with other non-audio scripts and it works.
If in the Asterisk CLI I enter the following, there is sound:
!sudo /home/me/scripts/simple_google_tts en “Call on line 1”
The script and a corresponding script it uses, have privileges set at 755. I’ve also tried setting ownership to asterisk.asterisk.
The Asterisk CLI shows the following when extension is 7001 called and when it is free:
– Executing [7001@outgoing:1] GotoIf(“SIP/sip-myphone-00000000”, “1?dial7001:7002,1”) in new stack
– Goto (outgoing,7001,2)
– Executing [7001@outgoing:2] System(“SIP/sip-myphone-00000000”, "/home/me/scripts/simple_google_tts en “Call on line 1"”) in new stack
– Executing [7001@outgoing:3] Dial(“SIP/sip-myphone-00000000”, “SIP/line1,20,tT”) in new stack
== Using SIP RTP CoS mark 5
– Called SIP/line1
Can anyone please offer any suggestions?
Thanks