[asterisk-bugs] [JIRA] (ASTERISK-27259) chan_pjsip: Outgoing leg does not use all configured codecs, but subset based on caller

lvl (JIRA) noreply at issues.asterisk.org
Fri Oct 13 15:59:21 CDT 2017


    [ https://issues.asterisk.org/jira/browse/ASTERISK-27259?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=239330#comment-239330 ] 

lvl commented on ASTERISK-27259:
--------------------------------

Preliminary testing on my end shows that most endpoints handle this behavior gracefully, but not all of them. Apart from Jitsi I observed a Snom phone replying to the re-INVITE with an empty set of payloads, which means the call doesn't terminate but proceeds without flowing audio. The strategy in https://gerrit.asterisk.org/#/c/6759/ looks like a great improvement for broad compatibility, thank you!

> chan_pjsip: Outgoing leg does not use all configured codecs, but subset based on caller
> ---------------------------------------------------------------------------------------
>
>                 Key: ASTERISK-27259
>                 URL: https://issues.asterisk.org/jira/browse/ASTERISK-27259
>             Project: Asterisk
>          Issue Type: Bug
>      Security Level: None
>          Components: Channels/chan_pjsip
>    Affects Versions: 15.0.0-rc1
>         Environment: Ubuntu 16.04 LTS
>            Reporter: lvl
>            Assignee: Unassigned
>      Target Release: 15.0.0, 15.1.0
>
>         Attachments: asterisk transcoding.txt, notranscode_forcemediaoffer.txt, notranscode_regular.txt, pjsip_wizard.conf, sip.conf
>
>
> Asterisk is refusing to perform transcoding between two PJSIP channels that don't share a common codec capability. Reproducing is simple:
> - Create two PJSIP endpoints with a limited set of allowed codecs, for example "g722,alaw"
> - Launch a SIP phone using the first endpoint's credentials with only the g722 codec enabled
> - Launch a SIP phone using the second endpoint's credentials with only the alaw codec enabled
> - Create a simple dialplan so endpoint1 can dial PJSIP/endpoint2
> Expected: Asterisk will use g722 on the 1st channel, use alaw on the 2nd channel, and transcode between them
> Observed: Asterisk will try to force endpoint2 to use g722 even though its SDP doesn't contain it. The call will fail. Whichever codec is used on the incoming channel, will be forced onto the outgoing channel as well.
> The following things don't make a difference:
> - Setting asymmetric_rtp_codec to yes or no
> - Setting preferred_codec_only to yes or no
> - Answer()'ing the incoming call before the outgoing Dial()
> - Limiting the "allow" list of codecs for endpoint1 to only "g722" and for endpoint2 to only "alaw"
> The only thing that made a difference is using the PJSIP_MEDIA_OFFER function in a pre-dial handler. Setting PJSIP_MEDIA_OFFER(audio)=g722,alaw,ulaw will make Asterisk offer all these 3 codecs in the outgoing call's SDP. However, immediately after the call is answered by endpoint2, Asterisk sends a re-invite to endpoint1 offering only endpoint2's codecs, causing endpoint1 to drop the call.
> Exactly the same setup (same dialplan, same Asterisk version, same phone configuration) works fine using chan_sip! Attached are the configuration files used and the logfile for the two scenarios.



--
This message was sent by Atlassian JIRA
(v6.2#6252)



More information about the asterisk-bugs mailing list