挂机后Asterisk / Freepbx / Call不会断开连接

时间:2015-02-16 15:23:14

标签: asterisk voip pbx

当我打电话给主干 - >来自SIP客户端的内部号码和挂断它不会断开线路。似乎BYE被发送到错误的中继线或者它被授权用户名错误。

  

[2015-02-16 15:51:01]公告[3053]:chan_sip.c:22109 handle_response:   无法在BYE上进行身份验证   ';标记= SDdu8i501-snl_004195XX18_NSN_CLIENT'

在第一个主干上它可以工作,但在第二个主干上没有,这是我的conf:

First Trunk:

type=peer
qualify=yes
nat=yes
username=XXXXXXX
host=bX.sXXXXXl.net
secret=XXXXXXXXXX
fromuser=XXXXXXX
fromdomain=XXXXXXX
dtmfmode=info
disallow=all
context=from-internal
canreinvite=yes
canredirect=yes
allow=alaw&ulaw
insecure=very

第二个中继:

type=peer
qualify=yes
nat=yes
username=XXXXXXX
host=bX.sXXXXXl.net
secret=XXXXXXXXXX
fromuser=XXXXXXX
fromdomain=XXXXXXX
dtmfmode=info
disallow=all
context=from-internal
canreinvite=yes
canredirect=yes
allow=alaw&ulaw
insecure=very

一次通话的tcpdump:

root@lix ~ # tcpdump -nqt -s 0 -A -i eth0 port 5060 
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
listening on eth0, link-type EN10MB (Ethernet), capture size 65535 bytes
IP 80.XX.XXX.149.5060 > 84.XXX.XXX.192.5060: UDP, length 1189
E.......y..wP_..T.........".INVITE sip:386XXXXXXXX@84.XXX.XXX.192:5060 SIP/2.0
Via: SIP/2.0/UDP 80.XX.XXX.149:5060;branch=z9hG4bKmrqmnl00a8ohig4vr6g0.1
To: <sip:386XXXXXXXX@bt.xxxxxxxx.net:29040>
From: <sip:040XXX513@bt.xxxxxxxx.net;user=phone;CPC=Ordinary>;tag=SDtl8c501-snl_0041961844_NSN_CLIENT
Call-ID: SDtl8c501-794b0bfaea6e05f8b7ab019950a6b3c5-06a1450
CSeq: 1235 INVITE
Contact: <sip:040XXX513@80.XX.XXX.149:5060;eplid=188.XX.XXX.241:5060;elid=188.XX.XXX.241:5060;evlid=pbx-core:1591;transport=udp>
Accept-Language: en;q=0.0
Allow: REGISTER, INVITE, ACK, BYE, CANCEL, NOTIFY, REFER, UPDATE, PRACK
P-Asserted-Identity: <sip:0038640XXX513@192.168.19.102;user=phone>
Supported: timer
Session-Expires: 360;refresher=uac
Min-SE: 360
Date: Mon, 16 Feb 2015 15:04:52 GMT
Max-Forwards: 67
Content-Type: application/sdp
Content-Length: 363

v=0
o=hiQ9200 4244020150116160452 1181089808 IN IP4 80.95.239.157
s=Phone Call via hiQ9200 SIPCA
c=IN IP4 80.95.239.157
t=0 0
m=audio 54246 RTP/AVP 18 8 0 100
a=rtpmap:18 G729/8000
a=fmtp:18 annexb=no
a=rtpmap:8 PCMA/8000
a=fmtp:8 vad=no
a=rtpmap:0 PCMU/8000
a=fmtp:0 vad=no
a=rtpmap:100 telephone-event/8000
a=fmtp:100 0-15
a=sendrecv
a=ptime:20

