Home » Technology » The SIPaholic’s Dream Come True: Introducing Anveo Direct

The Most Versatile VoIP Provider: FREE PORTING

The SIPaholic’s Dream Come True: Introducing Anveo Direct

We’re incredibly happy with the current list of providers that we recommend to PBX in a Flash™ users for VoIP trunking. At the top of our list is Vitelity, a leading VoIP provider that has been a major contributor to the Nerd Vittles and PBX in a Flash projects for many years. But, as often happens, one of our gurus on the PIAF Forum comes up with a terrific discovery that we just can’t wait to pass along. This week it was @w1ve who stumbled upon a new Anveo® Direct service for end-users with a special DID and SIP trunk offer. While the sub-account flexibility of Vitelity and some of the other providers is sorely missing, Anveo Direct does provide end-users with many of the same routing tools and SIP feature set that previously were reserved for use by major carriers. If you don’t believe some of the competition is less than thrilled, read this message thread on dslreports.com. And, until June 1, you can order DIDs in almost any U.S. region for 50¢ a month per DID with no setup fee. With Anveo Direct Value, that 50¢ buys you two trunks with 400 free incoming minutes a day. Outbound calls are pay-as-you-go and vary depending upon where you’re calling. Typical U.S. rates are $.001 to $.0055 per minute with least cost routing and automatic failover when a particular carrier’s route is having problems. As a point of reference, sending a one-page fax using Incredible Fax costs less than a penny and worked flawlessly using Anveo’s least costly routes.

DIDs also are available in more than 50 countries around the world, and all setup fees are waived until June 1. Most European DIDs are $1 or less per month. You’ll find the complete price list here. It’s worth mentioning that the 400 free incoming minutes a day applies collectively to all of your DIDs, not individually to each one. Additional incoming calls each day are billed at a penny a minute. The alternative is to purchase dedicated Anveo Direct trunks which provide unlimited inbound calling (one call at a time) for a monthly charge of $17 per trunk (worldwide), $11.25 per trunk (U.S. and Canada), or $6.50 per trunk (most of Europe). Monthly DID prices then are roughly 50% less.

Another nice surprise is that most of the DIDs include SMS messaging support. Incoming SMS messages are billed at a penny per message. Outbound SMS messages are routed through Europe and are billed at 4.4¢ per message. Unlike most providers, Anveo gives you the flexibility to configure your carriers and routes in almost any way you like. And there’s no proxy media so voice calls are passed directly from the carrier to your SIP endpoint. Anveo actually began as a wholesale provider of Voxbone services. With Anveo Direct, virtually all of the functions offered to commercial providers are now available to everybody. Along with fully redundant architecture and automatic SIP failover, Anveo offers you a choice of POPs in New York and Los Angeles as well as in Germany, Belgium, and China.

I know. I hear some of you saying, "Why would I want to pay good money for a DID when U.S. and Canadian calls plus the DIDs that Google Voice currently provides are all free?" Setting aside the ups and downs of Google Voice with Asterisk® over the years, it’s worth remembering that good things don’t last forever, and the word on the street is that Google’s generosity ship may be about to sail. In fact, it already has with worldwide iNum calls which Google originally handled for free. Now they’re 3¢ a minute even when calling across the street. Also keep in mind that, with VoIP, it costs you almost nothing to have a number of backup providers in place for that rainy day.

If you’ve used IPkall that provides free DIDs in the Seattle area with call routing to any SIP URI, then you will be generally familiar with the setup process for Anveo DIDs. There is no registration facility with Anveo Direct. Incoming calls to your DID are routed to SIP URIs of your choice. Outbound calls are sent to a SIP URI with a 6-character alphanumeric passcode of your choice. If this is all Greek to you, keep reading or stick with Vitelity. :wink:

Configuring a Destination SIP Trunk for Use with Anveo Direct

Before you can successfully configure a DID at Anveo Direct, you’ll first need to set up a SIP URI on your PIAF™ server. There are four initial steps: (1) enabling SIP URI access in your IPtables firewall, (2) mapping UDP 5060 to the IP address of your Asterisk server in your hardware-based firewall, (3) creating a SIP trunk for Anveo in FreePBX®, and (4) creating a custom context for incoming SIP URI calls from Anveo Direct.

Step #1: Just a couple of words of warning before we begin. You’ll need to open port 5060 on your hardware-based firewall and point it to your Asterisk server to use a SIP URI. Before you do that, make certain that you’ve installed Travelin’ Man 3 for PBX in a Flash which blocks inbound SIP connections except from trusted providers. Once Travelin’ Man 3 is installed, you’ll need to add Anveo Direct to your list of trusted providers for SIP connections (UDP 5060) with this command:

/root/add-ip anveo1 50.22.101.14
/root/add-ip anveo2 67.212.84.21
/root/add-ip anveo3 176.9.39.206
/root/add-ip anveo4 72.9.149.25
/root/add-ip anveo5 50.22.102.242
/root/add-ip anveo6 204.216.109.55

