This is a quick guide to using a GoIP GSM gateway with A2Billing as an outbound trunk. It doesn’t go through setting up rate cards and customers in A2Billing, guides for that are already available on this site.
First some general info and tips.
This guide was written using the following. The thing most likely to cause issues is a SIP ALG in your router. NAT issues are a pain to track down!
- SysAdminMan VPS – http://sysadminman.net/sysadminman-freepbx-a2billing-hosting.html
- Asterisk 11.6.0
- A2Billing 2.0.7
- OpenWRT ‘Backfire’ router as the broadband router. This doesn’t have a SIP ALG enabled
- GoIP 1 with firmware GHSFVT-1.1-22. This had a private IP of 10.10.10.159 and was behind the OpenWRT router
- Virgin GSM SIM (uses t-mobile network)
- You should whitelist your public IP like this to stop it getting blocked by fail2ban – http://sysadminman.net/blog/2011/a2b100-whitelisting-ip-addresses-3064
I would definitely recommend getting your A2Billing system working with regular SIP providers before trying to set up the GoIP. There may be further changes on the GoIP that you want to set. Sometimes I struggled to get the GoIP making calls after changing settings (even if I changed them back). It can be quicker to factory reset the GoIP and start again.
When testing DO NOT use a SIP phone/client that is behind the same firewall as your GoIP. This will likely cause NAT issues and will be impossible to troubleshoot!
SET UP THE TRUNK IN ASTERISK
First we are going to create the trunk in Asterisk. if you are using a system with FreePBX installed you want to put these lines in /etc/asterisk/sip_custom.conf – if there is just A2Billing on the system you want to add them to /etc/asterisk/sip.conf.
Make sure you use a complex secret/password! Not ‘goip’ !!!
Next reload the Asterisk SIP config –
SET UP THE TRUNK IN A2BILLING
The only important part is that we set ‘PROVIDER IP’ to the name we called the trunk in Asterisk
SET UP THE GOIP
First you need to connect your network cable to the LAN port, then insert your GSM SIM and power on the GoIP.
Next you need to find out what IP address has been given to your GoIP by DHCP. You’ll probably need to log in to your broadband router to find this. Now go to that IP with a web browser and enter the default username/password (admin/admin) and you should get a status page like this –
You should check that the GSM Status says LOGIN and the signal strength is above 12. At this time the Line Status will say LOGOUT.
Next set some general settings on the Preferences tab. Don’t forget to click Save Changes –
Next click on Call Settings. This is where we tell the GoIP about the account on our Asterisk server. You need to enter the settings highlighted. We only need 3 bits of information –
- Asterisk user account (goip) – this goes in the Phone Number and Authentication ID box
- Asterisk server IP address – this goes in the SIP Proxy and SIP Registrar Server box
- SIP secret – this goes in the Password box
Don’t forget to save the settings.
Now go to the Call Divert page –
The Call Divert page is where we tell the GoIP what to do with call attempts. We want it to send our calls from Asterisk to the PSTN (regular telephone network). This is already enabled and the only setting we need to change here is “Use CID as SIP Caller ID”.
Note here that we are not using any security to protect who can send calls to the GoIP. If you are going to leave it like this then you should ensure the GoIP port 5060 is not accessible from the Internet!
We are not going to be using the GoIP to accept incoming GSM calls so we will disable “Forward to VoIP”.
Now check back on the Status page and you should see Line Satus is now LOGIN. This is the device connected to Asterisk –
Also, if you check in Asterisk, you should see the GoIP connected –
sip show peers
Name/username Host Dyn Forcerport ACL Port Status Description Realtime
goip/goip 86.17.XX.XX D N 5060 OK (32 ms)
GIVE IT A TRY!
If everything went OK you should now be able to make calls. You will need to ensure you send the number to the GoIP in the format the network provider is expecting. For example if your calls to UK mobiles normally go out of A2Billing in the format 4475XXXXXXXX you may need to use the Add/Remove prefix settings on the A2Billing trunk to change the number to the format 075XXXXXXXX