[asterisk-dev] [Code Review] 4505: Asterisk 13 PJSIP sends RTP packets in wrong byte order on Intel platform when using slin codec

Matt Jordan reviewboard at asterisk.org
Tue Mar 17 11:57:36 CDT 2015


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://reviewboard.asterisk.org/r/4505/#review14719
-----------------------------------------------------------



/tags/13.2.0/include/asterisk/codec.h
<https://reviewboard.asterisk.org/r/4505/#comment25284>

    I don't think you can trust that the codec will know its endianness. Looking at the resample code, I don't _think_ it actually determines the endianness of its encoding/decoding, and instead relies on the underlying machine to make that determination. As such, I don't think this should be a property on the codec structure.



/tags/13.2.0/include/asterisk/format.h
<https://reviewboard.asterisk.org/r/4505/#comment25286>

    Since the smoother already has flags that determine the endianness, an additional API call in the format API feels wrong. If anything, the need for a different endianness on the smoother should be determined up front when the smoother is created, and not through the format API.



/tags/13.2.0/res/res_rtp_asterisk.c
<https://reviewboard.asterisk.org/r/4505/#comment25288>

    I think your issue should be solved here.
    
    When you care a new smoother, you can specify whether or not it is BE or LE via the ast_smoother_set_flags call. The real issue is determining whether or not your machine is BE or LE.
    
    What distro/environment did you produce this issue on?



/tags/13.2.0/res/res_rtp_asterisk.c
<https://reviewboard.asterisk.org/r/4505/#comment25283>

    I don't think this flag is needed. 


- Matt Jordan


On March 16, 2015, 10:36 p.m., Frankie Chin wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://reviewboard.asterisk.org/r/4505/
> -----------------------------------------------------------
> 
> (Updated March 16, 2015, 10:36 p.m.)
> 
> 
> Review request for Asterisk Developers.
> 
> 
> Bugs: ASTERISK-24858
>     https://issues.asterisk.org/jira/browse/ASTERISK-24858
> 
> 
> Repository: Asterisk
> 
> 
> Description
> -------
> 
> In Asterisk 13.2.0 when SLIN codec is used in two Asterisk servers registered to one another via PJSIP, the RTP payload is sent in the wrong byte order. The patch addresses the following based on the correct behavior in Asterisk 12.8.1:
> 1) Save ptime = 20 as the framing in the ast_rtp_codecs structure when creating outgoing SDP packet (res_pjsip_sdp_rtp.c)
> 2) Do not copy the framing when copying the payload (rtp_engine.c)
> 3) Introduce the new "smoother_be" flagin the ast_codec structure. Set this flag = 1 for all the SLIN codecs (codec_builtin.c).
> 4) Check for this "smoother_be" flag before using the smoother on the data (res_rtp_asterisk.c)
> 
> 
> Diffs
> -----
> 
>   /tags/13.2.0/res/res_rtp_asterisk.c 433002 
>   /tags/13.2.0/res/res_pjsip_sdp_rtp.c 433002 
>   /tags/13.2.0/main/rtp_engine.c 433002 
>   /tags/13.2.0/main/format.c 433002 
>   /tags/13.2.0/main/codec_builtin.c 433002 
>   /tags/13.2.0/include/asterisk/format.h 433002 
>   /tags/13.2.0/include/asterisk/codec.h 433002 
> 
> Diff: https://reviewboard.asterisk.org/r/4505/diff/
> 
> 
> Testing
> -------
> 
> The patch was tested using the scenario described in ASTERISK-24858
> 
> 
> Thanks,
> 
> Frankie Chin
> 
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-dev/attachments/20150317/22c4204e/attachment-0001.html>


More information about the asterisk-dev mailing list