[asterisk-users] Calling multiple phones at ones

Matthew Jordan mjordan at digium.com
Mon Jun 15 11:03:00 CDT 2015


On Mon, Jun 15, 2015 at 12:43 AM, Nathan Anderson <nathana at fsr.com> wrote:
> 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.

Generally speaking, this is still true. Sometimes some SIP things
bleed up a bit - after all, there are specific functions and
applications for both SIP channel drivers - but we try to keep
Asterisk as generic as possible in the dialplan.

> 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.

This is true for chan_sip. It is not true for the PJSIP stack.

The PJSIP stack does allow for multiple devices to register contacts
to a single Address of Record (AoR). You can then dial contacts
individually, or dial all contacts on an AoR using the
PJSIP_DIAL_CONTACTS function.

I would say that configuring the PJSIP stack in such a fashion is one
of the more "advanced" uses, and there are some gotchyas going with
that configuration (mostly related to device state). But it is
possible.

> 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
> --
> _____________________________________________________________________
> -- 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



-- 
Matthew Jordan
Digium, Inc. | Director of Technology
445 Jan Davis Drive NW - Huntsville, AL 35806 - USA
Check us out at: http://digium.com & http://asterisk.org



More information about the asterisk-users mailing list