Could you please share a little sample showing how to get connected to AMI with php?<div><br></div><div>Thanks a lot!</div><div><br></div><div>Elder<br><br><div class="gmail_quote">On Mon, Aug 1, 2011 at 3:40 PM, Kevin P. Fleming <span dir="ltr">&lt;<a href="mailto:kpfleming@digium.com">kpfleming@digium.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;"><div class="im">On 08/01/2011 03:35 PM, Paul Belanger wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
On 11-08-01 04:24 PM, Daniel - Asterisk wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
&lt;?php<br>
function ast_claves(){<br>
<br>
$socket =<br>
fsockopen(&#39;192.168.25.18&#39;,&#39;<u></u>5038&#39;,$errno,$errstr,10);<br>
<br>
<br>
fwrite($socket,&quot;Action: Login\r\n&quot;);<br>
<br>
fwrite($socket,&quot;UserName: mark\r\n&quot;);<br>
<br>
fwrite($socket,&quot;Secret: mysecret\r\n\r\n&quot;);<br>
<br>
fwrite($socket,&quot;Action: DBPut\r\n&quot;);<br>
<br>
fwrite($socket,&quot;Family: authenticate/jorge\r\n&quot;);<br>
<br>
fwrite($socket,&quot;Key: 123456\r\n&quot;);<br>
<br>
fwrite($socket,&quot;Value: pbx-a\r\n&quot;);<br>
<br>
fwrite($socket,&quot;Action: Logoff\r\n\r\n&quot;);<br>
<br>
<br>
fclose($socket);<br>
<br>
}<br>
<br>
ast_claves();<br>
<br>
?&gt;<br>
<br>
</blockquote>
You are closing the socket before reading the result of &#39;Logoff&#39; and<br>
Asterisk is complaining.<br>
</blockquote>
<br></div>
Well, he&#39;s sending DBPut before reading the result of Login as well.<br><font color="#888888">
<br>
-- <br>
Kevin P. Fleming<br>
Digium, Inc. | Director of Software Technologies<br>
Jabber: <a href="mailto:kfleming@digium.com" target="_blank">kfleming@digium.com</a> | SIP: <a href="mailto:kpfleming@digium.com" target="_blank">kpfleming@digium.com</a> | Skype: kpfleming<br>
445 Jan Davis Drive NW - Huntsville, AL 35806 - USA<br>
Check us out at <a href="http://www.digium.com" target="_blank">www.digium.com</a> &amp; <a href="http://www.asterisk.org" target="_blank">www.asterisk.org</a></font><div><div></div><div class="h5"><br>
<br>
--<br>
______________________________<u></u>______________________________<u></u>_________<br>
-- Bandwidth and Colocation Provided by <a href="http://www.api-digital.com" target="_blank">http://www.api-digital.com</a> --<br>
New to Asterisk? Join us for a live introductory webinar every Thurs:<br>
              <a href="http://www.asterisk.org/hello" target="_blank">http://www.asterisk.org/hello</a><br>
<br>
asterisk-users mailing list<br>
To UNSUBSCRIBE or update options visit:<br>
  <a href="http://lists.digium.com/mailman/listinfo/asterisk-users" target="_blank">http://lists.digium.com/<u></u>mailman/listinfo/asterisk-<u></u>users</a><br>
</div></div></blockquote></div><br></div>