Changeset 11342
- Timestamp:
- 02/11/11 18:40:47 (2 years ago)
- Files:
-
- freepbx/branches/2.9/amp_conf/bin/generate_hints.php (modified) (3 diffs)
- modules/branches/2.9/campon/functions.inc.php (modified) (1 diff)
- modules/branches/2.9/campon/install.php (modified) (1 diff)
- modules/branches/2.9/core/agi-bin/user_login_out.agi (modified) (4 diffs)
- modules/branches/2.9/core/functions.inc.php (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
freepbx/branches/2.9/amp_conf/bin/generate_hints.php
r10866 r11342 12 12 // 13 13 $intercom_code = isset($argv[1]) ? $argv[1] : ''; 14 $dnd_mode = isset($argv[2]) ? $argv[2] : ''; 14 $campon_toggle = isset($argv[2]) ? $argv[2] : ''; 15 $dnd_mode = isset($argv[3]) ? $argv[3] : ''; 15 16 16 17 $ast_with_dahdi = ast_with_dahdi(); … … 39 40 global $dnd_mode; 40 41 global $intercom_code; 42 global $campon_toggle; 41 43 42 44 $dnd_string = ($dnd_mode == 'dnd')?"&Custom:DND$user":''; … … 47 49 if ($intercom_code != 'nointercom' && $intercom_code != '') { 48 50 echo "exten => $intercom_code"."$user,hint,$dial_string"."$dnd_string\n"; 51 } 52 if ($campon_toggle != 'nocampon' && $campon_toggle != '') { 53 54 $dev_arr = explode('&',$dial_string); 55 $hint_val = 'ccss:'.implode('&ccss:',$dev_arr); 56 echo "exten => $campon_toggle"."$user,hint,$hint_val"."\n"; 49 57 } 50 58 } else if ($dnd_mode == 'dnd') { modules/branches/2.9/campon/functions.inc.php
r11338 r11342 234 234 $ext->add($id, $c, '', new ext_playback('beep')); 235 235 $ext->add($id, $c, '', new ext_macro('hangupcall')); 236 } 237 238 function campon_toggle($c) { 239 global $ext; 240 global $amp_conf; 241 242 $id = "app-campon-toggle"; // The context to be included 243 $hint_context = 'ext-local'; 244 245 $ext->addInclude('from-internal-additional', $id); // Add the include from from-internal 246 $ext->add($id, $c, '', new ext_answer('')); 247 $ext->add($id, $c, '', new ext_set('CCSS_SETUP', 'TRUE')); // keep from calling normal sub-ccss 248 $ext->add($id, $c, '', new ext_macro('user-callerid')); 249 $ext->add($id, $c, '', new ext_execif('$["${EXTENSION_STATE(' . $c . '${AMPUSER}@' . $hint_context . ')}" = "INUSE"]','CallCompletionCancel','','CallCompletionRequest','')); 250 $ext->add($id, $c, '', new ext_noop_trace('CC_REQUEST_RESULT: ${CC_REQUEST_RESULT} CC_REQUEST_REASON: ${CC_REQUEST_REASON}')); 251 $ext->add($id, $c, '', new ext_noop_trace('CC_CANCEL_RESULT: ${CC_CANCEL_RESULT} CC_CANCEL_REASON: ${CC_CANCEL_REASON}')); 252 $ext->add($id, $c, '', new ext_playback('beep')); 253 $ext->add($id, $c, '', new ext_macro('hangupcall')); 254 255 $ext->addGlobal('CAMPONTOGGLE',$c); 256 257 $userlist = core_users_list(); 258 if (is_array($userlist)) { 259 foreach($userlist as $item) { 260 $hint_code = $c.$item[0]; 261 $ext->add($hint_context, $hint_code, '', new ext_goto('1',$c,$id)); 262 if (!$amp_conf['DYNAMICHINTS']) { 263 $devices = core_hint_get($item[0]); 264 $dev_arr = explode('&',$devices); 265 $hint_val = 'ccss:'.implode('&ccss:',$dev_arr); 266 $ext->addHint($hint_context, $hint_code, $hint_val); 267 } 268 } 269 } 236 270 } 237 271 modules/branches/2.9/campon/install.php
r11338 r11342 21 21 unset($fcc); 22 22 23 // TODO: do I make this dependant on a patch 24 // 25 // Camp-On Toggle Feature Code 26 $fcc = new featurecode('campon', 'toggle'); 27 $fcc->setDescription('Camp-On Toggle'); 28 $fcc->setDefault('*84'); 29 $fcc->update(); 30 unset($fcc); 31 23 32 $freepbx_conf =& freepbx_conf::create(); 24 33 modules/branches/2.9/core/agi-bin/user_login_out.agi
r9667 r11342 52 52 $que_devstate = get_var( "QUEDEVSTATE" ) == "TRUE" ? true : false; 53 53 $intercom_code = get_var( "INTERCOMCODE" ); 54 $campon_toggle = get_var( "CAMPONTOGGLE" ); 54 55 55 56 $ast_version14 = version_compare($ast_version, "1.4", "ge"); … … 278 279 global $dnd_devstate; 279 280 global $intercom_code; 281 global $campon_toggle; 280 282 global $ast_version14; 281 283 … … 285 287 if ($devices) { 286 288 $dial_string = get_dial_string($devices); 289 290 if ($campon_toggle != 'nocampon' && $campon_toggle != '') { 291 $dev_arr = explode('&',$dial_string); 292 $hint_val = 'ccss:'.implode('&ccss:',$dev_arr); 293 $response = $astman->send_request('Command',array('Command'=>$dp_pre."add extension {$campon_toggle}{$user},hint,{$hint_val} into ext-local replace")); 294 } 287 295 if ($dnd_devstate) { 288 296 $dial_string .= "&Custom:DND$user"; … … 298 306 if ($intercom_code != 'nointercom' && $intercom_code != '') { 299 307 $response = $astman->send_request('Command',array('Command'=>$dp_pre."remove extension {$intercom_code}{$user}@ext-local hint")); 308 } 309 if ($campon_toggle != 'nocampon' && $campon_toggle != '') { 310 $response = $astman->send_request('Command',array('Command'=>$dp_pre."remove extension {$campon_toggle}{$user}@ext-local hint")); 300 311 } 301 312 } modules/branches/2.9/core/functions.inc.php
r11306 r11342 219 219 $ver16 = false; 220 220 } 221 // TODO: Temporary Kludge until CCSS is fixed 222 // 223 if (version_compare($ast_version, "1.8", "ge")) { 224 $cc_monitor_policy = "cc_monitor_policy=generic\n"; 225 } else { 226 $cc_monitor_policy = ""; 227 } 221 228 222 229 $sql = "SELECT keyword,data from $table_name where id=-1 and keyword <> 'account' and flags <> 1"; … … 350 357 $output .= $faxdetect; 351 358 } 359 if ($cc_monitor_policy) { 360 $output .= $cc_monitor_policy; 361 } 352 362 } 353 363 $output .= $additional."\n"; … … 1282 1292 $intercom_code = ($intercom_code == '') ? 'nointercom' : $intercom_code; 1283 1293 1294 $fcc = new featurecode('campon', 'toggle'); 1295 $campon_toggle = $fcc->getCodeActive(); 1296 unset($fcc); 1297 1298 $campon_toggle = ($campon_toggle == '') ? 'nocampon' : $campon_toggle; 1299 1284 1300 // Pass the code so agi scripts like user_login_logout know to generate hints 1285 1301 // … … 1288 1304 if ($amp_conf['DYNAMICHINTS']) { 1289 1305 if ($amp_conf['USEDEVSTATE'] && function_exists('donotdisturb_get_config')) { 1290 $add_dnd = ' dnd';1306 $add_dnd = 'dnd'; 1291 1307 } else { 1292 1308 $add_dnd = ''; 1293 1309 } 1294 $ext->addExec('ext-local',$amp_conf['AMPBIN'].'/generate_hints.php '.$intercom_code. $add_dnd);1310 $ext->addExec('ext-local',$amp_conf['AMPBIN'].'/generate_hints.php '.$intercom_code.' '.$campon_toggle .' '.$add_dnd); 1295 1311 } 1296 1312 $userlist = core_users_list();
