[arm-allstar] say text only to phone
Doug Crompton
wa3dsp at gmail.com
Wed Apr 5 08:09:20 EST 2017
Lowell,
You need to use AGI, Asterisk Gateway Interface. This is a method of
passing variables to/from any external program. Here is a link to some
explanation. There are other links just Google Asterisk AGI. Remember we
are using 1.4 so some things may not apply in some examples. Below is an
example I use in my home Asterisk PBX system. This is also 1.4 Asterisk so
would be the same for V1.5. I am using Perl in the application but it could
be bash, python, etc.
https://www.voip-info.org/wiki-Asterisk+AGI
This is in my extensions file. I basically call a program called
/var/lib/asterisk/agi-bin/agi-callerid.agi The best thing to do is
experiment with sending a variable and then passing it back modified in
some way to see how it works.
This is a portionof the extensions.conf file. Here I am passing
CALLERID(num) and CALLERID(name) and getting back blacklist and
answermachine.
[from-pstn]
exten => s,1,AGI(agi-callid.agi)
exten => s,2,noop(${CALLERID(num)})
exten => s,3,noop(${CALLERID(name)})
exten => s,4,noop(${blacklist})
exten => s,5,noop(${answermachine})
exten => s,6,Gotoif($[ ${blacklist} = 1 ]? 90:7)
exten => s,7,Gotoif($[ ${answermachine} = 1 ]? 80:60)
And this is a portion of the /var/lib/asterisk/agi-callerid.agi Perl
script. It must be executable.....
#!/usr/bin/perl
#
# Perl Script to screen incoming callerid for spam calls
# Doug Crompton - 1/2014
#
use Asterisk::AGI;
$AGI = new Asterisk::AGI;
my %input = $AGI->ReadParse();
$|=1;
my $blacklist = 0;
my $answermachine = 0;
my $ret = 0;
#exit;
Rest of processing code .........
*73 Doug*
*WA3DSP*
*http://www.crompton.com/hamradio <http://www.crompton.com/hamradio>*
On Wed, Apr 5, 2017 at 2:59 AM, "Lowell via arm-allstar" <
arm-allstar at hamvoip.org> wrote:
> The phone zoiper - a soft phone that speaks iax2.
>
>
> It seems to me that using Playback in the extensions.conf file only goes
> out to the phone because the phone hasn't been bridged to the app_rpt yet.
>
> The last few lines of your example show the connection on the last line...
> exten=27225,n,Playback(digits/5)
> exten=27225,n,Playback(rpt/connected)
> exten=27225,1,rpt(27225|P)
>
> Yes, I am using the autopatch technique. It successfully calls a bash
> script that looks kind of like this:
> #!/bin/bash
> FREQ=$(rigctl -m2 f )
> MODE=$(rigctl -m2 m | head -1)
> /usr/local/sbin/speaktext.sh "${FREQ} ${MODE}" ${NODE1}
>
> The sound goes to both the phone and the radio.
>
> I'm not sure how to pass a parameter back to the extensions file in a
> useable way.
>
> 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
>
>
More information about the arm-allstar
mailing list