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

Douglas Garstang dgarstang at oneeighty.com
Wed Dec 20 09:21:43 MST 2006


> -----Original Message-----
> From: Andreas Sikkema [mailto:andreas.sikkema at bbeyond.nl]
> Sent: Wednesday, December 20, 2006 9:08 AM
> To: Asterisk Users Mailing List - Non-Commercial Discussion
> Subject: RE: [asterisk-users] Match a Numer - then continue with
> dialplan
> 
> 
> > [snip]
> > > > 
> > > > [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)
> > 
> > Bradley, If I do this, then I can no longer continue with 
> > further extensions in my dialplan as Asterisk has already 
> > matched a number. I still need to check black/white lists, 
> > set pic codes and rate centers, 4 digit extensions etc within 
> > the company context. I just need to set the caller id and 
> > then move on. If I goto over to ${EXTEN} within syst_OffNet, 
> > I'd have to put ALL this logic within that extension, which 
> > would mean potentiall several hundred priorities. Asterisk 
> > really does need a way to match a number, execute some code, 
> > and then go back to looking for extensions.
> 
> Why not do something like this (in pseudo dialplan):
> 
> <matching and initial dialplan stuff>
> <decide the outgoing callerid should change>
Ok...

> SetVar(outgoing_callerid=1234567)
Bzzt. In order to call SetVar, I have to match the extension dialled. When that happens, there is NO WAY to continue searching the dialplan after that point for another extension to match.

> <continue with dialplan and do all kinds of weird things>
Can only continue within the current proirity... which means that at this point, all my further logic has to be coded as priorities in the extension that called SetVar. Seeing as though I have several dozen more contexts to include, this isn't feesible.

> Set(CALLERID(NUM)=${outgoing_callerid})
> Dial(outgoing destination)
> 
> This will not screw up your extesnions matching, but you will 
> need to check that outgoing_callerid has been filled before setting 
> callerid (or make sure it is always filled with something sensible).
Thanks for trying.



More information about the asterisk-users mailing list