[asterisk-users] priority problem
Steve Davies
davies147 at gmail.com
Thu Jul 13 01:50:56 MST 2006
On 7/13/06, unplug <maillisting at 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
More information about the asterisk-users
mailing list