No SDP sent in outbound INVITE from Asterisk using PJSIP

I’ve been searching high and low for some configuration item in either the dialplan or in the pjsip configuration which affects this, but I’m seeing with my most recent Asterisk 16.0.0 installation that after receiving an INVITE, Asterisk is then sending the target endpoint an INVITE with no SDP.

See:

<— Received SIP request (760 bytes) from UDP:10.20.8.116:50501 —>
INVITE sip:106@10.20.6.193 SIP/2.0
Via: SIP/2.0/UDP 10.20.8.116:50501;branch=z9hG4bK-524287-1—878aa948ac6d3f66;rport
Max-Forwards: 70
Contact: sip:107@10.20.8.116:50501;rinstance=4149fe5c9c30d847
To: sip:106@10.20.6.193
From: sip:107@10.20.6.193;tag=0570c57b
Call-ID: 94916MDUzZmY1YjQ4NGZkMGU2NzY4N2I0Y2JiYjc3ODcxM2M
CSeq: 1 INVITE
Allow: OPTIONS, SUBSCRIBE, NOTIFY, INVITE, ACK, CANCEL, BYE, REFER, INFO
Content-Type: application/sdp
Supported: replaces
User-Agent: User Agent of Choice
Content-Length: 213

v=0
o=- 13184276213375450 1 IN IP4 10.20.8.116
s=User Agent of Choice
c=IN IP4 10.20.8.116
t=0 0
m=audio 58992 RTP/AVP 9 0 101
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-15
a=sendrecv

<— Transmitting SIP response (532 bytes) to UDP:10.20.8.116:50501 —>
SIP/2.0 401 Unauthorized
Via: SIP/2.0/UDP 10.20.8.116:50501;rport=50501;received=10.20.8.116;branch=z9hG4bK-524287-1—878aa948ac6d3f66
Call-ID: 94916MDUzZmY1YjQ4NGZkMGU2NzY4N2I0Y2JiYjc3ODcxM2M
From: sip:107@10.20.6.193;tag=0570c57b
To: sip:106@10.20.6.193;tag=z9hG4bK-524287-1—878aa948ac6d3f66
CSeq: 1 INVITE
WWW-Authenticate: Digest realm=“asterisk”,nonce=“1539802613/03de79b74dae0c2ec3256ef498148f43”,opaque=“6b72d4353abcf868”,algorithm=md5,qop=“auth”
Server: Asterisk PBX 16.0.0
Content-Length: 0

<— Received SIP request (338 bytes) from UDP:10.20.8.116:50501 —>
ACK sip:106@10.20.6.193 SIP/2.0
Via: SIP/2.0/UDP 10.20.8.116:50501;branch=z9hG4bK-524287-1—878aa948ac6d3f66;rport
Max-Forwards: 70
To: sip:106@10.20.6.193;tag=z9hG4bK-524287-1—878aa948ac6d3f66
From: sip:107@10.20.6.193;tag=0570c57b
Call-ID: 94916MDUzZmY1YjQ4NGZkMGU2NzY4N2I0Y2JiYjc3ODcxM2M
CSeq: 1 ACK
Content-Length: 0

<— Received SIP request (1040 bytes) from UDP:10.20.8.116:50501 —>
INVITE sip:106@10.20.6.193 SIP/2.0
Via: SIP/2.0/UDP 10.20.8.116:50501;branch=z9hG4bK-524287-1—f32ea1751fdc4c7f;rport
Max-Forwards: 70
Contact: sip:107@10.20.8.116:50501;rinstance=4149fe5c9c30d847
To: sip:106@10.20.6.193
From: sip:107@10.20.6.193;tag=0570c57b
Call-ID: 94916MDUzZmY1YjQ4NGZkMGU2NzY4N2I0Y2JiYjc3ODcxM2M
CSeq: 2 INVITE
Allow: OPTIONS, SUBSCRIBE, NOTIFY, INVITE, ACK, CANCEL, BYE, REFER, INFO
Content-Type: application/sdp
Supported: replaces
User-Agent: User Agent of Choice
Authorization: Digest username=“107”,realm=“asterisk”,nonce=“1539802613/03de79b74dae0c2ec3256ef498148f43”,uri=“sip:106@10.20.6.193”,response=“cf94a3c6bcc5fa4fe29ab37933be805c”,cnonce=“706f8ee97bba1322df5b5a5998688b61”,nc=00000001,qop=auth,algorithm=md5,opaque=“6b72d4353abcf868”
Content-Length: 213

v=0
o=- 13184276213375450 1 IN IP4 10.20.8.116
s=User Agent of Choice
c=IN IP4 10.20.8.116
t=0 0
m=audio 58992 RTP/AVP 9 0 101
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-15
a=sendrecv

== Setting global variable ‘SIPDOMAIN’ to ‘10.20.6.193’
<— Transmitting SIP response (339 bytes) to UDP:10.20.8.116:50501 —>
SIP/2.0 100 Trying
Via: SIP/2.0/UDP 10.20.8.116:50501;rport=50501;received=10.20.8.116;branch=z9hG4bK-524287-1—f32ea1751fdc4c7f
Call-ID: 94916MDUzZmY1YjQ4NGZkMGU2NzY4N2I0Y2JiYjc3ODcxM2M
From: sip:107@10.20.6.193;tag=0570c57b
To: sip:106@10.20.6.193
CSeq: 2 INVITE
Server: Asterisk PBX 16.0.0
Content-Length: 0

-- Executing [106@internal:1] NoOp("PJSIP/107-00000024", "") in new stack
-- Executing [106@internal:2] Dial("PJSIP/107-00000024", "PJSIP/106/sip:106@10.20.8.55:60308;rinstance=d936834a36d94fbc,30,b(add-header^addheader^1)") in new stack
-- PJSIP/106-00000025 Internal Gosub(add-header,addheader,1) start
-- Executing [addheader@add-header:1] Set("PJSIP/106-00000025", "PJSIP_HEADER(add,Call-Info)=<sip:192.168.1.1>;answer-after=0") in new stack
-- Executing [addheader@add-header:2] Return("PJSIP/106-00000025", "") in new stack

== Spawn extension (internal, 106, 1) exited non-zero on ‘PJSIP/106-00000025’
– PJSIP/106-00000025 Internal Gosub(add-header,addheader,1) complete GOSUB_RETVAL=
– Called PJSIP/106/sip:106@10.20.8.55:60308;rinstance=d936834a36d94fbc

<— Transmitting SIP request (717 bytes) to UDP:10.20.8.55:60308 —>
INVITE sip:106@10.20.8.55:60308;rinstance=d936834a36d94fbc SIP/2.0
Via: SIP/2.0/UDP 10.20.6.193:5060;rport;branch=z9hG4bKPj131df430-3f0b-4b31-8ea8-ece641aabfcb
From: sip:107@10.20.6.193;tag=44525b39-c588-416d-abdc-e2ed3ac7e042
To: sip:106@10.20.8.55;rinstance=d936834a36d94fbc
Contact: sip:asterisk@10.20.6.193:5060
Call-ID: 35b63662-adc5-4c11-8022-0b11db77d133
CSeq: 3508 INVITE
Allow: OPTIONS, REGISTER, SUBSCRIBE, NOTIFY, PUBLISH, INVITE, ACK, BYE, CANCEL, UPDATE, PRACK, MESSAGE, REFER
Supported: 100rel, timer, replaces, norefersub
Session-Expires: 1800
Min-SE: 90
Call-Info: sip:192.168.1.1;answer-after=0
Max-Forwards: 70
User-Agent: Asterisk PBX 16.0.0
Content-Length: 0

