AGI script: No such file or directory

All installation and configuration problems and questions

Moderators: gerski, enjay, williamconley, Op3r, Staydog, gardo, mflorell, MJCoate, mcargile, Kumba, Michael_N

AGI script: No such file or directory

Postby saulortega » Fri Feb 13, 2015 9:42 am

[Feb 13 09:32:36] VERBOSE[4652] file.c: [Feb 13 09:32:36] -- <IAX2/vicidial-10880> Playing 'digits/3.gsm' (language 'en')
[Feb 13 09:32:36] VERBOSE[4652] pbx.c: [Feb 13 09:32:36] -- Executing [9977@pru:2] AGI("IAX2/vicidial-10880", "xxxxx.php,yyyyy") in new stack
[Feb 13 09:32:36] VERBOSE[4652] res_agi.c: [Feb 13 09:32:36] -- Launched AGI Script /usr/share/asterisk/agi-bin/xxxxx.php
[Feb 13 09:32:36] VERBOSE[4652] res_agi.c: [Feb 13 09:32:36] xxxxx.php,yyyyy: Failed to execute '/usr/share/asterisk/agi-bin/xxxxx.php': No such file or directory
[Feb 13 09:32:36] VERBOSE[4652] pbx.c: [Feb 13 09:32:36] -- Auto fallthrough, channel 'IAX2/vicidial-10880' status is 'UNKNOWN'
[Feb 13 09:32:36] VERBOSE[4652] chan_iax2.c: [Feb 13 09:32:36] -- Hungup 'IAX2/vicidial-10880'


ls -la /usr/share/asterisk/agi-bin/xxxxx.php
-rwxr-xr-x 1 root root 4578 feb 13 09:19 /usr/share/asterisk/agi-bin/xxxxx.php

I changed permissions on xxxxx.php to user and group asterisk, but no changes. Also I changed the extension .php to .agi, no changes.

