Changeset 6447

Show
Ignore:
Timestamp:
08/24/08 16:54:13 (5 years ago)
Author:
p_lindheimer
Message:

closes #3098 set persistenetmembers so dynamic agents are retained on asterisk restarting, and added option for autofill. These are a grey area between bug fix and feature code. Not having autofill in Asterisk 1.2 has always been somewhat of a bug on how one would expect a queue to behave. And similarly, not having dynamic agents persist upon Asterisk restarting is also a bit of a bug - thus these are being introduced. The do change some behavior

Files:

Legend:

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

    r6439 r6447  
    22 
    33class queues_conf { 
     4 
     5  var $_queues_general    = array(); 
     6 
    47  // return an array of filenames to write 
    58  // files named like pinset_N 
    69  function get_filename() { 
    7     return "queues_additional.conf"; 
     10    $files = array( 
     11      'queues_additional.conf', 
     12      'queues_general_additional.conf', 
     13      ); 
     14    return $files; 
    815  } 
    916   
    1017  // return the output that goes in each of the files 
    11   function generateConf() { 
     18  function generateConf($file) { 
     19    global $version; 
     20 
     21    switch ($file) { 
     22      case 'queues_additional.conf': 
     23        return $this->generate_queues_additional($version); 
     24        break; 
     25      case 'queues_general_additional.conf': 
     26        return $this->generate_queues_general_additional($version); 
     27        break; 
     28    } 
     29  } 
     30 
     31  function addQueuesGeneral($key, $value) { 
     32    $this->_queues_general[] = array('key' => $key, 'value' => $value); 
     33  } 
     34 
     35  function generate_queues_additional($ast_version) { 
    1236 
    1337    global $db; 
    14     global $version; 
    1538 
    1639    $additional = ""; 
     
    1841    // Asterisk 1.4 does not like blank assignments so just don't put them there 
    1942    // 
    20     $ver12 = version_compare($version, '1.4', 'lt'); 
     43    $ver12 = version_compare($ast_version, '1.4', 'lt'); 
    2144     
    2245    // legacy but in case someone was using this we will leave it 
     
    5376          switch($keyword){ 
    5477            case 'ringinuse':  
     78            case 'autofill':  
    5579              break; 
    5680            default: 
     
    104128    return $output; 
    105129  } 
     130 
     131  function generate_queues_general_additional($ast_version) { 
     132    $output = ''; 
     133 
     134    if (isset($this->_queues_general) && is_array($this->_queues_general)) { 
     135      foreach ($this->_queues_general as $values) { 
     136        $output .= $values['key']."=".$values['value']."\n"; 
     137      } 
     138    } 
     139    return $output; 
     140  } 
     141 
     142 
     143 
    106144} 
    107145 
     
    189227function queues_get_config($engine) { 
    190228  global $ext;  // is this the best way to pass this? 
     229  global $queues_conf; 
     230 
    191231  switch($engine) { 
    192232    case "asterisk": 
     233 
     234      if (isset($queues_conf) && is_a($queues_conf, "queues_conf")) { 
     235        $queues_conf->addQueuesGeneral('persistentmembers','yes'); 
     236      } 
     237 
    193238      /* queue extensions */ 
    194239      $ext->addInclude('from-internal-additional','ext-queues'); 
     
    355400  array($account,'eventmemberstatus',($_REQUEST['eventmemberstatus'])?$_REQUEST['eventmemberstatus']:'no',0), 
    356401  array($account,'weight',(isset($_REQUEST['weight']))?$_REQUEST['weight']:'0',0), 
     402  array($account,'autofill',(isset($_REQUEST['autofill']))?'yes':'no',0), 
    357403); 
    358404 
  • modules/branches/2.5/queues/module.xml

    r6441 r6447  
    22  <rawname>queues</rawname> 
    33  <name>Queues</name> 
    4   <version>2.5.2.4</version> 
     4  <version>2.5.3</version> 
    55  <type>setup</type> 
    66  <category>Inbound Call Control</category> 
     
    99  </description> 
    1010  <changelog> 
     11    *2.5.3* #3098 WARNING: subtle queue behavior might change: set persistenetmembers=yes so dynamic agents are retained on asterisk restarting, and added option for autofill 
    1112    *2.5.2.4* #3069 add queue weight option to queues 
    1213    *2.5.2.3* #3083, setting ringinuse causes transfered call to keep agent as unavailable, removing since it is not needed for FreePBX standard agents 
  • modules/branches/2.5/queues/page.queues.php

    r6440 r6447  
    3131$qregex = isset($_REQUEST['qregex'])?$_REQUEST['qregex']:''; 
    3232$weight = isset($_REQUEST['weight'])?$_REQUEST['weight']:'0'; 
     33$autofill = isset($_REQUEST['autofill'])?$_REQUEST['autofill']:'no'; 
    3334 
    3435 
     
    560561    </td> 
    561562  </tr> 
     563 
     564  <tr> 
     565    <td><a href="#" class="info"><?php echo _("Autofill:")?><span><?php echo _("Starting with Asterisk 1.4, if this is checked, and multiple agents are available, Asterisk will send one call to each waiting agent (depending on the ring strategy). Otherwise, it will hold all calls while it tries to find an agent for the top call in the queue making other calls wait. This was the behavior in Asterisk 1.2 and has no effect in 1.2. See Asterisk documentation for more details of this feature.")?></span></a></td> 
     566    <td> 
     567      <input name="autofill" type="checkbox" value="1" <?php echo (isset($autofill) && $autofill == 'yes' ? 'checked' : ''); ?>  tabindex="<?php echo ++$tabindex;?>"/> 
     568    </td> 
     569  </tr> 
    562570     
    563571  <tr>