If you’re generally familiar with IPtables, you can add the following block of code directly:

-A INPUT -s 50.22.101.14/32 -p udp -m udp --dport 5060:5069 -j ACCEPT
-A INPUT -s 67.212.84.21/32 -p udp -m udp --dport 5060:5069 -j ACCEPT
-A INPUT -s 176.9.39.206/32 -p udp -m udp --dport 5060:5069 -j ACCEPT
-A INPUT -s 72.9.149.25/32 -p udp -m udp --dport 5060:5069 -j ACCEPT
-A INPUT -s 50.22.102.242/32 -p udp -m udp --dport 5060:5069 -j ACCEPT
-A INPUT -s 204.216.109.55/32 -p udp -m udp --dport 5060:5069 -j ACCEPT

Once you’ve completed this step, restart IPtables: service iptables restart. Then run: iptables -nL. Make certain that all of the above IP addresses are in the trusted providers list. Do NOT proceed until you’re sure your server is protected! It’s your phone bill.

Step #2: Now access your hardware-based firewall and map incoming UDP port 5060 traffic to the IP address of your PBX in a Flash server. The exact steps vary slightly depending upon the type of router you have. Look for a tab that deals with redirecting Internet traffic through your router to destination IP addresses.

Step #3: Using a web browser, open the FreePBX Administration GUI by pointing to the IP address of your server. In FreePBX 2.10 and 2.11, choose Connectivity -> Trunks -> Add SIP Trunk. Create an entry that looks like the following removing any other entries in the User Details section of the form. Then save your settings and update the dialplan. If you don’t have success with our settings, try the ones recommended by @w1ve.

Repeat this process by creating five additional SIP trunks named anveo-2, anveo-3, anveo-4, anveo-5, and anveo-6 using the other four IP addresses that Anveo uses to route SIP calls: 67.212.84.21, 176.9.39.206, 72.9.149.25, 50.22.102.242, and 204.216.109.55.

NOTE: If using a PJsip trunk, add these IP addresses in the trunk’s Match= field.

Step #4: Log into your server as root with SSH, and edit /etc/asterisk/extensions_custom.conf. Add the following code to the bottom of the file and save your changes. Then restart Asterisk: amportal restart.

[from-anveo]
exten => _.,1,Ringing
exten => _.,n,Goto(from-trunk,${SIP_HEADER(X-anveo-e164)},1)

Just a word of explanation about why we’re using a custom trunk context for Anveo rather than using the standard from-trunk entry. Because of its environment, Anveo doesn’t pass the DID of the trunk in the traditional way.1 Instead, it passes the DID in a customized SIP header as shown above. If you used from-trunk as the destination for the incoming calls, then FreePBX would process the call using the Default Inbound Route which most sane people map to Hangup or Congestion. By using the custom context above, we can grab the actual DID and use it for FreePBX routing purposes. For Anveo purposes, the actual SIP URI we’ll be using is serverDID@serverIPaddress where the 1904… number in the example is your actual DID which we’ll obtain in the next section. If you have a fully-qualified domain name for your server, you can use that after the @ symbol instead of your server’s public IP address.

Configuring a DID in Anveo Direct

Now that we have almost everything in place on your server, we’re ready to begin today’s adventure with Anveo. For openers, you’ll need to register for an account at Anveo Direct. It’s a simple process. Just click on the Get Started icon on the website and follow your nose. Once you’ve registered and confirmed your email address, login to your account and you’ll find a 60¢ credit for experimentation. Since you can purchase a DID for 50¢ and because it’s prorated to the 15th of this month, you’ll have plenty of money to test out the service without spending a dime.

There are three steps to complete on the Anveo site: (1) purchase a DID, (2) create a SIP URI which will be used to route the calls from a specific DID to your server, and (3) configure the DID to route calls using the SIP URI created in the previous step.

Step #1: If you haven’t already done so, log into your Anveo Direct account. Then purchase a DID in your favorite town. From the Inbound Service pulldown, choose Order Anveo Direct DID. Just fill in the blanks after choosing your desired DID.

Step #2: Choose Inbound Service -> Configure Destination SIP Trunks -> Add a New SIP Trunk. Fill in the blanks as shown below using the DID you created in step #1. Be sure to use the complete DID number. Either an IP address or FQDN is fine after the @ symbol. Then click SAVE.

If you read the "hint" in the form, you will note that you can replace the actual DID number (1904… in our example) with $[E164]$ to make the SIP URI generic. Then you don’t have to create separate SIP URI entries for every DID you purchase. We’re pleased to report that it works as advertised, and we’re using it in our sample trunk so you can try it for yourself.

NOTE: For those using some Incredible PBX builds in which PJsip is assigned port 5060 and chan_sip is assigned port 5061, you should make an adjustment in your incoming dial string: $[E164]$@serverIPaddress:5061.

Step 3: From the Inbound Service pulldown, choose Configure Anveo DIDs. Click on the EDIT tab beside the DID you wish to configure. You’ll get a form that looks like the following:

