Multiple accounts with same ip

Hello

I have a customer with a pbx hosting several companies. He wishes to register onto my asterisk box to route outgoing calls.

So he registers multiple times with the same ip, with different usernames (one per company). The registration process goes fine, a sip show peers shows the multiple accounts with the correct ip.

However, when making a call, I get the infamous 'username mismatch, have digest has

xxx & yyy being valid credentials.

Here is the template for the sip.conf entries (Asterisk 1.6.1.20)
[xxxx]
type=friend
defaultuser=xxx
accountcode=xxx
regexten=xxx
amaflags=billing
secret=xxx
nat=yes
dtmfmode=RFC2833
qualify=no
disallow=all
allow=g729
host=dynamic
context=phone

Any ideas on how to manage this ?

Rgds,

J.

He should have “insecure=invite”.

A better solution is to provide a single direct in dialing trunk, and have him deal with apportioning the costs.

I do agree with your suggestion, but unfortunately, my customer doesnt :frowning: !

I’ve tried and it partially works. The call gets connected, but I get a real strange behaviour…

Variables ${accountcode} and ${callerid} are correctly set, but a variable set with setvar is not (it always default to one value of the accounts). later on, the call goes through A2Billing for processing, and the incorrect account is used !!
The value of the custom variable shows correctly with a sip show peer xxx

any idea why this would happen ? Asterisk version is 1.6.1.20

rgds

J.

The main problem is that on the incomming call, Asterisk authenticates on the basis of the source IP address instead of the username (username should have priority before the IP address, but this is not the case). I think a lot of users do not like this behaviour at all, but nothing is done in the direction of fixing this issue.