[OpenSIPS-Devel] Is it possible to return 0 from an exported function?

Bogdan-Andrei Iancu bogdan at opensips.org
Fri Jan 11 16:46:27 CET 2013


I second what Saul said! It is the same case as for set_count() :
      http://www.opensips.org/html/docs/modules/1.8.x/cfgutils.html#id250444

Regards,

Bogdan-Andrei Iancu
OpenSIPS Founder and Developer
http://www.opensips-solutions.com


On 01/11/2013 10:19 AM, Saúl Ibarra Corretgé wrote:
> On Jan 11, 2013, at 8:25 AM, Peter Lemenkov wrote:
>
>> Hello.
>> I'm writing a function (extending sipmsgops actually) which returns
>> Payload ID. Obviously it should return 0 in case of PCMU/8000/1 which
>> seems to be impossible.
>>
>> As a temporary solution I'm thinking of returing PayloadID+1 but this
>> looks really strange. Maybe there are some other ways to return actual
>> 0 from a module's exported function?
>>
> Not that I know of. If a function causes 0 to be returned to the script routing will be aborted AFAIK.
>
> What about this: you can take an AVP as an argument and save the value there, then your function would return 1 if all went ok or -1 if there was some kind of error.
>
>
> Regards,
>
> --
> Saúl Ibarra Corretgé
> AG Projects
>
>
>
>
> _______________________________________________
> Devel mailing list
> Devel at lists.opensips.org
> http://lists.opensips.org/cgi-bin/mailman/listinfo/devel
>



More information about the Devel mailing list