Multiple context

Hi guys,

 Is there a way to give a multiple context for a user.

If i give context one below one asterisk takes last defined context. Please help me to fox this issue i need a common user to support multiple user in different context.

Thanks.

Please show your configuration as it is not clear what you are saying.

The initial context for a SIP “user” is set in the sip.conf entry that matches the user name. GoTo’s in the dialplan can change this.

I have created the user , to support multiple context

[9854]
type=friend
host=dynamic
username=9854
secret=adgadg
dtmfmode=rfc2833
disallow=all
allow=ulaw,alaw
nat=yes
qualify=yes
transport=udp
context=internal
context=external
context=outside

It takes only the last defined context, it does not take other two contexts.

Thanks,

Assign a single context in sip.conf and then based on the validations you can route the users to other contexts like as below

[landing_context]
exten => _X.,1,GotoIf($["${CALLERID(number)}" = “09876543210”]?success,s,1:failure,s,1)

[success]
exten => s,1,NoOp(${CALLERID(number)})

[failure]
exten => s,1,NoOp(${CALLERID(number)})

Or define a context for the user and “include =>” the other contexts into that.

This is not issue. This is standart for asterisk, because endpoint must have only one input point. Just imagine how you want to route call for this? when you have multiple context?

So you can not define multiple contexts. If you define multiple - as you see the last defined will be as defined.

Only route from dialplan (Goto(), GotoIf(), GotoIfTime() Dial(local/@) may be used for context changing.