Changeset 11301
- Timestamp:
- 02/06/11 02:23:35 (2 years ago)
- Files:
-
- modules/branches/2.9/campon/functions.inc.php (modified) (19 diffs)
- modules/branches/2.9/campon/install.php (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
modules/branches/2.9/campon/functions.inc.php
r11283 r11301 8 8 case "asterisk": 9 9 $priority = 'report'; 10 $ext->splice('macro-user-callerid', 's', $priority,new ext_gosubif('$[${LEN(${DB(AMPUSER/${AMPUSER}/ccss/cc_agent_policy)})} & "${DB(AMPUSER/${AMPUSER}/ccss/cc_agent_policy)}" != "never"]', 'sub-ccss,s,1 ,${MACRO_CONTEXT},${MACRO_EXTEN}'));10 $ext->splice('macro-user-callerid', 's', $priority,new ext_gosubif('$[${LEN(${DB(AMPUSER/${AMPUSER}/ccss/cc_agent_policy)})} & "${DB(AMPUSER/${AMPUSER}/ccss/cc_agent_policy)}" != "never"]', 'sub-ccss,s,1(${MACRO_CONTEXT},${CALLERID(dnid))}')); 11 11 break; 12 12 } … … 45 45 $ext->add($mcontext,$exten,'', new ext_execif('$[${LEN(${CCSS_SETUP})}]','Return')); 46 46 $ext->add($mcontext,$exten,'', new ext_set('CCSS_SETUP', 'TRUE')); 47 $ext->add($mcontext,$exten,' ', new ext_gosubif('$[${LEN(${DB(AMPUSER/${ARG2}/ccss/cc_monitor_policy)})}]','monitor_config,1','monitor_default,1'));48 $ext->add($mcontext,$exten,' ', new ext_gosubif('$[${LEN(${DB(AMPUSER/${AMPUSER}/ccss/cc_agent_policy)})}]','agent_config,1','agent_default,1'));49 $ext->add($mcontext,$exten,'', new ext_return(' '));47 $ext->add($mcontext,$exten,'monitor', new ext_gosubif('$[${LEN(${DB(AMPUSER/${ARG2}/ccss/cc_monitor_policy)})}]','monitor_config,1','monitor_default,1')); 48 $ext->add($mcontext,$exten,'agent', new ext_gosubif('$[${LEN(${DB(AMPUSER/${AMPUSER}/ccss/cc_agent_policy)})}]','agent_config,1','agent_default,1')); 49 $ext->add($mcontext,$exten,'', new ext_return('${GOSUB_RETVAL}')); 50 50 51 51 /** … … 62 62 $ext->add($mcontext,$exten,'', new ext_noop_trace('Callee has no settings and default disabled, returning')); 63 63 $ext->add($mcontext,$exten,'', new ext_stackpop('')); 64 $ext->add($mcontext,$exten,'', new ext_return(' '));64 $ext->add($mcontext,$exten,'', new ext_return('FALSE')); 65 65 66 66 $ext->add($mcontext,$exten,'set_monitor', new ext_set('CALLCOMPLETTION(cc_max_monitors)', '${DB(AMPUSER/${ARG2}/ccss/max_monitors)}')); 67 $ext->add($mcontext,$exten,'', new ext_return(' '));67 $ext->add($mcontext,$exten,'', new ext_return('TRUE')); 68 68 69 69 /** … … 78 78 $ext->add($mcontext,$exten,'', new ext_noop_trace('calling a non-extesnion, policy set to never, skipping',6)); 79 79 $ext->add($mcontext,$exten,'', new ext_stackpop('')); 80 $ext->add($mcontext,$exten,'', new ext_return('FALSE')); 80 81 } else { 81 82 $ext->add($mcontext,$exten,'', new ext_noop_trace('calling a non-extesnion, policy enabled , continuing',6)); 82 83 $ext->add($mcontext,$exten,'', new ext_set('CALLCOMPLETTION(cc_monitor_policy)', $amp_conf['CC_NON_EXTENSION_POLICY'])); 83 84 $ext->add($mcontext,$exten,'', new ext_set('CALLCOMPLETTION(cc_max_monitors)', $amp_conf['CC_MAX_MONITORS_DEFAULT'])); 85 $ext->add($mcontext,$exten,'', new ext_return('TRUE')); 84 86 } 85 $ext->add($mcontext,$exten,'', new ext_return(''));86 87 87 88 If ($amp_conf['CC_MONITOR_POLICY_DEFAULT'] == 'never') { 88 89 $ext->add($mcontext,$exten,'is_exten', new ext_noop_trace('Callee has no settings and default is never so disabling')); 89 90 $ext->add($mcontext,$exten,'is_exten', new ext_stackpop('')); 91 $ext->add($mcontext,$exten,'', new ext_return('FALSE')); 90 92 } else { 91 93 $ext->add($mcontext,$exten,'is_exten', new ext_noop_trace('Callee has no settings and default enabled, continuing')); 92 94 $ext->add($mcontext,$exten,'is_exten', new ext_set('CALLCOMPLETTION(cc_monitor_policy)', $amp_conf['CC_MONITOR_POLICY_DEFAULT'])); 93 95 $ext->add($mcontext,$exten,'', new ext_set('CALLCOMPLETTION(cc_max_monitors)', $amp_conf['CC_MAX_MONITORS_DEFAULT'])); 96 $ext->add($mcontext,$exten,'', new ext_return('TRUE')); 94 97 } 95 $ext->add($mcontext,$exten,'', new ext_return(''));96 98 97 99 // subroutine(agent_config) … … 102 104 $ext->add($mcontext,$exten,'', new ext_set('CALLCOMPLETTION(ccnr_available_timer)', '${DB(AMPUSER/${ARG2}/ccss/ccnr_available_timer)}')); 103 105 104 // TODO: need to decide implementation here. The though is when they set Alert-Info or CID-Prepend, then we generate a unique macro for105 // that user and in that macro we set the prepend info, alert-info stuff since unique to that user, or maybe no need to be unique106 // I know who the exten is, cause they just called back, I think. Hmm, it's late, not thinking straight, re-visit this later since107 // as mentioned, need to work out the details for this one.108 //109 $ext->add($mcontext,$exten,'', new ext_set('CALLCOMPLETTION(cc_callback_macro)', '${DB(AMPUSER/${ARG2}/ccss/cc_callback_macro)}'));110 111 106 $ext->add($mcontext, $exten, '', new ext_execif('$["${CALLCOMPLETTION(cc_agent_policy)}" = "generic"]', 'Set', 'CALLCOMPLETTION(cc_recall_timer)=${DB(AMPUSER/${AMPUSER}/ccss/cc_recall_timer)}')); 112 107 $ext->add($mcontext, $exten, '', new ext_execif('$["${CALLCOMPLETTION(cc_agent_policy)}" = "generic"]', 'Set', 'CALLCOMPLETTION(cc_max_agents)=${DB(AMPUSER/${AMPUSER}/ccss/cc_max_agents)}')); 113 $ext->add($mcontext, $exten, '', new ext_execif('$["${DB(AMPUSER/${AMPUSER}/ccss/cc_agent_dialstring)}" = "internal"]', 'Set', 'CALLCOMPLETTION(cc_agent_dialstring)=Local/${AMPUSER}@from-ccss-internal')); 114 $ext->add($mcontext, $exten, '', new ext_execif('$["${DB(AMPUSER/${AMPUSER}/ccss/cc_agent_dialstring)}" = "extension"]', 'Set', 'CALLCOMPLETTION(cc_agent_dialstring)=Local/${AMPUSER}@from-ccss-extension')); 108 $ext->add($mcontext, $exten, '', new ext_execif('$["${DB(AMPUSER/${AMPUSER}/ccss/cc_agent_dialstring)}" = "internal"]', 'Set', 'CALLCOMPLETTION(cc_agent_dialstring)=Local/${AMPUSER}_${CALLERID(dnid)}@from-ccss-internal')); 109 $ext->add($mcontext, $exten, '', new ext_execif('$["${DB(AMPUSER/${AMPUSER}/ccss/cc_agent_dialstring)}" = "extension"]', 'Set', 'CALLCOMPLETTION(cc_agent_dialstring)=Local/${AMPUSER}_${CALLERID(dnid)}@from-ccss-extension')); 110 $ext->add($mcontext, $exten, '', new ext_execif('$[${LEN(${DB(AMPUSER/${AMPUSER}/ccss/cc_agent_dialstring)})}]', 'Set', 'CALLCOMPLETTION(cc_callback_macro)=ccss-default')); 115 111 $ext->add($mcontext,$exten,'', new ext_return('')); 116 112 … … 120 116 $ext->add($mcontext,$exten,'', new ext_noop_trace('Caller has no settings and default is never so disabling')); 121 117 $ext->add($mcontext,$exten,'', new ext_stackpop('')); 118 $ext->add($mcontext,$exten,'', new ext_return('FALSE')); 122 119 } else { 123 120 // TODO: is it possible we are not an extension calling here and we need more logic to safeguard? … … 135 132 If ($amp_conf['CC_AGENT_DIALSTRING_DEFAULT'] == 'extension') { 136 133 $ext->add($mcontext, $exten, '', new ext_set('CALLCOMPLETTION(cc_agent_dialstring)','Local/${AMPUSER}@from-ccss-extension')); 134 $ext->add($mcontext, $exten, '', new ext_set('CALLCOMPLETTION(cc_callback_macro)','ccss-default')); 137 135 } else If ($amp_conf['CC_AGENT_DIALSTRING_DEFAULT'] == 'internal') { 138 136 $ext->add($mcontext, $exten, '', new ext_set('CALLCOMPLETTION(cc_agent_dialstring)','Local/${AMPUSER}@from-ccss-internal')); 139 }140 // TODO: What about default cc_callback_macro, once we deterimine exactly how we use that, then we can see what condition141 // needs to set this and if it looks proper142 if (false) {143 137 $ext->add($mcontext, $exten, '', new ext_set('CALLCOMPLETTION(cc_callback_macro)','ccss-default')); 144 138 } 139 $ext->add($mcontext,$exten,'', new ext_return('TRUE')); 145 140 } 146 $ext->add($mcontext,$exten,'', new ext_return('')); 147 148 // TODO: Add from-ccss-extension 149 150 // TODO: Add from-ccss-internal 151 152 // TODO: Add something (SHARED(), current blkvm, to voicemail to block recall from going there 153 154 // TODO: Alert-Info and CID Prepend probably in macro but determin 141 142 $cpp = $amp_conf['CC_FORCE_DEFAULTS'] ? $amp_conf['CC_MONITOR_CID_PREPEND_DEFAULT'] : '${DB(AMPUSER/${CALLBACK_NUM}/ccss/cc_monitor_cid_prepend)}'; 143 144 $mcontext = 'macro-ccss-default'; 145 $exten = 's'; 146 147 if ($amp_conf['CC_FORCE_DEFAULTS'] && $amp_conf['CC_ANNOUNCE_MONITOR_DEFAULT']) { 148 $ext->add($mcontext,$exten,'', new ext_playback('beep&calling&extension')); 149 $ext->add($mcontext,$exten,'', new ext_saydigits('${CALLBACK_NUM}')); 150 } elseif ($amp_conf['CC_FORCE_DEFAULTS']) { 151 $ext->add($mcontext,$exten,'', new ext_answer('')); 152 } else { 153 $ext->add($mcontext,$exten,'', new ext_gotoif('$["${DB(AMPUSER/${AMPUSER}/ccss/cc_announce_monitor)}" = "silent"]','siprm')); 154 $ext->add($mcontext,$exten,'', new ext_playback('beep&calling&extension')); 155 $ext->add($mcontext,$exten,'', new ext_saydigits('${CALLBACK_NUM}')); 156 } 157 $ext->add($mcontext,$exten,'siprm', new ext_sipremoveheader('${CC_HEADER}')); 158 $ext->add($mcontext,$exten,'', new ext_noop_trace('In ccmacro with: ${CC_INTERFACES} Header: ${CC_HEADER} Callback: ${CALLBACK_NUM}')); 159 160 $ext->add($mcontext, $exten, '', new ext_set('CALLERID(name)',$cpp.'${CALLERIID(name)}')); 161 if ($amp_conf['CC_FORCE_DEFAULTS'] && $amp_conf['CC_MONITOR_ALERT_INFO_DEFAULT']) { 162 $ext->add($mcontext, $exten, '', new ext_alertinfo($amp_conf['CC_MONITOR_ALERT_INFO_DEFAULT'])); 163 } elseif (!$amp_conf['CC_FORCE_DEFAULTS']) { 164 $ext->add($mcontext, $exten, '', new ext_execif('$[!${LEN(${DB(AMPUSER/${AMPUSER}/ccss/cc_monitor_alert_info)})}]','MacroExit')); 165 $ext->add($mcontext, $exten, '', new ext_alertinfo('${DB(AMPUSER/${CALLBACK_NUM}/ccss/cc_monitor_alert_info)}')); 166 } 167 $ext->add($mcontext,$exten,'', new ext_macroexit('')); 168 169 170 $context = 'from-ccss-internal'; 171 $exten = '_X._X.'; 172 173 $ext->add($context, $exten, '', new ext_gosub('sub-from-css,s,1(${CUT(EXTEN,_,2)})')); 174 $ext->add($context, $exten, 'no_alert', new ext_goto('1','${CUT(EXTEN,_,1)}','from-internal')); 175 176 $context = 'from-ccss-extension'; 177 $exten = '_X._X.'; 178 179 $ext->add($context, $exten, '', new ext_gosub('sub-from-css,s,1(${CUT(EXTEN,_,2)})')); 180 $ext->add($context, $exten, '', new ext_goto('1','${CUT(EXTEN,_,1)}','ext-local')); 181 182 183 $cpp = $amp_conf['CC_FORCE_DEFAULTS'] ? $amp_conf['CC_AGENT_CID_PREPEND_DEFAULT'] : '${DB(AMPUSER/${AMPUSER}/ccss/cc_agent_cid_prepend)}'; 184 185 $mcontext = 'sub-from-ccss'; 186 $exten = 's'; 187 //$ext->add($context, $exten, '', new ext_set('FROM_CALL_COMPLETION','1')); 188 $ext->add($context, $exten, '', new ext_macro('blkvm-set')); 189 $ext->add($context, $exten, '', new ext_set('__CALLBACK_NUM','${ARG1}')); 190 $ext->add($context, $exten, '', new ext_set('CALLERID(name)','${IF($[${LEN(${DB(AMPUSER/${CALLBACK_NUM}/cidname)})}]?'.$cpp.'${DB(AMPUSER/${CALLBACK_NUM}/cidname)}:CALLBACK)}')); //TODO: Make this configurable 191 $ext->add($context, $exten, '', new ext_set('CALLERID(number)','${CALLBACK_NUM}')); 192 $ext->add($context, $exten, '', new ext_noop_trace('CID INFO: ${CALLERID(name)} ${CALLERID(num)} EXTEN: ${ARG1}',5)); 193 if ($amp_conf['CC_FORCE_DEFAULTS'] && $amp_conf['CC_AGENT_ALERT_INFO_DEFAULT']) { 194 $ext->add($context, $exten, '', new ext_set('__CC_HEADER',$amp_conf['CC_AGENT_ALERT_INFO_DEFAULT'])); 195 } elseif ($amp_conf['CC_FORCE_DEFAULTS']) { 196 $ext->add($context, $exten, '', new ext_return('')); 197 } else { 198 $ext->add($context, $exten, '', new ext_execif('$[!${LEN(${DB(AMPUSER/${AMPUSER}/ccss/cc_agent_alert_info)})}]','Return')); 199 $ext->add($context, $exten, '', new ext_set('__CC_HEADER','${DB(AMPUSER/${AMPUSER}/ccss/cc_agent_alert_info)}')); 200 } 201 $ext->add($context, $exten, '', new ext_alertinfo('${CC_HEADER}')); 202 $ext->add($context, $exten, '', new ext_return('')); 155 203 break; 156 204 } 157 205 } 158 206 159 // TODO: test response code to see if we can generate meaningful success/fail feedback160 207 function campon_request($c) { 161 208 global $ext; … … 166 213 $ext->addInclude('from-internal-additional', $id); // Add the include from from-internal 167 214 $ext->add($id, $c, '', new ext_answer('')); 215 $ext->add($id, $c, '', new ext_set('CCSS_SETUP', 'TRUE')); // keep from calling normal sub-ccss 168 216 $ext->add($id, $c, '', new ext_macro('user-callerid')); 217 $ext->add($id, $c, '', new ext_gosub('sub-ccss,s,agent')); 218 $ext->add($id, $c, '', new ext_noop_trace('GoSub(sub-ccss,s,agent) RETVAL: ${GOSUB_RETVAL}')); 219 // TODO: If they are not enabled, handle it here letting them know ${GOSUB_RETVAL} 220 // 221 169 222 $ext->add($id, $c, '', new ext_callcompletionrequest('')); 170 223 $ext->add($id, $c, '', new ext_noop_trace('CC_REQUEST_RESULT: ${CC_REQUEST_RESULT}')); … … 173 226 } 174 227 175 // TODO: test response code to see if we can generate meaningful success/fail feedback176 228 function campon_cancel($c) { 177 229 global $ext; … … 181 233 $ext->addInclude('from-internal-additional', $id); // Add the include from from-internal 182 234 $ext->add($id, $c, '', new ext_answer('')); 235 $ext->add($id, $c, '', new ext_set('CCSS_SETUP', 'TRUE')); // keep from calling normal sub-ccss 183 236 $ext->add($id, $c, '', new ext_macro('user-callerid')); 237 $ext->add($id, $c, '', new ext_gosub('sub-ccss,s,agent')); 238 $ext->add($id, $c, '', new ext_noop_trace('GoSub(sub-ccss,s,agent) RETVAL: ${GOSUB_RETVAL}')); 239 // TODO: If they are not enabled, handle it here letting them know ${GOSUB_RETVAL} 240 // 241 184 242 $ext->add($id, $c, '', new ext_callcompletioncancel('')); 185 243 $ext->add($id, $c, '', new ext_noop_trace('CC_REQUEST_RESULT: ${CC_REQUEST_RESULT}')); … … 283 341 $currentcomponent->setoptlistopts('cc_monitor_policy', 'sort', false); 284 342 343 $currentcomponent->addoptlistitem('cc_announce_monitor', 'announce', _('Announce')); 344 $currentcomponent->addoptlistitem('cc_announce_monitor', 'silent', _('Silent')); 345 $currentcomponent->setoptlistopts('cc_announce_monitor', 'sort', false); 346 285 347 for ($i=1;$i<=20;$i++) { 286 348 $currentcomponent->addoptlistitem('cc_max_monitors', $i, sprintf(_('%s Incoming Requests'),$i)); … … 319 381 $cc_agent_dialstring_label = _("Caller Callback Mode"); 320 382 $cc_max_monitors_label = _("Max Queued Callers"); 321 $cc_alert_info_label = _("Callback Alert-Info"); 322 $cc_cid_prepend_label = _("Callback CID Prepend"); 383 $cc_announce_monitor_label = _("Announce Callback Extension"); 384 $cc_agent_alert_info_label = _("Callback Alert-Info"); 385 $cc_agent_cid_prepend_label = _("Callback CID Prepend"); 386 $cc_monitor_alert_info_label = _("Callee Alert-Info"); 387 $cc_monitor_cid_prepend_label = _("Callee CID Prepend"); 323 388 324 389 $cc_agent_policy_tt = _("Asterisk: cc_agent_policy. Used to enable Camp-On for this user and set the Technology Mode that will be used when engaging the feature. In most cases 'Generic Device' should be chosen unless you have phones designed to work with channel specific capabilities."); … … 338 403 <li>$cc_agent_dialstring_label: " . $amp_conf['CC_AGENT_DIALSTRING_DEFAULT'] . "</li> 339 404 <li>$cc_max_monitors_label: " . $amp_conf['CC_MAX_MONITORS_DEFAULT'] . "</li> 340 <li>$cc_alert_info_label: " . $amp_conf['CC_ALERT_INFO_DEFAULT'] . "</li> 341 <li>$cc_cid_prepend_label: " . $amp_conf['CC_CID_PREPEND_DEFAULT'] . "</li> 405 <li>$cc_announce_monitor_label: " . $amp_conf['CC_ANNOUNCE_MONITOR_DEFAULT'] . "</li> 406 <li>$cc_agent_alert_info_label: " . $amp_conf['CC_AGENT_ALERT_INFO_DEFAULT'] . "</li> 407 <li>$cc_agent_cid_prepend_label: " . $amp_conf['CC_AGENT_CID_PREPEND_DEFAULT'] . "</li> 408 <li>$cc_monitor_alert_info_label: " . $amp_conf['CC_MONITOR_ALERT_INFO_DEFAULT'] . "</li> 409 <li>$cc_monitor_cid_prepend_label: " . $amp_conf['CC_MONITOR_CID_PREPEND_DEFAULT'] . "</li> 342 410 </ul>"; 343 411 $currentcomponent->addguielem($section, new gui_link_label('cc_default_settings', $cc_default_settings_label, $cc_default_settings_tt, true)); … … 350 418 351 419 352 $cc_offer_timer = $ccss['cc_offer_timer']; 353 $ccbs_available_timer = $ccss['ccbs_available_timer']; 354 $ccnr_available_timer = $ccss['ccnr_available_timer']; 355 $cc_recall_timer = $ccss['cc_recall_timer']; 356 $cc_max_agents = $ccss['cc_max_agents']; 357 $cc_agent_dialstring = $ccss['cc_agent_dialstring']; 358 $cc_max_monitors = $ccss['cc_max_monitors']; 359 $cc_alert_info = $ccss['cc_alert_info']; 360 $cc_cid_prepend = $ccss['cc_cid_prepend']; 420 $cc_offer_timer = $ccss['cc_offer_timer']; 421 $ccbs_available_timer = $ccss['ccbs_available_timer']; 422 $ccnr_available_timer = $ccss['ccnr_available_timer']; 423 $cc_recall_timer = $ccss['cc_recall_timer']; 424 $cc_max_agents = $ccss['cc_max_agents']; 425 $cc_agent_dialstring = $ccss['cc_agent_dialstring']; 426 $cc_max_monitors = $ccss['cc_max_monitors']; 427 $cc_announce_monitor = $ccss['cc_announce_monitor']; 428 $cc_agent_alert_info = $ccss['cc_agent_alert_info']; 429 $cc_agent_cid_prepend = $ccss['cc_agent_cid_prepend']; 430 $cc_monitor_alert_info = $ccss['cc_monitor_alert_info']; 431 $cc_monitor_cid_prepend = $ccss['cc_monitor_cid_prepend']; 361 432 362 433 $cc_offer_timer_tt = _("Asterisk: cc_offer_timer. How long after dialing an extenion a user has to make a call completion request."); … … 369 440 $cc_max_monitors_tt = _("Asterisk: cc_max_monitors. This is the maximum number of callers that are allowed to queue up call completion requests against this extension."); 370 441 371 $cc_alert_info_tt = _("An optional Alert-Info setting that can be used when initiating a callback. Only valid when 'Caller Policy' is set to a 'Generic Device'"); 372 $cc_cid_prepend_tt = _("An optional CID Prepend setting that can be used when initiating a callback. Only valid when 'Caller Policy' is set to a 'Generic Device'"); 442 $cc_announce_monitor_tt = _("Whether or not to announce the extension that is being called back when the phone is picked up."); 443 $cc_agent_alert_info_tt = _("An optional Alert-Info setting that can be used when initiating a callback. Only valid when 'Caller Policy' is set to a 'Generic Device'"); 444 $cc_agent_cid_prepend_tt = _("An optional CID Prepend setting that can be used when initiating a callback. Only valid when 'Caller Policy' is set to a 'Generic Device'"); 445 446 $cc_monitor_alert_info_tt = _("An optional Alert-Info setting that can be used to send to the extension being called back."); 447 $cc_monitor_cid_prepend_tt = _("An optional CID Prepend setting that can be used to send to the extension being called back."); 373 448 374 449 $msgInvalidAlertInfo = _('Please enter a valid Alert-Info'); … … 384 459 $currentcomponent->addguielem($section, new gui_selectbox('cc_max_monitors', $currentcomponent->getoptlist('cc_max_monitors'), $cc_max_monitors, $cc_max_monitors_label, $cc_max_monitors_tt, '', false)); 385 460 461 $currentcomponent->addguielem($section, new gui_radio('cc_announce_monitor', $currentcomponent->getoptlist('cc_announce_monitor'), $cc_announce_monitor, $cc_announce_monitor_label, $cc_announce_monitor_tt, false)); 462 386 463 //TODO: put in validation functions after the tt 387 $currentcomponent->addguielem($section, new gui_textbox('cc_alert_info', $cc_alert_info, $cc_alert_info_label, $cc_alert_info_tt, '', $msgInvalidAlertInfo, true)); 388 $currentcomponent->addguielem($section, new gui_textbox('cc_cid_prepend', $cc_cid_prepend, $cc_cid_prepend_label, $cc_cid_prepend_tt, '', $msgInvalidCIDPrefix, true)); 464 $currentcomponent->addguielem($section, new gui_textbox('cc_agent_alert_info', $cc_agent_alert_info, $cc_agent_alert_info_label, $cc_agent_alert_info_tt, '', $msgInvalidAlertInfo, true)); 465 $currentcomponent->addguielem($section, new gui_textbox('cc_agent_cid_prepend', $cc_agent_cid_prepend, $cc_agent_cid_prepend_label, $cc_agent_cid_prepend_tt, '', $msgInvalidCIDPrefix, true)); 466 467 $currentcomponent->addguielem($section, new gui_textbox('cc_monitor_alert_info', $cc_monitor_alert_info, $cc_monitor_alert_info_label, $cc_monitor_alert_info_tt, '', $msgInvalidAlertInfo, true)); 468 $currentcomponent->addguielem($section, new gui_textbox('cc_monitor_cid_prepend', $cc_monitor_cid_prepend, $cc_monitor_cid_prepend_label, $cc_monitor_cid_prepend_tt, '', $msgInvalidCIDPrefix, true)); 389 469 } 390 470 } … … 408 488 $ccss['cc_monitor_policy'] = isset($_REQUEST['cc_monitor_policy']) ? $_REQUEST['cc_monitor_policy'] : $amp_conf['CC_MONITOR_POLICY_DEFAULT']; 409 489 $ccss['cc_max_monitors'] = isset($_REQUEST['cc_max_monitors']) ? $_REQUEST['cc_max_monitors'] : $amp_conf['CC_MAX_MONITORS_DEFAULT']; 410 $ccss['cc_alert_info'] = isset($_REQUEST['cc_alert_info']) ? $_REQUEST['cc_alert_info'] : $amp_conf['CC_ALERT_INFO_DEFAULT']; 411 $ccss['cc_cid_prepend'] = isset($_REQUEST['cc_cid_prepend']) ? $_REQUEST['cc_cid_prepend'] : $amp_conf['CC_CID_PREPEND_DEFAULT']; 490 $ccss['cc_agent_alert_info'] = isset($_REQUEST['cc_agent_alert_info']) ? $_REQUEST['cc_agent_alert_info'] : $amp_conf['CC_AGENT_ALERT_INFO_DEFAULT']; 491 $ccss['cc_agent_cid_prepend'] = isset($_REQUEST['cc_agent_cid_prepend']) ? $_REQUEST['cc_agent_cid_prepend'] : $amp_conf['CC_AGENT_CID_PREPEND_DEFAULT']; 492 $ccss['cc_monitor_alert_info'] = isset($_REQUEST['cc_monitor_alert_info']) ? $_REQUEST['cc_monitor_alert_info'] : $amp_conf['CC_AGENT_ALERT_INFO_DEFAULT']; 493 $ccss['cc_monitor_cid_prepend'] = isset($_REQUEST['cc_monitor_cid_prepend']) ? $_REQUEST['cc_monitor_cid_prepend'] : $amp_conf['CC_AGENT_CID_PREPEND_DEFAULT']; 412 494 } 413 495 … … 454 536 $ccss['cc_agent_dialstring'] = $astman->database_get("AMPUSER",$xtn."/ccss/cc_agent_dialstring"); 455 537 $ccss['cc_max_monitors'] = $astman->database_get("AMPUSER",$xtn."/ccss/cc_max_monitors"); 456 $ccss['cc_alert_info'] = $astman->database_get("AMPUSER",$xtn."/ccss/cc_alert_info"); 457 $ccss['cc_cid_prepend'] = $astman->database_get("AMPUSER",$xtn."/ccss/cc_cid_prepend"); 538 $ccss['cc_announce_monitor'] = $astman->database_get("AMPUSER",$xtn."/ccss/cc_announce_monitor"); 539 if (!$ccss['cc_announce_monitor']) { 540 $ccss['cc_announce_monitor'] = $amp_conf['CC_ANNOUNCE_MONITOR_DEFAULT'] ? 'announce' : 'silent'; 541 } 542 $ccss['cc_agent_alert_info'] = $astman->database_get("AMPUSER",$xtn."/ccss/cc_agent_alert_info"); 543 $ccss['cc_agent_cid_prepend'] = $astman->database_get("AMPUSER",$xtn."/ccss/cc_agent_cid_prepend"); 544 $ccss['cc_monitor_alert_info'] = $astman->database_get("AMPUSER",$xtn."/ccss/cc_monitor_alert_info"); 545 $ccss['cc_monitor_cid_prepend'] = $astman->database_get("AMPUSER",$xtn."/ccss/cc_monitor_cid_prepend"); 458 546 } else { 459 $ccss['cc_offer_timer'] = $amp_conf['CC_OFFER_TIMER_DEFAULT']; 460 $ccss['ccbs_available_timer'] = $amp_conf['CCBS_AVAILABLE_TIMER_DEFAULT']; 461 $ccss['ccnr_available_timer'] = $amp_conf['CCNR_AVAILABLE_TIMER_DEFAULT']; 462 $ccss['cc_recall_timer'] = $amp_conf['CC_RECALL_TIMER_DEFAULT']; 463 $ccss['cc_max_agents'] = $amp_conf['CC_MAX_AGENTS_DEFAULT']; 464 $ccss['cc_agent_dialstring'] = $amp_conf['CC_AGENT_DIALSTRING_DEFAULT']; 465 $ccss['cc_max_monitors'] = $amp_conf['CC_MAX_MONITORS_DEFAULT']; 466 $ccss['cc_alert_info'] = $amp_conf['CC_ALERT_INFO_DEFAULT']; 467 $ccss['cc_cid_prepend'] = $amp_conf['CC_CID_PREPEND_DEFAULT']; 547 $ccss['cc_offer_timer'] = $amp_conf['CC_OFFER_TIMER_DEFAULT']; 548 $ccss['ccbs_available_timer'] = $amp_conf['CCBS_AVAILABLE_TIMER_DEFAULT']; 549 $ccss['ccnr_available_timer'] = $amp_conf['CCNR_AVAILABLE_TIMER_DEFAULT']; 550 $ccss['cc_recall_timer'] = $amp_conf['CC_RECALL_TIMER_DEFAULT']; 551 $ccss['cc_max_agents'] = $amp_conf['CC_MAX_AGENTS_DEFAULT']; 552 $ccss['cc_agent_dialstring'] = $amp_conf['CC_AGENT_DIALSTRING_DEFAULT']; 553 $ccss['cc_max_monitors'] = $amp_conf['CC_MAX_MONITORS_DEFAULT']; 554 $ccss['cc_announce_monitor'] = $amp_conf['CC_ANNOUNCE_MONITOR_DEFAULT'] ? 'announce' : 'silent'; 555 $ccss['cc_agent_alert_info'] = $amp_conf['CC_AGENT_ALERT_INFO_DEFAULT']; 556 $ccss['cc_agent_cid_prepend'] = $amp_conf['CC_AGENT_CID_PREPEND_DEFAULT']; 557 $ccss['cc_monitor_alert_info'] = $amp_conf['CC_MONITOR_ALERT_INFO_DEFAULT']; 558 $ccss['cc_monitor_cid_prepend'] = $amp_conf['CC_MONITOR_CID_PREPEND_DEFAULT']; 468 559 } 469 560 } else { … … 498 589 } 499 590 591 /* TODO: NOTES/ISSUES 592 * 593 * CallCompletionRequest 594 * CallCompletionCancel 595 * 596 * These simply fail if request can't be made or canceled. Can't have any intellignent dialplan to deal with it, really 597 * bad! 598 * 599 * It would be useful to put some information in channel variables when using the dialplan mode, who called, to avoid the 600 * ugly hoops of XXX_XXX format we are doing to retain the information. 601 */ modules/branches/2.9/campon/install.php
r11283 r11301 54 54 $freepbx_conf->define_conf_setting('CC_FORCE_DEFAULTS',$set); 55 55 56 // CC_ANNOUNCE_MONITOR_DEFAULT 57 // 58 $set['value'] = true; 59 $set['defaultval'] =& $set['value']; 60 $set['readonly'] = 0; 61 $set['hidden'] = 0; 62 $set['level'] = 1; 63 $set['module'] = 'campon'; 64 $set['category'] = 'Camp-On Module'; 65 $set['emptyok'] = 0; 66 $set['name'] = 'Announce the Callee Extension'; 67 $set['description'] = 'When set to true the target extension being called will be announced upone answering the Callback prior to ringing the extension. Setting this to false will go directly to ringing the extension, the CID information will still reflect who is being called back.'; 68 $set['type'] = CONF_TYPE_BOOL; 69 $freepbx_conf->define_conf_setting('CC_ANNOUNCE_MONITOR_DEFAULT',$set); 70 56 71 // CC_AGENT_POLICY_DEFAULT 57 72 // … … 210 225 $freepbx_conf->define_conf_setting('CC_MAX_MONITORS_DEFAULT',$set); 211 226 212 // CC_A LERT_INFO_DEFAULT227 // CC_AGENT_ALERT_INFO_DEFAULT 213 228 // 214 229 $set['value'] = ''; … … 224 239 $set['description'] = "An optional Alert-Info setting that can be used when initiating a callback. Only valid when 'Caller Policy' is set to 'generic' device'"; 225 240 $set['type'] = CONF_TYPE_TEXT; 226 $freepbx_conf->define_conf_setting('CC_A LERT_INFO_DEFAULT',$set);227 228 // CC_ CID_PREPEND_DEFAULT241 $freepbx_conf->define_conf_setting('CC_AGENT_ALERT_INFO_DEFAULT',$set); 242 243 // CC_AGENT_CID_PREPEND_DEFAULT 229 244 // 230 245 $set['value'] = ''; … … 240 255 $set['description'] = "An optional CID Prepend setting that can be used when initiating a callback. Only valid when 'Caller Policy' is set to a 'generic' device'"; 241 256 $set['type'] = CONF_TYPE_TEXT; 242 $freepbx_conf->define_conf_setting('CC_CID_PREPEND_DEFAULT',$set); 257 $freepbx_conf->define_conf_setting('CC_AGENT_CID_PREPEND_DEFAULT',$set); 258 259 // CC_MONITOR_ALERT_INFO_DEFAULT 260 // 261 $set['value'] = ''; 262 $set['defaultval'] =& $set['value']; 263 $set['options'] = ''; 264 $set['readonly'] = 0; 265 $set['hidden'] = 0; 266 $set['level'] = 1; 267 $set['module'] = 'campon'; 268 $set['category'] = 'Camp-On Module'; 269 $set['emptyok'] = 1; 270 $set['name'] = "Default Callee Alert-Info"; 271 $set['description'] = "An optional Alert-Info setting that can be used to send to the extension being called back."; 272 $set['type'] = CONF_TYPE_TEXT; 273 $freepbx_conf->define_conf_setting('CC_MONITOR_ALERT_INFO_DEFAULT',$set); 274 275 // CC_MONITOR_CID_PREPEND_DEFAULT 276 // 277 $set['value'] = ''; 278 $set['defaultval'] =& $set['value']; 279 $set['options'] = ''; 280 $set['readonly'] = 0; 281 $set['hidden'] = 0; 282 $set['level'] = 1; 283 $set['module'] = 'campon'; 284 $set['category'] = 'Camp-On Module'; 285 $set['emptyok'] = 1; 286 $set['name'] = "Default Callee CID Prepend"; 287 $set['description'] = "An optional CID Prepend setting that can be used to send to the extension being called back.'"; 288 $set['type'] = CONF_TYPE_TEXT; 289 $freepbx_conf->define_conf_setting('CC_MONITOR_CID_PREPEND_DEFAULT',$set); 243 290 244 291 $freepbx_conf->commit_conf_settings();
