[Asterisk-Users] Need help with config-files

Benchev bbench at mail.bg
Wed Jul 5 01:38:57 MST 2006


> > You [internal] is rather a macro than [internal]
> > <quote>
>
> Is a macro reqally required? If wildcards suffice, why use a macro?
Thanks for getting involved, since you might be in better help.

I his case maybe yes, since his [internal] is a macro-like, is it not?
> > [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.
The only reason  is to show him where the extension goes and where the device
(in this case his extension and peer name are equal to each other)

> 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?
Yep, and also DBget and DBput but we don't know which version he uses :)
> Anyway, you have too many numbers below. Why not use "n" and labels
> instead?
Absolutely!
> 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.
>
Looking at his extensions and sip.conf I thought ,the best
for Thomas is to simplify the things down to the point everything gets 
working. Probably to use regexten in the sip peers?
I think [internal] is the place to declare the internal extensions
not in [incoming-from-sip] and once a call comes to enter
a macro loop.
Thanks,
Benchev



More information about the asterisk-users mailing list