[Asterisk-Users] Context mix-up

Thor Atle Rustad thor.rustad at gmail.com
Sat Nov 26 13:25:00 MST 2005


I have two fwd accounts, and I want them to behave differently. It
took me a while to figure out why it wouldn't work, but finally I
realized that the last definition in sip.conf is the one that steals
the show.

Simplified, I have this:

register => account1:secret at fwd.pulver.com/88
register => account2:secret at fwd.pulver.com/87

[fwdaccount1]
context = context1
host=fwd.pulver.com
.
[fwdaccount2]
context = context2
host=fwd.pulver.com
.


In extensions.conf:

[context1]
exten => 88,1,NoOp(Testing context1)

[context2]
exten => 87,1,NoOp(Testing context2)


What happens in my case, is that every call goes into the context
defined _last_ in sip.conf. So any call to account1 will be branded
context2 and fail, because extension 88 is not defined in context2.
Calls to account2 will work ok.

If the two definitions in sip.conf trade places, the whole thing will
work the other way around.

[fwdaccount2]
context = context2
host=fwd.pulver.com
.
[fwdaccount1]
context = context1
host=fwd.pulver.com
.

Calls to either account will be branded context1 and fail if account 2
was called.


If this is how it is supposed to work, the workaround must be to let
both accounts enter the same context and differentiate their behavior
based on the extension dialed. Not difficult, but I thought it would
be possible to let them have different contexts from the start.

Thor



More information about the asterisk-users mailing list