星号 – 来自SIP DID中继线的呼入“被拒绝,因为没有find分机”

我有一个DID与DIDforSale指向我的星号服务器。 当我从我的固定电话拨打电话时,我收到AT&T断开线路录音。 Asterisk CLI显示错误消息:

[Oct 6 17:03:00] NOTICE[10563]: chan_sip.c:20163 handle_request_invite: Call from 'didforsale_1' to extension '###########' rejected because extension not found. 

“from”部分表示它正确匹配sip.conf对等项。 “to”部分显示对方正确发送DID号码作为目标分机。 DID号码是对方传入上下文中的有效扩展名(详情如下),所以我只能假定Asterisk正在查看错误的上下文。

组态

我在运行Ubuntu Server 10.04(lucid)的物理服务器上使用通过Apt安装的Asterisk 1.6.2.5-0ubuntu1.4。 我有一个configuration在sip.conf的主干每个始发IP一个对等(有两个)。 这些是相关的节:

 [didforsale_base](!) type=peer context=from-did nat=no insecure=port,invite ; configure codecs disallow=all allow=ulaw allow=alaw allow=g729 dtmfmode=rfc2833 [didforsale_1](didforsale_base) host=AAA.AAA.AAA.AAA [didforsale_2](didforsale_base) host=BBB.BBB.BBB.BBB 

对等体被configuration为将呼叫发送到包含每个DID号码的扩展的from-did上下文。 上下文在extensions.aelconfiguration如下:

 // starting context for calls originating from DID trunks // the call is matched on the DID number and routed appropriately context from-did { // test DID from DIDforSale ########### => jump s@inbound; } 

debugging输出

使用core set verbose 5core set debug 5 ,并且除了SIP数据包转储之外,只在其他CLI输出sip set debug on SIP:

  == Using SIP RTP CoS mark 5 Sending to AAA.AAA.AAA.AAA : 5060 (no NAT) Using INVITE request as basis request - [email protected] Found peer 'didforsale_1' for '+###########' from AAA.AAA.AAA.AAA:5060 Found RTP audio format 18 Found RTP audio format 0 Found RTP audio format 101 Found audio description format G729 for ID 18 Found audio description format PCMU for ID 0 Found audio description format telephone-event for ID 101 Capabilities: us - 0x10c (ulaw|alaw|g729), peer - audio=0x104 (ulaw|g729)/video=0x0 (nothing)/text=0x0 (nothing), combined - 0x104 (ulaw|g729) Non-codec capabilities (dtmf): us - 0x1 (telephone-event), peer - 0x1 (telephone-event), combined - 0x1 (telephone-event) Peer audio RTP is at port CCC.CCC.CCC.CCC:5432 

事前故障排除

我已经使用sip show peer didforsale_1validation了sip show peer didforsale_1正在使用正确的上下文。 dialplan show from-did表示正确parsing了上下文。 如果我将它包含在我的台式电话的默认环境中,则按照预期,呼叫DID号码将为我提供IVR菜单。

我在错误消息的几个search条件中阅读了Googlesearch结果的前几页,但没有find任何有用的信息。 大多数人使用FreePBX或类似的产品,需要帮助,在GUI中设置相当于我的from-did上下文。 几个post看起来像他们可能是同样的问题,但他们都没有答案。 我会张贴链接,但我的声誉太低。 一旦它足够高,我会编辑添加它们。

我最终从错误消息中提到的handle_request_invite读取了handle_request_invite函数的源代码。 该函数调用get_destination (在同一个文件中)来parsing目标地址。 如果get_destination返回一个错误,它会产生我所看到的错误信息。

来自DID提供商的传入SIP INVITE请求中的URI的域被设置为我的PBX的IP地址,而不是其域。 我allowexternaldomainsallowexternaldomains禁用sip.conf ,我的IP不在域列表中,所以目标地址被拒绝。 看看get_destination的源代码,它看起来应该在debugging级别1产生一个错误消息,然后返回错误,但由于某种原因,我没有看到它。

将我的IP地址添加到域列表似乎已经解决了这个问题。

我现在所看到的隐藏的数字是数字和数字之间的区别。

最简单的testing,看看是否是这个问题会是这样的:

 // starting context for calls originating from DID trunks // the call is matched on the DID number and routed appropriately context from-did { // test DID from DIDforSale ########### => jump s@inbound; +########### => jump s@inbound; } 

或“我错过了什么”选项日志logging:

 // starting context for calls originating from DID trunks // the call is matched on the DID number and routed appropriately context from-did { // test DID from DIDforSale _.+ => NoOp(debug incoming exten = ${EXTEN}) _.+ => jump s@inbound; } 

这会将实际的扩展logging到您的控制台。 使用_。+是皱眉(因为它符合一切),并会给你一个警告。

+来自国际电联发布国际电话号码的标准。 不同的SIP提供商将有不同的方式来处理这个问题。 但是,提到美国AT&T(一家美国公司)并使用10号号码表示这个问题的核心问题,就是美国常用的长途拨号符号:1-NNN- YYY-ZZZZ和国际电联国际注释+ 1-NNN-YYY-ZZZZ。