sip.conf文件中设置参数
allowoverlap= yes
,没有此参数默认也是yes。
这样asterisk便支持early dial了。
话机拨打若干个号码,如拨打一个号码5,发送SIP INVITE包到asterisk,asterisk收到包后,
进行分析。
如下
<------------->
--- (17 headers 16 lines) ---
Sending to
192.168.122.155:5060 (no NAT)
Using INVITE request as basis request - 2069677588-5060-469@BJC.BGI.
BCC.BFF
Found peer '3805' for '3805' from
192.168.122.155:5060
== Using SIP RTP CoS mark 5
Found RTP audio format 0
Found RTP audio format 101
Found audio description format PCMU for ID 0
Found audio description format telephone-event for ID 101
Found RTP video format 99
Found video description format H264 for ID 99
Capabilities: us - 0xe (gsm|ulaw|alaw), peer - audio=0x4 (ulaw)/video=0x200000 (h264)/text=0x0 (nothing), combined - 0x4 (ulaw)
Non-codec capabilities (dtmf): us - 0x1 (telephone-event|), peer - 0x1 (telephone-event|), combined - 0x1 (telephone-event|)
Peer audio RTP is at port
192.168.122.155:55450
Looking for 5 in from-internal (domain 192.168.122.38)
<--- Reliably Transmitting (no NAT) to
192.168.122.155:5060 --->
SIP/2.0 484 Address Incomplete
Via: SIP/2.0/UDP 192.168.122.155:5060;branch=
z9hG4bK755996444;received=192.
168.122.155;rport=5060
From: "3805" <
sip:3805@192.168.122.38>;tag=
1452114578
To: <
sip:5@192.168.122.38>;tag=
as0328ad0b
Call-ID: 2069677588-5060-469@BJC.BGI.
BCC.BFF
CSeq: 4681 INVITE
Server: Asterisk PBX 1.8.7.1
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH
Supported: replaces, timer
Content-Length: 0
<------------>
asterisk在指定的context中进行遍历查询是否存在
潜在的匹配规则(没有限制号码的长度),
比如这里的context是freepbx定义的from-
internal,这个context可以任意定义。如果存在,
发送484 给源地址,等待源继续发送号码,直到匹配到唯一的拨号规则后,
进入到拨号规则中去一一执行;否认发送404,not found。