Call agi file in extension.conf

hi ,
i’ve recently installed asterisk with dahdi and i want to create an ivr.
i tested the extension.conf with few commands like playback,saydigits and it works fine.
now i want to launch an agi file in my context(extension.conf) but it doesn’t work.
this is my code

[incoming]
exten => 1,1,Answer

exten => 1,n,AGI(../blague/test.agi,--apelant=${CALLERID}) ; doesn't work
exten => 1,n(exten),Background(vm-enter-num-to-call)  ;-->it work
exten => 1,n,WaitExten(5)  ;-->it work
;exten => 1,n(goodbye),Playback(vm-goodbye)  ;-->it work
exten => 1,n,SayDigits(${CALLERID(ani)})  ;-->it work
exten => 1,n,Hangup()  ;-->it work

NB:exten => 1,n,AGI(../blague/test.agi|--apelant=${CALLERID}) ;
this line worked fine for me when i have an older version of asterisk and agi file works fine also but the call in the context doesn’t pass.even in the log i don’t find anything.

please help me

please can someone help me .it’s urgent

For urgent replies move the topic to the Job forum and hire someone.

Move your AGI to the default AGI location: /var/lib/asterisk/agi-bin give it permission to execute and read by asterisk user and try it with:

In your AGI file get the CallerID using $argv array. Enable the agi debug in asterisk and try again.

thanks for your reply ,
It didn’t work , and also all the agi files even the samples .
I think that there’s a problem with all the agi call in the extension.
Is there a module or something that I should add to enable agi ?
PS : In the CLI> i have enabled agi debug but nothing is showing in the console

Be sure that the verbose is enable in the asterisk console with: core set verbose 5. Also check the file logger.conf in order to see if the console has the verbose too.

thanks for replying,
when i tried to run an agi in the extension,the CLI> shows

Accepting call from '95827614' to '1' on channel 0/27, span 1 -- Executing [1@incoming:1] Answer("DAHDI/i1/9xxxxxxx-40", "") in new stack -- Auto fallthrough, channel 'DAHDI/i1/9xxxxxxxx-40' status is 'UNKNOWN' -- Hungup 'DAHDI/i1/9xxxxxxx-40'
maybe the problem came from dahdi’s configuration because when i run dahdi restart, i have this:

[260884.879054] dahdi_transcode: Loaded. [260884.941040] INFO-xpp: revision Unknown MAX_XPDS=64 (8*8) [260884.941061] INFO-xpp: FEATURE: with PROTOCOL_DEBUG [260884.942314] INFO-xpp: FEATURE: with sync_tick() from DAHDI [260884.954621] INFO-xpp_usb: revision Unknown [260884.956814] usbcore: registered new interface driver xpp_usb [260885.239163] dahdi_devices pci:0000:03:09.0: local span 1 is already assigned span 1 [260885.239171] dahdi_devices pci:0000:03:09.0: local span 2 is already assigned span 2 [260885.239177] dahdi_devices pci:0000:03:09.0: local span 3 is already assigned span 3 [260885.239182] dahdi_devices pci:0000:03:09.0: local span 4 is already assigned span 4 [260885.456845] wct4xxp 0000:03:09.0: TE4XXP: Span 1 configured for CCS/HDB3/CRC4 [260885.457051] wct4xxp 0000:03:09.0: TE4XXP: Span 2 configured for CCS/HDB3/CRC4 [260885.457332] wct4xxp 0000:03:09.0: RCLK source set to span 1 [260885.457339] wct4xxp 0000:03:09.0: System timing mode, RCLK set to span 1 [260936.646294] radeon 0000:06:05.0: ebd36200 reserve failed for wait [261450.142931] radeon 0000:06:05.0: ebbe9300 reserve failed for wait [261469.517572] radeon 0000:06:05.0: ebcb4000 reserve failed for wait [261496.899755] radeon 0000:06:05.0: ebbe9300 reserve failed for wait [261505.018256] radeon 0000:06:05.0: ebd36200 reserve failed for wait [261509.408544] radeon 0000:06:05.0: ebd36200 reserve failed for wait [261559.956505] wct4xxp 0000:03:09.0: TE4XXP: Span 1 configured for CCS/HDB3/CRC4 [261559.957179] wct4xxp 0000:03:09.0: TE4XXP: Span 2 configured for CCS/HDB3/CRC4 [261559.957238] wct4xxp 0000:03:09.0: RCLK source set to span 1 [261559.957245] wct4xxp 0000:03:09.0: System timing mode, RCLK set to span 1 [261568.826171] radeon 0000:06:05.0: ebd36200 reserve failed for wait [261575.827460] radeon 0000:06:05.0: ed704c00 reserve failed for wait [261687.405423] radeon 0000:06:05.0: ea808500 reserve failed for wait
this is my chan_dahdi.conf

