[asterisk-users] Re: Match a Numer - then continue with, dialplan
Douglas Garstang
dgarstang at oneeighty.com
Wed Dec 20 11:49:42 MST 2006
> -----Original Message-----
> From: David Gomillion [mailto:dgomillion at eyecarenow.com]
> Sent: Wednesday, December 20, 2006 10:27 AM
> To: asterisk-users at 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
>
More information about the asterisk-users
mailing list