Home » Technology » Telephony (Page 68)

Category Archives: Telephony

The Most Versatile VoIP Provider: FREE PORTING

Introducing ISN: Free SIP Dialing From Any Asterisk Phone

Wouldn't it be nice to pick up any telephone on your Asterisk® system and place free SIP calls to anywhere in the world by dialing joe@sip.asterisk.com or any SIP URI? The problem, of course, is that most phones don't include alphanumeric keyboards much less the @ symbol. Well, not to worry. A group of Asterisk gurus headed up by John Todd came up with a clever plan using DNS that lets you dial any SIP URI using the 10 numeric keys plus the asterisk key on any standard telephone keypad. Today, we'll show you how to set up your Asterisk system to support ISN's (aka ITAD Subscriber Numbers).

Overview. In laymen's terms, 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@sip.pbxinaflash.com. In short, 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. For our recommended setup, you'll actually dial ISN numbers like this: **1234*1061. The leading asterisks will tell FreePBX to treat this as an ISN dial string.1

Prerequisites. We're assuming that you already have one of the FreePBX-enhanced Asterisk aggregations in place such as PBX in a Flash. If not, start there and then run the Orgasmatron Installer which provides all of the SIP URI functionality you'll need for this project. If you're not using PBX in a Flash, then review our tutorial on SIP URI's which will walk you through getting this functionality set up on your FreePBX-enhanced Asterisk server.

Adjusting Your Phones to Support ISN Dialing. We'll be using a somewhat different dial plan to make ISN calls so you'll probably have to adjust the default dialplan on your actual phones or ATA to get this to work. If you can place ISN calls with a softphone but you get a fast busy when you dial the same number on your hardware-based phones, then it's a dialplan problem. For Aastra phones, you can access the Aastra dialplan settings with a web browser. Just go to the IP address of the phone and login with admin:22222. Click on the Preferences option and you should see Local Dial Plan at the top of the page with an entry that looks like this: x+#|xx+*. Just change it to: x+#|xx+*|'*'xx+* and click the Save Settings button. No reboot of the phone is required. Notice that we've enclosed the asterisk in single quotes in the third option. That's the trick to getting Aastra phones to recognize * as part of an actual dial string. If you're using other phones, consult your user's guide for tips on modifying your dialplan to accommodate an asterisk as the first character in the dial string.

Enabling Outbound ISN Dialing. There are a number of ways to get ISN outbound dialing to work with Asterisk. We're going to show you a couple of methods. You can either set up a trunk and outbound route to handle the calls, or you can add an extension to your system which actual prompts for the ISN number when you dial that extension. There are also two ways to look up ISN numbers at freenum.org. The preferred method is using DNS queries with the new Asterisk ENUMLOOKUP function. An alternative method (which is especially useful with older versions of Asterisk that do not support ENUMLOOKUP) is to use FreeNUM's external public resolver to map ISN dial strings to SIP URIs. With PBX in a Flash and Asterisk 1.4.21.2 or later, both methods work.

Implementing the Trunk Method for ISN Dialing. With this option, you'll be able to pick up any (properly configured) phone on your Asterisk system and dial **1234*1061 to complete a free ISN SIP call. To set this up, we'll add a new trunk and outbound route in FreePBX. Then we'll insert a dialplan script in extensions_custom.conf to finish up. Once you reload your Asterisk dialplan, you'll be good to go.

Open FreePBX in a web browser, and choose Admin, Setup, Trunks, Add Trunk, Add Custom Trunk. Leave the General Settings blank for now. In the Dial Rules, insert X.*X. (be sure to include trailing period!) and, for the Custom Dial String, insert: local/$OUTNUM$@freenum. Click the Submit button to save your settings and reload the dialplan when prompted. Now add an Outbound Route called OutFreeNUM. For the Dial Pattern, use **|X.*X. with the trailing period again. For the Outbound Route Dial Pattern, you can get more elaborate so that you don't have to dial the ** prefix. Just be aware that this may not work with all handsets (including the Aastra's). It does work well with Zoiper softphones. Here's the dial pattern we actually use. With this dial pattern, you can dial most ISN numbers directly with no prefix, e.g. 16781234567*1061 works fine.

**|X.*X.
1NXXNXXXXXX*X.
NXXNXXXXXX*X.
XX*X.
XXX*X.
XXXX*X.
XXXXX*X.
XXXXXX*X.
XXXXXXX*X.

For the Trunk Sequence, choose local/$OUTNUM$@freenum. Save your entries and reload the dialplan once more.

Finally, log into your server as root and edit extensions_custom.conf in /etc/asterisk. At the bottom of the file, insert the following code:

