Published on O'Reilly (http://oreilly.com/)
 See this if you're having trouble printing code examples

Building Your Own Teleconference System with Asterisk and Gizmo

by Brian McConnell

Editor's Note: In the interest of disseminating this information as widely as possible, the author grants all reprint requests without the need to obtain any further permission as long as the URL of this original article is included. This article is a companion piece to For SARS Press 1, for Bird Flu Press 2... and How to Implement Telecommuting in a Hurry.

Asterisk is a free software package that turns a standard computer into a powerful multi-user telephone and conferencing system. This is a companion piece to For SARS Press 1, for Bird Flu Press 2... about how we can use information technology to protect our communities in the event of an influenza pandemic. An important component of our response will be to create electronic surrogates for public gatherings such as classrooms, lecture halls, and social gatherings.

With these electronic venues in place, even in the event of a community-wide curfew or quarantine, people will still be able to attend class, chat with neighbors, and socialize. This will allow society to continue to function and reduce the potential for panic if people are isolated for extended periods of time.

Schools, universities, businesses, and any organization that organizes social functions should begin preparations now so they are able to respond quickly if public health authorities close public venues or restrict people's movement, both are likely scenarios in a pandemic.

Teleconferencing is a good surrogate for public gatherings. With it, you can host classes, lectures, meetings, and casual chats. Most people have used dial-in "meet me" teleconferencing services where users call a toll-free number, enter an access code, and then are dropped into a party line. Here, I'll describe how to build your own conference bridge using inexpensive off-the-shelf hardware paired with free Internet telephony software.

Although there are many subscription teleconferencing services, such as WebEx and InterCall, I do not recommend relying on them as part of a disaster preparedness plan. They are expensive ($12.00 per hour or more per connected caller). They also do not have adequate surge capacity to handle a sudden spike in demand, which would happen if an entire school district was forced to close for a month (much less if school districts nationwide were forced to shut down). In the event of a real crisis, millions of people may rely on these systems like the ones I describe far more than commercial providers can accommodate in a short period of time.

To prepare, you need to build a conferencing platform that is dedicated to your users and that can operate independently of the public telephone network. With Asterisk and off-the-shelf computer hardware, you can do this quite cheaply. Even for large organizations, such as public universities, the cost of implementing this will be modest, especially compared to the cost of not having this capability ready to go and being shut down entirely.

To build this system, you will need the assistance of someone who is knowledgeable about Linux-based systems and networks. There are many people in your community with this background, and chances are that someone within your organization, or even your students, will be able to follow these instructions. My company, Open Communication Systems, is publishing detailed specifications and downloadable sample configurations so you can quickly build these systems without reinventing them. First, let's go over an equipment and vendor checklist.

Equipment and Vendor Checklist

To build your conferencing platform, you will need the following equipment and services.

Host In-House or Outsource?

The first question you need to ask is whether you want to host the conference bridges in-house or to outsource them to a collocation facility.

Unless you have a fairly heavy-duty network infrastructure, such as a university wide-area network, and have an IT department to support these servers, you will want to install the servers at a collocation facility or rent servers from the same.

If you plan to outsource, there are several top-tier hosting companies, including ServerBeach and Rackspace. They'll rent servers for as little as $100 per month, Internet connectivity included (Server Beach charges as little as $80 per month extra for an unmetered 10Mb connection per server). A note about connectivity charges, be sure to ask your provider for an unmetered connection to avoid being hit with overage charges. The advantage of using these services is that you don't need to touch the hardware. You can just login in as an administrator, install the Asterisk software, edit a few configuration files, and be up and running fairly quickly.

If you are building a really big system, you should think about placing servers close to the end users so that network traffic mostly stays within your campus network or the metropolitan area network. For example, if you're building a system for a 5,000 student university, you should design it so that most of the calls travel within your campus network or the local cable providers network. This will reduce the possibility that a surge in demand will overwhelm an upstream link somewhere. The Internet and its underlying routing system is quite resilient, but you do need to be mindful of where people will be calling from and, if possible, place the conferencing servers on the same local or metropolitan network. (If you are outsourcing the servers, this isn't an option, so you'll just have to hope that local ISPs have enough upstream bandwidth -- they probably do in most cases).