<— Received SIP response (329 bytes) from UDP:10.20.8.55:60308 —>
SIP/2.0 100 Trying
Via: SIP/2.0/UDP 10.20.6.193:5060;rport=5060;branch=z9hG4bKPj131df430-3f0b-4b31-8ea8-ece641aabfcb
To: sip:106@10.20.8.55;rinstance=d936834a36d94fbc
From: sip:107@10.20.6.193;tag=44525b39-c588-416d-abdc-e2ed3ac7e042
Call-ID: 35b63662-adc5-4c11-8022-0b11db77d133
CSeq: 3508 INVITE
Content-Length: 0

<— Received SIP response (493 bytes) from UDP:10.20.8.55:60308 —>
SIP/2.0 180 Ringing
Via: SIP/2.0/UDP 10.20.6.193:5060;rport=5060;branch=z9hG4bKPj131df430-3f0b-4b31-8ea8-ece641aabfcb
Contact: sip:106@10.20.8.55:60308;rinstance=d936834a36d94fbc
To: "Asterisk 106"sip:106@10.20.8.55;rinstance=d936834a36d94fbc;tag=dfb73053
From: sip:107@10.20.6.193;tag=44525b39-c588-416d-abdc-e2ed3ac7e042
Call-ID: 35b63662-adc5-4c11-8022-0b11db77d133
CSeq: 3508 INVITE
User-Agent: User Agent of Choice
Allow-Events: talk, hold
Content-Length: 0

-- PJSIP/106-00000025 is ringing
-- PJSIP/106-00000025 is ringing

<— Transmitting SIP response (525 bytes) to UDP:10.20.8.116:50501 —>
SIP/2.0 180 Ringing
Via: SIP/2.0/UDP 10.20.8.116:50501;rport=50501;received=10.20.8.116;branch=z9hG4bK-524287-1—f32ea1751fdc4c7f
Call-ID: 94916MDUzZmY1YjQ4NGZkMGU2NzY4N2I0Y2JiYjc3ODcxM2M
From: sip:107@10.20.6.193;tag=0570c57b
To: sip:106@10.20.6.193;tag=8ae4e1c9-dd30-4b3c-bffa-a0a7c23f3d4f
CSeq: 2 INVITE
Server: Asterisk PBX 16.0.0
Contact: sip:10.20.6.193:5060
Allow: OPTIONS, REGISTER, SUBSCRIBE, NOTIFY, PUBLISH, INVITE, ACK, BYE, CANCEL, UPDATE, PRACK, MESSAGE, REFER
Content-Length: 0

<— Received SIP response (792 bytes) from UDP:10.20.8.55:60308 —>
SIP/2.0 200 OK
Via: SIP/2.0/UDP 10.20.6.193:5060;rport=5060;branch=z9hG4bKPj131df430-3f0b-4b31-8ea8-ece641aabfcb
Contact: sip:106@10.20.8.55:60308;rinstance=d936834a36d94fbc
To: sip:106@10.20.8.55;rinstance=d936834a36d94fbc;tag=dfb73053
From: sip:107@10.20.6.193;tag=44525b39-c588-416d-abdc-e2ed3ac7e042
Call-ID: 35b63662-adc5-4c11-8022-0b11db77d133
CSeq: 3508 INVITE
Allow: OPTIONS, SUBSCRIBE, NOTIFY, INVITE, ACK, CANCEL, BYE, REFER, INFO, MESSAGE
Content-Type: application/sdp
Supported: replaces
User-Agent: User Agent of Choice
Content-Length: 207

v=0
o=- 13184276217265593 1 IN IP4 10.20.8.55
s=User Agent of Choice
c=IN IP4 10.20.8.55
t=0 0
m=audio 57420 RTP/AVP 9 0 101
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-15
a=sendrecv

   > 0x7fc6c001e3a0 -- Strict RTP learning after remote address set to: 10.20.8.55:57420
-- PJSIP/106-00000025 answered PJSIP/107-00000024

