Bug in sdp_neg/match_offer with prefer_remote_codec=0

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Regis,

Just fixed this in https://trac.pjsip.org/repos/ticket/1385.

Thanks for the report.

BR,
nanang


2011/10/7 R?gis Montoya <r3gis.3r at gmail.com>:
> Hi,
>
> I found a bug in sdp_neg.c "match_offer" method when you disable
> prefer_remote_codec_order (set PJMEDIA_SDP_NEG_PREFER_REMOTE_CODEC_ORDER to
> 0).
> (Tested on pjsip-1.x but regarding code should also affect pjsip-2.x)
>
> In this case master and slave pjmedia_sdp_media are inverted.
> As consequence, when tests are done on rtpmap the or_ parameter here
> http://trac.pjsip.org/repos/browser/pjproject/trunk/pjmedia/src/pjmedia/sdp_neg.c#L1255
> can be the one generated by pjsip and lr the one of the offer.
>
> In this case the test made at this line is not valid cause obviously
> or_.param will be empty in case of a single channel codec (pjsip does not
> add channel counts if 1 which is fine, but other side could add...).
> So test will fail if the other side add the channel count 1, while it should
> have succeeded because we have something like remote AMR/8000/1 and local
> AMR/8000 .
>
> So, in this case if remote party add channel count in rtpmap and
> prefer_remote_codec_order is disabled, it will result in unexpected
> behavior.
>
> On my side I did a quick fix :
> -------------------------------
> ? ? ? ? ? ?pjmedia_sdp_rtpmap remote_r = or_;
> ? ? ? ? ? ?if(!prefer_remote_codec_order){
> ? ? ? ? ? ? ? ?remote_r = lr;
> ? ? ? ? ? ?}
> ? ? ? ? ? ?if (!pj_stricmp(&or_.enc_name, &lr.enc_name) &&
> ? ? ? ? ? ? ? ?or_.clock_rate == lr.clock_rate &&
> ? ? ? ? ? ? ? ?(pj_stricmp(&or_.param, &lr.param)==0 ||
> ? ? ? ? ? ? ? ? (remote_r.param.slen==1 && *remote_r.param.ptr=='1')))
> ? ? ? ? ? ?{
> ....
> -------------------------------
> But I don't know if it is the best way to do that (maybe a pointer to param
> would be a better idea?).
>
> Regards,
> R?gis
>
> _______________________________________________
> Visit our blog: http://blog.pjsip.org
>
> pjsip mailing list
> pjsip at lists.pjsip.org
> http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org
>



[Index of Archives]     [Asterisk Users]     [Asterisk App Development]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [Linux API]
  Powered by Linux