High Availability (HA) Asterisk solutions, once reserved for mission critical deployments, are now a part of every normal setup. With VoIP, clustering solutions depend on moving the IP traffic to a working server. Setting up a main and standby Asterisk system allows continuous availability of such a working Asterisk system. But telephony is more than a data system using IP traffic and such an HA arrangement is inadequate in ensuring the continuation of all the on-going calls at the time of the hardware or software failure.  Going beyond this high availability for Asterisk, is the patented call survival method (US Patent US 20110310773 A1) and system that keeps calls alive while providing high availability.

A call center software manages hundreds of calls in different queues, connecting them appropriately. The call center ACD is a layer above the PBX which controls the routing through skills based routing and queue prioritization. When a software or hardware failure is encountered, all the on-going conversations and calls in the queue are lost. HA for Asterisk will get your system ready for future calls. With Call survival, the callers will be able to continue their on-going conversations or calls without the need to re-initiate. Implementation of call survival in call center solutions offers a redundancy beyond the normal high availability solutions implemented for Asterisk based call centers.

Too many disks

Don't do this


It’s increasingly common for users of Asterisk who have to manage a large number of recordings to want to push their backlog of recordings to the Cloud. It saves on local storage, and is nearly infinitely

expandable. The conversation often comes around to Amazon S3. It has a number of advantages, including capacity, a reasonable cost per gigabyte, and compatibility with Glacier, which offers long-term storage capacity at a lower cost per gigabyte. Amazon also has APIs that can be used to interact with your storage.

There are a number of ways you can get your recordings into the Cloud. s3cmd is a command-line tool that is fairly straightforward to configure and can be installed in Linux distributions such as Ubuntu fairly easily. In the case of Ubuntu, a simple

apt-get install s3cmd

will install it.

Accessing the files can be straightforward as well. Amazon provides some tools. Indosoft Q-Suite, which was designed to present recordings from multiple Asterisk servers, also has support for recordings in Amazon S3. Simply updating the database record when the file is moved is enough to get the job done.

There is a discussion of this in a bit more depth here and an example of a multi-process, locking bash script to move recordings to S3 is available here.

Our multi-tenant PBX recently came under a dictionary attack. Somebody was trying to brute force SIP registrations in order to gain access to our system for calls. This is something that happens from time to time when you have your Asterisk server sitting on the Internet. We do have a large number of devices that may have to register from unknown locations, so our firewall has to be fairly permissive as far as ports go. Instead, we have had good results with Fail2ban, which detects unsuccessful connection attempts and blocks the source IP after a certain number of failures.

We were surprised to see that fail2ban was not actually killing the dictionary attack in this case. We did see the required number of failed registration attempts, but the attack continued. Rather than wait while we determined the issue with fail2ban, we simply blocked the source IP in our firewall, expecting that to resolve the issue. It did not.

Most firewall rules allow established connections to continue. Even though UDP is stateless and we only use SIP over UDP, the firewall determined that the connection had been established and the attack was continuing over this established attack. Our sysadmin turned to the utility “conntrack”. It allows you to look at the connections that the Linux kernel is aware of and, among other things, allows you to delete connections. We chose to delete the connection. Once we did so, the firewall rules applied and the attack ended.

Another description of the attack and resolution can be found here.

This patch is for users who are trying to connect Asterisk to a trunk or gateway that doesn’t allow a caller-id. Normally when you set it blank, it will fill in “asterisk” as the ID.

Some providers or devices don’t allow a user in the From: field at all. In those cases, you will need a quick little patch to allow it to be blank. If a caller-id is specified on the channel, it will get passed through.

--- channels/sip/include/sip.h  2013-01-09 16:30:25.000000000 -0400
+++ channels/sip/include/sip.h  2013-06-26 13:52:03.713476705 -0300
@@ -184,7 +184,7 @@
 #define DEFAULT_MOHINTERPRET   "default"  /*!< The default music class */
 #define DEFAULT_MOHSUGGEST     ""
 #define DEFAULT_VMEXTEN        "asterisk" /*!< Default voicemail extension */
-#define DEFAULT_CALLERID       "asterisk" /*!< Default caller ID */
+#define DEFAULT_CALLERID       "" /*!< Default caller ID */
 #define DEFAULT_MWI_FROM       ""
 #define DEFAULT_NOTIFYMIME     "application/simple-message-summary"
 #define DEFAULT_ALLOWGUEST     TRUE
