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

Bogdan-Andrei Iancu bogdan at opensips.org
Fri Sep 27 06:28:33 EDT 2019


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
> http://lists.opensips.org/cgi-bin/mailman/listinfo/users

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


More information about the Users mailing list