Call hangs after picking up

Hello,

A few times per week calls are picked up and immediately call is terminated, it mostly happens to one of our extension.

We’ve tried changing the VoIP terminal and assigning a new extenion, but this issue continues to happen.

For example PJSIP/204 is calling PJSIP/436, looking at the logs I can see the phone is ringing and immediately after joining the bridge, PJSIP/436 quits:

[2022-04-20 09:24:33] VERBOSE[7104][C-0000be20] app_stack.c: PJSIP/436-00021150 Internal Gosub(func-apply-sipheaders,s,1) complete GOSUB_RETVAL=
[2022-04-20 09:24:33] VERBOSE[7104][C-0000be20] app_dial.c: Called PJSIP/436/sip:[email protected]:5060
[2022-04-20 09:24:33] VERBOSE[7104][C-0000be20] app_dial.c: PJSIP/436-00021150 is ringing
[2022-04-20 09:24:40] VERBOSE[7104][C-0000be20] app_dial.c: PJSIP/436-00021150 answered PJSIP/204-0002114f
[2022-04-20 09:24:40] VERBOSE[7152][C-0000be20] bridge_channel.c: Channel PJSIP/436-00021150 joined 'simple_bridge' basic-bridge <74b12498-08a2-4ac7-b72f-4268dc8e48c5>
[2022-04-20 09:24:40] VERBOSE[7104][C-0000be20] bridge_channel.c: Channel PJSIP/204-0002114f joined 'simple_bridge' basic-bridge <74b12498-08a2-4ac7-b72f-4268dc8e48c5>
[2022-04-20 09:24:40] VERBOSE[7152][C-0000be20] bridge_channel.c: Channel PJSIP/436-00021150 left 'simple_bridge' basic-bridge <74b12498-08a2-4ac7-b72f-4268dc8e48c5>
[2022-04-20 09:24:40] VERBOSE[7104][C-0000be20] bridge_channel.c: Channel PJSIP/204-0002114f left 'simple_bridge' basic-bridge <74b12498-08a2-4ac7-b72f-4268dc8e48c5>
[2022-04-20 09:24:40] VERBOSE[7104][C-0000be20] app_macro.c: Spawn extension (macro-dial-one, s, 63) exited non-zero on 'PJSIP/204-0002114f' in macro 'dial-one'
[2022-04-20 09:24:40] VERBOSE[7104][C-0000be20] app_macro.c: Spawn extension (macro-exten-vm, s, 18) exited non-zero on 'PJSIP/204-0002114f' in macro 'exten-vm'
[2022-04-20 09:24:40] VERBOSE[7104][C-0000be20] pbx.c: Spawn extension (ext-local, 436, 3) exited non-zero on 'PJSIP/204-0002114f'
[2022-04-20 09:24:40] VERBOSE[7104][C-0000be20] pbx.c: Executing [[email protected]:1] Macro("PJSIP/204-0002114f", "hangupcall,") in new stack
[2022-04-20 09:24:40] VERBOSE[7104][C-0000be20] pbx.c: Executing [[email protected]:1] GotoIf("PJSIP/204-0002114f", "1?theend") in new stack
[2022-04-20 09:24:40] VERBOSE[7104][C-0000be20] pbx_builtins.c: Goto (macro-hangupcall,s,3)
[2022-04-20 09:24:40] VERBOSE[7104][C-0000be20] pbx.c: Executing [[email protected]:3] ExecIf("PJSIP/204-0002114f", "0?Set(CDR(recordingfile)=)") in new stack
[2022-04-20 09:24:40] VERBOSE[7104][C-0000be20] pbx.c: Executing [[email protected]:4] Hangup("PJSIP/204-0002114f", "") in new stack
[2022-04-20 09:24:40] VERBOSE[7104][C-0000be20] app_macro.c: Spawn extension (macro-hangupcall, s, 4) exited non-zero on 'PJSIP/204-0002114f' in macro 'hangupcall'
[2022-04-20 09:24:40] VERBOSE[7104][C-0000be20] pbx.c: Spawn extension (ext-local, h, 1) exited non-zero on 'PJSIP/204-0002114f'

