Multiple IP phones for one SIP

Hello! I would like ask you how can I prevent secondary registration of IP Phone. If I register 2nd phone, they both will be registered and both can make outgoing calls. Incoming calls gets only one of them (in my case first one). So I would like prevent secondary registration. I could send XML push for second phone with text message like “this username is busy now”, but asterisk anyway accept this registration. By the way they (IP phones) shouldn’t binded to static IP. Just need some way to tell second IP phone “denied” on registration if this SIP is ON already or sort of.

Can you help me?

P.S. I do not use Users, only SIP configuration. Phones model “Fanvil C62”

If using chan_pjsip you can configure the AOR to reject such a thing by limiting it to a single contact and not enabling remove_existing. This does mean, however, that if the registered phone changed IP address or port it would not be able to re-register until the old IP address and port expired. This is because there’s nothing guaranteed in the messaging to identify the device except the authenticated username/password.

1 Like

Thank you so much for your help (for all my questions). But, I use only common SIP (chan_sip), without pjsip. Is there a way do same there?

The chan_sip channel driver does not have any functionality to allow that.

Okay, maybe then I can somehow by CLI command drop connection of IP phone? And then I could send XMLPush to second phone with notification.

It’s probably UDP which is not connection based. The REGISTER merely updates the address on the SIP peer. You would need to store the previous address, remove the new one, put the previous address back. I don’t know of a way to do that with chan_sip. You’d also have to know that it was happening and which phone should really be registered.

Ultimately you don’t want two phones using the same account on chan_sip and registering.

1 Like

chan_sip doesn’t allow multiple registrations. I think what you are seeing is the result of using type=friend. For outgoing calls from the devices, the registration is being ignored and they are being matched purely on From:.

The ability to have multiple registrations is actually something that quite a few people were demanding, and, I believe, is met by pjsip.

If second phone registered by same SIP number, SIP list in CLI shows new IP address. If second phone logout and make SIP free, first one still able to make outgoing calls, BUT in CLI (sip show peers) its with “(Unspecified)” IP and Status is “OK (4 ms)”. BUT it can no longer take incoming calls. Asterisk automatically made him “unavailable”. “core reload” or “sip reload” doesn’t help. And it still able to make outgoing calls. This weird.

And I would like ask you, maybe there is a way to update (reload) data in Asterisk to bring first phone back (for Asterisk) as soon as possible without logout-login in phone menu? This may cause so many troubles in future for company telephony system (I should be ready to meet dumb agents)… And I’m not ready to jump to pjsip from common sip yet, just have not enought time to figure it (configs) out.

P.S. while I was writting this, I got message in CLI:
[Sep 22 09:12:09] NOTICE[3512]: chan_sip.c:23869 handle_response_peerpoke: Peer ‘9997’ is now Reachable. (6ms / 2000ms)
Which is great, but, actually, too late. Even if I make “qualify = 2000”. Actually it came much much later than 2 sec…

The phone should de-reigister itself when it goes offline.

I believe chan_pjsip allows concurrent registrations from multiple devices for the same address of record (chan_sip is not being significantly developed).

I believe there is a CLI command to force de-registration, but I could be wrong.

You’re right. There is “sip qualify peer <PeerName/Num>”, but is does nothing. Also there is “sip unregister <PeerName/Num>” but it won’t help me because I need to force update peer status.

I have next scheme - we have one IP phone. Then another IP phone registers with same IP num, name and secret. Asterisk gets registration of second IP phone. Then my own C# application (which listens AMI events) push XML command to 2nd phone to de-authorize phone itself and view message like “Number is busy by another phone” on phone display. I made this already. After this, we have weird situation: Asterisk thinking that nobody registered on this SIP number and see this SIP as unreachable. And after some random delay (even few minutes even with sip parameter “qualify = 2000” and my last test it didn’t come for 5 mins and still same situation) it gets event “PeerStatus” with parameter “Reachable”. And everything is ok. So I don’t like this huge delay before it see that first phone is alive and ready because of it cannot get incoming call while Asterisk thinking it dead.

Sorry for maybe bad english. Hope you understand my point :slight_smile:

UPDATE: “Reachable” status came just now, after 20 mins. It’s TOO long… =(

Well I figured that it is NOT Asterisk issue actually. It works pretty fine (but in my vision could be better and clearly). So I just opened ip phone admin web panel and found “registration period” which was 3600 seconds. 1 hour. I’ve chaged to 30 sec and now any phone with this settings will automatically re-register every 30 seconds (if needed), and this dont make any troubles for voice conversations.

This is not the best workaround, but better than nothing. Bad thing is 50+ phones will spam these reports about registrations non-stop… Hope I will try re-config my Asterisk to pjsip.