[asterisk-users] Calling multiple phones at ones

Nathan Anderson nathana at fsr.com
Mon Jun 15 00:43:38 CDT 2015


What you want is called SIP call forking, and unfortunately, last time I checked (before Asterisk 12 and the advent of PJSIP), Asterisk's SIP channel driver does not support it, and I would be shocked if Asterisk 12+ changes this situation.  You can even see that people have written and submitted patches for this in the past, but they have been rejected:

https://issues.asterisk.org/jira/browse/ASTERISK-13614

It has apparently been a somewhat contentious issue.  Asterisk's philosophy is that it is not a SIP proxy, but a multiprotocol PBX that also happens to support SIP endpoints, and so the channel drivers need to be as generic as possible and anything that can be passed on to the dialplan to be handled in a uniform and consistent fashion should be, and that would include call forking.  The developers do not want for there to be two places (a universal way and a channel-specific way) where this kind of functionality can be configured.

You *can* fork calls with Asterisk; don't get me wrong.  Simply specify multiple endpoints to ring when you execute the Dial() application, concatenating them together with ampersands, like so:

[office-phones]
exten=555,1,Dial(SIP/555&DAHDI/g0/5551212&SIP/567)

As you can see, you can mix-and-match channel technologies in this way.  In the above example, when a call for extension 555 is received within the office-phones context, the SIP user 555 is called, the SIP user 567 is called, and the PSTN phone number 555-1212 is called, all simultaneously.  The first phone to answer the call gets it.

The problem that I have with this method is that if a particular channel technology or protocol has a mechanism specifically for performing call forking defined within the standard/spec for that protocol (as SIP does), there is no way with Asterisk to take advantage of the channel-specific way to accomplish this.

Let me unpack this a bit more.  As you can see, with the above example, if your published extension number is 555, and you want to have two different SIP phones ring at the same time when you get a call, you can't actually register them both to your Asterisk server as user '555'; they each need to have unique SIP usernames.  So you have one phone that is registered as 555, another one that is registered with a throwaway extension number (567), and then you instruct Asterisk to send the call to both 555 and 567.  Because Asterisk's SIP implementation does not support native SIP call forking and also assumes unique usernames for every SIP peer, if you try to register two SIP endpoints with the same username (e.g., 555), the second registration will actually be successful, but it will *overwrite* the registration for the first phone in memory, meaning that the phone that first registered with that username will stop receiving calls and only the second phone will get those calls.  And as the SIP registration timer expires for each phone and they refresh their registrations with the server, they will be constantly overwriting each other's registrations, so incoming calls will constantly switch between which phone is getting the calls.  It's a mess.

It's not that a single SIP registrar or proxy cannot have multiple endpoints registered to it with the same username; this is actually specifically allowed by the spec and many SIP-only proxies support this.  It's just that Asterisk does not, which means that you have to resort to (IMO) ugly hacks like creating a bunch of unpublished extension numbers for your additional phones.  I completely understand where the developers are coming from, but it would be great if this tension between the Asterisk philosophy and the need for this feature could be resolved via some sort of compromise, like, for example, allowing for the SIP channel driver to accept and track multiple registrations for the same SIP user, and then exposing each of these registrations as separate entries in the peers table that can be individually addressed within the dialplan.  Or something.

--
Nathan Anderson
First Step Internet, LLC
nathana at fsr.com

-----Original Message-----
From: asterisk-users-bounces at lists.digium.com [mailto:asterisk-users-bounces at lists.digium.com] On Behalf Of Ivan Demkovitch
Sent: Sunday, June 14, 2015 7:13 PM
To: asterisk-users at lists.digium.com
Subject: [asterisk-users] Calling multiple phones at ones

Hello group!

I’m new to Asterisk but got one running finally :)

Now I’m trying to solve following problem. I have company Automated Attendant and each employee have
SIP phone at home, SIP phone in office, cell phone.

I want all those 3 phones to be “one”. So, if someone calls our company number and dials my extension - I’d like 3 phones to ring at the same time.

What is this feature and where should I look for samples, etc? I’m going by “Asterisk: The definite guide” book and pretty confident with those concepts described but not sure 
how to achieve what I described above. 

Thank you,
Ivan
-- 
_____________________________________________________________________
-- Bandwidth and Colocation Provided by http://www.api-digital.com --
New to Asterisk? Join us for a live introductory webinar every Thurs:
               http://www.asterisk.org/hello

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users


More information about the asterisk-users mailing list