[Home]

Summary:ASTERISK-28051: RTP engine should only accept audio frames with allowed payloads
Reporter:Jan Blom (jblom)Labels:patch pjsip
Date Opened:2018-09-12 04:02:21Date Closed:2020-01-14 11:13:35.000-0600
Priority:MinorRegression?
Status:Closed/CompleteComponents:Resources/res_rtp_asterisk
Versions:15.6.0 Frequency of
Occurrence
Constant
Related
Issues:
Environment:CentOS 7.4 with Asterisk 15.6.0, PJSIP channel onlyAttachments:( 0) payload1.patch
Description:We run a stripped-down asterisk (both 15.5.0 and 15.6.0) with pjsip channel and only a few codecs since we want to avoid transcoding and other possible overhead.

Some incoming calls from one provider is setup with only PCMA in SDP from both sides. This usually works as expected. However, a few calls start with a single RTP packet with G.722 payload before we receive the G.711 stream.

This confuses Asterisk to think the received audio stream is G.722. “core show channel” reports “ReadFormat: g722” even after a second or two of receiving proper G.711 packets.

Since we don’t have a translation path between our voice prompts and G.722, asterisk complains and call will eventually end with a failure. We don’t have the G.722 codec loaded.

Since we in the pjsip configuration only allow a few select codecs that we can handle, I would expect audio frames with a different payload  type to be ignored. At least as a configuration option.

Looking at the source, it seems that ast_rtp_codecs_get_payload() (main/rtp_engine.c) should return NULL if the received payload type is not found in the current rtp instance. I have attached a patch that solves the issue for us.

There are probably other consequences with my simple patch, that I have overlooked. But it proves the point.
Comments:By: Asterisk Team (asteriskteam) 2018-09-12 04:02:24.245-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.

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].

By: Benjamin Keith Ford (bford) 2018-09-12 07:59:30.672-0500

Hey [~jblom], can you attach some logs with debug and verbose for the issue occurring as well? Also, for whoever investigates this issue, can you attach your pjsip.conf configuration as well as a minimal dialplan that reproduces this issue?

I see that you mentioned you attached a patch that resolves the issue, but it appears to not be there. Are you planning on submitting this to Gerrit [1]? Guidelines on how to do so can be found here [2].

[1] https://gerrit.asterisk.org/#/q/status:open
[2] https://wiki.asterisk.org/wiki/display/AST/Gerrit+Usage

By: Asterisk Team (asteriskteam) 2018-09-26 12:00:02.301-0500

Suspended due to lack of activity. This issue will be automatically re-opened if the reporter posts a comment. If you are not the reporter and would like this re-opened please create a new issue instead. If the new issue is related to this one a link will be created during the triage process. Further information on issue tracker usage can be found in the Asterisk Issue Guidlines [1].

[1] https://wiki.asterisk.org/wiki/display/AST/Asterisk+Issue+Guidelines