Hi, Li Peng!

You are running the script with the $si as first parameter, therefore you 
should access it in your Python script using sys.argv[1]. For example, if your 
script is:

#!/usr/bin/python
import sys
print sys.argv[1]

Then after executing the following commands in script, you should see the 
source IP of the message printed:

exec_avp("/usr/local/sbin/my_script.py $si", "$avp(should_route)");
xlog("Script printed $avp(should_route)\n");

Regards,

--
Ra(zvan Crainea
OpenSIPS Developer
http://www.opensips-solutions.com


On 04/20/2012 10:35 AM, GTS2010 wrote:
Hi Paiu:
As your words, "exec_avp("/usr/local/sbin/my_script.py $si", "$avp(should_route)"); In my_script.py I can print a str such as "the script is running!" , but I can not print the $si , I what to know how could I get the $si in my_script.py . I tried the sys.argv[1] , but I failed . And even the sys.argv[0] was can not be print . If I only run the my_script.py , I can get the sys.argv[0] and the sys.argv[1] be printed .
Hoping for your help!
Thanks & Regards!
Li Peng beijing China
2012-04-20
------------------------------------------------------------------------
GTS2010


_______________________________________________
Devel mailing list
[email protected]
http://lists.opensips.org/cgi-bin/mailman/listinfo/devel
_______________________________________________
Devel mailing list
[email protected]
http://lists.opensips.org/cgi-bin/mailman/listinfo/devel

Reply via email to