Asterisk 10 multiple registrations to upstream VOIP provider

I am trying to connect multiple customers to an upstream VOIP provider.
I was hoping to use multiple SIP trunks in my Asterisk 10.6.1 box.

I am converting my Asterisk 1.4 to 10.6 in the process.

in my sip.cfg file I added a second register line.

register => user1:password1@providerName
register => user2:password2@providerName

MY VOIP provided says I never get the new registration request even though I see both registrations in the
CLI>sip show registry
user 1 . . . . Registered
user 2 . . . . Registered
2 SIP registrations

I then changed the passwords to be wrong in the sip.cfg
register => user1:password1@providerName
register => user2:wrongpassword@providerName

I get the same results
CLI>sip show registry
user 1 . . . . Registered
user 2 . . . . Registered
2 SIP registrations

I remove the user 1 register command in the sip.cfg I get
CLI>sip show registry
user 2 . . . . Registered
1 SIP registrations

So it looks like eveything is OK.

The VOIP provider says that user 2 register request never happened. and the user 1 register is repeated.

Am I able to register to two different SIP providers.

any ideas how I can have multiple phone numbers (SIP accounts) to the same Asterisk Server?

How is Asterisk supposed to know the difference between incoming calls for different users, given that it matches registered peers by IP address?

The correct way of handling this sort of thing is to register yourself with the provider and then do your own call accounting for downstream users.

Thanks,

I was thinking that asterisk would act like my Polycom phones and register to the SIP server multiple times for different user names and presences like the phone does.
Each button on my polycom phone registers to a different sip account on the server and the phone has a common IP address.
I was not sure if asterisk 10 did the same thing or not.

I am not able to send two different registrations to the upstream server using the register command in sip.cfg, maybe a bug.

I tried different port number for each SIP client on Asterisk 10 thinking the VOIP provider could return responses on a different port.= for each account.

But that didn’t work.

Customer like buying the services from a company other than me for a variety of reasons, so that is why we have different accounts for each of the customers. They also fall behind in payments and I don’t want to deal with that crap.

I thought I understood SIP, but maybe this provider limits access to one IP address for each account. I thought the user and other info are in the SIP messages which the VOIP provider knows and Asterisk can figure out for multiple accounts, because it does it for the Polycom phones.

Oh Well.

To discriminate between multiple registrations for the same IP address, you would need to use the destination URL. In your case, you would probably have the ITSP forward the number as a direct in dialed number. The phone is probably registering with a callback address, which you can do by putting it, after a /, at the end of register line. In all cases, only the first sip.conf entry will match, and you will need to use the dialplan to discriminate.

However, the ITSP should accept multiple registration for the same address (in one case, we do this with a PABX (not an ITSP)). It is possible that their database structure needs to key to the IP address, or that they do it deliberately, to stop the sort of multiplexing you are doing, or so that registrations from dynamic addresses are wiped out quickly if a new customer takes over the address.

You would need to provide the actual register packets and responses so see if Asterisk was doing anything wrong.

Thanks:

I did a lot of Wireshark traces and the like.

I found that Asterisk does send the REGISTER packets for both accounts to the voip provider, in this case Teliax.

Teliax prefers one over the other and will only direct calls through for the fisrt register command.

I added the phone number after the slash in the register => command. It did make it easier to trace to dialplan.

When I removed the REGISTER => command for the first nunber (the dominant one) the second number was routed properly to my asterisk box.

When I added the first one, The second number was routed with the DID number/URI from the first entry as seen in the traced packet for the INVITE.

Eventually as the registration times out for the second registration, the number wasn’t routed.

So I think Teliax is locking to IP address with one account per IP Address.

Will see if they adjust for little ole me, or time for a different provider.

Thanks, was a fun project.