for some reason your script is not executing the get_var correctly, as
you can see in the output, asterisk is saying: "invalid or unknown
command&quot;.<br>
<br>
check the internals of your script, the most common reason is that you are mispelling the command.<br>
<br>
best regards<br><br><div><span class="gmail_quote">On 10/13/05, <b class="gmail_sendername">René Enskat [Teamware GmbH]</b> &lt;<a href="mailto:ren@teamware-gmbh.de">ren@teamware-gmbh.de</a>&gt; wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<br>Hello all,<br><br>I try to use a agi script to get a variable from * und put them into a<br>script which gives me another variablke and put this in *.<br>My problem is now it seems the var ID is empty coz i always jump into
<br>the result 0 loop.<br>The $MSN should be in the SetCIDNum.<br><br>#!/usr/bin/php -q<br><br>&lt;?php<br>include(&quot;/var/lib/asterisk/agi-bin/phpagi.php&quot;);<br>$agi = new AGI();<br><br>$ID = $agi-&gt;get_variable(&quot;SIPUSER&quot;);
<br><br>if ($ID['result'] == 0) {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$agi-&gt;verbose(&quot;SIPUSER not set -- nothing to do&quot;);<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;exit(1);<br>}<br><br>$agi-&gt;set_variable(&quot;MSN&quot;, exec(&quot;/var/lib/asterisk/agi-bin/msn4sip 111
<br>222 333 &quot; .$ID['data']));<br>?&gt;<br><br>Output from asterisk:<br>&nbsp;&nbsp;&nbsp;&nbsp;-- Executing SetVar(&quot;SIP/31-79e2&quot;, &quot;SIPUSER=31&quot;) in new stack<br>&nbsp;&nbsp;&nbsp;&nbsp;-- Executing AGI(&quot;SIP/31-79e2&quot;, &quot;msn4sip.agi
&quot;) in new stack<br>&nbsp;&nbsp;&nbsp;&nbsp;-- Launched AGI Script /var/lib/asterisk/agi-bin/msn4sip.agi<br>&nbsp;&nbsp;msn4sip.agi:
Arrayn(n&nbsp;&nbsp;&nbsp;&nbsp;[code] =&gt;
510n&nbsp;&nbsp;&nbsp;&nbsp;[result] =&gt;
n&nbsp;&nbsp;&nbsp;&nbsp;[data] =&gt;<br>Invalid or unknown commandn)n<br>&nbsp;&nbsp;msn4sip.agi: SIPUSER not set -- nothing to do<br>&nbsp;&nbsp;&nbsp;&nbsp;-- AGI Script msn4sip.agi completed, returning 0<br>&nbsp;&nbsp;&nbsp;&nbsp;-- Executing SetLanguage(&quot;SIP/31-79e2&quot;, &quot;de&quot;) in new stack
<br>&nbsp;&nbsp;&nbsp;&nbsp;-- Executing SetCIDNum(&quot;SIP/31-79e2&quot;, &quot;&quot;) in new stack<br><br><br><br>_______________________________________________<br>--Bandwidth and Colocation sponsored by <a href="http://Easynews.com">Easynews.com
</a> --<br><br>Asterisk-Users mailing list<br><a href="mailto:Asterisk-Users@lists.digium.com">Asterisk-Users@lists.digium.com</a><br><a href="http://lists.digium.com/mailman/listinfo/asterisk-users">http://lists.digium.com/mailman/listinfo/asterisk-users
</a><br>To UNSUBSCRIBE or update options visit:<br>&nbsp;&nbsp; <a href="http://lists.digium.com/mailman/listinfo/asterisk-users">http://lists.digium.com/mailman/listinfo/asterisk-users</a><br></blockquote></div><br><br clear="all">
<br>-- <br>&quot;Su nombre es GNU/Linux, no solamente Linux, mas info en <a href="http://www.gnu.org">http://www.gnu.org</a>&quot;