Assigning two contexts to one device


#1

Is it possible?

I’m reading Asterisk: The Definitive Guide and the question opos up when looking at the next dialplan example:

[b]
[globals]
LEIF=SIP/0000FFFF0001
JIM=SIP/0000FFFF0002
RUSSELL=SIP/0000FFFF0003

[LocalSets]
exten => 100,1,Dial(${LEIF})
exten => leif,1,Dial(${LEIF})
exten => 101,1,Dial(${JIM})
exten => jim,1,Dial(${JIM})
exten => 102,1,Dial(${RUSSELL})
exten => russell,1,Dial(${RUSSELL})

[TestMenu]
exten => 201,1,Answer()
same => n,Background(enter-ext-of-person)
same => n,WaitExten()

exten => 1,1,Dial(DAHDI/1,10)
same => n,Playback(vm-nobodyavail)
same => n,Hangup()

exten => 2,1,Dial(SIP/Jane,10)
same => n,Playback(vm-nobodyavail)
same => n,Hangup()[/b]

For example, lets say that we want to access de Menu (TestMenu) from a device (user1) that is set with the context LocalSets. Is it necessary to add the TestMenu context to this device in the correspondig .conf file aditionally to the one that is already set?

.conf file:

[user1]

context=LocalSets
context=TestMenu

Will it work if done it this way?

THANKS!


#2

Use include =>


#3

Thanks!