[arm-allstar] agi vs allstar -rx commands
Lowell
lowell.brunson at gmail.com
Sat Apr 8 03:17:54 EST 2017
Doug:
I believe your version 1.5 is based on Asterisk 14.
A list of AGI commands can be found here ( I understand it is an API but
the web page calls them AGI commands).:
https://wiki.asterisk.org/wiki/display/AST/Asterisk+14+AGI+Commands
That is where I find the command "SET VARIABLE answer $VALUE" you used in
your example script.
In the list of commands, there is a "EXEC APPLICATION OPTIONS" command. I
thought app_rpt was an asterisk application and I could make some calls to
it. Maybe I can only call the few things that can be called from the
dialplan.
The other way I can coerce asterisk/allstar to do something from a script
is to call asterisk with the -rx options followed by a command string. I'm
sure you know this because I have seen some of your scripts. I was just
under the impression that AGI was the "new thing" to replace calling
"asterisk -rx". I was hopeful that everything I could do with what I
thought was "the old way" could be done the AGI way. Guess I was wrong.
On Sat, Apr 8, 2017 at 12:40 AM, "Doug Crompton via arm-allstar" <
arm-allstar at hamvoip.org> wrote:
> Lowell,
>
> AGI is an interface not a language. See
> https://www.voip-info.org/wiki-Asterisk+AGI
>
> You need to call Asterisk however you would call any system command in the
> scripting language you are using. What scripting language are you using?
> Bash, Perl, Python? Each has a method to pass variable to/from Asterisk
> via AGI. Here is a simple bash example showing the passing of a filename
> but it could be anything passed to a bash script and a value returned.
>
> In extensions.conf
>
> exten => 772,n,AGI(testit.sh|"node-id")
> exten => 772,n,NoOp(Received answer: ${answer})
> exten => 772,n,SayDigits(${answer})
>
> script called testit.sh
>
> #!/bin/bash
> # Arguments from AGI call passed as $1, $2, $3, etc.
> /usr/bin/asterisk -rx "rpt localplay 40000 $1"
> # Return value example
> VALUE=1234
> echo -e "SET VARIABLE answer $VALUE"
>
>
>
> *73 Doug*
>
> *WA3DSP*
>
> *http://www.crompton.com/hamradio <http://www.crompton.com/hamradio>*
>
> On Sat, Apr 8, 2017 at 2:41 AM, "Lowell via arm-allstar" <
> arm-allstar at hamvoip.org> wrote:
>
> > I guess I don't have agi figured out yet.
> >
> > I can execute
> > allstar -rx "rpt localplay 1999 rpt/down"
> > successfully.
> >
> > I thought I could do something similar in my agi script like
> > echo "exec rpt localplay 1999 rpt/down" but no amount of grouping with
> > quotes satisfies the agi interface. I usually see a message like:
> >
> > Apr 7 23:39:10] WARNING[1995]: app_rpt.c:20759 rpt_exec: Cannot find
> > specified system node localplay
> >
> > How do I find out what rpt commands are available from the agi
> interface?
> >
> > Lowell
> > _______________________________________________
> >
> > arm-allstar mailing list
> > arm-allstar at hamvoip.org
> > http://lists.hamvoip.org/cgi-bin/mailman/listinfo/arm-allstar
> >
> > Visit the BBB and RPi2/3 web page - http://hamvoip.org
> >
> >
> _______________________________________________
>
> arm-allstar mailing list
> arm-allstar at hamvoip.org
> http://lists.hamvoip.org/cgi-bin/mailman/listinfo/arm-allstar
>
> Visit the BBB and RPi2/3 web page - http://hamvoip.org
>
More information about the arm-allstar
mailing list