[OpenSIPS-Users] is_request(), is_reply() functions in OpenSips

Vitalii Aleksandrov vitalik.voip at gmail.com
Tue Feb 25 09:02:57 EST 2020


I'm also used to have is_request()/is_reply() and when switched to 
opensips started to use following helpers:

route[IS_REQUEST] {
         if (route(IS_REPLY))
                 return(-1);
         else
                 return(1);
}

route[IS_REPLY] {
         if ($mb =~ "^SIP/2\.0")
                 return(1);
         else
                 return(-1);
}


Of course checking $rs should be really better that my regexp.

> Hi Răzvan,
>
> Thanks! I totally forgot about that option!
> Would there be a performance difference when using route params vs 
> just testing the $rs value? Since route params are totally new to me, 
> I’m not sure if they require additional processing time. Pretty sure 
> performance wouldn’t be an issue since we’re dealing with OpenSips 
> built to be high performance.
>
> Regards,
>
> Grant
>
> _______________________________________________
> 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/20200225/af8e0d9a/attachment.html>


More information about the Users mailing list