Multiple sip accounts same provider doesn't work

Hi!
My asterisk version is the latest:

Asterisk 1.6.2.13 built by root @ office on a x86_64 running Linux on 2010-09-17 10:47:51 UTC

and I figured out, registering multiple SIP Accounts from one provider, leads that all calls are routed to the context, which was assigned to the 1st account, asterisk registered itself.

So, when a call for “3349322e1” comes inside, asterisk tells me on the console (verbose 10) that ‘3349322e1’ wasn’t found which by information is true, but logically false because the accounts had been assigned to different context.

If I register comment out any of the other accounts, or let asterisk at first register the account with the context ‘tamertelein’ and the other accounts afer, all calls want to be routed, (independently which context is listed in the other accounts) in the context of the 1st account that registered.

And, asterisk is telling me, that all calls from all 3 accounts, come from the remote sip account which registered at 1st, which is for me very strange.

Any ideas how to solve it? Here the error, and the configs!

[Sep 21 11:32:30] NOTICE[21215]: chan_sip.c:20200
handle_request_invite: Call from ‘3349322e0’ to extension '3349322e1’
rejected because extension not found in context ‘mamatelein’.

sip.conf:

register = 3349322e0:xxxxxxx@sipgate.de/3349322e0
register = 3349322e1:xxxxxxx@sipgate.de/3349322e1
register = 3349322e2:xxxxxxx@sipgate.de/3349322e2

sipgate
type=friend
fromdomain=sipgate.de
host=sipgate.de
insecure=invite ; otherwise I get authentication errors
nat=yes
secret=xxxxxxx
caninvite=no
canreinvite=no
allow=alaw
allow=ulaw
allow=speex
allow=g729
dtmfmode=rfc2833

3349322e0
username=3349322e0
fromuser=3349322e0
context=mamatelein

3349322e1
username=3349322e1
fromuser=3349322e1
context=tamertelein

3349322e2
username=3349322e2
fromuser=3349322e2
context=tamertelein

extensions.ael:
context mamatelein {
3349322e0 => {
Dial(SIP/2002,r);
Hangup;
}
}

context tamertelein {
3349322e[12] => {
Dial(SIP/2000,r);
Hangup;
}
}

Hi

In this case send all the sipgate numbers to one context and sort them out they as they are all distinct extensions.
3349322e0
username=3349322e0
fromuser=3349322e0
context=sipgatein

[sipgatein]
exten => _3349322e0,1,Goto(mamatelein,3349322e0,1)
exten => _3349322e[1,2],1,Goto(tamatelein,3349322e0,1)

for example

Hi ianplain!
Thank you for the advise, And specially this is from my side not desired and doesn’t solve the problem!

Of course I do that right now, but that causes that 2 calls at the same time are not possible to come inside, because asterisk tells that everything would go through 3349322e0, which is simply not true, because at the side of the provider the PMX channels are mapped to the 3 different accounts.

And as you know either, SIP does not multiplexing. So, in this case the problem is not solved, by forwarding the call to a different context by extension is more or less only a temporary solution.

Tamer

Hi

Firstly i made a typo

[sipgatein]
exten => _3349322e0,1,Goto(mamatelein,3349322e0,1)
exten => _3349322e[1,2],1,Goto(tamatelein,3349322e0,1)

should be

[sipgatein]
exten => _3349322e0,1,Goto(mamatelein,3349322e0,1)
exten => _3349322e[1,2],1,Goto(tamatelein,${EXTEN},1)

Secondly, This method does work and is used extensively on ALL our customer servers when using ITSP 's that use this method.
UK SIpgate for example.

Ian

Hi Ianplan,
I admit that I made a mistake.

First, SIP protocoll is multiplexing, which means to receive several calls at the same time is possible. So, letting anything fall in one context works. That’s fine and good!

About the BUG:
Still it is a bug. because all shown on the console to the 1st sip registrar, instead to the right registrar.

I figured out, that this bug could be overcome (until it’s solved) to make the register command to 3 different IP-Addresses or domains fo the provider.

And the context command:

_3349322e[1,2],1,Goto(tamatelein,${EXTEN},1)

should be:
_3349322e[12],1,Goto(tamatelein,${EXTEN},1)

thanks for your helpfull advise, testing it out completly.

I will make a bug report and see it to be closed, that several register commands is “sip.conf” are executed correctly, even if they do register themselves at the same domain / ipaddress of the server.

Tamer

I believe the official Digium line is that this is not a bug.