Changeset 11301

Show
Ignore:
Timestamp:
02/06/11 02:23:35 (2 years ago)
Author:
p_lindheimer
Message:

more tuning of dialplan and a few added abilities re #778, still not really tested so not publishing yet and depends on some new macros not checked into core yet

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • modules/branches/2.9/campon/functions.inc.php

    r11283 r11301  
    88  case "asterisk": 
    99    $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))}')); 
    1111  break; 
    1212  } 
     
    4545      $ext->add($mcontext,$exten,'', new ext_execif('$[${LEN(${CCSS_SETUP})}]','Return')); 
    4646      $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}')); 
    5050 
    5151      /** 
     
    6262      $ext->add($mcontext,$exten,'', new ext_noop_trace('Callee has no settings and default disabled, returning')); 
    6363      $ext->add($mcontext,$exten,'', new ext_stackpop('')); 
    64       $ext->add($mcontext,$exten,'', new ext_return('')); 
     64      $ext->add($mcontext,$exten,'', new ext_return('FALSE')); 
    6565 
    6666      $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')); 
    6868 
    6969      /** 
     
    7878        $ext->add($mcontext,$exten,'', new ext_noop_trace('calling a non-extesnion, policy set to never, skipping',6)); 
    7979        $ext->add($mcontext,$exten,'', new ext_stackpop('')); 
     80        $ext->add($mcontext,$exten,'', new ext_return('FALSE')); 
    8081      } else { 
    8182        $ext->add($mcontext,$exten,'', new ext_noop_trace('calling a non-extesnion, policy enabled , continuing',6)); 
    8283        $ext->add($mcontext,$exten,'', new ext_set('CALLCOMPLETTION(cc_monitor_policy)', $amp_conf['CC_NON_EXTENSION_POLICY'])); 
    8384        $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')); 
    8486      } 
    85       $ext->add($mcontext,$exten,'', new ext_return('')); 
    8687 
    8788      If ($amp_conf['CC_MONITOR_POLICY_DEFAULT'] == 'never') { 
    8889        $ext->add($mcontext,$exten,'is_exten', new ext_noop_trace('Callee has no settings and default is never so disabling')); 
    8990        $ext->add($mcontext,$exten,'is_exten', new ext_stackpop('')); 
     91        $ext->add($mcontext,$exten,'', new ext_return('FALSE')); 
    9092      } else { 
    9193        $ext->add($mcontext,$exten,'is_exten', new ext_noop_trace('Callee has no settings and default enabled, continuing')); 
    9294        $ext->add($mcontext,$exten,'is_exten', new ext_set('CALLCOMPLETTION(cc_monitor_policy)', $amp_conf['CC_MONITOR_POLICY_DEFAULT'])); 
    9395        $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')); 
    9497      } 
    95       $ext->add($mcontext,$exten,'', new ext_return('')); 
    9698 
    9799      // subroutine(agent_config) 
     
    102104      $ext->add($mcontext,$exten,'', new ext_set('CALLCOMPLETTION(ccnr_available_timer)', '${DB(AMPUSER/${ARG2}/ccss/ccnr_available_timer)}')); 
    103105 
    104       // TODO: need to decide implementation here. The though is when they set Alert-Info or CID-Prepend, then we generate a unique macro for 
    105       //       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 unique 
    106       //       I know who the exten is, cause they just called back, I think. Hmm, it's late, not thinking straight, re-visit this later since 
    107       //       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  
    111106      $ext->add($mcontext, $exten, '', new ext_execif('$["${CALLCOMPLETTION(cc_agent_policy)}" = "generic"]', 'Set', 'CALLCOMPLETTION(cc_recall_timer)=${DB(AMPUSER/${AMPUSER}/ccss/cc_recall_timer)}')); 
    112107      $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')); 
    115111      $ext->add($mcontext,$exten,'', new ext_return('')); 
    116112 
     
    120116        $ext->add($mcontext,$exten,'', new ext_noop_trace('Caller has no settings and default is never so disabling')); 
    121117        $ext->add($mcontext,$exten,'', new ext_stackpop('')); 
     118        $ext->add($mcontext,$exten,'', new ext_return('FALSE')); 
    122119      } else { 
    123120        // TODO: is it possible we are not an extension calling here and we need more logic to safeguard? 
     
    135132        If ($amp_conf['CC_AGENT_DIALSTRING_DEFAULT'] == 'extension') { 
    136133          $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')); 
    137135        } else If ($amp_conf['CC_AGENT_DIALSTRING_DEFAULT'] == 'internal') { 
    138136          $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 condition 
    141         //       needs to set this and if it looks proper 
    142         if (false) { 
    143137          $ext->add($mcontext, $exten, '', new ext_set('CALLCOMPLETTION(cc_callback_macro)','ccss-default')); 
    144138        } 
     139        $ext->add($mcontext,$exten,'', new ext_return('TRUE')); 
    145140      } 
    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('')); 
    155203    break; 
    156204  } 
    157205} 
    158206 
    159 // TODO: test response code to see if we can generate meaningful success/fail feedback 
    160207function campon_request($c) { 
    161208  global $ext; 
     
    166213  $ext->addInclude('from-internal-additional', $id); // Add the include from from-internal 
    167214  $ext->add($id, $c, '', new ext_answer('')); 
     215  $ext->add($id, $c, '', new ext_set('CCSS_SETUP', 'TRUE')); // keep from calling normal sub-ccss 
    168216  $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 
    169222  $ext->add($id, $c, '', new ext_callcompletionrequest('')); 
    170223  $ext->add($id, $c, '', new ext_noop_trace('CC_REQUEST_RESULT: ${CC_REQUEST_RESULT}')); 
     
    173226} 
    174227 
    175 // TODO: test response code to see if we can generate meaningful success/fail feedback 
    176228function campon_cancel($c) { 
    177229  global $ext; 
     
    181233  $ext->addInclude('from-internal-additional', $id); // Add the include from from-internal 
    182234  $ext->add($id, $c, '', new ext_answer('')); 
     235  $ext->add($id, $c, '', new ext_set('CCSS_SETUP', 'TRUE')); // keep from calling normal sub-ccss 
    183236  $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 
    184242  $ext->add($id, $c, '', new ext_callcompletioncancel('')); 
    185243  $ext->add($id, $c, '', new ext_noop_trace('CC_REQUEST_RESULT: ${CC_REQUEST_RESULT}')); 
     
    283341  $currentcomponent->setoptlistopts('cc_monitor_policy', 'sort', false); 
    284342 
     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 
    285347  for ($i=1;$i<=20;$i++) { 
    286348    $currentcomponent->addoptlistitem('cc_max_monitors', $i, sprintf(_('%s Incoming Requests'),$i)); 
     
    319381    $cc_agent_dialstring_label =  _("Caller Callback Mode"); 
    320382    $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"); 
    323388 
    324389    $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."); 
     
    338403          <li>$cc_agent_dialstring_label: " . $amp_conf['CC_AGENT_DIALSTRING_DEFAULT'] . "</li> 
    339404          <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> 
    342410        </ul>"; 
    343411      $currentcomponent->addguielem($section, new gui_link_label('cc_default_settings', $cc_default_settings_label, $cc_default_settings_tt, true)); 
     
    350418 
    351419 
    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']; 
    361432 
    362433    $cc_offer_timer_tt =       _("Asterisk: cc_offer_timer. How long after dialing an extenion a user has to make a call completion request."); 
     
    369440    $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."); 
    370441 
    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."); 
    373448 
    374449    $msgInvalidAlertInfo = _('Please enter a valid Alert-Info'); 
     
    384459    $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)); 
    385460 
     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 
    386463    //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)); 
    389469  } 
    390470} 
     
    408488    $ccss['cc_monitor_policy'] =    isset($_REQUEST['cc_monitor_policy']) ? $_REQUEST['cc_monitor_policy'] : $amp_conf['CC_MONITOR_POLICY_DEFAULT']; 
    409489    $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']; 
    412494  } 
    413495 
     
    454536      $ccss['cc_agent_dialstring'] = $astman->database_get("AMPUSER",$xtn."/ccss/cc_agent_dialstring"); 
    455537      $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"); 
    458546    } 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']; 
    468559    } 
    469560  } else { 
     
    498589} 
    499590 
     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  
    5454$freepbx_conf->define_conf_setting('CC_FORCE_DEFAULTS',$set); 
    5555 
     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 
    5671// CC_AGENT_POLICY_DEFAULT 
    5772// 
     
    210225$freepbx_conf->define_conf_setting('CC_MAX_MONITORS_DEFAULT',$set); 
    211226 
    212 // CC_ALERT_INFO_DEFAULT 
     227// CC_AGENT_ALERT_INFO_DEFAULT 
    213228// 
    214229$set['value'] = ''; 
     
    224239$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'"; 
    225240$set['type'] = CONF_TYPE_TEXT; 
    226 $freepbx_conf->define_conf_setting('CC_ALERT_INFO_DEFAULT',$set); 
    227  
    228 // CC_CID_PREPEND_DEFAULT 
     241$freepbx_conf->define_conf_setting('CC_AGENT_ALERT_INFO_DEFAULT',$set); 
     242 
     243// CC_AGENT_CID_PREPEND_DEFAULT 
    229244// 
    230245$set['value'] = ''; 
     
    240255$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'"; 
    241256$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); 
    243290 
    244291$freepbx_conf->commit_conf_settings();