[asterisk-bugs] [JIRA] (ASTERISK-25517) PCMA codec negotiated.. Asterisk unexpectedly uses G722 for first second or so of call before sending PCMA

Asterisk Team (JIRA) noreply at issues.asterisk.org
Tue Jan 2 08:41:51 CST 2018


     [ https://issues.asterisk.org/jira/browse/ASTERISK-25517?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Asterisk Team updated ASTERISK-25517:
-------------------------------------

    Assignee: Joshua Colp  (was: hristo)
      Status: Open  (was: Waiting for Feedback)

> PCMA codec negotiated.. Asterisk unexpectedly uses G722 for first second or so of call before sending PCMA
> ----------------------------------------------------------------------------------------------------------
>
>                 Key: ASTERISK-25517
>                 URL: https://issues.asterisk.org/jira/browse/ASTERISK-25517
>             Project: Asterisk
>          Issue Type: Bug
>      Security Level: None
>          Components: Channels/chan_sip/CodecHandling, Core/RTP
>    Affects Versions: 11.20.0
>         Environment: Debian 7.8, x64
>            Reporter: hristo
>            Assignee: Joshua Colp
>            Severity: Minor
>         Attachments: debug.log, sending-g722-instead-of-g711.pcap
>
>
> Asterisk starts sending G722 even though in SDP from Asterisk as well as in SDP from the endpoint the first priority codec is set to PCMA. This only happens for about a second before Asterisk switches to PCMA, but it seems to be a problem for some IP phones and as a result the calls end up having one way audio.
> I'd expect that when Asterisk offers PCMA as primary codec in INVITE SDP and when it receives PCMA as primary codec in 200 OK from telephone, that it will only send PCMA, but this isn't the case.
> The problem can be reproduced with a default Asterisk installation by simply adding two sip.conf endpoints:
> {code}
> [Alice]
> host=dynamic
> type=friend
> secret=1000
> nat=no
> directmedia=no
> disallow=all
> allow=alaw
> [Bob]
> host=dynamic
> type=friend
> secret=2000
> nat=no
> directmedia=no
> disallow=all
> allow=g722
> allow=alaw
> allow=ulaw
> {code}
> and by adding a single line in extensions.conf in the \[public\] context:
> {code}
> exten => 2000,1,Dial(SIP/Bob)
> {code}
> What then happens when Alice calls 2000 (Bob) is:
> # Alice is configured with PCMA only, so she sends only PCMA in INVITE SDP
> # Asterisk sends an INVITE to Bob with the following codec order in SDP: PCMA, G722, PCMU. Which is presumably done so in order to try to avoid transcoding.
> # Bob replies with 200 OK with codec order of PCMA, G722, which results in 200 OK with PCMA in SDP being sent to Alice.
> At this point all devices and Asterisk have expressed preference for PCMA. Asterisk however, starts sending G722 RTP to Bob for about a second, before it switches to PCMA.
> A workaround is to set the codec order in sip.conf so that the primary codec of Bob matches the codec sent by Alice in INVITE SDP.
> Attached:
> - sending-g722-instead-of-g711.pcap - packet capture done on the Asterisk server
> - debug.log - Asterisk debug log for the same call, with rtp and sip debugging enabled.



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



More information about the asterisk-bugs mailing list