Ticket #513: dialmacro_02.patch
| File dialmacro_02.patch, 6.8 kB (added by kjcsb, 6 years ago) |
|---|
-
astetc/extensions.conf
old new 59 59 exten => s,39,Set(DB(CALLTRACE/${CT_EXTEN})=${CALLTRACE_HUNT}) 60 60 exten => s,40,Set(CTLoop=$[1 + ${CTLoop}]) 61 61 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 group62 exten => s,42,Dial(${${HuntMember}}${ds}M(${DialMacro})) ; dialparties will set the priority to 20 if $ds is not null and its a hunt group 63 63 exten => s,43,Set(HuntLoop=$[1 + ${HuntLoop}]) 64 64 exten => s,44,Set(HuntMembers=$[${HuntMembers} - 1]) 65 65 exten => s,45,Goto(s,22) -
htdocs/admin/modules/ringgroups/functions.inc.php
old new 38 38 $postdest = $grp['postdest']; 39 39 $grppre = $grp['grppre']; 40 40 $annmsg = $grp['annmsg']; 41 $dialmacro = $grp['dialmacro']; 41 42 42 43 $ext->add($contextname, $grpnum, '', new ext_macro('user-callerid')); 43 44 // check for old prefix … … 53 54 $ext->add($contextname, $grpnum, '', new ext_macro('record-enable','${MACRO_EXTEN},${RecordMethod}')); 54 55 // group dial 55 56 $ext->add($contextname, $grpnum, '', new ext_setvar('RingGroupMethod',$strategy)); 57 $ext->add($contextname, $grpnum, '', new ext_setvar('DialMacro',$dialmacro)); 56 58 if ((isset($annmsg) ? $annmsg : '') != '') { 57 59 // should always answer before playing anything, shouldn't we ? 58 60 $ext->add($contextname, $grpnum, '', new ext_gotoif('$[${DIALSTATUS} = ANSWER]','DIALGRP')); … … 73 75 } 74 76 } 75 77 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)."')");78 function 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)."')"); 78 80 } 79 81 80 82 function ringgroups_del($grpnum) { … … 95 97 } 96 98 97 99 function 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); 99 101 return $results; 100 102 } 101 103 ?> -
htdocs/admin/modules/ringgroups/install.sql
old new 1 1 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 ;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 , `macro` VARCHAR( 255 ) NULL , PRIMARY KEY (`grpnum`) ) TYPE = MYISAM ; 3 3 -
htdocs/admin/modules/ringgroups/page.ringgroups.php
old new 21 21 isset($_REQUEST['grppre'])?$grppre = $_REQUEST['grppre']:$grppre=''; 22 22 isset($_REQUEST['strategy'])?$strategy = $_REQUEST['strategy']:$strategy=''; 23 23 isset($_REQUEST['annmsg'])?$annmsg = $_REQUEST['annmsg']:$annmsg=''; 24 isset($_REQUEST['dialmacro'])?$dialmacro = $_REQUEST['dialmacro']:$dialmacro=''; //added by CSB 24 25 25 26 if (isset($_REQUEST['goto0']) && isset($_REQUEST[$_REQUEST['goto0']."0"])) { 26 27 $goto = $_REQUEST[$_REQUEST['goto0']."0"]; … … 60 61 //add group 61 62 if ($action == 'addGRP') { 62 63 //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); 64 65 needreload(); 65 66 } 66 67 … … 73 74 //edit group - just delete and then re-add the extension 74 75 if ($action == 'edtGRP') { 75 76 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); 77 78 needreload(); 78 79 } 79 80 } … … 110 111 $grptime = $thisgrp['grptime']; 111 112 $goto = $thisgrp['postdest']; 112 113 $annmsg = $thisgrp['annmsg']; 114 $dialmacro = $thisgrp['dialmacro']; 113 115 unset($grpliststr); 114 116 unset($thisgrp); 115 117 … … 130 132 $grptime = ''; 131 133 $goto = ''; 132 134 $annmsg = ''; 135 $dialmacro = ''; 133 136 134 137 echo "<h2>"._("Add Ring Group")."</h2>"; 135 138 } … … 186 189 <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> 187 190 <td><input size="4" type="text" name="grppre" value="<?php echo $grppre ?>"></td> 188 191 </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> 189 196 190 197 191 198 <tr>
