function set_hint($user, $devices) { //debug("set_hint: user: $user, devices: $devices",8); global $amp_conf; global $astman; global $dnd_mode; global $intercom_code; global $campon_toggle; $dnd_string = $dnd_mode == 'dnd' ? "&Custom:DND{$user}" : ''; $presence_string = $amp_conf['AST_FUNC_PRESENCE_STATE'] ? ",CustomPresence:{$user}" : ''; if ($devices) { $dial_string = get_dial_string($devices); echo "exten => {$user},hint," . $dial_string . $dnd_string . $presence_string . "\n"; if ($intercom_code != 'nointercom' && $intercom_code != '') { echo "exten => {$intercom_code}" . "{$user},hint," . $dial_string . $dnd_string . $presence_string . "\n"; } if ($campon_toggle != 'nocampon' && $campon_toggle != '') { $dev_arr = explode('&', $dial_string); $hint_val = 'ccss:' . implode('&ccss:', $dev_arr); echo "exten => {$campon_toggle}" . "{$user},hint,{$hint_val}" . "\n"; } } else { if ($dnd_mode == 'dnd') { echo "exten => {$user},hint,Custom:DND" . $user . $presence_string . "\n"; if ($intercom_code != 'nointercom' && $intercom_code != '') { echo "exten => {$intercom_code}" . "{$user},hint,Custom:DND" . $user . $presence_string . "\n"; } } } }
function set_hint($user, $devices) { debug("set_hint: user: {$user}, devices: {$devices}", 8); global $astman; global $dnd_mode; global $intercom_code; $dnd_string = $dnd_mode == 'dnd' ? "&Custom:DND{$user}" : ''; if ($devices) { $dial_string = get_dial_string($devices); echo "exten => {$user},hint,{$dial_string}" . "{$dnd_string}\n"; if ($intercom_code != 'nointercom' && $intercom_code != '') { echo "exten => {$intercom_code}" . "{$user},hint,{$dial_string}" . "{$dnd_string}\n"; } } else { if ($dnd_mode == 'dnd') { echo "exten => {$user},hint,Custom:DND{$user}\n"; if ($intercom_code != 'nointercom' && $intercom_code != '') { echo "exten => {$intercom_code}" . "{$user},hint,Custom:DND{$user}\n"; } } } }
die($results->getMessage()); } if (count($results) == 0) { $toupgradectr++; $exttoupgrade[] = $extnum; out("MISSING HINT"); } else { out("OK"); } } out("Found {$toupgradectr} to upgrade..."); if ($toupgradectr > 0) { out("Upgrading extension hints.."); foreach ($exttoupgrade as $extnum) { outn(" extension {$extnum}..."); $extds = get_dial_string($extnum); if ($extds != '') { //write database $sql = "INSERT INTO extensions (context, extension, priority, application) VALUES ('ext-local', {$extnum}, 'hint', '{$extds}')"; $extres = $db->query($sql); if (DB::IsError($extres)) { die($extres->getMessage()); } out("DONE ({$extds})"); } else { out("**ERROR** Unrecognised technology type in E{$extnum}"); } } out("Upgrading extension hints..OK"); } function get_dial_string($extnum)