mark morreny
2008-Mar-24 09:02 UTC
[asterisk-users] Getting Exec Format Error when running AGI call
Dear friends,
I am having problem with running a sample php and I can't figure out why. I
can run the sample.php using CLI but when I run it inside the dialplan it
does not work. Can someone please suggest the config problem that I may
have made?
dommy:/var/lib/asterisk/agi-bin# php sample.php
#!/usr/bin/php5 -q
VERBOSE "Here we go!" 2
VERBOSE "Call from - Calling phone"
SAY DIGITS 22 X
SAY NUMBER 2233 X
================== Asterisk CLI =====================*CLI> agi debug
AGI Debugging Enabled
*CLI> -- Executing [444 at my-phones:1]
Answer("SIP/2000-b640ba18", "") in
new stack
-- Executing [444 at my-phones:2] AGI("SIP/2000-b640ba18",
"sample.agi") in
new stack
-- Launched AGI Script /var/lib/asterisk/agi-bin/sample.agi
AGI Tx >> agi_request: sample.agi
AGI Tx >> agi_channel: SIP/2000-b640ba18
AGI Tx >> agi_language: en
AGI Tx >> agi_type: SIP
AGI Tx >> agi_uniqueid: 1206377474.53
AGI Tx >> agi_callerid: 2000
AGI Tx >> agi_calleridname: 2000
AGI Tx >> agi_callingpres: 0
AGI Tx >> agi_callingani2: 0
AGI Tx >> agi_callington: 0
AGI Tx >> agi_callingtns: 0
AGI Tx >> agi_dnid: 444
AGI Tx >> agi_rdnis: unknown
AGI Tx >> agi_context: my-phones
AGI Tx >> agi_extension: 444
AGI Tx >> agi_priority: 2
AGI Tx >> agi_enhanced: 0.0
AGI Tx >> agi_accountcode:
AGI Tx >>
AGI Rx << verbose "Failed to execute
'/var/lib/asterisk/agi-bin/sample.agi':
Exec format error" 2
== sample.agi: Failed to execute
'/var/lib/asterisk/agi-bin/sample.agi':
Exec format error
AGI Tx >> 200 result=1
-- AGI Script sample.agi completed, returning 0
Thanks,
Mark
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
http://lists.digium.com/pipermail/asterisk-users/attachments/20080324/296baa61/attachment.htm
Tilghman Lesher
2008-Mar-24 16:28 UTC
[asterisk-users] Getting Exec Format Error when running AGI call
On Monday 24 March 2008 04:02, mark morreny wrote:> Dear friends, > > I am having problem with running a sample php and I can't figure out why. > I can run the sample.php using CLI but when I run it inside the dialplan it > does not work. Can someone please suggest the config problem that I may > have made? > > > dommy:/var/lib/asterisk/agi-bin# php sample.php > #!/usr/bin/php5 -qThere seems to be an extra space at the beginning of the topmost line.> AGI Rx << verbose "Failed to execute > '/var/lib/asterisk/agi-bin/sample.agi': Exec format error" 2 > == sample.agi: Failed to execute '/var/lib/asterisk/agi-bin/sample.agi': > Exec format error > AGI Tx >> 200 result=1 > -- AGI Script sample.agi completed, returning 0Either that space is the issue or else you've failed to set the execute bit in the permissions on that file (chmod 755 sample.php). -- Tilghman
mark morreny
2008-Mar-25 10:31 UTC
[asterisk-users] Getting Exec Format Error when running AGI call
Yes, it is that silly space!!! Thanks for all your help. Thanks, Mark On Mon, Mar 24, 2008 at 5:02 PM, mark morreny <markmorreny at gmail.com> wrote:> Dear friends, > > I am having problem with running a sample php and I can't figure out why. > I can run the sample.php using CLI but when I run it inside the dialplan > it does not work. Can someone please suggest the config problem that I may > have made? > > > dommy:/var/lib/asterisk/agi-bin# php sample.php > #!/usr/bin/php5 -q > > VERBOSE "Here we go!" 2 > > VERBOSE "Call from - Calling phone" > > SAY DIGITS 22 X > > SAY NUMBER 2233 X > > ================== Asterisk CLI =====================> *CLI> agi debug > AGI Debugging Enabled > *CLI> -- Executing [444 at my-phones:1] Answer("SIP/2000-b640ba18", "") > in new stack > -- Executing [444 at my-phones:2] AGI("SIP/2000-b640ba18", "sample.agi") > in new stack > -- Launched AGI Script /var/lib/asterisk/agi-bin/sample.agi > AGI Tx >> agi_request: sample.agi > AGI Tx >> agi_channel: SIP/2000-b640ba18 > AGI Tx >> agi_language: en > AGI Tx >> agi_type: SIP > AGI Tx >> agi_uniqueid: 1206377474.53 > AGI Tx >> agi_callerid: 2000 > AGI Tx >> agi_calleridname: 2000 > AGI Tx >> agi_callingpres: 0 > AGI Tx >> agi_callingani2: 0 > AGI Tx >> agi_callington: 0 > AGI Tx >> agi_callingtns: 0 > AGI Tx >> agi_dnid: 444 > AGI Tx >> agi_rdnis: unknown > AGI Tx >> agi_context: my-phones > AGI Tx >> agi_extension: 444 > AGI Tx >> agi_priority: 2 > AGI Tx >> agi_enhanced: 0.0 > AGI Tx >> agi_accountcode: > AGI Tx >> > AGI Rx << verbose "Failed to execute > '/var/lib/asterisk/agi-bin/sample.agi': Exec format error" 2 > == sample.agi: Failed to execute > '/var/lib/asterisk/agi-bin/sample.agi': Exec format error > AGI Tx >> 200 result=1 > -- AGI Script sample.agi completed, returning 0 > > > > Thanks, > Mark >-------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.digium.com/pipermail/asterisk-users/attachments/20080325/b957b3d1/attachment-0001.htm