[OpenSIPS-Users] Replace avp_check() for opensips 3.5

Alain Bieuzent alain.bieuzent at free.fr
Wed Sep 24 14:24:32 UTC 2025


Thanks Liviu,

 

The correct way is single or double quotation mark ?

Because un documentation it’s written :

 

=~ - regular expression matching (e.g. $rU =~ '^1800*' is "$rU begins with 1800" )

 

Regards

 

De : Users <users-bounces at lists.opensips.org> au nom de Liviu Chircu <liviu at opensips.org>
Répondre à : OpenSIPS users mailling list <users at lists.opensips.org>
Date : mercredi 24 septembre 2025 à 16:04
À : <users at lists.opensips.org>
Objet : Re: [OpenSIPS-Users] Replace avp_check() for opensips 3.5

 

Hello Alain,

I checked the avp_check (ha!) code, and it also seems to be using the "case-insensitive" regex flag.  Which means, the following is the direct equivalent in modern opensips.cfg syntax:

if ($avp(codecs) =~ "PCMA")
{
     xlog("L_INFO", "$ci|Log codecs|PCMA exist in SDP and in DB - X-CODEC: PCMA");
}

Case-insensitive regex matching, just as before.

Best regards,

On 24.09.2025 15:55, Alain Bieuzent via Users wrote:

Hello everyone,

 

With version 3.5, the avp_check() function no longer exists and must be replaced.

What would be the "cleanest" way to perform the following check:

 

if (avp_check("$avp(codecs)","re/PCMA/g"))

{

xlog("L_INFO", "$ci|Log codecs|PCMA exist in SDP and in DB - X-CODEC: PCMA");

}

 

Thanks in advance

Alain



_______________________________________________
Users mailing list
Users at lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users
-- 
Liviu Chircu
www.opensips-solutions.com | www.siphub.com
_______________________________________________ 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/20250924/769e7657/attachment-0001.html>


More information about the Users mailing list