Changeset 5092
- Timestamp:
- 10/02/07 19:28:32 (6 years ago)
- Files:
-
- modules/branches/2.4/core/etc/extensions.conf (modified) (1 diff)
- modules/branches/2.4/core/functions.inc.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
modules/branches/2.4/core/etc/extensions.conf
r5090 r5092 650 650 [macro-dialout-trunk] 651 651 exten => s,1,Set(DIAL_TRUNK=${ARG1}) 652 exten => s,n,Set(DIAL_NUMBER=${ARG2}) 653 exten => s,n,Set(ROUTE_PASSWD=${ARG3}) 654 655 exten => s,n,GotoIf($["${ROUTE_PASSWD}" = ""]?noauth) ; arg3 is pattern password 656 exten => s,n(auth),Authenticate(${ROUTE_PASSWD}) 657 exten => s,n(noauth),GotoIf($["x${OUTDISABLE_${ARG1}}" = "xon"]?disabletrunk,1) 658 659 ; If NODEST is set, clear it. No point in remembering since dialout-trunk will just end in the 660 ; bit bucket. But if answered by an outside line with transfer capability, we want NODEST to be 661 ; clear so a subsequent transfer to an internal extension works and goes to voicmail or other 662 ; destinations. 663 ; 664 exten => s,n,Set(_NODEST=) 652 653 exten => s,n,GotoIf($["${ARG3}" = ""]?noauth) ; arg3 is pattern password 654 exten => s,n(auth),Authenticate(${ARG3}) 655 exten => s,n(noauth),GotoIf($["x${OUTDISABLE_${DIAL_TRUNK}}" = "xon"]?disabletrunk,1) 656 657 exten => s,n,Set(DIAL_NUMBER=${ARG2}) ; fixlocalprefix depends on this 665 658 666 659 exten => s,n,Set(DIAL_TRUNK_OPTIONS=${DIAL_OPTIONS}) // will be reset to TRUNK_OPTIONS if not intra-company 667 660 exten => s,n,Set(GROUP()=OUT_${DIAL_TRUNK}) 668 exten => s,n, Macro(user-callerid,SKIPTTL)669 exten => s,n, Macro(record-enable,${CALLERID(number)},OUT)670 exten => s,n ,GotoIf($["${INTRACOMPANYROUTE}" = "YES"]?skipoutcid) ;Set to YES if treated like internal661 exten => s,n,GotoIf($["${OUTMAXCHANS_${DIAL_TRUNK}}foo" = "foo"]?nomax) 662 exten => s,n,GotoIf($[ ${GROUP_COUNT()} > ${OUTMAXCHANS_${DIAL_TRUNK}} ]?chanfull) 663 exten => s,n(nomax),GotoIf($["${INTRACOMPANYROUTE}" = "YES"]?skipoutcid) ;Set to YES if treated like internal 671 664 exten => s,n,Set(DIAL_TRUNK_OPTIONS=${TRUNK_OPTIONS}) 672 665 exten => s,n,Macro(outbound-callerid,${DIAL_TRUNK}) 673 exten => s,n(skipoutcid),GotoIf($["${OUTMAXCHANS_${DIAL_TRUNK}}foo" = "foo"]?nomax) 674 exten => s,n(checkmax),GotoIf($[ ${GROUP_COUNT()} > ${OUTMAXCHANS_${DIAL_TRUNK}} ]?chanfull) 675 exten => s,n(nomax),AGI(fixlocalprefix) ; this sets DIAL_NUMBER to the proper dial string for this trunk 666 exten => s,n(skipoutcid),AGI(fixlocalprefix) ; this sets DIAL_NUMBER to the proper dial string for this trunk 676 667 exten => s,n,Set(OUTNUM=${OUTPREFIX_${DIAL_TRUNK}}${DIAL_NUMBER}) ; OUTNUM is the final dial number 677 668 exten => s,n,Set(custom=${CUT(OUT_${DIAL_TRUNK},:,1)}) ; Custom trunks are prefixed with "AMP:" modules/branches/2.4/core/functions.inc.php
r5090 r5092 484 484 $sql = "SELECT * FROM extensions where context = '".$outrt['application']."' ORDER BY extension, CAST(priority AS UNSIGNED) ASC"; 485 485 $thisrt = sql($sql,"getAll",DB_FETCHMODE_ASSOC); 486 $lastexten = false; 486 487 foreach($thisrt as $exten) { 487 488 //if emergencyroute, then set channel var … … 493 494 if(strpos($exten['args'],"MOHCLASS") !== false) 494 495 $ext->add($outrt['application'], $exten['extension'], '', new ext_setvar("MOHCLASS", '${IF($["x${MOHCLASS}"="x"]?'.substr($exten['args'],9).':${MOHCLASS})}' )); 495 if(strpos($exten['args'],"dialout-trunk") !== false) 496 if(strpos($exten['args'],"dialout-trunk") !== false) { 497 if ($exten['extension'] !== $lastexten) { 498 499 // If NODEST is set, clear it. No point in remembering since dialout-trunk will just end in the 500 // bit bucket. But if answered by an outside line with transfer capability, we want NODEST to be 501 // clear so a subsequent transfer to an internal extension works and goes to voicmail or other 502 // destinations. 503 // 504 // Then do one call to user-callerid and record-enable instead of each time as in the past 505 // 506 $ext->add($outrt['application'], $exten['extension'], '', new ext_setvar("_NODEST","")); 507 $ext->add($outrt['application'], $exten['extension'], '', new ext_macro('user-callerid,SKIPTTL')); 508 $ext->add($outrt['application'], $exten['extension'], '', new ext_macro('record-enable,${AMPUSER},OUT')); 509 $lastexten = $exten['extension']; 510 } 496 511 $ext->add($outrt['application'], $exten['extension'], '', new ext_macro($exten['args'])); 512 } 497 513 if(strpos($exten['args'],"dialout-enum") !== false) 498 514 $ext->add($outrt['application'], $exten['extension'], '', new ext_macro($exten['args']));