signalling = pri_cpe switchtype = euroisdn group = 0 context =incoming echocancel = yes channel => 1-15,17-31
dahdi_channel.conf

[code]; Autogenerated by /usr/sbin/dahdi_genconf on Thu Jul 24 10:06:55 2014
; If you edit this file and execute /usr/sbin/dahdi_genconf again,
; your manual changes will be LOST.
; Dahdi Channels Configurations (chan_dahdi.conf)
;
; This is not intended to be a complete chan_dahdi.conf. Rather, it is intended
; to be #include-d by /etc/chan_dahdi.conf that will include the global settings
;

; Span 1: TE4/0/1 “T4XXP (PCI) Card 0 Span 1” (MASTER) CCS/HDB3/CRC4
group=0,11
context=from-pstn
switchtype = euroisdn
signalling = pri_cpe
channel => 1-15,17-31
context = incoming
group = 63

; Span 2: TE4/0/2 “T4XXP (PCI) Card 0 Span 2” CCS/HDB3/CRC4
group=0,12
context=from-pstn
switchtype = euroisdn
signalling = pri_cpe
channel => 32-46,48-62
context = default
group = 63

; Span 3: TE4/0/3 “T4XXP (PCI) Card 0 Span 3” CCS/HDB3/CRC4
group=0,13
context=from-pstn
switchtype = euroisdn
signalling = pri_cpe
channel => 63-77,79-93
context = default
group = 63

; Span 4: TE4/0/4 “T4XXP (PCI) Card 0 Span 4” CCS/HDB3/CRC4
group=0,14
context=from-pstn
switchtype = euroisdn
signalling = pri_cpe
channel => 94-108,110-124
context = default
group = 63
[/code]

system.conf

[code]# Autogenerated by /usr/sbin/dahdi_genconf on Thu Jul 24 10:06:55 2014

If you edit this file and execute /usr/sbin/dahdi_genconf again,

your manual changes will be LOST.

Dahdi Configuration File

This file is parsed by the Dahdi Configurator, dahdi_cfg

Span 1: TE4/0/1 “T4XXP (PCI) Card 0 Span 1” (MASTER) CCS/HDB3/CRC4

span=1,0,0,ccs,hdb3,crc4

termtype: te

bchan=1-15,17-31
dchan=16
echocanceller=mg2,1-15
echocanceller=mg2,17-31

Span 2: TE4/0/2 “T4XXP (PCI) Card 0 Span 2” CCS/HDB3/CRC4

span=2,0,0,ccs,hdb3,crc4

termtype: te

#bchan=32-46,48-62
#dchan=47
#echocanceller=mg2,32-46,48-62

Span 3: TE4/0/3 “T4XXP (PCI) Card 0 Span 3” CCS/HDB3/CRC4

#span=3,3,0,ccs,hdb3,crc4

termtype: te

#bchan=63-77,79-93
#dchan=78
#echocanceller=mg2,63-77,79-93

Span 4: TE4/0/4 “T4XXP (PCI) Card 0 Span 4” CCS/HDB3/CRC4

#span=4,4,0,ccs,hdb3,crc4

termtype: te

#bchan=94-108,110-124
#dchan=109
#echocanceller=mg2,94-108,110-124

Global data

loadzone = us
defaultzone = us[/code]
i tried with this agi file

[code]#!/usr/bin/perl

use Asterisk::AGI;
use Getopt::Long;
use Date::Manip;

#use Switch;
#use DBIx;
use DBI;
use LWP;

$AGI = new Asterisk::AGI;
$AGI->stream_file("/test/sound_test",“0123456789”);

[/code]
where sound_test is a wav file under agi_bin/test
PS: the playback and the agi googletts runs correctly but not the other agi files. please help :cry:

Show us your dialplan.

