Ola galera<br><br>Alguem poderia me ajudar modificar esse codigo para fazer um callback da seguinte forma.. a pessoa liga para um numero.. da um toque e o asterisk retorna para ela liberando uma linha.<br><br>Segue:<br><table cellpadding="2">
<tbody><tr><td class="text2" bgcolor="#dddddd">capiin]<br>
exten =&gt; 1234/016066666,1,Wait,1<br>
exten =&gt; 1234/016066666,2,AGI,callback.agi<br>
exten =&gt; 1234/016066666,3,Hangup<br>
[capidialtone]<br>
exten =&gt; s,1,Dial,CAPI/@1234:b<br>
exten =&gt; s,2,Hangup<br>
</td><td>  <br></td></tr><tr>
<td class="text2" bgcolor="#dddddd">
&lt; ? p h p<br>
    ob_implicit_flush(true);<br>
    set_time_limit(0);<br>
    $err=fopen(&quot;php://stderr&quot;,&quot;w&quot;);<br>
    $in = fopen(&quot;php://stdin&quot;,&quot;r&quot;);<br>
    while (!feof($in)) {<br>
        $temp = str_replace(&quot;\n&quot;,&quot;&quot;,fgets($in,4096));<br>
        $s = split(&quot;:&quot;,$temp);<br>
        $agi[str_replace(&quot;agi_&quot;,&quot;&quot;,$s[0])] = trim($s[1]);<br>
        if (($temp == &quot;&quot;) || ($temp == &quot;\n&quot;)) {<br>
            break;<br>
        }<br>
    }<br>
            $cf = fopen(&quot;/home/kapejod/pbx/var/spool/asterisk/outgoing/cb&quot;.$agi[&quot;callerid&quot;],&quot;w+&quot;);
            fputs($cf,&quot;Channel: CAPI/&quot;.$agi[&quot;extension&quot;].&quot;:&quot;.$agi[&quot;callerid&quot;].&quot;\n&quot;);<br>
            fputs($cf,&quot;Context: capidialtone\n&quot;);<br>
            fputs($cf,&quot;Extension: s\n&quot;);<br>
            fputs($cf,&quot;SetVar: CALLERIDNUM=&quot;.$agi[&quot;extension&quot;].&quot;\n&quot;);<br>
            fputs($cf,&quot;MaxRetries: 2\n&quot;);<br>
            fputs($cf,&quot;RetryTime: 10\n&quot;);<br>
            fclose($cf);<br>
    fclose($in);<br>
    fclose($err);<br>
? &gt;<br>
</td>
<td>  
<br></td>
</tr>
<tr>
<td colspan="2" class="text2"><br></td></tr></tbody></table><br>Abraços para todos<br>