Changeset 6345

Show
Ignore:
Timestamp:
08/11/08 15:01:01 (5 years ago)
Author:
p_lindheimer
Message:

closes #2913 Add pre-answer delay option to incoming routes, rearrange the order of options on incoming screen

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • modules/branches/2.5/core/functions.inc.php

    r6315 r6345  
    861861          if ($item['ringing'] === "CHECKED") { 
    862862            $ext->add($context, $exten, '', new ext_ringing('')); 
     863          } 
     864          if ($item['delay_answer']) { 
     865            $ext->add($context, $exten, '', new ext_wait($item['delay_answer'])); 
    863866          } 
    864867 
     
    17761779  if (empty($existing)) { 
    17771780    $destination= ($target) ? $target : ${$goto0.'0'}; 
    1778     $sql="INSERT INTO incoming (cidnum,extension,destination,faxexten,faxemail,answer,wait,privacyman,alertinfo, ringing, mohclass, description, grppre) values ('$cidnum','$extension','$destination','$faxexten','$faxemail','$answer','$wait','$privacyman','$alertinfo', '$ringing', '$mohclass', '$description', '$grppre')"; 
     1781    $sql="INSERT INTO incoming (cidnum,extension,destination,faxexten,faxemail,answer,wait,privacyman,alertinfo, ringing, mohclass, description, grppre, delay_answer) values ('$cidnum','$extension','$destination','$faxexten','$faxemail','$answer','$wait','$privacyman','$alertinfo', '$ringing', '$mohclass', '$description', '$grppre', '$delay_answer')"; 
    17791782    sql($sql); 
    17801783    return true; 
     
    26372640    $did_vars['description'] = $newdid_name; 
    26382641    $did_vars['grppre']      = ''; 
     2642    $did_vars['delay_answer']= '0'; 
    26392643    core_did_add($did_vars, $did_dest); 
    26402644  } 
  • modules/branches/2.5/core/install.php

    r6315 r6345  
    194194} 
    195195 
     196// 2.5 new field 
     197// 
     198outn(_("checking for delay_answer field ..")); 
     199$sql = "SELECT `delay_answer` FROM `incoming`"; 
     200$check = $db->getRow($sql, DB_FETCHMODE_ASSOC); 
     201if(DB::IsError($check)) { 
     202  $sql = "ALTER TABLE `incoming` ADD `delay_answer` INT(2) DEFAULT NULL"; 
     203  $result = $db->query($sql); 
     204  if(DB::IsError($result)) { 
     205    out(_("fatal error")); 
     206    die_freepbx($result->getDebugInfo());    
     207  } else { 
     208    out(_("added")); 
     209  } 
     210} else { 
     211  out(_("already exists")); 
     212} 
     213 
    196214?> 
  • modules/branches/2.5/core/module.xml

    r6327 r6345  
    44  <category>Basic</category> 
    55  <name>Core</name> 
    6   <version>2.5.0beta1.1</version> 
     6  <version>2.5.0beta1.2</version> 
    77  <candisable>no</candisable> 
    88  <canuninstall>no</canuninstall> 
    99  <changelog> 
     10    *2.5.0beta1.2* #2913 Add pre-answer delay option to incoming routes, rearrange the order of options on incoming screen 
    1011    *2.5.0beta1.1* #2991, #2999, #2993, #3020, #3002, #3041, #2996, #3029, #3031 
    1112    *2.5.0beta1.0* #2976, #2778, #2413, #2974, #2962, #2894, #2073 
  • modules/branches/2.5/core/page.did.php

    r6294 r6345  
    2020$ringing = isset($_REQUEST['ringing'])?$_REQUEST['ringing']:''; 
    2121$description = isset($_REQUEST['description'])?$_REQUEST['description']:''; 
     22$privacyman = isset($_REQUEST['privacyman'])?$_REQUEST['privacyman']:'0'; 
     23$faxexten = isset($_REQUEST['faxexten'])?$_REQUEST['faxexten']:null; 
     24$faxemail = isset($_REQUEST['faxemail'])?$_REQUEST['faxemail']:null; 
     25$answer = isset($_REQUEST['answer'])?$_REQUEST['answer']:'0'; 
     26$alertinfo = isset($_REQUEST['alertinfo'])?$_REQUEST['alertinfo']:''; 
     27$mohclass = isset($_REQUEST['mohclass'])?$_REQUEST['mohclass']:'default'; 
     28$grppre = isset($_REQUEST['grppre'])?$_REQUEST['grppre']:''; 
     29$wait = isset($_REQUEST['wait'])&&$_REQUEST['wait']?$_REQUEST['wait']:''; 
     30$delay_answer = isset($_REQUEST['delay_answer'])&&$_REQUEST['delay_answer']?$_REQUEST['delay_answer']:''; 
     31 
    2232if (isset($_REQUEST['submitclear'])) { 
    2333  $_REQUEST[$goto0.'0'] = ''; 
     
    174184      <td><input type="text" name="cidnum" value="<?php echo htmlspecialchars(isset($cidnum)?$cidnum:'') ?>" tabindex="<?php echo ++$tabindex;?>"></td> 
    175185    </tr> 
     186 
     187    <tr><td colspan="2"><h5><?php echo _("Options")?><hr></h5></td></tr> 
     188    <tr> 
     189      <td><a href="#" class="info"><?php echo _("Alert Info")?><span><?php echo _('ALERT_INFO can be used for distinctive ring with SIP devices.')?></span></a>:</td> 
     190      <td><input type="text" name="alertinfo" size="10" value="<?php echo $alertinfo ?>" tabindex="<?php echo ++$tabindex;?>"></td> 
     191    </tr> 
     192    <tr> 
     193      <td><a href="#" class="info"><?php echo _("CID name prefix")?><span><?php echo _('You can optionally prefix the Caller ID name. ie: If you prefix with "Sales:", a call from John Doe would display as "Sales:John Doe" on the extensions that ring.')?></span></a>:</td> 
     194      <td><input type="text" name="grppre" size="10" value="<?php echo $grppre ?>" tabindex="<?php echo ++$tabindex;?>"></td> 
     195    </tr> 
     196<?php   if (function_exists('music_list')) { ?> 
     197    <tr> 
     198      <td><a href="#" class="info"><?php echo _("Music On Hold")?><span><?php echo _("Set the MoH class that will be used for calls that come in on this route. For example, choose a type appropriate for routes coming in from a country which may have announcements in their language.")?></span></a>:</td> 
     199      <td> 
     200        <select name="mohclass" tabindex="<?php echo ++$tabindex;?>"> 
     201        <?php 
     202          $tresults = music_list($amp_conf['ASTVARLIBDIR']."/mohmp3"); 
     203          $cur = (isset($mohclass) && $mohclass != "" ? $mohclass : 'default'); 
     204          echo '<option value="none">'._("No Music")."</option>"; 
     205          if (isset($tresults[0])) { 
     206            foreach ($tresults as $tresult) { 
     207              echo '<option value="'.$tresult.'"'.($tresult == $cur ? ' SELECTED' : '').'>'.$tresult."</option>\n"; 
     208            } 
     209          } 
     210        ?>     
     211        </select>    
     212      </td> 
     213    </tr> 
     214<?php } ?> 
     215    <tr> 
     216      <td><a href="#" class="info"><?php echo _("Signal RINGING")?><span><?php echo _('Some devices or providers require RINGING to be sent before ANSWER. You\'ll notice this happening if you can send calls directly to a phone, but if you send it to an IVR, it won\'t connect the call.')?></span></a>:</td> 
     217      <td><input type="checkbox" name="ringing" value="CHECKED" <?php echo $ringing ?>  tabindex="<?php echo ++$tabindex;?>"/></td> 
     218    </tr> 
     219    <tr> 
     220      <td><a href="#" class="info"><?php echo _("Pause Before Answer")?><span><?php echo _("An optional delay to wait before processing this route. Setting this value will delay the channel from answering the call. This may be handy if external fax equipment or security systems are installed in parallel and you would like them to be able to seize the line.")?></span></a>:</td> 
     221      <td><input type="text" name="delay_answer" size="3" value="<?php echo ($delay_answer != '0')?$delay_answer:'' ?>" tabindex="<?php echo ++$tabindex;?>"></td> 
     222    </tr> 
     223 
     224    <tr><td colspan="2"><h5><?php echo _("Privacy")?><hr></h5></td></tr> 
     225 
     226    <tr> 
     227      <td><a href="#" class="info"><?php echo _("Privacy Manager")?><span><?php echo _('If no Caller ID is sent, Privacy Manager will asks the caller to enter their 10 digit phone number. The caller is given 3 attempts. The number of digits and attempts can be defined in privacy.conf. If a user has Call Screening enabled, the incoming caller will be asked to enter their CallerId here if enabled, and then to say their name once determined that the called user requires it.')?></span></a>:</td> 
     228      <td> 
     229        <select name="privacyman" tabindex="<?php echo ++$tabindex;?>"> 
     230          <option value="0" <?php  echo ($privacyman == '0' ? 'SELECTED' : '')?>><?php echo _("No")?> 
     231          <option value="1" <?php  echo ($privacyman == '1' ? 'SELECTED' : '')?>><?php echo _("Yes")?> 
     232        </select> 
     233      </td> 
     234    </tr> 
     235 
    176236    <tr><td colspan="2"><h5><?php echo _("Fax Handling")?><hr></h5></td></tr> 
     237 
    177238    <tr> 
    178239      <td> 
     
    181242      <td> 
    182243        <select name="faxexten" tabindex="<?php echo ++$tabindex;?>"> 
    183 <?php  
    184 // Cleaning up warnings. I should do this a better way. 
    185 if (!isset($faxexten)) 
    186   $faxexten = null; 
    187 if (!isset($faxemail)) 
    188   $faxemail = null; 
    189 if (!isset($answer)) 
    190   $answer = '0'; 
    191 if (!isset($alertinfo)) 
    192   $alertinfo = 0; 
    193 if (!isset($mohclass)) 
    194   $mohclass = 'default'; 
    195 if (!isset($grppre)) 
    196   $grppre = ""; 
    197 ?> 
    198244          <option value="default" <?php  echo ($faxexten == 'default' ? 'SELECTED' : '')?>><?php echo _("FreePBX default")?> 
    199245          <option value="disabled" <?php  echo ($faxexten == 'disabled' ? 'SELECTED' : '')?>><?php echo _("disabled")?> 
     
    231277    <tr> 
    232278      <td><a href="#" class="info"><?php echo _("Pause After Answer")?><span><?php echo _('The number of seconds we should wait after performing an Immediate Answer. The primary purpose of this is to pause and listen for a fax tone before allowing the call to proceed.')?></span></a>:</td> 
    233       <td><input type="text" name="wait" size="3" value="<?php echo isset($wait)?$wait:'' ?>" tabindex="<?php echo ++$tabindex;?>"></td> 
    234     </tr> 
    235 <?php 
    236 if (!isset($privacyman)) 
    237   $privacyman = '0'; 
    238 ?> 
    239  
    240     <tr><td colspan="2"><h5><?php echo _("Privacy")?><hr></h5></td></tr> 
    241     <tr> 
    242       <td><a href="#" class="info"><?php echo _("Privacy Manager")?><span><?php echo _('If no Caller ID is sent, Privacy Manager will asks the caller to enter their 10 digit phone number. The caller is given 3 attempts. The number of digits and attempts can be defined in privacy.conf. If a user has Call Screening enabled, the incoming caller will be asked to enter their CallerId here if enabled, and then to say their name once determined that the called user requires it.')?></span></a>:</td> 
    243       <td> 
    244         <select name="privacyman" tabindex="<?php echo ++$tabindex;?>"> 
    245           <option value="0" <?php  echo ($privacyman == '0' ? 'SELECTED' : '')?>><?php echo _("No")?> 
    246           <option value="1" <?php  echo ($privacyman == '1' ? 'SELECTED' : '')?>><?php echo _("Yes")?> 
    247         </select> 
    248       </td> 
     279      <td><input type="text" name="wait" size="3" value="<?php echo ($wait != '0')?$wait:'' ?>" tabindex="<?php echo ++$tabindex;?>"></td> 
    249280    </tr> 
    250281     
    251     <tr><td colspan="2"><h5><?php echo _("Options")?><hr></h5></td></tr> 
    252     <tr> 
    253       <td><a href="#" class="info"><?php echo _("Alert Info")?><span><?php echo _('ALERT_INFO can be used for distinctive ring with SIP devices.')?></span></a>:</td> 
    254       <td><input type="text" name="alertinfo" size="10" value="<?php echo ($alertinfo)?$alertinfo:'' ?>" tabindex="<?php echo ++$tabindex;?>"></td> 
    255     </tr> 
    256     <tr> 
    257       <td><a href="#" class="info"><?php echo _("CID name prefix")?>:<span><?php echo _('You can optionally prefix the Caller ID name. ie: If you prefix with "Sales:", a call from John Doe would display as "Sales:John Doe" on the extensions that ring.')?></span></a>:</td> 
    258       <td><input type="text" name="grppre" size="10" value="<?php echo ($grppre)?$grppre:'' ?>" tabindex="<?php echo ++$tabindex;?>"></td> 
    259     </tr> 
    260 <?php   if (function_exists('music_list')) { ?> 
    261     <tr> 
    262       <td><a href="#" class="info"><?php echo _("Music On Hold?")?><span><?php echo _("Set the MoH class that will be used for calls that come in on this route. For example, choose a type appropriate for routes coming in from a country which may have announcements in their language.")?></span></a></td> 
    263       <td> 
    264         <select name="mohclass" tabindex="<?php echo ++$tabindex;?>"> 
    265         <?php 
    266           $tresults = music_list($amp_conf['ASTVARLIBDIR']."/mohmp3"); 
    267           $cur = (isset($mohclass) && $mohclass != "" ? $mohclass : 'default'); 
    268           echo '<option value="none">'._("No Music")."</option>"; 
    269           if (isset($tresults[0])) { 
    270             foreach ($tresults as $tresult) { 
    271               echo '<option value="'.$tresult.'"'.($tresult == $cur ? ' SELECTED' : '').'>'.$tresult."</option>\n"; 
    272             } 
    273           } 
    274         ?>     
    275         </select>    
    276       </td> 
    277     </tr> 
    278 <?php } ?> 
    279     <tr> 
    280       <td><a href="#" class="info"><?php echo _("Signal RINGING")?><span><?php echo _('Some devices or providers require RINGING to be sent before ANSWER. You\'ll notice this happening if you can send calls directly to a phone, but if you send it to an IVR, it won\'t connect the call.')?></span></a>:</td> 
    281       <td><input type="checkbox" name="ringing" value="CHECKED" <?php echo $ringing ?>  tabindex="<?php echo ++$tabindex;?>"/></td> 
    282     </tr> 
    283282<?php 
    284283  // implementation of module hook 
     
    316315  var msgInvalidFaxEmail = "<?php echo _('Please enter a valid Fax Email or leave it empty to use the default'); ?>"; 
    317316  var msgInvalidPause = "<?php echo _('Please enter a valid number for Pause after answer'); ?>"; 
     317  var msgInvalidPauseBefore = "<?php echo _('Please enter a valid number for Pause Before Answer field'); ?>"; 
    318318  var msgConfirmDIDCIDBlank = "<?php echo _('Leaving the DID Number AND the Caller ID Number empty will match all incoming calls received not routed using any other defined Incoming Route.\n\nAre you sure?'); ?>"; 
    319319  var msgConfirmDIDNonStd = "<?php echo _('DID information is normally just an incoming telephone number or for advanced users, a valid Asterisk Dial Pattern\n\nYou have entered a non standard DID pattern.\n\nAre you sure this is correct?'); ?>"; 
     
    341341   
    342342  if (!isInteger(theForm.wait.value)) 
    343     return warnInvalid(theForm.wait, msgInvalidPause); 
     343    return warnInvalid(theForm.wait, msgInvalidPauseBefore); 
     344 
     345  if (!isInteger(theForm.delay_answer.value)) 
     346    return warnInvalid(theForm.delay_answer, msgInvalidPauseBefore); 
    344347   
    345348  if (!validateDestinations(theForm,1,true))