Using Android with FreePBX – a SIP extension for free

FreePBX is an opensource VOIP PBX system that is built on top of Asterisk and therefore can use SIP to communicate with extensions. This means that we can use any of this SIP clients that are available for Android.

3CXPhoneOne such SIP compliant softphone is called 3CXPhone. This is a simple client that will work over both WiFI and 3G.

Bandwidth!! – One thing to consider when using a softphone on your Android handset is bandwidth. This might be a problem if you have a cap on your WiFi, but is much more likely to be an issue if you use 3G to make VOIP calls. Here are some quick facts and number to help you decide which codec to use -

G711 – good audio quality – uses around 72MB per hour    * also referred to as ulaw and alaw.

GSM – ok call quality – uses around 25MB per hour

G729 – ok call quality – uses around 21MB per hour    * not included with Asterisk or 3CXPhone

So above are 3 common codec choices with Asterisk. G711 has good quality audio but the trade-off is the amount of bandwidth it uses. If you have a small 3G cap you could quite quickly burn through it. The audio quality with GSM and G729 is OK. It’s perfectly understandable, and whether it’s acceptable or not will depend on the person making/receiving the call and their expectations.

G729 has the lowest bandwidth requirements of the 3 but it is not included with Asterisk by default (and is not available for 3CXPhone at all) as there are license costs to run it. You can add G729 to Asterisk but there is a license cost from Digium (there is an opensource version of G729 for Asterisk but you should be aware of any license restrictions - http://asterisk.hosting.lv/). You will also find that there is a higher cost for Android softphones that can run G729.

I would also recommend something like 3G Watchdog if you need to keep track of how much bandwidth you are using - https://play.google.com/store/apps/details?id=net.rgruet.android.g3watchdog&hl=en

Setup – Installation was straight forward. Just create an extension in FreePBX and then you just need the server IP (or name), extension number and extension secret in 3CXPhone. One thing I did notice was that disabling codecs in 3CXPhone did not seem to work for me. I disabled G711 in 3CXPhone and had G711 and GSM enabled in FreePBX for the extension. The call was still make using G711 and I don’t think that should be the case. If you want to use GSM I would just have GSM enabled for that extension in FreePBX. It would also be worth double checking what codec is used by checking a call in progress!

Continue reading ‘Using Android with FreePBX — a SIP extension for free’ »

A2Billing customer signup page

By default on the SysAdminMan A2Billing template the customer signup page is disabled. This is because anyone using A2Billing to provide call services to the general public should consider very carefully any fraud implications. Call providers are definite targets for fraudsters and any customer should be closely vetted to ensure they are legitimate.

There are many stolen credit cards and PayPal accounts in circulation. You should absolutely not allow automatic signup/activation.

So, with that said, how do you turn on the customer signup page? In A2Billing go to SYSTEM SETTINGS / Global List / signup and set ‘enable_signup’ to ‘yes’

a2billing signup

You should now be able to go to – https://vps_ip_address/signup.php

a2billing signup page

Managing files on your VPS – clearing up disk space

An Asterisk PBX usually requires very little disk space. One of the few exceptions is for voicemail and recordings storage. If a customers VPS runs out of disk space you can pretty much guarantee that the space is being used by recordings.

The easiest way to either delete or mass archive the recordings is via SCP. This works over the SSH port (22) and you use the root/ssh login details that were provided in the welcome e-mail.

If you’re a Windows user then there a nice, simple, free application called WinSCP - http://winscp.net/eng/index.php

Just enter your VPS IP address and the root username and password -

winscp login

and then browse to /var/spool/asterisk/monitor where the recordings are stored -

winscp browse

from there you can either delete the “.wav” files directly or move them off your VPS and on to your PC

Whitelist in fail2ban and denyhosts

All SysAdminMan servers come with fail2ban and denyhosts installed. These are two software packages that do similar things so can be confusing.
Here are the differences -

fail2ban
monitors Asterisk logs for failed ‘Register’ attempts and blocks the IP using IPTables. This means if you get yourself blocked it will appear as though the server has gone down

denyhosts
monitors /var/log/secure for failed SSH attempts and just blocks the IP for SSH access. You will get connection refused just for SSH if you get yourself blocked

It’s possible to whitelist your own IPs so that they don’t get accidentally blocked by following the instructions below.

You should replace 123.123.123.123 with your own IP -

export ignoreip="123.123.123.123"

sed -i "s/ignoreip = /ignoreip = $ignoreip /" /etc/fail2ban/jail.conf
service fail2ban restart

echo "sshd: $ignoreip" >> /etc/hosts.allow
service denyhosts restart