[asterisk-users] Match a Numer - then continue with dialplan

Watkins, Bradley Bradley.Watkins at compuware.com
Tue Dec 19 16:16:02 MST 2006


Please correct me if I'm misunderstanding your requirements, but see
below (inline) for what I would do: 

> -----Original Message-----
> From: asterisk-users-bounces at lists.digium.com 
> [mailto:asterisk-users-bounces at lists.digium.com] On Behalf Of 
> Douglas Garstang
> Sent: Tuesday, December 19, 2006 5:04 PM
> To: Asterisk Users Mailing List - Non-Commercial Discussion
> Subject: RE: [asterisk-users] Match a Numer - then continue 
> with dialplan
> 
> I just know someone is going to ask 'why would you ever want 
> to do that?'. Here's my answer.
> 
> We have two companies, each with a dialplan similar to what's 
> below. In the event that the number being dialled does not 
> match any number within our OWN company, we want to set the 
> caller id to be a generic one for the company, NOT one for 
> the user. This is a pretty normal requirement that most 
> companies want. So, in the event that the logic flows beyond 
> coo1_OnNet, we want to reset the caller id of say, 3254001 
> <Doug>, to 3254000 <Widgets Inc>. If there was a way to match 
> against a number in the dialplan, and then continue execution 
> after that point, we could put this statement at the end of 
> the coo1_OnNet context and it would all be sweet. Without 
> that, I don't have a clue how to do this... unless we stick 
> with out current 3,000 line python script.
> 
> [coo1_CallStart]
> include => coo1_OnNet
> include => syst_OnNet
> include => syst_OffNet

Instead of including your system-wide logic for offnet calling,
introduce a per-company offnet and include that instead:

[coo1_CallStart]
 include => coo1_OnNet
 include => syst_OnNet
 include => coo1_OffNet 

[coo1_OffNet]

exten => _X.,1,Set(CALLERID(NUM)=3254000)
exten => _X.,2,Set(CALLERID(NUM)=Widgets Inc.)
exten => _X.,3,Goto(syst_OffNet,${EXTEN},1)


The rest of this can stay untouched.


> [coo1_OnNet]
> 
>     exten => 3254101,1,Dial(SIP/3254101,20,tr)
>     exten => 3254102,1,Dial(SIP/3254102,20,tr)
>     exten => 3254103,1,Dial(SIP/3254103,20,tr)
> 
>     exten => 1000,1,Answer
>     exten => 1000,2,Wait(1)
>     exten => 1000,3,NoOp(${FOO})
> 
> [syst_OnNet]
> include => coo1_OnNet
> include => coo2_OnNet
> 
> [syst_OffNet]
> exten => _X.,1,Dial(SIP/11${EXTEN}@pstngw1,180,tr)

Regards,
- Brad
The contents of this e-mail are intended for the named addressee only. It contains information that may be confidential. Unless you are the named addressee or an authorized designee, you may not copy or use it, or disclose it to anyone else. If you received it in error please notify us immediately and then destroy it. 


More information about the asterisk-users mailing list