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

[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/[EMAIL PROTECTED],180,tr)



~                                              


> -----Original Message-----
> From: Douglas Garstang 
> Sent: Tuesday, December 19, 2006 2:46 PM
> To: Asterisk Users Mailing List - Non-Commercial Discussion
> Subject: [asterisk-users] Match a Numer - then continue with dialplan
> 
> 
> Anyone know if there's a way to match a dialplan extension, 
> execute some code, say set a variable, and then continue with 
> the dialplan?
> 
> I want to set a variable when the dialplan flows beyond a 
> certain context. This would be a great feature.
> 
> Doug.
> _______________________________________________
> --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
> 
_______________________________________________
--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

Reply via email to