Douglas Garstang
2006-Dec-20 11:50 UTC
[asterisk-users] Re: Match a Numer - then continue with, dialplan
> -----Original Message----- > From: David Gomillion [mailto:dgomillion@eyecarenow.com] > Sent: Wednesday, December 20, 2006 10:27 AM > To: asterisk-users@lists.digium.com > Subject: [asterisk-users] Re: Match a Numer - then continue with, > dialplan > > > I think you're making it far too difficult. > > What I do is something like this: > > [outgoing] > include => internal > include => longdistance > ;Always include internal first, as matches from the first include > ;will be used first. This allows you to make sure your internal > ;extensions don't go out your trunks. > > [longdistance] > ignorepat => 9; > include => default; already included from local, but putting here for > clarity > include => local; > > exten => _91XXXXXXX,1,Macro(trunkout,${EXTEN}) ;Medium Distance > exten => _91XXXXXXXXXX,1,Macro(trunkout,${EXTEN}) ;Long Distance > > Then, I have: > [macro-trunkout] > exten => s,1,Set(cname=${DB(showname/${CALLERIDNUM})}); > exten => s,n,Set(cnum=${DB(shownum/${CALLERIDNUM})}); > exten => s,n,GotoIf($["foo${cnum}" = "foo"]?6); //if > calling from ZAP > channel that set caller ID already > exten => s,n,Set(CALLERID(name)=${cname}|a); > exten => s,n,Set(CALLERID(number)=${cnum}|a); > exten => s,n,Dial(${TRUNK}/${ARG1:${TRUNKMSD}}); > exten => s,n,Goto(s-${DIALSTATUS},1) > > exten => s-ANSWER,1,Hangup > exten => s-CONGESTION,1,Congestion(30) > exten => s-CONGESTION,2,Hangup > exten => s-CANCEL,1,Hangup > exten => s-BUSY,1,Busy(30) > exten => s-BUSY,2,Hangup > > Why is this important? It's not. But it is fundamentally > different from > what you're asking. You want to match a partial extension dialed and > then continue appending digits. What you really need to do is > wait for > the whole number, then decide what kind of number it is, do the > processing, and send it on its way. It's just a slight change > in the way > you're thinking, because you understand that there's a class > of numbers > to treat differently. And that's OK. Just don't do anything with it > until the whole extension has been entered!Uhm, No. I'm not trying to partially match extensions and then continue appending digits. What makes you think that?> > You'll notice that, anything not going through the trunkout macro > doesn't get tweaked, and anything that goes through there > will read from > the database. I could just as easily set a single value, but > I have some > users that I want to go out as themselves, and different departments > that have a general number, etc. I found the Asterisk > Database to be the > easiest to tweak, as I have some scripts to allow admins to > change the > effective CallerID on the fly.David, this is completely different from what I am trying to do. Let's try this a different way. Let's say you have two companies. When someone calls a number in their own company, we use their INTERNAL caller id. When they call someone in another company, we want to send their EXTERNAL caller id. How would you do this? Doug.> > I hope this helps! Asterisk can do what you're asking, and it > does every > day. > > > _______________________________________________ > --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 >
Tony Mountifield
2006-Dec-20 14:40 UTC
[asterisk-users] Re: Match a Numer - then continue with, dialplan
In article <645FEC31A18FE54A8721500CDD55A7B6035D0C6C@mail.oneeighty.com>, Douglas Garstang <dgarstang@oneeighty.com> wrote:> > Let's try this a different way. Let's say you have two companies. When someone calls a > number in their own company, we use their INTERNAL caller id. When they call someone in > another company, we want to send their EXTERNAL caller id. How would you do this?Firstly, in the setup you are envisaging, how do you distinguish which company the caller is calling from? Their extensions number? The context at which they enter the dialplan? Or something else? Secondly, how do you distinguish between destination numbers in one company from those in another? Number range? Context? Cheers Tony -- Tony Mountifield Work: tony@softins.co.uk - http://www.softins.co.uk Play: tony@mountifield.org - http://tony.mountifield.org
Richard Lyman
2006-Dec-20 16:29 UTC
[asterisk-users] Re: Match a Numer - then continue with, dialplan
Douglas Garstang wrote:>> -----Original Message----- >> From: David Gomillion [mailto:dgomillion@eyecarenow.com] >>*snipped> David, this is completely different from what I am trying to do. > > Let's try this a different way. Let's say you have two companies. When someone calls a number in their own company, we use their INTERNAL caller id. When they call someone in another company, we want to send their EXTERNAL caller id. How would you do this? > > Doug. >if it is just callerid then wouldn't the gf stuff (if it still exists) work? it was something like (man i'm getting old, looking up in wiki) exten => s,1,Answer() exten => s,XXXX,2,Set(CALLERID(name)=OUTSIDE NAME|CALLERID(num)=xxxxxxxxxx) exten => s,2,Set(CALLERID(name)=INSIDE NAME|CALLERID(num)=xxxxxxxxxx) exten => s,3,Dial(yadda) XXXX would obviously be the callerid num of the internal exten
Richard Lyman
2006-Dec-21 10:15 UTC
[asterisk-users] Re: Match a Numer - then continue with, dialplan
Benny Amorsen wrote:>>>>>> "RL" == Richard Lyman <pchammer@dynx.net> writes: >>>>>> > > RL> grr, i hate when i typo (and reply to my own posts) exten => > RL> s/XXXX,2,Set(CALLERID(name)=OUTSIDE NAME|CALLERID(num)=xxxxxxxxxx) > > Heh, if you want to chase typos, perhaps you should add an underscore > before XXXX? > > > /Benny >if that were the case, then you should also change the CALLERID(name/num) references to macros! eh merry christmas to all!