Home » Posts tagged 'piaf' (Page 7)
Tag Archives: piaf
Finally a 100% Portable PBX: Introducing GoIP, a SIP-GSM Gateway for Asterisk
How far we have come! The original Asterisk® claim to fame was its ability to interface with proprietary phone systems and legacy telephony hardware, the glue that literally kept companies stuck to their overpriced PBXs. And, just as wired phone systems began to lose their edge, along came the Bell Sisters to introduce cellular communications with billing that began when the phone started ringing and an end to toll-free calling and extra fees for text messaging on top of exorbitantly priced data service. The piece that traditionally has been missing from Asterisk deployments has been interconnectivity with cellular data services. Well, that was then, and this is now. Meet the GoIP GSM Gateway in one, four, eight, and 16-channel flavors to meet your every need. Our focus today will be the one-channel GoIP device, but the larger units work almost identically so, once you’ve mastered the device, it’s not rocket science to move to the 4-channel or 8-channel device (or even larger) if the extra GSM ports better meet your office’s requirements.1
Let’s begin with the basics. What does it do? What does it cost? Why do I need it? How steep is the learning curve?
What Does It Do? In a nutshell, GoIP is a SIP-talkin’ GSM gateway that sits on the same network as your Asterisk server. Once you configure a trunk and a few special Asterisk settings to support SMS messaging, you’ll have another full-featured provider for your PBX, only this one happens to be GSM cellular-based. The good news is GoIP brings to your PBX most of the same feature set that is available using your favorite GSM cellphone except now every extension on your PBX in a Flash™ server can share the cellular connection both for calls and messaging. That means inbound and outbound cell calls as well as inbound and outbound SMS messaging for every extension on your PBX.
With today’s Nerd Vittles additions, here’s the new feature set using a GoIP device from any extension on your PBX:
- Make outbound calls through the GoIP cellular trunk from any PBX extension
- Receive incoming cellular calls and redirect them to any number on your PBX
- Dictate text by phone and deliver SMS messages to any SMS-capable device
- Use a browser to create and deliver outbound SMS messages to any SMS device
- Receive incoming SMS messages and forward the messages to any email address
- Receive incoming SMS messages and forward the messages to any SMS number
- Send an SMS message with a password and receive a callback with DISA dialtone
What Does It Cost? As much as we love Amazon for its referral revenue support of our blog and open source projects, we couldn’t find a single-channel GoIP offering at a reasonable price. The Amazon links provided above for the larger units are competitive (about $100 per port). For the single-channel model, eBay® is your friend. You’ll find multiple providers in the $150 price range. All of the units we’ve found ship from China. We used this provider who got the GoIP device to us exactly 14 days after we ordered it. Ours shipped with the latest firmware, but firmware updates are available here. AliExpress also sells the devices for about the same price. We’ve had good luck with them in the past.
The other expense with the GoIP devices is cellular service. For each channel, you’ll need a GSM SIM card just like what your GSM, AT&T, or T-Mobile cell phone uses. The good news is there are lots of other choices now. See WalMart for some options. Another option for low frequency use would be T-Mobile’s pay-by-the day plans. The $1 (unlimited SMS messaging) or $2/day (unlimited calls and unlimited SMS messaging) plans are almost perfect since you don’t need data. Just be sure to choose a GSM carrier, AT&T or T-Mobile in the U.S. market. Both are supported by StraightTalk. Our favorite remains the (almost) unlimited calling, text, and data $45 plan from StraightTalk. With their AT&T-compatible SIM (don’t buy it in a StraightTalk-locked phone!), it’s a simple matter of moving the SIM card from your cellphone to the GoIP’s GSM slot (connectors facing down). The GoIP unit can spoof an IMEI for picky providers.
Why Do I Need It? The two major advantages of adding a cellular trunk to your PBX are redundancy and portability. Except in the Hurricane Katrina situation, chances are that your Internet service provider and your cellular provider won’t both be dead in the water2 at the same time. The good news is that even with a hurricane, you can pack up your PBX in a Flash server or Raspberry Pi together with your GoIP device and move to higher ground. As fast as you can say "George Bush is a compassionate conservative," you’ll be back in business.
And then there are the mobile users such as construction site workers, mobile firefighters deployed to a site far from home and other first responders, or even the nomads that manage conventions in a different town every week. Think AstriCon! Rather than relying on crappy hotel WiFi service or paying an arm and a leg for installation of cable or DSL Internet service which often isn’t available anyway, now you have the flexibility to deploy a full-featured PBX at almost any temporary site with nothing more than a $30 Wi-Fi firewall/router, a PBX in a Flash Server or Raspberry Pi, and a GSM SIP trunk courtesy of GoIP. The only other ingredient you need is a little electricity. That could be a wall outlet, or a generator, or an inexpensive AC inverter for your vehicle. Did we mention it’ll work identically on the next site without spending an extra nickel. Hardware cost for the Mobile Communications Center (as shown below): about $250.
Last but not least are all of the organizations that could benefit from an SMS-based emergency messaging service. A dollar a day is a small price to pay to deploy a service that can alert the public, employees, or parents and students of emergency situations. Before you read about the next mass shooting or midnight tornado, give it some thought. We’ve already introduced SMS Blaster to make the job easy. Or you can roll your own by building a simple text file in /tmp/callees.txt with a 10-digit3 callee’s phone number on each line. Then add the following snippet to your Asterisk dialplan code and put your emergency message in line 2. You’ve just replaced a $100 a month message blasting service with a totally portable, self-managed solution. And you’ll recover your hardware costs in less than three months.
[goip-sms-blaster]
exten => s,1,Answer
exten => s,n,Set(SMSMSG="Here is where your emergency message goes.")
exten => s,n,ReadFile(callees=/tmp/callees.txt)
exten => s,n,Set(callees=${URIENCODE(${callees})})
exten => s,n,Set(callees=${REPLACE(callees,%0A,-)})
exten => s,n,Set(SMSNUM=${callees:0:10})
exten => s,n,While($[${LEN(${SMSNUM})}>9])
exten => s,n,NoOp(Here's where we send SMS message to: ${SMSNUM})
exten => s,n,Set(SMSOUT=${SMSNUM}%0A${SMSMSG})
exten => s,n,Set(SMSOUTRAW=${URIDECODE(${SMSOUT})})
exten => s,n,Set(MESSAGE(body)=${SMSOUTRAW})
exten => s,n,MessageSend(sip:goip_1)
exten => s,n,Set(callees=${callees:13})
exten => s,n,Set(SMSNUM=${callees:0:10})
exten => s,n,Set(SMSNUM=${REPLACE(SMSNUM,-,0)})
exten => s,n,EndWhile()
exten => s,n,Hangup()
How Steep Is the Learning Curve? Lucky for you, you’re not going to have to worry about the learning curve. After all, that’s why you come to Nerd Vittles, isn’t it? We’ve spent the better part of a week getting the GoIP to sit up and bark. If you’re a slow typist, it might take you 10 minutes to get everything set up and functional once you have your GoIP device and SIM card in hand. When we’re finished, you’ll have an easy way to make and receive calls through your GoIP device using any extension on your PBX. And you’ll have a simple utility to send and receive SMS messages. In fact, you’ll be able to dictate your SMS messages from any phone connected to your PBX and send them out to any number supported by SMS including the millions of Google Voice numbers. Last but not least, we’ll provide a utility to send password-protected SMS messages to GoIP and receive a return call with DISA dial tone to make outbound calls using any available trunks on your PBX.
A Word About Security. We’re a little paranoid when it comes to security so bear with us. Without impugning anyone’s integrity, suffice it to say this device is manufactured in China. Although the device reportedly runs Linux, none of its other firmware is open source, at least not that we could find. There also are three back doors into the system which can be triggered by SMS commands to the device itself. These are well documented in the GoIP User’s Manual. Whether there are other backdoors or whether the device "phones home" are questions we have neither the time nor the money to explore. Unless you do, you are well advised to treat the device in the same way you would treat a new employee on their first day at work. Don’t put the device on a private LAN in which other computers or devices on the LAN are not protected. Don’t use a SIM card with an automatic renewal feature or with authority to post charges against your credit or debit card. Change your Admin password to the device immediately. Don’t use a password you use elsewhere! Anyone can reset the device to factory defaults by knowing the default credentials and sending RESET admin in an SMS message to the device. We love the device, but be careful.
Initial Setup of the GoIP Device
To begin, you’ll need cellphone coverage in the place where you intend to connect your GoIP device. Verify this while the SIM card you plan to use is still installed in a working cellphone. Make a call and send an SMS message to verify that the site is appropriate. Next, verify that you have a place to connect your GoIP device to your LAN in the same location. Both of these are important first steps, or you’ll be wasting your time continuing on. Once the connectivity issues are out of the way, turn off your cell phone, remove the GSM SIM card, and insert it into the GoIP device with the connectors pointing downward. You should hear a click when the SIM card is properly seated. Now connect the device behind a hardware-based firewall/router that provides DHCP service. Plug an Ethernet cable into the LAN port of the GoIP device and connect it to your network. Finally, using the power adapter provided, apply power to the device. Watch the blinking lights. While booting the RUN light will flash on and off every 100 milliseconds. Once the RUN and CHANNEL lights flash GREEN once per second, you’re in business. Now use another cellphone to send a text message with the word INFO to the phone number associated with the SIM card you plugged into the GoIP Device. You should receive a return message telling you the DHCP LAN address associated with the GoIP CHANNEL port where you plugged in the SIM card. Write it down! We’re not going to use the PC port so you can ignore its IP address for now.
Asterisk Prerequisites for Today’s GoIP Project
We’ll be using PIAF-Green with Asterisk 11 and FreePBX 2.11 today so you’ll have to read between the lines if you’re using a prehistoric release or a non-FreePBX system. We’re also assuming you’ve installed Incredible PBX™ 11 which provides the necessary components to get Google’s text-to-speech and speech-to-text features working. If you’d prefer to roll your own, then start by installing Lefteris Zafiris’ GoogleTTS and Speech Recognition components for Asterisk. For PBX in a Flash users that aren’t using Incredible PBX, you can follow this tutorial to install all of the necessary components in one click.
Initial Setup of FreePBX for the GoIP Device
We’ve found that it’s easier to configure the FreePBX® side to support the GoIP, and then configure the GoIP unit. There are seven simple steps. If you don’t want SMS DISA callback support in your setup, skip the last two steps.
- Add GoIP SIP Trunk
- Add Custom SIP Settings
- Add GoIP Outbound Route
- Add GoIP Custom Destination
- Add GoIP Misc Application
- Add GoIP DISA Context
- Add GoIP DISA Misc Application
1. Start by adding a new SIP Trunk to support the GoIP device. Be sure to match the device names we’ve shown exactly, or nothing will work. Our special thanks to samyantoun for his initial work on this. Replace 192.168.0.107 with the IP address of your GoIP. Replace 77 with whatever dialing prefix you want to use to make calls through the GoIP trunk. And add the phone number associated with your GoIP in the Outbound CallerID field. If you’re using the GoIP device behind a hardware-based firewall with no Internet port exposure, then you can leave password as the secret. Otherwise, you would want something very secure!4
2. Add a couple of custom SIP entries at the bottom of Asterisk SIP Settings to support SMS messaging with Asterisk. Set accept_outofcall_messages=yes and outofcall_message_context=sms_message. Then Submit Changes.
3. Add an Outbound Route to make calls using your GoIP device using the dial prefix you chose for the trunk:
4. Next we need to add a FreePBX Custom Destination to support the Nerd Vittles speech-to-text module which we’ll be using to dictate and send SMS messages using any telephone on your PBX. Under Admin -> Custom Destination, add an entry that looks like this:
5. Then we need to associate an extension number with the custom destination we just added. We’ve chosen 4647 which spells GoIP. Choose Applications -> Misc Application and enter the following:
6. DISA is an Asterisk function that lets someone call into your PBX and obtain dial tone to place an outbound call using the available trunks on your PBX. In the case of the GoIP device, this gets a little fancier. We’ll actually be sending an SMS message with a custom password to the GoIP device, and it will in turn call the SMS sender’s number and provide DISA dialtone after the user enters a special DISA PIN. Make the PIN and password very secure. We’ll get to the password in a minute. On the FreePBX side, add a DISA context in FreePBX under Applications -> DISA that looks something like the following with a secure PIN (not the one in the example):
7. In order to use DISA with GoIP, we’ll need an extension associated with the DISA function. We add this number using FreePBX Misc Application. You can use any available extension number you like. Just remember what you chose when we configure the GoIP side to support SMS DISA access. Here’s what we use:
Configuration of the GoIP Device
All of the GoIP device configuration is handled using a browser pointed to the internal IP address of the GoIP. If you haven’t already done so, send an SMS message with the word INFO to the phone number associated with your GoIP device. You will get a return message with the private IP address of the unit. Using a browser, point it to the IP address and login with username admin and password admin. It’s probably a good idea to reset your unit to factory defaults before beginning the setup just to make sure you’re starting with a clean slate. Send an SMS message to the device with the words RESET admin to initialize the hardware.
As we’ve mentioned, sending the admin password to the device with the RESET keyword forces a total reset of the device so you obviously want to change this admin password immediately unless you want to risk a total stranger sending a reset command to your device. Do it now under Tools -> Change Password -> Administration Level. It’s probably a good idea to change the other passwords as well.
Next, click Configurations. This is the screen on which you set everything. The Preference pane has the country-specific settings for both the network and your cellphone carrier so set them carefully. The IMEI will default to the actual IMEI of your unit. If your cellphone carrier requires registration of a specific IMEI before your SIM card will work, then you can spoof the IMEI using the IMEI of the cell phone that was previously used with this SIM card. For the East Coast of the United States, our setup looks like this:
If you’re using DHCP for the GoIP, the Network Configuration pane shouldn’t require any changes. We do recommend that you lock the DHCP address to the GoIP in your router so that it doesn’t inadvertently change down the road. You will note that a PPTP VPN tunnel for the device is supported although we haven’t yet played with it.
The Call Settings pane has all of your SIP settings for the GoIP. These have got to be right or nothing will work. Our setup (that works) is shown below. Start by clicking on each of the Settings and Preferences links to open up the sub-menus. Both 192.168.0.180 entries should be replaced with the IP address of your Asterisk server. The Phone Number and Authentication ID both need to be goip_1 as shown. The password is password unless you changed your secret in the FreePBX trunk setup. DTMF Signaling should be changed to Outband and DTMF Type should be RFC2833. Ours still doesn’t work reliably, but that may be the lousy cellphone signal in our office. We recommend ULAW and ALAW exclusively for the Audio Codecs. You don’t want the overhead of codec translation particularly if you’re using a Raspberry Pi. On a normal server, G.729 would obviously reduce the bandwidth of GoIP voice calls. Get it working first and then experiment! The RTP port range should be 10000-20000 to match your Asterisk default setup.
The Call Divert pane is where we configure all of the Nerd Vittles magic. Forward Number(PSTN To VoIP) should be the number on your PBX to which you want inbound GoIP calls forwarded when someone calls the cellphone number associated with your GoIP device. This could be an extension, ring group, IVR, or even the DISA number we set up above. Just be sure you have a verrrrrry secure DISA PIN if you go this route! It’s your phone bill. The SMS Mode must be changed to Relay, and SMS Forward SIP Number must be s to work with the Nerd Vittles apps.
Once you have all of your settings entered, click the Save Settings link under Configurations. The unit will reload its SIP setup. It usually takes about 30 seconds. We recommend you now test the setup to make sure you can make a call to the GoIP number and have it forwarded to an extension on your Asterisk server. Then use an extension on your PBX to place an outbound call using the GoIP dial prefix you assigned above. If either call fails, check your settings for typos in both the FreePBX and GoIP configurations.
Adding the Nerd Vittles Apps to Support the GoIP Device
Now for the fun stuff. We’ve built a little shell script that sets up all of the Nerd Vittles applications we outlined above. It’s licensed as GPL2 code so you are more than welcome to make any changes or additions which you believe would be useful. We hope you’ll share them with the rest of us. The script puts everything in the proper place on Incredible PBX systems to support SMS messaging with Asterisk. You’ll be prompted for the following information:
- Email address to which to forward incoming SMS messages
- SMS number to which to forward incoming SMS messages
- Very secure password to trigger PBX callbacks
- Extension number to ring on callbacks
1. When incoming SMS messages are received by the GoIP unit, Asterisk will forward them to this email address.
2. When incoming SMS messages are received by the GoIP unit, Asterisk will forward them to this SMS number. You can disable either the forwarding email address or the forwarding SMS number (not both!) by editing the [sms_message] context in extensions_custom.conf and commenting out either of these lines with a semicolon:
exten => s,n,system(echo "SMS Message From ${SMSDID}: ${SMSMSG}"...
exten => s,n,MessageSend(sip:goip_1)
3. This password is what must be sent as an SMS message to the GoIP device to trigger a return call from Asterisk. Do NOT include any spaces in the password and make it very secure!
4. This is the extension number that will be used to place the return call from Asterisk. For DISA service, it would be 3172 in today’s setup. It could also be a regular extension on your PBX if you simply want to trigger a return call from your home or office extension when you send this password via SMS to the GoIP device. Note that the home or office extension must answer the call before the return call will be placed to your SMS device or phone.
Installation. To install the components (a one-minute job!), log into your server as root and issue the following commands:
cd /root
rm GoIP-install.sh
wget http://incrediblepbx.com/GoIP-install.sh
chmod +x GoIP-install.sh
./GoIP-install.sh
If you ever need to make changes to your setup, just run the script again and answer the prompts.
Kicking the Tires. To make sure everything is working, try sending an SMS message to the GoIP with your secret password from #3 above. You should get a return call within 30 seconds. Next, from an extension on your PBX, dial 4647. Dictate a brief message and then enter a phone number for delivery of the message via GoIP to some SMS device (not your GoIP unit!). Finally, send a "Hello World" SMS message to your GoIP device. It should be forwarded to both your email address (#1) and SMS number (#2) within a few seconds. Enjoy!
Deals of the Week. There’s still an amazing deal on the street if you hurry. A new company called Copy.com is offering 20GB of free cloud storage with no restrictions on file size uploads (which are all too common with other free offers). Copy.com has free sync apps for Windows, Macs, and Linux systems. To take advantage of the offer, just click on our referral link here. We get 5GB of extra storage, too, which will help avoid another PIAF Forum disaster.
Originally published: Monday, September 30, 2013
Need help with Asterisk? Visit the PBX in a Flash Forum.
We are pleased to once again be able to offer Nerd Vittles’ readers a 20% discount on registration to attend this year’s 10th Anniversary AstriCon in Atlanta. And, if you hurry, you also can take advantage of the early bird registration discount. Here’s the Nerd Vittles Discount Code: AC13NERD.
Special Thanks to Our Generous Sponsors
FULL DISCLOSURE: ClearlyIP, Skyetel, Vitelity, DigitalOcean, Vultr, VoIP.ms, 3CX, Sangoma, TelecomsXchange and VitalPBX have provided financial support to Nerd Vittles and our open source projects through advertising, referral revenue, and/or merchandise. As an Amazon Associate and Best Buy Affiliate, we also earn from qualifying purchases. We’ve chosen these providers not the other way around. Our decisions are based upon their corporate reputation and the quality of their offerings and pricing. Our recommendations regarding technology are reached without regard to financial compensation except in situations in which comparable products at comparable pricing are available from multiple sources. In this limited case, we support our sponsors because our sponsors support us.
BOGO Bonaza: Enjoy state-of-the-art VoIP service with a $10 credit and half-price SIP service on up to $500 of Skyetel trunking with free number porting when you fund your Skyetel account. No limits on number of simultaneous calls. Quadruple data center redundancy. $25 monthly minimum spend required. Tutorial and sign up details are here.
The lynchpin of Incredible PBX 2020 and beyond is ClearlyIP components which bring management of FreePBX modules and SIP phone integration to a level never before available with any other Asterisk distribution. And now you can configure and reconfigure your new Incredible PBX phones from the convenience of the Incredible PBX GUI.
VitalPBX is perhaps the fastest-growing PBX offering based upon Asterisk with an installed presence in more than 100 countries worldwide. VitalPBX has generously provided a customized White Label version of Incredible PBX tailored for use with all Incredible PBX and VitalPBX custom applications. Follow this link for a free test drive!
Special Thanks to Vitelity. Vitelity is now Voyant Communications and has halted new registrations for the time being. Our special thanks to Vitelity for their unwavering financial support over many years and to the many Nerd Vittles readers who continue to enjoy the benefits of their service offerings. We will keep everyone posted on further developments.
Some Recent Nerd Vittles Articles of Interest…
- Some of our purchase links refer users to Amazon when we find their prices are competitive for the recommended products. Nerd Vittles receives a small referral fee from Amazon to help cover the costs of our blog. We never recommend particular products solely to generate Amazon commissions. However, when pricing is comparable or availability is favorable, we support Amazon because Amazon supports us. [↩]
- With apologies for the tasteless photo and pun. [↩]
- The length of the phone numbers obviously can be adjusted to meet your local requirements. Just replace the 10’s with the length of the phone numbers you wish to use. Then replace 13 with 3 more than the phone number length you chose. [↩]
- We have engineered today’s GoIP solution for users in the U.S. and Canada. It obviously will support international deployment as well by making adjustments to the dial strings and cellphone settings in both the FreePBX and GoIP configurations. [↩]
The 5-Minute PBX: Introducing PIAF-Green Virtual Machine for VMware ESXi
In our never-ending trek to build the Perfect PBX™, we have another installment for you today featuring VMware’s just released vSphere Hypervisor 5.5 (ESXi). And, yes, there’s still a free ESXi version with a free license available here. But, unlike VirtualBox, you’ll need a dedicated (beefy) server on which to install ESXi. Be sure to register on the site and obtain then install the unrestricted license, or you’re SOL after the short eval period. We’ve built an ESXi appliance which installs in under 5 minutes featuring the latest, greatest PIAF-Green with a CentOS® 6.4 LAMP stack (32-bit), Asterisk® 11.5.1, and FreePBX® 2.11. This 2.0.6.4.4 release also has a number of new security patches including a new Linux kernel that’s been patched to eliminate the reported zero-day vulnerability. If this is your first experience with our virtual machine builds, we’re not talking about a crippled telephony platform with limited functionality. What you’ll have is the same platform that hundreds of thousands of organizations use to run their corporate phone systems. And, if you want the Incredible PBX™ feature set with literally dozens of open source telephony applications including news, weather, stocks, tide reports, SMS messaging, free faxing with Incredible Fax™, telephone reminders, wakeup calls, and more then just add a couple minutes to run two one-click installers. Welcome to the world of open source!
The real beauty of PBX in a Flash has not been that someone with sufficient expertise couldn’t assemble something just as good or even better. Watch the AstriCon presentations from last year if you have any doubts. And, just a reminder that’s it’s almost AstriCon time again. Come join us to celebrate the 10th Anniversary. You’ll find a registration discount coupon at the end of this article. The beauty of PBX in a Flash is it puts this technology down where the goats can get it. PIAF provides a toolset that encourages further development by simplifying the learning curve for a broad cross-section of the VoIP community while not compromising functionality or flexibility. The source code for the major components is included in the build so you can customize and recompile Asterisk or load a new version of Asterisk or any additional Linux app in minutes without losing your existing setup.
When it comes to support, we have literally hundreds of gurus on the PIAF Forum. That doesn’t mean any particular person or group knows everything. It’s merely a designation that a particular individual is an expert at something. The collective wisdom of the group is what makes PBX in a Flash as a project better because we’ve put in place a platform that experts from many different disciplines can build upon without needing to learn everything about everything. Simply stated, you can be a terrific chef without knowing how to build a stove!
The latest Asterisk® 11 and FreePBX® 2.11 releases are a remarkable step forward both in terms of toolset and in the new mindset of the development community. They are as close to bug-free as any software product ever can be, and that’s obviously a good thing. For our part, we want to get our latest release of PBX in a Flash with CentOS 6.4, Asterisk 11 and FreePBX 2.11 release into as many hands as possible. Many of our readers have existing VMware platforms in their businesses so today’s installment makes PIAF deployment a breeze whether you just want to kick the tires or deploy it in a production environment.
The Ultimate VoIP Appliance: PIAF-Green Virtual Machine for ESXi
Today brings us to yet another plateau in the virtual machine development era. Because most major companies already have a VMware platform in place, we’ll begin by walking you through the 5-minute exercise to install the PIAF-Green appliance. If you’re new to VMware and want to deploy an EXSi server on which to run PIAF-Green, then skip over the PIAF-Green install procedure for the time being. Jump down to the section where we walk you through bringing up your own ESXi server, and then return here once your ESXi server is humming along. Let us hasten to add that we make no claims with regard to VMware expertise. If you need help with VMware, head over to the PIAF Forum and chat with our VMware gurus. We’re not one of them.
To install the PIAF-Green Virtual Machine for ESXi, there are six simple steps:
- Download the ESXi PIAF-Green .ova template from SourceForge
- Verify checksums for downloaded ESXi PIAF-Green .ova template
- Deploy the PIAF-Green Template on ESXi using vSphere Client
- Start PIAF-Green appliance
- Login using Virtual Machine Console
- Complete the PIAF-Green Setup Checklist
Installing the PIAF-Green Virtual Machine for ESXi
1. Download the PIAF-Green Open Virtualization Appliance (.ova) for ESXi from SourceForge. Do not confuse it with our OVA appliance for VirtualBox. They’re not the same!
2. Verify the checksums for the 32-bit .ova appliance to be sure everything got downloaded properly. To check the MD5/SHA1 checksums in Windows, download and run Microsoft’s File Checksum Integrity Verifier.
For Mac or Linux desktops, open a Terminal window, change to the directory in which you downloaded the .ova file of your choice, and type the following commands:
md5 PIAF-Green-32.ova (use md5sum for Linux)
openssl sha1 PIAF-Green-32.ova
The correct MD5 checksum for PIAF-Green-32.ova is 2ba3a84d3be3167274308342f73a7a1f. The correct SHA1 checksum for PIAF-Green-32 is b79f2a96b65465337ddda5426e4a8d63982651ad. The bold portion isn’t actually shown in the i file display on SourceForge. Don’t worry about it.
3. To deploy the template on your ESXi server, open vSphere Client on your Windows desktop. Click File -> Deploy OVF Template as shown below. Browse to the location of your downloaded template and select it. Give the virtual machine a unique name (you can have multiple VMs using the same template). Accept the Disk Format defaults and click Finish to begin the import.
Once the import is finished, you’ll see a new PIAF-Green virtual machine in the Inventory under the IP address of your ESXi server.
4. Start up the new virtual machine by highlighting it and clicking Power on Virtual Machine in the right pane of vSphere Client. You can see it at the bottom of the screenshot below.
5. Open the Virtual Machine Console by clicking on the icon as shown below. Use your mouse to click inside the console window once it opens. Then log in as root with the default password: password.
HINT: To exit from the VM Console window, press Ctrl-Alt simultaneously.
PIAF-Green Virtual Machine Setup Checklist for ESXi
Once you’ve logged into PIAF-Green, you’ll see the status window telling you what’s running and what’s not. It should look something like what’s shown below. It includes the IP address of your virtual machine. This can be used with SSH to log in from any computer on your LAN. It also is required information to log in to the PIAF and FreePBX GUIs using a browser.
Here’s what you need to know. To work in the PIAF Virtual Machine from the vSphere Console, just left-click your mouse while it is positioned inside the VM Console window. To return to your host operating system desktop, press Ctrl-Alt. Remember to always shut down PIAF gracefully! Click in the VM Console window with your mouse, log in as root, and type: shutdown -h now.
Run ESXi and Virtual Machines behind a hardware-based firewall with no Internet port exposure!
Here’s the quick PIAF Setup Checklist:
- Change your root password immediately by typing passwd
- Set up a secure maint password for FreePBX: passwd-master
- Adjust your timezone setting: /root/timezone-setup
- Decipher your PIAF-Green VM’s IP address: status
- Browser log into PIAF: Point to IP address of PIAF-Green VM
- Click on User button to display the PIAF Admin menu
- Click on the FreePBX icon to load FreePBX GUI
- When prompted for Apache username and password: Username=maint
- Password is whatever password you set up with passwd-master
Now read the latest PIAF Quick Start Guide and begin your VoIP adventure.
You can read all about the Incredible PBX 11 and Incredible Fax feature set in our recent Nerd Vittles article. If you decide you’d like to add one or both to your PIAF-Green Virtual Machine, just log into your server as root and issue the following commands. NOTE: You must install Incredible Fax after installing Incredible PBX, or you will lose the ability to install Incredible PBX at a later time. With Incredible Fax, there are a number of prompts during the install. With the exception of the prompt asking for your local area code, just press Enter at every other prompt.
cd /root
wget http://incrediblepbx.com/incrediblepbx11.gz
gunzip incrediblepbx11.gz
chmod +x incrediblepbx11
./incrediblepbx11
./incrediblefax11.sh
The Incredible PBX 11 Inventory. For those that have never heard of The Incredible PBX, here’s the current 11.0 feature set in addition to the base install of PBX in a Flash with the CentOS 6.4, Asterisk 11, FreePBX 2.11, and Apache, SendMail, MySQL, PHP, phpMyAdmin, IPtables Linux firewall, Fail2Ban, and WebMin. Incredible Fax, NeoRouter and PPTP VPNs, and all sorts of backup solutions are still just one command away and may be installed using the scripts included with Incredible PBX 11 and PBX in a Flash. Type help-pbx and browse /root for dozens of one-click install scripts.
- AsteriDex
- CallerID Superfecta (FreePBX Module adds Names to CID Numbers)
- CallWho for Asterisk (Dial 411)
- Digium Phone Support (install-digiphones)
- Preconfigured Email That Works with SendMail and Incredible Fax
- OSS Endpoint Manager
- Extensions (1 preconfigured with random password)
- Festival Server and Festival TTS for Asterisk (festival –server &)
- Flite TTS for Asterisk
- FreePBX Backups
- Google Dictionary by Phone (Dial 333)
- Google News by Phone (Dial 951)
- Google Stocks by Phone (Dial 950)
- Google Voice (FreePBX GV/Motif Module)
- Hotel-Style Wakeup Calls (FreePBX Module)
- Incredible Backups… and Restores (install-incredbackup2)
- ISN: FreeNum SIP Calling from Any Phone
- MeetMe Conference Bridge (just dial C-O-N-F)
- Mondo Full System Backups (install-diskbackup)
- Incredible Fax 11 (/root/incrediblefax11.sh)
- Incremental Daily Backups (install-dailybackup)
- Munin Reports (install-munin)
- NeoRouter VPN Client (nrclientcmd)
- NewsClips from Yahoo
- ODBC Database Support (Dial 222, 223)
- OpenFire Instant Messaging & Chat Server (install-openfire)
- New PBX in a Flash Registry (show-registry)
- PPTP VPN for PIAF (/root/install-pptp)
- Reminders by Phone and Web
- SAMBA Windows Networking (configure-samba)
- SMS Dictator with Google Voice (Dial S-M-S)
- Speech-to-Text Directory Assistance (Dial 411)
- Stealth AutoAttendant
- TFTP Server (setup-tftp)
- Tide Reports with xTide (Dial T-I-D-E)
- Travelin’ Man 2 & 3 (Secure, remote access)
- Trunks (Vitelity, Gtalk, SIPgate, IPkall, VoIP.ms, and more)
- Weather by ZIP Code
- Worldwide Weather by Phone (Dial 949)
- Wolfram Alpha by Phone (/root/wolfram)
Unlike the dedicated machine platforms and OpenVZ compromises of years past, today’s PIAF-Green Virtual Machine is state-of-the-art giving you everything a bare metal install from source code would have provided. Most importantly, the components are truly portable. They can be exported and copied to an external USB drive or flash drive for instant portability for use on any ESXi server.
Installing VMware Tools (optional). If you wish to install VMware Tools in your Virtual Machine, here’s the two-step procedure. First, enable the tools in vSphere Client: VM -> Guest -> Install VMware Tools. See image below. Then log in to your virtual machine in the console and issue the following commands:
cd /mnt
mkdir cdrom
mount /dev/cdrom /mnt/cdrom
cd /tmp
tar zxvf /mnt/cdrom/VMware*
cd vmware-tools-distrib
./vmware-install.pl
Introducing vSphere Hypervisor 5.5 (ESXi)
We’re late to the party (again), but VMware’s latest ESXi platform is quite impressive. Because there’s a free version, we wanted to walk through the installation scenario just in case you have a spare (beefy) server sitting around gathering dust. Security is always our primary concern, and you are well-advised to install ESXi behind a secure, hardware-based firewall with no Internet port exposure to your ESXi server or its virtual machines!
There are dozens of VMware products and add-ons for the ESXi platform. Almost all of them cost money, lots of it. If your company is considering a move to VMware, then the free ESXi platform is a good way to get your feet wet. Before you make purchasing decisions, you really need to hire a VMware consultant. It could save you tens of thousands of dollars.
For today, our focus is getting a free ESXi platform in place to run PBX in a Flash virtual machines. Here’s what you’ll need: a server, the vSphere Hypervisor 5.5 ESXi ISO, a free license for ESXi, and the vSphere Client for Windows. All are free, but you do have to register for an account on the VMware web site. A web client is also available for dedicated Mac and Linux users. See the VMware site for details.
ESXi comes with a short-term license to let you try the application. Once you register for an account on the VMware web site, you also can obtain a full license here at no cost. Don’t put it off. Once your short-term eval license expires, you’re dead in the water unless you previously have installed the free, unrestricted license.
Installing ESXi. Here are the steps to get yourself in the (free) ESXi business:
- Download the ESXi ISO and burn it to a CD/DVD
- Obtain permanent license key from VMware
- Boot your server from the CD and answer the (easy) prompts
- When install finishes, remove CD and reboot
- Start up ESXi and log in as root with your new password
- Write down the IP address of your server
- Your temporary license key (only) is now active
- Using a browser, access your ESXi server by its IP address
- Click on the provided link to download and install the vSphere Client
- Open vSphere Client on Windows Desktop and login as root with same password
Registering Your ESXi License Key. Once the vSphere Client is open on your desktop…
- Select Configuration tab
- Click Software and choose Licensed Features
- Click Edit link in the top right hand corner as shown below
- Choose: Assign a new license key to this host
- Enter the license key you obtained from VMware
- Click OK to save your changes
- Make sure your key was accepted and is displayed
Getting Support. If you need help or have tips with regard to this tutorial, please visit this thread on the PIAF Forum and post your comments. Enjoy!
Deals of the Week. There are a couple of amazing deals still on the street, but you’d better hurry. First, for new customers, Sangoma is offering a board of your choice from a very impressive list at 75% off. For details, see this thread on the PIAF Forum. Second, a new company called Copy.com is offering 20GB of free cloud storage with no restrictions on file size uploads (which are all too common with other free offers). Copy.com has free sync apps for Windows, Macs, and Linux systems. To take advantage of the offer, just click on our referral link here. We get 5GB of extra storage, too, which will help avoid another PIAF Forum disaster.
Originally published: Tuesday, September 24, 2013
Need help with Asterisk? Visit the PBX in a Flash Forum.
We are pleased to once again be able to offer Nerd Vittles’ readers a 20% discount on registration to attend this year’s 10th Anniversary AstriCon in Atlanta. And, if you hurry, you also can take advantage of the early bird registration discount. Here’s the Nerd Vittles Discount Code: AC13NERD.
Special Thanks to Our Generous Sponsors
FULL DISCLOSURE: ClearlyIP, Skyetel, Vitelity, DigitalOcean, Vultr, VoIP.ms, 3CX, Sangoma, TelecomsXchange and VitalPBX have provided financial support to Nerd Vittles and our open source projects through advertising, referral revenue, and/or merchandise. As an Amazon Associate and Best Buy Affiliate, we also earn from qualifying purchases. We’ve chosen these providers not the other way around. Our decisions are based upon their corporate reputation and the quality of their offerings and pricing. Our recommendations regarding technology are reached without regard to financial compensation except in situations in which comparable products at comparable pricing are available from multiple sources. In this limited case, we support our sponsors because our sponsors support us.
BOGO Bonaza: Enjoy state-of-the-art VoIP service with a $10 credit and half-price SIP service on up to $500 of Skyetel trunking with free number porting when you fund your Skyetel account. No limits on number of simultaneous calls. Quadruple data center redundancy. $25 monthly minimum spend required. Tutorial and sign up details are here.
The lynchpin of Incredible PBX 2020 and beyond is ClearlyIP components which bring management of FreePBX modules and SIP phone integration to a level never before available with any other Asterisk distribution. And now you can configure and reconfigure your new Incredible PBX phones from the convenience of the Incredible PBX GUI.
VitalPBX is perhaps the fastest-growing PBX offering based upon Asterisk with an installed presence in more than 100 countries worldwide. VitalPBX has generously provided a customized White Label version of Incredible PBX tailored for use with all Incredible PBX and VitalPBX custom applications. Follow this link for a free test drive!
Special Thanks to Vitelity. Vitelity is now Voyant Communications and has halted new registrations for the time being. Our special thanks to Vitelity for their unwavering financial support over many years and to the many Nerd Vittles readers who continue to enjoy the benefits of their service offerings. We will keep everyone posted on further developments.
Some Recent Nerd Vittles Articles of Interest…
Fall Festivus: Asterisk Text-to-Speech Roundup with a Baker’s Dozen New Voices
[soundcloud url="http://api.soundcloud.com/tracks/110813303″ params="" width=" 100%" height="166″ iframe="true" /]
It’s been a while since we looked at the text-to-speech (TTS) landscape with Asterisk®. So we thought we’d bring you up to date on where we stand with text-to-speech in the free department insofar as Asterisk 11 is concerned. The hands-down winner remains Lefteris Zafiris’ implementation of Google TTS. It rivals any commercial TTS software application and costs you nothing. The good news is, if you’re running Incredible PBX 11, you already have it. For other PBX in a Flash systems, start with our previous Nerd Vittles tutorial to get Google TTS installed. For other systems, start with the Lefteris Zafiris tutorial. Once everything is installed, copy the perl script to /usr/local/sbin and make a temporary directory to hold your Google TTS recordings:
cp /var/lib/asterisk/agi-bin/googletts-cli.pl /usr/local/sbin/googletts-cli.pl
mkdir /tmp/tts
cd /tmp/tts
For each recording you wish to create, use the following syntax where hello.wav is the name for your new file and "Hello world" is the text you wish to convert to a sound file:
googletts-cli.pl -o hello.wav -l en -t "Hello world"
Next, convert the .wav file into a .gsm file that is compatible with Asterisk and move it into place for use with Asterisk:
sox hello.wav -r 8000 -c1 hello.gsm
mv hello.gsm /var/lib/asterisk/sounds/custom
To convert the file into an MP3 for your cellphone or a silly web site like ours, it goes like this:
lame -h -b 64 "hello.wav" "hello.mp3"
Now you can use the recording in your Asterisk dialplan like this:
exten => 1234,n,Playback(custom/hello)
To use the recorded voice prompts in FreePBX®, you first must copy them to your desktop computer. Then, in FreePBX, choose Admin -> System Recordings. Pick the file on your desktop and click Upload. Give the recording a name and then click Save. The recordings then are available for use in your IVRs, Ring Groups, and Announcements.
To create Google TTS prompts on-the-fly in your dialplan, use the following syntax:
exten => 1234,n,agi(googletts.agi,"Hello world.")
If you need help, take a look at PIAF Forum thread covering Google TTS and build some terrific applications for you and your customers. It’s the ultimate freebie!
Today we also want to explore what else is out there besides Flite and Google TTS. Festival and its little brother, Flite, have been staples of the PBX in a Flash and Incredible PBX projects since the outset. The problem has always been the lack of voices. The good news is that now there are at least some choices with Festival. To use these new voices with Asterisk in PBX in a Flash and Incredible PBX, you’ll first need to crank up Festival. From the command prompt, type: festival –server &. If you’d prefer to start up Festival when your server boots, then issue the following command and reboot:
echo "festival --server &" >> /etc/rc.d/rc.local
To download and install the new voices, we’ll need the RPMForge repository. If you’re using a 32-bit system, issue the following commands to activate it:
wget http://pkgs.repoforge.org/rpmforge-release/rpmforge-release-0.5.3-1.el6.rf.i686.rpm
rpm -Uvh rpmforge*
sed -i 's|enabled = 0|enabled = 1|' /etc/yum.repos.d/rpmforge.repo
If you’re running a 64-bit system, issue the following commands:
wget http://pkgs.repoforge.org/rpmforge-release/rpmforge-release-0.5.3-1.el6.rf.x86_64.rpm
rpm -Uvh rpmforge*
sed -i 's|enabled = 0|enabled = 1|' /etc/yum.repos.d/rpmforge.repo
Now let’s add some voices to your server. You can find out what’s available by issuing one of the following commands:
yum search festvox
yum search festival
To install some new voices for you to play with, issue the following commands:
yum -y install festvox-rms-arctic-hts.noarch
yum -y install festvox-kal-diphone.noarch
yum -y install festvox-ked-diphone.noarch
yum -y install festvox-jmk-arctic-hts.noarch
yum -y install festvox-clb-arctic-hts.noarch
yum -y install festvox-awb-arctic-hts.noarch
yum -y install festvox-bdl-arctic-hts.noarch
yum -y install hispavoces-pal-diphone.noarch
yum -y install hispavoces-sfl-diphone.noarch
For a list of your installed voices for Festival, issue the following command:
echo "(voice.list)" | festival --interactive
- kal_diphone
- ked_diphone
- nitech_us_clb_arctic_hts
- nitech_us_jmk_arctic_hts
- nitech_us_slt_arctic_hts
- nitech_us_rms_arctic_hts
- nitech_us_bdl_arctic_hts
- nitech_us_awb_arctic_hts
- JuntaDeAndalucia_es_sf_diphone
- JuntaDeAndalucia_es_pa_diphone
To use Festival voices in your dial plan, you’ll need the name of the voice you wish to use with a prefix of voice_. So, for example, the kal_diphone voice would be voice_kal_diphone. You can control the volume of the voice prompts by (gradually) adjusting the scale. Then the dialplan syntax looks like this:
exten => 1234,n,System(echo "Hello." | text2wave -eval "(voice_kal_diphone)" -scale 1.0 -F 8000 -o /tmp/${UNIQUEID}.wav)
exten => 1234,n,Playback(/tmp/${UNIQUEID})
exten => 1234,n,System(rm -f /tmp/${UNIQUEID}.wav)
We have a third option for you today. eSpeak for Asterisk is brought to you by none other than Lefteris Zafiris. If you haven’t already figured it out, Lefteris has single-handedly kept Asterisk text-to-speech humming along for years. We all owe him our deepest appreciation. Thank you, Lefteris!
eSpeak is a terrific TTS platform because it supports literally dozens of foreign languages. It’s still hard for some Americans to grasp the idea that the whole world doesn’t speak English so here’s an app for the Restivus. Lefteris is a Debian devotee so it takes a little elbow grease to get this one going on the CentOS platform with PBX in a Flash or Incredible PBX. If you can cut-and-paste commands, then this shouldn’t be too difficult; however, we don’t recommend this version for production use.1 After logging into your server as root, make certain that you’ve enabled the RPMForge repo as explained above. Then issue the following commands to install eSpeak and eSpeak for Asterisk:
yum -y install portaudio-devel
yum -y install libsndfile-devel
yum -y install libsamplerate-devel
yum -y install espeak
yum -y install espeak-develcd /usr/src
git clone git://github.com/zaf/Asterisk-eSpeak
cd Asterisk-eSpeak
make
make install
make samples
cd /etc/asterisk
mv espeak.conf espeak.conf.orig
wget http://incrediblepbx.com/espeak.conf
chown asterisk:asterisk *.conf
amportal restart
Once eSpeak is loaded, the dialplan syntax for eSpeak TTS looks like this:
exten => 1234,n,Espeak("Welcome to the new world.",any,en-us)
exten => 1234,n,Espeak("Bienvenido al nuevo mundo.",any,es-la)
For the list of eSpeak language abbreviations, issue the following command: espeak --voices
.
So… where do we go from here? Hopefully, MBROLA and Festival MBROLA are next in line. The Debian methodology has already been documented. Who would like to tackle a CentOS tutorial?
Important Final Step. Once you’ve finished installing your new TTS apps and voices, don’t forget to turn off the RPMForge repo. There are many apps in the repo that will do irreparable damage to your PBX in a Flash server if it attempts to update a component from the wrong repository! Just issue the following command to disable the RPMForge repo until you need it again. Enjoy!
sed -i 's|enabled = 1|enabled = 0|' /etc/yum.repos.d/rpmforge.repo
Deals of the Week. There’s still an amazing deal on the street, but you’d better hurry. A new company called Copy.com is offering 20GB of free cloud storage with no restrictions on file size uploads (which are all too common with other free offers). Copy.com has free sync apps for Windows, Macs, and Linux systems. To take advantage of the offer, just click on our referral link here. We get 5GB of extra storage which will help avoid another PIAF Forum disaster.
Originally published: Tuesday, September 17, 2013
Need help with Asterisk? Visit the PBX in a Flash Forum.
We are pleased to once again be able to offer Nerd Vittles’ readers a 20% discount on registration to attend this year’s 10th Anniversary AstriCon in Atlanta. Here’s the Nerd Vittles Discount Code: AC13NERD.
Special Thanks to Our Generous Sponsors
FULL DISCLOSURE: ClearlyIP, Skyetel, Vitelity, DigitalOcean, Vultr, VoIP.ms, 3CX, Sangoma, TelecomsXchange and VitalPBX have provided financial support to Nerd Vittles and our open source projects through advertising, referral revenue, and/or merchandise. As an Amazon Associate and Best Buy Affiliate, we also earn from qualifying purchases. We’ve chosen these providers not the other way around. Our decisions are based upon their corporate reputation and the quality of their offerings and pricing. Our recommendations regarding technology are reached without regard to financial compensation except in situations in which comparable products at comparable pricing are available from multiple sources. In this limited case, we support our sponsors because our sponsors support us.
BOGO Bonaza: Enjoy state-of-the-art VoIP service with a $10 credit and half-price SIP service on up to $500 of Skyetel trunking with free number porting when you fund your Skyetel account. No limits on number of simultaneous calls. Quadruple data center redundancy. $25 monthly minimum spend required. Tutorial and sign up details are here.
The lynchpin of Incredible PBX 2020 and beyond is ClearlyIP components which bring management of FreePBX modules and SIP phone integration to a level never before available with any other Asterisk distribution. And now you can configure and reconfigure your new Incredible PBX phones from the convenience of the Incredible PBX GUI.
VitalPBX is perhaps the fastest-growing PBX offering based upon Asterisk with an installed presence in more than 100 countries worldwide. VitalPBX has generously provided a customized White Label version of Incredible PBX tailored for use with all Incredible PBX and VitalPBX custom applications. Follow this link for a free test drive!
Special Thanks to Vitelity. Vitelity is now Voyant Communications and has halted new registrations for the time being. Our special thanks to Vitelity for their unwavering financial support over many years and to the many Nerd Vittles readers who continue to enjoy the benefits of their service offerings. We will keep everyone posted on further developments.
Some Recent Nerd Vittles Articles of Interest…
- Recompiling eSpeak from source with this patch will eliminate a reported file descriptor leak that could cause Asterisk to crash. [↩]
Newbie’s SIP Navigation Guide for Asterisk: Is It Safe?
It’s Back to School Time at Nerd Vittles today with a wrap-up of our series exploring the symbiotic relationship between SIP and Asterisk® including the most important consideration of all: SIP Security 101, a quick-and-dirty look at the security implications of using SIP with Asterisk. If you read nothing else before you begin your VoIP adventure, move today’s article to the top of your list. It might save you a personal fortune! Think of it as winning the lottery without even buying a ticket. Then we’ll summarize some safe approaches to using SIP with Asterisk. And finish up with a novel way to implement free SIP calling using almost any telephone: POTS phone, cellphone, or any SIP phone.
Asterisk Boot Camp: SIP Security 101
By default, most Asterisk systems including those relying upon FreePBX® are configured to deny anonymous SIP calls. If your server has a fully-qualified domain name, it means SIP calls to 201@myserver.com will fail. Since SIP URI calls are free from anywhere in the world, that’s a big deal. The million dollar question is why not just enable anonymous SIP calling on your Asterisk server and call it a day. Then anybody can call any extension on your PBX. That’s half of the answer actually: "Then anybody can call any extension on your PBX." If that were the only exposure by opening up SIP to anonymous callers, many of us could probably live with that. After all, that’s how POTS phones worked for almost 100 years. The difference, of course, is anonymous SIP calls are free and often undetectable regardless of where the calling party happens to actually be. Unlike HTTP requests which preclude users from spoofing the IP address, SIP requests have no such limitation. That means a SIP packet can knock on your door masquerading as a SIP packet initiated from your own server.
Unfortunately, when you expose UDP port 5060 and your Asterisk server to any and all SIP traffic sent your way from the Internet, it means any kind of SIP packet can be sent to your server for processing. That includes login requests to extensions and trunks as well as SIP packets with all sorts of vile code embedded in the SIP headers.
Without boring you with the details, suffice it to say that SIP vulnerabilities have been discovered regularly in all flavors of Asterisk… as recently as a few weeks ago. And, Asterisk 12 is just around the corner with an entirely new approach to SIP. So, before you open your server to anonymous SIP attacks, ask yourself whether you (and your wallet) believe that we’ve seen the last of the SIP vulnerabilities. Keep in mind that, if an attacker gains access to your server, everything is vulnerable including not only your internal extension credentials but also your account names and passwords with all of your providers. Once they have those, they don’t need access to your server any longer. They can run up phone bills on your nickel using direct connections to your providers.
Believe it or not, there was actually a SIP exploit several years ago where the bad guys embedded some code in a SIP packet that crashed the server when anyone happened to look at the SIP entry in their call logs or CDR reports using a browser. And, before the crash, it relayed some of your most prized Asterisk secrets to the attacker. Remember, many Asterisk passwords are stored in plain text on your server. If you don’t believe it, try these commands after logging into your server and switching to the asterisk user (the user account that runs Asterisk and your Apache web server):1
su asterisk
cat /etc/asterisk/manager.conf
asterisk -rx "database show"
mysql -uroot -ppassw0rd asterisk -e "SELECT keyword,data FROM sip"
If that last one doesn’t scare the crap out of you, then Let Me Google That For You. The simple answer would have been to cleanse SIP headers before writing the contents to the logs. But the "purists" won that battle maintaining that such action would bastardize the call logs by failing to document everything in exactly the way it was received.
So much for security!
As long as we have very secure passwords for trunks and extensions, doesn’t Fail2Ban block hacking attacks after several unsuccessful login attempts? Unfortunately, that depends on the performance of your server and the one being used by the attacker. Remember, neither Asterisk nor the Linux kernel, scans SIP traffic for malware. Fail2Ban operates on the data after the fact by scanning entries in your server logs for matching patterns which you define. And these entries are written to the logs only after Asterisk or your web server has processed the packets. If it turns out the attacker is using a gazillion-horsepower server in the cloud, then your poor little server never gets enough processing time with Linux to actually scan the Asterisk log for failed login attempts. What that means is the attacker can execute thousands, if not tens of thousands, of SIP attempts before Fail2Ban ever springs into action even when you’ve set the threshold for blocking an IP address to as few as three failed login attempts.
We want to stress that this isn’t a diatribe against the developers with regard to security. The point is some of the fundamental design choices made with regard to Asterisk and FreePBX do not lend themselves to safe deployment on a public-facing server without additional layers of security. In the case of PBX in a Flash™, it’s the reason we have implemented Apache-level security on the FreePBX web assets in addition to an IPtables firewall and Fail2Ban. For history lovers, keep in mind that, when Asterisk@Home and trixbox® were in their heyday, none of these safeguards were provided.
We’re going to postpone discussion of SIP encryption and SRTP because of its complexity. Suffice it to say, it’s just coming into its own with Asterisk 11, and it raises new problems of its own, e.g. finding compatible phones. You can try it out using our PBX in a Flash WebRTC Virtual Machine. And here is today’s must-read article on the subject.
What’s the bottom line with SIP exposure of your Asterisk server to the Internet? The short answer is DON’T especially if you’re new to the VoIP and Asterisk world. You’re simply asking for a $100,000 phone bill. Ma Bell & Friends don’t really care who makes calls on your nickel. And, remember, keeping your server behind a hardware-based firewall with no Internet port exposure does not affect your ability to make or receive calls using registered providers. That includes SIP, IAX2, Google Voice, and PSTN calls. It also doesn’t affect your ability to make free outbound SIP URI calls to anywhere in the world even with no provider registrations.
Safely Integrating SIP URIs into Asterisk
The long answer is there is a relatively safe way to implement SIP access to your server from the Internet. First, you can use registered trunks with reputable providers to provide SIP connectivity to your server. This includes PSTN calls to DIDs as well as SIP URI calls in many cases. Let the providers worry about SIP attacks while your server sits safely behind a hardware-based firewall with NO Internet port exposure! There are better tools than Asterisk to avoid SIP disasters and protect against malicious SIP attacks. You can protect yourself by keeping a minimal amount of money in your provider accounts with no automatic replenishment from a credit card. Second, for those that need to connect remote phones to your Asterisk server, you can use Firewall WhiteLists with IPtables to restrict access to only the good guys. Travelin’ Man 3 sets up WhiteLists for PBX in a Flash servers in a couple of minutes.
What you can’t do is rely upon BlackLists of IP addresses to keep the bad guys out. If you’ve ever played Whac-A-Mole, you can appreciate the difficulty of using BlackLists to secure your server. The bad guys can change their identity by simply using different IP addresses or by using the IP address of a compromised PC such as the one sitting in your grandma’s kitchen. In addition, the bad guys have become experts in inserting important (safe) IP addresses in BlackLists which, of course, is extremely problematic if one of those IP addresses happens to be one of your SIP providers.
The silver lining of Asterisk is the ability to make and receive free calls to and from anywhere in the world using SIP URIs. They look like email addresses, but SIP URIs actually connect calls via SIP between SIP servers and endpoints regardless of where they may be on the Internet. In the "old days," advertising a SIP URI for inbound call access to your server meant exposing Asterisk to anonymous SIP traffic. Not any more! Simply sign up for a (pre-paid) account on VoIP.ms or a FREE account at either sip2sip.info or Anveo.com, follow one of our tutorials to register your account, and you’ll automatically have a free SIP URI for your Asterisk server. No Internet port exposure of your Asterisk server is ever required!
Instead of using some-account-number@atlanta.voip.ms or some-account-number@sip2sip.info as your SIP URI, most folks will prefer a SIP URI that matches your existing domain, if you happen to have one. This Nerd Vittles article will walk you through the process of converting your VoIP.ms or Sip2Sip URI into something more manageable: yourname@yourdomain.com. And, thanks to RentPBX, everyone is more than welcome to use the PBX in a Flash cloaking servers on the east and west coast to manage the SIP URI translation magic. If you happen to be (or would like to become) a PBX in a Flash Forum Guru, there’s another option. We’ll host your vanity SIP URI @pbxinaflash.com using your forum name. Just drop us a note on the forum for details. We’re always looking for subject matter experts on the forum. You don’t have to be an expert in everything, just one topic. If you qualify, please let us know and WELCOME!
Dialing SIP URI Calls with iNUM Using Any Telephone
We’ve saved the best for last again. The only problem with SIP URIs is how to dial them. Most phones don’t have a full keyboard. While you can certainly create a few Speed Dial (Custom) Extensions in FreePBX using sip/joe@schmo.com as the SIP URI dial string for the extension, this isn’t feasible on a bigger scale. What makes more sense is to actually use a phone number to connect the call. We previously have documented the iNum solution that’s available through a number of providers including VoIP.ms and LocalPhone. These calls used to be free with Google Voice until Google changed their mind. Now they’re 3¢ a minute. But they’re still free calls with most providers. The only real drawback is the length of the phone number. 883510009901997 is a little hard to remember, even to call Lenny. And, with RentPBX, you need a prefix of 011 to add insult to injury. But, hey, the calls are free to anywhere.
There’s a better way that actually uses your SIP URI to make the call. It’s John Todd’s brainchild, FreeNUM with ISN. As the image shows, ISN numbers are easy to remember and easy to dial. Instead of an @ symbol for email, you use an * symbol for you know what. And you still get Lenny! The trick to ISN dialing is that we pass a number such as 1234*1061 to a DNS server that knows how to translate the numeric sequence into a SIP URI that looks like this: 1234@pbxinaflash.com. It takes the number after the asterisk and resolves it to a fully-qualified domain name which is preconfigured at freenum.org. And the result is inter-domain numeric SIP addressing using ordinary telephone instruments.
The Asterisk setup using FreePBX is simple. The FreeNUM trunk should look like this:
The Outbound Route should look like this:
The dialplan context to tack on the end of /etc/asterisk/extensions_custom.conf looks like this:
[freenum]
exten => _X.,1,Set(TIMEOUT(absolute)=10800)
exten => _X.,2,NoOp(Number to Call: ${EXTEN})
exten => _X.,3,Set(isnresult=${ENUMLOOKUP(${EXTEN},sip,,1,freenum.org)})
exten => _X.,4,GotoIf($["${isnresult}"=""]?6:5)
exten => _X.,5,Dial(SIP/${isnresult},40,r)
exten => _X.,6,Background(ss-noservice)
exten => _X.,7,Congestion
exten => _X.,8,Hangup
exten => h,1,Hangup
exten => i,1,Hangup
exten => T,1,Hangup
For those using Incredible PBX™, the good news is you already have it. Just pick up an extension on your system and dial 1234*1061 to give Lenny a piece of your mind. It works exactly like this SIP URI: sip/1234*1061@freenum.org. For everyone else, believe it or not, we’ve already written about this back when some of you still were in diapers. So read the article for all the details and ISN registration instructions. You will note that in more recent versions of Incredible PBX (including what we’ve shown above), the ** prefix for ISN calls has been eliminated. Now you can dial ISN calls just as described in the FreeNUM literature. We’ve also migrated our ISN domain from sip.pbxinaflash.com to pbxinaflash.com to simplify DNS administration. For PBX in a Flash Forum Gurus, we’ll be happy to set you up with your own free ISN number in the pbxinaflash.com domain as well.
Dialing SIP URI Calls with IPKall Using Any Telephone
There’s yet another option. With an IPKall DID from one of several Seattle area codes, you can interconnect your SIP URI with every PSTN phone in the world. And it’s free. Just make at least one inbound call a month, and the phone number is yours to keep. Here’s the easy way to do it. Just sign up for a free DID at www.ipkall.com. After choosing an area code for your free number, you’ll be prompted for the following information.
Here’s what you’d enter using your free Sip2Sip URI:
- Phone Number: 323XXXXXXX
- SIP Proxy: sip2sip.info
- Email Address: your-email-address
- Password: some-password-to-get-back-into-your-account
Here’s what you’d enter using your free Anveo SIP URI:
- Phone Number: 1555ACCOUNTNUMBER
- SIP Proxy: sip.anveo.com:5010
- Email Address: your-email-address
- Password: some-password-to-get-back-into-your-account
Once you’ve completed the form, submit it and wait for your new phone number to be delivered in your email. You should get it within a couple minutes so check your spam folder if you don’t see it. Congratulations! You’ve done everything you need to do for anyone to call you using either your SIP URI or your new DID from IPkall.
It’s worth noting that IPKall recycles DIDs that aren’t used for 30 days. If you use Incredible PBX, the easiest way to assure you don’t lose your number is to set up a weekly recurring Telephone Reminder that calls your IPkall number.
But How Do I Make VoIP Calls to Plain Old Telephones?
We’ve spent a lot of time on free SIP solutions for inbound calls, but inevitably you’re going to need a way to call Plain Old Telephones whether they be customers or friends and family. To make outbound calls or terminations in VoIP parlance, you’re going to need an account with a VoIP provider. If you’re in the United States, you still can get one or more free Google Voice accounts. These accounts let you make unlimited calls to anywhere in the U.S. and Canada. Both PBX in a Flash and Incredible PBX come preconfigured to support Google Voice calling. The scuttlebutt is this may be the last year of the free ride so it’s probably a good idea to try some other alternatives. It’s a good idea anyway because Google has made an art form of "improving" things and breaking VoIP calling periodically. Here’s our "Best of the Best" list of pay-by-the-minute VoIP providers for US48 calls. Lower cost providers are available to call some destinations, but the vendors below provide flat-rate per minute pricing to all US48 destinations. Trunks to support most of these providers also come preconfigured in Incredible PBX. With most of these providers, you set up an account and deposit a small pot of money. When you make calls, the cost of the call is debited from your account. When you run out of money, you can’t make any more calls. For the sake of redundancy, having multiple providers is a very good idea. It costs you nothing to have multiple providers until you actually make calls. Enjoy!
- $.005 – LocalPhone* (mobile $.007)
- $.007 – DIDlogic (toll-free $.005)
- $.009 – SIP.US
- $.010 – Flowroute (toll-free $.000)
- $.010 – Anveo.com
- $.011 – VoIP.ms*
- $.014 – Vitelity
- $.015 – Les.net
- $.020 – CallCentric*
* Free iNUM DID and free worldwide iNUM calling. Tutorial here.
Don’t forget to List Yourself in Directory Assistance so everyone can find you by dialing 411. And add your new number to the Do Not Call Registry to block telemarketing calls. Or just call 888-382-1222 from your new number.
Deals of the Week. There’s still an amazing deal on the street, but you’d better hurry. A new company called Copy.com is offering 20GB of free cloud storage with no restrictions on file size uploads (which are all too common with other free offers). Copy.com has free sync apps for Windows, Macs, and Linux systems. To take advantage of the offer, just click on our referral link here. We get 5GB of extra storage which will help avoid another PIAF Forum disaster.
Originally published: Monday, September 9, 2013
Need help with Asterisk? Visit the PBX in a Flash Forum.
We are pleased to once again be able to offer Nerd Vittles’ readers a 20% discount on registration to attend this year’s 10th Anniversary AstriCon in Atlanta. Here’s the Nerd Vittles Discount Code: AC13NERD.
Special Thanks to Our Generous Sponsors
FULL DISCLOSURE: ClearlyIP, Skyetel, Vitelity, DigitalOcean, Vultr, VoIP.ms, 3CX, Sangoma, TelecomsXchange and VitalPBX have provided financial support to Nerd Vittles and our open source projects through advertising, referral revenue, and/or merchandise. As an Amazon Associate and Best Buy Affiliate, we also earn from qualifying purchases. We’ve chosen these providers not the other way around. Our decisions are based upon their corporate reputation and the quality of their offerings and pricing. Our recommendations regarding technology are reached without regard to financial compensation except in situations in which comparable products at comparable pricing are available from multiple sources. In this limited case, we support our sponsors because our sponsors support us.
BOGO Bonaza: Enjoy state-of-the-art VoIP service with a $10 credit and half-price SIP service on up to $500 of Skyetel trunking with free number porting when you fund your Skyetel account. No limits on number of simultaneous calls. Quadruple data center redundancy. $25 monthly minimum spend required. Tutorial and sign up details are here.
The lynchpin of Incredible PBX 2020 and beyond is ClearlyIP components which bring management of FreePBX modules and SIP phone integration to a level never before available with any other Asterisk distribution. And now you can configure and reconfigure your new Incredible PBX phones from the convenience of the Incredible PBX GUI.
VitalPBX is perhaps the fastest-growing PBX offering based upon Asterisk with an installed presence in more than 100 countries worldwide. VitalPBX has generously provided a customized White Label version of Incredible PBX tailored for use with all Incredible PBX and VitalPBX custom applications. Follow this link for a free test drive!
Special Thanks to Vitelity. Vitelity is now Voyant Communications and has halted new registrations for the time being. Our special thanks to Vitelity for their unwavering financial support over many years and to the many Nerd Vittles readers who continue to enjoy the benefits of their service offerings. We will keep everyone posted on further developments.
Some Recent Nerd Vittles Articles of Interest…
- On the Raspberry Pi platform, substitute "raspberry" for "passw0rd" in the MySQL example. [↩]
The Music Frontier: Taming Streaming Music on Hold with Asterisk 11
It’s been over 7 years since we first wrote about streaming music on hold with Asterisk®. While we’re energized with Back to School Fever, we decided it was about time for a refresher. And, in honor of TWOfer Tuesday, we also have a terrific new SIP discovery to share. It won’t cost you a dime.
For long time readers of Nerd Vittles, you will note that all of the MOH syntax has changed since the early Asterisk days. So today we wanted to document how to integrate streaming music on hold into Asterisk 11 with or without FreePBX®.
Prerequisites: With the PIAF-Green platform, all of the Linux tools you’ll need are already in place. On other Asterisk platforms, you may need to install MPG123 before any of this will work. Before streaming audio can be used for Music on Hold (MOH) with Asterisk, there are three essential pieces. First, you must have a source of streaming audio that works. Second, you need a streaming audio player on your Asterisk/Linux server that can "talk" to Asterisk. And, finally, Asterisk has to be properly configured to support streaming audio as the source for your music on hold.
Legal Disclaimer. There are all sorts of licensing restrictions on streaming of commercial music. With commercial radio broadcasts, the short answer is you can’t do it without paying a fee. However, things get murky where your music on hold stream originates with an Internet provider who already has paid a fee for your use of the streaming content. Nevertheless, you should consult with an attorney before beginning your broadcasting career. It would be an understatement to suggest that the RIAA, ASCAP, and their friends in Congress and the White House, have made "music mooching" an expensive hobby. In addition, there is a move afoot by the White House to make streaming of copyrighted music a felony. Not surprisingly, the White House Copyright Czar just jumped ship to take a cushy job heading up the industry’s anti-piracy lobbying group. For those that are criminally inclined, it probably would be less expensive to return to the glory days of shoplifting music and playing it in the comfort of your home or dorm room… not that we would ever encourage criminal behavior, of course.
Choosing a Streaming Audio Source. An almost infinite variety of streaming audio exists on the net. If you’re just getting into streaming audio, head over to SHOUTcast.com for over 50,000 FREE sources to get you started. If you’d prefer to set up your own SHOUTcast server, Nerd Vittles has previously covered solutions for both the Windows (WinAMP) and Mac (NiceCast) platforms. This is one area where the Mac platform really shines. NiceCast works flawlessly. Insofar as Asterisk is concerned, here’s the bottom line. If the streaming audio source you’ve chosen sounds like crap when you play it on your PC or Mac, it will sound the same way (or worse) as your MOH source. So start your project by picking a source that sounds good and be sure it plays reliably on your desktop PC or Mac before proceeding further. Keep in mind that anything above a 24K mono stream is wasted on a telephone call so there’s no need to choose a 128K stereo audio stream unless you just want to eat up your bandwidth. Also keep in mind that, unless you’re using your own stream on your private LAN, the streaming audio will be using the same bandwidth that you need to support incoming and outgoing phone calls over your broadband connection. So less is more!
Configuring Asterisk for MOH Streaming Audio. Here are the three steps to get things working today. First, you’ll need the web link to your music source. Second, you’ll need to configure a MUSICCLASS Channel to support that stream using Asterisk. And third, you’ll need to set up a test extension to try out your music stream.
In the case of SHOUTcast.com, the procedure to obtain the necessary link for your streaming audio source is straight-forward. Find the station desired and Ctrl-Click or Right-Click on the station and copy the link to your clipboard. This is NOT the link you’ll need for Asterisk! Instead, open the link in a new browser window. It will download a .pls file to your desktop. Open this file using a text editor, and copy out one of the File* entries (if there are several). Choose the one that looks something like this: http://160.79.128.61:5016. If you’re using Nicecast on a Mac, start up the app, choose your music source, and then click the Share button. Nicecast will display two entries as shown below:
Using our example, the required Nicecast link for Asterisk running on the same LAN is http://192.168.0.105:8002.
Now set up a music on hold channel for your streaming audio: nano -w /etc/asterisk/musiconhold_custom.conf. If you’re using your own streaming audio server, then use the Nicecast entry from the procedure above. Otherwise, use the SHOUTcast entry following the procedure we outlined. Here are some examples:
[Reggae]
mode=custom
application=/usr/bin/mpg123 -q -r 8000 -f 8192 -b 2048 --mono -s http://160.79.128.61:5016
[Top40]
mode=custom
application=/usr/bin/mpg123 -q -r 8000 -f 8192 -b 2048 --mono -s http://95.141.24.98:80
[NewAge]
mode=custom
application=/usr/bin/mpg123 -q -r 8000 -f 8192 -b 2048 --mono -s http://sfstream1.somafm.com:8032
;[nicecast]
;mode=custom
;application=/usr/bin/mpg123 -q -r 8000 -f 8192 -b 2048 --mono -s http://192.168.0.105:8002/
There’s a reason we’ve commented out the [nicecast] entry. If Asterisk doesn’t find it running, you’ll get an endless stream of "Interrupted system call" errors, not exactly the sort of stream we had in mind. And a cautionary note about bandwidth: a streaming audio source, once configured, continues streaming until you disable it in musiconhold_custom.conf and restart Asterisk. So choose your sources, the number of sources, and the amount of bandwidth each consumes carefully. Finally, here’s a tip about the volume of your audio stream. With MPG123, the -f setting is the closest thing there is to a volume setting. The values range from 1 to 32768. If some of your callers will be using cellphones, it has been reported that the 8192 setting is too high. Give 1192 a try and adjust as necessary to meet your own requirements.
Once you’ve specified your audio stream(s), save the updated musiconhold custom file: Ctrl-X, Y, then Enter.
Testing Your MOH Stream with Asterisk. With everything now properly configured, let’s set up an extension just to be sure it’s working correctly. Edit your extensions_custom.conf file in /etc/asterisk and insert the following snippet in the [from-internal-custom] context:
exten => 466,1,Answer
exten => 466,2,Playback(pls-hold-while-try)
exten => 466,3,Set(CHANNEL(MUSICCLASS)=nicecast)
exten => 466,4,MusicOnHold()
exten => 466,5,Hangup
exten => 467,1,Answer
exten => 467,2,Playback(pls-hold-while-try)
exten => 467,3,Set(CHANNEL(MUSICCLASS)=Reggae)
;exten => 467,3,Set(CHANNEL(MUSICCLASS)=Top40)
;exten => 467,3,Set(CHANNEL(MUSICCLASS)=NewAge)
exten => 467,4,MusicOnHold()
exten => 467,5,Hangup
Once you’ve added this extension code, save the updated file: Ctrl-X, Y, then Enter. Then restart Asterisk: amportal restart. Pick up a phone on your Asterisk system and dial 467. After you’re connected, it may take up to 2 minutes for the streaming audio to begin, but this delay only occurs after Asterisk is restarted. Once you’ve heard your audio stream playing, hang up and call back just to make sure. Remember, each stream you activate continues streaming! It’s your bandwidth.
Configuring FreePBX 2.11 for MOH Streaming Audio. Once you have everything working, let’s switch to FreePBX 2.11 and show you the quick-and-dirty way to accomplish the same thing with a single line of code. Just use the same Application string that was used in the musiconhold_custom.conf setup above. The only caution here is be sure to use different labels than the ones used above. For example, to use the same source as NewAge, just change the label to NewAge2 in FreePBX.
Now open FreePBX and click Settings -> Music on Hold -> Add Streaming Category. Then fill in the blanks like this:
Once you have one or more streaming categories defined, you can select your favorite when you create a new Inbound Route, Ring Group, or Conference.
Introducing Anveo
SIP Nirvana. We have another terrific SIP discovery for you this week. Previously, we’ve raved about Sip2Sip’s free SIP URIs and AnveoDirect’s terrific SIP bargains for those that like wholesale prices. And last week we introduced SIP.US which finally hits the $20/trunk price point for unlimited inbound and outbound calling in US48. It also works hand-in-glove with FreePBX 2.11. Today we want to introduce Anveo’s commercial offering which includes residential, business, and free SIP services. Anveo is the hands-down winner of our "Best Free VoIP Resource on the Net" award. We’ll get to why, but there’s so much more…
Let’s begin with a quick summary of their DID offerings:
Anveo has one of the most robust VoIP offerings you’ll find in terms of feature set. Here’s a quick overview:
- SMS Messaging (1¢ per message)
- Fax and Fax-to-Email Integration
- Voicemail to Text
- Salesforce.com CRM
- ZOHO CRM
- G.729 and G.722 (HD Voice)
- Destination-based Outbound CallerID
- Text-to-Speech (41 voices in 17 languages)
- Google Contacts
- Google Analytics
- Web Calling
- Call Recording with Amazon S3 Integration
- Outbound Call Campaigns
- Conference Calls with Recording
- Worldwide DIDs and Number Porting
- Disposable Phone Numbers
- IVR Call Flow Builder
- Anveo Phone API
- Reseller Toolkit
For today, let’s focus on FREE. What a free Anveo account gets you is AMAZING. In addition to another SIP URI with fax support for your server, you also get access to Anveo’s Call Flow Builder to create templates with up to 10 items. None of it costs you a dime! Just sign up for a new account at anveo.com using the Nerd Vittles referral code: 9625450. That gets us a few shekels to keep the lights burning if you ever start spending real money with Anveo.
The shining star of Anveo is its drag-and-drop Call Flow Builder. The icing on the cake is Anveo’s Phone API which we will leave for exploration on another occasion. For Asterisk aficionados, think of Call Flow Builder as a drag-and-drop interface that actually creates Asterisk dialplan code on the fly. While you can create your own, there also is an impressive collection of sample templates from which to choose. Each takes less than 30 seconds to set up, and every template that you create gets its own dedicated SIP URI. For example, one click gets you a Fax-to-Email delivery service using any DID or SIP URI in your account. Another click gets you a Stealth AutoAttendant including automatic fax detection with email fax delivery plus SIP URI call forwarding, all for free. Very impressive! Here’s what it looks like when configured to send fax calls to email and non-fax inbound calls to Lenny. As we noted, this took less than 30 seconds to set up using a default template with any free Anveo account. All that we added was a SIP URI in the SIP Call Control by clicking on the Pencil icon to edit. Then we clicked SAVE in the blue title bar and, presto, Lenny worked!
First things first. Once you’ve signed up for a new account at anveo.com using the Nerd Vittles referral code: 9625450, Anveo will email your credentials. Sign in and activate a new SIP account. In order to register the Anveo SIP trunk with your Asterisk server, you’ll need two pieces of information which you will find under PBX -> Users/sub-accounts -> action.Preferences -> SIP Device Registration: Username and Password.
Once you have your username and password, open up FreePBX and add a new SIP Trunk with your credentials. You can create a custom DID for your trunk by tacking something like /12345 onto the end of the Registration String below.
Next, add an Inbound Route using the Custom DID you created above. Point it to an extension or other resource on your system. Then check to make sure your SIP registration was successful: Reports -> Asterisk Info -> SIP Info.
No exposure of your server to the Internet through your hardware-based firewall is required. However, for those using IPtables WhiteLists or Travelin’ Man for enhanced security, you will need to manually add a SIP entry for sip.anveo.com to /etc/sysconfig/iptables and restart IPtables. The appropriate entry should look like this:
-A INPUT -p udp -m udp -s sip.anveo.com --dport 5010 -j ACCEPT
Here’s what free gets you in addition to 15 megs of online storage for voicemails and faxes:
And Finally… The Magic. You now can receive free inbound SIP URI calls at zero cost from anywhere in the world using SIP/1555ACCOUNTNUMBER@sip.anveo.com:5010. And, if you prefer a more user-friendly SIP URI, take a look at last week’s Nerd Vittles cloaking service offering which is also free. Enjoy!
SIP URI Pricing Clarification. Inbound calls to your account’s SIP URI are always free. That means you can register an Asterisk trunk to your Anveo account, and all incoming SIP calls from your Anveo SIP URI will be free. If you sign up for a free IPKall DID as explained in our previous article, you’ll have a near perfect (and free) VoIP platform for your home or office. Give Lenny a try using our Anveo/IPKall/RentPBX combo:
On the Anveo Value Plans (see the DID screenshot above), be aware that calls using Call Flow templates that rely upon an additional Anveo SIP URI count against your daily bucket of "platform minutes." Free accounts get 40 free minutes a day. Business accounts get 150 minutes a day. Additional calls are billed at 1.5¢ per minute.1
A Word of Caution. For those considering commercial or home use of Anveo for "real calling," be advised that Anveo recently changed their pricing model on calls terminated in the United States. Some of these calls now are $.005 per minute while others reportedly were as high as $.25 per minute! Pricing has changed every day this week. We would encourage you to find a different termination provider if costs are a consideration. After four attempts to implement a tiered pricing model for U.S. terminations, Anveo rolled back to flat rate pricing on Thursday evening. See the DSL Reports message thread for details.
Deals of the Week. There’s still an amazing deal on the street, but you’d better hurry. A new company called Copy.com is offering 20GB of free cloud storage with no restrictions on file size uploads (which are all too common with other free offers). Copy.com has free sync apps for Windows, Macs, and Linux systems. To take advantage of the offer, just click on our referral link here. We get 5GB of extra storage which will help avoid another PIAF Forum disaster.
Originally published: Tuesday, September 3, 2013 Last updated: Thursday, September 5, 2013
Need help with Asterisk? Visit the PBX in a Flash Forum.
We are pleased to once again be able to offer Nerd Vittles’ readers a 20% discount on registration to attend this year’s 10th Anniversary AstriCon in Atlanta. Here’s the Nerd Vittles Discount Code: AC13NERD.
Special Thanks to Our Generous Sponsors
FULL DISCLOSURE: ClearlyIP, Skyetel, Vitelity, DigitalOcean, Vultr, VoIP.ms, 3CX, Sangoma, TelecomsXchange and VitalPBX have provided financial support to Nerd Vittles and our open source projects through advertising, referral revenue, and/or merchandise. As an Amazon Associate and Best Buy Affiliate, we also earn from qualifying purchases. We’ve chosen these providers not the other way around. Our decisions are based upon their corporate reputation and the quality of their offerings and pricing. Our recommendations regarding technology are reached without regard to financial compensation except in situations in which comparable products at comparable pricing are available from multiple sources. In this limited case, we support our sponsors because our sponsors support us.
BOGO Bonaza: Enjoy state-of-the-art VoIP service with a $10 credit and half-price SIP service on up to $500 of Skyetel trunking with free number porting when you fund your Skyetel account. No limits on number of simultaneous calls. Quadruple data center redundancy. $25 monthly minimum spend required. Tutorial and sign up details are here.
The lynchpin of Incredible PBX 2020 and beyond is ClearlyIP components which bring management of FreePBX modules and SIP phone integration to a level never before available with any other Asterisk distribution. And now you can configure and reconfigure your new Incredible PBX phones from the convenience of the Incredible PBX GUI.
VitalPBX is perhaps the fastest-growing PBX offering based upon Asterisk with an installed presence in more than 100 countries worldwide. VitalPBX has generously provided a customized White Label version of Incredible PBX tailored for use with all Incredible PBX and VitalPBX custom applications. Follow this link for a free test drive!
Special Thanks to Vitelity. Vitelity is now Voyant Communications and has halted new registrations for the time being. Our special thanks to Vitelity for their unwavering financial support over many years and to the many Nerd Vittles readers who continue to enjoy the benefits of their service offerings. We will keep everyone posted on further developments.
Some Recent Nerd Vittles Articles of Interest…
- We inquired about the SIP URI pricing with Anveo tech support. Their response is included in this section. The remainder of the article already had been written before contacting Anveo. In responding to the support request (in less than 10 minutes), Anveo generously offered us the use of additional platform minutes and a $5 "slush fund" for future testing and purchases of Call Flow PRO items (4¢ each). While we all may have our price for slanting reviews, we want to assure everyone that Anveo’s generosity in no way affected the contents or views expressed in this article. The FTC and NSA now can resume their naps. [↩]
A Second Look at Grandstream’s UCM6100 Asterisk PBX & Some SIP Surprises
What a difference a couple months make! For those that are keeping an eye on the UCM6100 Asterisk® PBX from Grandstream, we wanted to provide some additional insights based upon two firmware updates that Grandstream has released since the PBX was first introduced earlier this summer. The short version of this story is Grandstream has addressed most of the open source issues and they’ve resolved well over a hundred bugs. In addition, they’ve published excellent documentation on the PBX in addition to a tutorial on how to interconnect the UCM6100 with other devices including FreePBX®-based Asterisk servers such as PBX in a Flash. So we are pleasantly surprised by Grandstream’s efforts to address many of the concerns that were raised by some of us in the open source community.
UPDATE: Here’s a newer Asterisk appliance for under $30.
Let’s talk about functionality. While the system is still closed in the sense that you can’t add your own Asterisk dialplan code, there’s a lot to like about an under $300 turnkey PBX platform that offers 2 FXO and 2 FXS ports plus most of the feature set you’d find in a $5,000 to $10,000 PBX. And, yes, it even does faxing. The device is especially appealing for organizations that have numerous satellite offices with minimal technical expertise on site. Did we mention you also can backup and restore or even clone multiple units in a matter of minutes using the web-based GUI and an SD card.
We’ve saved the best for last. The silver lining may very well be the functionality boost you’ll get from the addition of a $100 OBi202 device with a Bluetooth adapter.1 This dynamic duo provides turnkey Google Voice support plus Bluetooth cellphone integration which means your cellphone becomes a transparent component in your PBX. When you’re in the office, calls to your cellphone can be managed through the PBX. When the Internet dies, outbound calls from users of the PBX can be routed out through your cellphone. And there’s support for up to three more SIP trunks from many of your favorite providers. Here’s a quick tutorial on how to integrate sip2sip.info and free SIP URIs.
If you glance up at the status screen shot, you’ll see that we have a SIP trunk registered to our primary PBX in a Flash server for transparent calling between extensions on both systems, a Google Voice trunk registered with the OBi202 for free calling in the U.S. and Canada, a second analog trunk registered to the Bluetooth port on the OBi202 to handle cellphone connectivity, a SIP extension registered to a Yealink T46G desktop SIP phone, and an analog extension registered to a collection of Panasonic analog (DECT) cordless phones. We have a Conference Room preconfigured and a Parking Lot to support 5 calls. In addition, there’s voicemail for each extension and an IVR setup (shown below) with virtually the same options you’d have with FreePBX. This is not some half-baked, crippled PBX. Mark Spencer & Co. developed the Asterisk-GUI which is what lies under the UCM6100 covers… and it shows.
Are we switching and dumping PBX in a Flash, Incredible PBX, and FreePBX? Of course not. But, having supported dozens of remote sites staffed with a handful of employees and no technical staff in a prior life, all I can say is this device would have been a godsend. It’s worth a careful look as a supplement to a full-featured central office Asterisk PBX.
Some SIP Surprises to Celebrate the End of Summer
Cloak & Dapper. If you like the clothes, then you’ll love this addition for your PBX. We’ve been exploring SIP URIs and free calling recently, and the one addition that many were clamoring for was an easy way to translate a SIP URI from sip2sip.info or voip.ms into an address using your own domain. By cloaking the address, your email and your "phone address" actually can match. So you can use joe@schmo.com for your email address and joe@schmo.com for your SIP URI as well. Unfortunately, DNS doesn’t speak SIP directly so it takes a little data manipulation to make this work. @w1ve, one of the PIAF resident gurus, actually discovered the sipcloak.org service in New Zealand. But, because of geographical limitations and the fact that it’s not open source, we preferred a home-grown solution. Thanks to the genius of Bill Simon, the magic of YATE, and the hosting generosity of RentPBX2, we now have redundant SIP cloaking servers on the east and west coasts of the United States. To use the service, just add the following records to DNS substituting your own domain and user entries. Once installed, you can receive SIP URI calls using bert@schmo.com or ernie@schmo.com. The PHP source code customized for YATE is available on GitHub. Our extra special thanks to Bill, Diana, and Iman who made this possible!
_sip._udp.schmo.com. IN SRV 10 10 5060 east.pbxinaflash.com.
_sip._udp.schmo.com. IN SRV 10 10 5060 west.pbxinaflash.com.
sip-bert.schmo.com. IN TXT "123@sip2sip.info"
sip-ernie.schmo.com. IN TXT "456@sip2sip.info"
Introducing SIP.US. We’re delighted to introduce a new SIP trunking provider and supporter for the PBX in a Flash project. While Vitelity3 remains the perfect choice for those wanting stellar reliability and pay-as-you-go convenience at rock-bottom pricing, there are organizations that actually need dedicated SIP trunks with an unlimited calling option. And, of course, in the VoIP world, redundancy is a good thing. With today’s special offer for PBX in a Flash users, SIP.US finally hits the $20 magic price point that many of us have clamored for. They also have an incredibly simple and secure module for FreePBX that makes setup a breeze. Here are some of the other advantages the SIP.US service offers:
The signup process couldn’t be easier. Sign up at our link using the PIAF promo code. Choose a free DID and obtain your security PIN for the FreePBX module from SIP.US. Finally, download the SIP.US module for FreePBX to your desktop and install it using Module Admin. Activate the module and enter your security PIN when prompted. That’s it! SIP.US handles the rest of the FreePBX setup process automagically. Give them a try. We think you’ll be delighted.
Deals of the Week. There are a couple amazing deals on the street, but you’d better hurry. ObiHai has all of their telephone adapters on sale at Amazon this week. Click on the Obi110 link in the sidebar to check out the latest pricing. A new company called Copy.com is offering 20GB of free cloud storage with no restrictions on file size uploads (which are all too common with other free offers). Copy.com has free sync apps for Windows, Macs, and Linux systems. To take advantage of the offer, just click on our referral link here. We get 5GB of extra storage which will help avoid another PIAF Forum disaster.
Originally published: Tuesday, August 27, 2013
Need help with Asterisk? Visit the PBX in a Flash Forum.
We are pleased to once again be able to offer Nerd Vittles’ readers a 20% discount on registration to attend this year’s 10th Anniversary AstriCon in Atlanta. Here’s the Nerd Vittles Discount Code: AC13NERD.
Special Thanks to Our Generous Sponsors
FULL DISCLOSURE: ClearlyIP, Skyetel, Vitelity, DigitalOcean, Vultr, VoIP.ms, 3CX, Sangoma, TelecomsXchange and VitalPBX have provided financial support to Nerd Vittles and our open source projects through advertising, referral revenue, and/or merchandise. As an Amazon Associate and Best Buy Affiliate, we also earn from qualifying purchases. We’ve chosen these providers not the other way around. Our decisions are based upon their corporate reputation and the quality of their offerings and pricing. Our recommendations regarding technology are reached without regard to financial compensation except in situations in which comparable products at comparable pricing are available from multiple sources. In this limited case, we support our sponsors because our sponsors support us.
BOGO Bonaza: Enjoy state-of-the-art VoIP service with a $10 credit and half-price SIP service on up to $500 of Skyetel trunking with free number porting when you fund your Skyetel account. No limits on number of simultaneous calls. Quadruple data center redundancy. $25 monthly minimum spend required. Tutorial and sign up details are here.
The lynchpin of Incredible PBX 2020 and beyond is ClearlyIP components which bring management of FreePBX modules and SIP phone integration to a level never before available with any other Asterisk distribution. And now you can configure and reconfigure your new Incredible PBX phones from the convenience of the Incredible PBX GUI.
VitalPBX is perhaps the fastest-growing PBX offering based upon Asterisk with an installed presence in more than 100 countries worldwide. VitalPBX has generously provided a customized White Label version of Incredible PBX tailored for use with all Incredible PBX and VitalPBX custom applications. Follow this link for a free test drive!
Special Thanks to Vitelity. Vitelity is now Voyant Communications and has halted new registrations for the time being. Our special thanks to Vitelity for their unwavering financial support over many years and to the many Nerd Vittles readers who continue to enjoy the benefits of their service offerings. We will keep everyone posted on further developments.
Some Recent Nerd Vittles Articles of Interest…
- Some of our purchase links refer users to Amazon when we find their prices are competitive for the recommended products. Nerd Vittles receives a small referral fee from Amazon to help cover the costs of our blog. We never recommend particular products solely to generate Amazon commissions. However, when pricing is comparable or availability is favorable, we support Amazon because Amazon supports us. [↩]
- The $15 a month RentPBX hosting special for PBX in a Flash servers in the Cloud is still available through the link in the right sidebar of Nerd Vittles. Better hurry! [↩]
- Vitelity has been and remains a loyal financial backer of the Nerd Vittles and PBX in a Flash projects. We appreciate Vitelity’s continuing support and encourage all of our readers to try out their service with the special pricing included toward the end of this article. [↩]
Practicing Safe SIP: Adding SIP URI and Free DID Connectivity to Asterisk
Last year, we began our exploration of safe SIP options for Asterisk® by introducing a hybrid solution using VoIP.ms for a registered SIP trunk and IPkall for a free DID. Today, in addition to a free IPkall DID to accept incoming PSTN calls, we have a slightly different approach that provides a direct SIP URI address from Sip2Sip.info for your server. As with the original tutorial, today’s implementation preserves our Zero Internet Footprint™ design for total SIP insulation of your server from the Internet. And all of the components to deploy today’s solution are completely free.
PBX in a Flash™ has a long (safe) history in the VoIP community, and the major reason is that we constantly preach never directly exposing any ports on your Asterisk server to the Internet without implementing a WhiteList of safe IP addresses. This Zero Internet Footprint™ design keeps everybody out except a trusted, defined group on your WhiteList. For everyone else, they never see your server. So how do you receive calls?
You do it with phone numbers (DIDs) or SIP URIs tied to registered Google Voice, SIP, and IAX trunks from reputable providers. Because these trunks have constant registrations with safe service providers on the Internet, calls to these DIDs and SIP URIs can flow in and out of your server without exposing your server directly to the Internet. Callers still can contact you, but they do it through an intermediary with whom you have a registered SIP trunk. Thus, the SIP vulnerability (if there is any) remains with the SIP provider and never with your server directly.
For today’s tutorial, we’ll be using the latest and greatest PIAF-Green™ Virtual Machine featuring Asterisk 11 and FreePBX® 2.11. We also recommend installation of Incredible PBX™ 11 which includes Travelin’ Man™ 3 to provide secure WhiteList management for your Asterisk firewall. Here are links to the PIAF-Green VM with Incredible PBX 11 as well as the Travelin’ Man 3 tutorial to get you started. We recommend you configure this using a VirtualBox® virtual machine on your favorite desktop computer just to get comfortable with the setup. Then you can repeat the drill using a dedicated or cloud-based server once you’ve mastered the basics. All of today’s setup will work without making any adjustments to your hardware-based firewall which should be sitting between your desktop computer and the Internet.
Registering for a Sip2Sip Account. Once you have the VoIP platform in place with Asterisk 11, FreePBX 2.11, Incredible PBX 11, and Travelin’ Man 3, you’re ready to add a SIP trunk from Sip2Sip.info. Just sign up for a free account on their site leaving the Account Name field blank. They will email you your credentials. Click on the provided link in the email to access your new account at http://x.sip2sip.info. Your account name will consist of a 10-digit-number@sip2sip.info. To log in, use the default SIP address as shown and leave the password field blank. Then click Login Now. Immediately click on the settings tab, choose an 8-digit numeric password, disable your Voice Mailbox, and click the SAVE button. Your Sip2Sip account is now secure unless someone is lucky enough to guess your password from the 100 million possibilities. You’ll need your 10-digit SIP account number and password to set up your SIP trunk on your Asterisk 11 server in the next step so write them down and then log out of your Sip2Sip account!
FreePBX and Asterisk Configuration Overview. Using a web browser, log into FreePBX® on your server. We’ll need to create several items to get everything working. First, we’ll add a new SIP trunk with your Sip2Sip credentials to handle incoming calls. Second, we’ll add a Custom Trunk to handle outbound calls to Sip2Sip. Third, we’ll add an Inbound Route to process incoming calls. Fourth, we’ll add an Outbound Route so that you can make calls using your outbound Sip2Sip trunk. Calls to other Sip2Sip numbers are free. For the rest, you’ll pay a per minute fee. Whether to use the pay service is completely up to you! Finally, we’ll log into your server as root and add Sip2Sip to your IPtables WhiteList and make two manual adjustments to the Asterisk dialplan to accommodate Sip2Sip’s way of handling SIP calls. Then we’ll restart Asterisk, and you’re done.
- Connectivity -> Trunks -> Add SIP Trunk
- Connectivity -> Trunks -> Add Custom Trunk
- Connectivity -> Inbound Routes -> Add Incoming Route
- Connectivity -> Outbound Routes -> Add Route
- Enable Sip2Sip in your IPtables WhiteList
- Add srvlookup=yes in sip_general_custom.conf
- Set enable=yes in dnsmgr.conf
- Restart Asterisk: amportal restart
Adding Sip2Sip SIP Trunk. While logged into FreePBX 2.11, choose Connectivity -> Trunks -> Add SIP Trunk. Fill out the form like this using your Sip2Sip 10-digit number and password. Unlike some trunk setups, entering your actual 10-digit Sip2Sip number as the Outbound Caller ID is mandatory, or inbound calls will be rejected by your server. Replace 223XXXXXXX with your actual 10-digit Sip2Sip number in the five places shown below. Replace 12345678 with your actual Sip2Sip password in the two places shown below.
- Trunk Name: Sip2Sip
- Outbound Caller ID: 223XXXXXXX
- Dial Pattern: leave blank
- Trunk Name: sip2sip
- Trunk Details:
- type=peer
- canreinvite=no
- nat=yes
- qualify=yes
- domain=sip2sip.info
- fromdomain=sip2sip.info
- outboundproxy=proxy.sipthor.net
- fromuser=223XXXXXXX
- defaultuser=223XXXXXXX
- secret=12345678
- insecure=invite
- context=from-trunk
- host=sip2sip.info&81.23.228.129&81.23.228.150&85.17.186.7
- Register String: 223XXXXXXX:12345678@sip2sip.info/223XXXXXXX
Adding Sip2Sip Custom Trunk for Outbound Calling. While logged into FreePBX 2.11, choose Connectivity -> Trunks -> Add Custom Trunk. Fill out the form like this using the entries below:
- Trunk Name: sip2sip-out
- Dialed Number Matched Pattern: 223NXXXXXX
- Custom Dial String: SIP/$OUTNUM$@sip2sip.info
Adding Inbound Route. Next you need to tell FreePBX how to process incoming calls from your Sip2Sip number. Choose Connectivity -> Inbound Routes -> Add Incoming Route and fill out the form to look like this. Change the destination to match whatever you prefer: an extension, ring group, IVR, etc. If you followed last week’s tutorial to install Lenny Encore, then you can choose Lenny as your destination as well.
Adding Outbound Route. Next you need to tell FreePBX how to process outbound calls to your Sip2Sip account. Choose Connectivity -> Outbound Routes -> Add Route and fill out the form to look like this. After you have saved your entries, make certain that you drag the sip2sip-out route to the top of your Outbound Route List (on the right side). Otherwise, 10-digit Sip2Sip calls may inadvertently be processed by one of your other trunks that handles 10-digit numbers. The 3333 and 4444 numbers are test accounts at Sip2Sip to enable you to try out connectivity.
Adding Sip2Sip to Your IPtables WhiteList. We’re assuming you already have installed Travelin’ Man 3 and secured your server by running /root/secure-iptables. If not, start there. Now we need to enable UDP SIP connectivity for Sip2Sip in your WhiteList by running the following commands while logged in as root:
/root/add-fqdn sip2sip sip2sip.info
/root/add-ip sip2sip1 81.23.228.129
/root/add-ip sip2sip2 81.23.228.150
/root/add-ip sip2sip3 85.17.186.7
Making Asterisk Dialplan Adjustments. While still logged into your server as root, issue the following commands to finish up enabling Sip2Sip URI support in Asterisk. The last command verifies that your Sip2Sip trunk is actually registered.
echo "enable=yes" >> /etc/asterisk/dnsmgr.conf
echo "srvlookup=yes" >> /etc/asterisk/sip_general_custom.conf
amportal restart
asterisk -rx "sip show registry"
Adding an IPkall DID for Your SIP URI. We’ve now completed all the steps necessary to receive incoming SIP URI calls using your new Sip2Sip URI: 323XXXXXXX@sip2sip.info. Anyone in the world can dial that SIP URI from a SIP phone, and the calls will be answered by your server. But suppose we’d also like folks to be able to pick up a Plain Old Telephone and call using Sip2Sip.info to route the incoming call through the SIP URI. Here’s the easy way to do it. Just sign up for a free DID at www.ipkall.com. After choosing an area code for your free number, you’ll be prompted for the following information. Here’s what you’d enter using today’s example:
- Sip2Sip Phone Number: 323XXXXXXX
- SIP Proxy: sip2sip.info
- Email Address: your-email-address
- Password: some-password-to-get-back-into-your-account
Once you’ve completed the form, submit it and wait for your new phone number to be delivered in your email. You should get it within a couple minutes so check your spam folder if you don’t see it. Congratulations! You’ve done everything you need to do for anyone to call you using either your Sip2Sip URI or your new DID number from IPkall.
It’s worth noting that IPkall recycles DIDs that aren’t used for 30 days. If you use Incredible PBX, the easiest way to assure you don’t lose your number is to set up a weekly recurring Telephone Reminder that calls your IPkall number.
Adding SIP URI Dialing with Your Own Domain. Thanks to a great tip from @w1ve on the PIAF Forum, you now can create free SIP URIs using your own domain. Here’s how.
Troubleshooting. If you experience intermittent congestion issues with attempted connections to your SIP URI, try the [from-sip-external] trick outlined in our PIAF Forum posting.
Add Free Calls to 40 Million Asterisk Servers with e164.org. While we’re on a roll of free calling, here’s a simple way to add free calling to 40 million Asterisk servers around the world. Just add your name and phone numbers to the e164.org registry at no cost and configure FreePBX with ENUM support. Then outbound calls to numbers in the e164 registry will always be free as well. The whole setup takes less than 10 minutes. Here’s how.
You already have a SIP URI for your Asterisk server from the Sip2Sip setup above. Now let’s get you signed up with an account on e164.org. Go to the web site and click the Sign Up tab. Go through the sign up drill and then log into your new account. Then click the Phone Numbers tab and add your IPkall phone number to e164. If you have additional DIDs, enter the area code and number for each of them. Then click the Next button. You’ll be warned about not having the number you’ve specified redirected to an IVR. If you already have this DID redirected to an IVR, change the routing temporarily to an extension that you can answer to obtain your PIN before you press Next to proceed. You’ll then be prompted for the SIP address to contact your server. Leave the default SIP protocol and plug in the address you were assigned by Sip2Sip. As soon as you click the Next button, your phone should start to ring, but there may not be a message when you answer. Hang up and wait for the second call within 15 minutes. It will include your PIN. Now click on the Phone Numbers tab and update your phone entry by choosing Enter PIN and typing your assigned PIN. Your phone number now has been activated with the e164 service. To complete the setup, you’ll want to click on the Do Not Call option and make your selections. You also can decide whether to list yourself in the ENUM White Pages directory.
Remember that the real purpose of this drill is to avoid charges when you place outbound calls to numbers in the ENUM directory. We merely added your numbers to e164.org so that others could benefit as well. So the final step before you can start saving money is to configure FreePBX to handle ENUM lookups for outbound calls from your server. One more observation may be helpful. You’ll recall that one of the limitations of FreePBX has always been that once an outbound route was chosen for a call, if the call was completed using the first destination trunk in that route, then the call processing ended there. ENUM adds a new wrinkle because we basically want to connect to ENUM to check for a free route and, if no matching entry is found, then we want the next trunk to process the call. As luck would have it, FreePBX has been tweaked to allow this scenario. All you have to do is create an ENUM trunk and then place it first in your sequence of trunks for each of your outbound routes. If an ENUM entry is found for the number you’re calling, the call will be routed as a free call with a direct SIP connection. Otherwise, the call processing will continue and the call will be routed using the next trunk specified in your outbound route.
There are two steps in FreePBX to implement ENUM. First, create a special ENUM trunk. Second, adjust your Outbound Routes to process outbound calls using the ENUM trunk first. Then the series of trunks you already have specified in each outbound route will be triggered if there is no ENUM path for your call. NOTE: You obviously wouldn’t do this for an emergency 911 outbound route.
In FreePBX, click Connectivity -> Trunks, Add ENUM Trunk. Enter your desired CallerID for these calls. Set a maximum number of channels, if desired, and then leave the other entries blank in most cases. Save your settings and reload your dialplan. Now click Connectivity -> Outbound Routes and adjust the sequence of trunks for each of your existing routes. Be sure to put ENUM in the top position of each desired route. Also make certain that all calls are dialed with a dial string of 1NXXNXXXXXX or NXXNXXXXXX with a Prepend entry of 1 as shown below. Enjoy!
Don’t forget to List Yourself in Directory Assistance so everyone can find you by dialing 411. And add your new number to the Do Not Call Registry to block telemarketing calls. Or just call 888-382-1222 from your new number.
Deals of the Week. There’s still one amazing deal on the street, but you’d better hurry. A new company called Copy.com is offering 20GB of free cloud storage with no restrictions on file size uploads (which are all too common with other free offers). Copy.com has free sync apps for Windows, Macs, and Linux systems. To take advantage of the offer, just click on our referral link here. We get 5GB of extra storage which will help avoid another PIAF Forum disaster.
Originally published: Monday, August 19, 2013
Need help with Asterisk? Visit the PBX in a Flash Forum.
Don’t miss the first-ever FreePBX World on August 27-28 at the Mandalay Bay in Las Vegas. For complete details, see this post on the FreePBX blog.
We are pleased to once again be able to offer Nerd Vittles’ readers a 20% discount on registration to attend this year’s 10th Anniversary AstriCon in Atlanta. Here’s the Nerd Vittles Discount Code: AC13NERD.
Special Thanks to Our Generous Sponsors
FULL DISCLOSURE: ClearlyIP, Skyetel, Vitelity, DigitalOcean, Vultr, VoIP.ms, 3CX, Sangoma, TelecomsXchange and VitalPBX have provided financial support to Nerd Vittles and our open source projects through advertising, referral revenue, and/or merchandise. As an Amazon Associate and Best Buy Affiliate, we also earn from qualifying purchases. We’ve chosen these providers not the other way around. Our decisions are based upon their corporate reputation and the quality of their offerings and pricing. Our recommendations regarding technology are reached without regard to financial compensation except in situations in which comparable products at comparable pricing are available from multiple sources. In this limited case, we support our sponsors because our sponsors support us.
BOGO Bonaza: Enjoy state-of-the-art VoIP service with a $10 credit and half-price SIP service on up to $500 of Skyetel trunking with free number porting when you fund your Skyetel account. No limits on number of simultaneous calls. Quadruple data center redundancy. $25 monthly minimum spend required. Tutorial and sign up details are here.
The lynchpin of Incredible PBX 2020 and beyond is ClearlyIP components which bring management of FreePBX modules and SIP phone integration to a level never before available with any other Asterisk distribution. And now you can configure and reconfigure your new Incredible PBX phones from the convenience of the Incredible PBX GUI.
VitalPBX is perhaps the fastest-growing PBX offering based upon Asterisk with an installed presence in more than 100 countries worldwide. VitalPBX has generously provided a customized White Label version of Incredible PBX tailored for use with all Incredible PBX and VitalPBX custom applications. Follow this link for a free test drive!
Special Thanks to Vitelity. Vitelity is now Voyant Communications and has halted new registrations for the time being. Our special thanks to Vitelity for their unwavering financial support over many years and to the many Nerd Vittles readers who continue to enjoy the benefits of their service offerings. We will keep everyone posted on further developments.
Some Recent Nerd Vittles Articles of Interest…
2013 Greatest Hits: Lenny Returns for an Encore Performance
Nothing in the VoIP community this year quite captured the hearts and minds of geeks around the world like Brian West’s "Lenny." For anyone that’s ever been dogged by obnoxious telemarketers or that’s had to deal with less than lucid tech support inquiries, Lenny was a godsend. Finally, we all had a place to send those poor souls while getting our daily chuckle listening to the results. If you’re late to the party and missed all the fun, then start today by listening to some of the recordings posted on ItsLenny.com and Reddit. Our personal favorite has got to be the "security expert" explaining the discovery of a vulnerability in Lenny’s network:
As if Brian needed another feather in his cap after FreeSwitch™, what made Lenny an instant hit was the ability to reroute telemarketing and blacklisted callers directly to ItsLenny.com headquarters for processing. The site provided numerous local phone numbers around the world as well as a SIP URI. For those in the PBX in a Flash™ and FreePBX® community, it was especially easy because of the Lorne Gaetz Lenny Blacklist Mod. By simply entering the SIP URI of Lenny, all of your telemarketers were immediately rerouted to Lenny. And then one day, The Music Died.
What? No more Lenny? Were we all destined to return to the screaming monkeys?
Well, not so fast. We got in touch with Brian to inquire about Lenny’s health. Brian explained that he was seeking a more robust home for our pal because of the tremendous response and worldwide usage of the ItsLenny.com site.
Brian also graciously offered permission to use the Lenny recordings for those that wanted to host their own "Lenny" during the interim. And that brings us to today. We’re not sufficiently proficient in FreeSwitch to offer an interim solution on that platform. And, for our shortcomings, we apologize. But what we can do is provide an Asterisk® alternative that you can host on your own server until Lenny returns to his former glory in his new home.
Introducing Lenny Encore! We’ve actually got a number of new creations to introduce today. First, we’ll give you a short law school lesson on the do’s and don’ts of recording phone calls. Second, today’s Lenny Encore dialplan code introduces the Asterisk BackgroundDetect function which actually waits for someone to speak and then proceeds when silence ensues. It’s not perfect, but it helps with applications like this and for applications that seek to detect the presence of answering machines when making robocalls. Third, we’ll show you how to use the Lenny Blacklist Mod in FreePBX to redirect blacklisted callers to any extension you wish rather than merely playing a congestion or Zapateller Special Information Tone (SIT). Fourth, we’ll show you how to record calls in Asterisk with one line of dialplan code. Fifth, we’ll document for the first time how to create a button on almost any SIP phone to reroute ringing (unanswered) incoming calls to another extension. Sixth, we’ll review how to safely set up your own SIP URI and Free DID to enable Lenny Encore access from anywhere. And, finally, we’ll provide you some links to take Lenny Encore for a test drive before you install anything. Please don’t use these links as a destination for your blacklist. The links will only be available for a few weeks. Now let’s get started.
Law School 101: Recording Phone Calls. For openers, this is not legal advice! Consult your own attorney for that. This is merely background information to hopefully alert you to some of the pitfalls which await should you decide to start recording phone conversations. One of the first things you learn in law school is that there’s a difference of legal opinion on almost every topic. That’s why both sides pay lawyers which is a good thing… for lawyers. So it is with the law pertaining to the recording of phone calls. Let’s start with the ABC’s of phone recording. Whether you can legally record a phone call between you and someone else depends upon several things: (A) the location of the person making the call, (B) the location of the person receiving the call, and (C) how the call makes the journey from Point A to Point B.
In some jurisdictions, you probably can’t record a phone call at all because you can’t legally operate an Asterisk server. In other jurisdictions, you can record a call if you give yourself permission to record your conversations with others. In a few jurisdictions (including at least a dozen states in the United States), both parties have to consent before you can record a phone call. In some of those, providing an announcement that you’re recording the call will suffice while in others you have to explain why you’re recording the call and allow the caller to opt out. At least in the United States, if the call crosses state lines then federal law may control; however, there may also be federal agency rules and regulations that impose additional constraints on interstate calls. In law school, there’s a full-semester course devoted to Conflict of Laws. What you need to know is that normally (but not always) the law of the jurisdiction in which the call is initiated controls. Clear as mud? You bet. Here’s the state-by-state and country-by-country breakdown of the rules for those of you that are curious. The moral of this story should be clear:
UNLESS YOUR INITIALS ARE NSA, DON’T RECORD PHONE CALLS UNLESS YOU’VE CONSULTED A LAWYER AND CAREFULLY EXPLAINED WHO THE CALLING PARTIES WILL BE, WHAT YOU INTEND TO RECORD, WHERE EACH POTENTIAL CALLER WILL BE CALLING FROM, WHEN YOU WILL BE RECORDING THE CALLS, WHY YOU ARE DOING IT, AND HOW YOU WILL BE RECORDING THE CALLS. And this isn’t going too well for the NSA either!
6 P.M. UPDATE: A couple of serious bugs were discovered in the initial release. If you’ve already installed Lenny Remake, please replace the original dialplan code using the following commands. Skip this step if you have not previously installed Lenny Remake. The first-time install instructions below have been corrected to remove the problem. Our apologies.
cd /tmp
wget http://pbxinaflash.com/lsupport.tgz
tar zxvf lsupport.tgz
rm lsupport.tgz
sed -i '\:// BEGIN Lenny Remake:,\:// END Lenny Remake:d' /etc/asterisk/extensions_custom.conf
sed -i '/\[from-internal-custom\]/r /tmp/lenny.txt' /etc/asterisk/extensions_custom.conf
rm lenny.txt
rm 3.gsm
asterisk -rx "dialplan reload"
amportal a r
Installing Lenny Encore for the First Time. Now for the fun stuff. We’ve only tested this on PBX in a Flash servers running Asterisk 1.8 and Asterisk 11. For other platforms, there may be some prerequisites that you have to address. On the PIAF platform, log into your server as root. Then create and run a shell script that looks like this:
#!/bin/bash
mkdir /var/lib/asterisk/sounds/lenny
chown asterisk:asterisk /var/lib/asterisk/sounds/lenny
cd /var/lib/asterisk/sounds/lenny
wget http://pbxinaflash.com/Lenny.tgz
tar zxvf Lenny.tgz
rm Lenny.tgz
cd /tmp
wget http://pbxinaflash.com/lsupport.tgz
tar zxvf lsupport.tgz
rm lsupport.tgz
sed -i '\:// BEGIN Lenny Remake:,\:// END Lenny Remake:d' /etc/asterisk/extensions_custom.conf
sed -i '/\[from-internal-custom\]/r /tmp/lenny.txt' /etc/asterisk/extensions_custom.conf
rm lenny.txt
mv 3.gsm /var/lib/asterisk/sounds/lenny
cd /var/lib/asterisk/sounds/lenny
chown asterisk:asterisk *
chmod 755 *
echo " " >> /etc/asterisk/extensions_custom.conf
echo "[bridgit]" >> /etc/asterisk/extensions_custom.conf
echo "exten => 4,1,Pickup(701@from-internal)" >> /etc/asterisk/extensions_custom.conf
echo "exten => 4,2,Pickup(777@from-internal)" >> /etc/asterisk/extensions_custom.conf
echo " " >> /etc/asterisk/extensions_custom.conf
asterisk -rx "dialplan reload"
amportal a r
echo "Try it out by dialing 53669 from any extension on your PBX."
In the [bridgit] section of the code (at the bottom of the script), you’ll see two extensions in bold: 701 and 777. These represent a phone extension and ring group on your server that handle incoming calls from telemarketers. We’ll explain it in more detail shortly. For now, change the numbers to match your setup before you run the script. If you want to manage telemarketing calls from additional extensions with SIP phones, just add additional lines to the [bridgit] context incrementing the line numbers as you go, e.g. 4,3 then 4,4, etc.
Installing Lenny Blacklist MOD. To automatically reroute blacklisted callers to Lenny Encore, you’ll need to modify the blacklist processing setup in FreePBX. To do this, you first have to install the Lennny Blacklist MOD. Download it to your desktop from the Download Now link. Next, add it to FreePBX in the usual way: Admin -> Module Admin -> Upload Modules. Choose the Lenny Blacklist MOD on your Desktop. Once its imported, click on the Local Module Admin link to install and enable it. Once it’s enabled, open it under Other -> Lenny Blacklist MOD. Configure it to match what’s shown below:
Recording Calls with Lenny Encore. By default, Lenny Encore will do its thing with no call recording. If you and your lawyer think recording is a good idea, here’s how to enable it. Log in as root and edit extensions_custom.conf in /etc/asterisk. Simply uncomment the three lines near the top of the file that look like what’s shown below and reload your dialplan:
;exten => 53669,n,MixMonitor(/tmp/Lenny/${RECORDING}.wav)
;exten => 53669,n,NoOp(Recording will be available: /tmp/Lenny/${RECORDING}.wav)
;exten => 53669,n,Playback(en/this-call-may-be-monitored-or-recorded)
This gets the recordings saved to the /tmp/Lenny directory on your server, but these file collections can grow large. We recommend emailing them to yourself in MP3 format once a day and then deleting them. Here’s how to set this up:
cd /root
wget http://nerdvittles.com/convert2mp3.tar.gz
tar zxvf convert2mp3.tar.gz
nano -w convert2mp3.sh
When the editor opens, plug in your email address for delivery of the files and then save the modified script. Now add an entry to /etc/crontab that looks like this:
6 1 * * * root /root/convert2mp3.sh >/dev/null 2>&1
Reroute Ringing Calls to Lenny Encore. We’ve never seen this documented for Asterisk so here’s a bonus for this week. Have you ever wanted to reroute an incoming call to another extension while it was ringing so that you didn’t have to answer, tell the caller to hold, and transfer the call? Well we have, too. That’s especially true in the case of telemarketers and politicians.
As part of the Lenny Encore dialplan code, we’ve added the necessary piece to get this working on many SIP phones with a spare button that can be pressed to dial a number. Many phones call it a Speed Dial entry. Just create a Speed Dial entry for your phone that looks like this:
Now, when the CallerID shows an annoying caller is ringing, just press the Lenny key!
But suppose you want to make this more generic. If you’d like to be able to press the Lenny key and be prompted for the extension number to which to forward the incoming call, then edit the 536691 dialplan code (as we did with call recording) and uncomment the following lines:
;exten => 536691,n,Flite("After the beep, enter extension or press pound for Lenny.")
;exten => 536691,n,Read(SENDTO,beep,7)
;exten => 536691,n,GotoIf($["foo${SENDTO}" = "foo"]?5:6)
If you hit the Lenny key while an incoming call is ringing and enter an extension number followed by #, then that’s where the call will go. If you just hit #, then Lenny Encore gets the call.
Taking Lenny Encore for a Test Drive. We’ve set up a temporary site to let you try Lenny out before installing on your own server. Just call 1-206-424-6913 or use either of the following SIP URIs: 2233435945@sip2sip.info or lenny@nerdvittles.com. Our next article shows you how to do it yourself!
Upgrading Lenny Encore. This project is still a work in progress. What that means is the code is changing almost daily. You can replace your setup with the latest code by following the 6 p.m. update procedure documented above. This will reset your system to NO RECORDINGS in addition to loading the latest dial plan code. Your feedback is, of course, always appreciated. Come join the fun!
More Lenny Encore to Come! Well, that’s enough to keep you busy this week. Next week (now available!), we’ll walk you through setting up a safe SIP URI and free DID to handle inbound calls for Lenny or any other purpose on your PBX in a Flash server.
Deals of the Week. There are a few amazing deals still on the street, but you’d better hurry. First, for new customers, Sangoma is offering a board of your choice from a very impressive list at 75% off. For details, see this thread on the PIAF Forum. Second, a new company called Copy.com is offering 20GB of free cloud storage with no restrictions on file size uploads (which are all too common with other free offers). Copy.com has free sync apps for Windows, Macs, and Linux systems. To take advantage of the offer, just click on our referral link here. We get 5GB of extra storage, too, which will help avoid another PIAF Forum disaster. Finally, O’Reilly has over 1,000 Packt Ebooks on sale for 50% off until August 15. Only 3 days left!
Originally published: Monday, August 12, 2013
Need help with Asterisk? Visit the PBX in a Flash Forum.
Don’t miss the first-ever FreePBX World on August 27-28 at the Mandalay Bay in Las Vegas. For complete details, see this post on the FreePBX blog.
We are pleased to once again be able to offer Nerd Vittles’ readers a 20% discount on registration to attend this year’s 10th Anniversary AstriCon in Atlanta. Here’s the Nerd Vittles Discount Code: AC13NERD.
Special Thanks to Our Generous Sponsors
FULL DISCLOSURE: ClearlyIP, Skyetel, Vitelity, DigitalOcean, Vultr, VoIP.ms, 3CX, Sangoma, TelecomsXchange and VitalPBX have provided financial support to Nerd Vittles and our open source projects through advertising, referral revenue, and/or merchandise. As an Amazon Associate and Best Buy Affiliate, we also earn from qualifying purchases. We’ve chosen these providers not the other way around. Our decisions are based upon their corporate reputation and the quality of their offerings and pricing. Our recommendations regarding technology are reached without regard to financial compensation except in situations in which comparable products at comparable pricing are available from multiple sources. In this limited case, we support our sponsors because our sponsors support us.
BOGO Bonaza: Enjoy state-of-the-art VoIP service with a $10 credit and half-price SIP service on up to $500 of Skyetel trunking with free number porting when you fund your Skyetel account. No limits on number of simultaneous calls. Quadruple data center redundancy. $25 monthly minimum spend required. Tutorial and sign up details are here.
The lynchpin of Incredible PBX 2020 and beyond is ClearlyIP components which bring management of FreePBX modules and SIP phone integration to a level never before available with any other Asterisk distribution. And now you can configure and reconfigure your new Incredible PBX phones from the convenience of the Incredible PBX GUI.
VitalPBX is perhaps the fastest-growing PBX offering based upon Asterisk with an installed presence in more than 100 countries worldwide. VitalPBX has generously provided a customized White Label version of Incredible PBX tailored for use with all Incredible PBX and VitalPBX custom applications. Follow this link for a free test drive!
Special Thanks to Vitelity. Vitelity is now Voyant Communications and has halted new registrations for the time being. Our special thanks to Vitelity for their unwavering financial support over many years and to the many Nerd Vittles readers who continue to enjoy the benefits of their service offerings. We will keep everyone posted on further developments.
Some Recent Nerd Vittles Articles of Interest…