Changeset 11823 for modules/branches/2.9
- Timestamp:
- 03/16/11 20:28:31 (2 years ago)
- Files:
-
- modules/branches/2.9/core/functions.inc.php (modified) (3 diffs)
- modules/branches/2.9/findmefollow/functions.inc.php (modified) (1 diff)
- modules/branches/2.9/queues/functions.inc.php (modified) (1 diff)
- modules/branches/2.9/ringgroups/functions.inc.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
modules/branches/2.9/core/functions.inc.php
r11814 r11823 1239 1239 $ext->add($context, $exten, '', new ext_setvar("__ALERT_INFO", str_replace(';', '\;', $item['alertinfo']))); 1240 1240 } 1241 // Add CID prefix, no need to do checks for existing pre-pends, this is an incoming did so this should1242 // be the first time the CID is manipulated. We set _RGPREFIX which is the same used throughout the different1243 // modules.1244 //1245 // TODO: If/When RGPREFIX is added to trunks, then see code in ringgroups to strip prefix if added here.1246 //1247 // TODO: core FreePBX documentation about this standard. (and probably rename from RGPREFIX to CIDPREFIX)1248 //1249 1241 if (!empty($item['grppre'])) { 1250 $ext->add($context, $exten, '', new ext_setvar('_RGPREFIX', $item['grppre'])); 1251 $ext->add($context, $exten, '', new ext_setvar('CALLERID(name)','${RGPREFIX}${CALLERID(name)}')); 1242 $ext->add($context, $exten, '', new ext_macro('prepend-cid', $item['grppre'])); 1252 1243 } 1253 1244 … … 1779 1770 $ext->add($context, $exten, '', new ext_macroexit()); 1780 1771 } 1772 1773 /* macro-prepend-cid */ 1774 // prepend a cid and if set to replace previous prepends, do so, otherwise stack them 1775 // 1776 $mcontext = 'macro-prepend-cid'; 1777 $exten = 's'; 1778 1779 if ($amp_conf['CID_PREPEND_REPLACE']) { 1780 $ext->add($mcontext, $exten, '', new ext_gotoif('$["${RGPREFIX}" = ""]', 'REPCID')); 1781 $ext->add($mcontext, $exten, '', new ext_gotoif('$["${RGPREFIX}" != "${CALLERID(name):0:${LEN(${RGPREFIX})}}"]', 'REPCID')); 1782 $ext->add($mcontext, $exten, '', new ext_noop_trace('Current RGPREFIX is ${RGPREFIX}....stripping from Caller ID')); 1783 $ext->add($mcontext, $exten, '', new ext_set('CALLERID(name)', '${CALLERID(name):${LEN(${RGPREFIX})}}')); 1784 $ext->add($mcontext, $exten, '', new ext_set('_RGPREFIX', '')); 1785 } 1786 $ext->add($mcontext, $exten, 'REPCID', new ext_set('_RGPREFIX', '${ARG1}')); 1787 $ext->add($mcontext, $exten, '', new ext_set('CALLERID(name)','${RGPREFIX}${CALLERID(name)}')); 1788 1789 1781 1790 1782 1791 /* outbound routes */ … … 3204 3213 $ext->add($mcontext,$exten,'', new ext_set("__EXTTOCALL", '${ARG2}')); 3205 3214 $ext->add($mcontext,$exten,'', new ext_set("__PICKUPMARK", '${ARG2}')); 3206 $ext->add($mcontext,$exten,'', new ext_set("RT", '${IF($["${ARG1}"!="novm" | "${DB(CFU/${EXTTOCALL})}"!="" | "${DB(CFB/${EXTTOCALL})}"!="" ]?${RINGTIMER}:"")}'));3215 $ext->add($mcontext,$exten,'', new ext_set("RT", '${IF($["${ARG1}"!="novm" | "${DB(CFU/${EXTTOCALL})}"!="" | "${DB(CFB/${EXTTOCALL})}"!="" | ${ARG3} | ${ARG4} | ${ARG5}]?${RINGTIMER}:"")}')); 3207 3216 $ext->add($mcontext,$exten,'checkrecord', new ext_macro('record-enable','${EXTTOCALL},IN')); 3208 3217 modules/branches/2.9/findmefollow/functions.inc.php
r11380 r11823 123 123 124 124 // deal with group CID prefix 125 // but strip only if you plan on setting a new one126 125 if ($grppre != '') { 127 $ext->add($contextname, $grpnum, '', new ext_gotoif('$["foo${RGPREFIX}" = "foo"]', 'REPCID')); 128 $ext->add($contextname, $grpnum, '', new ext_gotoif('$["${RGPREFIX}" != "${CALLERID(name):0:${LEN(${RGPREFIX})}}"]', 'REPCID')); 129 $ext->add($contextname, $grpnum, '', new ext_noop('Current RGPREFIX is ${RGPREFIX}....stripping from Caller ID')); 130 $ext->add($contextname, $grpnum, '', new ext_setvar('CALLERID(name)', '${CALLERID(name):${LEN(${RGPREFIX})}}')); 131 $ext->add($contextname, $grpnum, '', new ext_setvar('_RGPREFIX', '')); 132 $ext->add($contextname, $grpnum, 'REPCID', new ext_noop('CALLERID(name) is ${CALLERID(name)}')); 133 $ext->add($contextname, $grpnum, '', new ext_setvar('_RGPREFIX', $grppre)); 134 $ext->add($contextname, $grpnum, '', new ext_setvar('CALLERID(name)','${RGPREFIX}${CALLERID(name)}')); 126 $ext->add($contextname, $grpnum, '', new ext_macro('prepend-cid', $grppre)); 135 127 } 136 128 // recording stuff modules/branches/2.9/queues/functions.inc.php
r11789 r11823 393 393 394 394 // deal with group CID prefix 395 // Use the same variable as ringgroups/followme so that we can manage chaines of calls396 // but strip only if you plan on setting a new one397 //398 395 if ($grppre != '') { 399 $ext->add('ext-queues', $exten, '', new ext_gotoif('$["foo${RGPREFIX}" = "foo"]', 'REPCID')); 400 $ext->add('ext-queues', $exten, '', new ext_gotoif('$["${RGPREFIX}" != "${CALLERID(name):0:${LEN(${RGPREFIX})}}"]', 'REPCID')); 401 $ext->add('ext-queues', $exten, '', new ext_noop('Current RGPREFIX is ${RGPREFIX}....stripping from Caller ID')); 402 $ext->add('ext-queues', $exten, '', new ext_setvar('CALLERID(name)', '${CALLERID(name):${LEN(${RGPREFIX})}}')); 403 $ext->add('ext-queues', $exten, '', new ext_setvar('_RGPREFIX', '')); 404 $ext->add('ext-queues', $exten, 'REPCID', new ext_noop('CALLERID(name) is ${CALLERID(name)}')); 405 $ext->add('ext-queues', $exten, '', new ext_setvar('_RGPREFIX', $grppre)); 406 $ext->add('ext-queues', $exten, '', new ext_setvar('CALLERID(name)','${RGPREFIX}${CALLERID(name)}')); 396 $ext->add('ext-queues', $exten, '', new ext_macro('prepend-cid', $grppre)); 407 397 } 408 398 modules/branches/2.9/ringgroups/functions.inc.php
r11380 r11823 119 119 120 120 // deal with group CID prefix 121 // but strip only if you plan on setting a new one122 121 if ($grppre != '') { 123 $ext->add($contextname, $grpnum, '', new ext_gotoif('$["foo${RGPREFIX}" = "foo"]', 'REPCID')); 124 $ext->add($contextname, $grpnum, '', new ext_gotoif('$["${RGPREFIX}" != "${CALLERID(name):0:${LEN(${RGPREFIX})}}"]', 'REPCID')); 125 $ext->add($contextname, $grpnum, '', new ext_noop('Current RGPREFIX is ${RGPREFIX}....stripping from Caller ID')); 126 $ext->add($contextname, $grpnum, '', new ext_setvar('CALLERID(name)', '${CALLERID(name):${LEN(${RGPREFIX})}}')); 127 $ext->add($contextname, $grpnum, '', new ext_setvar('_RGPREFIX', '')); 128 $ext->add($contextname, $grpnum, 'REPCID', new ext_noop('CALLERID(name) is ${CALLERID(name)}')); 129 $ext->add($contextname, $grpnum, '', new ext_setvar('_RGPREFIX', $grppre)); 130 $ext->add($contextname, $grpnum, '', new ext_setvar('CALLERID(name)','${RGPREFIX}${CALLERID(name)}')); 122 $ext->add($contextname, $grpnum, '', new ext_macro('prepend-cid', $grppre)); 131 123 } 132 124