I’m also dumping our traffic and all I can see is 436 ACK’s and immediatly sends BYE:

- 671.628492970	192.168.22.240	192.168.22.183	SIP/SDP	1081	Request: INVITE sip:[email protected]:5060 | 
- 671.640594441	192.168.22.183	192.168.22.240	SIP	416	Status: 100 Trying | 
- 671.714939367	192.168.22.183	192.168.22.240	SIP	642	Status: 180 Ringing | 
- 678.488839817	192.168.22.183	192.168.22.240	SIP/SDP	885	Status: 200 OK | 
- 678.492387330	192.168.22.240	192.168.22.183	SIP	456	Request: ACK sip:[email protected]:5060 | 
- 678.567277050	192.168.22.183	192.168.22.240	SIP	469	Request: BYE sip:[email protected]:5060 | 
- 678.569088567	192.168.22.240	192.168.22.183	SIP	406	Status: 200 OK | 

Any ideas of what could cause this?

Thanks for your help.

Have you limited your choice of codecs to those you might actually use? Responding BYE to ACK could be the result of an unacceptable late offer, and it seems that some versions of Asterisk use late offer if you specify an excessive number of codecs (possibly by not disallowing all first).

In any case, it is 183 that is aborting the call, not Asterisk, and one would need the full SDP content, not just the SIP method and response code, to diagnose this at the Asterisk end.

I think that you’re on the right track, this extenions had no disallowed/allowed codecs set:

I’ve manually set them up:

Disallowed codecs: all
Allowed codecs: alaw&g722

Let’s see how it goes form now on, thanks for your help!

So after changing our codecs it’s happening once more, so I’m a bit clueless about what is going on:

SIP headers are:

INVITE sip:[email protected]:5060 SIP/2.0
Via: SIP/2.0/UDP 192.168.22.240:5060;rport;branch=z9hG4bKPjb4e58a33-8460-494a-bf2c-b6be4de1cc66
From: "XXXXX" <sip:[email protected]>;tag=411e7b5e-acbe-41a6-9018-b056a4891e12
To: <sip:[email protected]>
Contact: <sip:[email protected]:5060>
Call-ID: 2e01fea0-e354-4f86-9f26-7e02a18edb65
CSeq: 15043 INVITE
Allow: OPTIONS, REGISTER, SUBSCRIBE, NOTIFY, PUBLISH, INVITE, ACK, BYE, CANCEL, UPDATE, PRACK, MESSAGE, REFER
Supported: 100rel, timer, replaces, norefersub, histinfo
Session-Expires: 1800
Min-SE: 90
P-Asserted-Identity: "XXXXX" <sip:[email protected]>
Max-Forwards: 70
User-Agent: FPBX-15.0.23(16.20.0)
Content-Type: application/sdp
Content-Length:   239

v=0
o=- 396538567 396538567 IN IP4 192.168.22.240
s=Asterisk
c=IN IP4 192.168.22.240
t=0 0
m=audio 12352 RTP/AVP 8 101
a=rtpmap:8 PCMA/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=ptime:20
a=maxptime:150
a=sendrecv
SIP/2.0 100 Trying
Via: SIP/2.0/UDP 192.168.22.240:5060;rport=5060;branch=z9hG4bKPjb4e58a33-8460-494a-bf2c-b6be4de1cc66
From: "XXXXX" <sip:[email protected]>;tag=411e7b5e-acbe-41a6-9018-b056a4891e12
To: <sip:[email protected]>
Call-ID: 2e01fea0-e354-4f86-9f26-7e02a18edb65
CSeq: 15043 INVITE
User-Agent: Yealink SIP-T21P_E2 52.84.0.125
Content-Length: 0

