if (is_voip_enabled($operator_id)) { //prepare common voip functions include "functions/functions.voip.php"; $v = new voip(); $v->connect(VOIP_SERVER); } $btext = "onload='parent.closePopup();'"; // set default, change on conditions if (isset($_POST['contact_phone'])) { $contact_phone_id = bigintval($_POST['contact_phone']); $call_attempt_id = get_call_attempt($operator_id, false); $respondent_id = get_respondent_id($call_attempt_id); $call_id = get_call($operator_id, $respondent_id, $contact_phone_id, true); if ($call_id) { if (is_voip_enabled($operator_id)) { $v->dial(get_extension($operator_id), get_call_number($call_id)); } } else { exit; } } else { //hang up the call first if (is_voip_enabled($operator_id)) { $v->hangup(get_extension($operator_id)); } //disable recording ---> Not actual for call_interface2 ?? $newtext = T_("Start REC"); if (isset($_POST['outcome'])) { //process with outcome $outcome_id = bigintval($_POST['outcome']); end_call($operator_id, $outcome_id);
{ print "<p>" . T_("Try calling the supervisor") . "</p>"; } */ } else { if ($callstatus == 0 || $callstatus == 4 || $callstatus == 5) { if (is_voip_enabled($operator_id)) { if (isset($_GET['callsupervisor'])) { include "functions/functions.voip.php"; $v = new voip(); $v->connect(VOIP_SERVER); if (strcmp($_GET['callsupervisor'], "hangup") == 0) { $v->hangup(get_extension($operator_id)); print "<p>" . T_("You may now close this window") . "</p>"; } else { $v->dial(get_extension($operator_id), SUPERVISOR_EXTENSION); print "<p>" . T_("Calling the supervisor, you may close this window") . "</p>"; } } else { print "<p><a href='?callsupervisor=callsupervisor'>" . T_("Click here to call the supervisor's phone. Otherwise close this window") . "</a></p>"; print "<p><a href='?callsupervisor=hangup'>" . T_("Hangup when calling the supervisor") . "</a></p>"; } } else { print "<p>" . T_("Try calling the supervisor") . "</p>"; } } else { if ($callstatus == 2) { print "<p>" . T_("Please wait for this call to answer before attempting to call the supervisor") . "</p>"; } } }