"272", "5" => "228", "6" => "290", "3" => "250", "11" => "240" ); $strUser = $_GET["staffID"]; $strChannel = "SIP/". $users[$strUser]; #get the phone number from the form $strExten = $_GET["txtphonenumber"]; $strClient = $_GET["txtclient"]; #specify the caller id for the call $strCallerId = $strClient . " <" . $strExten . ">"; $length = strlen($strExten); if ($users[$strUser] && ($length > 7) && is_numeric($strExten)) { $oSocket = fsockopen($strHost, 5038, $errnum, $errdesc) or die("Connection to host failed"); fputs($oSocket, $authenticate); 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"); fclose($oSocket); } ?>