[Asterisk-Users] Accommodating multiple FWD users

Vic Cross vicc at veejoe.com.au
Mon Apr 19 05:36:03 MST 2004


On Sun, 18 Apr 2004, Malcolm Taylor wrote:

> Can anyone suggest a way in which all users could dial the prefix 8 and *
> would automatically associate the correct FWD account for the outbound call?

I had to do something like this for outgoing calls over two different PSTN 
lines.  It's probably sub-optimal, but at least I did not have to do 
anything with database or other code...

>>>> extensions.conf:  (watch for split / wrap on the last exten line)

[globals]
TRUNKCOMPANY=Zap/1
TRUNKCUSTOMER=Zap/1
TRUNKHOMELINE=Zap/2
PREFIXCOMPANY=
PREFIXCUSTOMER=*11*2#W
PREFIXHOMELINE=

[macro-trunkdial]
exten => s,1,Dial(${ARG2}/${ARG3}${ARG1})
exten => s,2,Congestion

[homeline]
include => allnumbers

[company]
include => allnumbers

[customer]
include => allnumbers

[allnumbers]
exten => 
_9.,1,Macro(trunkdial|${EXTEN:1}|${TRUNK${CONTEXT}}|${PREFIX${CONTEXT}})

<<<<

In the technology configuration files (zapata.conf, sip.conf, etc) I put
the user into the relevant context for the line I want them to dial out
on.  (The ${PREFIX...} variable is used to control an override dialling
code, for example to select a long-distance provider or--in my case--to
charge calls to a second number on the line.)

I could probably make the macro a bit simpler by using ${MACROEXTEN}, 
${MACROCONTEXT}, etc instead of passing three arguments.  Maybe I'll look 
at that for version two.

Anyway, this saved me from duplicating all the outgoing definitions in my 
dialplan (it is a lot more complicated than the _9. I show above).  If 
you've already got different extens set up for the various FWD accounts, 
this method should not be too hard to adapt for your purposes.

Hope it helps,
Vic Cross



More information about the asterisk-users mailing list