Changeset 3798

Show
Ignore:
Timestamp:
02/22/07 00:55:11 (6 years ago)
Author:
p_lindheimer
Message:

TTL should be infinitely inheritable to deal with SIP redirect type infinite loop forwarding scenarios

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • freepbx/branches/2.2/amp_conf/astetc/extensions.conf

    r3772 r3798  
    5656 
    5757exten => s,10,Dial(${ds})                               ; dialparties will set the priority to 10 if $ds is not null 
     58exten => s,11,Set(DIALSTATUS=${IF($["${DIALSTATUS_CW}"!="" ]?${DIALSTATUS_CW}:${DIALSTATUS})}) 
    5859 
    5960exten => s,20,NoOp(Returned from dialparties with hunt groups to dial ) 
     
    130131exten => _s-.,n,Congestion(10) 
    131132 
     133;------------------------------------------------------------------------ 
     134; [macro-vm] 
     135;------------------------------------------------------------------------ 
     136; CONTEXT:      macro-vm 
     137; PURPOSE:      call voicemail system and extend with personal ivr 
     138; 
     139; Under normal use, this macro will call the voicemail system with the extension and 
     140; desired greeting mode of busy, unavailable or as specified with direct voicemail 
     141; calls (usually unavailable) when entered from destinations. 
     142; 
     143; The voicemail system's two greetings have been 'hijacked' as follows to extend the 
     144; system by giving the option of a private 'ivr' for each voicemail user. The following 
     145; applies to both the busy and unavailable modes of voicemail and can be applied to one 
     146; or both, and differently. 
     147; 
     148; Global Defaults: 
     149; 
     150; The following are default values, used in both busy and unavail modes if no specific 
     151; values are specified. 
     152; 
     153; VMX_REPEAT 
     154;         The number of times to repeat the users message if no option is pressed. 
     155; VMX_TIMEOUT 
     156;         The timeout to wait after playing message before repeating or giving up. 
     157; VMX_LOOPS 
     158;         The number of times it should replay the message and check for an option when 
     159;         an invalid option is pressed. 
     160; 
     161; VMX_OPTS_DOVM 
     162;         Default voicemail option to use if vm is chosen as an option. No options will 
     163;         cause Allison's generic message, 's' will go straight to beep. 
     164; VMX_OPTS_TIMEOUT 
     165;         Default voicemail option to use if it times out with no options. No options will 
     166;         cause Allison's generic message, 's' will go straight to beep. 
     167;         IF THE USER PRESSES # - it will look like a timeout as well since no option will 
     168;         be presented. If the user wishes to enable a mode where a caller can press # 
     169;         during their message and it goes straight to voicemail with only a 'beep' then 
     170;         this should be set to 's'. 
     171; VMX_OPTS_LOOPS 
     172;         Default voicemail option to use if to many wrong options occur. No options will 
     173;         cause Allison's generic message, 's' will go straight to beep. 
     174; 
     175; VMX_CONTEXT 
     176;         Default context for user destinations if not supplied in the user's settings 
     177; VMX_PRI 
     178;         Default priority for user destinations if not supplied in the user's settings 
     179; 
     180; VMX_TIMEDEST_CONTEXT 
     181;         Default context for timeout destination if not supplied in the user's settings 
     182; VMX_TIMEDEST_EXT 
     183;         Default extension for timeout destination if not supplied in the user's settings 
     184; VMX_TIMEDEST_PRI 
     185;         Default priority for timeout destination if not supplied in the user's settings 
     186; 
     187; VMX_LOOPDEST_CONTEXT 
     188;         Default context for loops  destination if not supplied in the user's settings 
     189; VMX_LOOPDEST_EXT 
     190;         Default extension for loops  destination if not supplied in the user's settings 
     191; VMX_LOOPDEST_PRI 
     192;         Default priority for loops  destination if not supplied in the user's settings 
     193; 
     194; 
     195; The AMPUSER database variable has been extended with a 'vmx' tree (vm-extension). A 
     196; duplicate set is included for both unavail and busy. You could choose for to have an 
     197; ivr when unavail is taken, but not with busy - or a different once with busy. 
     198; The full list is below, each specific entry is futher described: 
     199; 
     200; state:    Whether teh current mode is enabled or disabled. Anything but 'enabled' is 
     201;           treated as disabled. 
     202; repeat:   This is the number of times that the users message should be played after the 
     203;           timeout if the user has not entered anything. It is just a variable to the 
     204;           Read() function which will do the repeating. 
     205; timeout:  This is how long to wait after the message has been read for a response from 
     206;           the user. A caller can enter a digit any time during the playback. 
     207; loops:    This is the number of loops that the system will allow a caller to retry if 
     208;           they enter a bad menu choice, before going to the loop failover destination 
     209; vmxopts:  This is the vm options to send to the voicemail command used when a specific 
     210;           voicemail destination is chosen (inidcated by 'dovm' in the ext field). This is 
     211;           typically either set to 's' or left blank. When set to 's' there will be no 
     212;           message played when entering the voicemail, just a beep. When blank, you will 
     213;           have Allison's generic message played. It is not typical to play the greetings 
     214;           since they have been 'hijacked' for these IVR's and from a caller's perspecitive 
     215;           this system appears interconnected with the voicemail so instructions can be 
     216;           left there. 
     217; timedest: The three variables: ext, context and pri are the goto destination if the caller 
     218;           enters no options and it timesout. None have to be set and a system default 
     219;           will be used. If just ext is set, then defaults will be used for context and 
     220;           pri, etc. 
     221; loopdest: This is identical to timedest but used if the caller exceeds the maximum invalid 
     222;           menu choices. 
     223; [0-9*]:   The user can specify up to 11 ivr options, all as single digits from 0-9 or *. The 
     224;           # key can not be used since it is used as a terminator key for the Read command 
     225;           and will never be returned. A minimum of the ext must be specified for each valid 
     226;           option and as above, the context and priority can also be specified if the default 
     227;           is not to be used. 
     228;           Option '0' takes on a special meaning. Since a user is able to break out of the 
     229;           voicemail command once entering it with a 0, if specified, the 0 destination will 
     230;           be used. 
     231;           Option '*' can also be used to breakout. It is undecided at this point whether 
     232;           providing that option will be used as well. (probably should). 
     233; 
     234; 
     235; /AMPUSER/<ext>/vmx/[busy|unavail]/state:                enabled|disabled 
     236; /AMPUSER/<ext>/vmx/[busy|unavail]/repeat:               n (times to repeat message) 
     237; /AMPUSER/<ext>/vmx/[busy|unavail]/timeout:              n (timeout to wait for digit) 
     238; /AMPUSER/<ext>/vmx/[busy|unavail]/loops:                n (loop returies for invalid entries) 
     239; /AMPUSER/<ext>/vmx/[busy|unavail]/vmxopts/dovm:         vmoptions (if ext is dovm) 
     240; /AMPUSER/<ext>/vmx/[busy|unavail]/vmxopts/timeout:      vmoptions (if timeout) 
     241; /AMPUSER/<ext>/vmx/[busy|unavail]/vmxopts/loops:        vmoptions (if loops) 
     242; /AMPUSER/<ext>/vmx/[busy|unavail]/timedest/ext:         extension (if timeout) 
     243; /AMPUSER/<ext>/vmx/[busy|unavail]/timedest/context:     context (if timeout) 
     244; /AMPUSER/<ext>/vmx/[busy|unavail]/timedest/pri:         priority (if timeout) 
     245; /AMPUSER/<ext>/vmx/[busy|unavail]/loopdest/ext:         extension (if too many failures) 
     246; /AMPUSER/<ext>/vmx/[busy|unavail]/loopdest/context:     context (if too many failures) 
     247; /AMPUSER/<ext>/vmx/[busy|unavail]/loopdest/pri:         priority (if too many failures) 
     248; /AMPUSER/<ext>/vmx/[busy|unavail]/[0-9*]/ext:           extension (dovm for vm access) 
     249; /AMPUSER/<ext>/vmx/[busy|unavail]/[0-9*]/context:       context  
     250; /AMPUSER/<ext>/vmx/[busy|unavail]/[0-9*]/pri:           priority  
     251;------------------------------------------------------------------------ 
    132252[macro-vm] 
     253; ARG1 - extension 
     254; ARG2 - DIRECTDIAL/BUSY 
    133255exten => s,1,Macro(user-callerid,SKIPTTL) 
    134256exten => s,n,Set(VMGAIN=${IF($["foo${VM_GAIN}"!="foo"]?"g(${VM_GAIN})":"")}) 
     
    138260; transfers will properly function. 
    139261; 
    140 exten => s,n,GotoIf($["foo${DB(${BLKVM_OVERRIDE})}" != "fooTRUE"]?s-${ARG2},1) 
     262exten => s,n,GotoIf($["foo${DB(${BLKVM_OVERRIDE})}" != "fooTRUE"]?vmx,1) 
    141263; 
    142264; we didn't branch so block this from voicemail 
    143265; 
    144266exten => s,n,Noop(CAME FROM: ${NODEST} - Blocking VM cause of key: ${DB(BLKVM_OVERRIDE)}) 
     267 
     268 
     269; If vmx not enabled for the current mode,then jump to normal voicemail behavior 
     270; 
     271exten => vmx,1,Set(MODE=${IF($["${ARG2}"="BUSY"]?busy:unavail)}) 
     272exten => vmx,n,GotoIf($["${ARG2}" != "DIRECTDIAL"]?notdirect) 
     273exten => vmx,n,Set(MODE=${IF($["${REGEX("[b]" ${VM_DDTYPE})}" = "1"]?busy:${MODE})}) 
     274exten => vmx,n(notdirect),Noop(Checking if ext ${ARG1} is enabled: ${DB(AMPUSER/${ARG1}/vmx/${MODE}/state)}) 
     275exten => vmx,n,GotoIf($["${DB(AMPUSER/${ARG1}/vmx/${MODE}/state)}" != "enabled"]?s-${ARG2},1) 
     276 
     277; If the required voicemail file does not exist, then abort and go to normal voicemail behavior 
     278; TODO: figure out which is proper file (.wav or .WAV) and maybe find a better way 
     279; 
     280exten => vmx,n,Macro(get-vmcontext,${ARG1}) 
     281exten => vmx,n(file),System(ls /var/spool/asterisk/voicemail/${VMCONTEXT}/${ARG1}/${MODE}.wav) 
     282 
     283; Get the repeat, timeout and loop times to use if they are overriden form the global settings 
     284; 
     285exten => vmx,n,Set(LOOPCOUNT=0) 
     286exten => vmx,n,GotoIf($["${DB_EXISTS(AMPUSER/${ARG1}/vmx/${MODE}/repeat)}" = "0"]?vmxtime) 
     287exten => vmx,n,Set(VMX_REPEAT=${DB_RESULT}) 
     288exten => vmx,n(vmxtime),GotoIf($["${DB_EXISTS(AMPUSER/${ARG1}/vmx/${MODE}/timeout)}" = "0"]?vmxloops) 
     289exten => vmx,n,Set(VMX_TIMEOUT=${DB_RESULT}) 
     290exten => vmx,n(vmxloops),GotoIf($["${DB_EXISTS(AMPUSER/${ARG1}/vmx/${MODE}/loops)}" = "0"]?vmxanswer) 
     291exten => vmx,n,Set(VMX_LOOPS=${DB_RESULT}) 
     292exten => vmx,n(vmxanswer),Answer() 
     293 
     294; Now play the users voicemail recording as the basis for their ivr, the Read command will repeat as needed and if it timesout 
     295; then we go to the timeout. Otherwise handle invalid options by looping until the limit until a valid option is played. 
     296; 
     297exten => vmx,n(loopstart),Read(ACTION,/var/spool/asterisk/voicemail/${VMCONTEXT}/${ARG1}/${MODE},1,skip,${VMX_REPEAT},${VMX_TIMEOUT}) 
     298exten => vmx,n,GotoIf($["${EXISTS(${ACTION})}" = "1"]?checkopt) 
     299 
     300; If we are here we timed out, go to the required destination 
     301; 
     302exten => vmx,n(noopt),Noop(Timeout: going to timeout dest) 
     303exten => vmx,n,Set(VMX_OPTS=${VMX_OPTS_TIMEOUT}) 
     304exten => vmx,n,GotoIf($["${DB_EXISTS(AMPUSER/${ARG1}/vmx/${MODE}/vmxopts/timeout)}" = "0"]?chktime) 
     305exten => vmx,n,Set(VMX_OPTS=${DB_RESULT}) 
     306exten => vmx,n(chktime),GotoIf($["${DB_EXISTS(AMPUSER/${ARG1}/vmx/${MODE}/timedest/ext)}" = "0"]?dotime) 
     307exten => vmx,n,Set(VMX_TIMEDEST_EXT=${DB_RESULT}) 
     308exten => vmx,n,GotoIf($["${DB_EXISTS(AMPUSER/${ARG1}/vmx/${MODE}/timedest/context)}" = "0"]?timepri) 
     309exten => vmx,n,Set(VMX_TIMEDEST_CONTEXT=${DB_RESULT}) 
     310exten => vmx,n(timepri),GotoIf($["${DB_EXISTS(AMPUSER/${ARG1}/vmx/${MODE}/timedest/pri)}" = "0"]?dotime) 
     311exten => vmx,n,Set(VMX_TIMEDEST_PRI=${DB_RESULT}) 
     312exten => vmx,n(dotime),Goto(${VMX_TIMEDEST_CONTEXT},${VMX_TIMEDEST_EXT},${VMX_TIMEDEST_PRI}) 
     313 
     314; We got an option, check if the option is defined, or one of the system defaults 
     315; 
     316exten => vmx,n(checkopt),GotoIf($["${DB_EXISTS(AMPUSER/${ARG1}/vmx/${MODE}/${ACTION}/ext)}" = "1"]?doopt) 
     317exten => vmx,n,GotoIf($["${ACTION}" = "0"]?o,1) 
     318exten => vmx,n,GotoIf($["${ACTION}" = "*"]?adef,1) 
     319 
     320; Got invalid option loop until the max 
     321; 
     322exten => vmx,n,Set(LOOPCOUNT=$[${LOOPCOUNT} + 1]) 
     323exten => vmx,n,GotoIf($[${LOOPCOUNT} > ${VMX_LOOPS}]?toomany) 
     324exten => vmx,n,Playback(pm-invalid-option&please-try-again) 
     325exten => vmx,n,Goto(loopstart) 
     326 
     327; tomany: to many invalid options, go to the specified destination 
     328; 
     329exten => vmx,n(toomany),Noop(Too Many invalid entries, got to invalid dest) 
     330exten => vmx,n,Set(VMX_OPTS=${VMX_OPTS_LOOPS}) 
     331exten => vmx,n,GotoIf($["${DB_EXISTS(AMPUSER/${ARG1}/vmx/${MODE}/vmxopts/loops)}" = "0"]?chkloop) 
     332exten => vmx,n,Set(VMX_OPTS=${DB_RESULT}) 
     333exten => vmx,n(chkloop),GotoIf($["${DB_EXISTS(AMPUSER/${ARG1}/vmx/${MODE}/loopdest/ext)}" = "0"]?doloop) 
     334exten => vmx,n,Set(VMX_LOOPDEST_EXT=${DB_RESULT}) 
     335exten => vmx,n,GotoIf($["${DB_EXISTS(AMPUSER/${ARG1}/vmx/${MODE}/loopdest/context)}" = "0"]?looppri) 
     336exten => vmx,n,Set(VMX_LOOPDEST_CONTEXT=${DB_RESULT}) ;TODO make configurable per above 
     337exten => vmx,n(looppri),GotoIf($["${DB_EXISTS(AMPUSER/${ARG1}/vmx/${MODE}/loopdest/pri)}" = "0"]?doloop) 
     338exten => vmx,n,Set(VMX_LOOPDEST_PRI=${DB_RESULT}) ;TODO make configurable per above 
     339exten => vmx,n(doloop),Goto(${VMX_LOOPDEST_CONTEXT},${VMX_LOOPDEST_EXT},${VMX_LOOPDEST_PRI}) 
     340 
     341; doopt: execute the valid option that was chosen 
     342; 
     343exten => vmx,n(doopt),Noop(Got a valid option: ${DB_RESULT}) 
     344exten => vmx,n,Set(VMX_EXT=${DB_RESULT}) 
     345; 
     346; Special case, if this option was to go to voicemail, set options and go 
     347; 
     348exten => vmx,n,GotoIf($["${VMX_EXT}" != "dovm"]?getdest) 
     349exten => vmx,n(vmxopts),Set(VMX_OPTS=${VMX_OPTS_DOVM}) 
     350exten => vmx,n,GotoIf($["${DB_EXISTS(AMPUSER/${ARG1}/vmx/${MODE}/vmxopts/dovm)}" = "0"]?vmxdovm) 
     351exten => vmx,n(vmxopts),Set(VMX_OPTS=${DB_RESULT}) 
     352exten => vmx,n(vmxdovm),goto(dovm,1) 
     353; 
     354; General case, setup the goto destination and go there (no error checking, its up to the GUI's to assure 
     355; reasonable values 
     356; 
     357exten => vmx,n(getdest),GotoIf($["${DB_EXISTS(AMPUSER/${ARG1}/vmx/${MODE}/${ACTION}/context)}" = "0"]?vmxpri) 
     358exten => vmx,n,Set(VMX_CONTEXT=${DB_RESULT}) 
     359exten => vmx,n(vmxpri),GotoIf($["${DB_EXISTS(AMPUSER/${ARG1}/vmx/${MODE}/${ACTION}/pri)}" = "0"]?vmxgoto) 
     360exten => vmx,n,Set(VMX_PRI=${DB_RESULT}) 
     361exten => vmx,n(vmxgoto),Goto(${VMX_CONTEXT},${VMX_EXT},${VMX_PRI}) 
     362 
     363; If the required voicemail file is not present, then revert to normal voicemail 
     364; behavior treating as if it was not set 
     365; 
     366exten => vmx,file+101,Noop(File for mode: ${MODE} does not exist, going to normal voicemail) 
     367exten => vmx,n,Goto(s-${ARG2},1) 
     368 
     369; Drop into voicemail either as a direct destination (in which case VMX_OPTS might be set to something) or 
     370; if the user timed out or broke out of the loop then VMX_OPTS is always cleared such that an Allison 
     371; message is played and the caller know's what is going on. 
     372; 
     373exten => dovm,1,Noop(VMX Timeout - go to voicemail) 
     374exten => dovm,n,Voicemail(${ARG1}@${VMCONTEXT}|${VMX_OPTS}${VMGAIN}) ; no flags, so allison plays please leave ... 
     375exten => dovm,n,Goto(exit-${VMSTATUS},1) 
    145376 
    146377exten => s-BUSY,1,NoOp(BUSY voicemail) 
     
    158389exten => _s-.,n,Goto(exit-${VMSTATUS},1) 
    159390 
     391; If the user has a 0 option defined, use that for operator zero-out from within voicemail 
     392; as well to keep it consistant with the menu structure 
     393; 
    160394exten => o,1,Background(one-moment-please)      ; 0 during vm message will hangup 
    161 exten => o,n,GotoIf($["x${OPERATOR_XTN}"="x"]?nooper:from-internal,${OPERATOR_XTN},1) 
     395exten => o,n,GotoIf($["${DB_EXISTS(AMPUSER/${ARG1}/vmx/${MODE}/0/ext)}" = "0"]?doopdef) 
     396 
     397exten => o,n,Set(VMX_OPDEST_EXT=${DB_RESULT}) 
     398exten => o,n,GotoIf($["${DB_EXISTS(AMPUSER/${ARG1}/vmx/${MODE}/0/context)}" = "1"]?opcontext) 
     399exten => o,n,Set(DB_RESULT=${VMX_CONTEXT}) 
     400exten => o,n(opcontext),Set(VMX_OPDEST_CONTEXT=${DB_RESULT}) 
     401exten => o,n,GotoIf($["${DB_EXISTS(AMPUSER/${ARG1}/vmx/${MODE}/0/pri)}" = "1"]?oppri) 
     402exten => o,n,Set(DB_RESULT=${VMX_PRI}) 
     403exten => o,n(oppri),Set(VMX_OPDEST_PRI=${DB_RESULT}) 
     404 
     405exten => o,n,Goto(${VMX_OPDEST_CONTEXT},${VMX_OPDEST_EXT},${VMX_OPDEST_PRIORITY}) 
     406exten => o,n(doopdef),GotoIf($["x${OPERATOR_XTN}"="x"]?nooper:from-internal,${OPERATOR_XTN},1) 
    162407exten => o,n(nooper),GotoIf($["x${FROM_DID}"="x"]?nodid) 
    163 exten => o,n,Dial(Local/${FROM_DID}@from-pstn) 
     408exten => o,n,Dial(Local/${FROM_DID)@from-pstn) 
    164409exten => o,n,Macro(hangup) 
    165410exten => o,n(nodid),Dial(Local/s@from-pstn) 
    166411exten => o,n,Macro(hangup) 
    167412 
     413; If the user has a * option defined, use that for the * out from within voicemail 
     414; as well to keep it consistant with the menu structure 
     415; 
    168416exten => a,1,Macro(get-vmcontext,${ARG1}) 
    169 exten => a,n,VoiceMailMain(${ARG1}@${VMCONTEXT}) 
    170 exten => a,n,Hangup 
     417exten => a,n,GotoIf($["${DB_EXISTS(AMPUSER/${ARG1}/vmx/${MODE}/*/ext)}" = "0"]?adef,1) 
     418 
     419exten => a,n,Set(VMX_ADEST_EXT=${DB_RESULT}) 
     420exten => a,n,GotoIf($["${DB_EXISTS(AMPUSER/${ARG1}/vmx/${MODE}/*/context)}" = "1"]?acontext) 
     421exten => a,n,Set(DB_RESULT=${VMX_CONTEXT}) 
     422exten => a,n(acontext),Set(VMX_ADEST_CONTEXT=${DB_RESULT}) 
     423exten => a,n,GotoIf($["${DB_EXISTS(AMPUSER/${ARG1}/vmx/${MODE}/*/pri)}" = "1"]?apri) 
     424exten => a,n,Set(DB_RESULT=${VMX_PRI}) 
     425exten => a,n(apri),Set(VMX_ADEST_PRI=${DB_RESULT}) 
     426exten => a,n,Goto(${VMX_ADEST_CONTEXT},${VMX_ADEST_EXT},${VMX_ADEST_PRI}) 
     427 
     428exten => adef,1,VoiceMailMain(${ARG1}@${VMCONTEXT}) 
     429exten => adef,n,Hangup 
    171430 
    172431exten => exit-FAILED,1,Playback(im-sorry&an-error-has-occured) 
     
    180439 
    181440exten => t,1,Hangup() 
     441;------------------------------------------------------------------------ 
    182442 
    183443;------------------------------------------------------------------------ 
     
    299559; Cleanup any remaining RG flag 
    300560; 
    301 exten => s,n,GotoIf($[ "foo${USE_CONFIRMATION}" = "foo" | "foo${RINGGROUP_INDEX}" = "foo" | "${CHANNEL}" != "${UNIQCHAN}"]?skiprg) 
     561exten => s,n,GotoIf($[ "x${USE_CONFIRMATION}" = "x" | "x${RINGGROUP_INDEX}" = "x" | "${CHANNEL}" != "${UNIQCHAN}"]?skiprg) 
    302562exten => s,n,Noop(Cleaning Up Confirmation Flag: RG/${RINGGROUP_INDEX}/${CHANNEL}) 
    303563exten => s,n,DBDel(RG/${RINGGROUP_INDEX}/${CHANNEL}) 
     
    305565; Cleanup any remaining BLKVM flag 
    306566; 
    307 exten => s,n(skiprg),GotoIf($[ "foo${BLKVM_BASE}" = "foo" | "BLKVM/${BLKVM_BASE}/${CHANNEL}" != "${BLKVM_OVERRIDE}" ]?theend
     567exten => s,n(skiprg),GotoIf($[ "x${BLKVM_BASE}" = "x" | "BLKVM/${BLKVM_BASE}/${CHANNEL}" != "${BLKVM_OVERRIDE}" ]?skipblkvm
    308568exten => s,n,Noop(Cleaning Up Block VM Flag: ${BLKVM_OVERRIDE}) 
    309569exten => s,n,DBDel(${BLKVM_OVERRIDE}) 
    310570 
    311 exten => s,n(theend),Wait(5) 
    312 exten => s,n,Hangup 
     571; Cleanup any remaining FollowMe DND flags 
     572
     573exten => s,n(skipblkvm),GotoIf($[ "x${FMGRP}" = "x" | "x${FMUNIQUE}" = "x" | "${CHANNEL}" != "${FMUNIQUE}" ]?theend) 
     574exten => s,n,DBDel(FM/DND/${FMGRP}/${CHANNEL}) 
     575 
     576exten => s,n(theend),Hangup 
    313577 
    314578[macro-faxreceive] 
     
    354618[macro-dialout-trunk] 
    355619exten => s,1,Set(DIAL_TRUNK=${ARG1}) 
     620exten => s,n,GotoIf($["x${OUTDISABLE_${ARG1}}" = "xon"]?disabletrunk,1) 
    356621 
    357622; If NODEST is set, clear it. No point in remembering since dialout-trunk will just end in the 
     
    378643exten => s,n,Set(OUTNUM=${OUTPREFIX_${DIAL_TRUNK}}${DIAL_NUMBER}) ; OUTNUM is the final dial number 
    379644exten => s,n,Set(custom=${CUT(OUT_${DIAL_TRUNK},:,1)}) ; Custom trunks are prefixed with "AMP:" 
    380 exten => s,n,GotoIf($["${custom}" = "AMP"]?customtrunk) 
     645 
     646; Back to normal processing, whether intracompany or not. 
     647; But add the macro-setmusic if we don't want music on this outbound call 
     648
     649exten => s,n,GotoIf($[$["${MOHCLASS}" = "default"] | $["foo${MOHCLASS}" = "foo"]]?gocall) ; Set to YES if we should pump silence 
     650exten => s,n,Set(DIAL_TRUNK_OPTIONS=M(setmusic^${MOHCLASS})${DIAL_TRUNK_OPTIONS})   ; set MoH or off 
     651 
     652exten => s,n(gocall),GotoIf($["${custom}" = "AMP"]?customtrunk) 
    381653exten => s,n,Dial(${OUT_${DIAL_TRUNK}}/${OUTNUM},300,${DIAL_TRUNK_OPTIONS}) ; Regular Trunk Dial 
    382654exten => s,n,Goto(s-${DIALSTATUS},1) 
     
    402674exten => s-CANCEL,3,Congestion(20) 
    403675 
    404 exten => _s-.,1,NoOp(Dial failed due to ${DIALSTATUS} - failing through to other trunks) 
     676exten => _s-.,1,GotoIf($["x${OUTFAIL_${ARG1}}" = "x"]?noreport) 
     677exten => _s-.,n,DeadAGI(${OUTFAIL_${ARG1}}) 
     678exten => _s-.,n(noreport),Noop(TRUNK Dial failed due to ${DIALSTATUS} - failing through to other trunks) 
     679 
     680exten => disabletrunk,1,Noop(TRUNK: ${OUT_${DIAL_TRUNK}} DISABLED - falling through to next trunk) 
    405681 
    406682exten => h,1,Macro(hangupcall) 
     
    717993exten => s,n(report),Noop(TTL: ${TTL} ARG1: ${ARG1}) 
    718994exten => s,n,GotoIf($[ "${ARG1}" = "SKIPTTL" ]?continue) 
    719 exten => s,n(report2),Set(_TTL=${IF($["foo${TTL}" = "foo"]?64:$[ ${TTL} - 1 ])}) 
     995exten => s,n(report2),Set(__TTL=${IF($["foo${TTL}" = "foo"]?64:$[ ${TTL} - 1 ])}) 
    720996exten => s,n,GotoIf($[ ${TTL} > 0 ]?continue) 
    721997exten => s,n,Wait(${RINGTIMER}) ; wait for a while, to give it a chance to be picked up by voicemail 
     
    8341110include => from-internal-additional 
    8351111include => ext-local-confirm 
     1112include => findmefollow-ringallv2 
    8361113; This causes grief with '#' transfers, commenting out for the moment. 
    8371114; include => bad-number 
     
    8811158exten => fax,1,Goto(ext-fax,in_fax,1) 
    8821159 
     1160;------------------------------------------------------------------------ 
     1161; [macro-setmusic] 
     1162;------------------------------------------------------------------------ 
     1163; CONTEXT:      macro-setmusic 
     1164; PURPOSE:      to turn off moh on routes where it is not desired 
     1165; 
     1166;------------------------------------------------------------------------ 
     1167[macro-setmusic] 
     1168exten => s,1,NoOp(Setting Outbound Route MoH To: ${ARG1}) 
     1169exten => s,2,SetMusicOnHold(${ARG1}) 
     1170;------------------------------------------------------------------------ 
     1171 
    8831172; ########################################## 
    8841173; ## Ring Groups with Confirmation macros ## 
     
    10431332exten => h,1,Noop(Hangup Extension in macro-confirm) 
    10441333exten => h,n,Macro(hangupcall) 
     1334 
     1335;------------------------------------------------------------------------ 
     1336 
     1337;------------------------------------------------------------------------ 
     1338; [findmefollow-ringallv2] 
     1339;------------------------------------------------------------------------ 
     1340; This context, to be included in from-internal, implements the PreRing part of findmefollow 
     1341; as well as the GroupRing part. It also communicates between the two so that if DND is set 
     1342; on the primary extension, and mastermode is enabled, then the other extensions will not ring 
     1343; 
     1344;------------------------------------------------------------------------ 
     1345[findmefollow-ringallv2] 
     1346exten => _FMPR-.,1,Noop(In FMPR ${FMGRP} with ${EXTEN:5}) 
     1347exten => _FMPR-.,n,Set(RingGroupMethod=) 
     1348exten => _FMPR-.,n,Set(USE_CONFIRMATION=) 
     1349exten => _FMPR-.,n,Set(RINGGROUP_INDEX=) 
     1350exten => _FMPR-.,n,Macro(simple-dial,${EXTEN:5},${FMREALPRERING}) 
     1351exten => _FMPR-.,n,GotoIf($["${DIALSTATUS}" != "BUSY"]?nodnd) 
     1352exten => _FMPR-.,n,Set(DB(FM/DND/${FMGRP}/${FMUNIQUE})=DND) 
     1353exten => _FMPR-.,n(nodnd),Noop(Ending FMPR ${FMGRP} with ${EXTEN:5} and dialstatus ${DIALSTATUS}) 
     1354exten => _FMPR-.,n,Hangup() 
     1355 
     1356exten => _FMGL-.,1,Noop(In FMGL ${FMGRP} with ${EXTEN:5}) 
     1357exten => _FMGL-.,n,GotoIf($["${DB(FM/DND/${FMGRP}/${FMUNIQUE})}" = "DND"]?dodnd) 
     1358exten => _FMGL-.,n,Wait(1) 
     1359exten => _FMGL-.,n,GotoIf($["${DB(FM/DND/${FMGRP}/${FMUNIQUE})}" = "DND"]?dodnd) 
     1360exten => _FMGL-.,n,Wait(1) 
     1361exten => _FMGL-.,n,GotoIf($["${DB(FM/DND/${FMGRP}/${FMUNIQUE})}" = "DND"]?dodnd) 
     1362exten => _FMGL-.,n,Wait(${FMPRERING}) 
     1363exten => _FMGL-.,n,GotoIf($["${DB(FM/DND/${FMGRP}/${FMUNIQUE})}" = "DND"]?dodnd) 
     1364exten => _FMGL-.,n,DBDel(FM/DND/${FMGRP}/${FMUNIQUE}) 
     1365exten => _FMGL-.,n(dodial),Macro(dial,${FMGRPTIME},${DIAL_OPTIONS},${EXTEN:5}) 
     1366exten => _FMGL-.,n,Noop(Ending FMGL ${FMGRP} with ${EXTEN:5} and dialstatus ${DIALSTATUS}) 
     1367exten => _FMGL-.,n,Hangup() 
     1368exten => _FMGL-.,n+10(dodnd),DBDel(FM/DND/${FMGRP}/${FMUNIQUE}) 
     1369exten => _FMGL-.,n,GotoIf($["${FMPRIME}" = "FALSE"]?dodial) 
     1370exten => _FMGL-.,n,Noop(Got DND in FMGL ${FMGRP} with ${EXTEN:5} in ${RingGroupMethod} mode, aborting) 
     1371exten => _FMGL-.,n,Hangup() 
    10451372 
    10461373;------------------------------------------------------------------------