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 –

/etc/asterisk/sip_general_custom.conf

jbenable=yes
jbimpl=adaptive

 

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 outbound call status page

I recently wrote this as a simple web page to show the current calls in progress on an Asterisk PBX. It was written for an A2Billing system.

It just runs a ‘core show channels concise’ and then shows lines that contain certain text. By default it shows lines that are ‘Up’ and running the ‘Dial’ application, but this could be changed. It uses twitter bootstrap to add some formatting to the table.

The div containing the table is refreshed every 3 seconds. This is what it looks like –

SysAdminMan active calls

Continue reading

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 –

disallowed_methods=UPDATE

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

AstriCon – the place to be for Asterisk users, developers and implementers

This year the 10th Annual AstriCon is being held in Atlanta from the 8th – 10th October.

If you use Asterisk in your organisation, or implement Asterisk for other organisations, then AstriCon is packed full of useful sessions on current usage possibilities and the future direction of Asterisk.

There are also lots of sessions regarding Asterisk/VoIP security, which everyone should be paying attention to!

For more information check out the AstriCon website – http://www.asterisk.org/community/astricon-user-conference

If you decide to book then use the special promo code “AC13BLO” for a 20% discount on the price of an AstriCon pass

Understanding latency and packet loss with mtr

If you have call quality issues with VOIP then one of the first things to check is if there is any packet loss or unexpected high latency on the network connections. A great tool for this is called ‘mtr’.

However, I often see some misunderstanding of the reports produced by mtr.

I was going to write a guide to mtr but there is a really good one already that you can find here – https://library.linode.com/linux-tools/mtr

Two of the most important things the post highlights can be summarised like this …

Packet loss

This packet loss is OK …

[email protected]:~# mtr --report www.google.com
HOST: ducklington               Loss%   Snt   Last   Avg  Best  Wrst StDev
  1. 63.247.74.43                  0.0%    10    0.3   0.6   0.3   1.2   0.3
  2. 63.247.64.157                50.0%    10    0.4   1.0   0.4   6.1   1.8
  3. 209.51.130.213                0.0%    10    0.8   2.7   0.8  19.0   5.7
  4. aix.pr1.atl.google.com        0.0%    10    6.7   6.8   6.7   6.9   0.1
  5. 72.14.233.56                  0.0%    10    7.2   8.3   7.1  16.4   2.9
  6. 209.85.254.247                0.0%    10   39.1  39.4  39.1  39.7   0.2
  7. 64.233.174.46                 0.0%    10   39.6  40.4  39.4  46.9   2.3
  8. gw-in-f147.1e100.net          0.0%    10   39.6  40.5  39.5  46.7   2.2

This packet loss is BAD …

[email protected]:~# mtr --report www.google.com
HOST: localhost                   Loss%   Snt   Last   Avg  Best  Wrst StDev
  1. 63.247.74.43                   0.0%    10    0.3   0.6   0.3   1.2   0.3
  2. 63.247.64.157                  0.0%    10    0.4   1.0   0.4   6.1   1.8
  3. 209.51.130.213                60.0%    10    0.8   2.7   0.8  19.0   5.7
  4. aix.pr1.atl.google.com        60.0%    10    6.7   6.8   6.7   6.9   0.1
  5. 72.14.233.56                  50.0%    10    7.2   8.3   7.1  16.4   2.9
  6. 209.85.254.247                40.0%    10   39.1  39.4  39.1  39.7   0.2
  7. 64.233.174.46                 40.0%    10   39.6  40.4  39.4  46.9   2.3
  8. gw-in-f147.1e100.net          40.0%    10   39.6  40.5  39.5  46.7   2.2

Latency

If you’re expecting a ping/latency of around 40ms this is OK (even with a 254ms latency along the route) …

[email protected]:~# mtr --report www.google.com
HOST: localhost                   Loss%   Snt   Last   Avg  Best  Wrst StDev
  1. 63.247.74.43                  0.0%    10    0.3   0.6   0.3   1.2   0.3
  2. 63.247.64.157                 0.0%    10    0.4   1.0   0.4   6.1   1.8
  3. 209.51.130.213                0.0%    10    0.8   2.7   0.8  19.0   5.7
  4. aix.pr1.atl.google.com        0.0%    10    6.7   6.8   6.7   6.9   0.1
  5. 72.14.233.56                  0.0%    10  254.2 250.3 230.1 263.4   2.9
  6. 209.85.254.247                0.0%    10   39.1  39.4  39.1  39.7   0.2
  7. 64.233.174.46                 0.0%    10   39.6  40.4  39.4  46.9   2.3
  8. gw-in-f147.1e100.net          0.0%    10   39.6  40.5  39.5  46.7   2.2

If you’re expecting latency of a lot less than 400ms then this report is BAD …

[email protected]:~# mtr --report www.google.com
HOST: localhost                   Loss%   Snt   Last   Avg  Best  Wrst StDev
  1. 63.247.74.43                  0.0%    10    0.3   0.6   0.3   1.2   0.3
  2. 63.247.64.157                 0.0%    10    0.4   1.0   0.4   6.1   1.8
  3. 209.51.130.213                0.0%    10    0.8   2.7   0.8  19.0   5.7
  4. aix.pr1.atl.google.com        0.0%    10  388.0 360.4 342.1 396.7   0.2
  5. 72.14.233.56                  0.0%    10  390.6 360.4 342.1 396.7   0.2
  6. 209.85.254.247                0.0%    10  391.6 360.4 342.1 396.7   0.4
  7. 64.233.174.46                 0.0%    10  391.8 360.4 342.1 396.7   2.1
  8. gw-in-f147.1e100.net          0.0%    10  392.0 360.4 342.1 396.7   1.2