I'll assume that if you're running a university's wide area network that you know what you're doing and only need some tips on configuring Asterisk and the VoIP client software. If you're hosting your conference bridges at an offsite collocation facility, be sure to pick a vendor that has extensive peering agreements and a lot of redundant facilities. If you are building a large cluster of servers, you should spread them across multiple providers so that a failure at one does not take your entire service offline.

Sizing Your System

These are approximate numbers, but will provide a rough estimate of how much hardware you will need for a given number of simultaneous callers. Schools and universities should plan system capacity to accommodate the number of students in classrooms at one time and should probably increase this number somewhat. The most conservative approach will be to build for a 1-to-1 ratio with the number of people in your organization, although you can get by with less if you schedule classes to combine a mix of live calls and offline work such as textbook drills.

Depending on how you configure it, Asterisk can handle about 50 to 100 simultaneous callers per server. Conferencing is a CPU-intensive application, so it is important to follow some configuration guidelines. There are a few tricks you can use to boost performance significantly.

So, if you have 500 students in your high school, you should plan on buying 5 to 10 servers to handle 200 to 500 callers in virtual classes at any time. If you buy the servers outright, this will cost $10,000 to $20,000, although you can also cobble together used hardware to cut costs. If you lease the servers, this will cost about $1,000 to $2,000 per month depending on the collocation provider for a fully built out system. You can see where leasing has obvious benefits; however, many other organizations may be trying to do the same thing at the same time, thus causing supply chain bottlenecks at the collocation facility. If possible, you should plan ahead and buy or start leasing at least some systems now. Internet connectivity will be included with the server rental. At the very least, you can do a guerrilla project to build a one- or two-server prototype using scavenged hardware.

This may sound expensive, but it is a fraction of what conventional conference bridges cost ($100 to $1,000 per caller plus telephone and operating expenses), or the cost of being shut down completely. If funding is an issue, you could levy a special fee to defray the cost of building the system. Using the 500-student high school as an example, you would need to charge about $4 per student/month to cover the direct operating costs (rental) or $40 per student for a one-time purchase.

Another thing you should do is contact local ISPs to see if they are willing to support your project. They may have spare servers that they can set aside for use in an emergency. Don't expect them to give you service for free, but since this is an important public service they may be willing to work with you. Some may be willing to help you build this project in exchange for some sort of acknowledgement or advertisement, others may be willing to stage servers on a contingency basis. Remember that once you build this system you can use it during normal times as well, so you may find it a worthwhile investment, regardless of whether a pandemic ever materializes.

Building and Configuring Your System

Once you have sized your system, you'll need to install and configure your Asterisk servers. Since Asterisk has a built-in meet me conferencing capability, this is pretty easy to do. The hardest part is getting Asterisk up and running. It is a fairly complex piece of software with a lot of moving parts. If you're completely new to Asterisk, I recommend starting with Asterisk@Home, which will guide you through setting up a small system. Asterisk Business Edition, sold by Digium for $795, also makes the initial setup process easier.

My other company, Radio Handi a teleconferencing service that runs partially on Asterisk, is publishing a set of basic configuration files that you can use as a cheat sheet to get a system up and running fairly quickly.

Sample Configurations

The following three configuration files tell Asterisk how to answer and route incoming calls to one or more conference rooms.

Download extensions.conf.


; Static extension configuration file, used by
; the pbx_config module. This is where you configure all your 
; inbound and outbound calls in Asterisk. 
; This configuration file is reloaded 
; - With the "extensions reload" command in the CLI
; - With the "reload" command (that reloads everything) in the CLI