this is my extension that i used to call

[incoming] exten => 1,1,Answer ;exten => 1,2,Playback(../../blague/intro-blague) ;exten =>1,n,AGI(googletts.agi,"bonjour",fr) exten => 1,2,AGI(haythem.agi); exten => 1,n,Hangup()

and this is the content of haythem.agi which situated under /var/lib/asterisk/agi-bin

[code]#!/usr/bin/perl

use Asterisk::AGI;
use Getopt::Long;
use Date::Manip;

#use Switch;
#use DBIx;
use DBI;
use LWP;

$AGI = new Asterisk::AGI;
$AGI->stream_file("/blague/intro-blague",“0123456789”);

[/code]
/blague/intro-blague is a wave file under agi-bin

this is the result is the CLI>

-- Reloading module 'res_config_mysql.so' (MySQL RealTime Configuration Driver) == MySQL RealTime reloaded. -- Reloading module 'res_config_sqlite3.so' (SQLite 3 realtime config engine) -- Reloading module 'res_crypto.so' (Cryptographic Digital Signatures) -- Reloading module 'res_fax.so' (Generic FAX Applications) -- Reloading module 'res_musiconhold.so' (Music On Hold Resource) -- Reloading module 'res_phoneprov.so' (HTTP Phone Provisioning) == Parsing '/etc/asterisk/sip.conf': Found == Parsing '/etc/asterisk/users.conf': Found == Parsing '/etc/asterisk/phoneprov.conf': Found -- Reloading module 'res_rtp_asterisk.so' (Asterisk RTP Stack) -- Reloading module 'res_stun_monitor.so' (STUN Network Monitor) -- Accepting call from '95827614' to '1' on channel 0/19, span 1 -- Executing [1@incoming:1] Answer("DAHDI/i1/95827614-2f", "") in new stack -- Executing [1@incoming:2] AGI("DAHDI/i1/95827614-2f", "haythem.agi") in new stack -- Launched AGI Script /var/lib/asterisk/agi-bin/haythem.agi <DAHDI/i1/95827614-2f>AGI Tx >> agi_request: haythem.agi <DAHDI/i1/95827614-2f>AGI Tx >> agi_channel: DAHDI/i1/95827614-2f <DAHDI/i1/95827614-2f>AGI Tx >> agi_language: en <DAHDI/i1/95827614-2f>AGI Tx >> agi_type: DAHDI <DAHDI/i1/95827614-2f>AGI Tx >> agi_uniqueid: 1407140970.46 <DAHDI/i1/95827614-2f>AGI Tx >> agi_version: 11.11.0 <DAHDI/i1/95827614-2f>AGI Tx >> agi_callerid: 95827614 <DAHDI/i1/95827614-2f>AGI Tx >> agi_calleridname: unknown <DAHDI/i1/95827614-2f>AGI Tx >> agi_callingpres: 3 <DAHDI/i1/95827614-2f>AGI Tx >> agi_callingani2: 0 <DAHDI/i1/95827614-2f>AGI Tx >> agi_callington: 0 <DAHDI/i1/95827614-2f>AGI Tx >> agi_callingtns: 0 <DAHDI/i1/95827614-2f>AGI Tx >> agi_dnid: 1 <DAHDI/i1/95827614-2f>AGI Tx >> agi_rdnis: unknown <DAHDI/i1/95827614-2f>AGI Tx >> agi_context: incoming <DAHDI/i1/95827614-2f>AGI Tx >> agi_extension: 1 <DAHDI/i1/95827614-2f>AGI Tx >> agi_priority: 2 <DAHDI/i1/95827614-2f>AGI Tx >> agi_enhanced: 0.0 <DAHDI/i1/95827614-2f>AGI Tx >> agi_accountcode: <DAHDI/i1/95827614-2f>AGI Tx >> agi_threadid: -1241302160 <DAHDI/i1/95827614-2f>AGI Tx >> -- <DAHDI/i1/95827614-2f>AGI Script haythem.agi completed, returning 0 -- Executing [1@incoming:3] Hangup("DAHDI/i1/95827614-2f", "") in new stack == Spawn extension (incoming, 1, 3) exited non-zero on 'DAHDI/i1/95827614-2f' -- Hungup 'DAHDI/i1/95827614-2f' dell-desktop*CLI>

please help