Why? :(

I tried both from Callmenu AGI route, and adding a dialplan in extensions.con; the same.

VERSION: 2.8-409a
BUILD: 130809-1410

Version: 2.8b0.5
SVN Version: 1930
DB Schema Version: 1355
DB Schema Update Date: 2014-01-19 17:45:02
saulortega
 
Posts: 118
Joined: Mon Jul 29, 2013 11:46 am

Re: AGI script: No such file or directory

Postby saulortega » Mon Feb 16, 2015 3:29 pm

Well, if I put "#!/usr/bin/php -q" instead of "#!/usr/bin/php", the error don't appears any more.

But the PHP script don't runs! :(

My PHP script write a text to a file. If I runs it manually, the file is written. But when it is called from Asterisk the file is not written. :(

Code: Select all
[Feb 16 15:12:00] VERBOSE[4614] pbx.c:     -- Executing [9977@pru:2] AGI("IAX2/vicidial-2211", "x.php") in new stack
[Feb 16 15:12:00] VERBOSE[4614] res_agi.c: <IAX2/vicidial-2211>AGI Tx >> agi_request: x.php
[Feb 16 15:12:00] VERBOSE[4614] res_agi.c: <IAX2/vicidial-2211>AGI Tx >> agi_channel: IAX2/vicidial-2211
[Feb 16 15:12:00] VERBOSE[4614] res_agi.c: <IAX2/vicidial-2211>AGI Tx >> agi_language: en
[Feb 16 15:12:00] VERBOSE[4614] res_agi.c: <IAX2/vicidial-2211>AGI Tx >> agi_type: IAX2
[Feb 16 15:12:00] VERBOSE[4614] res_agi.c: <IAX2/vicidial-2211>AGI Tx >> agi_uniqueid: 1424117516.995
[Feb 16 15:12:00] VERBOSE[4614] res_agi.c: <IAX2/vicidial-2211>AGI Tx >> agi_version: 1.8.23.0-vici
[Feb 16 15:12:00] VERBOSE[4614] res_agi.c: <IAX2/vicidial-2211>AGI Tx >> agi_callerid: 1987
[Feb 16 15:12:00] VERBOSE[4614] res_agi.c: <IAX2/vicidial-2211>AGI Tx >> agi_calleridname: No Reply
[Feb 16 15:12:00] VERBOSE[4614] res_agi.c: <IAX2/vicidial-2211>AGI Tx >> agi_callingpres: 0
[Feb 16 15:12:00] VERBOSE[4614] res_agi.c: <IAX2/vicidial-2211>AGI Tx >> agi_callingani2: 0
[Feb 16 15:12:00] VERBOSE[4614] res_agi.c: <IAX2/vicidial-2211>AGI Tx >> agi_callington: 0
[Feb 16 15:12:00] VERBOSE[4614] res_agi.c: <IAX2/vicidial-2211>AGI Tx >> agi_callingtns: 0
[Feb 16 15:12:00] VERBOSE[4614] res_agi.c: <IAX2/vicidial-2211>AGI Tx >> agi_dnid: unknown
[Feb 16 15:12:00] VERBOSE[4614] res_agi.c: <IAX2/vicidial-2211>AGI Tx >> agi_rdnis: unknown
[Feb 16 15:12:00] VERBOSE[4614] res_agi.c: <IAX2/vicidial-2211>AGI Tx >> agi_context: pru
[Feb 16 15:12:00] VERBOSE[4614] res_agi.c: <IAX2/vicidial-2211>AGI Tx >> agi_extension: 9977
[Feb 16 15:12:00] VERBOSE[4614] res_agi.c: <IAX2/vicidial-2211>AGI Tx >> agi_priority: 2
[Feb 16 15:12:00] VERBOSE[4614] res_agi.c: <IAX2/vicidial-2211>AGI Tx >> agi_enhanced: 0.0
[Feb 16 15:12:00] VERBOSE[4614] res_agi.c: <IAX2/vicidial-2211>AGI Tx >> agi_accountcode: vicidial
[Feb 16 15:12:00] VERBOSE[4614] res_agi.c: <IAX2/vicidial-2211>AGI Tx >> agi_threadid: 140004263806720
[Feb 16 15:12:00] VERBOSE[4614] res_agi.c: <IAX2/vicidial-2211>AGI Tx >>
[Feb 16 15:12:00] VERBOSE[4614] res_agi.c: <IAX2/vicidial-2211>AGI Rx << Extension '/usr/share/asterisk/agi-bin/x.php' not present.
[Feb 16 15:12:00] VERBOSE[4614] res_agi.c: <IAX2/vicidial-2211>AGI Tx >> 510 Invalid or unknown command
[Feb 16 15:12:00] VERBOSE[4614] res_agi.c:     -- <IAX2/vicidial-2211>AGI Script x.php completed, returning 0
[Feb 16 15:12:00] VERBOSE[4614] pbx.c:     -- Executing [9977@pru:3] SayAlpha("IAX2/vicidial-2211", "c") in new stack
[Feb 16 15:12:00] VERBOSE[4614] file.c:     -- <IAX2/vicidial-2211> Playing 'letters/c.gsm' (language 'en')
[Feb 16 15:12:01] VERBOSE[4614] pbx.c:     -- Executing [9977@pru:4] Hangup("IAX2/vicidial-2211", "") in new stack
[Feb 16 15:12:01] VERBOSE[4614] pbx.c:   == Spawn extension (pru, 9977, 4) exited non-zero on 'IAX2/vicidial-2211'
[Feb 16 15:12:01] VERBOSE[4614] chan_iax2.c:     -- Hungup 'IAX2/vicidial-2211'


What means "Extension '/usr/share/asterisk/agi-bin/x.php' not present."?

Who user runs the PHP when it is called from Asterisk? :roll:
saulortega
 
Posts: 118
Joined: Mon Jul 29, 2013 11:46 am

Re: AGI script: No such file or directory

Postby DomeDan » Tue Mar 31, 2015 3:21 pm

try to make a perl agi script in the agi directory instead: /var/lib/asterisk/agi-bin/
and for example, file /var/lib/asterisk/agi-bin/agi-test.agi is called like this: AGI(agi-test.agi)
Vicidial Partner. Region: Sweden/Norway.
Does Vicidial installation, configuration, customization, add-ons, CRM implementation, support, upgrading, network-related, pentesting etc. Remote and onsite assistance.
Email: domedan (at) gmail.com
DomeDan
 
Posts: 1226
Joined: Tue Jan 04, 2011 9:17 am
Location: Sweden

Re: AGI script: No such file or directory

Postby saulortega » Mon Apr 06, 2015 3:13 pm

Yes, it is a PHP/Asterisk's problem.

I finally programmed my AGI in Python, and nnow is working fine. :)
saulortega
 
Posts: 118
Joined: Mon Jul 29, 2013 11:46 am


Return to Support

Who is online

Users browsing this forum: No registered users and 78 guests