[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

Make sure you eliminate the line-wrap on line 3 above. Then save the file and reload your dialplan: asterisk -rx "dialplan reload". Now place a test call by dialing: **1234*1061. If the call doesn't connect to Nerd Vittles' demo site, check the Asterisk CLI and fix any reported errors.

Implementing the Extension Method for ISN Dialing. With this option, you'll be able to pick up any phone on your Asterisk system and dial FREE (3733) to place an ISN call. You'll be prompted to enter the number using the following format: 1234*1061. Note that there are no leading asterisks with this method. Instead of using ENUMLOOKUP to find the ISN number, we'll use FreeNUM's external public resolver to do the ISN translation into a SIP URI.

Log into your Asterisk server as root and edit extensions_custom.conf in /etc/asterisk. At the bottom of the file, insert the following context:

[custom-freenum]
exten => s,1,Answer
exten => s,2,Wait(2)
exten => s,3,Background(pls-entr-num-uwish2-call)
exten => s,4,Read(NUM2CALL,beep,30)
exten => s,5,GotoIf($["foo${NUM2CALL}" = "foo"]?10)
exten => s,6,Set(TIMEOUT(absolute)=10800)
exten => s,7,Background(pls-hold-while-try)
exten => s,8,Dial(SIP/${NUM2CALL}@public.freenum.org,30,m)
exten => s,9,Congestion
exten => s,10,Hangup
exten => h,1,Hangup
exten => i,1,Hangup
exten => T,1,Hangup

Now move to the top of the file and insert the following line in the [from-internal-custom] context:

exten => 3733,1,Goto(custom-freenum,s,1)

Save the changes you've made to the file and then edit (or create, if necessary) sip_custom.conf and insert the following line:

promiscredir=yes

Save the file and then restart Asterisk: amportal restart. Now place a test call by dialing 3733. When prompted for the ISN number, enter 1234*1061 and press # to avoid the timeout delay. Be aware that on non-FreePBX systems, this code would go in sip.conf; however, that file gets overwritten with any FreePBX reload. Hence the reason that we've placed the code in sip_custom.conf.

Creating a SIP URI for Your Asterisk Server. Before you can receive any inbound calls with ISN dialing, you'll need at least one SIP URI for your Asterisk server. The format of a SIP URI is much like an email address: somename@yourdomain.dyndns.org or somenumber@yourdomain.dyndns.org. Step 1 is to register a fully-qualified domain name (FQDN) for your Asterisk server. Step 2 is to actually set up the SIP URI's on your server.

If you already have a registered domain, then we recommend you create a sip subdomain: sip.yourname.org. Then point that subdomain to the IP address of your Asterisk server. If your Asterisk server has a dynamic IP address, then register a subdomain with a service such as dyndns.org and point that domain at your Asterisk server. We've previously covered how to install software on your Asterisk server to make sure your FQDN always resolves to the correct dynamic IP address. Here's the link for DNS-O-Matic.

Once you have FQDN covered, you're ready to set up a SIP URI. With Orgasmastron builds of PBX in a Flash, the work already has been done for you. You should already have a SIP URI of mothership@yourFQDN. For everyone else, the drill involves moving a copy of the [from-sip-external] context into extensions_override_freepbx.conf in /etc/asterisk so that it can be edited without risking an overwrite from FreePBX. To find out the location of the [from-sip-external] context, issue the following commands while logged into your server as root:

cd /etc/asterisk
grep from-sip-external *

The result will look something like this:

extensions.conf:[from-sip-external]
extensions_override_freepbx.conf:[from-sip-external]
sip_general_additional.conf:context=from-sip-external

If the middle line is there, the context already has been copied over. Otherwise, list out the file showing [from-sip-external] which varies depending upon your version of FreePBX: cat extensions.conf. Now cut-and-paste the entire [from-sip-external] context into extensions_override_freepbx.conf. Then edit the override file and add an entry for each SIP URI you wish to create. The entries should be inserted just below the exten => s,1... line. Here are some samples:

exten => 16781234567,1,Goto(from-trunk,${DID},1)

This entry would let you control the routing of 16781234567 by creating a new incoming route in FreePBX with a DID entry of 16781234567. Then you can point the SIP URI to any FreePBX resource, e.g. an extension, ring group, IVR.

exten => e164,1,Goto(from-trunk,e164,1)

This entry would route e164@yourFQDN to the Inbound Route created for a DID number entry of e164.

exten => 18431234567,1,Goto(custom-windyhouse,s,1)

This entry would route incoming calls to 18431234567@yourFQDN to s,1 in a custom context called [custom-windyhouse] in extensions_custom.conf.

exten => 17065439876,1,Dial(SIP/17066313456@sip.otherdomain.com)


This entry would route incoming calls to 17065439876@yourFQDN to another SIP URI.

exten => 12021234567,1,Dial(local/12029876543@from-internal)

This entry would route incoming calls to 12021234567@yourFQDN to a cellphone at 12029876543 using your Asterisk dialplan to choose an appropriate trunk for the call.

exten => 18883331212,1,Dial(SIP/skype_joe@proxy01.sipphone.com)

This entry would route incoming calls to 18883331212@yourFQDN to a Skype user named joe using the free Gizmo5 gateway.

Once you've made all desired SIP URI entries, save the override file and reload your Asterisk dialplan.

Using the PBX in a Flash ITAD Number. So you're probably asking, "What's in this for me?" Well, a couple of things actually. First, if you're a PBX in a Flash user, we want you to join our free calling network. We already have reserved the 1061 ITAD number for our group. Just cut-and-paste the form below, fill in the blanks, and email it to us. We'll set up an ISN number for your server (one per customer, please) so that others can contact you without spending a dime. The other option is to obtain your own ITAD number for your organization and set it up on your own server. We'll get to that in a minute.

If you want to join our club (and we really don't mind if you're not using PBX in a Flash), then cut-and-paste the form below into your email and fill it out. And here's the email link. Once we receive your request, we'll set up an ISN number for you that matches your existing phone number. So, if your phone number is 16781234567, your new ISN number will be 16781234567*1061. Please include your international codes with your phone number. Before we activate your ISN number, we'll place a test call to your SIP URI to verify it's working. Please be sure it is before applying. 🙂

Name:
Mailing Address:
Phone Number:
SIP URI for Your Server: _____________@_____________________________
ISN Number (leave blank):
Publish Entry in Directory? Yes or No (choose one)

Obtaining Your Own ITAD Number. We know there are lots of you that prefer to do things yourself. And that's perfectly fine. We're going to quickly show you how. But, if you want to be included in the PBX in a Flash directory, please send us the form above with your own ISN contact number once you get things working.

To get your own ITAD number, visit this link and follow the instructions for requesting your own number. It's easy, but detail matters so do it right the first time! Within a few days, you'll get your shiny new number. And, in a few more days, freenum.org will notify you that your account has been established.

Setting Up An ISN Account at FreeNum.org. Once you receive your login credentials from FreeNUM, log in to your account. Leave the DNS Wildcard setting the way it is. All you have to do is insert your fully-qualified domain name in the FQDN placeholder. For example, if your FQDN were sip.big.edu, then the last part of the DNS entry should look like this:

sip:\\1@sip.big.edu!" .

Save your entry and wait an hour. Then test it by dialing your new ISN number or, after logging into your server as root, use a command like the following. Turn your SIP URI around from 6781234567*1061 so that it looks like this:

dig @freenum.org NAPTR 7.6.5.4.3.2.1.8.7.6.1061.freenum.org.



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


Aretta Introduces Free NetPBX. In an industry first, Aretta Communications is rolling out a free Asterisk hosted solution known as NetPBX Free Edition. The only cost is for the minutes you use, and the free hosted service will support one inbound or outbound call at a time. Everything including the SIP trunking is preconfigured so the system is literally plug-and-play. We'll provide a more in-depth review once we've had some time to play.


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...

  1. The dial string has been modified a bit to mesh with special dial codes in FreePBX. See the comments for details. []

Some Summertime Distractions for Asterisk Lovers


In addition to Spoleto and the Bridge Run, Charleston has many great traditions, one of which is a prompt transition from a rainy, cold winter into sweltering summer. We got a very long spring break this year, but now we’re paying for it. After spending a couple weeks on Balsam Mountain, it was nothing short of culture shock driving back into Charleston last night. But we’re glad to be home. And this week, we celebrate summer with a list of some of our favorite vacation discoveries that didn’t involve snakes and bears. Some are related to Asterisk®, and some aren’t. So here goes.

Streaming Video with Roku. If you haven’t figured out why Time Warner and Comcast have been pushing for Internet bandwidth caps, here’s a hint. Streaming video not only is killing their pipes, but more importantly (to them) it’s killing their pay-per-view and HBO/Showtime monopolies. If you enjoy (or can even remember) great television and movies without thousands of commercials, then we’ve got two discoveries that will make your summer! The first one is Roku, a little $100 device about the size and weight of a couple packs of cigarettes. You plug it into your TV and the Internet, pop the popcorn, and you’re ready for some fun. With an $8.95 Netflix subscription (which buys you one-at-a-time DVD rentals by mail), you also get unlimited movies streamed to your Roku device. It’s not their entire catalog, but it’s a substantial subset including most of the Starz catalog. The Roku player supports composite, S-video, component, and HDMI video connections as well as stereo and optical audio. A new addition allows the rental or purchase of first-run movies from Amazon (at Blockbuster prices). More offerings are promised for later this summer. Can Hulu be far behind? If you’ve been holding off purchasing a Blu-Ray player, then here’s another option. LG’s new $200 BD370 Blu-Ray Disc Player incorporates this same technology in addition to YouTube access. We haven’t used the BD370 yet, but we sure do want one.

Cellphones for Preteens. We laughed at our friends from Naples, Florida last summer when they were lamenting the fact that every child in their daughter’s second grade class had a cellphone except for theirs. They swore that they wouldn’t give in. That lasted until Christmas when the shiny new LG Xenon appeared. Chuckling all the way to spring, we recently met the same fate with the Samsung A767 Propel after our 9-year-old raised over $300 selling all of her old toys at the neighborhood yard sale. Bottom line: All the kids are going to have them by the time they turn 10. And with the family plans available from a number of providers, the costs are no longer prohibitive for most of us. You might as well get them trained to use cellphones responsibly while they’re young. Trust me. It’s a lot more difficult once they hit high school or college and know everything. There is a difference between adult and kid usage of cellphones. They rarely make a call. But you’ll want an unlimited texting plan. And none of the kids want an iPhone. They much prefer one the newer phones that includes a full keyboard for texting. Apple, are you listening?

If you go down this road with the rest of us that swore we wouldn’t do it, demand two things: (1) that your kids not use cellphones while driving and (2) that they not hold cellphones up to their ears while making calls. The jury is still out on whether cellphone usage leads to brain tumors. But it seems pretty obvious when you review the research provided by organizations not funded by the cellphone industry. Remember the tobacco companies swore that cigarettes were safe for decades, and they paid good money for authoritative-sounding research to back them up. Read this. And watch this. Then decide whether you want to gamble with the lives of your children. Better safe than sorry.

Deals, Deals, and More Deals. If you always shop for technology purchases at the same few stores, then send us a check for all the money we’re about to save you. There’s a green eBates coupon in the right pane just below that will usually save you 1-5% on all your technology and clothing purchases and just about anything else. It costs nothing to use it, and you’ll get $5 just for signing up. So do we. 🙂 To go with those savings, there are some bargain web sites that you won’t want to miss. Our old favorite is TechBargains, but there’s also a new kid on the block, DealNews. Check ’em out. You’ll find something you just can’t live without… at bargain basement prices.

SMS Messaging with Asterisk. We’ve always lamented the fact that Asterisk had no built in SMS messaging capability. This is primarily because the cellphone providers keep a fairly tight lock on the SMS business since it’s their Cash Cow. There is a simple solution actually.

Virtually all of the cellphone providers have an Email-to-SMS gateway that can be used for sending SMS messages to their customers. For example, to send a message to a cellphone subscriber on the AT&T network, you just send an email message to 6781234567@txt.att.net. Click here for a complete list of the email gateway addresses.

That got us to thinking how simple it really would be to create a bash script that delivered the same message to every provider used by your friends. Who cares if all but one of the messages goes in the bit bucket. Your SMS message still will get delivered. For example, in the United States, if you’ve covered AT&T, Verizon, Alltel, Sprint, T-Mobile, US Cellular, Cricket, and Nextel, that pretty much gets 99% of the cellphones. If there’s a service that we’ve left out that you really need, just add another line to the bash script with the domain of that carrier.

So, log into your server as root and create a bash script named sms.sh that looks like the following: nano -w sms.sh

#!/bin/bash

# Script for sending SMS messages
# For additional cell carriers, see:
# http://en.wikipedia.org/wiki/List_of_carriers_providing_Email_or_Web_to_SMS

msg="Just testing the new SMS batch script."
subj="SMS Message"
num2call="8431234567″

echo "$msg" | mail -s "$subj" $num2call@message.alltel.com
echo "$msg" | mail -s "$subj" $num2call@txt.att.net
echo "$msg" | mail -s "$subj" $num2call@sms.mycricket.com
echo "$msg" | mail -s "$subj" $num2call@messaging.nextel.com
echo "$msg" | mail -s "$subj" $num2call@messaging.sprintpcs.com
echo "$msg" | mail -s "$subj" $num2call@tmomail.net
echo "$msg" | mail -s "$subj" $num2call@email.uscc.net
echo "$msg" | mail -s "$subj" $num2call@vtext.com

Fill in the msg, subj, and num2call fields. Press Ctl-X, Y, then Enter to save your file. Then make it executable: chmod +x sms.sh. Now give it a try: ./sms.sh

You can alter the sender address for your emails from the default of root by inserting an entry like the following in /etc/mail/genericstable: root    joeschmo@gmail.com. Then restart SendMail: service sendmail restart.

Micro$oft Bing. I have to admit that I’ve always had a soft spot for Microsoft. They came from humble beginnings and outsmarted almost everybody during the 80’s and 90’s… until Google entered the picture and did much the same thing to them. You’ve also got to hand it to Microsoft. They may not get it right the first, or second, or third time. But they don’t give up. And their reincarnated search engine, Bing, is worth a look. It includes an Explorer Pane that categorizes search results in a left panel that is customized to your search query. There’s also a Quick Preview providing website popups. The theory is to give you a sneak peak at a particular site to see if it’s what you’re looking for. As with many Microsoft creations, it’s just too slow at the moment to be of much value. Good idea. Not so good implementation.

A good bit already has been written about Bing’s picture and video search capabilities. Suffice it to say, once they tamed the content, it’s worth a look. Actually, it was worth a look even before they tamed the content. 🙂 But give Microsoft credit, they quickly recognized that there needs to be a way to make the web accessible to younger children and students without exposing them to an endless stream of pornography. What happened to the good old days of reading National Geographic to find all that stuff?

Microsoft’s Farecast technology also is interesting. It brings new, smart tools to the process of purchasing airline and hotel accommodations. Much of this toolkit was acquired by Microsoft, but it’s pretty slick. The downside of Bing, when compared to Google, is that there seems to be a tilt toward Microsoft content in results. And there still is a lot of drill-down (aka Windows) to find exactly what you’re looking for. Both are deeply rooted in the Microsoft psyche so I doubt it’ll ever go away. But have a look anyway. It’s an interesting, new product to at least have in your search toolkit.

Let There Be Music. All-you-can-eat streaming music plans have been around for a while. But there’s never been anything quite like the new Napster service from Best Buy. $5 a month for access to 7 million songs on either your PC or a Sonos sound system is just too good to pass up. We’ve previously written about this so we won’t repeat it all here. Have a look at the article if you’re a music addict. And, if streaming DRM’d music isn’t your thing, check out this PC Mag article on Virgin Media’s new offering. It will let you download an unlimited number of MP3’s from Universal’s entire music catalog for about $20 a month. Unbelievable!

People Tracking. If you glance over to the right margin, you’ll get a good sample of Google’s Latitude offering that pinpoints your location on a Google map using GPS data from your cellphone. AT&T offers something similar for "only" $10-$15 a month. This data can be either the location of the nearest cellphone tower or, if your phone is GPS-enabled, it can be the actual GPS coordinates of your phone. There are obviously privacy issues that need to be weighed, and Google has carefully addressed most of those issues. You can restrict access to select friends, or just family, or no one at all. In coming months, we’re going to build something similar with Google Maps to display a map with the default location of incoming calls on certain color SIP phones. Stay tuned. In the meantime, feel free to monitor our summer vacation as we move from Charleston, to the beach, and back to the mountains. Not too exciting, but it may give you some ideas for future uses of this technology. For those of you with young daughters, think of it as LoJack for Parents!

Footnote: Uh, oh. Google.everything just died. 8:30 a.m., June 16. Bad way to start your day. Good time to check out Bing. 🙂

Hurricane Tracking. If hurricanes are a part of your everyday life and you haven’t visited Stormpulse.com yet, you’re missing the ultimate storm tracking site on the net. Not only do they provide up-to-the-minute predictions from all of the world’s best sources, but you also get map overlays showing virtually anything you’d ever want to know that’s weather-related. Unbelievably good! And, for a ringside seat, visit our own Pawleys Island WebCam. We’ll wave to you later this week.

Promising New Asterisk Appliance. Every now and then we read an article about a new Asterisk appliance that really shows some promise. So it is with Michael Graves’ recent writeup of Jazinga, a $1095 Asterisk appliance that does just about anything and everything a small business would ever need in a phone system using a simple but intuitive web interface. Have a look. We think you’ll agree. Very slick, indeed. Only wish it were $595 instead of $1095.

Some Great Blogs. And, speaking of blogs, there are some other telephony blogs in addition to Graves on SOHO VoIP that are worth a look from time to time. Here’s another Baker’s Dozen of our favorites in no particular order:

FreeNum Dialing System. Another new project worth a careful look is FreeNum. Taking a page from Nextel, FreeNum lets you make SIP calls from ordinary telephones after registering your organization. The format of a FreeNum dial string looks like 1234*567 where your extension is 1234 and your ITAD (Internet Telephony Administrative Domain) number is 567. FreeNUM relies upon DNS and, as such, is perfectly suited for transparent use over the Internet. In coming weeks, we’ll have more to say about FreeNUM including a methodology for letting all PBX in a Flash systems register with a shared ITAD for transparent communications worldwide. Here’s the article.

Twitter. The entire planet is aflutter with Twitter. We finally bit the bullet, and we’d be the first to admit that Twitter fills an important gap in today’s Internet-centric 21st century world. Not only does it provide instantaneous searches of very current content, it’s also quite useful as a micro-blogging tool if you like to keep current on technology happenings without always waiting for full-blown articles to appear. Many of the topics in this article were first introduced to Twitter users over the last few weeks. So there’s much more to Twitter than periodic reports of individuals’ bathroom and sleeping habits. You can get a sampling by reviewing our Twitter entries in the right pane of this blog. And there are literally hundreds of Twitter clients to meet your every need. Here’s a link to a great Twitter FAQ. Then give Twitter a try if you haven’t already. NerdUno is looking forward to hearing from you.

Wordle.net. We’ve mentioned Wordle before, but no article on Internet fun would be complete without at least a passing reference. The way Wordle works is that you pass it some text. It then rearranges the words in a hierarchical order that exposes the word usage count of the various words in the text it examined. You can see an example below which took the subject matter from the PBX in a Flash Help Forum and passed it through Wordle. You’ll note that "Resolved" is just about the same size as "problem" and "question." That actually speaks volumes about the quality of our forum. Give it a try. We think you’ll agree. We’ve done some other samples to give you some ideas: the Gettysburg Address, the Declaration of Independence, and MLK’s I Have A Dream speech. Try a few of your own. It’s a summertime blast. Enjoy!



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…

Asterisk TTS: Introducing Today in History

If you're a history buff and want a convenient way to find out everything that ever happened Today in History, then this week's text to speech (TTS) application for Asterisk® should be just what you need. Pick up any phone connected to your Asterisk system and dial T-O-D-A-Y (86329 for the spelling-impaired). The script will retrieve today's historical events and today's birthdays of interest from Yahoo News and play the results back to you over the phone using either Flite or Cepstral to handle the TTS translation. To speed up the retrieval process, you can also set this up as a cron job to download the latest events each day while you're sleeping. Thereafter, when you dial T-O-D-A-Y, the results are played back for callers instantaneously.

Prerequisites. If you're using PBX in a Flash, then all of the tools you'll need are already in place. And we have a script for you that will install the application in just a few seconds. For other users, you'll need an Asterisk server with PHP5 and either Flite or Cepstral to handle the text-to-speech chores.

Overview. If you've previously installed other Nerd Vittles text to speech applications, then the drill this time around is quite similar. There's a PHP/AGI script which gets stored in /var/lib/asterisk/agi-bin. In this script (nv-today.php), you can change the default Flite TTS engine to Cepstral by changing the $ttspick variable setting from 0 to 1. Then there is a snippet of dialplan code that needs to be added to the [from-internal-custom] context in extensions_custom.conf for FreePBX installations. Once you reload your Asterisk dialplan, you're ready to go.

How It Works. The PHP/AGI script only does real work once a day. It always checks to see if there is an existing /tmp/today.txt file with today's file stamp. If there is, it exits gracefully. If today's file doesn't exist or if the file's time stamp is earlier than midnight, then the script downloads the latest information for today in history and creates a text file of the data. Then either the Flite or Cepstral TTS engine is called to convert the text file into /tmp/today.wav. The dial plan code is used to answer calls to extension 86329. Then it runs the PHP/AGI script, and finally it plays back /tmp/today.wav. Note: The PHP/AGI script, if run as a cron job or from the command prompt, should never be run as the root user, but only as the asterisk user. Otherwise, the today.txt and today.wav files cannot be replaced by the script when it subsequently is run from the dialplan.

Script Installation. If you're using PBX in a Flash, log into your server as root and issue the following commands:

cd /root
wget http://bestof.nerdvittles.com/applications/today/today.pbx
chmod +x today.pbx
./today.pbx

Automatic Updates Using crontab. If you'd like to automatically generate the Today in History files each day, add the following entry to the bottom of /etc/crontab:

01 0 * * * asterisk /var/lib/asterisk/agi-bin/nv-today.php

Manual Installation. For those using a different Asterisk aggregation that includes PHP5, FreePBX, and Flite, add this code to /etc/asterisk/extensions_custom.conf in the [from-internal-custom] context:

exten => 86329,1,Answer
exten => 86329,2,Wait(1)
exten => 86329,3,Set(TIMEOUT(digit)=7)
exten => 86329,4,Set(TIMEOUT(response)=10)
exten => 86329,5,Flite(Please stand bye while we retrieve: Today in History.)
exten => 86329,6,AGI(nv-today.php)
exten => 86329,7,Playback(/tmp/today)
exten => 86329,8,Wait(1)
exten => 86329,9,Hangup

Then issue the following commands from the command prompt after logging in as root:

cd /root
mkdir today
cd today
wget http://bestof.nerdvittles.com/applications/today/today.zip
unzip today.zip
rm -f today.zip
cp nv-today.php /var/lib/asterisk/agi-bin/nv-today.php
chmod 775 /var/lib/asterisk/agi-bin/nv-today.php
chown asterisk:asterisk /var/lib/asterisk/agi-bin/nv-today.php
asterisk -rx "dialplan reload"

Running the Application. Now you're ready for a test run. Pick up any phone connected to your Asterisk system and dial T-O-D-A-Y. After a brief pause to download the data, today's events in history and today's birthdays will be played back over your phone using your favorite text to speech voice. To eliminate the pause the first time the application is run each day, simply add the crontab entry as outlined above. Enjoy!


Free DIDs While They Last. Sipgate is giving away a free U.S. DID with free incoming calls plus 200 free minutes for outbound calls. Better hurry. Here's the trunk setup for FreePBX-based systems:

Trunk name: sipgate

type=peer
username=ACCTNO
fromuser=ACCTNO
secret=ACCTPW
context=from-trunk
host=sipgate.com
fromdomain=sipgate.com
insecure=very
caninvite=no
canreinvite=no
nat=no
disallow=all
allow=ulaw&alaw

Registration Strong: ACCTNO:ACCTPW@sipgate.com/YOUR-DID-NUMBER

ACCTNO is the account number assigned to your sipgate account. ACCTPW is the password for your account. YOUR-DID-NUMBER is your 10-digit DID.

Finally create an inbound route using your actual 10-digit DID and assign a destination for the inbound calls.



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


Twitter Magic. If you haven't noticed the right margin of Nerd Vittles lately, we've added a new link to our Twitter feed. If you explore a little, you'll discover that the user interface now brings you instant access to every Twitter feed from the convenience of the Nerd Vittles desktop. Enjoy!


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...

VoIP Over VPN: Securely Interconnecting Asterisk Servers

We’ve just returned from a week in the Pacific Northwest teaching an Asterisk® course for an organization that wants to interconnect satellite offices using Asterisk servers. This coincided with a support request from one of America’s premier airlines which wants to do much the same thing for all of its reservation counters in airports situated in feeder cities around the country. Suffice it to say, PBX in a Flash in conjunction with Asterisk and Hamachi VPNs is perfectly suited to let anyone build these interconnected systems in minutes rather than months. In fact, with less than a day’s worth of introduction to Asterisk and PBX in a Flash, a group of 16 network administrators with no previous Asterisk experience did just that in a one-hour lab session during our training seminar last week. At the risk of (further) destroying our ability to earn a living, here’s how we did it.

Proxmox as a Training Tool. Before we get into the nitty gritty of actually interconnecting Asterisk servers with Hamachi VPNs, let us provide the free tip of the week for those of you that want to experiment with interconnecting Asterisk servers or for those that like to test various Asterisk scenarios without rebuilding servers all day long. There is no finer tool for this than the Proxmox Virtual Environment, a free and easy to use Open Source virtualization platform for running Virtual Appliances and Virtual Machines. With a sale-priced Dell T105 with a Quad Core AMD Opteron processor and 8 gigs of RAM, you’ll have a perfect platform to run about 16 simultaneous PBX in a Flash servers. The trick is finding the machines on sale for half price which is about every other week. Our lab system which matches this configuration was less than $600 with RAM purchased from a third party. You can save most of the shipping cost by using our coupon link in the right column to shop at Dell’s small business site.

Proxmox lets you build virtual machines in two ways: OpenVZ templates or Qemu/KVM Templates and ISO images. While we intend to offer an OpenVZ template for PBX in a Flash soon, currently it’s easy to create your own ISO template using the standard PBX in a Flash ISO image. Once you’ve uploaded your ISO image into Proxmox, simply create a new virtual machine by giving it a name, specifying 512MB of RAM and a 30GB partition. In 10 seconds or less, your new VM will be ready to boot. Start your VM and then open the VNC console window within the Proxmox web interface and install PBX in a Flash just as if you were building a stand-alone machine. When the 15-minute install completes, run through the Orgasmatron Installer setup, and you’ll have your turnkey PBX in a Flash system ready for production in less than 30 minutes.

You don’t have to repeat this drill for every virtual machine. Instead, use the built-in Proxmox backup utility to make a backup image of what you built. Shut down the VM, create a /backup directory, and then schedule the compressed backup in the web browser. When the backup completes, you’ll have a backup image in /backup with a file name like this: vzdump-101.tgz.

To create a new virtual machine, you issue the following command while positioned in the /backup directory specifying the number for the new virtual machine:

vzdump --restore vzdump-101.tgz 102

In about 3 minutes, you’ll have a second virtual machine that’s a clone of the first one. Because it’s a true clone, it would obviously have the same MAC address for the virtual NIC. You don’t want that or all of your VMs would boot up using the same IP address. Using the Proxmox web interface, just edit the new VM 102 by switching from the Status tab to the Hardware tab, delete the existing Ethernet device, and then create a new Ethernet device under the hardware address list pulldown. This will create a new virtual NIC with a new MAC address. So, when you boot VM 102, it will be assigned a new IP address by your DHCP server. You can decipher the new IP address by opening the VNC console window for VM 102 after you boot it up. Now you’re an expert. You can create the additional Baker’s Dozen turnkey PBX in a Flash servers in about an hour. Start all of them up, and you’ve got an instant training facility and PBX in a Flash playground.

April, 2012 Update. See our new article for a current state-of-the-art VoIP VPN.

Creating Hamachi VPN. You obviously don’t need a virtual private network in order to interconnect Asterisk servers. But, as easy as the Hamachi VPN is to set up, especially with PBX in a Flash servers, why wouldn’t you want all of your inter-Asterisk communications secured and encrypted? In addition to the capacity limitation of the Proxmox server, there’s another reason we chose to build 16 PBX in a Flash VMs. That happens to be the number of servers you can interconnect with the Hamachi Virtual Private Network without incurring a charge.1 Why use the Hamachi VPN when OpenVPN is free with unlimited network connections and no strings? The short answer is it’s incredibly simple to set up without public and private key hassles, and it supports dynamic IP server addressing with zero configuration. We plan to cover OpenVPN in a subsequent article but, for many implementations, Hamachi VPNs offer a robust, flexible alternative that can be deployed in minutes.

If you’re not using PBX in a Flash, there are a million good Hamachi VPN tutorials available through a quick Google search. If you are using PBX in a Flash, we’ve done the work for you. With the Orgasmatron Installer build, you’ll find the Hamachi VPN installation script in /root/nv. For other PBX in a Flash systems, just download the install-hamachi.x script from here or, after logging into your server as root, issue the following commands:

wget http://pbxinaflash.net/source/hamachi/install-hamachi.x
chmod +x install-hamachi.x
./install-hamachi.x

Before beginning the Hamachi VPN install, it’s a good idea to make yourself a cheat sheet for the servers you plan to interconnect. We’re going to interconnect 3 servers today, but doing 16 is just more of the same. You’ll need a unique name for your virtual private network. Pick a name that distinguishes this VPN from others you may build down the road. For our example, we’re going to use piaf-vpn. Next, you need a very secure password for your VPN. We’re going to use password for demonstration purposes only. Finally, you need a unique nickname for each of your servers, e.g. piaf-server1, piaf-server2, and piaf-server3 for our example setup today.

For the first Hamachi install, we’ll need to create the new network. For the remaining installs, we’ll simply join the existing network. Keep in mind that you can only remove machines from the network using the same server that was used to create the other VPN accounts initially so build out your virtual private network by starting with your main server, piaf-server1 in our example.

To begin the Hamachi VPN install, run the script using the commands shown above. Type Y to agree to the installer license and then press the Enter key to kick off the install. For the piaf-server1 install, type N to create a new Hamachi network. For the remaining installs, you’d type J to join an existing Hamachi network. Enter the network name you chose above. For our sample, we used piaf-vpn. Type it twice when prompted. Now type your network password and then your nickname for this server when prompted to do so. Then standby while the Hamachi software is installed. It takes a few minutes depending upon the speed of your network connection. And remember, do NOT use our sample network name. Make up your own and don’t forget it. When the install completes, you can review the log if you’d like. Unless something has come unglued, Hamachi should now be running on your first server. Repeat the drill on your other servers.

The next step is to grab some of our scripts to make it easier to manage Hamachi on your servers.

cd /usr/local/bin
wget http://pbxinaflash.net/source/hamachi/hampiaf
wget http://pbxinaflash.net/source/hamachi/hamachi-servers
chmod +x ham*
cd /root
wget http://pbxinaflash.net/source/hamachi/hamachi.faq

The hamachi.faq document provides all of the commands you’ll need to manage Hamachi including the steps to start over with a totally new virtual private network. For now, let’s be sure your network is running. Type: hamachi-servers piaf-vpn using the network name you assigned to your own VPN. Then type it again, and it should display all of the servers on your VPN with their private VPN IP addresses:

root@pbx:~ $ hamachi-servers piaf-vpn
This server:
Identity 5.151.123.1
Nickname piaf-server1
AutoLogin yes
OnlineNet piaf-vpn

Going online in piaf-vpn .. failed, already online
Retrieving peers’ nicknames ..
* [piaf-vpn]
5.151.123.2 piaf-server2
5.151.123.3 piaf-server3

Finally, a word of caution about security. One of the drawbacks of the ease with which you can create Hamachi VPNs is the ease with which you can create Hamachi VPNs. Anyone that knows your network name and password can join your network with one simple command. You can kick them off from the main server where the VPN was created (hampiaf evict piaf-vpn 5.249.146.66), but you can’t keep them from joining. So, protect your network by making the password extremely secure. There currently is no way to change your network password. All you can do is create a new network with a new network name and a more secure password.

Interconnecting Asterisk Servers. Once your VPN is established and all of your servers are on line, then we’re ready to interconnect them with Asterisk and FreePBX. There are a number of ways to do this. For smaller networks, we’re going to show you the easy and secure way using IAX and the VPN you just created. As with the VPN setup, a cheat sheet comes in handy to avoid erroneous entries that would cause your calls between servers to fail. What we recommend is assigning and creating a block of extensions on each of your servers with different ranges of numbers. For example, we’re going to use four-digit extensions in the 1xxx range for piaf-server1, 2xxx for piaf-server2, and 3xxx for piaf-server3. The idea here is that the extensions are unique between your servers. This makes it easy to dial between offices without having to resort to dialing prefixes. So the first step in interconnecting your servers is to build the necessary extensions on each of your servers.

Now for the cheat sheet. Using the hamachi-servers tool above, decipher the VPN IP address of each of your servers and make a chart with the server names, the range of extension numbers, and the VPN IP address of each server. You’ll also need to think up a very secure password. We’re going to use the same one for all of the servers although you certainly don’t need to. So long as the password you choose is secure, there’s really no reason not to use the same one.

piaf-server1 1xxx 5.151.123.1 password
piaf-server2 2xxx 5.151.123.2 password
piaf-server3 3xxx 5.151.123.3 password

Creating Trunks. The next step is to create an IAX trunk on each server for each remaining server in your network. In our example, on piaf-server1, we’d want to create trunks for piaf-server2 and piaf-server3. On piaf-server2, we’d want to create trunks for piaf-server1 and piaf-server3. And so on.

NOTE: Because of a change in IAX design to fix a security issue that arose after this article was originally published, be sure to add the following line in the User Details of each trunk below:

requirecalltoken=no


On your first server (piaf-server1 in our example), using a web browser, open FreePBX and choose Admin, Setup, Trunks and then click Add IAX2 Trunk. Create the trunk to piaf-server2 with the following entries. Leave everything blank except the entries shown below:

While still on piaf-server1, repeat the process to create a trunk for piaf-server3:

On your second server (piaf-server2 in our example), using a web browser, open FreePBX and choose Admin, Setup, Trunks and then click Add IAX2 Trunk. Create the trunk to piaf-server1 with the following entries. Leave everything blank except the entries shown below:

While still on piaf-server2, repeat the process to create a trunk for piaf-server3:

On your third server (piaf-server3 in our example), using a web browser, open FreePBX and choose Admin, Setup, Trunks and then click Add IAX2 Trunk. Create the trunk to piaf-server1 with the following entries. Leave everything blank except the entries shown below:

While still on piaf-server3, repeat the process to create a trunk for piaf-server2:

Creating Outbound Routes. Now we need to tell Asterisk how to route the calls between the servers. In a nutshell, we want calls to extensions in the 1xxx range routed to extensions on piaf-server1, calls to 2xxx extensions routed to piaf-server2, and calls to 3xxx extensions routed to piaf-server3. On each server, create an outbound route for each of the remaining servers. Name the routes server1, server2, and server3 as appropriate. The critical pieces of information in each outbound route are the dial string (which should match the extensions on the server we’re connecting to) and the Trunk Sequence (which should be the appropriate IAX trunk for the server we’re connecting to).

On piaf-server1, we’d have a server2 outbound route with a Dial String of 2xxx and a Trunk Sequence of IAX2/piaf-server2. Then we’d have another server3 route with a Dial String of 3xxx and a Trunk Sequence of IAX2/piaf-server3. If you have a catch-all outbound route, be sure to move these routes above the catch-all in the right column. Then reload your dialplan.

On piaf-server2, we’d have a server1 outbound route with a Dial String of 1xxx and a Trunk Sequence of IAX2/piaf-server1. Then we’d have another server3 route with a Dial String of 3xxx and a Trunk Sequence of IAX2/piaf-server3. If you have a catch-all outbound route, be sure to move these routes above the catch-all in the right column. Then reload your dialplan.

On piaf-server3, we’d have a server1 outbound route with a Dial String of 1xxx and a Trunk Sequence of IAX2/piaf-server1. Then we’d have another server2 route with a Dial String of 2xxx and a Trunk Sequence of IAX2/piaf-server2. If you have a catch-all outbound route, be sure to move these routes above the catch-all in the right column. Then reload your dialplan.

If you’re setting this up with PRI or T1 connections between your servers, you might also want to specify at least secondary trunk sequences for each of the outbound routes to provide some redundancy. For example, on piaf-server1, you might want a secondary Trunk Sequence for server2 that specified IAX2/piaf-server3. Then, if the primary connection between server1 and server2 was down, Asterisk would attempt to complete calls to 2xxx extensions by routing them to server3 and then on to server2 from there. To the caller and call recipient, they’d never know that the direct link between server1 and server2 had failed.

Alternate routing might also be appropriate where you have more capacity between certain servers. For example, if you had a single T1 line between server1 and server3 but you had PRI connections between server1 and server2 and between server2 and server3, then it might make more sense to indirectly route 3xxx calls from server1 through server2 and then on to server3 rather than the direct route from server1 to server3. Enjoy!


Free DIDs While They Last. Sipgate is giving away a free U.S. DID with free incoming calls plus 200 free minutes for outbound calls. Better hurry. Here’s the trunk setup for FreePBX-based systems:

Trunk name: sipgate

type=peer
username=ACCTNO
fromuser=ACCTNO
secret=ACCTPW
context=from-trunk
host=sipgate.com
fromdomain=sipgate.com
insecure=very
caninvite=no
canreinvite=no
nat=no
disallow=all
allow=ulaw&alaw

Registration Strong: ACCTNO:ACCTPW@sipgate.com/YOUR-DID-NUMBER

ACCTNO is the account number assigned to your sipgate account. ACCTPW is the password for your account. YOUR-DID-NUMBER is your 10-digit DID.

Finally create an inbound route using your actual 10-digit DID and assign a destination for the inbound calls.



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


Twitter Magic. If you haven’t noticed the right margin of Nerd Vittles lately, we’ve added a new link to our Twitter feed. If you explore a little, you’ll discover that the user interface now brings you instant access to every Twitter feed from the convenience of the Nerd Vittles desktop. Enjoy!


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…

  1. See comment #1 below. []

Asterisk on Steroids: The Orgasmatron Installer, Part IV

If you haven't installed our two dozen turnkey Asterisk® applications in under 5 minutes, it's not too late! We recently introduced our Orgasmatron Installer for PBX in a Flash. And today we wrap up the tutorials with Part IV in this series. Faxing and email work out of the box. More than a dozen extensions and a number of hosting provider trunks are preconfigured. Delivery of CallerID names with numbers is available from over a dozen providers of your choice. ODBC database connectivity is now painless. And the Flite text-to-speech engine is preconfigured with Cepstral TTS only a few keystrokes away. Also included are FreePBX 2.5, Apache, SendMail, MySQL, PHP, phpMyAdmin, IPtables Linux firewall, Fail2Ban, and WebMin. Here's the complete list of what 5 minutes of your time brings to this one-of-a-kind Asterisk server platform:

In Part II of this series, we walked you through securing your system and configuring a few of the major applications: AsteriDex, CallerID Superfecta, CallWho, Cepstral, and Emailing with SendMail. In Part III, we covered faxing with nvFax, FONmail, FreePBX backups, the Gizmo5 FreePBX module, setup of Hamachi VPNs, interconnecting Asterisk servers with IAX, setting up on-the-fly conferences, ODBC database implementation, and telephone reminders using a phone or web browser. Today, we'll cover the remaining applications in the Orgasmatron build: Hotel-Style Wakeup Calls, Mondo Full System Backups, Yahoo Newsclips, SIP URI support, TeleYapper, Tide Reports with xTide, Weather Reports by telephone, and how to use the Zaptel updater.

Hotel-Style Wakeup Calls. This application was specifically designed for FreePBX and does just what the name implies. From any phone connected to your PBX, dial *68 and follow the prompts using 4-digit numbers for the desired wake up call times. Then wait for your wakeup call. Doesn’t get much easier than that. There are a number of configuration options which can be set by logging into FreePBX and choosing Admin, Tools, Wakeup Calls. Operator mode lets you specify extensions which can set up wakeup calls for any extension. You also can define the ring time, number of retries, and the time to wait between retries. For the complete tutorial, see this Nerd Vittles article.

Mondo Full System Backups. One of the age-old limitations of Asterisk@Home and now trixbox was the inability to make a full disk backup of your PBX so that it could be restored after a catastrophic event, man-made or otherwise. Tom King solved all of that with his implementation of Mondo Rescue for PBX in a Flash systems. There are numerous options for storing the backups. We prefer using a USB flash drive and rotating between two of them. With falling prices of flash drives, you now can purchase 8GB and 16GB models for peanuts. To enable the backup system, insert a USB flash drive on your PBX. Log into your server as root and type dmesg. Scan through the contents of the display until you find the device name for your USB flash drive. The listing should look something like this:

usb-storage: waiting for device to settle before scanning
Vendor: Kingston Model: DataTraveler 2.0 Rev: PMAP
Type: Direct-Access ANSI SCSI revision: 00
SCSI device sdc: 15874048 512-byte hdwr sectors (8128 MB)
sdc: Write Protect is off
sdc: Mode Sense: 23 00 00 00
sdc: assuming drive cache: write through
SCSI device sdc: 15874048 512-byte hdwr sectors (8128 MB)
sdc: Write Protect is off
sdc: Mode Sense: 23 00 00 00
sdc: assuming drive cache: write through
sdc: sdc1
sd 8:0:0:0: Attached scsi removable disk sdc
sd 8:0:0:0: Attached scsi generic sg2 type 0
usb-storage: device scan complete

In the listing above, it would tell you that your device is named sdc1. In Mondo parlance, this device name would be /dev/sdc1. Your mileage may vary obviously depending upon the type server you are using. Don't guess! Otherwise, you may end up inadvertently formatting (aka erasing) your primary hard disk since this is the first step in the Mondo backup process.

Once you are positive that you have the correct device name for your flash drive, edit /etc/asterisk/disk-backup.conf. Change line 11 to the following: CONFIGURED="1". Then change line 50 to the device name for your flash drive: USBDEVICENAME="/dev/sdc1". Save your changes. Now run a test backup to be sure everything is working properly: /etc/cron.weekly/disk-backup.cron.

You can review the contents of your flash drive by making a script with the following commands. Be sure to make the script executable and use the actual device name for your flash drive:

#!/bin/bash
mount -t vfat /dev/sdc1 /mnt/usbmondo
df /mnt/usbmondo
echo " "
ls -all -h /mnt/usbmondo
umount /mnt/usbmondo

Be aware that Mondo backups may not properly restore on some of the new Atom-based netbooks. A patch has been released by the Mondo development team which we currently are testing. This newer version also supports creation of bootable flash drives as part of the backup process. Stay tuned.

Yahoo Newsclips for Asterisk. This was one of the first Nerd Vittles text-to-speech (TTS) applications for Asterisk, and it remains one of the most popular. To use it, dial 511 from any phone on your Asterisk system. The default setup gives a choice of numerous Yahoo news and sports feeds which will be read to you over the telephone. For detailed setup instructions, see the original Nerd Vittles article. The application, by default, uses the Flite text-to-speech engine. If you have purchased Cepstral, you can easily reconfigure Newsclips for Asterisk to use Cepstral as the TTS engine. Just edit nv-news.php in /var/lib/asterisk/agi-bin and change the $ttspick entry in line 16 from 0 to 1.

Asterisk SIP URI Support. Direct SIP-to-SIP communications is one of the most exciting emerging trends in Internet telephony. Within 10 years, Gartner predicts that 50% of all phone traffic will be pure IP from end to end. You can start using it with your new server to make free phone calls today. All that's really needed is a SIP URI for your server. SIP URI's work just like email addresses except they tell phone systems where to deliver calls over the Internet. The Orgasmatron build preconfigures a number of SIP URI's for you including mothership, e164, and fax. This means that anyone can contact you by "dialing" your SIP URI using either the IP address of your server or a fully-qualified domain name that points to that IP address. A typical SIP URI would look like this: mothership@192.77.210.14. This tells the calling system to route the call to the mothership context on the Asterisk server living at 192.77.210.14. You also can contact the demo applications on your server by dialing nv-demo@192.77.210.24.

The next logical step with SIP URI's is to interconnect your server with a traditional POTS phone number using your SIP URI. You can sign up for a free incoming phone number at ipkall.com. For your account type, choose SIP. For your SIP phone number, enter: mothership. For your SIP proxy, enter the fully-qualified domain name (FQDN) or IP address of your server, e.g. mypbx.dyndns.org. Choose a password and enter your real email address, and ipkall.com will beam you a Washington state phone number within a day or so. Just use it at least once a month, and you've got free inbound calls using a real telephone number forever. You can do much the same thing with Gizmo by signing up for an account using the FreePBX web interface included in the Orgasmatron build. You can't beat the price! For more detail on SIP proxies, see this Nerd Vittles article. To add your new number to directory assistance listings in the United States, just go to listyourself.net and sign up.

The other great use for SIP-to-SIP communications is to register yourself in the ENUM system so that other Asterisk and FreeSwitch systems can translate your plain old telephone number into a SIP URI and place the call SIP-to-SIP without any communications charges. To sign up for the service, go to both 164.org and enumplus.org. It only takes a minute. ENUM is implemented for default outbound calls by default on Orgasmatron builds. This means your server will attempt to place the call for free through ENUM before using your other outbound trunks for which you have to pay a fee to a provider.

TeleYapper. This application is an automated message broadcasting service commonly known as a call blasting or phone blasting system. It is licensed for non-commercial use including the following: to send prerecorded phone messages for neighborhood association announcements, school closings, tornado alerts, little league practices, fund raisers, municipal government reminders, and for just about any other non-commercial purpose. TeleYapper is simple to use. Dial extension M-S-G (674) on your Asterisk system and enter your password. You'll be prompted to record a message. Next you enter the group number for delivery of your TeleYapper message. The system will tell you how many recipients are in the group you have chosen. You then can begin the phone blasting session, or you can choose to resend messages to failed calls on a previous try to the same group. TeleYapper keeps track of which calls were successfully delivered and which were not so that follow-up calls can be placed. For detailed instructions on how to add entries to your TeleYapper database, see this Best of Nerd Vittles article.

Tide Reports with xTide. As the name implies, the xTide for Asterisk TTS application lets you retrieve tide and lunar information about any U.S. port by dialing 8433 (T-I-D-E) from any phone connected to your Asterisk system.

The default port setting for xTide for Asterisk is Pawleys Island, South Carolina. You can change this to meet your needs. There are three steps to reconfiguring the desired port city. First, identify a port city supported by xTide. Second, test the port city you have chosen using the tide application. Third, configure xTide for Asterisk for your desired port city. To identify whether a particular port city is supported by xTide, visit this link and search for the city you wish to use. Once you have verified that your desired location is supported, test it manually with the tide application that was installed as part of xTide for Asterisk. Log into your server as root and issue the command: tide -l "portcity", e.g. tide -l "boston".

Once you have verified that you get a tide report for your chosen city, simply reconfigure xTide for Asterisk to support that destination. While still logged in as root, edit /etc/asterisk/xtide.conf and change the contents to your new city. Be careful NOT to add any blank lines to the config file!

SITE="pawleys"
SITENAME="Pawlees Island, South Carolina"

You'll note that the spelling of the SITENAME was modified slightly to assist the TTS application. Complete details for configuring xTide for Asterisk as well as instructions for changing to Cepstral TTS support are included in the Best of Nerd Vittles article.

Weather Reports by Phone. Three separate TTS weather applications are included in the Orgasmatron build. You can retrieve weather forecasts by zip code and airport code as well as by international city. Dial Z-I-P and enter a 5-digit zip code. Or dial 6-1-1 and enter a three-character U.S. airport code. Or dial 6-1-2 and choose the international city preconfigured in your system. By default, the Worldwide Weather Forecasts for Asterisk application comes preconfigured to support 10 cities around the world. Here's the list:

0 - Tokyo
1 - Washington
2 - Berlin
3 - Florence
4 - Gough Island
5 - London
6 - Moscow
7 - Sydney
8 - Toronto
9 - Zurich

For details on changing the city codes as well as tips in using the other weather applications, see the Best of Nerd Vittles articles.

Miscellaneous Scripts. For your convenience, a script is included to update your zaptel setup whenever you add a card to your system or install a new Linux kernel. You'll find the script in the /root/nv folder on your server: zaptel-update.sh. There's also a script to install A2Billing: install-a2billing. There's also a detailed FAQ to walk you through configuring the Amazon S3 cloud computing service to work with PBX in a Flash as an off-site storage facility: s3cmd.faq. For configuration tips on configuring S3, see this Nerd Vittles article.

CallerID Superfecta 2.1. It's only been 10 days since the new FreePBX-based CallerID Superfecta was released. But wait until you see this new version. The original release of this application included 3 data sources. This one has 15 including the first Canadian source! There are too many new features to mention all of them here, but here's the short list:

1. Added Local Caching to MySQL
2. Retention of Valid Caller ID Name if Provided by Trunk
3. "Automatic" Support for sources requiring authentication
4. Post CID retrieval processing for source scripts
5. Altered whocalled behavior to return textual CallerID info
6. Support for sources with CID and SPAM rankings
7. Enhanced script error reporting in debug interface
8. "Report Back" capability to populate Data sources

You'll have to install this yourself unless you downloaded the Orgasmatron Installer (v1.4) after 5 pm EDT yesterday, May 24. The install instructions are included in the release notes, and it only takes a few seconds. Here's a link to the writeup on the new module on the PBX in a Flash Forum.

Unrelated But Still Interesting. If you're fascinated by all discoveries relating to words beginning with the letters o-r-g-a-s-m, be sure to check out Mary Roach's recent Ted Talk. Enjoy. 🙂

Read Part I and download the software.

Read Part II.

Read Part III.



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


Twitter Magic. If you haven't noticed the right margin of Nerd Vittles lately, we've added a new link to our Twitter feed. If you explore a little, you'll discover that the user interface now brings you instant access to every Twitter feed from the convenience of the Nerd Vittles desktop. Enjoy!


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...

Asterisk CallerID Perfected: CallerID Superfecta 2.0

If you’re new to VoIP and Internet Telephony, it may come as a shock when you discover that incoming calls no longer display the names of your callers unlike your POTS CallerID service. The problem is that most telephone providers deliver only a CallerID number when sending calls. Your DID service provider is responsible for looking up the incoming number in their directory and supplying a matching name. Simply stated, CallerID numbers are pushed to recipients, but CallerID names must be pulled from in-house databases. With Ma Bell and siblings, this was easy because they had a monopoly on all of the records. They’ve done their best to preserve that advantage. For example, Google provides very good CallerID information for people in the traditional phone book but provides no facility for adding numbers of those that don’t have a Ma Bell line. Coincidence? Probably not. With Internet Telephony Hosting Providers, CNAM lookups are few and far between. A few now will provide CallerID lookups but only on a per call fee basis.

A similar problem arises for outbound VoIP calls that you place. Even though you may provide a CallerID name and number, most telephone companies throw the supplied CallerID name in the bit bucket and do their own lookups. If you’re not in their directory, your number or nothing will be supplied instead of your actual name. Bottom line: This is one major piece of the telephone monopoly that Judge Greene forgot to address. And it’s only going to get worse now that more people own cellphones than Ma Bell landlines.

With Asterisk®, the simplest solution is to do your own CNAM lookups. And today we’re delighted to introduce CallerID Superfecta 2.0, a FreePBX module with incredible flexibility. It also serves as a living testament to how open source development actually should work.

The History Lesson. We originally wrote an AGI script for Asterisk@Home known as the CallerID Trifecta. As sources of CNAM lookups expanded, a number of other individuals contributed code to support those lookups. The original application morphed into the CallerID Superfecta when these new sources were added, but all the code still resided in a difficult-to-maintain PHP/AGI script. Tony Shiffer picked up the ball last year and converted the CallerID Trifecta into a FreePBX module which made it incredibly easy to install the application and configure the providers you wished to use. Fast forward to today, and now Jeremy Jacobs, with help from other members of the PBX in a Flash Forum community, has taken the original work of a number of PBX in a Flash Forum participants and released a real masterpiece, CallerID Superfecta 2.0. It’s not only easy to install and configure, but now it’s incredibly flexible and simple to expand as more and more people begin contributing lookup routines to this open source project. And Tony has put the icing on the cake with a new SVN development site to track bugs and feature requests for this project and others as we move forward.



The CallerID Superfecta Design. As originally implemented, CallerID Superfecta let you choose one or more lookup sources for incoming CallerID numbers. When an inbound call arrived, the sources were queried in a specified order, and the first source that provided a matching CallerID name won. The CNAM search result was returned to Asterisk for display on your phone instruments, and the lookup procedure ended. The problem with the original design was that newer and better lookup providers continued to appear, the hard-coded search order wasn’t necessarily ideal for every user or organization, and the providers kept changing formats to make lookups more challenging. CallerID Superfecta 2.0 fixes all of that!

What’s New. For openers there are a number of new lookup sources as well as some tweaks to older sources that stamped out a few bugs from our previous, sloppy code. 🙂 The web user interface (UI) for FreePBX also has been totally reworked. Now you can prioritize the lookups in the order that best meets your needs. And, as new CNAM lookup sources become available, they are automatically added to the new UI. The code also has been modularized with separate templates for each provider. This makes the addition of new lookup sources incredibly simple to implement. There’s also a new debug function built directly into the web user interface. By entering a telephone number in the new debug field and pressing the debug button on the form, the results from your selected lookup sources together with the latency of each enabled data source are displayed on the form for you to review. This new debug function greatly enhances troubleshooting while serving as a terrific tool to assist in fine tuning which providers to actually enable and in what order. Providers who can’t be reached, or who perform too slowly, or who provide lousy results can be turned off completely or moved to the bottom of the search order. Finally, CallerID Superfecta 2.0 introduces prefix code hooks. This gives developers the ability to trigger an additional outside process when the Caller ID function is initiated. For example, this feature might be used in a call center to allow the system to automatically perform an ODBC query and bring up a customer record for use by a customer service representative.

Installing CallerID Superfecta 2.0. Installation and setup should be a snap on any of the FreePBX-based Asterisk aggregations including PBX in a Flash. First, using a browser on your desktop PC, download CallerID Superfecta 2.0 from the Superfecta repository. Do not decompress the .tgz archive. Second, open FreePBX with your browser and choose Admin, Module Admin, Upload Module. Browse and select the superfecta-2.x.x.tgz module from your desktop and click the Upload button. When the upload completes, click local module administration. Scroll down and click CID Superfecta. Click the Install or Upgrade radio button depending upon whether you have previously installed the Superfecta FreePBX module. Click Process, Confirm, Return to install the new module. Reload the Asterisk dialplan when prompted.

Configuring CallerID Superfecta 2.0. There really are only two steps to bring CallerID Superfecta on line. First , we’ll configure the lookup sources and search order of the lookups. And then, for each inbound route on your Asterisk system, we’ll tell FreePBX to use CallerID Superfecta as the CallerID lookup source.



To configure CallerID Superfecta, click Admin, Setup, CID Superfecta in FreePBX. If you’re using PBX in a Flash or trixbox, be sure to insert the UserName maint and your FreePBX maint password in the fields provided under General Options. Then choose the Services you’d like to use for queries by clicking on the corresponding Enabled buttons. If you’re unfamiliar with previous versions of the product, we’d recommend you start with Addresses, White Pages, Yellow Pages, Any Who, and Telco Data. If you use the Asterisk Phonebook, AsteriDex, or SugarCRM, enable those options as well. Our rule of thumb in prioritizing the searches is to move your personal directories (Asterisk Phonebook, AsteriDex, and SugarCRM) to the top of the list. For the remaining choices, we recommend you start with the following search order: Addresses, White Pages, Yellow Pages, Any Who, and then Telco Data. Telco Data normally returns only the city and state of the caller, not the caller’s name. Who Called requires registration. Once you get everything squared away, click the Save button. Then key in a few known phone numbers in the Debug section of the form and click the Debug button to make sure everything is working as you expected. Take note of the retrieval times and the results and adjust the search order to meet your needs. Remember, the first match on a name using the search sources from top to bottom wins. The other search sources are never consulted for this number.

For additional configuration options and tips on configuring SugarCRM, see this thread on the PBX in a Flash Forum.

Once you’re satisfied with your lookup sources and the search order, the only remaining step is to designate CID Superfecta as the CallerID lookup source in your inbound routes. For each inbound route on which you want CallerID lookups performed, click Admin, Setup, Inbound Routes and choose the desired route from the column of routes on the right margin. Scroll to the CID Lookup Source section of the form and choose CID Superfecta from the dropdown box. Click Submit, Apply Config Changes, Continue to save your entry. Enjoy!

Good Things Are Coming. Sometimes you can just sense that something really terrific is about to happen with a project that’s been properly nurtured. So it is with PBX in a Flash. Many of us invested countless hours in the Asterisk@Home project, but it just never quite took off in terms of fostering independent development. And that is what open source is all about. When we started the PBX in a Flash project with Tom King and Joe Roper, we wanted something different, a participatory platform that could get folks excited about Internet telephony and open source development. As long time readers of this column know, we’ve pumped lots of applications into PBX in a Flash in hopes of encouraging others to catch the spark. Well, we’ve made it. CallerID Superfecta 2.0 is a perfect example of a creation from a developer who hasn’t previously contributed to any open source project. And there now are many more in the works. So we’re excited for the Asterisk community. Seeing your baby grow up is quite a thrill. We’re quickly building a network of application developers and contributors of many varieties, and it is starting to transform a really good telephony toolbox into a really spectacular application platform. Have a look at this new project to get a glimpse of what lies ahead.

This isn’t a private club. If you’d like to participate in a big or a small way, please visit our new, non-denominational Development Site and kick the tires. The objective is to create applications that can run on any of the FreePBX-based Asterisk distributions. So, while we’re a little biased, you don’t have to be to join in on the fun. Just click the Register link at the top of the form. Welcome!!!

Other Coming Attractions. Well, we got distracted again this week because CallerID Superfecta 2.0 was such as terrific new product. We’ll wrap up the Orgasmatron Installer tutorial in our next column. Stay tuned!

Security Alert. Secunia has published some security vulnerabilities in FreePBX. Upgrade all of your FreePBX modules at your earliest convenience.


Twitter Magic. If you haven’t noticed the right margin of Nerd Vittles lately, we’ve added a new link to our Twitter feed. If you explore a little, you’ll discover that the user interface now brings you instant access to every Twitter feed from the convenience of the Nerd Vittles desktop. Enjoy!


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…

Asterisk on Steroids: The Orgasmatron Installer, Part III

Happy Cinco de Mayo! And you can celebrate the event by installing two dozen turnkey Asterisk® applications in under 5 minutes! We recently introduced our new Orgasmatron Installer for PBX in a Flash. And today the saga continues with Part III in our series. Faxing and email work out of the box. More than a dozen extensions and a number of hosting provider trunks are preconfigured. Delivery of CallerID names with numbers is available from a half dozen providers of your choice. ODBC database connectivity is now painless. And the Flite text-to-speech engine is preconfigured with Cepstral TTS only a few keystrokes away. Also included are FreePBX 2.5, and Apache, SendMail, MySQL, PHP, phpMyAdmin, IPtables Linux firewall, Fail2Ban, and WebMin. Here's the complete list of what 5 minutes of your time brings to your Asterisk server platform:

In Part II of this series, we walked you through securing your system and configuring a few of the major applications: AsteriDex, CallerID Superfecta, CallWho, Cepstral, and Emailing with SendMail. Today, we'll tackle nine more applications in the list.

Fax Module with nvFax. The NVfax module provides basic incoming and outgoing fax functionality for your PBX in a Flash system. It's not perfect because faxing with VoIP providers is hit and miss at best! As installed, inbound faxing works after a simple configuration. Here are the three steps:

#1. Log into your server as root and edit fax-process.pl in the /var/lib/asterisk/bin folder. Change the following default parameter to make it your default MAILTO email address:

my $to = "JoeSchmoe\@gmail.com";

NOTE: Always edit system files like this: nano -w filename

#2. Using a web browser, log into FreePBX and choose Admin, Setup, General Settings. In the Fax Machine section of the form, choose system as the extension for receiving faxes, enter the destination email address for incoming faxes, and enter an email from address for outbound faxes.

#3. While still in FreePBX, you need to define how you want faxes processed when they are received from outside your PBX. Choose Admin, Setup, Inbound Routes. For each incoming route on your PBX where you want to enable receipt of faxes, click on that incoming route definition. In the Fax Handling section of the form, choose system as the fax extension, enter the fax email destination address, choose nvfax as the fax detection type, and use 5 as the fax detection delay setting. Save your settings for each inbound destination and then reload your dialplan.

You can test it by plugging a real fax machine into a VoIP phone adapter such as the Linksys SPA-2102 and assigning the ATA an extension number on your PBX. Using the fax machine, simply send a fax to extension 329 (F-A-X). It should arrive as a PDF in your email inbox within a couple minutes.

Once you get fax delivery of faxes from inside your PBX working reliably, then you're ready to graduate to the Big League and get faxing from outside your PBX working. This is 99% dependent upon the quality of inbound calls from your DID provider. If your DID provider doesn't support ULAW, give up or switch providers. We have successfully tested inbound faxing with TelaSIP, Teliax, voip.ms, and Future-Nine. With Teliax and Future-Nine, you will need to add the following settings to your Incoming Trunk Configuration in FreePBX:

t38pt_rtp=no
t38pt_tcp=no
t38pt_udptl=no

For additional tips and tricks, read our Best of Nerd Vittles article on faxing.

FONmail for Asterisk. FONmail is one of several applications that works in conjunction with AsteriDex. It lets you pick up a telephone connected to your Asterisk system, dial 6245 (M-A-I-L), and dictate a message for email delivery to someone in your AsteriDex database. You'll be prompted for the phone number of your recipient, or you can look up a person using the first three letters of their name in the AsteriDex database. Once you record your message and choose the recipient, the dictated message is emailed to the recipient using the email address you've entered for that person in AsteriDex.

For FONmail to work, you obviously have to add entries into AsteriDex (with email addresses) for the recipients you intend to select, and you need to populate the new dialcodes for AsteriDex by following the instructions in Part II of this tutorial. The final piece is specifying your return email address for the outbound emails. Set your return email address by editing the $email entry at the top of nv-mailit.php. The file is stored in /var/lib/asterisk/agi-bin.

FreePBX Backups. A disaster recovery plan is a critical component with any computer system, and PBX in a Flash is no different. You need to have a plan for recovering from a disaster whether that disaster is an Act of God, or man-made, or the result of a hardware failure. Our recommended strategy goes like this. Make weekly full disk backups with Mondo to at least a pair of USB flash drives. Replace the drive each week and take the other drive off site. In addition, make daily or weekly FreePBX backups and copy them to a safe place. Amazon S3 offers a convenient, inexpensive off-site storage facility for FreePBX backups. FreePBX backups let you restore FreePBX components to a machine state at the time the backup was made. Here's how to set up FreePBX automatic backups. Be sure you clean out old backups from time to time as they take up disk space. The backups are stored in folders under /var/lib/asterisk/backups based upon the name you assign to your backup schedule.

Here's how to set one up to make a backup on demand:

1. Open FreePBX with your web browser.
2. Choose Admin, Tools, Backup and Restore, Add Backup.
3. Give the backup schedule a name, e.g. RightNow.
4. Change all Radio buttons to Yes to backup everything.
5. Backup schedule: Run Backup Now.
6. Click Submit Changes button to kick off the backup.

Here's how to set one up to make a weekly backup every Sunday night:

1. Open FreePBX with your web browser.
2. Choose Admin, Tools, Backup and Restore, Add Backup.
3. Give the backup schedule a name, e.g. Daily.
4. Change all Radio buttons to Yes to backup everything.
5. Backup schedule: Run Backup Weekly (on Sunday).
6. Click Submit Changes to save new backup schedule.

Gizmo5 FreePBX Module. One of the VoIP providers that provides enormous flexibility in getting the most out of your new system is Gizmo5. For very little money and virtually no configuration hassles, Gizmo5 can't be beat. One of the slick functions that Gizmo5 provides is the ability to make 5-minute phone calls to any Skype user at no cost. For $20 a year, you can make as many 2-hour Skype calls as you like to your ten best friends. For more details, see our article. The Orgasmatron installer puts everything in place for you to set up a Gizmo account quickly from within the FreePBX interface. Just choose Admin, Setup, Gizmo5 Integration. Just follow the prompts to create your new account and make an initial deposit.

Installing the Hamachi VPN. Once you've run the Orgasmatron Installer, you have the option of installing the Hamachi virtual private network (VPN) which supports the interconnection of 16 computers at no cost. Simply run the install-hamachi.x script which you'll find in your /root/nv folder. For complete configuration instructions, read the install-hamachi.pdf file and hamachi.faq, both of which are also in the same directory.

Interconnecting Asterisk Servers with IAX. If you don't plan to interconnect your Asterisk server with one or more other Asterisk servers, then delete the Remote-Host outbound route in FreePBX and then delete the remote-peer trunk. If you plan to use the ODBC demo examples on extensions 222 and 223, you at least will need to change the Dial Pattern for the Remote-Host outbound route by deleting the 2XX entry as explained elsewhere in this article. What this provided was a simple way to interconnect extensions in the 200-299 range of numbers on a remote PBX.

If you do plan to interconnect Asterisk servers, then change this 2XX Dial Pattern to match the extension numbers on your remote PBX. For example, if the remote Asterisk server uses extensions in the 7000-7999 range of numbers, you'd want to include a 7XXX entry in your Remote-Host Dial Pattern.

To enable, interconnection of your new server to another Asterisk server, edit the remote-peer trunk and insert the actual IP address of your remote host. Also change the secret in the Peer and User sections to a very secure entry and use the same secret entry in your remote host trunk setup.

On the remote server, create a new IAX trunk with settings like the following using your correct secret and the IP address of your new server that was built with the Orgasmatron Installer:

MeetMe Conferences On the Fly. If you're accustomed to spending hundreds of dollars to schedule and run phone conferences with dozens of people, those days are officially over with PBX in a Flash. You now can purchase a phone number in 2600+ rate centers in the United States with support for 20 simultaneous calls for under $9 a month. Once you have purchased your DIDforSale DID and configured the new trunk on your server, simply point the inbound route for that trunk to Misc Destination: MeetMe CONF.

To set up a conference at any time, pick up any phone on your PBX and dial 2663 (C-O-N-F). When prompted for the conference number, make one up, e.g. 30303. When prompted for a conference PIN, make one up, e.g. 1234. Now notify all conference participants to dial the Conference DID (or 2663 for internal users) and to use 30303# for the conference number and 1234# for the PIN. When everyone hangs up, the conference ends. Simple as that!

ODBC Database Connectivity. All of the necessary components to support ODBC database integration with Asterisk have been installed for versions of the Orgasmatron Installer after May 1. Also included are two sample dialplan components that demonstrate how to build ODBC applications. These two samples are explained in the Nerd Vittles ODBC article. The extensions used by these two samples are 222 and 223. If you used an older version of the Orgasmatron Installer, you'll have to manually add ODBC support and the sample extensions conflict with the default routing rules for interconnecting your server to another Asterisk server. So you have two options. Either change the Dial Pattern for interconnecting to the remote server by deleting the 2XX entry or modify the extension numbers for the ODBC demos in /etc/asterisk/odbc.conf. Once you have addressed this inconsistency, you can activate the ODBC demo applications by inserting the following line in the [from-internal-custom] context of extensions_custom.conf in /etc/asterisk: #include odbc.conf

Then reload your Asterisk dialplan: asterisk -rx "dialplan reload"

Reminders by Phone and by Web. The latest version of the Best of Nerd Vittles Telephone Reminders 4.0 application is included in the Orgasmatron Installer. You can schedule reminders by telephone by dialing 1-2-3 from a phone connected to your Asterisk PBX. The default password is 12345678. To keep strangers from using your reminder system, you need to change this password. Edit extensions_custom.conf in /etc/asterisk and search for the 123 extension. Change the password entry in the Authenticate entry and reload your dialplan as shown above.

You also can schedule reminders using a web browser. There's an option in FreePBX: Admin, Tools, Reminders. You also can access the reminders application separate and apart from FreePBX using the IP address of your Asterisk server: http://ipaddress/reminders.

The CallerID number for the application, the TTS engine, and your email address all can be adjusted to meet your needs. See the Best of Nerd Vittles article for details on making these changes.

Continue reading Part IV (Monday, May 25).


Twitter Magic. If you haven't noticed the right margin of Nerd Vittles lately, we've added a new link to our Twitter feed. If you explore a little, you'll discover that the user interface now brings you instant access to every Twitter feed from the convenience of the Nerd Vittles desktop. Enjoy!


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...

Asterize Your Data: Taming ODBC with Asterisk

One of the perks of participating in the Atlanta Asterisk Users Group InstallFest a couple weeks ago was getting to hear some terrific speakers. At the top of that list was Jared Smith, who heads up the Training Division at Digium®. We always had considered ODBC to be a bit overwhelming for those new to Asterisk®, but Jared disproved that theory in less than 30 minutes. For those of you that don't have an opportunity to hear it from the master, today we present our Mom-and-Pop version of how to get Asterisk interacting with all of your favorite databases whether they be parts and inventory data, CRM, or just about anything else. And our special thanks to Jared for providing the inspiration to tackle this.

If you're new to the ODBC World, here's a quick primer. The idea behind Open Data Base Connectivity is to simplify the task of connecting up any flavor database management system so that it can talk to applications and foreign databases without having to write custom code to support every different DBMS. ODBC serves in much the same way as a translator who sits between you and foreign visitors. With the benefit of a translator, whatever is spoken is understood on both ends of the conversation.

The real beauty of ODBC is that it is conversant with almost every DBMS offering on the planet including Oracle, Informix, SAS, MS Access, DB2, SQL Server, MySQL, PostgreSQL, Sybase, and even dBase, FoxPro, and XDB. All you really need is the ODBC connector for your operating system plus one or more database drivers for the DBMS data sources you wish to use. Visit EasySoft if you want more background. They sum up the role of ODBC this way:

The goal of ODBC is to make it possible to access any data from any application, regardless of which database management system (DBMS) is handling the data. ODBC achieves this by inserting a middle layer called a database driver between an application and the DBMS. This layer translates the application's data queries into commands that the DBMS understands.

Our goal for today is to get ODBC working on your Asterisk system and to build a simple MySQL application that demonstrates how all the pieces should fit together. We've chosen MySQL because it is integrated into all of the major Asterisk aggregations and requires no additional installation. Even though our focus today is MySQL databases, the same process can be used to interconnect with virtually any foreign database regardless of where it happens to reside. And, in coming weeks, we will start cranking out some ODBC applications that actually are useful 🙂 ... much like what we've done in the Asterisk text-to-speech arena. Hopefully, this tutorial will encourage others to contribute ODBC applications for the benefit of everyone in the Asterisk community.

Getting ODBC working today also reinforces one of the key design strengths of PBX in a Flash. We strongly recommend you start with the latest build of PBX in a Flash. Then run our Orgasmatron Installer. It will provide you a feature rich and extremely stable base platform that just works! Unlike the RPM-based Asterisk aggregations such as trixbox and Elastix, it's incredibly easy with PBX in a Flash to recompile Asterisk to add ODBC functionality because Asterisk is actually built from Asterisk source code when PBX in a Flash is initially installed. That's not to suggest that any of this is impossible using the other aggregations. Just be aware that you may break the ability to later update your system once you manually bolt on additions such as ODBC by recompiling Asterisk. And, of course, you can add ODBC functionality to pure Asterisk systems as well. For an excellent tutorial, see Asterisk: The Future of Telephony (2nd Edition for Asterisk 1.4), by Jim van Meggelen, Jared Smith, and Leif Madsen.

Overview. Let's quickly review the installation steps to bring ODBC connectivity on line. First, we'll install several Linux RPMs to fill in the missing pieces to activate ODBC on your PBX in a Flash server. Second, we'll activate the Linux ODBC driver for MySQL. Third, we'll install a sample timeclock database in MySQL so we have something to play with. Fourth, we'll run a little Nerd Vittles script to tell Linux and Asterisk about all of your MySQL databases. Fifth, we'll recompile Asterisk so that it knows how to talk ODBC. Any time you create a new MySQL database, you'll want to run the script in Step #4 again to repopulate the ODBC information that tells Linux and Asterisk about your MySQL databases. The script only takes a few seconds. Once these steps are completed, you're ready to start creating your ODBC applications.

There are two parts to building any ODBC application with Asterisk. First, we'll define the SQL code to read and write to a particular table in one of your MySQL databases. Second, we'll insert some dialplan code in the new odbc.conf file in the /etc/asterisk directory. This dialplan code tells Asterisk how to behave when a database query is received from a telephone on your system. For each additional ODBC application, you just perform these two steps again. And we'll do that once more using our AsteriDex database just to show you how easy this really is. So let's get started.

1. Installing Linux RPMs. Log into your server as root and issue the following commands to install the necessary RPMs on your PBX in a Flash server. (NOTE: Skip this step if you're using PIAF-Green!)

yum -y install unixODBC-devel
yum -y install libdbi-dbd-mysql
yum -y install mysql-connector-odbc

2. Activating the MySQL ODBC Driver. While still logged into your server as root, issue the following commands to activate the MySQL ODBC driver on your system:

cd /root
wget http://pbxinaflash.net/source/odbc/mysql-odbc
chmod +x mysql-odbc
./mysql-odbc

3. Installing Sample MySQL Database. While still logged into your server as root, issue the following commands to install the sample MySQL database on your system:

cd /root
wget http://pbxinaflash.net/source/odbc/mysql-sample
chmod +x mysql-sample
mv /etc/asterisk/func_odbc.conf /etc/asterisk/func_odbc.conf.old
./mysql-sample

4. Defining MySQL Databases for Linux and Asterisk. The biggest pain in setting up ODBC used to be the creation of the text files telling Linux and Asterisk about your MySQL databases. We decided to write a script to automate the process. What this script does is query MySQL for the names of all your MySQL databases. It then generates the necessary settings in /etc/odbc.ini and /etc/asterisk/res_odbc.conf to support all of your MySQL databases. Don't forget to rerun it if you create new MySQL databases, or they won't be accessible through ODBC. Execute the following commands to run the script:

cd /root
wget http://pbxinaflash.net/source/odbc/odbc-gen.sh
chmod +x odbc-gen.sh
./odbc-gen.sh

Just a word of caution that this script overwrites both odbc.ini and res_odbc.conf after making backups of both existing files (odbc.old and res_odbc.conf.old). If you happen to be a whiz kid, and you've already made entries in odbc.ini and res_odbc.conf to connect to other databases, you'll need to put your entries back in place (from the backups) after running the script the first time. If you accidentally run the script twice, your connection data will be lost since the script only makes copies of the most recent versions of the two files.

5. Recompiling Asterisk. The final step in activating ODBC on your system is to recompile Asterisk so that it becomes ODBC conversant. You obviously want to do this when your PBX is not in service. While still logged in as root, issue these commands. (NOTE: Skip this step if you're using PIAF-Green!)

cd /usr/src/asterisk
make clean
./configure
make
make install
amportal restart

Building ODBC Applications With Asterisk. We cheated. We said there were two steps in building Asterisk ODBC apps. But we actually installed the code for our two samples when we installed the sample database. So let's review the two steps so you'll know how to roll your own down the road. The two files that manage ODBC queries with Asterisk are stored in /etc/asterisk. The queries are stored in func_odbc.conf. And the dialplan code is placed in odbc.conf. It could just as easily have been inserted in extensions_custom.conf, but we thought it was more straightforward to create a separate config file solely to manage ODBC dialplan code. If for no other reason, this way you'll know where to look when something goes wrong. 🙂

Step 1 is to create the SQL query statements that will be used by Asterisk to read and write to a table in one of your databases. We built a sample time card system which could be used to let employees clock in and clock out using a telephone on your Asterisk system. The SQL code to look up employee's names based upon their employee number is called a read in Asterisk 1.4 and readsql in Asterisk 1.6. It looks like the third line below. The SQL code to update information in the file is called write or writesql, and it's on the fourth line. Ignore the wordwrap. All of the read or write code must fit on a single line in func_odbc.conf in the /etc/asterisk directory. Once you add to or make changes in this file, you'll need to reload your Asterisk modules: asterisk -rx "module reload". You can check which ODBC custom functions are available on your system with this command: asterisk -rx "core show functions like ODBC". You'll note that, for every defined function, Asterisk tacks on an ODBC_ prefix. So TIMECLOCK becomes ODBC_TIMECLOCK. You use these functions to retrieve or populate data from within your dialplan as you'll see in a minute. You also can review the SQL commands for any functions you create with a command like this: core show function ODBC_TIMECLOCK. Here's what the demo TIMECLOCK function code in func_odbc.conf actually looks like:

[TIMECLOCK]
dsn=MySQL-timeclock
read=SELECT `comments` FROM `users` WHERE `empnum`='${SQL_ESC(${ARG1})}'
write=UPDATE `users` SET `empnum`='${SQL_ESC(${VAL1})}' WHERE `empnum`='${SQL_ESC(${ARG1})}'

Step 2 in building an ODBC Asterisk app is to write the dialplan code to assign an extension which will be used to answer a call for a database query, to prompt the caller for information, to issue a SQL query to the database (using one of the functions defined in Step 1), and to return the query results to the caller. All of this dialplan code goes in /etc/asterisk/odbc.conf. Let's take a brief look at the dialplan code we've written to look up an employee's name based upon a 5-digit employee number. It looks like this:


exten => 222,1,Answer
exten => 222,n,Wait(2)
exten => 222,n,Flite("Please enter the 5 digit employee number.")
exten => 222,n,Read(EMPNUM,beep,5)
exten => 222,n,NoOp(EMPNUM: ${EMPNUM})
exten => 222,n,Set(EMPNAME=${ODBC_TIMECLOCK(${EMPNUM})})
exten => 222,n,GotoIf($["${EMPNAME}foo" = "foo"]?notfound)
exten => 222,n,Flite("The employee name is ${EMPNAME}. Good bye.")
exten => 222,n,NoOp(Employee: ${EMPNAME})
exten => 222,n,Hangup
exten => 222,n(notfound),Flite("No such employee on file. Good bye.")
exten => 222,n,Hangup

This code does the following. It answers a call to extension 222, prompts the user for a 5-digit employee number (12345 and 23456 are in the sample file), stores the number to EMPNUM, outputs the number to the Asterisk CLI, and performs an ODBC query to ODBC_TIMECLOCK (note the addition of the ODBC_ prefix to the name we assigned above). If there is no matching employee name for the EMPNUM, the dialplan jumps to the notfound label and reports "no such employee." Otherwise, it speaks the employee name which the query stored in the EMPNAME variable.

We've also created an ODBC interface to AsteriDex. You obviously have to have AsteriDex 4 installed for this application to work. With this sample, you dial extension 223 and enter the 3-character DIALCODE which is the first three letters of a name in your AsteriDex database. Then the dialplan code retrieves the first matching entry providing both the matching name and phone number. It also gives the caller the option of calling the person whose number was retrieved. Before this sample will work, you'll need to populate the DIALCODEs. To do this, use a web browser and point it to the IP address of your Asterisk server and the directory housing your AsteriDex application, e.g. http://192.168.0.44/asteridex4/dialcode.php. Once you've run this application, dial 223 from any phone on your Asterisk system and enter A-M-E. This will return the default entry for American Airlines from your AsteriDex database. You can review all of the dialplan code by pulling up odbc.conf. Our code shows how easy it is to retrieve multiple fields from a database, parse those fields, and place an outbound call based upon a response from the caller. And all of this is accomplished with a couple dozens lines of simple dialplan code.

Where To Go From Here. We've covered the installation of ODBC and provided a couple of quick examples on how to extract data from ODBC-compatible databases using Asterisk. But to maximize your benefits with ODBC, learning the Structured Query Language (SQL) is the key that unlocks the castle. That's where the real work is performed. You want your good data to stay that way. And you want the answers to your queries to be right.

Our sample code in func_odbc.conf and odbc.conf will show you how to organize things and Asterize your SQL queries to pass information back and forth between Asterisk and MySQL. But mastering syntax alone won't earn you a Black Belt in SQL design. Here are two brand new O'Reilly books that will. The first book was just released, and the second one will be available shortly: Simply SQL and Learning SQL. Enjoy!


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...