Changeset 6508
- Timestamp:
- 08/30/08 00:04:49 (3 months ago)
- Files:
-
- modules/branches/2.5/core/functions.inc.php (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
modules/branches/2.5/core/functions.inc.php
r6507 r6508 1186 1186 } 1187 1187 1188 // Let's create globals for each trunk to determine which one's have fixlocalprefix settings. 1189 // this allows us to skip calling the agi script if there are no rules to process saving 1190 // on performance 1191 // 1192 $conf = core_trunks_readDialRulesFile(); 1193 if (is_array($conf)) { 1194 foreach ($conf as $trunknum => $entries) { 1195 $trunkname = substr($trunknum,6); 1196 $ext->addGlobal("PREFIX_TRUNK_$trunkname",count($entries)); 1197 } 1198 } 1199 1188 1200 /* outbound routes */ 1189 1201 // modules should use their own table for storage (and module_get_config() to add dialplan) … … 1369 1381 $ext->add($context, $exten, '', new ext_set('DIAL_TRUNK_OPTIONS', '${TRUNK_OPTIONS}')); 1370 1382 $ext->add($context, $exten, '', new ext_macro('outbound-callerid', '${DIAL_TRUNK}')); 1371 $ext->add($context, $exten, 'skipoutcid', new ext_ agi('fixlocalprefix')); // this sets DIAL_NUMBER to the proper dial string for this trunk1383 $ext->add($context, $exten, 'skipoutcid', new ext_execif('$["${PREFIX_TRUNK_${DIAL_TRUNK}}" != ""]','AGI','fixlocalprefix')); // this sets DIAL_NUMBER to the proper dial string for this trunk 1372 1384 $ext->add($context, $exten, '', new ext_set('OUTNUM', '${OUTPREFIX_${DIAL_TRUNK}}${DIAL_NUMBER}')); // OUTNUM is the final dial number 1373 1385 $ext->add($context, $exten, '', new ext_set('custom', '${CUT(OUT_${DIAL_TRUNK},:,1)}')); // Custom trunks are prefixed with "AMP:" … … 1448 1460 $ext->add($context, $exten, '', new ext_set('DIAL_TRUNK_OPTIONS', '${TRUNK_OPTIONS}')); 1449 1461 $ext->add($context, $exten, '', new ext_macro('outbound-callerid', '${DIAL_TRUNK}')); 1450 $ext->add($context, $exten, 'skipoutcid', new ext_ agi('fixlocalprefix')); // this sets DIAL_NUMBER to the proper dial string for this trunk1462 $ext->add($context, $exten, 'skipoutcid', new ext_execif('$["${PREFIX_TRUNK_${DIAL_TRUNK}}" != ""]','AGI','fixlocalprefix')); // this sets DIAL_NUMBER to the proper dial string for this trunk 1451 1463 $ext->add($context, $exten, '', new ext_set('OUTNUM', '${OUTPREFIX_${DIAL_TRUNK}}${DIAL_NUMBER}')); // OUTNUM is the final dial number 1452 1464 … … 1555 1567 $ext->add($context, $exten, 'nomax', new ext_set('DIAL_NUMBER', '${ARG2}')); 1556 1568 $ext->add($context, $exten, '', new ext_set('DIAL_TRUNK', '${ARG1}')); 1557 $ext->add($context, $exten, '', new ext_ agi('fixlocalprefix')); // this sets DIAL_NUMBER to the proper dial string for this trunk1569 $ext->add($context, $exten, '', new ext_execif('$["${PREFIX_TRUNK_${DIAL_TRUNK}}" != ""]','AGI','fixlocalprefix')); // this sets DIAL_NUMBER to the proper dial string for this trunk 1558 1570 // Replacement for asterisk's ENUMLOOKUP function 1559 1571 $ext->add($context, $exten, '', new ext_agi('enumlookup.agi'));
