I have asterisk 1.2.18 running on a new system we just installed. Although I've used AGIs many times in the past, I'm stumped on this one. It may just be a simple issue that I need another eyeset to look at. My AGI does the following: #!/usr/bin/perl #Load a few modules... use Asterisk::AGI; use DBI; $AGI = new Asterisk::AGI; #Grab input from Asterisk my %input = $AGI->ReadParse(); #Some Debugging $AGI->exec('SayDigits',$ARGV[0]); exit; -------- All seems fine. If I run the script from the command line it works as expected: [root at efax agi-bin]# ./GetEmailFromDID.agi 333 EXEC SayDigits "333" However, when actually running in practice I get: -- Executing AGI("Zap/23-1", "GetEmailfromDID.agi|5706016716") in new stack -- Launched AGI Script /var/lib/asterisk/agi-bin/GetEmailfromDID.agi -- AGI Script GetEmailfromDID.agi completed, returning 0 -------- extensions.conf [macro-faxreceive] exten => s,1,Set(FAXFILE=/var/spool/asterisk/fax/${UNIQUEID}.tif) exten => s,2,agi(GetEmailfromDID.agi|${CALLERID(number)}) exten => s,3,rxfax(${FAXFILE}) exten => s,104,Set(EMAILADDR=faxbin at efaxplace.net) exten => s,105,Goto(3) Any thoughts on why asterisk doesn't seem to be passing anything to the script and the script doesn't seem to be passing anything back? When I call I do not hear the digits read to me, instead I just get thrown to the next object after the digit reading. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.digium.com/pipermail/asterisk-users/attachments/20071114/2cb7b8ad/attachment.htm
On Wed, 14 Nov 2007, Matt wrote:> I have asterisk 1.2.18 running on a new system we just installed. > Although I've used AGIs many times in the past, I'm stumped on this one. > All seems fine. If I run the script from the command line it works as > expected: > However, when actually running in practice I get: > -- Executing AGI("Zap/23-1", "GetEmailfromDID.agi|5706016716") in new > stack > -- Launched AGI Script /var/lib/asterisk/agi-bin/GetEmailfromDID.agi > -- AGI Script GetEmailfromDID.agi completed, returning 0 > -------- > Any thoughts on why asterisk doesn't seem to be passing anything to the > script and the script doesn't seem to be passing anything back?Permissions? Brett
Make sure /usr/bin/perl can be reached. Also try in your CLI: agi debug Same case happens when I do not have php-cli installed for php AGI scripts. Mindaugas Kezys http://www.kolmisoft.com MOR - Advanced Billing for Asterisk PBX From: asterisk-users-bounces at lists.digium.com [mailto:asterisk-users-bounces at lists.digium.com] On Behalf Of Matt Sent: Wednesday, November 14, 2007 4:00 PM To: Asterisk Users Mailing List - Non-Commercial Discussion Subject: [asterisk-users] Problem with AGI Script I have asterisk 1.2.18 running on a new system we just installed. Although I've used AGIs many times in the past, I'm stumped on this one. It may just be a simple issue that I need another eyeset to look at. My AGI does the following: #!/usr/bin/perl #Load a few modules... use Asterisk::AGI; use DBI; $AGI = new Asterisk::AGI; #Grab input from Asterisk my %input = $AGI->ReadParse(); #Some Debugging $AGI->exec('SayDigits',$ARGV[0]); exit; -------- All seems fine. If I run the script from the command line it works as expected: [root at efax agi-bin]# ./GetEmailFromDID.agi 333 EXEC SayDigits "333" However, when actually running in practice I get: -- Executing AGI("Zap/23-1", "GetEmailfromDID.agi|5706016716") in new stack -- Launched AGI Script /var/lib/asterisk/agi-bin/GetEmailfromDID.agi -- AGI Script GetEmailfromDID.agi completed, returning 0 -------- extensions.conf [macro-faxreceive] exten => s,1,Set(FAXFILE=/var/spool/asterisk/fax/${UNIQUEID}.tif) exten => s,2,agi(GetEmailfromDID.agi|${CALLERID (number)}) exten => s,3,rxfax(${FAXFILE}) exten => s,104,Set(EMAILADDR=faxbin at efaxplace.net) exten => s,105,Goto(3) Any thoughts on why asterisk doesn't seem to be passing anything to the script and the script doesn't seem to be passing anything back? When I call I do not hear the digits read to me, instead I just get thrown to the next object after the digit reading. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.digium.com/pipermail/asterisk-users/attachments/20071114/b6178935/attachment.htm
What exactly does the write("SET VARIABLE myvariable"); do? I understand the Set(CALLERID.... sets the calleridnumber equal to ${myvariable}, but then do you use the write to read that in? Or is that to dump something back out? Just want to make sure I understand clearly. On Nov 19, 2007 6:00 AM, Chris Blunt <chris.blunt at entropy-it.com> wrote:> Hello, > > I had a similar problem with a PHP AGI script. I'm not sure if it's a bug > or what, but it seems the new way of setting variables is an application, > no > way could I get it to work. > > In the end I set a user defined variable in the AGI like this: write("SET > VARIABLE myvariable"); > > Then in the dial play did something like > Set(CALLERID(number)=${myvariable}) > > It may not be the most elegant solution but it works fine for me. > > Chris > > > -----Original Message----- > From: asterisk-users-bounces at lists.digium.com > [mailto:asterisk-users-bounces at lists.digium.com] On Behalf Of Eric > "ManxPower" Wieling > Sent: 18 November 2007 16:48 > To: Asterisk Users Mailing List - Non-Commercial Discussion > Subject: Re: [asterisk-users] Problem with AGI Script > > didier wrote: > > Callerid(number) ? or callerid(num) ? > > Grasshopper, you will find many answers you seek by looking in > /path/to/src/asterisk-1.4/doc/channelvariables.txt > > _______________________________________________ > --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 > > > _______________________________________________ > --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 >-------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.digium.com/pipermail/asterisk-users/attachments/20071119/1dcf7bbd/attachment.htm
Wow I can't believe I missed this, and I can't believe no one else saw it! Look at the word FROM in both the script, and the way it is called. 'From' and 'from'... that doesn't work. On Nov 14, 2007 8:59 AM, Matt <mhoppes at gmail.com> wrote:> I have asterisk 1.2.18 running on a new system we just installed. > Although I've used AGIs many times in the past, I'm stumped on this one. It > may just be a simple issue that I need another eyeset to look at. > > My AGI does the following: > #!/usr/bin/perl > > #Load a few modules... > use Asterisk::AGI; > use DBI; > > $AGI = new Asterisk::AGI; > > #Grab input from Asterisk > my %input = $AGI->ReadParse(); > > > #Some Debugging > $AGI->exec('SayDigits',$ARGV[0]); > exit; > -------- > All seems fine. If I run the script from the command line it works as > expected: > [root at efax agi-bin]# ./GetEmailFromDID.agi 333 > EXEC SayDigits "333" > > However, when actually running in practice I get: > -- Executing AGI("Zap/23-1", "GetEmailfromDID.agi|5706016716") in new > stack > -- Launched AGI Script /var/lib/asterisk/agi-bin/GetEmailfromDID.agi > -- AGI Script GetEmailfromDID.agi completed, returning 0 > -------- > extensions.conf > [macro-faxreceive] > exten => s,1,Set(FAXFILE=/var/spool/asterisk/fax/${UNIQUEID}.tif) > exten => s,2,agi(GetEmailfromDID.agi|${CALLERID (number)}) > exten => s,3,rxfax(${FAXFILE}) > exten => s,104,Set(EMAILADDR=faxbin at efaxplace.net) > exten => s,105,Goto(3) > > > Any thoughts on why asterisk doesn't seem to be passing anything to the > script and the script doesn't seem to be passing anything back? When I call > I do not hear the digits read to me, instead I just get thrown to the next > object after the digit reading. >-------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.digium.com/pipermail/asterisk-users/attachments/20071121/bf9721ae/attachment.htm