[asterisk-users] Passing parameter from executable program to asterisk dialplan

Muro, Sam research at businesstz.com
Sun Jul 25 11:29:35 CDT 2010


Kyle Kienapfel wrote:
> On Sun, Jul 25, 2010 at 9:04 AM, Muro, Sam <research at businesstz.com>
> wrote:
>> Kyle Kienapfel wrote:
>>> On Sun, Jul 25, 2010 at 8:18 AM, Muro, Sam <research at businesstz.com>
>>> wrote:
>>>> I am having a problem understanding the way to retrieve some
>>>> parameters
>>>> to
>>>> asterisk via AGI or what ever method that fits. I have an executable
>>>> program that accept one parameter (CALLERID) and return customer
>>>> status
>>>> from the database server which can be printed in the console.
>>>>
>>>> #./retrive 0117473789
>>>> NAME: Franklin John
>>>> STATUS: Active
>>>>
>>>> Can someone advice on how i can catch this values from AGI or directly
>>>> on
>>>> dialplan.
>>>>
>>>> Thanks
>>>> Sam
>>>>
>>>> --
>>>
>>> Hopefully you can modify the executable
>>>
>>> #./retrieve 8675309
>>> SET VARIABLE name Jenny
>>> SET VARIABLE status Active
>>>
>>> When running an AGI asterisk expects to have a conversation with the
>>> application, so when the AGI does a command asterisk reports back with
>>> whether or not it worked. I know a person can set one variable that
>>> way, but when I got a need to set two variables I finally broke down
>>> and read the documentation on AGI's :)
>>>
>>> Start
>>> Readlines from input until line is blank
>>> print "SET VARIABLE name Jenny"
>>> readline
>>> print "SET VARIABLE status Active"
>>> End
>>>
>>> --
>>
>> Thanks,
>> So I you suggesting that the executable to changed to output say
>> cout <<"SET VARIABLE name Jenny";
>> and let the AGI retrieve them as per the pseudo you mentioned?
>>
>> Sam
>>
>
> Does doing that output a newline at the end of the line?
>
> If it doesn't you might want something more like (i am just guessing
> syntax here btw)
> cout <<"SET VARIABLE name Jenny" << ENDL;
> or
> cout <<"SET VARIABLE name Jenny\n";
>
> --
You are right. Both of them are correct syntax
I will give it a try and revert

Sam



More information about the asterisk-users mailing list