; The "General" category is for certain variables.  
; If static is set to no, or omitted, then the pbx_config will rewrite
; this file when extensions are modified.  Remember that all comments
; made in the file will be lost when that happens. 
; XXX Not yet implemented XXX
; if static=yes and writeprotect=no, you can save dialplan by
; CLI command 'save dialplan' too
; If autofallthrough is set, then if an extension runs out of
; things to do, it will terminate the call with BUSY, CONGESTION
; or HANGUP depending on Asterisk's best guess (strongly recommended).
; If autofallthrough is not set, then if an extension runs out of 
; things to do, asterisk will wait for a new extension to be dialed 
; (this is the original behavior of Asterisk 1.0 and earlier).
; If clearglobalvars is set, global variables will be cleared 
; and reparsed on an extensions reload, or Asterisk reload.
; If clearglobalvars is not set, then global variables will persist
; through reloads, and even if deleted from the extensions.conf or
; one if its included files, will remain set to the previous value.
; If priorityjumping is set to 'yes', then applications that support
; 'jumping' to a different priority based on the result of their operations
; will do so (this is backwards compatible behavior with pre-1.2 releases
; of Asterisk). Individual applications can also be requested to do this
; by passing a 'j' option in their arguments.
; You can include other config files, use the #include command
; (without the ';'). Note that this is different from the "include" command
; that includes contexts within other contexts. The #include command works
; in all asterisk configuration files.
;#include "filename.conf"

; The "Globals" category contains global variables that can be referenced
; in the dialplan with ${VARIABLE} or ${ENV(VARIABLE)} for Environmental
; variables,
; ${${VARIABLE}} or ${text${VARIABLE}} or any hybrid
CONSOLE=Console/dsp                ; Console interface for demo
IAXINFO=guest                    ; IAXtel username/password
TRUNK=Zap/g2                    ; Trunk interface
; Note the 'g2' in the TRUNK variable above. It specifies which group (defined
; in zapata.conf) to dial, i.e. group 2, and how to choose a channel to use in
; the specified group. The four possible options are:
; g: select the lowest-numbered non-busy Zap channel
;    (aka. ascending sequential hunt group).
; G: select the highest-numbered non-busy Zap channel
;    (aka. descending sequential hunt group).
; r: use a round-robin search, starting at the next highest channel than last
;    time (aka. ascending rotary hunt group).
; R: use a round-robin search, starting at the next lowest channel than last
;    time (aka. descending rotary hunt group).
TRUNKMSD=1                    ; MSD digits to strip (usually 1 or 0)

; Any category other than "General" and "Globals" represent 
; extension contexts, which are collections of extensions.  
; Extension names may be numbers, letters, or combinations
; thereof. If an extension name is prefixed by a '_'
; character, it is interpreted as a pattern rather than a
; literal.  In patterns, some characters have special meanings:
;   X - any digit from 0-9
;   Z - any digit from 1-9
;   N - any digit from 2-9
;   [1235-9] - any digit in the brackets (in this example, 1,2,3,5,6,7,8,9)
;   . - wildcard, matches anything remaining (e.g. _9011. matches 
;    anything starting with 9011 excluding 9011 itself)
;   ! - wildcard, causes the matching process to complete as soon as
;       it can unambiguously determine that no other matches are possible
; For example the extension _NXXXXXX would match normal 7 digit dialings, 
; while _1NXXNXXXXXX would represent an area code plus phone number
; preceeded by a one.
; Each step of an extension is ordered by priority, which must
; always start with 1 to be considered a valid extension.  The priority
; "next" or "n" means the previous priority plus one, regardless of whether
; the previous priority was associated with the current extension or not.
; The priority "same" or "s" means the same as the previously specified
; priority, again regardless of whether the previous entry was for the
; same extension.  Priorities may be immediately followed by a plus sign
; and another integer to add that amount (most useful with 's' or 'n').  
; Priorities may then also have an alias, or label, in 
; parenthesis after their name which can be used in goto situations
; Contexts contain several lines, one for each step of each
; extension, which can take one of two forms as listed below,
; with the first form being preferred.  One may include another
; context in the current one as well, optionally with a
; date and time.  Included contexts are included in the order
; they are listed.
;exten => someexten,priority[+offset][(alias)],application(arg1,arg2,...)
;exten => someexten,priority[+offset][(alias)],application,arg1|arg2...
; Timing list for includes is 
;   <time range>|<days of week>|<days of month>|<months>
;include => daytime|9:00-17:00|mon-fri|*|*
; ignorepat can be used to instruct drivers to not cancel dialtone upon
; receipt of a particular pattern.  The most commonly used example is
; of course '9' like this:
;ignorepat => 9
; so that dialtone remains even after dialing a 9.

