[asterisk-users] How to write a function with a return value in Asterisk

Mike
Wed, 08 Aug 2007 15:24:45 -0000

Hi,

Is it possible to write a function in Asterisk, that returns a value?  Sort
of like any programming language allows?

For example, I`d like function ReturnSipReg to return the right
SipRegistration to dial, based on some value so that I could use it in my
dial plan:

i.e:

exten => 1234,1,Dial(SIP/ReturnSipReg(John))
; would dial John's extension, which I don't know at this point to which
Sip
Registration it's associated. ReturnSipReg would find that out for me.


Unfortunately, doing it in two steps (by setting a variable and using it
after) can't be done, I need it to all be done in the same Asterisk
priority. See my previous email for background ("Buddy watch and the hint
priority - brain teaser").


Any help is extremely appreciated.

Mike
-------------- next part --------------
An HTML attachment was scrubbed...