Пожалуйста, войдите здесь. Часто задаваемые вопросы О нас
Задайте Ваш вопрос

История изменений [назад]

нажмите, чтобы скрыть/показать версии 1
изначальная версия
редактировать

ответил 2011-12-20 12:51:23 +0400

mkt Gravatar mkt

Click-to-Call -от VoipJots.com Поставил /var/www/html/ nano -w /var/www/html/click-to-call.php

<html> <head> <title>Click-to-Call</title> </head> <body>

#------------------------------------------------------------------------------------------ #edit the below variable values to reflect your system/information #------------------------------------------------------------------------------------------

#specify the name/ip address of your asterisk box #if your are hosting this page on your asterisk box, then you can use #127.0.0.1 as the host IP. Otherwise, you will need to edit the following #line in manager.conf, under the Admin user section: #permit=127.0.0.1/255.255.255.0 #change to: #permit=127.0.0.1/255.255.255.0,xxx.xxx.xxx.xxx ;(the ip address of the server this page is running on) $strHost = "127.0.0.1";

#specify the username you want to login with (these users are defined in /etc/asterisk/manager.conf) #this user is the default AAH AMP user; you shouldn't need to change, if you're using AAH. $strUser = "admin";

#specify the password for the above user $strSecret = "admin";

#specify the channel (extension) you want to receive the call requests with #e.g. SIP/XXX, IAX2/XXXX, ZAP/XXXX, etc $strChannel = "SIP/1000";

#specify the context to make the outgoing call from. By default, AAH uses from-internal #Using from-internal will make you outgoing dialing rules apply $strContext = "a2billing";

#specify the amount of time you want to try calling the specified channel before hangin up $strWaitTime = "60";

#specify the priority you wish to place on making this call $strPriority = "1";

#specify the maximum amount of retries $strMaxRetry = "2";

#-------------------------------------------------------------------------------------------- #Shouldn't need to edit anything below this point to make this script work #-------------------------------------------------------------------------------------------- #get the phone number from the posted form $strExten = $_POST['txtphonenumber'];

#specify the caller id for the call $strCallerId = "Web Call <$strExten>";

$length = strlen($strExten);

