[asterisk-bugs] [JIRA] (ASTERISK-30337) res_pjsip_sdp_rtp: RTP not read before negotiation completes

Joshua C. Colp (JIRA) noreply at issues.asterisk.org
Thu Dec 1 10:10:51 CST 2022


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

Joshua C. Colp updated ASTERISK-30337:
--------------------------------------

    Summary: res_pjsip_sdp_rtp: RTP not read before negotiation completes  (was: RTP arriving from callee before SDP is sent in burst to caller)

> res_pjsip_sdp_rtp: RTP not read before negotiation completes
> ------------------------------------------------------------
>
>                 Key: ASTERISK-30337
>                 URL: https://issues.asterisk.org/jira/browse/ASTERISK-30337
>             Project: Asterisk
>          Issue Type: Bug
>      Security Level: None
>          Components: Channels/chan_pjsip, Core/RTP, Resources/res_pjsip_sdp_rtp, Resources/res_rtp_asterisk
>    Affects Versions: 13.38.3, 20.0.0
>         Environment: Debian Sid with packaged Asterisk 1:20.0.0~dfsg+~cs6.12.40431414-2.
>            Reporter: Alex Hermann
>         Attachments: media-before-sdp-1.log, media-before-sdp-1.pcap
>
>
> When RTP is received form an UAS before the UAS has sent an SDP answer, that RTP is sent to the caller in a single burst after the SDP answer  is received.
> Asterisk seems to open the port where RTP is to be received, but never actually reads from the socket until SDP is received. If the UAS sends RTP at this time, it gets queued by the OS. When SDP finally arrives, *all* RTP queued by the OS is read as fast as possible by Asterisk, resulting in a burst of forwarded RTP to the caller.
> RFC 3264 says:
> bq. Once the offerer has sent the offer, it MUST be prepared to receive media for any recvonly streams described by that offer. It MUST be prepared to send and receive media for any sendrecv streams in the offer, 
> So, I think this means that Asterisk should not only open the RTP port, but also read from it directly. I don't care much if the RTP that arrived before the SDP gets dropped or forwarded, although the latter seems the proper behavior.
> The issue with forwarding in a burst, is that there are some devices in the wild that seem to have an unlimited (jitter)buffer and buffer _all_ received RTP and play/relay it according to the RTP timestamps. This means that, because of this bug, all audio gets delayed by the time between first RTP and reception of SDP, which often equals the ringtime, which may well be in the tens of seconds.
> I'll attach Asterisk log and a pcap illustrating the issue and a sipp script to reproduce it.
> I can reliably reproduce this on Asterisk 13.38+ and 20.0. I did not try intermediate versions.



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



More information about the asterisk-bugs mailing list