[OpenSIPS-Users] codec_delete() not working in 3.0

Bogdan-Andrei Iancu bogdan at opensips.org
Mon Sep 30 09:49:56 EDT 2019


Hi Mark,

When calling RTPengine, the changes done by the `codec_delete` are lost 
- this is a typical problem when you try to do several changes over the 
same part of the message.

Have you tried strip the codecs also from rtpengine (there is a `strip` 
option there for removing codes)

Regards,

Bogdan-Andrei Iancu

OpenSIPS Founder and Developer
   https://www.opensips-solutions.com
OpenSIPS Summit 2019
   https://www.opensips.org/events/Summit-2019Amsterdam/

On 9/27/19 3:05 PM, Mark Farmer wrote:
> I am using rtpengine_offer etc later on. Would that add stuff back in?
>
>
> On Fri, 27 Sep 2019 at 11:28, Bogdan-Andrei Iancu <bogdan at opensips.org 
> <mailto:bogdan at opensips.org>> wrote:
>
>     Hi MArk,
>
>     Simply injecting your SDP in a basic script like:
>
>     route{
>
>         # Codecs we do NOT support!
>         $avp(BadCodec) = "G729";
>         $avp(BadCodec) = "G729a";
>
>         for ($var(ToDelete) in $(avp(BadCodec)[*]))
>             if (codec_delete("$var(ToDelete)")) {
>                 xlog("CUSTOM_LOG: Invalid codec detected and deleted:
>     $var(ToDelete)");
>             }
>
>         forward();
>         exit;
>     }
>
>     shows that the codec delete works:
>
>     v=0
>     o=- 1569572039 1569572039 IN IP4 xxx.xxx.xxx.xxx
>     s=Polycom IP Phone
>     c=IN IP4 xxx.xxx.xxx.xxx
>     b=AS:512
>     t=0 0
>     m=audio 2226 RTP/AVP 9 8 0 18 127
>     a=rtpmap:9 G722/8000
>     a=rtpmap:8 PCMA/8000
>     a=rtpmap:0 PCMU/8000
>     a=rtpmap:18 G729/8000
>     a=fmtp:18 annexb=no
>     a=rtpmap:127 telephone-event/8000
>     m=video 2228 RTP/AVP 109 34
>     a=rtpmap:109 H264/90000
>     a=fmtp:109 profile-level-id=42800d; packetization-mode=0
>     a=rtpmap:34 H263/90000
>     a=fmtp:34 CIF=1;QCIF=1;SQCIF=1
>
>     results in:
>
>     v=0
>     o=- 1569572039 1569572039 IN IP4 xxx.xxx.xxx.xxx
>     s=Polycom IP Phone
>     c=IN IP4 xxx.xxx.xxx.xxx
>     b=AS:512
>     t=0 0
>     m=audio 2226 RTP/AVP 9 8 0 127
>     a=rtpmap:9 G722/8000
>     a=rtpmap:8 PCMA/8000
>     a=rtpmap:0 PCMU/8000
>     a=rtpmap:127 telephone-event/8000
>     m=video 2228 RTP/AVP 109 34
>     a=rtpmap:109 H264/90000
>     a=fmtp:109 profile-level-id=42800d; packetization-mode=0
>     a=rtpmap:34 H263/90000
>     a=fmtp:34 CIF=1;QCIF=1;SQCIF=1
>
>
>     Are you sure you are not doing any other SDP oriented change, like
>     rtpengine / rtpproxy ?
>
>     I tested against 2.4 version
>
>     Regards,
>
>     Bogdan-Andrei Iancu
>
>     OpenSIPS Founder and Developer
>        https://www.opensips-solutions.com
>     OpenSIPS Summit 2019
>        https://www.opensips.org/events/Summit-2019Amsterdam/
>
>     On 9/26/19 6:37 PM, Mark Farmer wrote:
>>     Been looking at this for a while now and it just won't play ball.
>>     I have an avp defined:
>>
>>     # Codecs we do NOT support!
>>     $avp(BadCodec) = "G729";
>>     $avp(BadCodec) = "G729a";
>>
>>     Then I use a for each to remove any instances of the codecs:
>>
>>     for ($var(ToDelete) in $(avp(BadCodec)[*]))
>>                     if (codec_delete($var(ToDelete))) {
>>     xlog("CUSTOM_LOG: Invalid codec detected and deleted:
>>     $var(ToDelete)");
>>                     }
>>
>>     sipmsgops reports that it's trying to remove codecs:
>>
>>     DBG:sipmsgops:codec_delete: deleting codec <G729a> with clock <>
>>     ---
>>     DBG:sipmsgops:codec_delete: deleting codec <G729> with clock <>
>>     ---
>>
>>     My custom logs only generate a single entry since only G729 is
>>     present in SDP:
>>
>>     CUSTOM_LOG: Invalid codec detected and deleted: G729
>>
>>     But when the call is routed, the G729 codecs remain in the SDP:
>>
>>     a=rtpmap:18 G729/8000
>>
>>     Can anyone suggest why might that be?
>>
>>     Regards
>>     Mark.
>>
>>
>>
>>     _______________________________________________
>>     Users mailing list
>>     Users at lists.opensips.org  <mailto:Users at lists.opensips.org>
>>     http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>
>
>
> -- 
> Mark Farmer
> farmorg at gmail.com <mailto:farmorg at gmail.com>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.opensips.org/pipermail/users/attachments/20190930/bc391eb0/attachment.html>


More information about the Users mailing list