Asterisk LibPRI outbound MOH fix

This is a very simple and effective ‘work around’ for the popular Asterisk outbound Music on Hold (MOH) issue. This is a default Asterisk setting that will play your own MOH on an outbound call, which has proved to be problematic. More often than not, and all the time with certain dialed numbers (depending on the dialed company’s PBX system), the caller (you) is put on hold, and your Asterisk system plays your [default] MOH music. When the call is unholded by the remote party, the call on your side is not retrieved, resulting in your MOH being played indefinitely, loosing the call – very unprofessional, and you are guaranteed this will happen to your CEO, to his most frequent dialed business partners !

Reason: Within the Asterisk Kernel, it is coded to play the [default] Message on Hold (MOH) class, which is the same for all calls made internally to another extension. You can create many MOH classes, but only the [default] is used for external calls. It is also a bug in the way LibPRI processes ISDN on-hold frames, and won’t be fixed in current Asterisk 1.4, but will be an option to turn this off in DAHDI Asterisk 1.6 (so I have read). We have tried and tested 1.6, and was introduced to a whole new range of problems (other advice – stick to 1.4!). Asterisk also has issues interpreting certain DTMF tones, so does not know when to unhold a call, because never receives or interprets the unhold tone sent by remote PBX system. On the ‘Outbound Routes’ option in FreePBX, you can set the MOH to none, but does not work, still uses default.

Relates to:

Elastix – My best choice of a complete Asterisk PBX Solution!
Other Asterisk installed by source, possibly on Ubuntu

All the above are available for ISO download, and based on CentOS 5 Core.


a) Hire a very expensive Asterisk Guru to recode your current Asterisk Kernel to suit you (other issues will arise, and you will have to folk out a lot more money)…


b) Simply do it yourself with the tools provided in three easy steps! After many late nights Googling and trying to figure out the Kernel / Code myself, I came up with a very simple, right in front of you, simple solution. The only downfall here, is that internally dialed extensions (you to a work mate) will not play music on hold, the person on hold will only hear silence, which is worth it!

Create a new Music on Hold class, and configure the music.

Firstly browser to your FreePBX GUI, navigate to ‘Music on Hold’, select ‘Add Music Category’, and give it a name. For now I will name it CompanyA.

In your Linux console, this will create a folder in /var/lib/asterisk/mohmp3/CompanyA/

Copy your music from /var/lib/asterisk/mohmp3/ to this new directory:

Change ALL your Inbound Lines and Queues

Next Change ALL your Inbound Lines and Queues within FreePBX GUI to use this new MOH class ‘CompanyA’. You dont have to do this for inbound Fax lines if you are making use of Fax to Email, like Hylafax. I left mine as Default.

You can script this, but its a much longer process to create a script, rather than simply doing it via the GUI. If you backup your asterisk folder, or rsync it, then change a field or two in FreePBX, then run rsync again or diff on the files, it changes more than one config file, and just becomes confusing. Get your IT desktop guy to do the manual work, otherwise please post the script!

Edit config file and restart Asterisk

Finally all you need to do is edit a config file, reload Asterisk, and you’re done!

Comment out the [default] MOH class to point to /dev/null (this deactivates the MOH feature completely for this class). Comment out and add for easy roll-back, always think ahead!

FINALLY – in FreePBX, ‘Reload Asterisk’… and you’re done!

Result: From here, when you make an outbound call, and you are put on hold, you will hear the dialed party’s Music on Hold (or whatever they have) instead of yours. This reassures you that the call has not dropped, and you are still on hold. There is no DTMF tones or frames that your Asterisk box has to interpret, taking the fault away from your side. Your CEO will be happy that now he can actually wait on hold for a board member and not be cut off, and wondering why they called person has not come back to him.

Remus applied to the official Xen repository

The one problem with Xen is transparent high availability of your servers, sure you can snapshot an image but thats only of you shutdown the virtual machine. How excited was I when Remus announced that it has been applied to the official Xen repository, and is expected to be included with the next major release. Bookmark this page for a soon to be released how to install Xen with Remus support on CentOS 5.4!

What is Remus?

Remus provides transparent, comprehensive high availability to ordinary virtual machines running on the Xen virtual machine monitor. It does this by maintaining a completely up-to-date copy of a running VM on a backup server, which automatically activates if the primary server fails. Key features:

* The backup VM is an exact copy of the primary VM. When failure happens, it continues running on the backup host as if failure had never occurred.
* The backup is completely up-to-date. Even active TCP sessions are maintained without interruption.
* Protection is transparent. Existing guests can be protected without modifying them in any way.

For a full description and evaluation, see their NSDI paper.

Visit the project:

Installing Jasper reporting for MySQL on CentOS 5.4

bitnami_stackcentosWhat is BitNami?

BitNami Native Installers automate the setup of a BitNami Stack on Windows, Linux or Mac OS X. Each installer includes all of the software necessary to run out of the box (the Stack). The process is simple; just download, click next-next-next and you are done! BitNami Stacks are completely self contained and will not interfere with other software on your system.

What is Jasper for MySQL?

JasperServer Professional is a high-performance standalone and embeddable report server that provides non-technical business users with:

* Drag and drop ad hoc report building
* Drag and drop dashboarding with live-refresh, and mash-ups with external content
* A rich business metadata layer for easy ad hoc query
* Integrated and in-memory data analysis
* Built-in charting and integration with third-party visualization tools
* Self-service parameterized web reporting
* Report scheduling, distribution and historical versioning
* A secure report and metadata repository
* Access to any data source including relational, XML, Hibernate, EJB, POJO, and custom
* Row and column level data security

Preliminary Note:

I am using a CentOS 5.4 x86_64 base installation in this tutorial

* (IP CentOS 5.4 x86_64 Base installation

Download and Install BitNami JasperSever Stack

In this installation I went ahead and chose all the defaults

Note: if you get this error:

-bash: ./bitnami-jasperserver-3.5.0-0-linux-installer.bin: /lib/ bad ELF interpreter: No such file or directory

make sure the i386 version of ibstdc++ is installed:

Starting and Stopping the JasperServer

Once you have started the JasperServer point your browser to the following URL to access the JasperServer GUI

Now your MySQL reporting can begin.

How to keep a detailed audit trail on your CentOS 5.4 servers

centosThe psacct package contains several utilities for monitoring process activities, including ac, lastcomm, accton and sa. The ac command displays statistics about how long users have been logged on. The lastcomm command displays information about previous executed commands. The accton command turns process accounting on or off. The sa command summarizes information about previously executed commmands. Install the psacct package if you’d like to use its utilities for monitoring process activities on your CentOS 5.4 system.

Installing the psacct package

Use yum command if you are using CentOS 5.4 / Fedora 11 / RHEL 5.4:

Continue reading “How to keep a detailed audit trail on your CentOS 5.4 servers”