[Asterisk-Users] Interesting Dial-Plan Question

Matt mhoppes at gmail.com
Thu Apr 27 07:52:13 MST 2006


Ok here is what we did.. all in one context:

exten => _NXXXXXX,1,NoOp(Customer Area Code Is: ${CALLERIDNUM:0:3})
exten => _NXXXXXX,2,Goto(${CALLERIDNUM:0:3}${EXTEN},1)
exten => _1NXXXXXXXXX,1,NoOp(Chopping One Off Number: ${EXTEN:1:10})
exten => _1NXXXXXXXXX,2,Goto(${EXTEN:1:10},1)

Had to fix Eric's code a bit... CALLERIDNUM::0:3 didn't work :P  But
that works great!  Call lengths to US calls are now standardized :) 
Before it showed up however you dialed it hehe.

On 4/27/06, Matt <mhoppes at gmail.com> wrote:
> That will work?   So if I have:
>
> CALLERIDNUM = 5705551212
> exten => _NXXXXXX,1,Goto(${CALLERIDNUM::0:3}${EXTEN},1)
> exten => _570NXXXXXX,1,Dial(Zap/g1/${EXTEN},1)
>
> And if CALLERIDNUM = 7175551212
> exten => _717NXXXXXX,1,Dial(Zap/g2/${EXTEN},1)
>
> (Notice 717 calls go out g2.. and 570 go out g1).
>
> That seems as though it should work, however it still would seem I
> have to dork up my current dial-plan.   That's why I'm wondering if I
> should do that EXTEN and CALLERIDNUM stuff in another context, and
> then transfer to my outdial context?
>
> The problem I see doing it this way is that not ALL area code 717 or
> 570 calls go out g1 or g2.   Some calls in the same are code are long
> distance and need to route out the LD provider... even though they are
> still 717-555-1212 format.
>
> Right now.. if someone dials 1-570-555-1212, 570-555-1212, or 555-1212
> it routes correctly (wether it is long distance or not).   My goal is
> to artificially make the person dial '570' or '717' even if they dial
> 555-1212 by looking at the originating number.  Unless someone thinks
> of a good reason not too.. it seems a context flip woudl be the way to
> go.
>



More information about the asterisk-users mailing list