[SR-Users] Return codes within a route

Jeff Bilyk jbilyk at gmail.com
Tue Feb 20 23:53:15 CET 2018


Thanks Muhammad, appreciate that clarification.

On Tue, Feb 20, 2018 at 5:10 PM, M S <shaheryarkh at gmail.com> wrote:

> Hi,
>
> My understanding is that return value of last statement becomes the return
> value of named route if none explicitly specified. Therefore i always
> explicitly return 1 or exit.
>
>> Muhammad.
> On Tue 20. Feb 2018 at 22:48, Jeff Bilyk <jbilyk at gmail.com> wrote:
>
>> Hello,
>>
>> Running into odd behaviour in Kamailio 5.0.2 and I'm hoping to clarify.
>> I have a simple route that uses the textops functions subst and remove_hf.
>> Other than that, there is nothing else done within the route.  In some
>> cases, the remove_hf function returns false as there are no matching
>> headers.
>>
>> Documentation in https://www.kamailio.org/wiki/cookbooks/5.0.x/core#
>> return seems to show that if there are no explicit return statements,
>> the route should return 1.  However, this route appears to be returning
>> -1.
>>
>> My question is: if a function within a route returns a negative value,
>> and there are no explicit return statements, will the entire route return
>> -1 (as it appears is happening), or should the route return 1 as the core
>> cookbook indicates?
>>
>> Thanks in advance,
>>
>> Jeff
>> _______________________________________________
>> Kamailio (SER) - Users Mailing List
>> sr-users at lists.kamailio.org
>> https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
>>
>
> _______________________________________________
> Kamailio (SER) - Users Mailing List
> sr-users at lists.kamailio.org
> https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
>
>


-- 
Jeff
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.kamailio.org/pipermail/sr-users/attachments/20180220/acffb764/attachment.html>


More information about the sr-users mailing list