Choose the Call Options tab and select the SIP URI that you configured in Step #2. Click SAVE.

Choose the Geo. Pop tab and select the POP server closest to you. Click SAVE.

Choose the Codecs tab and select the codecs you wish to enable. We recommend using only G.711u until you’re sure everything is working correctly. Click SAVE.

Completing the FreePBX Setup for Anveo Direct

We’re almost finished. The last step is to create an Inbound Route in FreePBX for the DID you just purchased from Anveo Direct. So jump back over to FreePBX in your browser. Choose Connectivity -> Inbound Routes -> Add Incoming Route. Fill out the form using the complete DID Number, e.g. 1904… Choose a Destination for Incoming Calls that works on your server. It could be an extension, a ring group, an IVR, or any other resource that’s available. In our example, we’ve chosen the Weather Underground application from Incredible PBX. Save your settings and update the dialplan.

Now you’re ready to place your first call, or you can call the number shown above to try out our demo system using Anveo. Ignore the + symbol when dialing calls. It’s not necessary.

Making Outbound Calls with Anveo Direct

If you also want to use Anveo to place outbound calls, all of the rates are per minute. The rate tables can be downloaded from here. Before you can place outbound calls, you’ll need to create a Call Termination Trunk under Outbound Service. In the form, you set up a 6-character code for access to the SIP URI and also specify the IP addresses from which calls can be placed. A sample is shown below. You obviously need to create a VERY secure access code. The code must begin with a zero and may contain any number as well as A-Z and a-z for each character. Once you’re finished, SAVE your settings. This is the area where Anveo’s Least Cost Routing methodology really shines. If you’re cheap (like us), use the settings shown. If you prefer higher quality trunks, change the Carriers to All Carriers. It gets more complicated if you want it to, but these settings will get you started with incredible rates.

The final step is to define a Custom Trunk (AnveoOut) and Outbound Route (AnveoSIP) in FreePBX to send outbound calls to Anveo. Typically, you would specify a dialing prefix (555 in the example) to force certain calls to use the Anveo Direct route. Here’s a sample Custom SIP Trunk to handle the calls. The custom dial string should look like this using your own 6-character code, of course: SIP/012345$OUTNUM$@sbc.anveo.com.

Once you’ve saved your settings, create an Outbound Route for the calls that looks something like what’s shown below. Be sure to add the CallerID number you wish to use for the outbound calls and make the 555 prefix match what you used when you created the Custom Trunk in the last step. When you Save your setup, be sure to move the Outbound Route up the priority list on the right so that these calls get evaluated before your other calling routes.

Receiving SMS Messages with Anveo Direct

To receive SMS messages from Anveo, there’s an SMS tab in the DID configuration menu for each of your DIDs. You must have a web server with PHP 4 or 5 to manage the incoming messages. It’s important to use a file name for the web link that is difficult for people to guess. Otherwise, anybody can bombard you with SMS messages if they happen to guess the web link. Here’s a sample to get you started. In the Anveo SMS tab for your DID, you’d insert something like the following and check the Forward to URL box:

http://myserver.org/smsmessenger.php?from=$[from]$&to=$[to]$&message=$[message]$

On your web server using whatever filename you chose for the smsmessenger.php file, insert the following code replacing the $deliverto contents with your actual email address:


<?php
$deliverto = "youremailname@gmail.com";
$from = $_REQUEST['from'];
$to = $_REQUEST['to'];
$message = $_REQUEST['message'];
$subject="SMS Message from $from to $to";
$comment="SMS Message\n\n FROM: $from\n\nTO: $to\n\nMSG: $message\n\n";
mail("$deliverto", "$subject", "$comment", "$from");
?>

Once this is in place, people can simply send an SMS message to your 11-digit DID, and it will be delivered to the email address you inserted for $deliverto. Incoming SMS messages are a penny apiece.

Sending SMS Messages with Anveo Direct

Sending SMS messages through Anveo Direct is similar to the key procedure used for placing outbound calls. Before you can send SMS messages, however, you’ll need to activate an API account which is free. This gets you an API key. Once you have a key, SMS messages are sent using API requests to https://www.anveo.com/api/v2.asp. Sample PHP scripts to handle the details are available on the Anveo Direct web site. The procedure works well, but the messaging rates are not cheap at 4.4¢ per message. In addition, there appears to be a glitch in the "sent from" feature of the API which results in outbound SMS messages always appearing to come from an international number in the United Kingdom. But, again, the functionality is there, if you need it. For the time being, the SMS messaging functionality built into Incredible PBX is free and much easier to use. See the SMS Dictator article on Nerd Vittles for details. Enjoy!

Originally published: Monday, May 6, 2013



Need help with Asterisk? Visit the PBX in a Flash Forum.
Or Try the New, Free PBX in a Flash Conference Bridge.


whos.amung.us If you’re wondering what your fellow man is reading on Nerd Vittles these days, wonder no more. Visit our new whos.amung.us statistical web site and check out what’s happening. It’s a terrific resource both for us and for you.


 

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…