; handle incoming call

;Wait 1 second and answer the line
exten => _1747NXXXXXX,1,Wait,1
exten => _1747NXXXXXX,n,Answer

;Play prompt - "Welcome to Quarantine Class"
exten => _1747NXXXXXX,n,Playback(welcome-quarantine)

;Enter MeetMe conference
;With no conference ID indicated the caller will be prompted
;to enter a conference ID.
;The accompanying meetme.conf is configured to require the
;caller to also enter a pin.
exten => _1747NXXXXXX,n,MeetMe()

exten => _1747NXXXXXX,n,Hangup

;Wait 1 second and answer the line
exten => _1NXXNXXXXXX,1,Wait,1
exten => _1NXXNXXXXXX,n,Answer

;Play prompt - "Welcome to Quarantine Class"
exten => _1NXXNXXXXXX,n,Playback(welcome-quarantine)

;Enter MeetMe conference
;With no conference ID indicated the caller will be prompted
;to enter a conference ID.
;The accompanying meetme.conf is configured to require the
;caller to also enter a pin.
exten => _1NXXNXXXXXX,n,MeetMe()

exten => _1NXXNXXXXXX,n,Hangup

Download meetme.conf.


; Configuration file for MeetMe simple conference rooms for Asterisk of course.
; This configuration file is read every time you call app meetme()

;audiobuffers=32        ; The number of 20ms audio buffers to be used
                ; when feeding audio frames from non-Zap channels
                ; into the conference; larger numbers will allow
                ; for the conference to 'de-jitter' audio that arrives
                ; at different timing than the conference's timing
                ; source, but can also allow for latency in hearing
                ; the audio from the speaker. Minimum value is 2,
                ; maximum value is 32.
; Usage is conf => confno[,pin][,adminpin]    
; conf => [conference id],[optional password]
; The conference ID would map to a scheduled class or meeting
conf => 2001,9938   ; history 2001 conference, with pin code 9938
conf => 3001,1877   ; history 3001 conference, with pin code 1877

Download sip.conf.


