Asterisk:通话文件和实时
由于我使用的是实时,因此调用文件似乎无法正常工作。当执行呼叫文件时,电话会按预期响铃。但 asterisk (v 1.6) 在接听电话后立即挂断。
我的通话文件:
Channel: SIP/1
Callerid: <123>
Context: test
Extension: 100
我的实时扩展:
cont|ext|pr|App
----+---+-+---------
test|100|1|Answer
----+---+-+---------
test|100|2|SayNumber(123)
cli 上的错误消息:
Channel 'SIP/1-0000001' sent into invalid extension 's' in context 'default', but no invalid handler
当我将上表中的扩展名从“100”更改为有线时, ”到“s”一切正常。
有人有提示吗?
更新:
不幸的是,mv
命令也不能解决问题。 (我还在我的调用文件 Priority: 1
中添加了另一行。)
以下是文件:
extconfig.conf
sipusers => mysql,general,sip_users
sippeers => mysql,general,sip_users
extensions => mysql,general,extensions
sip.conf
[general]
language=en
bindport=5060
context=default
canreinvite=no
tos=throughput
nat=yes
Since I'm using Realtime it seems that callfiles don't work properly. As a callfile is executed the phone rings as expected. But asterisk (v 1.6) hang up immediately as the call is answered.
My callfile:
Channel: SIP/1
Callerid: <123>
Context: test
Extension: 100
My Realtime-Extensions:
cont|ext|pr|App
----+---+-+---------
test|100|1|Answer
----+---+-+---------
test|100|2|SayNumber(123)
Error message on the cli:
Channel 'SIP/1-0000001' sent into invalid extension 's' in context 'default', but no invalid handler
It's wired that as I change the extension in the table above from "100" to "s" everything works fine.
Does anybody have a hint?
Update:
Unfortunately also the mv
command does not solve the problem. (I also added a further line to my callfile Priority: 1
.)
Here are the files:
extconfig.conf
sipusers => mysql,general,sip_users
sippeers => mysql,general,sip_users
extensions => mysql,general,extensions
sip.conf
[general]
language=en
bindport=5060
context=default
canreinvite=no
tos=throughput
nat=yes
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
好吧,我不熟悉实时,但是发布生成的 sip.conf 和 extensions.conf 会很有帮助(至少是相关部分)。
不过,我的第一直觉是您使用 cp 复制 asterisk 的调用文件,这不是原子操作(文件是逐行复制的),这可能导致 asterisk 执行不完全完整的调用文件。
使用 mv 命令,这是一个原子操作,并且将确保 asterisk 操作在 100% 完整的调用文件上。
我怀疑这是问题的原因是您的调用文件是正确的,但如果它开始只执行 2 行,默认情况下任何传入调用都将转到默认上下文的 's' 扩展名,并且如果它读取到第三行,它将转到测试上下文的 's' 扩展名。
可以肯定的是,这是一个奇怪的错误。
Well, I'm not familiar with Realtime, but a posting of the generated sip.conf and extensions.conf would be helpful (at least the relevant sections).
My first instinct though is that you're using cp to copy the call files for asterisk, which is not an atomic operation (files are copied line by line), which can lead to asterisk executing a not-quite-complete call file.
Use the mv command, which is an atomic operation, and will ensure that asterisk is operating on a 100% complete call file.
The reason I suspect this is the issue is that your call file is correct, but if it starts executing with only 2 lines, by default any incoming call will go to the 's' extension of the default context, and if it reads to the third line, it will go to the 's' extension of your test context.
Weird error to be sure.