In dial plan, we can set the priority. However, I find that the priority count is a global value. It will continue to increment no matter in different context. Below is what I have tried. -------------------------------- In extension.conf [testflow] exten => _X.,1,NoOp(testflow,1=${CALLERID(NUM)}) exten => _X.,2,NoOp(testflow,2=${CALLERID(NUM)}) include => testflow1 include => testflow2 include => testflow3 [testflow1] exten => _X.,1,NoOp(testflow1,1=${CALLERID(NUM)}) exten => _X.,2,NoOp(testflow1,2=${CALLERID(NUM)}) exten => _X.,3,NoOp(testflow1,3=${CALLERID(NUM)}) [testflow2] exten => _X.,1,NoOp(testflow2,1=${CALLERID(NUM)}) exten => _X.,2,NoOp(testflow2,2=${CALLERID(NUM)}) exten => _X.,3,NoOp(testflow2,3=${CALLERID(NUM)}) exten => _X.,4,NoOp(testflow2,4=${CALLERID(NUM)}) [testflow3] exten => _X.,1,NoOp(testflow3,1=${CALLERID(NUM)}) exten => _X.,2,NoOp(testflow3,2=${CALLERID(NUM)}) exten => _X.,3,NoOp(testflow3,3=${CALLERID(NUM)}) exten => _X.,4,NoOp(testflow3,4=${CALLERID(NUM)}) exten => _X.,5,NoOp(testflow3,5=${CALLERID(NUM)}) ------------------------------- result in the log -- Executing NoOp("SIP/871966760539-4467", "testflow|1=871966760539") in new stack -- Executing NoOp("SIP/871966760539-4467", "testflow|2=871966760539") in new stack -- Executing NoOp("SIP/871966760539-4467", "testflow1|3=871966760539") in new stack -- Executing NoOp("SIP/871966760539-4467", "testflow2|4=871966760539") in new stack -- Executing NoOp("SIP/871966760539-4467", "testflow3|5=871966760539") in new stack As you can see in context of testflow1 and afterward, the priority start is 3 instead of 1. Is the the correct sequence of priority execution? Can I reset it to run the priority 1 in every context?
On 7/13/06, unplug <maillisting@gmail.com> wrote:> In dial plan, we can set the priority. However, I find that the > priority count is a global value. It will continue to increment no > matter in different context. Below is what I have tried.This is exactly how it is designed, and is a very useful feature. You need to understand the matching order properly to appreciate to power of this type of evaluation, but I believe the solution to your particular question is Goto, and not include. [testflow] exten => _X.,1,NoOp(testflow,1=${CALLERID(NUM)}) exten => _X.,2,NoOp(testflow,2=${CALLERID(NUM)}) exten => _X.,3,Goto(testflow1,${EXTEN},1) ... Each context has its own "exten =>" lines checked first, and then each "include =>" is checked in the order specified after that. Consider using Macros too, they will often shorten a dialplan. Cheers, Steve
Thanks. Could you tell me how useful it is? As I think if the priority is reset in every context. I can design something like this. My default context is myflow and your default context is yrflow. So I can easy to delete a context in the context myflow if necessary. [myflow] include => testflow1 include => testflow2 include => testflow3 [yrflow] include => testflow1 include => testflow3 [testflow1] exten => _X.,1,NoOp(testflow1,1=${CALLERID(NUM)}) [testflow2] exten => _X.,1,NoOp(testflow2,1=${CALLERID(NUM)}) exten => _X.,2,NoOp(testflow2,2=${CALLERID(NUM)}) [testflow3] exten => _X.,1,NoOp(testflow3,1=${CALLERID(NUM)}) exten => _X.,2,NoOp(testflow3,2=${CALLERID(NUM)}) exten => _X.,3,NoOp(testflow3,3=${CALLERID(NUM)}) On 7/13/06, Steve Davies <davies147@gmail.com> wrote:> On 7/13/06, unplug <maillisting@gmail.com> wrote: > > In dial plan, we can set the priority. However, I find that the > > priority count is a global value. It will continue to increment no > > matter in different context. Below is what I have tried. > > This is exactly how it is designed, and is a very useful feature. > > You need to understand the matching order properly to appreciate to > power of this type of evaluation, but I believe the solution to your > particular question is Goto, and not include. > > [testflow] > exten => _X.,1,NoOp(testflow,1=${CALLERID(NUM)}) > exten => _X.,2,NoOp(testflow,2=${CALLERID(NUM)}) > exten => _X.,3,Goto(testflow1,${EXTEN},1) > ... > > Each context has its own "exten =>" lines checked first, and then each > "include =>" is checked in the order specified after that. Consider > using Macros too, they will often shorten a dialplan. > > Cheers, > Steve > _______________________________________________ > --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 >
On 7/13/06, unplug <maillisting@gmail.com> wrote:> Thanks. Could you tell me how useful it is? As I think if the > priority is reset in every context. I can design something like this. > My default context is myflow and your default context is yrflow. So > I can easy to delete a context in the context myflow if necessary. > > [myflow] > include => testflow1 > include => testflow2 > include => testflow3 > > [yrflow] > include => testflow1 > include => testflow3 > > [testflow1] > exten => _X.,1,NoOp(testflow1,1=${CALLERID(NUM)}) > > [testflow2] > exten => _X.,1,NoOp(testflow2,1=${CALLERID(NUM)}) > exten => _X.,2,NoOp(testflow2,2=${CALLERID(NUM)}) > > [testflow3] > exten => _X.,1,NoOp(testflow3,1=${CALLERID(NUM)}) > exten => _X.,2,NoOp(testflow3,2=${CALLERID(NUM)}) > exten => _X.,3,NoOp(testflow3,3=${CALLERID(NUM)}) >To get what you want to do, I would rewrite it something like this (There may be better ways, I just spent 5 seconds on this ;) ): [myflow] exten => _X.,1,Macro(testflow1) exten => _X.,2,Macro(testflow2) exten => _X.,3,Macro(testflow3) [yrflow] exten => _X.,1,Macro(testflow1) exten => _X.,2,Macro(testflow3) [macro-testflow1] exten => s,1,NoOp(testflow1,1=${CALLERID(NUM)}) [macro-testflow2] exten => s,1,NoOp(testflow2,1=${CALLERID(NUM)}) exten => s,2,NoOp(testflow2,2=${CALLERID(NUM)}) [macro-testflow3] exten => s,1,NoOp(testflow3,1=${CALLERID(NUM)}) exten => s,2,NoOp(testflow3,2=${CALLERID(NUM)}) exten => s,3,NoOp(testflow3,3=${CALLERID(NUM)}) "include =>" is a continue-until-matched type of contruct. "Macro()" is a re-use-of-code construct. Steve
Thanks again. But I want to ask what is the usage of include if it is a continue-until-matched type of contruct. On 7/13/06, Steve Davies <davies147@gmail.com> wrote:> On 7/13/06, unplug <maillisting@gmail.com> wrote: > > Thanks. Could you tell me how useful it is? As I think if the > > priority is reset in every context. I can design something like this. > > My default context is myflow and your default context is yrflow. So > > I can easy to delete a context in the context myflow if necessary. > > > > [myflow] > > include => testflow1 > > include => testflow2 > > include => testflow3 > > > > [yrflow] > > include => testflow1 > > include => testflow3 > > > > [testflow1] > > exten => _X.,1,NoOp(testflow1,1=${CALLERID(NUM)}) > > > > [testflow2] > > exten => _X.,1,NoOp(testflow2,1=${CALLERID(NUM)}) > > exten => _X.,2,NoOp(testflow2,2=${CALLERID(NUM)}) > > > > [testflow3] > > exten => _X.,1,NoOp(testflow3,1=${CALLERID(NUM)}) > > exten => _X.,2,NoOp(testflow3,2=${CALLERID(NUM)}) > > exten => _X.,3,NoOp(testflow3,3=${CALLERID(NUM)}) > > > > To get what you want to do, I would rewrite it something like this > (There may be better ways, I just spent 5 seconds on this ;) ): > > [myflow] > exten => _X.,1,Macro(testflow1) > exten => _X.,2,Macro(testflow2) > exten => _X.,3,Macro(testflow3) > > [yrflow] > exten => _X.,1,Macro(testflow1) > exten => _X.,2,Macro(testflow3) > > [macro-testflow1] > exten => s,1,NoOp(testflow1,1=${CALLERID(NUM)}) > > [macro-testflow2] > exten => s,1,NoOp(testflow2,1=${CALLERID(NUM)}) > exten => s,2,NoOp(testflow2,2=${CALLERID(NUM)}) > > [macro-testflow3] > exten => s,1,NoOp(testflow3,1=${CALLERID(NUM)}) > exten => s,2,NoOp(testflow3,2=${CALLERID(NUM)}) > exten => s,3,NoOp(testflow3,3=${CALLERID(NUM)}) > > "include =>" is a continue-until-matched type of contruct. "Macro()" > is a re-use-of-code construct. > > Steve > _______________________________________________ > --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 >
I use include in an other way than you do. i use different extensions, not the same in each includet context, maybe that makes more sense (to you) [apps] include => emergency include => cfwd include => mailbox [emergency] exten => 911,1,do stuff here [cfwd] exten => *31,1, enable cfwd exten => *32,1, disable cfwd [mailbox] exten => *41,1, enable mailbox exten => *42,1, disable mailbox> Thanks again. But I want to ask what is the usage of include if it is > a continue-until-matched type of contruct.
According to your setting, below is meaningless. Am I right? [apps] include => emergency include => cfwd include => mailbox [emergency] exten => 911,1,do stuff here [cfwd] exten => *31,1, enable cfwd exten => *32,1, disable cfwd exten => 911,1, do stuff2 here exten => 911,1, do stuff3 here [mailbox] exten => *41,1, enable mailbox exten => *42,1, disable mailbox On 7/17/06, Kai Ober <kast.asterisk@gmx.de> wrote:> I use include in an other way than you do. > i use different extensions, not the same in each includet context, maybe > that makes more sense (to you) > > [apps] > include => emergency > include => cfwd > include => mailbox > > > [emergency] > exten => 911,1,do stuff here > > [cfwd] > exten => *31,1, enable cfwd > exten => *32,1, disable cfwd > > [mailbox] > exten => *41,1, enable mailbox > exten => *42,1, disable mailbox > > > > Thanks again. But I want to ask what is the usage of include if it is > > a continue-until-matched type of contruct. > > _______________________________________________ > --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 >
On 7/17/06, unplug <maillisting@gmail.com> wrote:> According to your setting, below is meaningless. Am I right? > > [apps] > include => emergency > include => cfwd > include => mailbox > > [emergency] > exten => 911,1,do stuff here > > [cfwd] > exten => *31,1, enable cfwd > exten => *32,1, disable cfwd > exten => 911,1, do stuff2 here > exten => 911,1, do stuff3 here > > [mailbox] > exten => *41,1, enable mailbox > exten => *42,1, disable mailbox >Why would you want (or need) to do this? As you seem to realise already, the "do stuff2/3 here" lines will do nothing. If you were writing a shell-script, and put a comment at the start of a line it would also do nothing - Should we change that too? You seem to be un-necessarily trying to rewrite the structure provided in the extensions.conf file. Is there something _functional_ that you cannot do that you need to be able to do? Or is it just that you cannot lay out the file in the specific order that you want to? Perhaps if you gave a real-life example with details of what you are trying to do, it might be easier to offer a solution that suits your needs. Regards, Steve
ARA is Asterisk RealTime Architecture. Using RDBMS as a backend of the asterisk. On 7/17/06, Steve Davies <davies147@gmail.com> wrote:> > Someone here suggest to use > > macro to implement my design. As I want to use ARA in my design. If > > I use macro to here, ARA will be meaningless. > > > > Yes, I suggested macros. Sorry, what is ARA? > > Steve > _______________________________________________ > --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 >