Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Save more on your purchases! discount-offer-chevron-icon
Savings automatically calculated. No voucher code required.
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
FreeSWITCH Cookbook

You're reading from   FreeSWITCH Cookbook Written by members of the FreeSWITCH team, this is the ultimate guide to getting the most out of the platform. Stuffed with over 40 recipes, just about every angle is covered, from call routing to enabling text-to-speech conversion.

Arrow left icon
Product type Paperback
Published in Feb 2012
Publisher Packt
ISBN-13 9781849515405
Length 150 pages
Edition 1st Edition
Languages
Concepts
Arrow right icon
Toc

Table of Contents (12) Chapters Close

FreeSWITCH Cookbook
Credits
About the Authors
About the Reviewers
www.PacktPub.com
Preface
1. Routing Calls FREE CHAPTER 2. Connecting Telephones and Service Providers 3. Processing Call Detail Records 4. External Control 5. PBX Functionality Index

Ringing multiple endpoints simultaneously


FreeSWITCH makes it easy to ring multiple endpoints simultaneously within a single command.

Getting ready

Open conf/dialplan/default.xml in a text editor or create or edit a new XML file in the conf/dialplan/default/ subdirectory.

How to do it...

Add a comma-separated list of endpoints to your bridge (or originate) application. For example, to ring userA@local.pbx.com and userB@local.pbx.com simultaneously, use an extension like this:

<extension name="ring_simultaneously">
  <condition field="destination_number" expression="^(2000)$">
    <action application="bridge" data="{ignore_early_media=true}sofia/internal/userA@local.pbx.com,sofia/sip/userB@local.pbx.com"/> 
  </condition>
</extension>

How it works...

Putting comma-separated endpoints in the argument to bridge causes all of the endpoints in that list to be dialed simultaneously. It sounds simple, however, there are several factors to consider when ringing multiple devices simultaneously in a real environment. The bridge application will connect the call to whoever sends media first. This includes early media (ringing). To put this another way, if you bridge a call to two parties and one party starts sending a ringing signal back to you, that may be considered media and the call will be connected to that party only. Ringing of the other phones will cease.

If you find that calls always go to a specific number on your list of endpoints versus ringing all numbers, or that all phones ring for a moment before ringing only a single number, your call may be getting bridged prematurely because of early media. Notice that we added ignore_early_media=true at the beginning of the dial string. As its name implies, ignore_early_media tells the bridge application not to connect the calling party to the called party when receiving early media (such as a ringing or busy signal). Instead, bridge will only connect the calling party to the called party who actually answers the call. In most cases, it is useful to ignore early media when ringing multiple endpoints simultaneously.

There's more...

In some scenarios, you may also wish to ring specific devices for a limited amount of time. You can apply the leg_timeout parameter to each leg of the bridge to specify how long to ring each endpoint, like this:

<action application="bridge" data="[leg_timeout=20]sofia/internal/userA@local.pbx.com,[leg_timeout=30]sofia/sip/userB@local.pbx.com"/>

In this example, userA's phone would ring for a maximum of 20 seconds while userB's phone would ring for a maximum of 30 seconds.

Tip

Call legs and the leg_timeout variable

The leg_timeout variable is unique in that it implies the ignoring of early media. When using the leg_timeout variable on each call leg in a bridge attempt, there is no need to explicitly use {ignore_early_media=true} in the bridge argument. For a more complete discussion of using { and } (curly braces) versus [ and ] (square brackets), see http://wiki.freeswitch.org/wiki/Channel_Variables#Channel_Variables_in_Dial_strings.

This method of calling multiple parties works well for small numbers of endpoints. However, it does not scale to dozens or more users. Consider using a FIFO queue in such an environment (FreeSWITCH's mod_fifo is discussed at length online at http://wiki.freeswitch.org/wiki/Mod_fifo). See also Ringing multiple endpoints sequentially (simple failover) for an example of ringing a group of endpoints one at a time, which includes an expanded discussion of using call timeouts.

See also

  • The Ringing multiple endpoints sequentially (simple failover) section that follows

You have been reading a chapter from
FreeSWITCH Cookbook
Published in: Feb 2012
Publisher: Packt
ISBN-13: 9781849515405
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime
Banner background image