<— Transmitting SIP request (703 bytes) to UDP:10.20.8.55:60308 —>
ACK sip:106@10.20.8.55:60308;rinstance=d936834a36d94fbc SIP/2.0
Via: SIP/2.0/UDP 10.20.6.193:5060;rport;branch=z9hG4bKPj3fd65156-38c7-4df1-86c3-abcff60a12bb
From: sip:107@10.20.6.193;tag=44525b39-c588-416d-abdc-e2ed3ac7e042
To: sip:106@10.20.8.55;rinstance=d936834a36d94fbc;tag=dfb73053
Call-ID: 35b63662-adc5-4c11-8022-0b11db77d133
CSeq: 3508 ACK
Max-Forwards: 70
User-Agent: Asterisk PBX 16.0.0
Content-Type: application/sdp
Content-Length: 226

v=0
o=- 2223832505 3 IN IP4 10.20.6.193
s=Asterisk
c=IN IP4 10.20.6.193
t=0 0
m=audio 13848 RTP/AVP 9 101
a=rtpmap:9 G722/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=ptime:20
a=maxptime:150
a=sendrecv

   > 0x7fc6c0010150 -- Strict RTP learning after remote address set to: 10.20.8.116:58992

<— Transmitting SIP response (852 bytes) to UDP:10.20.8.116:50501 —>
SIP/2.0 200 OK
Via: SIP/2.0/UDP 10.20.8.116:50501;rport=50501;received=10.20.8.116;branch=z9hG4bK-524287-1—f32ea1751fdc4c7f
Call-ID: 94916MDUzZmY1YjQ4NGZkMGU2NzY4N2I0Y2JiYjc3ODcxM2M
From: sip:107@10.20.6.193;tag=0570c57b
To: sip:106@10.20.6.193;tag=8ae4e1c9-dd30-4b3c-bffa-a0a7c23f3d4f
CSeq: 2 INVITE
Server: Asterisk PBX 16.0.0
Allow: OPTIONS, REGISTER, SUBSCRIBE, NOTIFY, PUBLISH, INVITE, ACK, BYE, CANCEL, UPDATE, PRACK, MESSAGE, REFER
Contact: sip:10.20.6.193:5060
Supported: 100rel, timer, replaces, norefersub
Content-Type: application/sdp
Content-Length: 250

v=0
o=- 2219942362 3 IN IP4 10.20.6.193
s=Asterisk
c=IN IP4 10.20.6.193
t=0 0
m=audio 10734 RTP/AVP 9 0 101
a=rtpmap:9 G722/8000
a=rtpmap:0 PCMU/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=ptime:20
a=maxptime:150
a=sendrecv

-- Channel PJSIP/106-00000025 joined 'simple_bridge' basic-bridge <58ab0f0f-0c78-4190-88b4-426d2aef5375>
-- Channel PJSIP/107-00000024 joined 'simple_bridge' basic-bridge <58ab0f0f-0c78-4190-88b4-426d2aef5375>
   > Bridge 58ab0f0f-0c78-4190-88b4-426d2aef5375: switching from simple_bridge technology to native_rtp
   > Locally RTP bridged 'PJSIP/107-00000024' and 'PJSIP/106-00000025' in stack

<— Received SIP request (455 bytes) from UDP:10.20.8.116:50501 —>
ACK sip:10.20.6.193:5060 SIP/2.0
Via: SIP/2.0/UDP 10.20.8.116:50501;branch=z9hG4bK-524287-1—5788ae0c6e994c3d;rport
Max-Forwards: 70
Contact: sip:107@10.20.8.116:50501;rinstance=4149fe5c9c30d847
To: sip:106@10.20.6.193;tag=8ae4e1c9-dd30-4b3c-bffa-a0a7c23f3d4f
From: sip:107@10.20.6.193;tag=0570c57b
Call-ID: 94916MDUzZmY1YjQ4NGZkMGU2NzY4N2I0Y2JiYjc3ODcxM2M
CSeq: 2 ACK
User-Agent: User Agent of Choice
Content-Length: 0

Let me know if I can help provide any further info.

Rae

Do you have the res_pjsip_sdp_rtp module loaded?

Great question, I wouldn’t have thought to check that.

I do indeed have it running:
Excerpt from module show like res_pjsip -

