Click-To-Call script - How to set caller ID

TKJDK
Posts: 34
Member Since:
2006-11-03

I was wondering how to modify the "Click-To-Call script" by VoipJots.com modified by nerdvittles.com and others.

What can I add in the script to set the outbound caller id? Now it just displays the system default caller id, but i would like to display the caller id of a specific department.

/Thomas

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

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

$length = strlen($strChannel);

if ($length == 8 && is_numeric($strChannel))
{
$oSocket = fsockopen($strHost, 5038, $errnum, $errdesc,20) or die("Connection to host failed");
fputs($oSocket, "Action: login\r\n");
fputs($oSocket, "Username: $strUser\r\n");
fputs($oSocket, "Secret: $strSecret\r\n\r\n");
fputs($oSocket, "Events: off\r\n");
sleep(1) ;
fputs($oSocket, "Action: originate\r\n");
fputs($oSocket, "Channel: local/$strChannel@outbound-allroutes\r\n");
fputs($oSocket, "CallerId: $strCallerId\r\n");
fputs($oSocket, "Context: custom-app-from-web-telefonkortdk\r\n");
fputs($oSocket, "Extension: s\r\n");
fputs($oSocket, "Priority: 1\r\n\r\n");
fputs($oSocket, "Action: Logoff\r\n\r\n");
sleep(2) ;
fclose($oSocket);