Category Archives: Asterisk

Asterisk OpenSource PBX

Using a Cisco/Linksys SPA-504G with Asterisk and FreePBX

Below is a quick start guide for getting a Cisco/Linksys SIP handset up and running with Asterisk/FreePBX.

Both Linksys & Cisco phones have almost identical web admin setup pages but the layout and design differ slightly, setup procedures are identical for both.


Firstly plug the phone into the network via cat5 network cable (If you have 2 switch ports beneath the phone you want to use the port marked “SW”, don’t bother routing through the PC…it wont work well) and connect the power supply and plug in.
The phones get configured via a web interface, to do this you must first know the IP address of the phone. Shown below.

cisco spa504g config button

  •  Then Press “9” for network options
  • See where it says “Current IP” and type it into your web browser

Humbug – Google Analytics for your Asterisk server

I came across a very interesting service today from a company called Humbug Labs.

Humbug Labs

It’s billed as the telecoms equivalent to Google Analytics, and I think that gives you a good idea what it’s about. You install a small application on your Asterisk server that feeds the CDR records to their cloud platform.

Once there you can do lots of interesting analysis, reporting and alerting. It produces nice graphs on traffic flows and can aggregate statistics from multiple PBXs.

Perhaps the most interesting feature is the realtime fraud alerting. You can create custom alerts that trigger on defined traffic patterns. For example – if your PBX should have no outgoing calls between 20:00 and 06:00 then you can create a rule that will alert if outbound calls are placed during these times. Alerts can be via e-mail or SMS.

There are lots of alert filters including time of day, day of week, built in blacklists, call duration …

The guys at Humbug Labs plan to introduce premium paid-for features later in the year but to keep the analytics service free.

I’ve yet to do some proper testing with a production server but I think this has the potential to be an excellent addition to any Asterisk installation.

Here are some screen shots. Sign up and give it a go. Please post a comment below with your experiences!

Humbug Statistics

Humbug Alerts

Asterisk scanning with SIPVicious

A while back I wrote a blog post describing what SIPVicious was and how to scan your server with it –

I would recommend doing this to your own Asterisk server because even if you don’t, someone else will be!

One of the annoyances of older versions of SIPVicious was that even if you blocked the incoming traffic (using something like fail2ban) SIPVicious didn’t care and would carry on sending scanning packets, even though it got no reply to them. This could go on for days, normally until the scanning server provider pulled the plug on the script kiddies. If the scan was from a server with a lot of available bandwidth you could end up with a large amount of incoming traffic.

The developer of SIPVicious has released a small utility included with v0.2.6 of the package called This is designed to interrupt the scan by sending packets to crash svwar and svcrack running on the scanning system. It does this by abusing a bug in older versions of the software.

Version v.0.2.6 of SIPVicious does not continue scanning remote systems when it receives no reply to the scanning packets.

You can find out more details about SIPVicious and the new features here –

I haven’t tried myself yet so use at your own risk.


Asterisk Realtime and A2Billing – what is it?

There is often confusion when setting up A2Billing about Asterisk Realtime and SIP/IAX2 configuration files. Here’s a quick explanation between the two and some pointers if you have problems.

For a SIP or IAX2 account to be able to connect to Asterisk it needs to be made aware of the SIP/IAX2 account details (username, password, etc). The original way for A2Billing to tell Asterisk about any customers with SIP/IAX2 access details was to create 2 files – additional_a2billing_sip.conf and additional_a2billing_iax.conf.  These would then be ‘included’ as part of the Asterisk configuration files so when Asterisk was reloaded the account details were read.

Continue reading

Asterisk security advisory – T38 AST-2011-002

Digium have released the following security Advisory (AST-2011-002) relating to current versions of Asterisk.

While no known exploits exist this is a buffer overflow that could result in an Asterisk server being crashed or exploited remotely.

New versions of Asterisk will be patched against this exploit but it is also possible to disable the affected parts of Asterisk which are T38 fax pass-thru support and chan_ooh323. Unless you have specifically set up T38 faxing or H323 on your system it is highly unlikely that you are using this functionality anyway and you can safely disable them.

For more details concerning the following commands see the advisory here –

cp /etc/asterisk/sip_general_custom.conf /etc/asterisk/sip_general_custom.conf.orig
echo 't38pt_udptl = no' >> /etc/asterisk/sip_general_custom.conf

cp /etc/asterisk/modules.conf /etc/asterisk/modules.conf.orig
sed -i 's/\[modules\]/\[modules\]\nnoload => chan_ooh323/' /etc/asterisk/modules.conf

asterisk -rx "core restart now"
asterisk -rx "restart now"

Only one restart command is needed depending on the version of Asterisk but running both will not hurt.
All calls in progress will be terminated when the restart is run.

Cheap international phone calls using Asterisk/FreePBX and local numbers

One of the easiest ways to make cheap international phone calls is to set up a local access number that automatically forwards to an international number using VOIP.

This is a great way to keep in touch with friends and family in other countries (or to let them keep in touch with you!)

It’s very simple to do in FreePBX in two easy steps.

Create a Misc Destination for the number you want to call –

then create an Inbound Route with your local number as the DID Number –

and set the destination to your Misc Destination –

You can then call the local number and be connected to the international number, only paying inexpensive VOIP rates. The local number can be dialled in the normal way, including from a mobile phone.

Give it a go by ringing this London number – 020 3455 4080 – which will connect you to the Naval speaking clock in Washington DC.

If you’re looking for free UK local numbers then try here –

Nortel 1535 IP phone with Asterisk and O2 broadband

I recently ordered a Nortel 1535 SIP phone as recommended by Ward Mundy here –

At £35 (price seems to vary up and down) from e-bay they are definitely a bargin. There’s a good thread on the PBX-in-a-Flash forum about setting it up here –

They come with the default language set to Turkish so that needs changing to English.

Continue reading

Asterisk technical reference sources

If you’re looking to delve under the covers of Asterisk there are some great reference source available. Here are just a few – – A complete refernece of the Asterisk dialplan commands.

www.asteriskdocs.orgAsterisk: The Future of Telephony. A complete book in PDF format. – Digium’s Asterisk forums – SIP on Wikipedia – AsteriskGuru tutorials

Blocking Asterisk hacking/scanning attempts with fail2ban

Warning – if you follow these instructions fail2ban will, by default, be protecting you against other scans such as ssh attempts. This means though that if you get your IP blocked you will not be able to connect to your server from that IP. Ensure that you whitelist your IP by following the instructions at the end of the post.

Over the past few weeks we have seen a big jump in the scanning of VOIP servers. All of these scans are brute force scanning attempts that first scan for valid extension numbers and then to brute force guess the extension password by repeatedly trying different passwords.

Unfortunately Asterisk doesn’t have anything built-in to prevent these types of scans but it is very good at logging these attempts in the Asterisk logs. This means we can use a free utility called fail2ban and the linux iptables firewall to block IP addresses that make repeated failed login attempts.

Fail2ban is already included in PBX-in-a-Flash but we can also use it with other Asterisk distributions.

Continue reading