Joined: Tue 12 of Nov, 2013


Posted:Tue 12 of Nov, 2013 (20:22 UTC)
Hi Guys,

I have a problem with my click2call.php file.

If i click on a number in my intranet this link ( activates the click2call.php script.

If i dial from a Gigaset IP Pro to an Grandstream it is working like i want too. the call on the caller phone is automaticly answering and then the destination is ringing. But if i dial from a Gigaset to a Gigaset phone the caller phone is automaticly answering and the destination phone too.
What is wrong with my script?

$dest = $_GET'dest'];
$caller = $_GET'caller'];
$oSocket = fsockopen("localhost", 5038, $errnum, $errdesc) or die("Connection to host failed");
fputs($oSocket, "Action: login\r\n");
fputs($oSocket, "Events: off\r\n");
fputs($oSocket, "Username: admin\r\n");
fputs($oSocket, "Secret: amp111\r\n\r\n");
fputs($oSocket, "Action: originate\r\n");
fputs($oSocket, "Channel: local/".$caller."@from-internal\r\n");
fputs($oSocket, "WaitTime: 30\r\n");
fputs($oSocket, "CallerId: Web Call <".$dest.">\r\n");
fputs($oSocket, "Variable: _SIPADDHEADER=Call-Info:\;answer-after=1\r\n" );
fputs($oSocket, "Exten: ".$dest."\r\n");
fputs($oSocket, "Async: yes\r\n\r\n");
fputs($oSocket, "Context: from-internal\r\n");
fputs($oSocket, "Priority: 1\r\n\r\n");
fputs($oSocket, "Action: Logoff\r\n\r\n");

I hope you can help me