[Asterisk-Users] Need help with config-files

Benchev bbench at mail.bg
Tue Jul 4 23:53:43 MST 2006


On Tuesday 04 July 2006 17:55, Thomas Jacobsen wrote:
> Hello,
>
> I decided to resend the files, because i made alot of typos in them. -
> Please use these files instead.
You [internal] is rather a macro than [internal]
<quote>
[internal]
exten => _ZX[0-8]X,1,DBget(temp=CFIM/${EXTEN})
exten => _ZX[0-8]X,2,Dial(SIP/${temp})
exten => _ZX[0-8]X,3,Dial(SIP/${EXTEN},20)
exten => _ZX[0-8]X,102,Goto(${EXTEN},3)
exten => _ZX[0-8]X,4,VoiceMail(u${EXTEN})
exten => _ZX[0-8]X,104,VoiceMail(b${EXTEN})
exten => _ZX[0-8]X,5,Hangup
</quote>
I would suggest 
[internal]
exten => _1001,1,Macro(stdexten,1001,sip/1001)
exten => _1002,1,Macro(stdexten,1002,sip/1002)
etc...
and then use a macro  i.e.:
[macro-stdexten] ; lastcaller, BlackListing, CFIM
;; Standard extension macro:
;;   ${ARG1} - Extension  (we could have used ${MACRO_EXTEN} here as well
;;   ${ARG2} - Device(s) to ring
;;
exten => s,1,LookupBlacklist ; If CID blacklisted, goto 102
exten => s,2,Set(temp=${DB(CFIM/${ARG1})}); Get CFIM (Call Forward IM) key
exten => s,3,GotoIf($["${temp}" = ""]?,6); go to s,6 if no CFIM
exten => s,4,GotoIf($[${temp:0:6} = ${temp}]?s|5:s|9) ; internal # of 6 digits 
or int more than 6
exten => s,5,Dial(Local/${temp}@default/n)   ; Unconditional forward
exten => s,6,Set(DB(lastcaller/${ARG1})=${CALLERIDNUM}) ; Note the last caller
exten => s,7,Dial(${ARG2},20) ; Call the device with a 20 sec.If no j NOT 
jumping
exten => s,8,Goto(s-${DIALSTATUS},1)
exten => s,9,Set(temp=${DB(CFIM/${ARG1})})  ; Get again CFIM
exten => s,10,Set(CDR(accountcode)=${ARG1}) ; set ARG1  = accountcode thus 
changing whom to bill 
exten => s,11,Playback(pls-hold-while-try) ; advise him
exten => s,12,Dial(Local/${temp}@default/n)
exten => s,102,Goto(blacklisted,s,1) ; Blacklisted CallerID
exten => s,103,Goto(s,7) ; No CFIM key
exten => s-NOANSWER,1,Voicemail(u${ARG1}) 
exten => s-NOANSWER,2,Goto(s,1)         ; If they press #, return to start
exten => s-BUSY,1,Voicemail(b${ARG1})   ; If busy, send to voicemail -> busy 
exten => s-BUSY,2,Goto(s,1)     ; If they press #, return to start over
exten => _s-.,1,Goto(s-NOANSWER,1)    ; Treat anything else as no answer
exten => a,1,VoicemailMain(${ARG1})   ; If they press * -> VoicemailMain

You should change it or use the sample from the original
extensions.conf to answer your needs.
The macro does not need to be included in a context.
And as you see priorities jump n+101. 

Hope it helps.
Benchev



More information about the asterisk-users mailing list