--- channels/chan_sip.c 2013-06-26 13:45:36.202153235 -0300
+++ channels/chan_sip.c 2013-06-26 13:44:47.912153728 -0300
@@ -12495,9 +12495,9 @@

        ourport = (p->fromdomainport) ? p->fromdomainport : ast_sockaddr_port(&p->ourip);
        if (!sip_standard_port(p->socket.type, ourport)) {
-               snprintf(from, sizeof(from), "\"%s\" <sip:%s@%s:%d>;tag=%s", n, tmp_l, d, ourport, p->tag);
+               snprintf(from, sizeof(from), "\"%s\" <sip:%s%s%s:%d>;tag=%s", n, tmp_l, ast_strlen_zero(tmp_l) ? "" : "@", d, ourport, p->tag);
        } else {
-               snprintf(from, sizeof(from), "\"%s\" <sip:%s@%s>;tag=%s", n, tmp_l, d, p->tag);
+               snprintf(from, sizeof(from), "\"%s\" <sip:%s%s%s>;tag=%s", n, tmp_l, ast_strlen_zero(tmp_l) ? "" : "@", d, p->tag);
        }

        if (!ast_strlen_zero(explicit_uri)) {

 

Voicemail ButtonIt’s very often the case that when using Asterisk-based call center ACD software, we want some calls to be directed to a voicemail box. This may be simply a call to the extension of someone who is busy or away from their phone, or could be a community voicemail for callers who have exited the queue.

Back in the day, your options were limited when you were running multi-server call center software. If a call came in to Asterisk server A, the voicemail application on Asterisk server B would be unaware of the message. The voicemail application that comes with Asterisk only has one valid option in this case; sending the voicemail message via email. This is not always what works in the call center environment, so a second solution can sometimes be engineered. Using a shared file system or file synchronization allows both voicemail systems to work with the same set of files and prompts. There are, of course, issues with both of these. Shared filesystems are sometimes unavailable to one system or another due to drivers or connectivity problems. File synchronization is usually not immediate, and periodic syncing leaves gaps where changes or messages may not be available.

Database-backed voicemail has been around for a few years now, and is the default setting for Q-Suite installs. It supports the sending of voicemails as well, but allows instant updates to voicemail prompts on all Asterisk servers tied to a particular database, as well as immediate access to new voicemail messages. This makes it perfect for failover situations as well. ODBC drivers are available for multiple databases, and allow it to be used with Cloud-based database systems like Amazon RDS.

Cloud based call center software cater to very large systems. Asterisk is by far the most widely used telephony platform. As a  natural evolution, the use of Asterisk in both Cloud and large premise based installations have come a long way. Technology for call center software is to some extent driven by the ‘assemble and build’ mode where various accessory technology element available in software form come together to deliver the final solution. Call center software depends on the underlying PBX technology and other technologies for web, database, SIP, and redundancy.

Redundancy and High Availability (HA) for data systems does not have the complexity associated with providing a fail-over mechanism in voice telephony where the two telephone end points of an established call need to be re-connected. In most cases, HA for a VoIP system is the immediate availability of a redundant system. The growth of  VoIP based voice telephony has presented a opportunity that has been well exploited in the call survival mechanism embodied in Q-Suite HA. The contribution of Asterisk in such advancements is immense as it allows the developers of the call center software to focus on these frontiers by doing the heavy lifting necessary in SIP, digital telephony, and interoperability.

A large Asterisk based contact center in the cloud or in customer premise will have many Asterisk, Web, and Database servers under the control of the call center ACD. Applying call recovery and initiating call survival requires a more complex and robust system that can manage fail-overs without the loss of on-going calls. The redundancy offered through call survival driven High Availability for Asterisk contact centers offers the reliability for mission critical implementations in VoIP.

ClusterLoad balancing in Asterisk can be an overloaded term. In some cases, it refers to spreading calls to multiple servers. In others, it refers to calls made outbound. There are other cases as well. The two cases mentioned are two that are not handled by Asterisk out of the box, and additional software may need to be introduced in order to handle them. In multi-server Asterisk call center installs, load balancing allows calls to be distributed more evenly which prevents overloading any particular server.

One method to do this is employing a SIP proxy. The proxy should be configurable enough that it can make decisions about where the call should be directed in realtime while taking into account changing conditions on the server. For instance, if an Asterisk server becomes unavailable or overloaded, it should be possible to remove that server from the active list. Allowing outbound calls from multiple servers is also a must to avoid having to have a trunk for each Asterisk server.

Indosoft’s Q-Suite has a High Availability SIP proxy that combines these features along with an Overseer that monitors the health of each Asterisk server and alerts the SIP proxy of a server’s availability. Selection of servers can also be made on a per-trunk basis if needed. This intelligent SIP proxy also includes patented technology for call survival. These additional features provide a high availability Asterisk call center solution that’s suitable for a wide variety of applications.

There’s a patent troll going after Asterisk users / integrators. The specific patent is related to using DTMF to mute yourself while in a conference. You can apply the following patches to protect yourself. This doesn’t remove the prompt from the menu, but it won’t allow the feature to work, therefore keeping you safe from any extortion attempts.

This patch is for Asterisk 1.8 and the Meetme and Confbridge applications:

diff -u -r apps/app_confbridge.c asterisk-1.8.23.0-meetme/apps/app_confbridge.c
--- apps/app_confbridge.c       2013-01-02 12:54:20.000000000 -0400
+++ apps/app_confbridge.c       2013-08-15 16:25:18.000000000 -0300
@@ -665,13 +665,7 @@
        digit = ast_waitstream(bridge_channel->chan, AST_DIGIT_ANY);
        ast_stopstream(bridge_channel->chan);

-       if (digit == '1') {
-               /* 1 - Mute or unmute yourself, note we only allow manipulation if they aren't waiting for a marked user or if marked users exist */
-               if (!ast_test_flag(&conference_bridge_user->flags, OPTION_WAITMARKED) || conference_bridge->markedusers) {
-                       conference_bridge_user->features.mute = (!conference_bridge_user->features.mute ? 1 : 0);
-               }
-               res = ast_stream_and_wait(bridge_channel->chan, (conference_bridge_user->features.mute ? "conf-muted" : "conf-unmuted"), "");
-       } else if (isadmin && digit == '2') {
+       if (isadmin && digit == '2') {
                /* 2 - Unlock or lock conference */
                conference_bridge->locked = (!conference_bridge->locked ? 1 : 0);
                res = ast_stream_and_wait(bridge_channel->chan, (conference_bridge->locked ? "conf-lockednow" : "conf-unlockednow"), "");
diff -u -r apps/app_meetme.c asterisk-1.8.23.0-meetme/apps/app_meetme.c
--- apps/app_meetme.c   2013-05-06 12:52:16.000000000 -0300
+++ apps/app_meetme.c   2013-08-15 16:20:39.000000000 -0300
@@ -2312,24 +2312,6 @@
 static void meetme_menu_normal(enum menu_modes *menu_mode, int *dtmf, struct ast_conference *conf, struct ast_flags64 *confflags, struct ast_channel *chan, struct ast_conf_user *user)
 {
        switch (*dtmf) {
-       case '1': /* Un/Mute */
-               *menu_mode = MENU_DISABLED;
-
-               /* user can only toggle the self-muted state */
-               user->adminflags ^= ADMINFLAG_SELFMUTED;
-
-               /* they can't override the admin mute state */
-               if (ast_test_flag64(confflags, CONFFLAG_MONITOR) || (user->adminflags & (ADMINFLAG_MUTED | ADMINFLAG_SELFMUTED))) {
-                       if (!ast_streamfile(chan, "conf-muted", chan->language)) {
-                               ast_waitstream(chan, "");
-                       }
-               } else {
-                       if (!ast_streamfile(chan, "conf-unmuted", chan->language)) {
-                               ast_waitstream(chan, "");
-                       }
-               }
-               break;
-
        case '2':
                *menu_mode = MENU_DISABLED;
                if (user->adminflags & (ADMINFLAG_MUTED | ADMINFLAG_SELFMUTED)) {
@@ -2392,26 +2374,6 @@
 static void meetme_menu_admin(enum menu_modes *menu_mode, int *dtmf, struct ast_conference *conf, struct ast_flags64 *confflags, struct ast_channel *chan, struct ast_conf_user *user)
 {
        switch(*dtmf) {
-       case '1': /* Un/Mute */
-               *menu_mode = MENU_DISABLED;
-               /* for admin, change both admin and use flags */
-               if (user->adminflags & (ADMINFLAG_MUTED | ADMINFLAG_SELFMUTED)) {
-                       user->adminflags &= ~(ADMINFLAG_MUTED | ADMINFLAG_SELFMUTED);
-               } else {
-                       user->adminflags |= (ADMINFLAG_MUTED | ADMINFLAG_SELFMUTED);
-               }
-
-               if (ast_test_flag64(confflags, CONFFLAG_MONITOR) || (user->adminflags & (ADMINFLAG_MUTED | ADMINFLAG_SELFMUTED))) {
-                       if (!ast_streamfile(chan, "conf-muted", chan->language)) {
-                               ast_waitstream(chan, "");
-                       }
-               } else {
-                       if (!ast_streamfile(chan, "conf-unmuted", chan->language)) {
-                               ast_waitstream(chan, "");
-                       }
-               }
-               break;
-
        case '2': /* Un/Lock the Conference */
                *menu_mode = MENU_DISABLED;
                if (conf->locked) {

This patch is for Asterisk 11 and for the Confbridge application:

--- apps/app_confbridge.c.old   2014-09-16 15:08:27.000000000 -0300
+++ apps/app_confbridge.c       2014-09-16 15:10:06.000000000 -0300
@@ -2039,11 +2039,6 @@

        AST_LIST_TRAVERSE(&menu_entry->actions, menu_action, action) {
                switch (menu_action->id) {
-               case MENU_ACTION_TOGGLE_MUTE:
-                       res |= action_toggle_mute(conference_bridge,
-                               conference_bridge_user,
-                               bridge_channel->chan);
-                       break;
                case MENU_ACTION_ADMIN_TOGGLE_MUTE_PARTICIPANTS:
                        if (!isadmin) {
                                break;

Deciding whether to migrate a large call center away from a TDM-based PBX to VoIP-based Asterisk can be difficult. Any site wishing to do that would need to decide whether to go it alone, or use an existing contact center solution. Using an existing solution may cost more upfront, but you’ll have the advantage of not having to develop all the screens and reports yourself.

One of the biggest decisions would be whether to use a hosted service, on-premises system, or a hybrid of both. In many cases, it would be more economical to retain existing telephony infrastructure. Adapters and gateways allow easy conversion to VoIP but still require some equipment to be on site. The hybrid solution can keep the voice traffic on the premises to reduce the opportunity for delay or network lag.

As with any large software installation, there will be costs to manage the hardware and software. Many of these costs can be defrayed by selecting a vendor that will manage the servers as a managed service. This will leverage the economies of scale and allow the vendor to provide a high value service. This will essentially give the call center the advantages of both on-site and hosted service.

Moving from a closed PBX to an open VoIP implementation will reap great benefits for your call center. It is a significant upgrade from previous technologies so you will need to adjust business processes to allow you to make the best use of them.

Cloud offering of call center software and infrastructure as a service, catering to on-demand growth,  has greatly simplified the task of setting up a call center operation. Personal computer (PC) and adequate bandwidth are the minimum requirements to get started. Cloud service providers deploying Asterisk based contact centers around the world, take advantage of the language support and localization capabilities within Asterisk.

For larger deployments, the contact center software will manage multiple Asterisk servers. In the case of multi-tenant deployment, the call center ACD may have to support different languages for different tenants. For example, any cloud service setup for Europe as a multi-tenant contact center, will require to support different languages out of the same installation from the get go. The self service requirements which are critical to the scaling of  the cloud contact center deployments, offer user interfaces that are highly GUI driven.

Some contact center software offer language support and localization for Cloud based multi-tenant contact centers, out-of-the-box. This requires a greater level of sophistication in the software to handle language pack and sound files individually for different tenants within the contact center ACD. A true multi-tenant setup spans over multiple servers without dedicating separate Asterisk servers individually to each tenant. Using Asterisk as the underlying telephony platform definitely is a great advantage for setting up  feature-rich, multi-tenant, call center solutions in the cloud. It is a given that more and more service providers will migrate to Asterisk to offer distributed cloud based contact center services.