[Asterisk-Users] Need help with config-files

Tzafrir Cohen tzafrir.cohen at xorcom.com
Wed Jul 5 00:43:33 MST 2006


On Wed, Jul 05, 2006 at 09:53:43AM +0300, Benchev wrote:
> 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>

Is a macro reqally required? If wildcards suffice, why use a macro?

> [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)

Any special reason to use a number three times in the call to the macro?
If it is inherently the same, use one parameter.

e.g:

exten => _1001,1,Macro(stdexten,${EXTEN},sip/${EXTEN})

And maybe eliminate the second parameter.

> 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

Isn't "jump to priority" deprecated?

Anyway, you have too many numbers below. Why not use "n" and labels
instead?

exten => s,1,Do,Something
; maybe replace the following two by a very long GotoIf with an obscure
; functions syntax ;-)
exten => s,n,A(test)
exten => s,n,GotoIf($[ "${testresult}" = "bad" ],bad)
exten => s,n,GoOn(AsUsual)
exten => s,n,Hangup
exten => s,n(bad),Handle(bad)

This makes it possible to add/remove lines without editing everything in
the neighbourhood.

> 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
> _______________________________________________
> --Bandwidth and Colocation provided by Easynews.com --
> 
> Asterisk-Users mailing list
> To UNSUBSCRIBE or update options visit:
>    http://lists.digium.com/mailman/listinfo/asterisk-users
> 

-- 
Tzafrir Cohen      sip:tzafrir at local.xorcom.com
icq#16849755       iax:tzafrir at local.xorcom.com
+972-50-7952406           
tzafrir.cohen at xorcom.com  http://www.xorcom.com



More information about the asterisk-users mailing list