成功使得mgcp网关注册到asterisk,mgcp网关为Voipack公司的VOG4000
修改 /etc/asterisk/mgcp.conf,内容如下:
; MGCP Configuration for Asterisk
;
[general]
;port = 2427
;bindaddr = 0.0.0.0
;[dlinkgw]
;host = 192.168.0.64
;context = default
;canreinvite = no
;line => aaln/2
;line => aaln/1
;; The MGCP channel supports the following service codes:
;; # - Transfer
;; *67 - Calling Number Delivery Blocking
;; *70 - Cancel Call Waiting
;; *72 - Call Forwarding Activation
;
; MGCP Configuration for Asterisk
;
[general]
;port = 2427
;bindaddr = 0.0.0.0
;[dlinkgw]
;host = 192.168.0.64
;context = default
;canreinvite = no
;line => aaln/2
;line => aaln/1
;; The MGCP channel supports the following service codes:
;; # - Transfer
;; *67 - Calling Number Delivery Blocking
;; *70 - Cancel Call Waiting
;; *72 - Call Forwarding Activation
;; *73 - Call Forwarding Deactivation
;; *78 - Do Not Disturb Activation
;; *79 - Do Not Disturb Deactivation
;; *8 - Call pick-up
;
; known to work with Swissvoice IP10s
;[192.168.1.20]
;context=local
;host=192.168.1.20
;callerid = "John Doe" <123>
;callgroup=0 ; in the range from 0 to 63
;pickupgroup=0 ; in the range from 0 to 63
;nat=no
;threewaycalling=yes
;transfer=yes ; transfer requires threewaycalling=yes. Use FLASH to transfer
;callwaiting=yes ; this might be a cause of trouble for ip10s
;cancallforward=yes
;line => aaln/1
;
;[dph100]
;
; Supporting the DPH100M requires defining DLINK_BUGGY_FIRMWARE in
; chan_mgcp.c in addition to enabling the slowsequence mode due to
; bugs in the D-Link firmware
;
;context=local
;host=dynamic
;dtmfmode=none ; DTMF Mode can be 'none', 'rfc2833', or 'inband' or
; 'hybrid' which starts in none and moves to inband. Default is none.
;slowsequence=yes ; The DPH100M does not follow MGCP standards for sequencing
;line => aaln/1
; known to work with wave7optics FTTH LMGs
;[192.168.1.20]
;accountcode = 1000 ; record this in cdr as account identification for billing
;amaflags = billing ; record this in cdr as flagged for 'billing', 'documentation', or 'omit'
;context = local
;host = 192.168.1.20
;wcardep = aaln/* ; enables wildcard endpoint and sets it to 'aaln/*' another common format is '*'
;callerid = "Duane Cox" <123> ; now lets setup line 1 using per endpoint configuration...
;callwaiting = no
;callreturn = yes
;cancallforward = yes
;canreinvite = no
;transfer = no
;dtmfmode = inband
;line => aaln/1 ; now lets save this config to line1 aka aaln/1
;callerid = "Duane Cox" <456> ; now lets setup line 2
;callwaiting = no
;callreturn = yes
;cancallforward = yes
;canreinvite = no
;transfer = no
;dtmfmode = inband
;line => aaln/2 ; now lets save this config to line2 aka aaln/2
[0040cb210184]
context=ext-local
host=dynamic
dtmfmode=rfc2833
line => aaln/1
callwaiting=yes
cancallforward=yes
canreinvite=no
transfer=yes
line => aaln/2
line => aaln/3
line => aaln/4
终端注册方式
Voipack>caAddrSet "192.168.0.108" (asterisk IP address)
Voipack>dbgcmd
MXP>show xgcp
MXP>show xgcp
xGCP General Configuration:
Our RGW Name : 0040cb210184
Primary DNS IP addr : 211.167.97.67 (enabled)
Secondary DNS IP addr : (disabled)
Sig TOS: 0
1:注意红色字体
2:如果你有两个口,那么就
line => aaln/1
line => aaln/2
很简单就可以注册了。摘机后的debug消息
MXP>spy xgcp 2
MXP>0100815602 - local hook callback, tcid=0, off_hook = 1
0100815602 - mgcpev: event 33 on tcid 0 has arrived(conn_id=0)
0100815603 - sending(PB)[len=63][addr=192.168.0.108][port=2727] NTFY 387 MGCP 1.0 NCS 1.0
X:464fcd9c
O: hd
0100815607 - XGCP CAIF: recvd msg from 192.168.0.108:aa7,msg=
0100815607 - the msg have 1 lines and send lenth is 12
0100815607 - msgline[0]=200 387 OK
0100815607 - XGCP CAIF: recvd msg from 192.168.0.108:aa7,msg=
0100815608 - the msg have 13 lines and send lenth is 237
0100815608 - msgline[0]=CRCX 10 MGCP 1.0
0100815608 - msgline[1]=C: 61fe6a3122a4ee30
0100815608 - msgline[2]=L: p:20, a:PCMU
0100815608 - msgline[3]=M: sendrecv
0100815609 - msgline[4]=X: 22a4ee30
0100815609 - msgline[5]=
0100815609 - msgline[6]=v=0
0100815609 - msgline[7]=o=root 4707 4707 IN IP4 192.168.0.108
0100815609 - msgline[8]=s=session
0100815609 - msgline[9]=c=IN IP4 192.168.0.108
0100815609 - msgline[10]=t=0 0
0100815610 - msgline[11]=m=audio 18948 RTP/AVP 0
0100815610 - msgline[12]=a=rtpmap:0 PCMU/8000
0100815610 - XGCP CAIF: recvd msg from 192.168.0.108:aa7,msg=
0100815610 - the msg have 4 lines and send lenth is 93
0100815611 - msgline[0]=RQNT 11 MGCP 1.0
0100815611 - msgline[1]=X: 464fcd9c
0100815611 - msgline[2]=R: L/hu(N),L/hf(N),D/[0-9#*](N)
0100815611 - msgline[3]=S: L/dl
0100815612 - parsing msg @ 362d64, len=25
0100815612 - parsing msg @ 36cb94, len=298
0100815613 - XGCP parse SDP - rtpmap fmt 0 (pcmu) mapped to telogy type 9
0100815614 - RTPMAN: assigning RTP port 40000 for connection
0100815614 - tcid 0, free dsp channel
0100815640 - tcid 0 dsp coding operation done
0100815641 - tcid 0 loading dsp[codec=9 vif=1280 md=40]
0100815651 - tcid 0 dsp coding operation done
0100815652 - tcid 0, enable voice
0100815653 - XGCPIF: set dtmf to host OFF
0100815653 - xgcp CMU: adjust connectivity mode =0=> 3,endpoint tcid=0, leg = 0
0100815653 - rtpman: configuring an RTP port for tcid 0
0100815655 - tcid 0, audio mode = 3
0100815656 - sending(PB)[len=140][addr=192.168.0.108][port=2727] 200 10 OK
I:9
v=0
o=aaln/0 9 0 IN IP4 192.168.0.252
s=phonecall
c=IN IP4 192.168.0.252
t=0 0
a=sendrecv
m=audio 40000 RTP/AVP 0
a=ptime:20
0100815657 - tcid 0. no request events??
0100815658 - parsing msg @ 36c794, len=118
0100815660 - XGCPIF: set dtmf to host ON
0100815660 - tcid0 tone30 param=
0100815661 - sending(PB)[len=10][addr=192.168.0.108][port=2727] 200 11 OK
MXP>
MXP>
MXP>
MXP>
MXP>
MXP>
MXP>
MXP>
MXP>
MXP>
MXP>
MXP>
MXP>
MXP>
MXP>
MXP>
MXP>
MXP>
MXP>
MXP>
MXP>
MXP>
MXP>
MXP>
MXP>
MXP>
MXP>
MXP>
MXP>
MXP>
MXP>
MXP>
MXP>
MXP>
MXP>
MXP>
MXP>
MXP>
MXP>
MXP>
MXP>
下面的是挂机消息。
MXP>0100819637 - local hook callback, tcid=0, off_hook = 0
0100819638 - mgcpev: event 35 on tcid 0 has arrived(conn_id=0)
0100819638 - tcid0 stop tone30
0100819639 - sending(PB)[len=63][addr=192.168.0.108][port=2727] NTFY 388 MGCP 1.0 NCS 1.0
X:464fcd9c
O: hu
0100819641 - XGCP CAIF: recvd msg from 192.168.0.108:aa7,msg=
0100819641 - the msg have 1 lines and send lenth is 12
0100819641 - msgline[0]=200 388 OK
0100819642 - XGCP CAIF: recvd msg from 192.168.0.108:aa7,msg=
0100819642 - the msg have 4 lines and send lenth is 78
0100819642 - msgline[0]=DLCX 12 MGCP 1.0
0100819642 - msgline[1]=C: 61fe6a3122a4ee30
0100819643 - msgline[2]=X: 22a4ee30
0100819643 - msgline[3]=I: 9
0100819643 - XGCP CAIF: recvd msg from 192.168.0.108:aa7,msg=
0100819643 - the msg have 3 lines and send lenth is 63
0100819643 - msgline[0]=RQNT 13 MGCP 1.0
0100819644 - msgline[1]=X: 464fcd9c
0100819644 - msgline[2]=R: L/hd(N)
0100819645 - parsing msg @ 362c24, len=25
0100819645 - parsing msg @ 3659dc, len=103
0100819647 - xgcp CMU: adjust connectivity mode =3=> 5,endpoint tcid=0, leg = 0
0100819648 - XGCPCMU: sendrec->confloop4, i=0, legid=0, Mode=3
0100819648 - XGCPCMU: sendrec->confloop4, i=1, legid=0, Mode=0
0100819649 - tcid 0, free dsp channel
0100819676 - tcid 0 dsp coding operation done
0100819677 - rtpman: freeing RTP port
0100819677 - clean rtp voice port on tcid 0
0100819679 - sending(PB)[len=54][addr=192.168.0.108][port=2727] 250 12 OK
P: PS=383,OS=65876,PR=0,OR=0,PL=0,JI=0,LA=0
0100819680 - tcid 0. no request events??
0100819680 - parsing msg @ 365a5c, len=84
0100819682 - sending(PB)[len=10][addr=192.168.0.108][port=2727] 200 13 OK
0100819684 - XGCP CAIF: recvd msg from 192.168.0.108:aa7,msg=
0100819684 - the msg have 4 lines and send lenth is 77
0100819684 - msgline[0]=RQNT 14 MGCP 1.0
0100819684 - msgline[1]=X: 464fcd9c
0100819684 - msgline[2]=R: L/hd(N)
0100819685 - msgline[3]=S: L/vmwi(-)
0100819685 - mgcpev: event 122 on tcid 0 has arrived(conn_id=0)
0100819685 - mgcpev: event 122 on tcid 1 has arrived(conn_id=0)
0100819685 - mgcpev: event 122 on tcid 2 has arrived(conn_id=0)
0100819685 - mgcpev: event 122 on tcid 3 has arrived(conn_id=0)
0100819686 - parsing msg @ 365a5c, len=102
0100819687 - XGCPIF: tcid 0 loading dsp
0100819698 - tcid 0 dsp coding operation done
0100819699 - tcid 0, enable voice
0100819699 - XGCPIF: set dtmf to host OFF
0100819700 - **TCID 0 MESSAGE WAITING OFF** hook=on
0100819700 - sending(PB)[len=10][addr=192.168.0.108][port=2727] 200 14 OK
0100820011 - tcid 0, VBD generation done, res - 0
下回我来讲讲如何mgcp与SIP互通。