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
—
7 thoughts on - Calling Multiple Phones At Ones
Hi Ivan
Using the following extensions:
SIP/100
SIP/101
SIP/102
Example 1:
[default]
exten => _X.,1,Dial(SIP/100&SIP/101&SIP/102,30,tT)
same => n,hangup
Example 2:
exten => _X.,1,Dial(SIP/100,10,tT)
exten => _X.,2,Dial(SIP/101,10,tT)
exten => _X.,3,Dial(SIP/102,10,tT)
same => n,hangup
This is the simplest methods, but there are others more complex and better.
[image: Sua Foto]Rafael S. SaraivaPorto Alegre – RS
| Mobile: (51) 8174-7956
<http://br.linkedin.com/pub/rafael-saraiva/52/aab/230>
<https://plus.google.com/u/0/+RafaelSaraivaRS>
2015-06-14 23:12 GMT-03:00 Ivan Demkovitch:
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.
You can ring multiple phones with a single Dial() statement, separating them with “and” signs: Dial(TECH1/EXT1&TECH2/EXT2&TECH3/EXT3& …..)
Suppose my desk phone at work is SIP/403, my desk phone at home (which, by cunning use of VPN, actually appears on an address in the Company Intranet)
is SIP/703 and my mobile is 07xxxxxx726. Then in the dialplan, I would have something like
exten => 403,1,NoOp(Trying three different ways to call AJS)
exten => 403,2,Dial(SIP/403&SIP/703&${GSM_GW}/07xxxxxx726,60)
exten => 403,3,VoiceMail(403,u)
exten => 403,4,Hangup()
—
AJS
Note: Originating address only accepts e-mail from list! If replying off-
list, change address to asterisk1list at earthshod dot co dot uk .
—
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.
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.
—
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
—
How about ringall strategy with a queue?
—
Not sure how that would help. Every SIP phone in the queue would still have to have a unique SIP identifier/username.
Very interesting and good to know; thanks. I’ll have to check it out when I’ve got some spare time.