[Asterisk-java-cvs] CVS: asterisk-java/xdocs tutorial.xml,1.8,1.9
Brought to you by:
srt
From: Stefan R. <sr...@us...> - 2005-04-06 23:07:18
|
Update of /cvsroot/asterisk-java/asterisk-java/xdocs In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30351/xdocs Modified Files: tutorial.xml Log Message: Added note on how to pass parameters to an AGIScript. Index: tutorial.xml =================================================================== RCS file: /cvsroot/asterisk-java/asterisk-java/xdocs/tutorial.xml,v retrieving revision 1.8 retrieving revision 1.9 diff -u -d -p -r1.8 -r1.9 --- tutorial.xml 16 Mar 2005 10:52:11 -0000 1.8 +++ tutorial.xml 6 Apr 2005 23:07:02 -0000 1.9 @@ -137,6 +137,18 @@ INFO: End AGIScript HelloAGIScript on AG own commands you can also use the <a href="apidocs/net/sf/asterisk/fastagi/AGIChannel.html">channel</a>.sendCommand(<a href="apidocs/net/sf/asterisk/fastagi/AGICommand.html">AGICommand</a>) method to send arbitrary commands.</p> + <p>You can pass parameters to your scripts by including them in the URL used with + the AGI command. These parameters can be read by the getParameter(String) and + getParameterValues(String) methods in + <a href="apidocs/net/sf/asterisk/fastagi/AGIRequest.html">AGIRequest</a>.</p> + <p>If you want to pass a parameter named user with a value of "john" to your + script called hello.agi running on localhost your call to the AGI application + looks like this:</p> +<source><![CDATA[ +exten => 1300,1,Agi(agi://localhost/hello.agi?user=john) +]]></source> + <p>You can also pass multiple parameters. Parameters containing special characters + must be URL encoded.</p> <p>If you are about to write more complex scripts please note that your AGIScript must be threadsafe. Only one instance will be used to serve all requests. This is kind of similar to the constraints a servlet engine places on the |