[asterisk-users] Problem with AGI Script

Benjamin Jacob benjamin.jacob at mgl.com
Wed Nov 14 22:13:29 CST 2007


well.. if nothings working.. try putting in debug lines urself in the 
code.. say
use system calls to write some debugging data into some temporary file 
in ur perl code.

let us know..

Matt wrote:

> [root at efax agi-bin]# /usr/bin/perl -v
>
> This is perl, v5.8.5 built for i386-linux-thread-multi
>
>
> Debug shows nothing:
> -- Launched AGI Script /var/lib/asterisk/agi-bin/GetEmailfromDID.agi
> AGI Tx >> agi_request: GetEmailfromDID.agi
> AGI Tx >> agi_channel: Zap/23-1
> AGI Tx >> agi_language: en
> AGI Tx >> agi_type: Zap
> AGI Tx >> agi_uniqueid: 1195061174.4
> AGI Tx >> agi_callerid: 5706016716
> AGI Tx >> agi_calleridname: Test Networks
> AGI Tx >> agi_callingpres: 0
> AGI Tx >> agi_callingani2: 0
> AGI Tx >> agi_callington: 33
> AGI Tx >> agi_callingtns: 0
> AGI Tx >> agi_dnid: 5706010280
> AGI Tx >> agi_rdnis: unknown
> AGI Tx >> agi_context: macro-faxreceive
> AGI Tx >> agi_extension: s
> AGI Tx >> agi_priority: 2
> AGI Tx >> agi_enhanced: 0.0
> AGI Tx >> agi_accountcode:
> AGI Tx >>
> -- AGI Script GetEmailfromDID.agi completed, returning 0
>
> Just returned with a 0 and doesn't do anything it is suppose to do. 
> I'm kind of at a loss.
>
>
> On Nov 14, 2007 11:40 AM, Mindaugas Kezys <mkezys at gmail.com 
> <mailto:mkezys at gmail.com>> wrote:
>
>     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>
>     [mailto: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
>     <mailto: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.
>
>
>     _______________________________________________
>     --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
>


EMAIL DISCLAIMER : This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. Any unauthorised distribution or copying is strictly prohibited. If you receive this transmission in error, please notify the sender by reply email and then destroy the message. Opinions, conclusions and other information in this message that do not relate to official business of Mascon shall be understood to be neither given nor endorsed by Mascon. Any information contained in this email, when addressed to Mascon clients is subject to the terms and conditions in governing client contract.

Whilst Mascon takes steps to prevent the transmission of viruses via e-mail, we can not guarantee that any email or attachment is free from computer viruses and you are strongly advised to undertake your own anti-virus precautions. Mascon grants no warranties regarding performance, use or quality of any e-mail or attachment and undertakes no liability for loss or damage, howsoever caused. 





More information about the asterisk-users mailing list