Ronald Wiplinger
2006-Jul-02 08:24 UTC
[Asterisk-Users] How to continue after a match in an include
I am looking for a way that after a successfully match in one include the next include is still visited. The first include should just set some variables. I tried to number this extension block either with _. or with s and since it matches, the function (setting some variables) have been done. After that, I want to go to the next include, which has a match for _91NNN. However, since the first match was already successful, the next includes are not visited anymore. How can I overcome this problem? bye Ronald Wiplinger
Create a context that is the one that you want the dialplan to visit last, and dont include this context anywhere, then in the first context create a line that has a goto statement, something like this: [default] include => 1stcontext [1stcontext] exten => _.,1,Set(MYVAR=123${EXTEN}) exten => _.,2,Goto(2ndcontext,${EXTEN}),1) [2ndcontext] exten => _91NNN,1,Noop(We set this to: ${MYVAR}) if you dial 91222 you should see in the console: We set this to: 12391222 Hope this helps. On 7/2/06, Ronald Wiplinger <ronald@elmit.com> wrote:> I am looking for a way that after a successfully match in one include > the next include is still visited. > > The first include should just set some variables. > I tried to number this extension block either with _. or with s > and since it matches, the function (setting some variables) have been done. > After that, I want to go to the next include, which has a match for > _91NNN. > However, since the first match was already successful, the next includes > are not visited anymore. > > How can I overcome this problem? > > > bye > > Ronald Wiplinger > _______________________________________________ > --Bandwidth and Colocation provided by Easynews.com -- > > Asterisk-Users mailing list > To UNSUBSCRIBE or update options visit: > lists.digium.com/mailman/listinfo/asterisk-users >
Kevin P. Fleming
2006-Jul-19 10:57 UTC
[Asterisk-Users] How to continue after a match in an include
----- Ronald Wiplinger <ronald@elmit.com> wrote:> The first include should just set some variables. > I tried to number this extension block either with _. or with s > and since it matches, the function (setting some variables) have been > done. > After that, I want to go to the next include, which has a match for > _91NNN. > However, since the first match was already successful, the next > includes > are not visited anymore.Start the priority in the second 'included' context at 10 (for example), instead of 1, and then put priorities 1 through 9 in the first context (even if you have to put NoOp()s in there to use up all the priorities). -- Kevin P. Fleming Senior Software Engineer Digium, Inc.