Asterisk 1.8.6.0 two customer one SIP provider

Hello.

I have two customer with one SIP provider!

cut from sip.conf

register => 22xxxx0:xxxxxxxx@sip.nxxxxxxx.xx/22xxxx0 register => 22xxxx1:xxxxxxxx@sip.nxxxxxxx.xx/22xxxx1
cut from sip.conf

[code][xxx1]
type = peer
host = sip.nxxxxxxx.xx
context = xxx1in
insecure = port,invite

[xxx2]
type = peer
host = sip.xxxxxxxx.xx
context = xxx2in
insecure = port,invite
[/code]

cut form extensions.conf

[code][xxx2in]
exten => 2xxxxx0,1,Dial…

[xxx1in]
exten => 2xxxxx1,1,Dial…
[/code]

Call for xxx2 come in “context = xxx1in” and on console i see something like:

To solve this error I put in extensions.conf

[xxx1in] include => xxx2in

The easiest option is to behave like a network service provider and have a single upstream account which you re-charge to your customers.

You need to match in user mode, or on remote port, if you you want to separate out two accounts from the same IP address, or, if they don’t register with you, use a single context for incoming calls, as you are doing.

If your insecure setting is correct, you cannot match on port. However it is more likely that someone has been lazy and told you to open the system more than necessary, because that is slightly more likely to work than the maximally safe setting. In most cases, if insecure is needed, it should be “insecure=invite”.