AGAIN: Multiple phones registering with same extension

I know this question has been asked many times and I’ve not seen a good answer so far.
My situation is slightly different because [color=#008000]all my ten Cisco 7960 phones share more or less the same 6 extensions[/color].

[color=#FF0000]I’m trying to switch from SipXecs to Asterisk.[/color]

You’re going to ask why:
SipXecs does not work with multiple ethernet ports on the computer (eth0 and eth1), so now my phones and all my computers reside on the same ethernet segment. Since I don’t have expensive swtiches, I can’t create VLANs and manage bandwidth…

My use case:
I work from home so I’m using my PBX at home. Both my work and personal phones and phone lines are sharing the same SipXecs PBX. Since this is a HOME systems, the users (the family members) can answer on almost any phones in the house. Each member has an extension and a voicemail. Since the kids are in their late teens, they live at different hours then we do hence the kid’s extensions are not programmed on our bedroom phone and vice-versa.

SipXecs does allow multiple phones to simultaneously register with the same sip account, I guess SipXecs uses [ IP : SIP/user] as a primary key, unlike asterisk where a new [ SIP/user ] registration at a different IP will only REPLACE the last registration and only the last registered phone will ring, not both phones as one would expect.

[color=#BF0000]Is there a configuration method (other than GHOST extensions) to setup my Asterisk the same way it is with SipXecs?[/color]
The ghost extension method is “almost acceptable” if you have one or maybe 2 exceptions like that. But for me EVERY single phone is setup this way. I’ve seen an answer using the FreePBX front end, but I was unable to install it on my Asterisk because it expects an asterisk database in mysql. I have mysql running, but there are no asterisk databases and I’ve installed both Asterisk and FreePBX… So I was unable to test and duplicate the configuration FreePBX would have done.

This is a cut and paste of my SipXecs management screen showing that multiple phones are registered at the same time with the same extensions. And they all ring at the same time when a particular extension is dialed. This setup work great except for the bandwidth management.
[color=#800080]URI Contact Expiration [s] Phone
sip:200@politick.ca sip:200@192.168.10.103:5060;transport=udp;x-sipX-nonat 3117 urn:uuid:00000000-0000-0000-0000-000af4f8548e
sip:222@politick.ca sip:222@192.168.10.103:5060;transport=udp;x-sipX-nonat 1535 urn:uuid:00000000-0000-0000-0000-000af4f8548e
sip:200@politick.ca sip:200@192.168.10.101:5060;transport=udp;x-sipX-nonat 1231 urn:uuid:00000000-0000-0000-0000-0007509818d4
sip:222@politick.ca sip:222@192.168.10.101:5060;transport=udp;x-sipX-nonat 2776 urn:uuid:00000000-0000-0000-0000-0007509818d4
sip:233@politick.ca sip:233@192.168.10.101:5060;transport=udp;x-sipX-nonat 59 urn:uuid:00000000-0000-0000-0000-0007509818d4
sip:202@politick.ca sip:202@192.168.10.101:5060;transport=udp;x-sipX-nonat 2755 urn:uuid:00000000-0000-0000-0000-0007509818d4
sip:233@politick.ca sip:233@192.168.10.103:5060;transport=udp;x-sipX-nonat 596 urn:uuid:00000000-0000-0000-0000-000af4f8548e
sip:222@politick.ca sip:222@192.168.10.107:5060;transport=udp;x-sipX-nonat 1819 urn:uuid:00000000-0000-0000-0000-001930c954c2
sip:203@politick.ca sip:203@192.168.10.107:5060;transport=udp;x-sipX-nonat 2780 urn:uuid:00000000-0000-0000-0000-001930c954c2
sip:201@politick.ca sip:201@192.168.10.103:5060;transport=udp;x-sipX-nonat 534 urn:uuid:00000000-0000-0000-0000-000af4f8548e
sip:203@politick.ca sip:203@192.168.10.103:5060;transport=udp;x-sipX-nonat 1299 urn:uuid:00000000-0000-0000-0000-000af4f8548e
sip:202@politick.ca sip:202@192.168.10.103:5060;transport=udp;x-sipX-nonat 942 urn:uuid:00000000-0000-0000-0000-000af4f8548e
"Famille 222"sip:222@politick.ca sip:222@192.168.10.30:5060;x-sipX-nonat 14
"Martin"sip:233@politick.ca sip:233@192.168.10.30:5060;x-sipX-nonat 12
"Nathalie"sip:201@politick.ca sip:201@192.168.10.30:5060;x-sipX-nonat 300
"Kasandra"sip:202@politick.ca sip:202@192.168.10.30:5060;x-sipX-nonat 138
"Lauriane"sip:203@politick.ca sip:203@192.168.10.30:5060;x-sipX-nonat 151
"PeckTech"sip:200@politick.ca sip:200@192.168.10.30:5060;x-sipX-nonat 297
sip:201@politick.ca sip:201@192.168.10.101:5060;transport=udp;x-sipX-nonat 1099 urn:uuid:00000000-0000-0000-0000-0007509818d4
sip:203@politick.ca sip:203@192.168.10.101:5060;transport=udp;x-sipX-nonat 2277 urn:uuid:00000000-0000-0000-0000-0007509818d4[/color]

The multiple registration mechanism doesn’t seem to me to be how SIP was intended to work.

With Asterisk, the important thing to understand is that the thing with a handset is not an extension. The dialplan can map an extension to many such devices either using & notation, or using queues.

I don’t know what a GHOST extension is. For my only guess, all Asterisk extensions are GHOST ones, as it is only coincidental (and considered bad security practice) if device names and extensions are aligned.

I didn’t design the SIP protocol, but usually a protocol is just a protocol. It tries to be as flexible and as efficient as possible while delivering a set of convenient services. It does not dictate a means of use, that’s up to the implementation.

And since SipXecs delivers this functionality reliably (I mean phones don’t drop registrations, it’s not a fluke that it works), it would almost look like if SIP was intended to work that way. (And that’s why I keep on talking about this particular SipXecs example, because many posts in the past were [color=#800000]killed [/color]on that premise: “[color=#800000]It’s not meant to work this way[/color]”)

[color=#408000]Multiple registrations looks like a good feature to me.[/color] I have multiple computers throughout the house and I can use Google talk or Skype on any of them without having to re-register on the computer I currently use. If I’m on the road and I use my smart phone to SIP register at home, I wouldn’t want it to unregister my hard phones at home. I don’t want to have to think to reboot my hard phones when I step in. I mean face it, this is the only way Asterisk can be compatible with mobile services people will expect of a PBX / communication engine…

I found the article, the person (Eric) actually called them Phantom… my mistake. Here’s the article:
http://eric.lubow.org/2008/system-administration/asterisk-pbx/1-extension-multiple-phones/

The problem with this approach is that if I have 10 phones and I have 6 SIP accounts (4 family members + 2 work related)
then I need to create 60 entries in sip.conf. Templates can simplify the task a bit, but the maintenance is a real nightmare. Maybe if there was support for “for loops” and “arrays” in the Asterisk language (I would have used that), but I believe a simple multiple SIP registration based on the IP/SIP recombination would be a rather elegant and simple fix for the problem.

I’ve been in the software business for 2 decades. I can relate to the developers that understand the amount of work required to deliver a new feature if the system architecture was NOT designed to support such an implementation. Maybe that’s the case for Asterisk, I don’t know… But seeing the amount of hits I got when Googling for this feature + Asterisk, I don’t believe I’m the only person with this particular need.

There are multiple use cases even in the business world where such a feature would be used. I can think of a shipper that has both a desk phone and a wireless phone. Or the CEO that wants his Android to connect to the office WiFi and receive the company calls on his cell phone while he’s in the building…

Thank you,
Martin Politick.

[color=#008000]P.S. This is not a rant, I’m really looking for Asterisk help. I’m just looking for a neat way of switching to Asterisk. If that does not pan out I could always manage my bandwidth issue by adding an extra NIC in my Internet gateway and put all my phones and SipXecs on that ethernet segment… My wife would kill me if I need to buy managed switches.[/color]

Hi

Asterisk does not allow multiple registrations of SIP endpoints on the same sip account.

That is very different to multiple sip endpoints on an extension number.

For example extension 1234 can be set to call SIP/1234&SIP4321&IAX2/1234&SIP/JOESOAP

All these endpoint can be configured with the same caller ID and mailbox. so are seen as one extension.

Ian

Thanks Ian,

Then you are suggesting that I should stick with my current PBX solution ?

Yes I believe that’s what Eric was calling a Phantom extension here
http://eric.lubow.org/2008/system-administration/asterisk-pbx/1-extension-multiple-phones/

But for my particular situation that means configuring about 60 endpoints in sip.conf right?
And each extension in extension.conf would call about 8 to 10 phones.
It is doable, but a real maintenance nightmare for what should be a simple home system.

I just thought, maybe I could create an external shell script to generate this messy configuration and include it in
sip/conf and extension.conf? Would that work?

Martin Politick.

He is suggesting using Asterisk, but not trying to make Asterisk look like the alternative.

Your extension/device matrix seems to be static, so you only need sip.conf entries for the phones. The extensions then list the phones that ring when that number is used.

Yes, I could script the 60 SIP entries and the “10 extensions”.

But I just thought about my phone configurations now …
If I script the Asterisk configurations where each endpoint is different (i.e. 60 SIP accounts),
that also means that each phone configuration will have to be different as they all need to register to different SIP accounts.

Right now my SIPxxxxxxxxxxxx.cnf for each phone is almost the same, I just remove some SIP accounts if I don’t want them to ring there. Now this means that each SIPxxxxxxxxxxxx.cnf will have to be different…
I’d have to script them as well …

I can’t find an attractive solution…
Can Asterisk create SIPxxxxxxxx.cnf for Cisco 7960 phones automatically based on sip.conf and extension.conf ?

Martin Politick.

Either you haven’t explained your requirements properly, or you are failing to see the Asterisk way of doing this because you are too intent on emulating the other system.

If I understand it, you need one sip.conf entry for each phone and one extension.conf sequence for each extension (number).

Hi David,

I tried real hard to explain my requirements in my first post.
Let me try to re-phrase and simplify:

I have 10 hard phones at home and we are 6 people living in the house.
When people call at home, I want them to dial one of 6 extensions to determine who they want to reach.
Ex: 200-> Martin, 201->Nathalie, 202->Kasandra, … 205->Lauriane

Now since the family can be in any room in the house, I want all phones to ring
and people look at which extension is being rung and answer if it’s for them.
So each of the 10 phones have “extensions” 200, 201,202…205
when it rings I look at which extension is ringing and I pick up if it’s for me.
If not, I let it ring and it may be pickup by the other family member or it may go to voicemail.

I probably am.
Could you please give me an example of sip.conf and extension.conf that would fulfill the above requirements?
The only way I understand how to do this is with Eric’s configuration that will require 60 SIP entries.

Thank you for your time Dave,
Martin Politick.

There is nothing special about sip.conf. It may help if you use best security practice and name the sections after the MAC addresses of the phones; that should stop your confusing extensions and devices.

Ian has already shown you how to construct the Dial application parameters.

The way I understand I need to configure sip.conf is that I’d need to create 60 entries like

for(Extension=1 ; Extension <= 6 ; Extension++) { for( Phone=1 ; Phone <= 10 ; Phone++) { printf("[%d%d]", Extension, PhoneId); ... } }
Example :
—extension.conf---------------------------------------------------------------
exten=>200,1,Dial(SIP/20001&SIP/20002&SIP/20003&SIP/20004&SIP/20005&SIP/20006&SIP/20007&SIP/20008&SIP/20009&SIP/20010,18)
exten=>201,1,Dial(SIP/20101&SIP/20102&SIP/20103&SIP/20104&SIP/20105&SIP/20106&SIP/20107&SIP/20108&SIP/20109&SIP/20110,18)
exten=>202,1,Dial(SIP/20201&SIP/20202&SIP/20203&SIP/20204&SIP/20205&SIP/20206&SIP/20207&SIP/20208&SIP/20209&SIP/20210,18)
exten=>203,1,Dial(SIP/20301&SIP/20302&SIP/20303&SIP/20304&SIP/20305&SIP/20306&SIP/20307&SIP/20308&SIP/20309&SIP/20310,18)
exten=>204,1,Dial(SIP/20401&SIP/20402&SIP/20403&SIP/20404&SIP/20405&SIP/20406&SIP/20407&SIP/20408&SIP/20409&SIP/20410,18)
exten=>205,1,Dial(SIP/20501&SIP/20502&SIP/20503&SIP/20504&SIP/20505&SIP/20506&SIP/20507&SIP/20508&SIP/20509&SIP/20510,18)

—sip.conf---------------------------------------------------------------
; 10 SIP accounts for Martin’s extensions on the 10 Cisco 7960 phones

[20001]
type=peer
context=users
username=20001
callerid=Martin Politick <200>
mailbox=200@politick.ca
host=dynamic
nat=no

[20002]
type=peer
context=users
username=20002
callerid=Martin Politick <200>
mailbox=200@politick.ca
host=dynamic
nat=no

[20003]
type=peer
context=users
username=20003
callerid=Martin Politick <200>
mailbox=200@politick.ca
host=dynamic
nat=no



[20010]
type=peer
context=users
username=20010
callerid=Martin Politick <200>
mailbox=200@politick.ca
host=dynamic
nat=no

; 10 SIP accounts for Nathalie’s extensions on the 10 Cisco 7960 phones

[20101]
type=peer
context=users
username=20101
callerid=Nathalie <201>
mailbox=201@politick.ca
host=dynamic
nat=no

[20102]
type=peer
context=users
username=20102
callerid=Nathalie <201>
mailbox=201@politick.ca
host=dynamic
nat=no

[20103]
type=peer
context=users
username=20103
callerid=Nathalie <201>
mailbox=201@politick.ca
host=dynamic
nat=no



[20010]
type=peer
context=users
username=20110
callerid=Nathalie <201>
mailbox=201@politick.ca
host=dynamic
nat=no





You said that the extension/device matrix was fixed. The 60 extensions are for when the extension/device matrix is dynamic. Even then I’m not sure that that is true.

The way to handle the latter is by global variables in the dialplan, or queues, where you pause an agent when a phone is not in use by a particular person.

sip.conf aaaa bbbb cccc dddd eeee ffff ggggg hhhhh iiiii jjjj kkkk

if extension 001 should call aaaa, cccc and jjjj

exten => 001,n,Dial(SIP/aaaa&SIP/cccc&SIP/jjjj)

if extension 002 calls all

exten => 002,n,Dial(SIP/aaaa&SIP/bbbb&SIP/cccc&SIP/dddd&SIP/eeee&SIP/ffff&SIP/ggggg&SIP/hhhhh&SIP/iiiii&SIP/jjjj&SIP/kkkk)

I don’t really understand the semantics of “extension/device matrix”. I meant the number of phones and extensions are fixed to 10 and 6 respectively and it does not change over time.

If I understand what you mean by:

Then I believe that I’d endup with 10 mailboxes (one for each phone, not one for each person)
and it may even be impossible to know what extension was called (i.e. identify who the call is intended for)
but I don’t know this for sure as I’ve not tested this.

Martin Politick.

I gave up and installed a new NIC in my router.
Unfortunately it will be simpler than changing to Asterisk with my particular requirements.

This allows me to have and extra subnet and a separate ethernet segment
with its dedicated cheap switch for all my phones and my alternative PBX.
This way bulk transfers between Desktops and the NAS will have no effect on the VoIP.

Too bad, I was really looking forward to tinker with Asterisk’s dial plan and all the add-in modules you can call with it.
That component looks really powerful in Asterisk.

Martin Politick.

As I understand, you are trying to achieve a feature that I have implemented for registering the same extension from two different IPs. I used a perl script with AMI to capture registration events. It works like this.

The script Connects to AMI and wait for events. If it is registration Event then script will store the Username/IP/Ports/Technology in Database. If next registration comes from same IP and port, it updates registration time in DB and if registration is from different or even different port of same ip then it stores it as another registration. Hence when call comes to user, both the devices ring and anyone can be picked to answer the call.
first Device: SIP/User1@192.168.0.20:5061
second Device: SIP/User1@203.223.0.45:5678

in database these are stored like

User1:
IP1: 192.168.0.100 Por1: 5060
IP2: 69.30.21.10 Port2: 5060

User2:
IP1: 192.168.10.1 Por1: 5060
IP2: 192.168.10.1 Por2: 5061
when call comes then these registrations can be fetched from DB and routed like this ()
exten=> 123456,n,Dial(SIP/user1@${ip1}:${port1}&SIP/user1@${ip2}:${port2})

Leading voip service provider Axvoice has implemented multiple registration scenario and plan to launch in future to provide a new exciting feature to their customers.

Yes,
that would have worked for me for me.

And probably for my Android phones that only register when people are in the house within WiFi range,
assuming that exten=> 123456,n,Dial(SIP/user1@${ip1}:${port1}&SIP/user1@${ip2}:${port2})
does not go belly up if say {ip2} is not int the DB because the phone is not int the house.

But I’ve re-formatted my VoIP server and installed the latest version of what I had before with
a new NIC and routes in my Linux router.
My Xmas vacation is over so I don’t have as much time to tinker with this anymore.

But [color=#408000]thank you[/color], I might look into it this summer.

Martin Politick.

Dear BrennaKessler
could you please share this script?