res_pjsip_sdp_rtp.so PJSIP SDP RTP/AVP stream handler 0 Running core

What about the respective configurations? Did this previously work? Is there anything of note at startup for log messages?

More great questions. This is a fresh install of 16.0.0 on CentOS 6.10, so it was not working previously at some point.

At startup there are the following errors:

[Oct 17 12:45:42] WARNING[2760]: loader.c:2228 load_modules: Some non-required modules failed to load.
[Oct 17 12:45:42] ERROR[2760]: loader.c:2243 load_modules: Error loading module ‘codec_opus.so’: /lib64/libc.so.6: version GLIBC_2.14' not found (required by /usr/lib/asterisk/modules/codec_opus.so) [Oct 17 12:45:42] ERROR[2760]: loader.c:2243 load_modules: Error loading module 'codec_g729a.so': /lib64/libc.so.6: versionGLIBC_2.14’ not found (required by /usr/lib/asterisk/modules/codec_g729a.so)
[Oct 17 12:45:42] ERROR[2760]: loader.c:2243 load_modules: Error loading module ‘format_ogg_opus.so’: /lib64/libc.so.6: version GLIBC_2.14' not found (required by /usr/lib/asterisk/modules/format_ogg_opus.so) [Oct 17 12:45:42] ERROR[2760]: loader.c:2243 load_modules: Error loading module 'codec_silk.so': /lib64/libc.so.6: versionGLIBC_2.14’ not found (required by /usr/lib/asterisk/modules/codec_silk.so)
[Oct 17 12:45:42] ERROR[2760]: loader.c:2243 load_modules: chan_sip declined to load.
[Oct 17 12:45:42] ERROR[2760]: loader.c:2243 load_modules: cdr_tds declined to load.
[Oct 17 12:45:42] ERROR[2760]: loader.c:2243 load_modules: cdr_radius declined to load.
[Oct 17 12:45:42] ERROR[2760]: loader.c:2243 load_modules: cdr_pgsql declined to load.
[Oct 17 12:45:42] ERROR[2760]: loader.c:2243 load_modules: cel_tds declined to load.
[Oct 17 12:45:42] ERROR[2760]: loader.c:2243 load_modules: cel_sqlite3_custom declined to load.
[Oct 17 12:45:42] ERROR[2760]: loader.c:2243 load_modules: cel_radius declined to load.
[Oct 17 12:45:42] ERROR[2760]: loader.c:2243 load_modules: cdr_sqlite3_custom declined to load.
[Oct 17 12:45:42] ERROR[2760]: loader.c:2243 load_modules: res_hep_rtcp declined to load.
[Oct 17 12:45:42] ERROR[2760]: loader.c:2243 load_modules: res_hep_pjsip declined to load.

This looks like a valid late offer SDP case, but I thought Asterisk only supported late offer as UAS, not as UAC.

@david551

Agreed WRT valid case, and also, calls do work. The only problem here really is that the endpoint receiving the call shows the option to answer as audio OR video call (understandably, since the INVITE could be for anything), when the call was sent as audio only.

Asterisk does correctly send the SDP in the ACK to conclude the late offer negotiation. Perhaps I should have clarified that initially.

Yes, that would have been useful to know. I’m not sure why it is doing that - not something I’ve seen. Have you bumped up core debug (debug to console in logger.conf and core set debug 9 in CLI) to show if it gives any insights?

Not a lot of help there as far as I can tell.

Log file here:
https://pastebin.com/H5Wzs2N4

Second call (after disabling OPUS on client), which is successful, starts at line 803. That one is probably the most helpful

The first call, one client has OPUS enabled, the other does not. Both have G.711u and G.722 enabled. That call fails despite a codec in common between them. Asterisk can’t find a translation path for OPUS (disabled on Asterisk) - which shouldn’t be necessary given a common codec between the endpoints as far as I understand.

The codec thing MAY be related, but is a separate issue. If nothing else stands out/works, I may recompile with OPUS and other codecs which rely on GLIBC 2.14 or higher disabled from the start.