Skip to content

Instantly share code, notes, and snippets.

@guilespi
Created June 7, 2013 20:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save guilespi/5732017 to your computer and use it in GitHub Desktop.
Save guilespi/5732017 to your computer and use it in GitHub Desktop.
<?php
//Main script settings
$CALL_ERROR_MSG = "Sorry, but I could not connect your call. Please try again later";
$ALT_CALLER_ID = "";
if (substr($CALLER_ID, 0, 3)=="011") {
$CALLER_ID = "00" . substr($CALLER_ID, 3);
}
//When a call transfer failure occurs
function callFailure($event) {
say($CALL_ERROR_MSG);
}
//Transfering the call to SIP
if($currentCall->callerID == "") {
transfer("sip:1000@guilespi.no-ip.org/1000", array(
"timeout" => 120,
"answerOnMedia" => true,
"callerID" => $CALLER_ID,
"onTimeout" => "callFailure",
"onCallFailure" => "callFailure"));
} else {
transfer("sip:1000@guilespi.no-ip.org/1000", array(
"timeout" => 120,
"answerOnMedia" => true,
"onTimeout" => "callFailure",
"onCallFailure" => "callFailure"));
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment