[asterisk-users] two steps when calling from web!
Muhammad
mohammad.ghazavi at gmail.com
Wed Jan 23 01:09:33 CST 2013
*-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 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.
-1 in normal way, when I type the number in softphone, it call the number
and show me just "End" bottom.
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.
*-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.*
**
here is my AMI code:
<?php
#ip address that asterisk is on.
$host = "ip addrss here";
$user = "username here";
$secret = "my secret here";
$channel = $_REQUEST['exten'];
$context = "from-internal";
$waitTime = "20";
$priority = "1";
$maxRetry = "2";
$number=strtolower($_REQUEST['number']);
$pos=strpos ($number,"local");
if ($number == null):
exit();
endif ;
if ($pos===false) :
$errno=0 ;
$errstr=0 ;
$callerId = "calling to : $number";
$oSocket = fsockopen ("localhost", 5038, &$errno, &$errstr, 20);
if (!$oSocket) {
echo "$errstr ($errno)<br>\n";
} else {
fputs($oSocket, "Action: login\r\n");
fputs($oSocket, "Events: on\r\n");
fputs($oSocket, "Username: $user\r\n");
fputs($oSocket, "Secret: $secret\r\n\r\n");
fputs($oSocket, "Action: originate\r\n");
fputs($oSocket, "Channel: $channel\r\n");
fputs($oSocket, "WaitTime: $waitTime\r\n");
fputs($oSocket, "CallerId: $callerId\r\n");
fputs($oSocket, "Exten: $number\r\n");
fputs($oSocket, "Context: $context\r\n");
fputs($oSocket, "Priority: $priority\r\n\r\n");
fputs($oSocket, "Action: Logoff\r\n\r\n");
sleep(2);
fclose($oSocket);
}
echo "Extension $channel should be calling $number." ;
else :
exit() ;
endif ;
?>
On Tue, Jan 22, 2013 at 6:28 PM, Christopher Harrington <chris at acsdi.com>wrote:
> On Tue, Jan 22, 2013 at 1:57 AM, Muhammad <mohammad.ghazavi at gmail.com>wrote:
>
>> Dear All.
>>
>> 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.
>>
>>
> 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.
>
>
>
>> My source code is in AMI fsocket open to make call from web. how can I
>> call direct to the number?
>>
>>
> 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.
>
>
>> --
>> _____________________________________________________________________
>> -- Bandwidth and Colocation Provided by http://www.api-digital.com --
>> New to Asterisk? Join us for a live introductory webinar every Thurs:
>> http://www.asterisk.org/hello
>>
>> asterisk-users mailing list
>> To UNSUBSCRIBE or update options visit:
>> http://lists.digium.com/mailman/listinfo/asterisk-users
>>
>
>
>
> --
> -Chris Harrington
> ACSDi Office: 763.559.5800
> Mobile Phone: 612.326.4248
>
>
> --
> _____________________________________________________________________
> -- Bandwidth and Colocation Provided by http://www.api-digital.com --
> New to Asterisk? Join us for a live introductory webinar every Thurs:
> http://www.asterisk.org/hello
>
> asterisk-users mailing list
> To UNSUBSCRIBE or update options visit:
> http://lists.digium.com/mailman/listinfo/asterisk-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-users/attachments/20130123/c75fbebc/attachment.htm>
More information about the asterisk-users
mailing list