if ($length = 14 && is_numeric($strExten)) {

$oSocket = fsockopen($strHost, 5038, $errnum, $errdesc) or die("Connection to host failed"); fputs($oSocket, "Action: login\r\n"); fputs($oSocket, "Events: off\r\n"); fputs($oSocket, "Username: $strUser\r\n"); fputs($oSocket, "Secret: $strSecret\r\n\r\n"); fputs($oSocket, "Action: originate\r\n"); fputs($oSocket, "Channel: $strChannel\r\n"); fputs($oSocket, "WaitTime: $strWaitTime\r\n"); fputs($oSocket, "CallerId: $strCallerId\r\n"); fputs($oSocket, "Exten: $strExten\r\n"); fputs($oSocket, "Context: $strContext\r\n"); fputs($oSocket, "Priority: $strPriority\r\n\r\n"); fputs($oSocket, "Action: Logoff\r\n\r\n"); sleep (1); fclose($oSocket); ?>

We are currently trying to call you. Please be patient, and wait for your phone to ring!
If your phone does not ring after 2 minutes, we apologize, but must either be out, or already on the phone.
Try Again

Enter your phone number (XXXXXXXXXXXXXX), and we will call you a few seconds later! <form action="&lt;? echo $_SERVER['PHP_SELF'] ?&gt;" method="post"> <input type="text" size="20" maxlength="14" name="txtphonenumber">
<input type="submit" value="Call Us!"> </form>

</body> </html>

::::::::::::::::::::::::::::::::::::::::::::: $strChannel = "SIP/1000"; ===> номер должен быть подключен к сети !обязательно!

Звонок приходить нормально. Но что бы общаться приходиться набрать от "SIP/1000" --- XXXXXXXXXX#

Click-to-Call -от VoipJots.com Поставил /var/www/html/ nano -w /var/www/html/click-to-call.php

<html> <head> <title>Click-to-Call</title> </head> <body>

#------------------------------------------------------------------------------------------ #edit the below variable values to reflect your system/information #------------------------------------------------------------------------------------------

#specify the name/ip address of your asterisk box #if your are hosting this page on your asterisk box, then you can use #127.0.0.1 as the host IP. Otherwise, you will need to edit the following #line in manager.conf, under the Admin user section: #permit=127.0.0.1/255.255.255.0 #change to: #permit=127.0.0.1/255.255.255.0,xxx.xxx.xxx.xxx ;(the ip address of the server this page is running on) $strHost = "127.0.0.1";

#specify the username you want to login with (these users are defined in /etc/asterisk/manager.conf) #this user is the default AAH AMP user; you shouldn't need to change, if you're using AAH. $strUser = "admin";

#specify the password for the above user $strSecret = "admin";

#specify the channel (extension) you want to receive the call requests with #e.g. SIP/XXX, IAX2/XXXX, ZAP/XXXX, etc $strChannel = "SIP/1000";

#specify the context to make the outgoing call from. By default, AAH uses from-internal #Using from-internal will make you outgoing dialing rules apply $strContext = "a2billing";

#specify the amount of time you want to try calling the specified channel before hangin up $strWaitTime = "60";

#specify the priority you wish to place on making this call $strPriority = "1";

#specify the maximum amount of retries $strMaxRetry = "2";

#-------------------------------------------------------------------------------------------- #Shouldn't need to edit anything below this point to make this script work #-------------------------------------------------------------------------------------------- #get the phone number from the posted form $strExten = $_POST['txtphonenumber'];

#specify the caller id for the call $strCallerId = "Web Call <$strExten>";

$length = strlen($strExten);

if ($length = 14 && is_numeric($strExten)) {

$oSocket = fsockopen($strHost, 5038, $errnum, $errdesc) or die("Connection to host failed"); fputs($oSocket, "Action: login\r\n"); fputs($oSocket, "Events: off\r\n"); fputs($oSocket, "Username: $strUser\r\n"); fputs($oSocket, "Secret: $strSecret\r\n\r\n"); fputs($oSocket, "Action: originate\r\n"); fputs($oSocket, "Channel: $strChannel\r\n"); fputs($oSocket, "WaitTime: $strWaitTime\r\n"); fputs($oSocket, "CallerId: $strCallerId\r\n"); fputs($oSocket, "Exten: $strExten\r\n"); fputs($oSocket, "Context: $strContext\r\n"); fputs($oSocket, "Priority: $strPriority\r\n\r\n"); fputs($oSocket, "Action: Logoff\r\n\r\n"); sleep (1); fclose($oSocket); ?>

We are currently trying to call you. Please be patient, and wait for your phone to ring!
If your phone does not ring after 2 minutes, we apologize, but must either be out, or already on the phone.
Try Again/var/www/html/click-to-call.php ссылка на страницу

Enter your phone number (XXXXXXXXXXXXXX), and we will call you a few seconds later! <form action="&lt;? echo $_SERVER['PHP_SELF'] ?&gt;" method="post"> <input type="text" size="20" maxlength="14" name="txtphonenumber">
<input type="submit" value="Call Us!"> </form>

</body> </html>

::::::::::::::::::::::::::::::::::::::::::::: $strChannel = "SIP/1000"; "SIP/1234"; ===> номер должен быть подключен к сети !обязательно!

Звонок приходить нормально. Но что бы общаться приходиться набрать от "SIP/1000" --- XXXXXXXXXX#

Проект компании "АТС Дизайн"
Asterisk® и Digium® являются зарегистрированными торговыми марками компании Digium, Inc., США.
IP АТС Asterisk распространяется под лицензией GNU GPL.