[SR-Users] how to check $ua

Daniel-Constantin Mierla miconda at gmail.com
Sun Jan 14 11:50:26 CET 2018


Besides having the negation (!) as remarked in another response, to
match starting with in a regexp you have to use ^ at the beginning, like:

$au =~ "^32"

Without ^, any $au that has 32 inside will match. Then, there is also a
function starts_with() that can be used for this particular case.

The $au is available after doing the authentication.

Cheers,
Daniel


On 13.01.18 18:53, David Villasmil wrote:
> I'm trying to verify the auth username begins with, i.e. "32", but i'm
> using in AUTH route:
>
> if( !($au=~"32") ){
>  do something
> }
>
> and that's not working, and i don't get why?
>
>
> Regards,
>
> David Villasmil
> email: david.villasmil.work at gmail.com
> <mailto:david.villasmil.work at gmail.com>
> phone: +34669448337
>>
>
> _______________________________________________
> Kamailio (SER) - Users Mailing List
> sr-users at lists.kamailio.org
> https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users

-- 
Daniel-Constantin Mierla
www.twitter.com/miconda -- www.linkedin.com/in/miconda
Kamailio Advanced Training - March 5-7, 2018, Berlin - www.asipto.com
Kamailio World Conference - May 14-16, 2018 - www.kamailioworld.com

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.kamailio.org/pipermail/sr-users/attachments/20180114/46f65b0b/attachment.html>


More information about the sr-users mailing list