SIP/2.0 180 Ringing
Via: SIP/2.0/UDP 192.168.22.240:5060;rport=5060;branch=z9hG4bKPjb4e58a33-8460-494a-bf2c-b6be4de1cc66
From: "XXXXX" <sip:[email protected]>;tag=411e7b5e-acbe-41a6-9018-b056a4891e12
To: <sip:[email protected]>;tag=1533595318
Call-ID: 2e01fea0-e354-4f86-9f26-7e02a18edb65
CSeq: 15043 INVITE
Contact: <sip:[email protected]:5060>
Allow: INVITE, INFO, PRACK, ACK, BYE, CANCEL, OPTIONS, NOTIFY, REGISTER, SUBSCRIBE, REFER, PUBLISH, UPDATE, MESSAGE
User-Agent: Yealink SIP-T21P_E2 52.84.0.125
Allow-Events: talk,hold,conference,refer,check-sync
Content-Length: 0

SIP/2.0 200 OK
Via: SIP/2.0/UDP 192.168.22.240:5060;rport=5060;branch=z9hG4bKPjb4e58a33-8460-494a-bf2c-b6be4de1cc66
From: "XXXXX" <sip:[email protected]>;tag=411e7b5e-acbe-41a6-9018-b056a4891e12
To: <sip:[email protected]>;tag=1533595318
Call-ID: 2e01fea0-e354-4f86-9f26-7e02a18edb65
CSeq: 15043 INVITE
Contact: <sip:[email protected]:5060>
Content-Type: application/sdp
Allow: INVITE, INFO, PRACK, ACK, BYE, CANCEL, OPTIONS, NOTIFY, REGISTER, SUBSCRIBE, REFER, PUBLISH, UPDATE, MESSAGE
User-Agent: Yealink SIP-T21P_E2 52.84.0.125
Allow-Events: talk,hold,conference,refer,check-sync
Content-Length: 215

v=0
o=- 20249 20249 IN IP4 192.168.22.183
s=SDP data
c=IN IP4 192.168.22.183
t=0 0
m=audio 12478 RTP/AVP 8 101
a=rtpmap:8 PCMA/8000
a=ptime:20
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-15
a=sendrecv
ACK sip:[email protected]:5060 SIP/2.0
Via: SIP/2.0/UDP 192.168.22.240:5060;rport;branch=z9hG4bKPj81b9a970-ef75-446f-934c-7bc64b524f49
From: "XXXXX" <sip:[email protected]>;tag=411e7b5e-acbe-41a6-9018-b056a4891e12
To: <sip:[email protected]>;tag=1533595318
Call-ID: 2e01fea0-e354-4f86-9f26-7e02a18edb65
CSeq: 15043 ACK
Max-Forwards: 70
User-Agent: FPBX-15.0.23(16.20.0)
Content-Length:  0

BYE sip:[email protected]:5060 SIP/2.0
Via: SIP/2.0/UDP 192.168.22.183:5060;branch=z9hG4bK2234124380
From: <sip:[email protected]>;tag=1533595318
To: "XXXXX" <sip:[email protected]>;tag=411e7b5e-acbe-41a6-9018-b056a4891e12
Call-ID: 2e01fea0-e354-4f86-9f26-7e02a18edb65
CSeq: 2 BYE
Contact: <sip:[email protected]:5060>
Max-Forwards: 70
User-Agent: Yealink SIP-T21P_E2 52.84.0.125
Content-Length: 0

SIP/2.0 200 OK
Via: SIP/2.0/UDP 192.168.22.183:5060;rport=5060;received=192.168.22.183;branch=z9hG4bK2234124380
Call-ID: 2e01fea0-e354-4f86-9f26-7e02a18edb65
From: <sip:[email protected]>;tag=1533595318
To: "XXXXX" <sip:[email protected]>;tag=411e7b5e-acbe-41a6-9018-b056a4891e12
CSeq: 2 BYE
Server: FPBX-15.0.23(16.20.0)
Content-Length:  0

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.