Topic: Click to call application [Comments: 1]
Wed, 06/23/2010 - 14:53 | Click to call application
Hi,
I have a click to "call application" in php on my website that works fine with my Elastix system. I would like to integrate it to specific tenant in my Thirdlane MTE and don't know how to do it.
Basically the parameters I have to manipulate are:
- Ip addres where the click to call application is installed
- username to login (in /etc/asterisk/manager.conf)
- secret to login (in /etc/asterisk/manager.conf)
- the extension you want to receive the call
- the context to make the outgoing call from
How can I make this to work with Thirdlane in a specific tenant?
Please advice,
Regards,
RMRG
$strHost = "127.0.0.1";
$strUser = "userXXX";
$strSecret = "secretXXX";
$strChannel = "SIP/151";
$strContext = "from-internal";
$strWaitTime = "50";
$strPriority = "1";
$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 == 7 && is_numeric($strExten))
#if ($length > 0 && 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: 11$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");
fclose($oSocket);
?>





Wed, 06/30/2010 - 19:16 | Change the context from
Change the context from "from-internal" to "from-inside".
FSD