Changeset 3805

Show
Ignore:
Timestamp:
02/22/07 14:13:49 (6 years ago)
Author:
p_lindheimer
Message:

revert r3798, not sure how that happened (too late) - also addreses #1803

Files:

Legend:

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

    r3798 r3805  
    5656 
    5757exten => s,10,Dial(${ds})                               ; dialparties will set the priority to 10 if $ds is not null 
    58 exten => s,11,Set(DIALSTATUS=${IF($["${DIALSTATUS_CW}"!="" ]?${DIALSTATUS_CW}:${DIALSTATUS})}) 
    5958 
    6059exten => s,20,NoOp(Returned from dialparties with hunt groups to dial ) 
     
    131130exten => _s-.,n,Congestion(10) 
    132131 
    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 ;------------------------------------------------------------------------ 
    252132[macro-vm] 
    253 ; ARG1 - extension 
    254 ; ARG2 - DIRECTDIAL/BUSY 
    255133exten => s,1,Macro(user-callerid,SKIPTTL) 
    256134exten => s,n,Set(VMGAIN=${IF($["foo${VM_GAIN}"!="foo"]?"g(${VM_GAIN})":"")}) 
     
    260138; transfers will properly function. 
    261139; 
    262 exten => s,n,GotoIf($["foo${DB(${BLKVM_OVERRIDE})}" != "fooTRUE"]?vmx,1) 
     140exten => s,n,GotoIf($["foo${DB(${BLKVM_OVERRIDE})}" != "fooTRUE"]?s-${ARG2},1) 
    263141; 
    264142; we didn't branch so block this from voicemail 
    265143; 
    266144exten => 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 ; 
    271 exten => vmx,1,Set(MODE=${IF($["${ARG2}"="BUSY"]?busy:unavail)}) 
    272 exten => vmx,n,GotoIf($["${ARG2}" != "DIRECTDIAL"]?notdirect) 
    273 exten => vmx,n,Set(MODE=${IF($["${REGEX("[b]" ${VM_DDTYPE})}" = "1"]?busy:${MODE})}) 
    274 exten => vmx,n(notdirect),Noop(Checking if ext ${ARG1} is enabled: ${DB(AMPUSER/${ARG1}/vmx/${MODE}/state)}) 
    275 exten => 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 ; 
    280 exten => vmx,n,Macro(get-vmcontext,${ARG1}) 
    281 exten => 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 ; 
    285 exten => vmx,n,Set(LOOPCOUNT=0) 
    286 exten => vmx,n,GotoIf($["${DB_EXISTS(AMPUSER/${ARG1}/vmx/${MODE}/repeat)}" = "0"]?vmxtime) 
    287 exten => vmx,n,Set(VMX_REPEAT=${DB_RESULT}) 
    288 exten => vmx,n(vmxtime),GotoIf($["${DB_EXISTS(AMPUSER/${ARG1}/vmx/${MODE}/timeout)}" = "0"]?vmxloops) 
    289 exten => vmx,n,Set(VMX_TIMEOUT=${DB_RESULT}) 
    290 exten => vmx,n(vmxloops),GotoIf($["${DB_EXISTS(AMPUSER/${ARG1}/vmx/${MODE}/loops)}" = "0"]?vmxanswer) 
    291 exten => vmx,n,Set(VMX_LOOPS=${DB_RESULT}) 
    292 exten => 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 ; 
    297 exten => vmx,n(loopstart),Read(ACTION,/var/spool/asterisk/voicemail/${VMCONTEXT}/${ARG1}/${MODE},1,skip,${VMX_REPEAT},${VMX_TIMEOUT}) 
    298 exten => vmx,n,GotoIf($["${EXISTS(${ACTION})}" = "1"]?checkopt) 
    299  
    300 ; If we are here we timed out, go to the required destination 
    301 ; 
    302 exten => vmx,n(noopt),Noop(Timeout: going to timeout dest) 
    303 exten => vmx,n,Set(VMX_OPTS=${VMX_OPTS_TIMEOUT}) 
    304 exten => vmx,n,GotoIf($["${DB_EXISTS(AMPUSER/${ARG1}/vmx/${MODE}/vmxopts/timeout)}" = "0"]?chktime) 
    305 exten => vmx,n,Set(VMX_OPTS=${DB_RESULT}) 
    306 exten => vmx,n(chktime),GotoIf($["${DB_EXISTS(AMPUSER/${ARG1}/vmx/${MODE}/timedest/ext)}" = "0"]?dotime) 
    307 exten => vmx,n,Set(VMX_TIMEDEST_EXT=${DB_RESULT}) 
    308 exten => vmx,n,GotoIf($["${DB_EXISTS(AMPUSER/${ARG1}/vmx/${MODE}/timedest/context)}" = "0"]?timepri) 
    309 exten => vmx,n,Set(VMX_TIMEDEST_CONTEXT=${DB_RESULT}) 
    310 exten => vmx,n(timepri),GotoIf($["${DB_EXISTS(AMPUSER/${ARG1}/vmx/${MODE}/timedest/pri)}" = "0"]?dotime) 
    311 exten => vmx,n,Set(VMX_TIMEDEST_PRI=${DB_RESULT}) 
    312 exten => 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 ; 
    316 exten => vmx,n(checkopt),GotoIf($["${DB_EXISTS(AMPUSER/${ARG1}/vmx/${MODE}/${ACTION}/ext)}" = "1"]?doopt) 
    317 exten => vmx,n,GotoIf($["${ACTION}" = "0"]?o,1) 
    318 exten => vmx,n,GotoIf($["${ACTION}" = "*"]?adef,1) 
    319  
    320 ; Got invalid option loop until the max 
    321 ; 
    322 exten => vmx,n,Set(LOOPCOUNT=$[${LOOPCOUNT} + 1]) 
    323 exten => vmx,n,GotoIf($[${LOOPCOUNT} > ${VMX_LOOPS}]?toomany) 
    324 exten => vmx,n,Playback(pm-invalid-option&please-try-again) 
    325 exten => vmx,n,Goto(loopstart) 
    326  
    327 ; tomany: to many invalid options, go to the specified destination 
    328 ; 
    329 exten => vmx,n(toomany),Noop(Too Many invalid entries, got to invalid dest) 
    330 exten => vmx,n,Set(VMX_OPTS=${VMX_OPTS_LOOPS}) 
    331 exten => vmx,n,GotoIf($["${DB_EXISTS(AMPUSER/${ARG1}/vmx/${MODE}/vmxopts/loops)}" = "0"]?chkloop) 
    332 exten => vmx,n,Set(VMX_OPTS=${DB_RESULT}) 
    333 exten => vmx,n(chkloop),GotoIf($["${DB_EXISTS(AMPUSER/${ARG1}/vmx/${MODE}/loopdest/ext)}" = "0"]?doloop) 
    334 exten => vmx,n,Set(VMX_LOOPDEST_EXT=${DB_RESULT}) 
    335 exten => vmx,n,GotoIf($["${DB_EXISTS(AMPUSER/${ARG1}/vmx/${MODE}/loopdest/context)}" = "0"]?looppri) 
    336 exten => vmx,n,Set(VMX_LOOPDEST_CONTEXT=${DB_RESULT}) ;TODO make configurable per above 
    337 exten => vmx,n(looppri),GotoIf($["${DB_EXISTS(AMPUSER/${ARG1}/vmx/${MODE}/loopdest/pri)}" = "0"]?doloop) 
    338 exten => vmx,n,Set(VMX_LOOPDEST_PRI=${DB_RESULT}) ;TODO make configurable per above 
    339 exten => vmx,n(doloop),Goto(${VMX_LOOPDEST_CONTEXT},${VMX_LOOPDEST_EXT},${VMX_LOOPDEST_PRI}) 
    340  
    341 ; doopt: execute the valid option that was chosen 
    342 ; 
    343 exten => vmx,n(doopt),Noop(Got a valid option: ${DB_RESULT}) 
    344 exten => vmx,n,Set(VMX_EXT=${DB_RESULT}) 
    345 ; 
    346 ; Special case, if this option was to go to voicemail, set options and go 
    347 ; 
    348 exten => vmx,n,GotoIf($["${VMX_EXT}" != "dovm"]?getdest) 
    349 exten => vmx,n(vmxopts),Set(VMX_OPTS=${VMX_OPTS_DOVM}) 
    350 exten => vmx,n,GotoIf($["${DB_EXISTS(AMPUSER/${ARG1}/vmx/${MODE}/vmxopts/dovm)}" = "0"]?vmxdovm) 
    351 exten => vmx,n(vmxopts),Set(VMX_OPTS=${DB_RESULT}) 
    352 exten => 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 ; 
    357 exten => vmx,n(getdest),GotoIf($["${DB_EXISTS(AMPUSER/${ARG1}/vmx/${MODE}/${ACTION}/context)}" = "0"]?vmxpri) 
    358 exten => vmx,n,Set(VMX_CONTEXT=${DB_RESULT}) 
    359 exten => vmx,n(vmxpri),GotoIf($["${DB_EXISTS(AMPUSER/${ARG1}/vmx/${MODE}/${ACTION}/pri)}" = "0"]?vmxgoto) 
    360 exten => vmx,n,Set(VMX_PRI=${DB_RESULT}) 
    361 exten => 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 ; 
    366 exten => vmx,file+101,Noop(File for mode: ${MODE} does not exist, going to normal voicemail) 
    367 exten => 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 ; 
    373 exten => dovm,1,Noop(VMX Timeout - go to voicemail) 
    374 exten => dovm,n,Voicemail(${ARG1}@${VMCONTEXT}|${VMX_OPTS}${VMGAIN}) ; no flags, so allison plays please leave ... 
    375 exten => dovm,n,Goto(exit-${VMSTATUS},1) 
    376145 
    377146exten => s-BUSY,1,NoOp(BUSY voicemail) 
     
    389158exten => _s-.,n,Goto(exit-${VMSTATUS},1) 
    390159 
    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 ; 
    394160exten => o,1,Background(one-moment-please)      ; 0 during vm message will hangup 
    395 exten => o,n,GotoIf($["${DB_EXISTS(AMPUSER/${ARG1}/vmx/${MODE}/0/ext)}" = "0"]?doopdef) 
    396  
    397 exten => o,n,Set(VMX_OPDEST_EXT=${DB_RESULT}) 
    398 exten => o,n,GotoIf($["${DB_EXISTS(AMPUSER/${ARG1}/vmx/${MODE}/0/context)}" = "1"]?opcontext) 
    399 exten => o,n,Set(DB_RESULT=${VMX_CONTEXT}) 
    400 exten => o,n(opcontext),Set(VMX_OPDEST_CONTEXT=${DB_RESULT}) 
    401 exten => o,n,GotoIf($["${DB_EXISTS(AMPUSER/${ARG1}/vmx/${MODE}/0/pri)}" = "1"]?oppri) 
    402 exten => o,n,Set(DB_RESULT=${VMX_PRI}) 
    403 exten => o,n(oppri),Set(VMX_OPDEST_PRI=${DB_RESULT}) 
    404  
    405 exten => o,n,Goto(${VMX_OPDEST_CONTEXT},${VMX_OPDEST_EXT},${VMX_OPDEST_PRIORITY}) 
    406 exten => o,n(doopdef),GotoIf($["x${OPERATOR_XTN}"="x"]?nooper:from-internal,${OPERATOR_XTN},1) 
     161exten => o,n,GotoIf($["x${OPERATOR_XTN}"="x"]?nooper:from-internal,${OPERATOR_XTN},1) 
    407162exten => o,n(nooper),GotoIf($["x${FROM_DID}"="x"]?nodid) 
    408 exten => o,n,Dial(Local/${FROM_DID)@from-pstn) 
     163exten => o,n,Dial(Local/${FROM_DID}@from-pstn) 
    409164exten => o,n,Macro(hangup) 
    410165exten => o,n(nodid),Dial(Local/s@from-pstn) 
    411166exten => o,n,Macro(hangup) 
    412167 
    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 ; 
    416168exten => a,1,Macro(get-vmcontext,${ARG1}) 
    417 exten => a,n,GotoIf($["${DB_EXISTS(AMPUSER/${ARG1}/vmx/${MODE}/*/ext)}" = "0"]?adef,1) 
    418  
    419 exten => a,n,Set(VMX_ADEST_EXT=${DB_RESULT}) 
    420 exten => a,n,GotoIf($["${DB_EXISTS(AMPUSER/${ARG1}/vmx/${MODE}/*/context)}" = "1"]?acontext) 
    421 exten => a,n,Set(DB_RESULT=${VMX_CONTEXT}) 
    422 exten => a,n(acontext),Set(VMX_ADEST_CONTEXT=${DB_RESULT}) 
    423 exten => a,n,GotoIf($["${DB_EXISTS(AMPUSER/${ARG1}/vmx/${MODE}/*/pri)}" = "1"]?apri) 
    424 exten => a,n,Set(DB_RESULT=${VMX_PRI}) 
    425 exten => a,n(apri),Set(VMX_ADEST_PRI=${DB_RESULT}) 
    426 exten => a,n,Goto(${VMX_ADEST_CONTEXT},${VMX_ADEST_EXT},${VMX_ADEST_PRI}) 
    427  
    428 exten => adef,1,VoiceMailMain(${ARG1}@${VMCONTEXT}) 
    429 exten => adef,n,Hangup 
     169exten => a,n,VoiceMailMain(${ARG1}@${VMCONTEXT}) 
     170exten => a,n,Hangup 
    430171 
    431172exten => exit-FAILED,1,Playback(im-sorry&an-error-has-occured) 
     
    439180 
    440181exten => t,1,Hangup() 
    441 ;------------------------------------------------------------------------ 
    442182 
    443183;------------------------------------------------------------------------ 
     
    559299; Cleanup any remaining RG flag 
    560300; 
    561 exten => s,n,GotoIf($[ "x${USE_CONFIRMATION}" = "x" | "x${RINGGROUP_INDEX}" = "x" | "${CHANNEL}" != "${UNIQCHAN}"]?skiprg) 
     301exten => s,n,GotoIf($[ "foo${USE_CONFIRMATION}" = "foo" | "foo${RINGGROUP_INDEX}" = "foo" | "${CHANNEL}" != "${UNIQCHAN}"]?skiprg) 
    562302exten => s,n,Noop(Cleaning Up Confirmation Flag: RG/${RINGGROUP_INDEX}/${CHANNEL}) 
    563303exten => s,n,DBDel(RG/${RINGGROUP_INDEX}/${CHANNEL}) 
     
    565305; Cleanup any remaining BLKVM flag 
    566306; 
    567 exten => s,n(skiprg),GotoIf($[ "x${BLKVM_BASE}" = "x" | "BLKVM/${BLKVM_BASE}/${CHANNEL}" != "${BLKVM_OVERRIDE}" ]?skipblkvm
     307exten => s,n(skiprg),GotoIf($[ "foo${BLKVM_BASE}" = "foo" | "BLKVM/${BLKVM_BASE}/${CHANNEL}" != "${BLKVM_OVERRIDE}" ]?theend
    568308exten => s,n,Noop(Cleaning Up Block VM Flag: ${BLKVM_OVERRIDE}) 
    569309exten => s,n,DBDel(${BLKVM_OVERRIDE}) 
    570310 
    571 ; Cleanup any remaining FollowMe DND flags 
    572 
    573 exten => s,n(skipblkvm),GotoIf($[ "x${FMGRP}" = "x" | "x${FMUNIQUE}" = "x" | "${CHANNEL}" != "${FMUNIQUE}" ]?theend) 
    574 exten => s,n,DBDel(FM/DND/${FMGRP}/${CHANNEL}) 
    575  
    576 exten => s,n(theend),Hangup 
     311exten => s,n(theend),Wait(5) 
     312exten => s,n,Hangup 
    577313 
    578314[macro-faxreceive] 
     
    618354[macro-dialout-trunk] 
    619355exten => s,1,Set(DIAL_TRUNK=${ARG1}) 
    620 exten => s,n,GotoIf($["x${OUTDISABLE_${ARG1}}" = "xon"]?disabletrunk,1) 
    621356 
    622357; If NODEST is set, clear it. No point in remembering since dialout-trunk will just end in the 
     
    643378exten => s,n,Set(OUTNUM=${OUTPREFIX_${DIAL_TRUNK}}${DIAL_NUMBER}) ; OUTNUM is the final dial number 
    644379exten => s,n,Set(custom=${CUT(OUT_${DIAL_TRUNK},:,1)}) ; Custom trunks are prefixed with "AMP:" 
    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 
    649 exten => s,n,GotoIf($[$["${MOHCLASS}" = "default"] | $["foo${MOHCLASS}" = "foo"]]?gocall) ; Set to YES if we should pump silence 
    650 exten => s,n,Set(DIAL_TRUNK_OPTIONS=M(setmusic^${MOHCLASS})${DIAL_TRUNK_OPTIONS})   ; set MoH or off 
    651  
    652 exten => s,n(gocall),GotoIf($["${custom}" = "AMP"]?customtrunk) 
     380exten => s,n,GotoIf($["${custom}" = "AMP"]?customtrunk) 
    653381exten => s,n,Dial(${OUT_${DIAL_TRUNK}}/${OUTNUM},300,${DIAL_TRUNK_OPTIONS}) ; Regular Trunk Dial 
    654382exten => s,n,Goto(s-${DIALSTATUS},1) 
     
    674402exten => s-CANCEL,3,Congestion(20) 
    675403 
    676 exten => _s-.,1,GotoIf($["x${OUTFAIL_${ARG1}}" = "x"]?noreport) 
    677 exten => _s-.,n,DeadAGI(${OUTFAIL_${ARG1}}) 
    678 exten => _s-.,n(noreport),Noop(TRUNK Dial failed due to ${DIALSTATUS} - failing through to other trunks) 
    679  
    680 exten => disabletrunk,1,Noop(TRUNK: ${OUT_${DIAL_TRUNK}} DISABLED - falling through to next trunk) 
     404exten => _s-.,1,NoOp(Dial failed due to ${DIALSTATUS} - failing through to other trunks) 
    681405 
    682406exten => h,1,Macro(hangupcall) 
     
    993717exten => s,n(report),Noop(TTL: ${TTL} ARG1: ${ARG1}) 
    994718exten => s,n,GotoIf($[ "${ARG1}" = "SKIPTTL" ]?continue) 
    995 exten => s,n(report2),Set(__TTL=${IF($["foo${TTL}" = "foo"]?64:$[ ${TTL} - 1 ])}) 
     719exten => s,n(report2),Set(_TTL=${IF($["foo${TTL}" = "foo"]?64:$[ ${TTL} - 1 ])}) 
    996720exten => s,n,GotoIf($[ ${TTL} > 0 ]?continue) 
    997721exten => s,n,Wait(${RINGTIMER}) ; wait for a while, to give it a chance to be picked up by voicemail 
     
    1110834include => from-internal-additional 
    1111835include => ext-local-confirm 
    1112 include => findmefollow-ringallv2 
    1113836; This causes grief with '#' transfers, commenting out for the moment. 
    1114837; include => bad-number 
     
    1158881exten => fax,1,Goto(ext-fax,in_fax,1) 
    1159882 
    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] 
    1168 exten => s,1,NoOp(Setting Outbound Route MoH To: ${ARG1}) 
    1169 exten => s,2,SetMusicOnHold(${ARG1}) 
    1170 ;------------------------------------------------------------------------ 
    1171  
    1172883; ########################################## 
    1173884; ## Ring Groups with Confirmation macros ## 
     
    13321043exten => h,1,Noop(Hangup Extension in macro-confirm) 
    13331044exten => 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] 
    1346 exten => _FMPR-.,1,Noop(In FMPR ${FMGRP} with ${EXTEN:5}) 
    1347 exten => _FMPR-.,n,Set(RingGroupMethod=) 
    1348 exten => _FMPR-.,n,Set(USE_CONFIRMATION=) 
    1349 exten => _FMPR-.,n,Set(RINGGROUP_INDEX=) 
    1350 exten => _FMPR-.,n,Macro(simple-dial,${EXTEN:5},${FMREALPRERING}) 
    1351 exten => _FMPR-.,n,GotoIf($["${DIALSTATUS}" != "BUSY"]?nodnd) 
    1352 exten => _FMPR-.,n,Set(DB(FM/DND/${FMGRP}/${FMUNIQUE})=DND) 
    1353 exten => _FMPR-.,n(nodnd),Noop(Ending FMPR ${FMGRP} with ${EXTEN:5} and dialstatus ${DIALSTATUS}) 
    1354 exten => _FMPR-.,n,Hangup() 
    1355  
    1356 exten => _FMGL-.,1,Noop(In FMGL ${FMGRP} with ${EXTEN:5}) 
    1357 exten => _FMGL-.,n,GotoIf($["${DB(FM/DND/${FMGRP}/${FMUNIQUE})}" = "DND"]?dodnd) 
    1358 exten => _FMGL-.,n,Wait(1) 
    1359 exten => _FMGL-.,n,GotoIf($["${DB(FM/DND/${FMGRP}/${FMUNIQUE})}" = "DND"]?dodnd) 
    1360 exten => _FMGL-.,n,Wait(1) 
    1361 exten => _FMGL-.,n,GotoIf($["${DB(FM/DND/${FMGRP}/${FMUNIQUE})}" = "DND"]?dodnd) 
    1362 exten => _FMGL-.,n,Wait(${FMPRERING}) 
    1363 exten => _FMGL-.,n,GotoIf($["${DB(FM/DND/${FMGRP}/${FMUNIQUE})}" = "DND"]?dodnd) 
    1364 exten => _FMGL-.,n,DBDel(FM/DND/${FMGRP}/${FMUNIQUE}) 
    1365 exten => _FMGL-.,n(dodial),Macro(dial,${FMGRPTIME},${DIAL_OPTIONS},${EXTEN:5}) 
    1366 exten => _FMGL-.,n,Noop(Ending FMGL ${FMGRP} with ${EXTEN:5} and dialstatus ${DIALSTATUS}) 
    1367 exten => _FMGL-.,n,Hangup() 
    1368 exten => _FMGL-.,n+10(dodnd),DBDel(FM/DND/${FMGRP}/${FMUNIQUE}) 
    1369 exten => _FMGL-.,n,GotoIf($["${FMPRIME}" = "FALSE"]?dodial) 
    1370 exten => _FMGL-.,n,Noop(Got DND in FMGL ${FMGRP} with ${EXTEN:5} in ${RingGroupMethod} mode, aborting) 
    1371 exten => _FMGL-.,n,Hangup() 
    13721045 
    13731046;------------------------------------------------------------------------