As part of my [VoIP adventure game]({{< relref "/ops/2020-01-20-voip-adventure-game.md" >}}), I need to set up a VoIP number, but thankfully my ISP ([iiNet](https://www.iinet.net.au/)) provides a free VoIP number to NBN customers, so that was covered. Next up I needed a virtual PBX, I went with [Asterisk](https://www.asterisk.org/get-started). This was an easy install on Ubuntu 18.04, just: ``` sudo apt install asterisk ``` Of course, installing software is much different from configuring it for use, so let me just preface this with describing some of my experience: > AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAH Most of the frustration really just comes from getting my VoIP number registered. For iiNet users, there's some settings you can use [available on their website](https://iihelp.iinet.net.au/Setting_up_Netphone_%28VoIP%29). However be warned, getting them into Asterisk is slightly harder. You'll want to modify `/etc/asterisk/sip.conf` and add the following straight under your `[general]` line: ``` register => XXXXXXXXXX@iinetphone.iinet.net.au:YYYYYYYY:XXXXXXXXXX@iinetphone/XXXXXXXXXX ``` Make sure to replace the XXXXXXXXXX with your Netphone number (including state code) and the YYYYYYYY with your Netphone password. Then at the bottom of `sip.conf` add the following: ``` [iinetphone] host=sip.wa.iinet.net.au fromdomain=iinetphone.iinet.net.au fromuser=XXXXXXXXXX username=XXXXXXXXXX defaultuser=XXXXXXXXXX context=inbound disallow=all ;allow=g729 allow=ulaw allow=alaw insecure=port,invite canreinvite=no secret=YYYYYYYY type=friend nat=yes qualify=yes ``` Make the same replacements, but also change `sip.wa.iinet.net.au`, replacing the state (second section) with your home state. Now open up `/etc/asterisk/extensions.conf` and find the section labelled `[default]` and change it to the following: ``` [default] include => inbound ``` Then append the following to the end of the file: ``` [inbound] exten => XXXXXXXXXX,1,Answer() exten => XXXXXXXXXX,1,Wait(5) ``` Replace XXXXXXXXXX with your Netphone number once more. Make sure you restart Asterisk (`systemctl restart asterisk.service`) and you should be able to call the number. Expect it to answer, wait 5 seconds, then immediately disconnect. Now you can do whatever you want to configure it to answer, send to a softphone extension or a VoIP handset, etc.