<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <tt><font color="#000000"></font></tt>
    <pre class="moz-signature" cols="72"><big><font color="#000000"><small>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,</small></font></big><tt><font color="#000000">

</font></tt>--
R&#259;zvan Crainea
OpenSIPS Developer
<a class="moz-txt-link-freetext" href="http://www.opensips-solutions.com">http://www.opensips-solutions.com</a></pre>
    <br>
    On 04/20/2012 10:35 AM, GTS2010 wrote:
    <blockquote
      cite="mid:29018e19.11e532.136ceadb8cf.Coremail.GTS2010@126.com"
      type="cite">
      <style type="text/css"> <!--@import url(scrollbar.css); --></style>
      <meta content="text/html; charset=ISO-8859-1"
        http-equiv="Content-Type">
      <style>                        BLOCKQUOTE{margin-Top: 0px; margin-Bottom: 0px; margin-Left: 2em}                        body{FONT-SIZE:12.1pt; COLOR:#001; FONT-FAMILY:&#23435;&#20307;,serif;}                </style>
      <meta name="GENERATOR" content="MSHTML 8.00.6001.19222">
      <base target="_blank">
      <stationery>
        <div>&nbsp;</div>
        <div>
          <div><font face="&#23435;&#20307;" color="#000000" size="3">
              <div><font face="&#23435;&#20307;" color="#000000" size="3">Hi Paiu:</font></div>
              <div>&nbsp;</div>
              <div>As your words,
                "exec_avp("/usr/local/sbin/my_script.py $si",
                "$avp(should_route)");<br>
                In my_script.py I can print a str such as "the script is
                running!" , but I&nbsp;can not print the $si , I what to know
                how could I&nbsp;get the $si in my_script.py . I&nbsp;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
                .</div>
              <div>&nbsp;</div>
              <div>&nbsp;</div>
              <div>&nbsp;</div>
              <div>Hoping for your help!</div>
              <div>Thanks &amp; Regards!</div>
              <div>&nbsp;</div>
              <div>Li Peng beijing China</div>
            </font></div>
        </div>
        <div align="left"><font face="Verdana" color="#c0c0c0" size="2">2012-04-20</font></div>
        <font face="Verdana" size="2">
          <hr style="WIDTH: 122px; HEIGHT: 2px" id="SignNameHR" size="2"
            align="left">
        </font>
        <div><font face="Verdana" color="#c0c0c0" size="2"><span
              id="_FlashSignName">GTS2010</span></font></div>
      </stationery><br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
      <pre wrap="">_______________________________________________
Devel mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Devel@lists.opensips.org">Devel@lists.opensips.org</a>
<a class="moz-txt-link-freetext" href="http://lists.opensips.org/cgi-bin/mailman/listinfo/devel">http://lists.opensips.org/cgi-bin/mailman/listinfo/devel</a>
</pre>
    </blockquote>
  </body>
</html>