Go read the guide to find out more and read a description of the traces above – https://library.linode.com/linux-tools/mtr

Using SysAdminMan OpenVPN template with pfSense

I’ve had a few customers recently using the SysAdminMan VPN:PBX template with an existing on-site pfSense gateway. The VPN:PBX template has Asterisk, FreePBX and A2Billing installed, along with OpenVPN setup to allow secure connections to the VPS.

pfSense can be used as an OpenVPN client/gateway so this makes a great combination for a secure off-site PBX.

Here are some setup instructions for configuring pfSense with the SysAdminMan VPN:PBX template.

1 – Obtaining the OpenVPN client certificates

When your SysAdminMan server is created 3 files will be generated that are required to configure pfSense as an OpenVPN client. These files can be e-mailed to you or retrieved from the VPS using a program like WinSCP. The 3 files are –

/etc/openvpn/keys/ca.crt
/etc/openvpn/keys/tplink.key
/etc/openvpn/keys/tplink.crt

These 3 files identify an individual OpenVPN client. If you are just connecting a single gateway this is all you will need. If you’d like instructions for creating more certificates please open a support ticket.

2 – Installing the Certificates on pfSense

Next we need to install the 3 certificates above in pfSense. The 3 files (ca.crt, tplink.key and tplink.crt) are text files which we can open with notepad, or something similar, and copy and paste the contents in to the correct place in pfSense.

First select “System/Cert Manager” from the pfSense menu. Then we click to add a CA –

pfsense add CA

Continue reading

VoIP latency (ping) test for SysAdminMan servers

I get asked quite a lot for example IP addresses that potential customers can ping to get an idea of latency to the SysAdminMan servers.

You can ping the following addresses to get an idea of latency –

UK Server – ping uk-test.sysadminman.net
US Server – ping us-test.sysadminman.net

Latency below 150ms should be fine – http://voip.about.com/od/glossary/g/latency.htm

The UK servers should work well for customers in Europe and the US servers for customers in the US and Canada.

If you see unexpectedly high latency to either of the test servers please get in touch and we can look to see where the delay is being introduced.

Tech-Vets podcast

I’m a big fan of podcasts. If you commute, or are able to listen during the day while working, it’s a great way to keep up to date with what’s going on in the tech industry.

This month SysAdminMan is sponsoring the Tech-Vets podcast which is produced by Mike Smith and Carey Holzman where they talk about their experiences of running two small IT businesses. Even if you’re not in exactly the same market it’s often an interesting discussion on getting and retaining customers and the general ups and downs of running your own company.

As there is not too much focus on current technology the previous episodes age well. Why not check them out here – http://tech-vets.com/

My other favourite podcasts are –

Security Now – http://twit.tv/sn

FLOSS Weekly – http://twit.tv/show/floss-weekly

Linux Outlaws – http://sixgun.org/linuxoutlaws

This Week in Tech – http://twit.tv/show/this-week-in-tech

VOIP Users Conference – http://www.voipusersconference.org/

And if you’re looking for an App on Android to use for listening and managing podcasts then check out BeyondPod in the Google App Store

Using iPhone Media 5 as a FreePBX extension

I wanted to setup extensions on my Free PBX system. This will allow me to transfer calls to different users, fantastic. I am not keen on spending extra cash in extra handsets, I am keen to use mobile phones we already have as our extensions, I can only talk to one person at a time. The technical word I need is soft phone. I can also use these types of phone through a laptop too.

Before I used the soft phone, I found the blog post Using Android with FreePBX – a SIP extension for free really helpful

We have iPhones I am advised that the. X-Lite is great on Android phone and PC but it won’t work in background on iPhone.  By background, I mean when the app isn’t active – so potentially no incoming calls.

Instead we are using Media5-fone Pro VoIP SIP Mobile Softphone, it is the unique SIP Softclient with Wideband and HD Voice Audio Quality for the iPhone/iPad/iPod Touch, it requires Requires iOS 4.3 or later. The Media5 Facebook page has up to date information about the product too.

You install the Media5 fone on your iPhone like any other app. When you open the app it looks like you are using a normal handset, except the Media5 phone is linked to your FreePBX. You can still come away from the app and use your mobile phone as usual.

Linking the Media5 fone to the FreePBX was easy. I had to enter my username (extension) and password / secret and was away.

Fun with Freeswitch and FusionPBX audio using soundtouch

FusionPBX is definitely more difficult to setup than FreePBX, but it does give you direct access to the dial plan which makes it fairly straight forward to do some advanced call handling.

In this example I’m going to set up and inbound number and then create an echo test that manipulates the callers voice, before echoing it back to them.

Inbound Number with UKDDI

First I’m going to create an Inbound Number with UKDDI and forward it to my FusionPBX server –

UK DDI inbound number

Inbound Number in FusionPBX

Next I create a ‘Destination’ in FusionPBX –

FusionPBX destination

Continue reading