Summary:ASTERISK-21812: Whitespace not escaped correctly on AGI()
Reporter:Ariel Wainer (ariw)Labels:
Date Opened:2013-05-23 13:19:45Date Closed:2013-05-23 17:35:45
Status:Closed/CompleteComponents:. I did not set the category correctly.
Versions:11.4.0 Frequency of
Environment:Ubuntu server 12.04 server, using asterisk-latest from the tarball as well as the package.Attachments:
Description:When I try to call an AGI script like this:

exten => 12345,2,AGI(/usr/bin/python /usr/local/bin/test.py)

It doesn't work, it says:
WARNING[30174][C-00000003]: res_agi.c:1681 launch_script: Failed to execute '/usr/bin/python /usr/local/bin/test.py': File does not exist.

Both the binary and the script work and asterisk has the right permissions.
Comments:By: Michael L. Young (elguero) 2013-05-23 17:35:04.377-0500

This is not the proper way to run an AGI application.

Add "#!/usr/bin/python" (or whatever the path to the python binary) to the top of your python script.  Make sure the permissions are set correctly.

For future support questions, please check out the forum, mailing list or irc channel for help. (http://www.asterisk.org/community)


By: Ariel Wainer (ariw) 2013-05-23 19:11:04.411-0500

Michael, I understand what you say, but in some cases (i.e. java), this might not be possible.

Best regards.

By: Michael L. Young (elguero) 2013-05-23 19:21:39.872-0500

In the case of java, you would probably want to use FastAGI.

By: Rusty Newton (rnewton) 2013-05-24 10:28:41.340-0500

same => n,AGI(/tmp/blah /testfile.py)

   -- Executing [1111@internal:1] Wait("Console/dsp", "1") in new stack
   -- Executing [1111@internal:2] AGI("Console/dsp", "/tmp/blah /testfile.py") in new stack
   -- Launched AGI Script /tmp/blah /testfile.py
   -- <Console/dsp>AGI Script /tmp/blah /testfile.py completed, returning 0
   -- Executing [1111@internal:3] Hangup("Console/dsp", "") in new stack

Works for me. Asterisk 11.4.0 on Ubuntu 12.04. I'm going to close this out, but feel free to comment if you find out what was causing the problem. It doesn't look like a bug. If you do find something that looks buggy we'll re-open.

By: Rusty Newton (rnewton) 2013-05-24 10:33:03.039-0500

Whoops I didn't refresh the page before commenting today. I agree with Michael, this is not a bug from what I see.