Asterisk / Freepbx / Call doesn't disconnects after hangup

cky

When i call to trunk -> internal number and hangup from SIP client it doesn't disconnect the line. It seems that BYE is sent to wrong trunk or it is authorized with wrong username.

[2015-02-16 15:51:01] NOTICE[3053]: chan_sip.c:22109 handle_response: Failed to authenticate on BYE to ';tag=SDdu8i501-snl_004195XX18_NSN_CLIENT'

On first trunk it works but on the second it doesn't, this is my 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

Second 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

tcpdump of one call:

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:[email protected]:5060 SIP/2.0
Via: SIP/2.0/UDP 80.XX.XXX.149:5060;branch=z9hG4bKmrqmnl00a8ohig4vr6g0.1
To: <sip:[email protected]:29040>
From: <sip:[email protected];user=phone;CPC=Ordinary>;tag=SDtl8c501-snl_0041961844_NSN_CLIENT
Call-ID: SDtl8c501-794b0bfaea6e05f8b7ab019950a6b3c5-06a1450
CSeq: 1235 INVITE
Contact: <sip:[email protected]: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:[email protected];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:[email protected]:5060 SIP/2.0
Via: SIP/2.0/UDP 80.XX.XXX.149:5060;branch=z9hG4bKtb9h0300c8i1ngckd6g0.1
To: <sip:[email protected]:29040>;tag=as4bbef921
From: <sip:[email protected];user=phone;CPC=Ordinary>;tag=SDtl8c501-snl_0041961844_NSN_CLIENT
Call-ID: SDtl8c501-794b0bfaea6e05f8b7ab019950a6b3c5-06a1450
CSeq: 1235 ACK
Contact: <sip:[email protected]: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:[email protected]:29040>;tag=as4bbef921
To: <sip:[email protected];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:[email protected]:29040>;tag=as4bbef921
To: <sip:[email protected];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:[email protected]:29040>;tag=as4bbef921
To: <sip:[email protected];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
[email protected]/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:[email protected]:29040>;tag=as4bbef921
To: <sip:[email protected];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
[email protected]/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:[email protected]:29040>;tag=as4bbef921
To: <sip:[email protected];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
[email protected]/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:[email protected]:29040>;tag=as4bbef921
To: <sip:[email protected];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:[email protected]:29040>;tag=as4bbef921
To: <sip:[email protected];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:[email protected]:29040>;tag=as4bbef921
To: <sip:[email protected];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:[email protected]:29040>;tag=as4bbef921
To: <sip:[email protected];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:[email protected]>;tag=as3d51a72f
To: <sip:[email protected]>;tag=aprq1squpq0-2pase510000s7
Call-ID: [email protected]
CSeq: 126 REGISTER
Contact: <sip:[email protected]: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:[email protected]>;tag=as2c8ec8f0
To: <sip:[email protected]>;tag=SD7tiv999-
Call-ID: [email protected]
CSeq: 126 REGISTER
Contact: <sip:[email protected]: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:[email protected]:5060 SIP/2.0
Via: SIP/2.0/UDP 80.XX.XXX.149:5060;branch=z9hG4bKtb9h0300c8i1ngckd6g0cd00080a3.1
To: <sip:[email protected]:29040>;tag=as4bbef921
From: <sip:[email protected];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
arheops

BYE message authentification is not very hardly used extension(actually it not needed, becuase BYE always have session id and ip/port same as before).

There was no such feature in asterisk, becuase on that time almost no softswitches or devices have that implemented.

After some moment BYE auth was added to asterisk chan_sip as patch. But since there was no support for needed structure cross-reference in architecture,it have been developed as lookup in peer list(default auth procedure used).

Auth procedure for asterisk is: asterisk select first section with same ip/port combination. So it select first trunk

You have no way fix that without major chan_sip rewrite. You can try use modern version with pjsip if that vital.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

Asterisk playback after hangup

From Dev

Two hangup events in one call hangup in asterisk call

From Dev

Asterisk Call Manager hangup event on Python

From Dev

Programming Asterisk IVR inside freepbx problem continuing the program when clerk hangup

From Dev

Freepbx can't connect to asterisk wrong password

From Dev

send a specific DTMF phone as soon as hangup the call on asterisk

From Dev

How do I make a Twilio call hangup if my app doesn't get a valid response from the call recipient

From Dev

Calling a PHP script using FreePBX and Asterisk

From Dev

Javascript doesn't work after call a function

From Dev

Asterisk call drop after 30 seconds

From Dev

Asterisk : automatically answer call after originate

From Dev

Asterisk change callerid after consultation call

From Dev

Asterisk ringgroup get call after registration

From Dev

After an AJAX call, the next AJAX call doesn't work

From Dev

Twilio Hangup: charge for call Id

From Dev

Node command doesn't execute asterisk path

From Java

Why doesn't ASTERISK work in google sheets?

From Dev

Grep: The asterisk (*) doesn't always work

From Dev

Grep: The asterisk (*) doesn't always work

From Dev

can't connect to FTP server -- disconnects after FEAT command

From Dev

How to create account balance for each users in asterisk freePBX system?

From Dev

inputAccessoryView doesn't appear automatically after call "reloadInputViews"

From Dev

Rails doesn't display flash messages after ajax call

From Dev

Change inner text after ajax call back doesn't work?

From Dev

Jquery function doesn't work after Ajax call

From Dev

addClass() function doesn't work after ajax call

From Dev

jQuery doesn't fire twice after call to .load()

From Dev

Why doesn't this object get set to NULL after the function call?

From Dev

Why opening after deleting doesn't call the onupgradeneeded callback

Related Related

  1. 1

    Asterisk playback after hangup

  2. 2

    Two hangup events in one call hangup in asterisk call

  3. 3

    Asterisk Call Manager hangup event on Python

  4. 4

    Programming Asterisk IVR inside freepbx problem continuing the program when clerk hangup

  5. 5

    Freepbx can't connect to asterisk wrong password

  6. 6

    send a specific DTMF phone as soon as hangup the call on asterisk

  7. 7

    How do I make a Twilio call hangup if my app doesn't get a valid response from the call recipient

  8. 8

    Calling a PHP script using FreePBX and Asterisk

  9. 9

    Javascript doesn't work after call a function

  10. 10

    Asterisk call drop after 30 seconds

  11. 11

    Asterisk : automatically answer call after originate

  12. 12

    Asterisk change callerid after consultation call

  13. 13

    Asterisk ringgroup get call after registration

  14. 14

    After an AJAX call, the next AJAX call doesn't work

  15. 15

    Twilio Hangup: charge for call Id

  16. 16

    Node command doesn't execute asterisk path

  17. 17

    Why doesn't ASTERISK work in google sheets?

  18. 18

    Grep: The asterisk (*) doesn't always work

  19. 19

    Grep: The asterisk (*) doesn't always work

  20. 20

    can't connect to FTP server -- disconnects after FEAT command

  21. 21

    How to create account balance for each users in asterisk freePBX system?

  22. 22

    inputAccessoryView doesn't appear automatically after call "reloadInputViews"

  23. 23

    Rails doesn't display flash messages after ajax call

  24. 24

    Change inner text after ajax call back doesn't work?

  25. 25

    Jquery function doesn't work after Ajax call

  26. 26

    addClass() function doesn't work after ajax call

  27. 27

    jQuery doesn't fire twice after call to .load()

  28. 28

    Why doesn't this object get set to NULL after the function call?

  29. 29

    Why opening after deleting doesn't call the onupgradeneeded callback

HotTag

Archive