Skip to main content

Click to call application

Posted by rmrg on Wed, 06/23/2010

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);
?>


Submitted by Ulsa on Fri, 10/25/2013 Permalink

Dear All,

I am currently working with Thirdlane multe tenant and facing problem with CLICK2CALL Application is not working. Actaully we customized the above mentioned code accordingly with PHP. Unfortunately i'm getting error while genarating click2call link for user extensions, That error is Access denied for user ''@'localhost' to database 'click2calldatabase'No database selected,
Here is my connection string for mysql what i am using to host the connection for mysql.
I am not sure what is the wrong with this connection string.
$con=mysql_connect("localhostname","user","userpassword");
 mysql_select_db("click2calldatabase");
 echo mysql_error();

After the above mentioned connection string. I am retriving data from tables accordingly from mysql. Can anyone help me out why I'm getting error  with my connection.!!!

Thanks
Ulsa

 

Submitted by Ulsa on Fri, 12/27/2013 Permalink

Dear All.

We have configured CLICK2CALL application with multitenanent it's working now,
You know how it is working like I can able produce link with PHP code that based on we are genarating calls to accordingly to extensions. Then when we generate a link for extension we can able get the calls from browser, After submiting from browser with values the calls are landing to our extension when we answer the calls are going to whoever submitted the values with according to the number.

Is there way can we call the user whoever trying to reach first from click2call application and then the call should routed to our extension?

Thanks
Ulsa