Tag Archives: VOIP

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

Test your broadband connection for VOIP

Most broadband connections work really well with VOIP now but any jitter or packet loss will ruin your call quality.

Here’s a neat tool that checks your link for latency, packet loss and jitter. Bear in mind that if you’re running the test on a computer/laptop that’s connected via WiFi you are likely to get much worse results that a physically cabled connection. Running VOIP over WiFi is definitely not recommended.

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  🙂

Using an Iphone 3G with Asterisk and SIP

I’ve been testing an application called SipPhone for the Iphone (http://www.vnet-corp.com/iSip.htm)

It works over WiFi only (obviously, as the mobile providers don’t want you using VOIP rather than paying for their minutes!) and it works pretty well. It was easy to get it registered as an extension on my Asterisk server and start making calls as you would with any other SIP or softphone.

The quality was very good although it will obviously depend on how good your Wifi connection is. I had some trouble getting it to stay registered with my Asterisk server although that will be to do with my setup. My Asterisk server is on a public IP address and my Iphone was on my home WiFi connection, which is behind a NAT router.

I probably could have got it to stay registered by playing around with port forwarding on the router but is wasn’t really worth it due to a bigger problem. Apple do not currently allow 3rd party apps to run in the background on the Iphone. That means as soon as you come out of the SipPhone application it’s no longer running, so you’re no longer connected anyway.

So while it’s great for firing up and making outgoing calls it’s probably not practical for incoming calls. This may change in the future if Apple allow applications to run in the background.

Calculating bandwidth for Asterisk calls

One of the things you need to do when looking for a server to run Asterisk on is figure out how much bandwidth you need for the number of concurrent calls you’re expecting to have.

A great tool for this can be found here – http://www.asteriskguru.com/tools/bandwidth_calculator.php

Just set the codec you’re going to be using (check with your VOIP provider – g.711/ulaw is usual and the highest quality), the connection type (usually SIP or IAX2 with Asterisk) and the number of concurrent calls. It will then display the bandwidth required for that many calls.

One thing to watch out for if you’re planning on mixing codecs (say g.711 on one leg of the call and g.729 on the other) is that your server will have to transcode/convert the audio which is processing intensive.  This may limit the number of concurrent calls your server can handle.

Also don’t forget that if you’re planning on running Asterisk at home your upload speed will normally be a lot slower than the download speed.

Least Cost Routing (LCR) with Asterisk and A2Billing

A2Billing is a great piece of call billing software for Asterisk. It can be integrated with FreePBX and used in lots of different ways.

I run my own Asterisk system with FreePBX and use a2billing to do least cost routing. It’s possible to import rate tables from many different voip providers and then let a2billing route the call based on the cheapest route.

One of the things you need to be aware of is that a2billing will route based on the ‘best matching’ rate. So, lets say you are trying to call +17061234567 and you have rate cards for 2 providers. If provider_a has a rate for +17061 at $0.02/min and provider_b has a rate for +1706 at $0.01/min, a2billing will choose the more expensive provider_a as the rate is a better match. This could require some manipulation of the rate tables to get things to work how you want.

As I said a2billing can also integrate with FreePBX so that you can pass all outgoing calls from FreePBX to A2Billing to allow it to do the routing. You also get the benefit of better CDR reports.

So, if you’re looking for something to do least cost routing for Asterisk then it might be worth checking out a2billing!

Getting started with FreePBX – Part 6 Cheap phone calls using DISA and Callback

One of the great things about voip is that you can make international calls at local rates.  Combine that with Asterisk/FreePBX and you’ve got the ability to make cheap international phone calls using your mobile phone.

To do this we’re going to setup DISA (Direct Inward System Access). This will enable us to ring our Asterisk server, get a dial tone and then dial back out again.

Then I will show you how you can combine this with callbacks if that works out cheaper for you.

Installing the modules

First we need to install the DISA (if it’s not installed already) and Callback modules. See part 5 for more information about installing FreePBX modules.

Setting up DISA

Now we are going to configure a DISA…

Continue reading

Hackers targetting Asterisk boxes

I saw the first ‘externsion scan’ of my Asterisk box this week. That is, an external server tried to register as an extension, starting at extension 100 all the way up to extension 999. I’m assuming if they had found a valid extension number then this would have been been followed by a brute force password (secret) scan.

This is an interesting article explaining the problem a little more – http://michigantelephone.wordpress.com/2008/11/28/why-didnt-freepbx-developers-implement-important-security-patch/

If you’re running Asterisk (and FreePBX) then the least you need to do is make sure that you’ve got pretty strong passwords for your extensions.

CallWithUs launch UK based SIP server

*** UPDATE 23/6/09 – While callwithus still have a UK sip server you should use the server ‘sip.callwithus.com’ in your configuration settings. Check the callwithus website for details.

If you’re based in the UK or Europe and looking for a cheap ITSP (VIOP provider) it might be worth looking at CallWithUS as they’ve recently launched a UK based SIP server.

As well as the US based servers sip.callwithus.com, east.callwithus.com and west.callwithus.com you can now use uk.callwithus.com. I now get sub 6ms pings from my Asterisk server in BlueSquare to the CallWithUs server.

I’ve been using CallWithUs for a while now and they provide very competitively priced DIDs and termination rates.