Registering multiple accounts on same sip provider

Hi all,

I am trying to register my astersik box on my sip provider with 2 different accounts. Actually the accounts are registering very well. The problem that I want to place incoming calls from each account to a different context. But with my actual configuration wherever the call comes from they are routed to the same context. I suppose it is because I have the same hostname in the 2 contexts.

This is my sip.conf :

[general]
port=5060
register => user1:password1@myprovider.com
register => user2:password2@myprovider.com

[myprovider_incoming1]
type=peer
host=myprovider.com
context=from_myprovider_1
nat=yes
canreinvite=no

[myprovider_incoming2]
type=peer
host=myprovider.com
context=from_myprovider_2
nat=yes
canreinvite=no

[myprovider_out1]
type=peer
host=myprovider.com
user=user1
secret=password1
fromuser=user1
fromdomain=myprovider.com
nat=yes
canreinvite=no

[myprovider_out2] ; configuration des appels sortants par ippi
type=peer
host=myprovider.com
user=user2
secret=password2
fromuser=user2
fromdomain=myprovider.com
nat=yes
canreinvite=no

Thanks to all

Not sure if this helps, but here is the configuration suggested by voiptalk:

voiptalk.org/products/asteri … g-sip.html

Unless you want to handle calls from each line differently, I recommend that you create only one context for a VoSP to share many lines from the same VoSP. This will make management easier.

Try put the destination extension at the end of the register statement, in the extension then jump to a different context with Goto():

register => 05751781234:yyyyyyyy@voip.eutelia.it/05751781234
register => 05751785678:zzzzzzzz@voip.eutelia.it/05751785678

Cheers.

Marco Bruni

Hi,

Thanks you Marco it did it.

Cheers,
Nacef

mbruni is right, and I may add this to the Asterisk GUI section.

When you register to the provider with a specific username and password, you can register your extension (in which Asterisk will route it correctly either to the same context, and different DID, or completely seperate contexts)

-bk