[Home]

Summary:ASTERISK-29978: chan_sip/res_rtp: Asterisk do not use the first media format in reply with SDP
Reporter:Mark Petersen (asterisk.org@zombie.dk)Labels:
Date Opened:2022-03-21 07:44:14Date Closed:
Priority:MinorRegression?
Status:Open/NewComponents:Channels/chan_sip/CodecHandling Resources/res_rtp_asterisk
Versions:16.24.1 18.10.1 Frequency of
Occurrence
Constant
Related
Issues:
Environment:Attachments:( 0) Asterisk_debug.log
( 1) tcpdump-dev-asterisk.pcap
Description:Alice call Bob
Allice support alaw,ulaw Bob support g722,alaw,ulaw
when Asterisk receive 200 OK from Bob, it do not use the first codec in the 200 OK
causing mitch match RTP, witch result in one way sound on most phones

sip.conf
disallow=all
allow=g722,alaw,ulaw,gsm

sip show peer hpbx
 Codecs       : (g722|alaw|ulaw|gsm)

INVITE
m=audio 19534 RTP/AVP 8 9 0 3 101
a=rtpmap:8 PCMA/8000
a=rtpmap:9 G722/8000
a=rtpmap:0 PCMU/8000
a=rtpmap:3 GSM/8000
a=rtpmap:101 telephone-event/8000

200 OK
m=audio 51172 RTP/AVP 8 9 0 101
a=rtpmap:8 PCMA/8000
a=rtpmap:9 G722/8000
a=rtpmap:0 PCMU/8000
a=rtpmap:101 telephone-event/8000

asterisk send using rtpmap:9 G722/8000
but should be using rtpmap:8 PCMA/8000
according ti RFC https://datatracker.ietf.org/doc/html/rfc3264#section-7
Comments:By: Asterisk Team (asteriskteam) 2022-03-21 07:44:15.716-0500

Thanks for creating a report! The issue has entered the triage process. That means the issue will wait in this status until a Bug Marshal has an opportunity to review the issue. Once the issue has been reviewed you will receive comments regarding the next steps towards resolution. Please note that log messages and other files should not be sent to the Sangoma Asterisk Team unless explicitly asked for. All files should be placed on this issue in a sanitized fashion as needed.

A good first step is for you to review the [Asterisk Issue Guidelines|https://wiki.asterisk.org/wiki/display/AST/Asterisk+Issue+Guidelines] if you haven't already. The guidelines detail what is expected from an Asterisk issue report.

Then, if you are submitting a patch, please review the [Patch Contribution Process|https://wiki.asterisk.org/wiki/display/AST/Patch+Contribution+Process].

Please note that once your issue enters an open state it has been accepted. As Asterisk is an open source project there is no guarantee or timeframe on when your issue will be looked into. If you need expedient resolution you will need to find and pay a suitable developer. Asking for an update on your issue will not yield any progress on it and will not result in a response. All updates are posted to the issue when they occur.

Please note that by submitting data, code, or documentation to Sangoma through JIRA, you accept the Terms of Use present at [https://www.asterisk.org/terms-of-use/|https://www.asterisk.org/terms-of-use/].

By: Mark Petersen (asterisk.org@zombie.dk) 2022-03-21 07:45:49.883-0500

SIP + RTP trace of a call with one way sound  
"209" is not able to hear "200"
asterisk 18.10.1

By: Mark Petersen (asterisk.org@zombie.dk) 2022-03-21 07:47:17.071-0500

Asterisk "core set debug 9" log

By: Mark Petersen (asterisk.org@zombie.dk) 2022-03-21 07:56:11.162-0500

--- ORDER is correct ---
rtp_engine.c:1311 ast_rtp_codecs_payloads_set_m_type: Setting tx payload type 8 based on m type on 0x7f9311bc2110
rtp_engine.c:1311 ast_rtp_codecs_payloads_set_m_type: Setting tx payload type 9 based on m type on 0x7f9311bc2110
rtp_engine.c:1311 ast_rtp_codecs_payloads_set_m_type: Setting tx payload type 0 based on m type on 0x7f9311bc2110

chan_sip.c:10903 process_sdp: Processing media-level (audio) SDP a=rtpmap:8 PCMA/8000... OK.
chan_sip.c:10903 process_sdp: Processing media-level (audio) SDP a=rtpmap:9 G722/8000... OK.
chan_sip.c:10903 process_sdp: Processing media-level (audio) SDP a=rtpmap:0 PCMU/8000... OK.
chan_sip.c:10903 process_sdp: Processing media-level (audio) SDP a=rtpmap:101 telephone-event/8000... OK.
chan_sip.c:10903 process_sdp: Processing media-level (audio) SDP a=silenceSupp:off - - - -... UNSUPPORTED OR FAILED.
chan_sip.c:10903 process_sdp: Processing media-level (audio) SDP a=fmtp:101 0-15... UNSUPPORTED OR FAILED.
chan_sip.c:10903 process_sdp: Processing media-level (audio) SDP a=ptime:20... OK.
chan_sip.c:10903 process_sdp: Processing media-level (audio) SDP a=sendrecv... OK.
chan_sip.c:10903 process_sdp: Processing media-level (audio) SDP a=rtcp:57221... UNSUPPORTED OR FAILED.
res_rtp_asterisk.c:1235 ast_rtp_ice_set_role: (0x7f93300f2dd0) ICE set role failed; no ice instance
acl.c:1047 ast_ouraddrfor: For destination '10.253.253.170', our source address is '10.253.248.16'.
res_rtp_asterisk.c:8542 ast_rtp_remote_address_set: (0x7f93300f2dd0) RTCP setting address on RTP instance

--- ORDER has changed from above ---
rtp_engine.c:1197 rtp_codecs_payloads_copy_tx: Copying tx payload mapping 0 (0x7f934803f768) from 0x7f9311bc2110 to 0x7f93300f2fa8
rtp_engine.c:1197 rtp_codecs_payloads_copy_tx: Copying tx payload mapping 8 (0x7f934800bc68) from 0x7f9311bc2110 to 0x7f93300f2fa8
rtp_engine.c:1197 rtp_codecs_payloads_copy_tx: Copying tx payload mapping 9 (0x7f934811cd98) from 0x7f9311bc2110 to 0x7f93300f2fa8
rtp_engine.c:1197 rtp_codecs_payloads_copy_tx: Copying tx payload mapping 101 (0x7f93480f8978) from 0x7f9311bc2110 to 0x7f93300f2fa8

res_rtp_asterisk.c:8339 ast_rtp_prop_set: (0x7f93300f2dd0) RTCP ignoring duplicate property
chan_sip.c:11217 process_sdp: We're settling with these formats: (g722)