Asterisk AGI variable pass to Python

Hi,

I am developing the Speech IVR using PHPAGI , i want to send the PHPAGI variable to python script . Below the my code details

  // PHPAGI Code
       $item='Say_Card_Company';
        $agi->exec("EAGI","pahh.py $item");

i received the variable in Python code

import sys
TITLE = sys.argv[1]

But i am not getting the any information on this variable , Please help me on this . How can receive the variable .

Please Advice

Thanks,
Palanivel S

$item variable it is just an string ?

Sorry, I’m home now, but I can get on and retrieve. Just the Zimbra.log file? Asterisk version should be in my first entry, but let me know if you need me to post again. Not sure on the item variable. And how would I go about verifying the SIP device and it forwarding? Doesn’t appear to show up in any of the conf files or database in queues or ring groups. Thanks!

Sorry but your reply it is confusing and mention things that have nothing to do with the original post, are you sure you re posting on the correct thread ?

I’m sorry, I was thinking about another issue when I replied. But just let me know what, and maybe how, to pull what you need.

specify the full path of the python agi on your php code, also make sure the permisions for execute the code

And it starts with a #! line containing the full path to the python interpreter.

Hi ,
Yes . Its only for string . I want to capture this string in python code.

Thanks,
Palanivel

Hi ,

I am specify the full path but i did’t get the variable on python page.

// PHPAGI Code

$item='Say_Card_Company';
 $agi->exec("EAGI","/var/lib/asterisk/agi-bin/pahh.py $item");

// Python Code

import urllib2
import sys

titt = sys.argv[1] // When i add this line into python code , this script is not working .

Please advice

Thanks,
Palanivel S

Make sure Python scripts works fine outside the Asterisk, test it directly on the console