IP 80.XX.XXX.149.5060 > 84.XXX.XXX.192.5060: UDP, length 625
E.......y...P_..T........y..ACK sip:386XXXXXXXX@84.XXX.XXX.192:5060 SIP/2.0
Via: SIP/2.0/UDP 80.XX.XXX.149:5060;branch=z9hG4bKtb9h0300c8i1ngckd6g0.1
To: <sip:386XXXXXXXX@bt.xxxxxxxx.net:29040>;tag=as4bbef921
From: <sip:040XXX513@bt.xxxxxxxx.net;user=phone;CPC=Ordinary>;tag=SDtl8c501-snl_0041961844_NSN_CLIENT
Call-ID: SDtl8c501-794b0bfaea6e05f8b7ab019950a6b3c5-06a1450
CSeq: 1235 ACK
Contact: <sip:040XXX513@80.XX.XXX.149:5060;eplid=188.XX.XXX.241:5060;elid=188.XX.XXX.241:5060;evlid=pbx-core:1591;transport=udp>
Allow: REGISTER, INVITE, ACK, BYE, CANCEL, NOTIFY, REFER
Date: Mon, 16 Feb 2015 15:04:55 GMT
Max-Forwards: 67
Content-Length: 0


IP 80.XX.XXX.149.5060 > 84.XXX.XXX.192.5060: UDP, length 509
E.......y...P_..T........./(SIP/2.0 401 Unauthorized
Via: SIP/2.0/UDP 84.XXX.XXX.192:5060;received=146.212.15.165;branch=z9hG4bK77f199c4;rport=49375
From: <sip:386XXXXXXXX@bt.xxxxxxxx.net:29040>;tag=as4bbef921
To: <sip:040XXX513@bt.xxxxxxxx.net;user=phone;CPC=Ordinary>;tag=SDtl8c501-snl_0041961844_NSN_CLIENT
Call-ID: SDtl8c501-794b0bfaea6e05f8b7ab019950a6b3c5-06a1450
CSeq: 102 BYE
WWW-Authenticate: Digest realm="bt.xxxxxxxx.net", nonce="774148580-b3756059388ed16573d45f15fb506022", algorithm=MD5, qop="auth"
Content-Length: 0


IP 80.XX.XXX.149.5060 > 84.XXX.XXX.192.5060: UDP, length 509
E.......y...P_..T.........  3SIP/2.0 401 Unauthorized
Via: SIP/2.0/UDP 84.XXX.XXX.192:5060;received=146.212.15.165;branch=z9hG4bK5a06c3e1;rport=49375
From: <sip:386XXXXXXXX@bt.xxxxxxxx.net:29040>;tag=as4bbef921
To: <sip:040XXX513@bt.xxxxxxxx.net;user=phone;CPC=Ordinary>;tag=SDtl8c501-snl_0041961844_NSN_CLIENT
Call-ID: SDtl8c501-794b0bfaea6e05f8b7ab019950a6b3c5-06a1450
CSeq: 103 BYE
WWW-Authenticate: Digest realm="bt.xxxxxxxx.net", nonce="774148580-b3756059388ed16573d45f15fb506022", algorithm=MD5, qop="auth"
Content-Length: 0


IP 80.XX.XXX.149.5060 > 84.XXX.XXX.192.5060: UDP, length 509
E.......y...P_..T.........  3SIP/2.0 401 Unauthorized
Via: SIP/2.0/UDP 84.XXX.XXX.192:5060;received=146.212.15.165;branch=z9hG4bK5a06c3e1;rport=49375
From: <sip:386XXXXXXXX@bt.xxxxxxxx.net:29040>;tag=as4bbef921
To: <sip:040XXX513@bt.xxxxxxxx.net;user=phone;CPC=Ordinary>;tag=SDtl8c501-snl_0041961844_NSN_CLIENT
Call-ID: SDtl8c501-794b0bfaea6e05f8b7ab019950a6b3c5-06a1450
CSeq: 103 BYE
WWW-Authenticate: Digest realm="bt.xxxxxxxx.net", nonce="774148580-b3756059388ed16573d45f15fb506022", algorithm=MD5, qop="auth"
Content-Length: 0


IP 80.XX.XXX.149.5060 > 84.XXX.XXX.192.5060: UDP, length 509
E.......y...P_..T.........@.SIP/2.0 401 Unauthorized
Via: SIP/2.0/UDP 84.XXX.XXX.192:5060;received=146.212.15.165;branch=z9hG4bK61805162;rport=49375
From: <sip:386XXXXXXXX@bt.xxxxxxxx.net:29040>;tag=as4bbef921
To: <sip:040XXX513@bt.xxxxxxxx.net;user=phone;CPC=Ordinary>;tag=SDtl8c501-snl_0041961844_NSN_CLIENT
Call-ID: SDtl8c501-794b0bfaea6e05f8b7ab019950a6b3c5-06a1450
CSeq: 104 BYE
WWW-Authenticate: Digest realm="bt.xxxxxxxx.net", nonce="774148580-b3756059388ed16573d45f15fb506022", algorithm=MD5, qop="auth"
Content-Length: 0


IP 80.XX.XXX.149.5060 > 84.XXX.XXX.192.5060: UDP, length 509
E.......y...P_..T.........@.SIP/2.0 401 Unauthorized
Via: SIP/2.0/UDP 84.XXX.XXX.192:5060;received=146.212.15.165;branch=z9hG4bK61805162;rport=49375
From: <sip:386XXXXXXXX@bt.xxxxxxxx.net:29040>;tag=as4bbef921
To: <sip:040XXX513@bt.xxxxxxxx.net;user=phone;CPC=Ordinary>;tag=SDtl8c501-snl_0041961844_NSN_CLIENT
Call-ID: SDtl8c501-794b0bfaea6e05f8b7ab019950a6b3c5-06a1450
CSeq: 104 BYE
WWW-Authenticate: Digest realm="bt.xxxxxxxx.net", nonce="774148580-b3756059388ed16573d45f15fb506022", algorithm=MD5, qop="auth"
Content-Length: 0


IP 80.XX.XXX.149.5060 > 84.XXX.XXX.192.5060: UDP, length 509
E.......y...P_..T.........@.SIP/2.0 401 Unauthorized
Via: SIP/2.0/UDP 84.XXX.XXX.192:5060;received=146.212.15.165;branch=z9hG4bK61805162;rport=49375
From: <sip:386XXXXXXXX@bt.xxxxxxxx.net:29040>;tag=as4bbef921
To: <sip:040XXX513@bt.xxxxxxxx.net;user=phone;CPC=Ordinary>;tag=SDtl8c501-snl_0041961844_NSN_CLIENT
Call-ID: SDtl8c501-794b0bfaea6e05f8b7ab019950a6b3c5-06a1450
CSeq: 104 BYE
WWW-Authenticate: Digest realm="bt.xxxxxxxx.net", nonce="774148580-b3756059388ed16573d45f15fb506022", algorithm=MD5, qop="auth"
Content-Length: 0


IP 80.XX.XXX.149.5060 > 84.XXX.XXX.192.5060: UDP, length 509
E.......y...P_..T..........^SIP/2.0 401 Unauthorized
Via: SIP/2.0/UDP 84.XXX.XXX.192:5060;received=146.212.15.165;branch=z9hG4bK3cbc6149;rport=49375
From: <sip:386XXXXXXXX@bt.xxxxxxxx.net:29040>;tag=as4bbef921
To: <sip:040XXX513@bt.xxxxxxxx.net;user=phone;CPC=Ordinary>;tag=SDtl8c501-snl_0041961844_NSN_CLIENT
Call-ID: SDtl8c501-794b0bfaea6e05f8b7ab019950a6b3c5-06a1450
CSeq: 105 BYE
WWW-Authenticate: Digest realm="bt.xxxxxxxx.net", nonce="774148580-b3756059388ed16573d45f15fb506022", algorithm=MD5, qop="auth"
Content-Length: 0


IP 80.XX.XXX.149.5060 > 84.XXX.XXX.192.5060: UDP, length 509
E.......y...P_..T..........^SIP/2.0 401 Unauthorized
Via: SIP/2.0/UDP 84.XXX.XXX.192:5060;received=146.212.15.165;branch=z9hG4bK3cbc6149;rport=49375
From: <sip:386XXXXXXXX@bt.xxxxxxxx.net:29040>;tag=as4bbef921
To: <sip:040XXX513@bt.xxxxxxxx.net;user=phone;CPC=Ordinary>;tag=SDtl8c501-snl_0041961844_NSN_CLIENT
Call-ID: SDtl8c501-794b0bfaea6e05f8b7ab019950a6b3c5-06a1450
CSeq: 105 BYE
WWW-Authenticate: Digest realm="bt.xxxxxxxx.net", nonce="774148580-b3756059388ed16573d45f15fb506022", algorithm=MD5, qop="auth"
Content-Length: 0


IP 80.XX.XXX.149.5060 > 84.XXX.XXX.192.5060: UDP, length 509
E.......y...P_..T..........^SIP/2.0 401 Unauthorized
Via: SIP/2.0/UDP 84.XXX.XXX.192:5060;received=146.212.15.165;branch=z9hG4bK3cbc6149;rport=49375
From: <sip:386XXXXXXXX@bt.xxxxxxxx.net:29040>;tag=as4bbef921
To: <sip:040XXX513@bt.xxxxxxxx.net;user=phone;CPC=Ordinary>;tag=SDtl8c501-snl_0041961844_NSN_CLIENT
Call-ID: SDtl8c501-794b0bfaea6e05f8b7ab019950a6b3c5-06a1450
CSeq: 105 BYE
WWW-Authenticate: Digest realm="bt.xxxxxxxx.net", nonce="774148580-b3756059388ed16573d45f15fb506022", algorithm=MD5, qop="auth"
Content-Length: 0


IP 80.XX.XXX.149.5060 > 84.XXX.XXX.192.5060: UDP, length 363
E.......y...P_..T........s.xSIP/2.0 200 OK
Via: SIP/2.0/UDP 84.XXX.XXX.192:5060;received=146.212.15.165;branch=z9hG4bK07349552;rport=49375
From: <sip:3868330183@bt.xxxxxxxx.net>;tag=as3d51a72f
To: <sip:3868330183@bt.xxxxxxxx.net>;tag=aprq1squpq0-2pase510000s7
Call-ID: 04dbfaef3da62fdd08e43d987d0529a3@84.XXX.XXX.192
CSeq: 126 REGISTER
Contact: <sip:s@84.XXX.XXX.192:5060>;expires=60


IP 80.XX.XXX.149.5060 > 84.XXX.XXX.192.5060: UDP, length 394
E.......y...P_..T..........wSIP/2.0 200 OK
Via: SIP/2.0/UDP 84.XXX.XXX.192:5060;received=146.212.15.165;branch=z9hG4bK4b188443;rport=49375
From: <sip:3868330113@bt.xxxxxxxx.net>;tag=as2c8ec8f0
To: <sip:3868330113@bt.xxxxxxxx.net>;tag=SD7tiv999-
Call-ID: 6014e3525b8dac626c14802659345f7a@84.XXX.XXX.192
CSeq: 126 REGISTER
Contact: <sip:s@84.XXX.XXX.192:5060>;expires=60;audio
Supported: outbound
Content-Length: 0


IP 80.XX.XXX.149.5060 > 84.XXX.XXX.192.5060: UDP, length 531
E../....y.. P_..T..........HBYE sip:386XXXXXXXX@84.XXX.XXX.192:5060 SIP/2.0
Via: SIP/2.0/UDP 80.XX.XXX.149:5060;branch=z9hG4bKtb9h0300c8i1ngckd6g0cd00080a3.1
To: <sip:386XXXXXXXX@bt.xxxxxxxx.net:29040>;tag=as4bbef921
From: <sip:040XXX513@bt.xxxxxxxx.net;user=phone;CPC=Ordinary>;tag=SDtl8c501-snl_0041961844_NSN_CLIENT
Call-ID: SDtl8c501-794b0bfaea6e05f8b7ab019950a6b3c5-06a1450
CSeq: 1236 BYE
Accept-Language: en;q=0.0
Allow: REGISTER, INVITE, ACK, BYE, CANCEL, NOTIFY, REFER
Date: Mon, 16 Feb 2015 15:05:08 GMT
Max-Forwards: 67
Content-Length: 0

1 个答案:

答案 0 :(得分:0)

BYE消息验证不是很难使用扩展(实际上它不需要,因为BYE总是有会话ID和ip / port一样)。

星号中没有这样的功能,因为那时几乎没有任何软交换或设备实现。

片刻之后,BYE auth被添加到asterisk chan_sip作为补丁。但由于架构中不支持所需的结构交叉引用,因此它已被开发为对等列表中的查找(使用默认的auth过程)。

星号的验证程序是:星号选择具有相同IP /端口组合的第一部分。所以它选择第一个主干

没有主要的chan_sip重写,你无法解决这个问题。如果重要的话,你可以试着用pjsip使用现代版本。