Tag Archives: sip

Monitoring your Peers (Asterisk extensions) and Trunks

As an admin for a telephone system, possibly one of the most useful things you can do is monitoring your peers and trunks. There are 2 great reasons you should do so:

1. You can respond to and resolve issues with your system before your users know about it, and you can be in the know if someone reports “none of the phones are working” when in fact only 1 or 2 are not working

2. You can actually know when there is a problem with the system – where you otherwise might not know there is a problem until someone calls on your mobile to say your office number is not working


I have 2 scripts running every 15 minutes to email me with the details of any down extensions and trunks. This is done in Crontab with the line:

*/15 8-18 * * Mon-Fri /usr/Peermonitor.sh

and similar for Trunkmonitor.sh. This line says to run every 15 minutes between 08:00 and 18:00 every Monday-Friday

Continue reading

Improving Asterisk call quality with SIP jitter buffers

I had a customer let me know that they had improved their call quality from WiFi and 3G connections by turning on the Asterisk jitter buffers for SIP connections. If you have any extensions where connection quality is intermittent it could be worth trying.

This can by done with the FreePBX SIP Settings module or by adding the following lines to –




After changing you should restart Asterisk or ‘sip reload’ from the console.

If you are just using Asterisk the change would go in the [general] section of sip.conf

If you try this option and notice any difference to call quality please post a comment below. Thanks!

Asterisk call drops after 30 seconds – SIP disallowed_methods

I had a customer today struggling with an issue where certain incoming calls were being automatically dropped after around 30 seconds. They did some debugging and found the solution that I thought I’d share.

In this case it only affected incoming calls to an IVR, but I’ve since read other reports of it affecting certain outgoing calls. It’s caused by a call provider ignoring SIP UPDATE messages sent by Asterisk. After a certain number of these messages are ignored the call gets disconnected.

You can only really tell if this is the cause of the call being disconnected by capturing the SIP packets and checking what’s going on but the SIP UPDATE messages can be disabled in Asterisk by adding –


to the SIP trunk in question.

At least 2 providers that seem to do this are CallCentric and Spitfire. For more information see here – http://forums.asterisk.org/viewtopic.php?f=1&t=80237

Another possible cause of calls dropping are SIP session timers

Using Android with FreePBX – CSipSimple extension

I’ve used a few different Android SIP clients as extensions on FreePBX and my current favourite is CSipSimple

Installation and setup is straight forward. There are several built in configuration profiles for call providers, or you can choose advanced and enter your FreePBX server details to use CSipSimple as a FreePBX extension.

CSipSimple account setupCSipSimple add accountCSipSimple Registered Account

Continue reading


New or novice users my find this basic glossary useful when using their Asterisk VOIP, a few telephone industry acronyms

CDR: Call Data Records or Call Detail Records.  These are logs of calls that have passed through the phone system.

GUI: Usually pronounced “gooey”,  Acronym for Graphical User Interface, the graphical administration software used to manipulate the phone system

Inbound call: This is a call from a regular telephone number to your PBX. Also referred to as Origination

ITSP:  Acronym for Internet Telephony Service Provider. This is a company that allows calls to and from ‘normal’ telephone numbers (PSTN)

NGN: Acronym for Non Geographic Numbers, such as 0845 in the UK

Outbound call: This is a call from your VOIP PBX to a regular telephone number. Also referred to as Termination

PBX: This stands for Private Branch Exchange, it is an old fashioned term for a phone system

PSTN: Public Switched Telephone Network. This is a term used to described the ‘normal’ telephone network. Non VOIP landline and mobile/cell telephone numbers.

SIP: A communication protocol for phones, a language to make phones and phone systems, talk to each other

Trunk: A link to another phone system or call provider. For example you would have a ‘trunk’ to your call provider (ITSP). Your system would send VOIP calls down the trunk to your call provider, they would send the call to it’s destination (a landline or mobile)

IP authentication in A2Billing using SIP

When you create a SIP enabled account in A2Billing then by default it will be setup to use username/secret authentication. If you want to use IP authentication (where the A2Billing customer uses a fixed IP address to authenticate to you instead) then there are a few settings to change on the SIP account.

This guide was done using A2Billing v1.9.4 and the SIP accounts are created under the “CUSTOMERS/VoIP Settings” menu. Previous versions had a different menu name, but the general idea is the same.

After creating the SIP account check the following –

Change HOST to the IP address of the customer –


Change TYPE to ‘peer’ –


Set USERNAME to be blank –


Set SECRET to be blank –


HTC Desire, Android Gingerbread and Asterisk

I’ve been running the LeeDroid ROM on my HTC Desire for a while now but after trying to upgrade to the latest version went a little haywire I decide to see what other options there were.

I wanted to run Android 2.3 – Gingerbread – but HTC havn’t released their HTC Sense for the Desire/Gingerbread combination yet, so if you want to run Android 2.3 you can, just without Sense.

I installed CyanogenMod 7.0.2 which is based on Android 2.3.3. The install was easy on my rooted Desire and after having it for a day I don’t think I’ll miss HTC Sense.

One really nice feature is the addition of a SIP stack as standard. I was able to type in the name of my Asterisk server, plus the extension and secret, and start making calls immediately. I’ve used SipDroid before but the integration of SIP in Gingerbread seems much nicer.

I called my Asterisk voicemail over both WiFi and 3G without any problems but, as always with VOIP and WiFi/3G, you are going to want a good signal and not be moving around to get acceptable results.

Here are some screenshots of my Gingerbread install –

The Internet Call option settings in GingerbreadSelecting Internet Calling optionsAsterisk SIP settings

Choosing whether to make the call over VOIPAn Asterisk voicemail call in progress

Limiting SIP/IAX connections to Asterisk with IPTables

WARNING: be very careful when editing IPTables firewall rules. It is relatively easy to completely disable access to your machine.

All Sysadminman VPSs come with IPTables enabled. However to allow for VOIP traffic both SIP and IAX ports are opened.

If you know that your VOIP providers and all extensions are on fixed IP addresses then it is possible to limit connections to just those addresses.

Continue reading

No audio with certain Asterisk calls

I had an unusual problem recently with certain calls going to the PSTN via a SIP provider. The call would connect but with no audio at either end.

I’ve seen this lots before and is often caused by NAT or a firewall blocking the audio stream but that wasn’t the cause this time.

The problem was caused my trunk only being setup to allow the ulaw codec (allow=ulaw on the trunk). What I think was happening was that my provider was accepting, and connecting, the call but then when it tried to hand the call off to it’s upstream provider, which only accepted alaw, it would fail.

So if you’re having problems with connected calls but no audio it might be worth enabling all of the codecs on the trunk to rule out any codec mismatch issues.

If that doesn’t help look at NAT or firewalling  🙂