<div class="gmail_extra">Do jeito que eu estou tentando, não está funcionando nem o Hangup, somente o Originate.<br>Dê uma olhada:<br><br>Aí dessa forma, o Origintate funciona, sendo : URL?acao=o                 ou           URL?acao=h<br>
o=Originate<br>h=Hangup<br><br><br>&lt;?php<br>  $timeout = 30;<br> $socket = fsockopen(&quot;192.168.X.Y&quot;,&quot;5038&quot;, $errno, $errstr, $timeout); <br> fputs($socket, &quot;Action: Login\r\n&quot;);<br> fputs($socket, &quot;UserName: user\r\n&quot;);<br>
 fputs($socket, &quot;Secret: senha\r\n\r\n&quot;);<br> sleep(1);<br> $wrets=fgets($socket,128);<br><br>echo &quot;&lt;br /&gt;&lt;br /&gt;ERRNO:&quot;.$errno.&quot;&lt;br /&gt;ERRSTR:&quot;.$errstr.&quot;&lt;br /&gt;&lt;br /&gt;&quot;;<br>
<br><br>$ramint = $_POST[&quot;rinterno&quot;];<br>$foneext = $_POST[&quot;fexterno&quot;];<br>$tipo = &quot;sip&quot;;<br><br>echo &quot;Ramal interno:... $ramint &lt;br&gt;&quot;;<br>echo &quot;Fone externo :... $foneext &lt;br&gt;&quot;;<br>
echo &quot;Continuidade:...  $cont &lt;br&gt;&quot;;<br><br>if ($cont == &quot;1&quot;)<br>{<br>        if ($tipo == &quot;sip&quot;)<br>        {<br>            if ($_GET[&#39;acao&#39;]==&#39;o&#39;) {<br>                fputs($socket, &quot;Action: Originate\r\n&quot; );<br>
            } else {<br>                fputs($socket, &quot;Action: Hangup\r\n&quot; ); <br>            }<br>            fputs($socket, &quot;Channel: SIP/306\r\n&quot; );<br>            if ($_GET[&#39;acao&#39;]==&#39;o&#39;) {<br>
                fputs($socket, &quot;Exten: 307\r\n&quot; ); <br>            }<br>            fputs($socket, &quot;Async: yes\r\n\r\n&quot; );<br>            $wrets=fgets($socket,128);<br>            print_r($wrets);<br>        }<br>
<br>echo &quot;Discagem efetuada ...: &quot;;<br>}<br>echo &quot;Log ....................: &quot;;<br>echo &quot;&lt;br&gt;&quot;;<br>echo &quot;$wrets &lt;br&gt;&quot; ; <br><br>?&gt;<br><br><br>-- <br>Marcos Paulo Maia Nicolau<br>
8º Período_Ciência da Computação<br>Universidade Federal de Lavras_UFLA<br>Linux User # 499266<br>
</div>