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

Saúl Ibarra Corretgé saul at ag-projects.com
Fri Jan 11 09:19:56 CET 2013


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






More information about the Devel mailing list