考虑以下星号拨号计划。播放完最后一个声音文件后,它会立即挂起,waittexte timeout参数似乎被忽略了。我试图实现的行为是在最后一个声音文件完成后等待给定的秒数以获得响应,然后挂断。最后一个声音文件显示"拨号*以再次听到这些选项"。如果我将waittexte超时设置为60,它将在播放声音文件之前挂断。更短的时间可以让它们全部播放,但随后它立即挂断。欢迎提出任何更好的处理建议
[mainmenu]
exten => s,1,Wait(0.25)
same => 2,Answer()
same => 3,Background(/srv/asterisk/sounds/optionslist)
same => n,Background(/srv/asterisk/sounds/dial2cs)
same => n,Background(/srv/asterisk/sounds/dial3ma)
same => n,Background(/srv/asterisk/sounds/dial4ac)
same => n,Background(/srv/asterisk/sounds/dial0)
same => n,Background(/srv/asterisk/sounds/dialstar)
same => n,WaitExten(20)
exten => 2,1,Goto(cs,2,1)
exten => *,1,Goto(s,3)
控制台输出
== Using SIP RTP CoS mark 5
-- Executing [+12345@public:1] Goto("SIP/xxx.pstn.twilio.com-00000044", "mainmenu,s,1") in new stack
-- Goto (mainmenu,s,1)
-- Executing [s@mainmenu:1] Wait("SIP/xxx.pstn.twilio.com-00000044", "0.25") in new stack
-- Executing [s@mainmenu:4] BackGround("SIP/xxx.pstn.twilio.com-00000044", "/srv/asterisk/sounds/dial2cs") in new stack
-- Executing [s@mainmenu:5] BackGround("SIP/xxx.pstn.twilio.com-00000044", "/srv/asterisk/sounds/dial3ma") in new stack
-- <SIP/xxx.pstn.twilio.com-00000044> Playing '/srv/asterisk/sounds/dial3ma.slin' (language 'en')
-- Executing [s@mainmenu:6] BackGround("SIP/xxx.pstn.twilio.com-00000044", "/srv/asterisk/sounds/dial4ac") in new stack
-- <SIP/xxx.pstn.twilio.com-00000044> Playing '/srv/asterisk/sounds/dial4ac.slin' (language 'en')
-- Executing [s@mainmenu:7] BackGround("SIP/xxx.pstn.twilio.com-00000044", "/srv/asterisk/sounds/dial0") in new stack
-- <SIP/xxx.pstn.twilio.com-00000044> Playing '/srv/asterisk/sounds/dial0.slin' (language 'en')
-- Executing [s@mainmenu:8] BackGround("SIP/xxx.pstn.twilio.com-00000044", "/srv/asterisk/sounds/dialstar") in new stack
-- <SIP/xxx.pstn.twilio.com-00000044> Playing '/srv/asterisk/sounds/dialstar.slin' (language 'en')
[
[Aug 4 05:03:28] WARNING[2225]: chan_sip.c:4175 retrans_pkt: Retransmission timeout reached on transmission xxx@0.0.0.0 for seqno 5305 (Critical Response) -- See https://wiki.asterisk.org/wiki/display/AST/SIP+Retransmissions
Packet timed out after 32001ms with no response
[Aug 4 05:03:28] WARNING[2225]: chan_sip.c:4204 retrans_pkt: Hanging up call xxx@0.0.0.0 - no reply to our critical packet (see https://wiki.asterisk.org/wiki/display/AST/SIP+Retransmissions).
== Spawn extension (mainmenu, s, 8) exited non-zero on 'SIP/xxx.pstn.twilio.com-00000044'
Asterisk 11.7.0~dfsg-1ubuntu1
我认为您遇到了类似于本主题Asterisk中的问题,SIP重新传输超时。尝试解决NAT设置或防火墙的问题。
在这个答案中,建议在sip.conf
中设置canreinvite=no
。