<div dir="ltr"><i>-We'll need to know more about the software you're using. That is, what is it called, what version is it, and so on.</i><div><br></div><div>I used last version of X-lite softphone as client, first calling an extension, then extension call my number through my extension that registered on softphone.</div>
<div>-1 in normal way, when I type the number in softphone, it call the number and show me just "End" bottom.</div><div>2- when I calling the number through the web, it show me "Answer" bottom and I have to click answer to calling then number. it is 2 steps to calling from web.</div>
<div><br></div><div><div><i>-There may be headers you can pass to cause your softphone to automatically answer the incoming call. By default, most physical SIP phones allow a sort of "intercom" mode that requires no user action before the SIP call is brought up. I don't know if your software would support the same mechanism.</i></div>
<span class="HOEnZb"><i><font color="#888888"></font></i></span><div><br></div><div>here is my AMI code:</div><div><br></div><div><div><?php</div><div>#ip address that asterisk is on.</div><div>$host = "ip addrss here";</div>
<div>$user = "username here";</div><div>$secret = "my secret here";</div><div>$channel = $_REQUEST['exten'];</div><div>$context = "from-internal";</div><div><br></div><div>$waitTime = "20";</div>
<div><br></div><div>$priority = "1";</div><div><br></div><div>$maxRetry = "2";</div><div>$number=strtolower($_REQUEST['number']);</div><div>$pos=strpos ($number,"local");</div><div>if ($number == null):</div>
<div><span class="Apple-tab-span" style="white-space:pre">        </span>exit();</div><div>endif ;</div><div>if ($pos===false) :</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>$errno=0 ;</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>$errstr=0 ;</div>
<div><span class="Apple-tab-span" style="white-space:pre">        </span>$callerId = "calling to : $number";</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>$oSocket = fsockopen ("localhost", 5038, &$errno, &$errstr, 20);</div>
<div><span class="Apple-tab-span" style="white-space:pre">        </span>if (!$oSocket) {</div><div><span class="Apple-tab-span" style="white-space:pre">                </span>echo "$errstr ($errno)<br>\n";</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>} else {</div>
<div><span class="Apple-tab-span" style="white-space:pre">                </span>fputs($oSocket, "Action: login\r\n");</div><div><span class="Apple-tab-span" style="white-space:pre">                </span>fputs($oSocket, "Events: on\r\n");</div>
<div><span class="Apple-tab-span" style="white-space:pre">                </span>fputs($oSocket, "Username: $user\r\n");</div><div><span class="Apple-tab-span" style="white-space:pre">                </span>fputs($oSocket, "Secret: $secret\r\n\r\n");</div>
<div><span class="Apple-tab-span" style="white-space:pre">                </span>fputs($oSocket, "Action: originate\r\n");</div><div><span class="Apple-tab-span" style="white-space:pre">                </span>fputs($oSocket, "Channel: $channel\r\n");</div>
<div><span class="Apple-tab-span" style="white-space:pre">                </span>fputs($oSocket, "WaitTime: $waitTime\r\n");</div><div><span class="Apple-tab-span" style="white-space:pre">                </span>fputs($oSocket, "CallerId: $callerId\r\n");</div>
<div><span class="Apple-tab-span" style="white-space:pre">                </span>fputs($oSocket, "Exten: $number\r\n");</div><div><span class="Apple-tab-span" style="white-space:pre">                </span>fputs($oSocket, "Context: $context\r\n");</div>
<div><span class="Apple-tab-span" style="white-space:pre">                </span>fputs($oSocket, "Priority: $priority\r\n\r\n");</div><div><span class="Apple-tab-span" style="white-space:pre">                </span>fputs($oSocket, "Action: Logoff\r\n\r\n");</div>
<div><span class="Apple-tab-span" style="white-space:pre">                </span>sleep(2);</div><div><span class="Apple-tab-span" style="white-space:pre">                </span>fclose($oSocket);</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>}</div>
<div><span class="Apple-tab-span" style="white-space:pre">        </span>echo "Extension $channel should be calling $number." ;</div><div>else :</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>exit() ;</div>
<div>endif ;</div><div>?></div></div><div><br></div><br><div class="gmail_quote">On Tue, Jan 22, 2013 at 6:28 PM, Christopher Harrington <span dir="ltr"><<a href="mailto:chris@acsdi.com" target="_blank">chris@acsdi.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="im">On Tue, Jan 22, 2013 at 1:57 AM, Muhammad <span dir="ltr"><<a href="mailto:mohammad.ghazavi@gmail.com" target="_blank">mohammad.ghazavi@gmail.com</a>></span> wrote:<br>
</div><div class="gmail_extra"><div class="gmail_quote"><div class="im">
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><font color="#333399" face="tahoma, sans-serif">Dear All.</font>
<div><font color="#333399" face="tahoma, sans-serif"><br></font></div><div><font color="#333399" face="tahoma, sans-serif">When I calling a number from web, my softphone show me "Answer" and "Decline" bottoms, and then I have to click Answer to call the number. it seems it is two step to calling the number. If I type the number direct to my client softphone, it calls directlly the number without show me to choose Answer to calling.</font></div>
<div><font color="#333399" face="tahoma, sans-serif"><br></font></div></div></blockquote><div><br></div></div><div>We'll need to know more about the software you're using. That is, what is it called, what version is it, and so on.</div>
<div class="im">
<div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><font color="#333399" face="tahoma, sans-serif"></font></div><div><font color="#333399" face="tahoma, sans-serif">My source code is in AMI fsocket open to make call from web. how can I call direct to the number?</font></div>
</div>
<br></blockquote><div><br></div></div><div>There may be headers you can pass to cause your softphone to automatically answer the incoming call. By default, most physical SIP phones allow a sort of "intercom" mode that requires no user action before the SIP call is brought up. I don't know if your software would support the same mechanism.</div>
<span class="HOEnZb"><font color="#888888">
<div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">--<br>
_____________________________________________________________________<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/mailman/listinfo/asterisk-users</a><br></blockquote></font></span></div><span class="HOEnZb"><font color="#888888"><br>
<br clear="all"><div><br></div>-- <br>-Chris Harrington<br>
<div>ACSDi Office: 763.559.5800</div><div><div>Mobile Phone: 612.326.4248</div></div><div><br></div>
</font></span></div></div>
<br>--<br>
_____________________________________________________________________<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/mailman/listinfo/asterisk-users</a><br></blockquote></div><br></div></div>