[Home]

Summary:ASTERISK-25550: Codecs negotiated incorrectly
Reporter:Anatoli (anatoli)Labels:
Date Opened:2015-11-13 15:14:38.000-0600Date Closed:2020-01-14 11:13:57.000-0600
Priority:MajorRegression?
Status:Closed/CompleteComponents:Codecs/General Core/CodecInterface pjproject/pjsip
Versions:13.4.0 13.6.0 Frequency of
Occurrence
Constant
Related
Issues:
Environment:Ubuntu 14.04, PJSIP 2.4.5Attachments:( 0) pjsip.log
( 1) tcp.dump
Description:Hi,

I'm not sure this is an Asterisk issue or a PJSIP one, please confirm.

When an endpoint (in this case Linphone on iPhone) has 2 codecs selected as allowed (iLBC & G722) and tries to make a call to a destination whose codec is alaw, the sound that is heard on the origin endpoint sounds accelerated (like fast-forwarded) with heavy distortion, but on the destination phone (a cellphone or a landline) everything sounds OK.

For the origin endpoint channel, {{core show channel}} outputs the following:
{quote}
NativeFormats: (g722|ilbc)
   WriteFormat: slin
    ReadFormat: slin
WriteTranscode: Yes (slin@8000)->(ilbc@8000)
 ReadTranscode: Yes (g722@16000)->(slin@8000)
{quote}
And for the destination one:
{quote}
 NativeFormats: (alaw)
   WriteFormat: slin
    ReadFormat: slin
WriteTranscode: Yes (slin@8000)->(alaw@8000)
 ReadTranscode: Yes (alaw@8000)->(slin@8000)
{quote}


So it looks like the origin endpoint expects to send and receive the media coded using a single codec but Asterisk/PJSIP decide to receive the media from the endpoint coded using G722 and to send it back using iLBC.

PJSIP is configured to allow G722 & iLBC for the origin endpoint and alaw for the destination one.

If the origin endpoint chooses only one codec in the configuration (either iLBC or G722), everything works fine.

Please let me know if additional information is needed.

Thanks,
Anatoli
Comments:By: Asterisk Team (asteriskteam) 2015-11-13 15:14:40.014-0600

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: Rusty Newton (rnewton) 2015-11-18 15:37:37.854-0600

We require additional debug to continue with triage of your issue. Please follow the instructions on the wiki [1] for how to collect debugging information from Asterisk. For expediency, where possible, attach the debug with a '.txt' file extension so that the debug will be usable for further analysis.

Thanks!

[1] https://wiki.asterisk.org/wiki/display/AST/Collecting+Debug+Information





By: Rusty Newton (rnewton) 2015-11-18 15:38:03.766-0600

In addition to the debug log please provide a packet capture that correlates with the call in the debug log. Thanks!

By: Rusty Newton (rnewton) 2015-12-10 20:13:16.951-0600

I figured the issue may be easy to reproduce, however I was unable to reproduce it.

I setup two PJSIP endpoints
* endpoint A device (MicroSIP on a laptop) configured for ilbc,g722, with the Asterisk endpoint configuration setup for ilbc,g722 only
* endpoint B device (Linksys/Cisco Sipura SPA942) configured for alaw, with the Asterisk endpoint configuration setup for alaw only
* both endpoints configured for direct_media=no

I called from A to B, then from B to A with no problems. I tried changing the order of the ilbc and g722 codecs both on Asterisk and on the MicroSIP device. No difference in behavior except which codec was chosen for the A leg of the call. In all cases the audio sounded good. (ILBC never sounds great, but it didn't sound abnormal).

I couldn't reproduce the "core show channel" output that you pasted in the description.

You'll need to provide the following:

* pjsip.conf configuration required to reproduce the issue
* extensions.conf configuration
* new packet capture along with a new debug log that correlates with it.
** The previous log you provided seems to only show half the call and only the PJSIP logger output. We need a complete debug log captured following the instructions we provided. It should show WARNING,ERROR,NOTICE,VERBOSE,DEBUG messages alongside the PJSIP logger output for the complete call.
* step by step instructions to reproduce the issue.
* attach all configuration and logs as .txt files except the packet capture.

There probably is an issue here but we need the additional information to investigate. Thanks!

By: Asterisk Team (asteriskteam) 2015-12-25 12:00:19.821-0600

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