Ticket #513: dialmacro_02.patch

File dialmacro_02.patch, 6.8 kB (added by kjcsb, 6 years ago)

Patch file

  • astetc/extensions.conf

    old new  
    5959        exten => s,39,Set(DB(CALLTRACE/${CT_EXTEN})=${CALLTRACE_HUNT}) 
    6060        exten => s,40,Set(CTLoop=$[1 + ${CTLoop}]) 
    6161        exten => s,41,Goto(s,37) 
    62 exten => s,42,Dial(${${HuntMember}}${ds} ) ; dialparties will set the priority to 20 if $ds is not null and its a hunt group 
     62exten => s,42,Dial(${${HuntMember}}${ds}M(${DialMacro})) ; dialparties will set the priority to 20 if $ds is not null and its a hunt group 
    6363exten => s,43,Set(HuntLoop=$[1 + ${HuntLoop}]) 
    6464exten => s,44,Set(HuntMembers=$[${HuntMembers} - 1]) 
    6565exten => s,45,Goto(s,22) 
  • htdocs/admin/modules/ringgroups/functions.inc.php

    old new  
    3838          $postdest = $grp['postdest']; 
    3939          $grppre = $grp['grppre']; 
    4040          $annmsg = $grp['annmsg']; 
     41          $dialmacro = $grp['dialmacro']; 
    4142           
    4243          $ext->add($contextname, $grpnum, '', new ext_macro('user-callerid')); 
    4344          // check for old prefix 
     
    5354          $ext->add($contextname, $grpnum, '', new ext_macro('record-enable','${MACRO_EXTEN},${RecordMethod}')); 
    5455          // group dial 
    5556          $ext->add($contextname, $grpnum, '', new ext_setvar('RingGroupMethod',$strategy)); 
     57          $ext->add($contextname, $grpnum, '', new ext_setvar('DialMacro',$dialmacro)); 
    5658          if ((isset($annmsg) ? $annmsg : '') != '') { 
    5759            // should always answer before playing anything, shouldn't we ? 
    5860            $ext->add($contextname, $grpnum, '', new ext_gotoif('$[${DIALSTATUS} = ANSWER]','DIALGRP'));       
     
    7375  } 
    7476} 
    7577 
    76 function ringgroups_add($grpnum,$strategy,$grptime,$grplist,$postdest,$grppre='',$annmsg='') { 
    77   $results = sql("INSERT INTO ringgroups (grpnum, strategy, grptime, grppre, grplist, annmsg, postdest) VALUES (".$grpnum.", '".str_replace("'", "''", $strategy)."', ".str_replace("'", "''", $grptime).", '".str_replace("'", "''", $grppre)."', '".str_replace("'", "''", $grplist)."', '".str_replace("'", "''", $annmsg)."', '".str_replace("'", "''", $postdest)."')"); 
     78function ringgroups_add($grpnum,$strategy,$grptime,$grplist,$postdest,$grppre='',$annmsg='',$dialmacro) { 
     79  $results = sql("INSERT INTO ringgroups (grpnum, strategy, grptime, grppre, grplist, annmsg, postdest, dialmacro) VALUES (".$grpnum.", '".str_replace("'", "''", $strategy)."', ".str_replace("'", "''", $grptime).", '".str_replace("'", "''", $grppre)."', '".str_replace("'", "''", $grplist)."', '".str_replace("'", "''", $annmsg)."', '".str_replace("'", "''", $postdest)."', '".str_replace("'", "''", $dialmacro)."')"); 
    7880} 
    7981 
    8082function ringgroups_del($grpnum) { 
     
    9597} 
    9698 
    9799function ringgroups_get($grpnum) { 
    98   $results = sql("SELECT grpnum, strategy, grptime, grppre, grplist, annmsg, postdest FROM ringgroups WHERE grpnum = $grpnum","getRow",DB_FETCHMODE_ASSOC); 
     100  $results = sql("SELECT grpnum, strategy, grptime, grppre, grplist, annmsg, postdest, dialmacro FROM ringgroups WHERE grpnum = $grpnum","getRow",DB_FETCHMODE_ASSOC); 
    99101  return $results; 
    100102} 
    101103?> 
  • htdocs/admin/modules/ringgroups/install.sql

    old new  
    11 
    2 CREATE TABLE IF NOT EXISTS `ringgroups` ( `grpnum` BIGINT( 11 ) NOT NULL , `strategy` VARCHAR( 50 ) NOT NULL , `grptime` SMALLINT NOT NULL , `grppre` VARCHAR( 100 ) NULL , `grplist` VARCHAR( 255 ) NOT NULL , `annmsg` VARCHAR( 255 ) NULL , `postdest` VARCHAR( 255 ) NULL , PRIMARY KEY  (`grpnum`) ) TYPE = MYISAM ;  
     2CREATE TABLE IF NOT EXISTS `ringgroups` ( `grpnum` BIGINT( 11 ) NOT NULL , `strategy` VARCHAR( 50 ) NOT NULL , `grptime` SMALLINT NOT NULL , `grppre` VARCHAR( 100 ) NULL , `grplist` VARCHAR( 255 ) NOT NULL , `annmsg` VARCHAR( 255 ) NULL , `postdest` VARCHAR( 255 ) NULL , `macro` VARCHAR( 255 ) NULL , PRIMARY KEY  (`grpnum`) ) TYPE = MYISAM ;  
    33 
  • htdocs/admin/modules/ringgroups/page.ringgroups.php

    old new  
    2121isset($_REQUEST['grppre'])?$grppre = $_REQUEST['grppre']:$grppre=''; 
    2222isset($_REQUEST['strategy'])?$strategy = $_REQUEST['strategy']:$strategy=''; 
    2323isset($_REQUEST['annmsg'])?$annmsg = $_REQUEST['annmsg']:$annmsg=''; 
     24isset($_REQUEST['dialmacro'])?$dialmacro = $_REQUEST['dialmacro']:$dialmacro=''; //added by CSB 
    2425 
    2526if (isset($_REQUEST['goto0']) && isset($_REQUEST[$_REQUEST['goto0']."0"])) { 
    2627        $goto = $_REQUEST[$_REQUEST['goto0']."0"]; 
     
    6061    //add group 
    6162    if ($action == 'addGRP') { 
    6263      //ringgroups_add($account,implode("-",$grplist),$strategy,$grptime,$grppre,$goto); 
    63       ringgroups_add($account,$strategy,$grptime,implode("-",$grplist),$goto,$grppre,$annmsg); 
     64      ringgroups_add($account,$strategy,$grptime,implode("-",$grplist),$goto,$grppre,$annmsg,$dialmacro); 
    6465      needreload(); 
    6566    } 
    6667     
     
    7374    //edit group - just delete and then re-add the extension 
    7475    if ($action == 'edtGRP') { 
    7576      ringgroups_del($account);  
    76       ringgroups_add($account,$strategy,$grptime,implode("-",$grplist),$goto,$grppre,$annmsg); 
     77      ringgroups_add($account,$strategy,$grptime,implode("-",$grplist),$goto,$grppre,$annmsg,$dialmacro); 
    7778      needreload(); 
    7879    } 
    7980  } 
     
    110111    $grptime = $thisgrp['grptime']; 
    111112    $goto = $thisgrp['postdest']; 
    112113    $annmsg = $thisgrp['annmsg']; 
     114    $dialmacro = $thisgrp['dialmacro']; 
    113115    unset($grpliststr); 
    114116    unset($thisgrp); 
    115117     
     
    130132    $grptime = ''; 
    131133    $goto = ''; 
    132134    $annmsg = ''; 
     135    $dialmacro = ''; 
    133136 
    134137    echo "<h2>"._("Add Ring Group")."</h2>"; 
    135138  } 
     
    186189        <td><a href="#" class="info"><?php echo _("CID name prefix")?>:<span><?php echo _('You can optionally prefix the Caller ID name when ringing extensions in this group. 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> 
    187190        <td><input size="4" type="text" name="grppre" value="<?php  echo $grppre ?>"></td> 
    188191      </tr> 
     192      <tr> 
     193        <td><a href="#" class="info"><?php echo _("Dial macro")?>:<span><?php echo _('You can optionally include the name of the macro that is to be called when the call is answered. ')  //added by CSB?></span></a></td> 
     194        <td><input size="4" type="text" name="dialmacro" value="<?php  echo $dialmacro //added by CSB?>"></td> 
     195      </tr> 
    189196 
    190197 
    191198      <tr>