I’ve been using Asterisk off and on for the past 10 years or so. For those wondering it’s basically software phone system often called a PBX. You can use it to do some very crazy things. I won’t cover those in this post as it’s meant to simply be a precursor to assist in setting it up for later posts. You’ll need a VPS or a Linux VM. I’ll be doing this on Ubuntu 14.04 but any debian derivative, Arch, and most other distros should have it in the repo.
First, ssh into your machine and install Asterisk.
root@asterisk:~# apt-get update && apt-get install asterisk
Once that’s done we need a way to actually make phone calls. I use a SIP provider called FlowRoute found at flowroute.com. I’ve used them for several years now with no issues whatsoever. The prices are cheap ($0.0098/min for US-48) so credits usually last me a while. They’ll also give you $0.25 to start with so you can try it out. Create an account there and log in. Once you’re in you need to click the “Interconnection” button at the top.
From here you need to click the “System Configurator” link in orange underneath the “Tech Prefix” section
Then select “Asterisk” from the dropdown menu
Once you’re there all you should have to do is copy and paste the values in the three black boxes and put them at the end of their respective files.
Once done check to make sure Asterisk is running and start it if it’s not.
root@asterisk:~# service asterisk status * Asterisk PBX is running
Then open the Asterisk shell with “asterisk -r” and reload the config with “reload”
root@asterisk:~# asterisk -r Privilege escalation protection disabled! See https://wiki.asterisk.org/wiki/x/1gKfAQ for more details. Asterisk 11.7.0~dfsg-1ubuntu1, Copyright (C) 1999 - 2013 Digium, Inc. and others. Created by Mark Spencer <email@example.com> Asterisk comes with ABSOLUTELY NO WARRANTY; type 'core show warranty' for details. This is free software, with components licensed under the GNU General Public License version 2 and other licenses; you are welcome to redistribute it under certain conditions. Type 'core show license' for details. ========================================================================= Connected to Asterisk 11.7.0~dfsg-1ubuntu1 currently running on asterisk (pid = 942) asterisk*CLI> reload asterisk*CLI>
Then you should be able to run “sip show peers” and show a connection to flowroute
asterisk*CLI> sip show peers Name/username Host Dyn Forcerport ACL Port Status Description flowroute/redacted 333.333.333.333 a 5060 Unmonitored 1 sip peers [Monitored: 0 online, 0 offline Unmonitored: 1 online, 0 offline]
That’s it! You’re all set up. One thing you should absolutely do at this point is secure your Asterisk installation. If you’re on a VPS you will have people try to brute force/scan your Asterisk service constantly. Read this page for information. I should have some new posts soon on fun things to do with Asterisk.