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

Mike list at virtutel.ca
Wed Aug 8 11:10:47 CDT 2007


I can be a bit slow sometimes, but you said that it's not possible, and on
the other hand told me to write my own function (which appears to contradict
the first statement).

Your example of the use of a function is exactly what I need (Create a
function and Dial(SIP/${MY_FUNKY_NEW_FUNC(ooga)})) , what I don't know is
how to actually write the function with a return value (and Googling this
doesn't get me any relevant result, apparently).

I'd be most thankful for some link to a page that shows how to write such a
function in Asterisk.

Mike

-----Original Message-----
From: asterisk-users-bounces at lists.digium.com
[mailto:asterisk-users-bounces at lists.digium.com] On Behalf Of Andrew
Kohlsmith
Sent: Wednesday, August 08, 2007 11:59
To: asterisk-users at lists.digium.com
Subject: Re: [asterisk-users] How to write a function with a return
valueinAsterisk

On Wednesday 08 August 2007 11:41:38 am Mike wrote:
> But what if I wanted to write my own custom application for one 
> specific purpose, I can't set a return value?  It's not possible at all?

Not possible, to my knowledge.

> Let me put it this way then, if I needed to have some processing all 
> done in the same Asterisk priority (in my case, I want to use the "hint"
> priority but I need to find the value of a variable and use it in the 
> same line).

Create a function and Dial(SIP/${MY_FUNKY_NEW_FUNC(ooga)})

> Exten => 12345,hint,Dial(SIP/${A}) ; I need to know ${A} first, but I 
> can't know before this line is called (it's very DB driven).

Give the function method a try; that's about the only way I can think of
doing something like that...  Note that if it's a very DB driven system, you
can use func_odbc to do what you want by declaring an SQL statement as a
function.

-A.

_______________________________________________
--Bandwidth and Colocation Provided by http://www.api-digital.com--

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users




More information about the asterisk-users mailing list