; SIP configuration
; SIP Configuration for Asterisk
; Syntax for specifying a SIP device in extensions.conf is
; SIP/devicename where devicename is defined in a section below.
; You may also use
; SIP/username@domain to call any SIP user on the Internet
; (Don't forget to enable DNS SRV records if you want to use this)
; If you define a SIP proxy as a peer below, you may call
; SIP/proxyhostname/user or SIP/user@proxyhostname
; where the proxyhostname is defined in a section below
; Useful CLI commands to check peers/users:
;   sip show peers              Show all SIP peers (including friends)
;   sip show users              Show all SIP users (including friends)
;   sip show registry           Show status of hosts we register with
;   sip debug                   Show all SIP messages

port = 5060            ; Port to bind to
bindaddr = xx.xx.xx.xx    ; Address to bind SIP channel to
context = default        ; Default context for incoming calls
srvlookup = yes            ; Enable DNS SRV lookups on outbound calls
;allowguest = yes

pedantic = no            ; Enable slow, pedantic checking for Pingtel
tos=lowdelay            ; IP QoS parameter, either keyword or value

;maxexpirey=3600        ; Max length of incoming registration we allow
;defaultexpirey=120        ; Default length of incoming/outoing registration
;notifymimetype=text/plain    ; Allow overriding of mime type in NOTIFY
;videosupport=yes        ; Turn on support for SIP video

disallow=all            ; Disallow all codecs
allow=ulaw            ; Allow codecs in order of preference

; Asterisk can register as a SIP user agent to a SIP proxy (provider)
; Format for the register statement is:
;       register => user[:secret[:authuser]]@host[:port][/extension]
; If no extension is given, the 's' extension is used. The extension
; needs to be defined in extensions.conf to be able to accept calls
; from this SIP proxy (provider)
; host is either a host name defined in DNS or the name of a 
; section defined below.
; Examples:

register => 1747xxxxxxx:*******@proxy01.sipphone.com

;gizmo config
; This section configures Asterisk to receive incoming calls from the Gizmo VoIP network
; if you have multiple Gizmo accounts, just create one entry for each account.

host =
type = friend
insecure = very
context = voxbonecontext

host =
type = friend
insecure = very
context = voxbonecontext

host =
type = friend
insecure = very
context = voxbonecontext

host =
type = friend
insecure = very
context = voxbonecontext

host =
type = friend
insecure = very
context = voxbonecontext

This example configuration works as follows. It will answer incoming calls from Gizmo with a greeting and prompt you to enter a four-digit extension number. This will identify the conference room that you want to join. You configure conferences in the meetme.conf configuration file. The example configuration has a few different types of conferences defined. You can easily edit this file to number conferences any way you want and to enable or disable features such as password controls.

I recommend testing the system using Gizmo Project. To do this, create an account on Gizmo, and then fill in the appropriate fields in the sip.conf file on your Asterisk server. You should then be able to call the Gizmo phone number for the account you created (usually 1747nnnnnnn) or the Gizmo nickname (e.g., "ConcordHighSchool"). You'll hear the greeting, and can then enter an extension number to join the desired conference.

If you need more than one server to accommodate all of your callers, I recommend creating one Gizmo account for each server. This way, you can park some classes on one server, and some on another. The simplest thing is to have one Gizmo account per server (e.g. ConcordHighSchoolMath, ConcordHighSchoolHistory, etc). This will spread the load across many servers, but avoid building a sophisticated load balancing and dynamic call routing service (this is very difficult to do, and beyond the scope of what most organizations can do). In general, my advice is to find a smart computer and networking person, give them your headcount and class or meeting schedules, and let them come up with the best solution. Then send out his instructions telling users what to do.

To call into the system, users will need to have Gizmo on their home or laptop computers, as well as a reasonably fast Internet connection. Since Gizmo is free software, and it costs nothing to make Internet calls you will not need to buy normal telephone service to answer these calls. These calls ride entirely over the Internet. It is also very easy to install and use, unlike other VoIP software, such as CounterPath (formerly Xten), which requires a lot of configuration to work properly. I do not recommend Skype because it does not peer with other VoIP networks. Gizmo also has built in instant messaging capability, which is great as an adjunct to a live voice teleconference.

Because some of your users may not have home computers or broadband Internet connectivity, you should also provide some local telephone connectivity if possible. There are two ways to do this: order digital phone lines from your local phone company or order VoIP origination service.

Most local telephone companies offer a fairly affordable digital telephone service called T-1. T-1 lines carry up to 24 simultaneous calls, and usually cost several hundred dollars per month. Incoming calls are generally toll-free (callers dial a local number, so there may be long-distance charges if they are not calling locally). Asterisk supports connections to digital telephone lines, including T1, E1, and ISDN Primary Rate circuits. T1 is the most common in North America, while E1 and ISDN are common elsewhere. Digium sells inexpensive network interface cards that can connect up to four T1/E1 circuits per system.

The problem with T-1 service is that it often takes four to six weeks to provision, and in the event of a crisis, the phone company will be focused on keeping existing service up and running. It may be impossible for them to provision new services. Configuring these circuits, E1 and ISDN especially, can be a real nightmare, although generic T1 voice service is not too bad if you follow the phone company's instructions closely.

The simplest way to link phone numbers into your system will be by ordering VoIP service from a company like Voxbone. It will give you direct inward dialing (DID) telephone numbers in cities throughout the United States and about 40 other countries. You pay a flat monthly rate to accept incoming calls via these numbers (no per minute charges, although users may incur cellular or long distance charges). The calls arrive on your Asterisk servers via the Internet. The example configuration includes settings for Voxbone. There are several other providers to choose from, including Level Three, Global Crossing, XO Communication, and a number of smaller providers. Unfortunately, many of these companies only cater to large customers and will not accept small orders. This will change during the next year or so as dozens of new companies enter this market, but for now your choices are limited.

In general, I recommend that you simply tell your users that they need to figure out how to get online with Gizmo to dial in to your system. Phone companies can take weeks to process orders, and some of these companies may be overwhelmed by demand in a situation like this. Provide local phone numbers if you can, because not everyone will have a computer with a broadband connection, but don't assume that it will be easy to interconnect your Asterisk system with the public telephone network.

The key to success here is finding someone who is knowledgeable about Linux and who is a good tinkerer. This type of person will be able to download the example files and instructions, troubleshoot network or configuration problems, and get an improvised system working quite quickly. This is very important, and I can't emphasize this enough. This is not a shrink-wrapped product, and so it is important that you have someone who is good at tinkering and troubleshooting.

I also strongly recommend Asterisk: The Future of Telephony. It is an excellent primer about Asterisk and provides a lot of information about many different types of applications and how to configure the system.

Using Your System

Once your system is up and running, using it is really easy. Let's consider a school as an example. You have about 500 students, and have set up one conference bridge for each department, and have mapped one Gizmo account to each conference bridge. So you end up with a table something like this:

ConcordHSHistory (1-747-555-1001)
ConcordHSMath (1-747-555-1002)
ConcordHSForeignLanguage (1-747-555-1003)

So, to dial into History 302, you'd call ConcordHSHistory or 1-747-555-1001 and then dial extension 302 when you hear the greeting. Then you're dropped into a full duplex (all parties can talk) or listen only (only the teacher can talk) conversation. Simple.

Gizmo has a lot of other neat features including:

Mostly I like Gizmo because it is very easy to install and use, works on Windows, Linux, and Mac computers, and it is based on open standards (which is why it can call directly into Asterisk systems, whereas other internet telephony services such as Skype are closed off, proprietary networks). At this point, it is the only free VoIP software I would recommend, but I will be updating this article periodically as new tools become available.

When to Use Your System

The goal of social distancing in a pandemic is to reduce or eliminate opportunities for influenza to spread. Public venues such as classrooms are especially hazardous, and will be closed promptly by public health authorities during an outbreak. The purpose of staging these systems for rapid use is to enable organizations to take their entire operation online on a moment's notice, without necessarily waiting to be told to do so. If you are prepared to host classes online, there is no reason to keep classrooms open if there is a risk to your students or employees.

Apart from the obvious benefit of limiting opportunities for the disease to spread, this will allow you to continue normal operations with little disruption. If you decide to implement this plan, you can inform all students and faculty that classes will continue, as usual, except online. By implementing this as a precautionary measure, you can demonstrate that you are prepared for this situation and, in the cases of schools, anticipate the concerns of parents who may keep their children home anyway. Being able to continue operations with some degree of normalcy will help to maintain morale and prevent panic.

Social Organizations and Businesses

People may be expected to stay at home or limit their contact with others for many weeks. People are social animals and most will have a difficult time doing nothing but watching TV or reading books for such a long time.

Electronic venues can play a role by enabling people to maintain social ties, both person-to-person and in groups, while they are hiding out. I am not suggesting that this will be fun or in any way a decent replacement for an evening at the local pub, but considering the alternative, it's better than staring at CNN.

Businesses and organizations that host social gatherings should be thinking about ways to re-create their events online. Business owners should be thinking about ways to create online venues, partly because most business will be closed down or deserted anyway, and they can provide their patrons with a surrogate place to gather, as well as entertainment to pass idle time. You can laugh at this suggestion, but after you've been holed up in your house for days with nothing to do but watch TV, you'll probably be thrilled to find some sort of distraction, even if it is playing drinking games with fellow barflies on a conference bridge. What else are you going to do besides be freaked out by the TV news?

What Your Users Will Need

Your users will need to have a home or laptop PC with a DSL or cable Internet connection. Gizmo will not work well over a dial-up Internet connection. The Gizmo client is free to download, and if you are only calling other Gizmo accounts, is free to use.

Users will get the best results if they buy a USB headset or handset to connect to their computer or laptop, although they can use the computer's built-in speakers and microphone (every caller should be trained to put their phone or Gizmo client on mute except when they are talking, this is to prevent background noise and feedback). A USB headset is not necessary if users will primarily be listening to a lecture and only speaking occasionally (as long as they remember to mute their lines when not speaking).

If you decide to offer local telephone connectivity via a VoIP service provider, such as Voxbone, users will also be able to call into sessions from any fixed line or mobile telephone. Again, I recommend steering as many people as possible toward Gizmo to avoid buying a lot of service from these providers. It costs $10 to $20 per month per phone line equivalent (per concurrent caller), so if you wanted to give 100 concurrent callers the option of dialing in via their regular phones, it will cost you $1,000 to $2,000 per month on top of your other costs, whereas allowing people to call in via Gizmo costs nothing on top of basic server rental and connectivity costs.

Hosting Small Conferences with Skype

If you can't afford to build your own conferencing facility, or don't need to have more than 5 to 10 people on a single call, you can use Skype to host small conference calls without the need for a centralized conference bridge. This makes sense for business communication where there are typically fewer people on a call (except for large conference calls), as well as for small classes and social groups. Most businesses already have some sort of conferencing capability, either via an in house conference bridge or PBX, or via a hosted conferencing service such as WebEx.

I recommend Skype for hosting small conferences and as a backup to the Asterisk/Gizmo configuration described above. Unfortunately, it won't work well for larger calls. Skype does offer the ability to host large conference calls via HighSpeedConferencing, but I would not rely on this as a primary service because it may not be able to accommodate a surge in demand if a lot of people decide to do this at the same time. As of this writing, this is an experimental service with fairly limited capacity relative to potential demand.

Social Uses for this Platform

Organizations may also want to budget some extra capacity so that users can create their own party lines for personal use. Radio Handi, provides this service to the general public. It enables people to create voice communities for any subject, location or peer group. However, we don't have enough capacity to answer calls if the scenario I am describing happens, which is why we are freely sharing information about how to build conferencing platforms.

Organizations can build a "lite" version of what we built at Radio Handi by creating a list of extensions or conference rooms for public use. Think of these like meeting rooms for clubs and organizations.

For example, a school could set up a server specifically for extracurricular organizations and publish a list of extensions for each of them, as well as to publish a list of floating rooms that can be used for any purpose. Students could then dial into these whenever they wanted, and use them either for their stated purpose, or just to kill time.

The latter is an important point. In a quarantine situation, people may be expected to stay at home for days or even several weeks until a local outbreak has subsided. People will get bored and, if there is a high rate of mortality in the community at large, become quite fearful, especially if wildly exaggerated rumors begin to circulate. Enabling people to form social networks and stay in constant contact will help maintain morale and prevent panic. It will also make it easier for people to resist the temptation to break quarantine until it is really safe to do so.


Online gathering places are not a long-term substitute for a classroom, family reunion, or the corner pub, but in a pandemic we may be expected to isolate ourselves from people outside our family for several weeks. Online gathering places can be used as a way to pass time, keep working or going to school, and to boost morale in an otherwise difficult and possibly quite frightening situation.

It will cost most organizations little or nothing to prototype these solutions (closer to nothing if they scavenge existing computers). A school with several hundred students will need only a few standard computers and a local ISP to give them a good deal on hosting. Total cost: a few thousand dollars at most for the computers. Potential benefit: lives saved.

I hope that the flu pandemic does not come to pass. But even if this threat never materializes you can use these systems for day-to-day activities: to host after-hours classes, to allow sick kids to dial-in from home, to create after-hours venues for students, and who knows what else. The main cost of building these systems is time and experimentation, so once you've got them working, you'll be able to use them for many things, and you'll have this in your back pocket if a pandemic happens.

Appendix: Common Problems and Solutions

A full troubleshooting guide is beyond the scope of this article, but this will give you an idea of the problems you are likely to encounter. I also recommend the book Asterisk: The Future of Telephony for detailed configuration and troubleshooting guidance.

Also see Asterisk's web site (www.asterisk.org) for more information.

Not Enough Bandwidth Going into Conference Server

You should plan on provisioning 100kbps of bandwidth per concurrent caller. Thus, a 100 user conference bridge will need 10mbps of constant connectivity. In reality, you should probably double this number. Fortunately, bandwidth at collocation facilities is pretty cheap so you should order more than you think you will need.

As a point of reference, Server Beach offers 10mbps of unmetered connectivity for an extra $80/month per server (check for current rates). Thus, a fast dual-CPU machine will cost about $300 per month including connectivity, and will handle about 50 to 100 callers per server (for an average monthly cost of $3 to $6 per concurrent caller).

You can reduce bandwidth requirements substantially by using low bandwidth codecs such as G.729 or Speex, but these also require a lot of computation, which will reduce the number of concurrent calls a given server can handle. Generally, I recommend planning on 40 to 50 users per box, with G.711 mu-Law as the standard codec. You'll use more bandwidth (about 5Mb when the server is running 50 calls), but you're less likely to overload the CPU. Unfortunately, there is no way to predict the exact behavior of a particular server, so you'll just need to set it up and test it to see how many calls your box can handle.

Improperly Configured Asterisk Server

Be sure to disable features you do not need, specifically you will want to disable high compression codecs such as G.729 and GSM. High compression codecs such as GSM reduce the amount of bandwidth needed per call substantially, by 50% or more in many cases. However, this comes at a cost. These codecs require a lot of computation and require Asterisk to transcode, or convert, audio from compressed to uncompressed form and back (especially for conferencing, because every audio stream must be uncompressed so that the conference bridge can blend the different audio streams). Transcoding is bad, because it will reduce your system's capacity from 50 to 100 callers (or more for listen-only conferences) to 20 to 30 callers or less on a slow PC. Order more bandwidth and use the standard G.711 codec. It requires about 80kbps to 100kbps for each call. Also, be sure that the Asterisk application is given higher priority over other applications running on the machine (and avoid having the Asterisk server host other applications such as a web server).

Improper sip.cof Settings

Asterisk is very picky about the SIP configuration since this determines how it will handle incoming calls. The example configurations should get you up and running with Gizmo pretty easily. If you want to use another SIP provider, for public telephone network interconnect for example, be sure to follow their configuration instructions exactly, and test, test, test, and test.

Improper Dial Plan Settings

Asterisk's dial plan, which determines how calls will be handled once answered, is very powerful but also easy to break. I recommend sticking with a simple default dial plan that answers all incoming calls exactly the same way:

  1. Answer call
  2. Play a greeting and prompt user for three or four digit extension
  3. Send call to Meet Me conference (same as three or four digit extension number)
  4. Play error message if incorrect extension entered, go back to step 2

If you do not really know what you are doing, I do not recommend setting up direct inward dialing where you may have SIP phone numbers routed directly to specific conference rooms or extensions. This is a convenient feature for users, but it is very easy to botch the configuration and not notice it. It is better to force callers to dial a few digits into an auto-attendant, that way all you need to do to verify that the system is answering calls correctly is to call in and if you hear the greeting, you know its working.

Brian McConnell is an inventor, author, and serial telecom entrepreneur. He has founded three telecom startups since moving to California. The most recent, Open Communication Systems, designs cutting-edge telecom applications based on open standards telephony technology.

Return to the O'Reilly Emerging Telephony

Copyright © 2009 O'Reilly Media, Inc.