If I set the type=user, my registration fails. The fromuser-option doesn’t make any difference.
Right now, I’m at the office again so I can actually check out more. I’m working at a provider and we use an Asterisk 1.4 machine to give VoIP to our customers. Customers are stated as “friend” and with a username+password they can connect to our VoIP-system. We are basically a VoIP-switch for we’re sending it all to our carrier, so no heavy PBX stuff done. Register a client, do some billing and then forward it directly to our upstream carrier.
The problem now is that we have customers who have multiple accounts (e.g. AccountA and AccountB) and only 1 PBX where they put both accounts in. For us, both accounts are coming from the same IP address and the same port. The only difference is within the REGISTER (different username/pass obviously) and whenever they make an INVITE we ask them to do an authorization as well. So, on every INVITE there’s an unique username/password again.
REGISTERING both accounts work flawless. They both are considered online and incoming phonecalls do work. The problem is outgoing phonecalls.
It seems that the first registered account (despite the authorization) is being remembered.
AccountA and AccountB are both online, AccountA makes INVITE and works, AccountB makes INVITE and it gives back a 401 Unauthorized to the customer (and in the logging it says
[quote]
chan_sip.c: username mismatch, have , digest has [/quote]
On an Asterisk 1.8.10 using the same settings, it works. On the 1.4.34, it doesn’t.
Here’s an example of the SIP user config (we’re having the whole configuration inside a MySQL database, sorry for the layout thing. csv can be made as well)
id pid customer name accountcode amaflags callgroup callerid canreinvite context defaultip dtmfmode fromuser fromdomain fullcontact host insecure language mailbox md5secret nat deny permit mask pickupgroup port qualify restrictcid rtptimeout rtpholdtimeout secret type username disallow allow musiconhold regseconds ipaddr regexten cancallforward lastms t38pt_udptl t38pt_usertpsource setvar senddnid maxchannels
1452 NULL Customer A accountA accountA NULL NULL NULL no customers NULL NULL NULL pbx.signet.nl sip:accountA@172.16.255.5:5060 dynamic NULL NULL NULL NULL yes NULL NULL NULL NULL 40532 yes NULL NULL NULL password friend accountA all alaw;ulaw;gsm;g729 NULL 1338365192 9xx.xxx.xxx.xx accountA no 74 NULL NULL y 4
3254 NULL Customer B accountB accountB NULL NULL NULL no customers NULL NULL NULL pbx.signet.nl sip:accountB@172.16.255.5:5060 dynamic NULL NULL NULL NULL yes NULL NULL NULL NULL 40532 yes NULL NULL NULL password friend accountB all alaw;ulaw;gsm;g729 NULL 13365345 9xx.xxx.xxx.xx accountB no 74 NULL NULL y 1
So, when account B dials out (while both registered, online and having the good credentials), it simply will be denied on Asterisk 1.4.34. My question is, will this work on a newer Asterisk 1.4.xx or can I get this working withing version 1.4.34 ?
Again, it does work on 1.8.10 using these exact settings.