Changeset 6247

Show
Ignore:
Timestamp:
08/01/08 20:33:25 (2 months ago)
Author:
p_lindheimer
Message:

closes #2073 prepend optional queue hold time to CID so agent can see how long the person was holding

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • modules/branches/2.5/core/agi-bin/dialparties.agi

    r6246 r6247  
    6767$cidname = $AGI->request['agi_calleridname']; 
    6868debug("Caller ID name is '$cidname' number is '$cidnum'", 1); 
     69 
     70$queue_wait = get_var( $AGI, "QUEUEWAIT" ); 
     71if ($queue_wait != '') { 
     72        $saved_cidname = get_var( $AGI, "SAVEDCIDNAME" ); 
     73        $elapsed = round((time() - $queue_wait)/60,0); 
     74        if ($saved_cidname == '') { 
     75                $AGI->set_variable('__SAVEDCIDNAME',$cidname); 
     76                $AGI->set_variable('CALLERID(name)',"M$elapsed:$cidname"); 
     77        } else { 
     78                $AGI->set_variable('CALLERID(name)',"M$elapsed:$saved_cidname"); 
     79        } 
     80} 
    6981 
    7082// From this point forward, Set KEEPCID in the channel so subsequent calls, CF, etc. retain the incoming 
  • modules/branches/2.5/core/module.xml

    r6199 r6247  
    44        <category>Basic</category> 
    55        <name>Core</name> 
    6         <version>2.5.0alpha1.1</version> 
     6        <version>2.5.0alpha1.2</version> 
    77        <candisable>no</candisable> 
    88        <canuninstall>no</canuninstall> 
    99        <changelog> 
     10                *2.5.0alpha1.2* #2976, #2778, #2413, #2974, #2962, #2894, #2073 
    1011                *2.5.0alpha1.1* #2930, #2938, #2922, #2939, #1568, #2949, #2779, #2953, #1911, #2807 
    1112                *2.5.0alpha1.0* #2853, #2925, #2391, #2785, #2923, #2671, #2585, #2908, #2909, #2510, #2976, #2845, #1715, #2760, #2926, #2927, #2838, also added misc icons, links between users/devices 
  • modules/branches/2.5/queues/functions.inc.php

    r6170 r6247  
    213213                                        // line to clear this flag so that subsequent transfers can occur. 
    214214                                        // 
     215                                        if ($q['queuewait']) { 
     216                                                $ext->add('ext-queues', $exten, '', new ext_execif('$["${QUEUEWAIT}" = ""]', 'Set', '__QUEUEWAIT=${EPOCH}')); 
     217                                        } 
    215218                                        $ext->add('ext-queues', $exten, '', new ext_setvar('__BLKVM_OVERRIDE', 'BLKVM/${EXTEN}/${CHANNEL}')); 
    216219                                        $ext->add('ext-queues', $exten, '', new ext_setvar('__BLKVM_BASE', '${EXTEN}')); 
     
    317320} 
    318321 
    319 function queues_add($account,$name,$password,$prefix,$goto,$agentannounce_id,$members,$joinannounce_id,$maxwait,$alertinfo='',$cwignore='no',$qregex='') { 
     322function queues_add($account,$name,$password,$prefix,$goto,$agentannounce_id,$members,$joinannounce_id,$maxwait,$alertinfo='',$cwignore='no',$qregex='',$queuewait='no') { 
    320323        global $db; 
    321324 
     
    382385        $dest          = isset($goto) ? $goto:''; 
    383386        $cwignore      = isset($cwignore) ? $cwignore:'0'; 
     387        $queuewait     = isset($queuewait) ? $queuewait:'0'; 
    384388        $qregex        = isset($qregex) ? addslashes($qregex):''; 
    385389 
    386390        // Assumes it has just been deleted 
    387         $sql = "INSERT INTO queues_config (extension, descr, grppre, alertinfo, joinannounce_id, ringing, agentannounce_id, maxwait, password, ivr_id, dest, cwignore, qregex
    388                 VALUES ('$extension', '$descr', '$grppre', '$alertinfo', '$joinannounce_id', '$ringing', '$agentannounce_id', '$maxwait', '$password', '$ivr_id', '$dest', '$cwignore', '$qregex')    "; 
     391        $sql = "INSERT INTO queues_config (extension, descr, grppre, alertinfo, joinannounce_id, ringing, agentannounce_id, maxwait, password, ivr_id, dest, cwignore, qregex, queuewait
     392                VALUES ('$extension', '$descr', '$grppre', '$alertinfo', '$joinannounce_id', '$ringing', '$agentannounce_id', '$maxwait', '$password', '$ivr_id', '$dest', '$cwignore', '$qregex', '$queuewait')      "; 
    389393        $results = sql($sql); 
    390394        return true; 
     
    588592                $results['cwignore']      = $config['cwignore']; 
    589593                $results['qregex']        = $config['qregex']; 
     594                $results['queuewait']     = $config['queuewait']; 
    590595        } 
    591596 
  • modules/branches/2.5/queues/install.php

    r6170 r6247  
    425425} 
    426426 
     427outn(_("checking for queuewait field..")); 
     428$sql = "SELECT `queuewait` FROM queues_config"; 
     429$check = $db->getRow($sql, DB_FETCHMODE_ASSOC); 
     430if(DB::IsError($check)) { 
     431        // add new field 
     432        $sql = "ALTER TABLE queues_config ADD `queuewait` TINYINT( 1 ) DEFAULT 0"; 
     433        $result = $db->query($sql); 
     434        if(DB::IsError($result)) { 
     435                die_freepbx($result->getDebugInfo()); 
     436        } 
     437        out(_("OK")); 
     438} else { 
     439        out(_("already exists")); 
     440} 
     441 
    427442?> 
  • modules/branches/2.5/queues/module.xml

    r6171 r6247  
    22        <rawname>queues</rawname> 
    33        <name>Queues</name> 
    4         <version>2.5.1</version> 
     4        <version>2.5.2</version> 
    55        <type>setup</type> 
    66        <category>Inbound Call Control</category> 
     
    99        </description> 
    1010        <changelog> 
     11                *2.5.2* #2073 add a Queue hold time CID prepend to report how long the caller has been holding 
    1112                *2.5.1* #2068 recordings_id, don't list IVRs with compound messages 
    1213                *2.5.0.1* #2875, #2768 
  • modules/branches/2.5/queues/page.queues.php

    r6170 r6247  
    2727$maxwait = isset($_REQUEST['maxwait'])?$_REQUEST['maxwait']:''; 
    2828$cwignore = isset($_REQUEST['cwignore'])?$_REQUEST['cwignore']:'0'; 
     29$queuewait = isset($_REQUEST['queuewait'])?$_REQUEST['queuewait']:'0'; 
    2930$rtone = isset($_REQUEST['rtone'])?$_REQUEST['rtone']:'0'; 
    3031$qregex = isset($_REQUEST['qregex'])?$_REQUEST['qregex']:''; 
     
    9899                                        $conflict_url = framework_display_extension_usage_alert($usage_arr); 
    99100                                } else { 
    100                                         queues_add($account,$name,$password,$prefix,$goto,$agentannounce_id,$members,$joinannounce_id,$maxwait,$alertinfo,$cwignore,$qregex); 
     101                                        queues_add($account,$name,$password,$prefix,$goto,$agentannounce_id,$members,$joinannounce_id,$maxwait,$alertinfo,$cwignore,$qregex,$queuewait); 
    101102                                        needreload(); 
    102103                                        redirect_standard(); 
     
    110111                        case "edit":  //just delete and re-add 
    111112                                queues_del($account); 
    112                                 queues_add($account,$name,$password,$prefix,$goto,$agentannounce_id,$members,$joinannounce_id,$maxwait,$alertinfo,$cwignore,$qregex); 
     113                                queues_add($account,$name,$password,$prefix,$goto,$agentannounce_id,$members,$joinannounce_id,$maxwait,$alertinfo,$cwignore,$qregex,$queuewait); 
    113114                                needreload(); 
    114115                                redirect_standard('extdisplay'); 
     
    207208 
    208209        <tr> 
     210                <td><a href="#" class="info"><?php echo _("Wait Time Prefix:")?><span><?php echo _("When set to Yes, the CID Name will be prefixed with the total wait time in the queue so the answering agent is aware how long they have waited. It will be rounded to the nearest minute, in the form of Mnn: where nn is the number of minutes")?></span></a></td> 
     211                <td> 
     212                        <select name="queuewait" tabindex="<?php echo ++$tabindex;?>"> 
     213                        <?php 
     214                                $default = (isset($queuewait) ? $queuewait : 'no'); 
     215                                $items = array('1'=>_("Yes"),'0'=>_("No")); 
     216                                foreach ($items as $item=>$val) { 
     217                                        echo '<option value="'.$item.'" '. ($default == $item ? 'SELECTED' : '').'>'.$val; 
     218                                } 
     219                        ?> 
     220                        </select> 
     221                </td> 
     222        </tr> 
     223 
     224        <tr> 
    209225                <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> 
    210226                <td><input type="text" name="alertinfo" size="30" value="<?php echo (isset($alertinfo)?$alertinfo:'') ?>" tabindex="<?php echo ++$tabindex;?>"></td> 
Donate



Support
Download
Develop
Forums
News
Documentation
Paid Support
About

Paid Ads