Posts tagged: email

Introducing Phone Genie for Asterisk (Email Edition)

From Our Disney Cruise Family Scrapbook Almost two years ago, we introduced Phone Genie for Asterisk®. It let you reconfigure your Asterisk system remotely using your favorite web browser. This included the ability to set and adjust call forwarding, call waiting, and Do Not Disturb for any Asterisk extension. In addition, you could enter Asterisk CLI commands and execute a number of Linux system commands, all from the convenience of your web browser. Phone Genie for Asterisk remains one of the all-time favorite downloads of our readers.

Unfortunately, you don't always have access to a web browser when you're away from your Asterisk server. So today we introduce the perfect complement to the original Phone Genie with our new Email Edition. By following this quick tutorial, you can configure your Asterisk server to respond to any Asterisk CLI command which can be sent from almost any email client on the planet. And we'll perform all this magic with less than a dozen lines of bash scripting. Asterisk CLI commands have almost limitless possibilities. Use Phone Genie to check the status or change the functionality of just about any component on your server.

How It Works. The best way to explain how all of this works is to use a simple example. Let's assume you've left home and forgot to transfer your inbound calls for extension 701 to your cellphone. What we'll do is send a simple email message to a special user account on your Asterisk server that we've set up specifically to handle email directives for your server. Unlike most email addresses, we want this one to be unintuitive so strangers aren't sending messages to your server all the time. Let's assume the address is kxt1498@myserver.dyndns.org for this example. Using any email client, just address a message to that account. For the subject of the message, we'll use the following:

Asterisk: database put CF 701 6781234567

It doesn't really matter whether you include a message with the email. As long as the subject of the email is in the proper form, that's all that matters. The command above activates call forwarding for extension 701 and sends the calls to 6781234567. The command uses standard Asterisk CLI syntax.

On your Asterisk server, we'll have a simple bash script that runs every minute or two to check for new emails in the kxt1498 user's mailbox. If it finds a new message, it will parse the subject line, make certain there is a password match, and then send the command (unaltered) to the Asterisk Command Line Interface for processing. Here's an overview of all the CLI commands. The results of executing the command will be emailed to the address you've configured in the script. This works as both confirmation that your command has been executed and a security alert that your Asterisk system has been accessed using the Email Edition of Phone Genie. In the above example, you would receive an email at the address you've configured in the script with a subject of PhoneGenie. The body of the email would look like this:

Updated database successfully...database put CF 701 6781234567

Prerequisites. This software assumes you are using one of the Asterisk aggregations built on CentOS 5. We've tested it with PBX in a Flash. You'll also need an SMTP server (SendMail or Postfix) that is configured to send and receive emails to and from destinations on the Internet. You do not need a POP3 or IMAP mail server! We've tested this with Asterisk 1.4, but it should work fine with Asterisk 1.6 as well. FreePBX 2.5 or later is required for some functions.

Security Warning. Before we begin, let's pause for a moment to review the enormity of your problems if you do this wrong and to remind you that YOU ARE PROCEEDING AT YOUR OWN RISK. PBX in a Flash in particular is shipped with all outside access to your SMTP server blocked. We've obviously got to remove that layer of security for this software to function properly. But you need to be especially careful with SMTP servers because they can be used to relay SPAM to the entire world if you fiddle with settings that you don't understand. So... DON'T MAKE IMPROVEMENTS THAT AREN'T COVERED HERE UNLESS YOU KNOW WHAT YOU'RE DOING!

This software also gives certain email messages elevated privileges on your Asterisk server so that Asterisk itself can be reconfigured. If you compromise the email account name and password for this application, anybody worldwide can pretty much destroy the functionality of your server. In addition, calls to a certain extension could be rerouted to a very expensive destination on a cruise ship sailing around the world. If your dialplan permitted these calls and you had an account with automatic replenishment from a credit card or bank account, you've got a very expensive problem on your hands. That's one reason that reliable email notification of every Phone Genie transaction is critically important. If you're not getting timely notifications of each Phone Genie transaction, DO NOT USE THIS SOFTWARE until that problem is resolved!

Should you detect that your system has been compromised by receiving an email that indicates a command has been executed on your Asterisk server that you did not initiate, you should immediately disable or remove the script so that no further Phone Genie emails are processed on your server. Be sure to preserve any unprocessed Phone Genie emails for authorities as these may contain important information regarding the source of the emails. These email messages usually are deleted once Phone Genie completes execution of the associated Asterisk commands.

Overview. Here's the drill for today. First, we'll adjust both your hardware- based and IPtables firewalls to allow inbound email delivery to your Asterisk server. Second, we'll remove SendMail from your system and install and configure Postfix to handle the SMTP email chores. This will greatly simplify the security issues in locking down your server from unwanted emails. Depending upon your Internet service provider, installation of Postfix may break outbound email delivery from your server if your provider happens to block outbound traffic on port 25. We'll show you how to fix it. Third, we'll add a new user account on your Asterisk server that will be used exclusively to handle Phone Genie messages. Fourth, you're going to need a fully-qualified domain name for your Asterisk server so that email can be delivered reliably to your server. We'll walk you through getting this set up. Fifth, we'll install and configure the Phone Genie software and run some simple tests to make certain everything is working as it should. Sixth, we'll add the Phone Genie script as a cron job which will be run every couple of minutes to check for incoming Phone Genie emails. Finally, we'll review some of the Asterisk commands that can be executed using the Email Edition of Phone Genie for Asterisk.

Security Design. We've obviously given a great deal of thought to the security issues surrounding this application. The security model we've adopted works like this. First, for an email to get through to your Asterisk server, one and only one email address will work from the Internet. All other inbound email from the Internet will be rejected by Postfix. We strongly suggest you leave it that way. Your email address consists of the special username that we will create on your server plus a (hopefully new) fully-qualified domain name that points to your server. You are well advised to use and keep secret both a non-intuitive and complicated username AND a non-intuitive and complicated, fully-qualified domain name. Only this combination will let the email message through the Postfix filter! Using the correct username and a different FQDN that may also point to your server's correct IP address will nevertheless be rejected by Postfix. The third piece in the security model is the password. If you examine the sample Subject above, you will note that it begins with the word "Asterisk" followed by a colon, a space, and then the Asterisk CLI command. The word "Asterisk" is actually the password, and it can be changed to any password you like. So, if you change your password to FooBaR, then the subject of your message should look like this. Note that the colon followed by a space are also required!

FooBaR: database put CF 701 6781234567

Finally, it should be obvious but... DON'T SEND THESE EMAILS FROM AN UNTRUSTED CLIENT OR A PC IN A PUBLIC PLACE because your email message may get stored in a place that someone else could decipher how to access your server. If you wouldn't leave a $1000 bill beside the computer from which you're sending the email, don't send it! Otherwise, you may lose a good bit more than $1,000. To give you some idea of what's at risk with a compromised system, try sending the following email using your correct email address and password:

FooBaR: help

</sermon>

Firewall Configuration. For purposes of our example today, we're assuming that your Asterisk server is sitting behind a hardware-based firewall/router on a private subnet and that your Asterisk server includes a functioning software-based IPtables Linux firewall. This is the default PBX in a Flash setup that we always recommend. On your hardware-based firewall, you will need to redirect incoming TCP port 25 traffic to TCP port 25 on the private IP address of your Asterisk server. This change often requires a reboot of your firewall/router. Once that change is complete, log into your Asterisk server as root and edit /etc/sysconfig/iptables on PBX in a Flash systems. We need to add a new rule to IPtables which allows incoming TCP port 25 traffic through the firewall. Scroll to the bottom of the file and insert the following lines just above the COMMIT line:

# Allow inbound SMTP traffic on TCP port 25
-A INPUT -p tcp -m tcp --dport 25 -j ACCEPT

Save your additions to the file and then reload IPtables and your network:

service iptables stop
service iptables start
service network restart
service iptables status | grep "tcp dpt:25"

The last command should return an entry from IPtables showing TCP port 25 traffic is now being ACCEPTed into the server. If not, check your entries and repeat the process until this works.

Postfix Installation. Let's continue by removing SendMail from your server and installing Postfix. They both perform the same email functions, but the complexity of SendMail makes the likelihood of a configuration error too risky for us to sleep well. If you understand the intricacies of SendMail and feel comfortable implementing the security model we've described above, by all means, have at it. We'll be happy to share your results with the rest of our user community. In the meantime, here's the Postfix solution. While still logged into your server as root, issue the following commands to uninstall SendMail and install Postfix:

rpm -e --nodeps sendmail
yum -y install postfix

Choosing a Username and FQDN. Before we configure Postfix, you need to decide upon a user account name for your Asterisk server to manage Phone Genie messages. And you also need a fully-qualified domain name which points to the public IP address of your Asterisk server. As mentioned above, we strongly recommend that the username and FQDN be obscure and unguessable. For example, a combination of letters and numbers that don't spell words are good choices. Something like dlrpzh7b3@dhf34.nerdvittles.com will help you sleep well. If you don't have a static IP address and dedicated domain for your server that you can manage, then use an equally obscure FQDN from a provider such as dyndns.org. Something like dhf34.dyndns.org works. You then can configure your Asterisk server to automatically keep your dynamic IP address current. We're going to use these entries as examples below. Obviously, you should choose different entries!

To create the new user account on your server using whatever name you have chosen, here are the commands to issue while still logged into your server as root. Just substitute your chosen username for dlrpzh7b3 in both commands. Be sure to choose a secure password, too.

useradd dlrpzh7b3
passwd dlrpzh7b3

Configuring Postfix. Now let's get Postfix set up for maximum protection. First, move to postfix directory: cd /etc/postfix. Now edit main.cf: nano -w main.cf. Search for the inet_interfaces line in the file: Ctrl-W, inet_interfaces =. Add a hash mark to the beginning of each uncommented inet_interfaces line so that your entries look like this:

#inet_interfaces = $myhostname
#inet_interfaces = $myhostname, localhost
#inet_interfaces = localhost

Next, search for mydestination in the file: Ctrl-W,mydestination =. Comment out each of the lines except the one that looks like this:

mydestination = $myhostname, localhost.$mydomain, localhost

Now add the private IP address of your Asterisk server and your FQDN chosen above to the line so that it looks like this. Don't forget the commas and keep everything on one line.

mydestination = $myhostname, localhost.$mydomain, localhost, 192.168.0.118, dhf34.nerdvittles.com

Finally, move to the last line in the file and make it look like this, all on one line:

smtpd_recipient_restrictions = check_recipient_access hash:/etc/postfix/access, permit_mynetworks, reject_unauth_destination

Save your changes to the file: Ctrl-X, Y, then Enter. Now edit /etc/postfix/access. Move to the very bottom of the file and add two new lines with the following entries using the actual email address and FQDN you chose above instead of the examples. The first line tells Postfix to allow emails addressed to the specified email recipient. The next line tells Postfix to reject all other emails addressed to anyone at this domain. Other domains and public IP addressing are blocked by our mydestination entry above.

dlrpzh7b3@dhf34.nerdvittles.com OK
dhf34.nerdvittles.com REJECT recipient rejected

Save your changes to the file: Ctrl-X, Y, then Enter. Now issue the following two commands:

postmap /etc/postfix/access
service postfix restart

Testing Postfix. Now comes the important part. We need to make sure that outbound emails from your Asterisk server are delivered. And we need to make sure that incoming emails ONLY to the one email address you've designated are received and that all other emails from the Internet are rejected. We can't stress enough how important all three of these tests are. If your Postfix implementation doesn't pass all three, DO NOT PROCEED!

Testing outbound email with Postfix is easy. While logged into your server as root, issue the following command using a destination email address (instead of yourname@gmail.com) where you regularly receive emails:

echo "Hi there" | mail -s Test yourname@gmail.com

Count to 20 and refresh your email's Inbox. If the message is there, you've passed Test #1. If not, check your junk mail folder. If it's still not there, try another email address if you have one. Still no cigar? Then your Internet Service Provider is probably blocking email generated from downstream email servers. For tips on remedying the problem, see this message thread on the PBX in a Flash forums. You might also want to review the Postfix tutorial on dyndns.com. Here's another good tutorial on setting up a Gmail relay using Postfix. And here's another excellent tutorial. Then run the test again until you achieve success.

Testing inbound email to your designated email address is Test #2. Use a web client and send an email message to dlrpzh7b3@dhf34.nerdvittles.com substituting the actual email address you have chosen for your server. Count to 20, log into your server as root and type the following command to retrieve email for user dlrpzh7b3: mail -u dlrpzh7b3. The server should report that you have one new message. Type "d 1" and then "q" to delete the message and quit the mail app. If no email arrives, check the Inbox on your sending client to see if the message bounced and, if so, why. Check your email entries in /etc/postfix/access and /etc/postfix/main.cf for typos and review the steps in Configuring Postfix above. Then repeat the test until you successfully send a message to your designated email address.

Testing inbound email to an unauthorized email address on your Asterisk server is Test #3. For this test, we want to make sure that an email sent to the root account on your server fails. What you'll need for this test is the FQDN that was chosen above. Then, using a mail client, send an email message to root@dhf34.nerdvittles.com using your actual FQDN. Count to 20, log into your server as root, and type: mail. The message you sent should NOT be in the Inbox. Repeat the test by sending a message to root and dlrpzh7b3 @the actual IP address of your Asterisk server. These, too, should both fail. Once you get a passing grade on all three tests, we can move on. The hard part is behind you!

Installing Phone Genie. While logged into your server as root, issue the following commands:

cd /root
wget http://pbxinaflash.net/source/nv/phonegenie.tgz
tar zxvf phonegenie.tgz
rm phonegenie.tgz

Configuring Phone Genie. While still logged into your server as root, edit phonegenie.sh. You will note that there are 3 fields that need to be configured at the top of the file: user, pw, and notify. The user field is the designated user account name that will be used for incoming emails (dlrpzh7b3 in our example). The pw field is the word in every email Subject that precedes the colon, space, and Asterisk CLI command (Asterisk in our example). The notify field is a reliable email address where you regularly receive emails promptly. This is where the results of your Phone Genie email commands will be sent. Choose this email address wisely, as if your bank account depended upon it. It does! Once you have filled in the 3 fields (preserving the quotation marks around each entry), save the file with your changes.

Testing Phone Genie. Now we're ready to try everything out. Using an email client, send an email message to dlrpzh7b3@dhf34.nerdvittles.com (using your actual Phone Genie email name and FQDN). For the Subject, enter the following (substituting the password you created above for Asterisk)... Asterisk: help

After counting to 20, log into your Asterisk server as root and issue the following command:

/root/phonegenie.sh

You should see a display of all of the Asterisk CLI commands and within a minute or so, you should receive an email with the same information at the email address you entered into the notify field in phonegenie.sh in the previous step.

Installing Phone Genie as a Cron Job. Once you have tested several Phone Genie emails manually and you're satisfied that everything is working reliably, you can set up the Phone Genie shell script as a cron job. It should be set to execute every minute or every couple of minutes throughout the day and night. Edit /etc/crontab and insert the command shown below to have the script execute every 2 minutes:

*/2 * * * * root /root/phonegenie.sh > /dev/null

Sample Phone Genie Commands. In addition to all of the traditional Asterisk CLI commands, Phone Genie also supports a number of commands that are specific to FreePBX. These additional commands let you configure call forwarding, call waiting, do not disturb, system speed dials, and blacklist entries on your Asterisk server. For Asterisk CLI command syntax, consult voip-info.org. For FreePBX command syntax, see the listing below. Enjoy!

database put CF 302 8338116666 * Call Forwarding Enable
database del CF 302 * Call Forwarding Disable

database put CFB 302 8238221234 * Call Forwarding on Busy Enable
database del CFB 302 * Call Forwarding on Busy Disable

database put CFU 302 8038445689 * Call Forwarding Unavailable Enable
database del CFU 302 * Call Forwarding Unavailable Disable

database put CW 302 ENABLED * Call Waiting Enable
database del CW 302 * Call Waiting Disable

database put DND 302 YES * Do Not Disturb Enable
database del DND 302 * Do Not Disturb Disable

database put blacklist 6781234567 1 * Blacklist a number
database del blacklist 6781234567 * Remove blacklisted number

database put sysspeeddials 99 6781234567 * Set up Speed Dial 99
database del sysspeeddials 99 * Remove Speed Dial 99
(NOTE: Be sure you enable Feature Code *0 prefix in FreePBX!)

We wish all of you a very Merry Christmas!




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.


 
New Vitelity Special. Vitelity has generously offered a new discount for PBX in a Flash users. You now can get an almost half-price DID and 60 free minutes from our special Vitelity sign-up link. If you're seeking the best flexibility in choosing an area code and phone number plus the lowest entry level pricing plus high quality calls, then Vitelity is the hands-down winner. Vitelity provides Tier A DID inbound service in over 3,000 rate centers throughout the US and Canada. And, when you use our special link to sign up, the Nerd Vittles and PBX in a Flash projects get a few shekels down the road while you get an incredible signup deal as well. The going rate for Vitelity's DID service is $7.95 a month which includes up to 4,000 incoming minutes on two simultaneous channels with terminations priced at 1.45¢ per minute. Not any more! For PBX in a Flash users, here's a deal you can't (and shouldn't) refuse! Sign up now, and you can purchase a Tier A DID with unlimited incoming calls for just $3.99 a month and you get a free hour of outbound calling to test out their call quality. To check availability of local numbers and tiers of service from Vitelity, click here. Do not use this link to order your DIDs, or you won't get the special pricing! After the free hour of outbound calling, Vitelity's rate is just 1.44¢ per minute for outbound calls in the U.S. There is a $35 prepay when you sign up. This covers future usage and any balance is fully refundable if you decide to discontinue service with Vitelity.
 


Some Recent Nerd Vittles Articles of Interest...

Surfing the Google Wave

Original image courtesy of Squidoo.com... with apologies We’ve spent a week getting to know Google Wave using Chrome along with 100,000 of our closest friends. We wanted to give you a status report. Hype aside, Google Wave is an incredible tool when used for the right purpose. If you’ve been asleep or hiding under a rock for the past two weeks and missed the party, here’s a quick summary of Google’s latest invention. It’s a bird, it’s a plane… actually it’s a collaboration and communications platform that brings the full richness of Web 2.0 to your desktop. Some have suggested that it’s what email would look like if it were invented today. Our discussion focuses on the web-based Wave client, but Google Wave also is an open source development toolkit, and we’ll get to that one day soon.

Much has been written about Google Wave’s capabilities, and we won’t repeat that here. Instead, we want to address Google Wave’s potential and what we see as some of the present shortcomings of the product. We fully appreciate that this is a preview, and many of our concerns may yet be addressed before Google Wave becomes available to the general public. We can’t help chuckling at the realization that, in less than 30 years, we’ve now come full circle in data processing. What began as mainframe computing evolved into personal computing. And now Google Wave brings us much closer to being back where we started except for a state-of-the-art user interface and a new name: Cloud Computing. If IBM had addressed the user interface issues with mainframe computing, they probably never would have lost their market in the first place.

The screenshot above really can’t do justice to the richness of the client interface because you truly need a monitor as wide as your desk to get the most out of Google Wave. No, you won’t be using this on your cellphone or PDA… at least not well. For openers, Google Wave provides real-time collaboration so you actually see folks typing into various message threads (called waves) in the Land of Google. When you create a new wave, you “invite” other people in your Contacts to the wave. This puts the wave at the top of their Inbox in bold-faced type, akin to what Gmail would do with an incoming email.

There’s another frame to the right of your Inbox which actually displays the complete wave that you have selected so you’re never really jumping back and forth between selecting waves and reading them. What takes a bit of getting used to is the fact that both your Inbox and the wave you are currently reading may be changing every second with input from literally dozens of your associates or strangers if the wave you’re reading happened to be designated as public.

There’s one other dramatic difference in waves and threads of email messages. Other folks can change your stuff. As a collaboration tool with close associates, this might be desirable. With public waves, it would be a nightmare in the real world. And we don’t consider the 100,000 Google Wave previewers the real world. They are for the most part well-behaved probably out of fear that they’d be booted out if they behaved badly. That isn’t the real world as we all know. And the current Google Wave design would let a single creep destroy virtually every public wave in minutes using bots and malicious changes to documents. As presently designed, there would be little recourse other than replaying what your wave used to look like. You really can’t put Humpty back together again as some have already discovered.

Richard Nixon learned the hard way that tape recorders can be a blessing and a curse. Much has been made of the capability Google Wave offers to replay a wave so that you can playback the development of a thread of messages and see who added or deleted what and when. Google has touted the fact that everything is preserved. Well, not quite. First, there’s no capability at least presently to scroll back to a certain place in the timeline and recreate a new wave up to there. The most you can retrieve is a single posting. Second, anybody with access to the wave can use this timeline feature so wave restoration wouldn’t necessarily be desirable unless it were restricted to the original author of the wave. And, third, at least at Google someone knows how to cheat the system and delete stuff from the timeline. We only discovered this in reviewing the first public porn wave which started out prim and proper enough but quickly gathered steam when someone posted a collection of NSFW (or anywhere else) photos from their favorite collection. Within a few minutes, the postings quietly disappeared. Being the careful reviewer that we are, we immediately reached for the Playback button to check the history of the wave. Sure enough, the raunchy photos were still there. But, by the next morning, they had completely vanished from the chronology. So much for the official stance that nothing ever disappears. The real disappointment with the replay function is the lack of any capability to restore an entire wave. Because only individual messages (known as blips) can be recovered, this would prove to be next to worthless in a complex wave with hundreds of postings.

That brings us to the issue of whether public waves really make sense given the world in which we live. The good news is it works much better than IRC because of the richness of the content with attachments and hyperlinks. But, at least for public waves, the ability to edit someone else’s stuff would have to go. We try not to focus on legal nightmares in reviewing new software, but one can’t help wondering what would happen if one were to post something complimentary about a neighbor in a public wave and then another neighbor altered your posting by falsely accusing the individual of sleeping around with half of the neighborhood. Obviously, there’s still a good bit of work to do on the security front and in deciding whether allowing others to amend someone else’s postings is a good idea. Whether Google gets the security piece right will ultimately determine the success of Google Wave.

For public waves, it’s a no-brainer. You just can’t! And, to be honest, in reviewing hundreds of public waves in the preview, we can’t recall a single instance where this functionality would have been necessary. In a true (private) collaborative project, it would be wonderful but color-coding of text or some other method of identifying who wrote what would be absolutely essential from both a practical and legal standpoint. Both Microsoft Word and WordPerfect have had this capability forever. The simple way in Google Wave would be to add user’s pictures with a colored border and matching colored text whenever they make changes to someone else’s posting. With this addition, Google Wave could become a wonderful collaborative tool in both legal and technical environments.

And, speaking of word processing, Google Wave falls a bit short on the word processing scale. Despite the richness of Google’s knol platform, some of that functionality still is not available in Google Wave. The text editing and formatting is much akin to what’s available in a typical email client. You can change fonts, adjust color, indent, add hyperlinks and images, but that’s about as far as it goes. There are no headers, footers, footnotes, etc. So you can’t easily transform a wave into a formatted document for printing at this juncture. But that may come as development continues.

There are a few other things still on our Wish List. First, we’d love for Google Wave to evolve into a tool that can replace today’s forums which are not much more functional than BBS software was two decades ago. Once there is administrator control of rollback and protection of waves by granular access rights to functions, bots, and gadgets as well as the ability to block users and ranges of IP addresses, this should happen. Second, we obviously want the ability to include either read-only or read-write access to waves in a blog or web site. We already have the web site functionality working (see below for a sample), but you currently need a Google Wave account to access it. Third, we really want to assimilate all of the tools we use into the Google Wave Desktop so that everything is accessible in one place. That’s what Cloud Computing is all about, and Google Wave comes closer than anything else in meeting that need. You already can access Gmail on your Google Wave desktop and any web site that can be framed can be included in a wave as an iFrame. That doesn’t leave much once the security feature set is in place to protect all the components.

Finally, we’ll close with a brief mention of the coolest feature of Google Wave. That is its expandability which is enabled by incorporating bots and gadgets into any wave. As you might imagine, these extensions can do almost anything… good or bad. Here’s a short list of what has been developed and what’s already on the radar in just a few short weeks:

Chatbots
Eliza – ogenex@appspot.com – An implementation of the Eliza chatbot borrowed from the NLTK.
Elize – elizarobot@appspot.com – Is one of the first robots that was created by non Googler and is very useful if you are feeling alone in your Google Wave client.
Rude chatbot – notatory@appspot.com – An obnoxious chatbot borrowed from the Natural Language Processing Toolkit.
TooAngel Wave – In Progress – tooangel-wave@appspot.com – A self learning robot, that will respond to a reply in a more humanoid way

Conversion
BotURL – boturl@appspot.com – A URL Linker that replaces full URLs with hyperlinks.
Calcbot – calcbot@appspot.com – This bot will do in place calculations for simple mathematical expressions and allow you to use user defined variables.
Cartoony – cartoonybot@appspot.com – Replaces the text of every submitted blip with a cartoon balloon that contains the text instead. Colors the balloons based on username.
Dice Bot – dice-bot@appspot.com – Dice-rolling bot. Dice Bot will replace XdY (X is the number of dice; Y is the number of sides) with the results of those rolls.
Flippy – flippy-wave@appspot.com – Turns text upside-down.
Fnordlinky – fnordlinks@appspot.com – Replaces “PMID <number>” with article information from PubMed.
Hearty Emobot – hearty-emobot@appspot.com – Replaces ASCII art with wingding characters.
i-cron – i-cron@appspot.com – Evaluates Python expressions. Looks at blips in event, searches for CALC() macros and executes Python code using exec().
Insulty – megabytemb123@appspot.com – Information Needed
IPA Bot – ipa-bot@appspot.com – Changes normal letters into special characters used for phonetics.
Piratify
– piratify@appspot.com – Turns whatever you type into “Pirate Speak” .. Arrrr.
Plotzie – plotzie@appspot.com – Plots sparklines from your data.
Shortee – Wish – Change “c u l8r” to “see you later” etc.
Swedish Chef – borkforceone@appspot.com – Changes english into Swedish-Chef Speak. Bork! Bork!
Syntaxy – kasyntaxy@appspot.com – Syntaxy does blip-by-blip syntax highlighting for a variety of languages including Python, Java, C, C++, html, css and javascript.
Watexy – watexy@appspot.com – Use LaTeX mathematical language in your Waves!
Wikify – wikifier@appspot.com – Replaces specific marked up text with a link to Wikipedia or a description relevant to the marked text.

Games
Hangman – wavehangman@appspot.com – Play Hangman.
Roshambo – roshambowave@appspot.com – Play Roshambo (Rock / Paper / Scissors).
Speedy – Wish – Track the words per minute of all participants, competitive typing!

Groups
Groupy – groupy-robot@appspot.com – Robot to manage groups.

Integration
drop.io – mikeswaverobot@appspot.com – Creates a drop and puts the info into the wave whenever the robot is added as a participant.
OpenAustralia – In Progress – A robot to allow interaction with the OpenAustralia web site.
PlonieBot – In Progress – ploniebot@appspot.com – Brings wave document editing capabilities to the Plone CMS
Poppy – In Progress – poppywave@appspot.com – Helps bridge Google Wave conversations to email users outside the Wave.
Rssybot – rssybot@appspot.com – Turn google wave into an RSS reader!
Starify – starifybot@appspot.com – Lets you star waves, in sort of bookmarking style.
Tweety the Twitbot – tweety-wave@appspot.com – You can access your Twitter account.
Twiliobot – twiliobot@appspot.com – Transforms phone numbers into click-to-call links. If user clicks a link, a call is placed to his phone and to the number in the link. The call can be transcribed and inserted into the wave as text with a link to the audio.
Wave-Email – In Progress – wave-email@appspot.com – Provide an extension to Google Wave which will allow the integration of both sending and receiving emails.
Wave Live Messenger – wavelivemessenger@appspot.com – Allows you to chat to your windows live messenger contacts from inside a wave.

Language
PhilBot – Wish – A suggested solution to the problem of waves with languages you can’t read.
Rosy Etta – rosy@wavesandbox.com – Translator (40 Languages).

Polling
Polly the Pollster – polly-wave@appspot.com – Poll Bot.

Search / Aggregation
Dr Maps – dr-maps@appspot.com – Updates a wave by inserting a map associated to an address.
Dr Weather – shiny-sky@appspot.com – Gives the weather for a City
Embedded Search Results – wave-sandbox@appspot.com – Web and Image searches inline.
FML Blipper – fmlblipper@appspot.com – displays random FML story from www.fmylife.com
Grauniady – grauniady@appspot.com – Searches the latest items from The Guardian for a given phrase.
Stocky – stocky-wave@appspot.com – Detects stock symbols from a wave and updates it with the live stock price.
Wavethingy – wavethingy@appspot.com – Searches Amazon for DVDs and books, and gives the author a cut of any purchases made off the links.
Yelpy – yelpful@appspot.com – Searches Yelp with a user defined location and category.

Utilities
AmazonBot – amazon-withwaves-com@appspot.com – Enables social product research and shopping on Amazon.com. Wave participants can share products & reviews with contacts in real-time thanks to automatic queries by the AmazonBot against conversation keywords. The AmazonBot gadget can detect products and return inline product links or a custom full product browser.
Bloggy
– blog-wave@appspot.com – Information Needed
Bit.ly Bot – bitly-bot@appspot.com – Shortens the url using bitly.
Botty – Wish – Will automatically add a set of useful bots to a wave according to a collection of bots (so they don’t have to individually be added when you use them all the time.
CountColon – countcolon@appspot.com – Adds text statistics to your blips (words, lines, etc.)
Companion Sphere – companionsphere@appspot.com – Collection of geek utils, first working verb is “lookup” for wikipedia/wiktionary one-line descriptions.
Databot – Wish – Will start as soon as the GData interface is published.
Emoticony – emoticonbot@appspot.com – Replaces text representations of emoticons with the relevant image.
JBREAKOUT – jbreakout@appspot.com – Debug utility that reports event triggers.
Maison – maison@appspot.com – Makes blips public at http://maison.appspot.com.
Multi – multi-wave@appspot.com – A quote collector. Reply a blip you want to quote with ‘quote this’ and randomly display a quote with ‘quote <wave @account.com>’. The bot is still being under development but you can try playing with it.
Natural Language Processing – knowledge-books@appspot.com – Adds blips with NLP analysis.
Nokar – lab2market@appspot.com – Has many features such as translations, image insertion, insert last tweets etc.
Posterous – posterous-robot@appspot.com – A robot for posterous.com user to post blog in Google Wave. Here is how to write a blog using Google Wave Robot for Posterous.
Publisher – wave-publisher@appspot.com – Information Needed
Skimmy – wave-skimmy@appspot.com – Converts text emoticons, from : ) to img. Has a bookmarklet which creates a popup menu to insert emoticons for which the code is unknown.
Smiley – smiley-bot@appspot.com – Changes the smiley symbols to smiley images.
Smiley – In Progress – smiley-robot@appspot.com – Changes the smiley symbols to smiley images.
Style Chart – stylechart@appspot.com – Inserts a chart into a wave.

Wave Management
Bouncy – bouncy-wave@appspot.com – Allows you to remove robots from a wave. Doesn’t seem to work on real people though, and laughs if you try to ask it to kick itself out. To get it to kick a bot out, type “bounce:name@domain.com”
Linear – Wish – Enforce all replies to be to the main wave. If a user replies to a reply, remove it and place it as a reply to the main wavelet.
Read Onlie – readonliebot@appspot.com – Records the original wave content. Whenever it’s edited, the content is replaced with the original. Simple as that.
Seekdroid – seekdroid@appspot.com – You can list Robots, add them and find them out, easy to use. In continuous development. Website with all the information seekdroid.appspot.com.
Sweepy – sweepy-wave@appspot.com – Remove empty, whitespace-only blips.
Taggy – taggy-wave@appspot.com – Recognize #hashtags and add them as tags to the wave.
Tocgen – tocgen@appspot.com – Table of Contents auto-generated and updated based on the h1,h2,h3,h4 in a wave.
Twitusernames – twitusernames@appspot.com – Replaces all Twitter @username with links to the Twitter accounts.

Gadget Utilities
Ajax Animator – In Progress – http://antimatter15.com/ajaxanimator/wave/manifest.xml – A fully integrated multi-user web based vector graphic animation authoring environment.
AmazonBot Gadgett – http://amazon-withwaves-com.appspot.com/gadgets/AmazonProductList.xml – The AmazonBot gadget can detect products and return inline product links or a custom full product browser.
Bidder – http://wave-api.appspot.com/public/gadgets/bidder.xml – Simple Auction.
Checky – http://wave-gadgets.appspot.com/checky.xml – Basecamp-like checklists with drag-and-drop.
Click me – http://wave-api.appspot.com/public/gadgets/hellowave.xml – Shows a button with a counter. Each time the button gets clicked, the counter is incremented by one. Shows off how the state interaction works.
HTML – http://wave-ide.appspot.com/html.xml – Embed any HTML into a wave.
iFrame – http://wave-ide.appspot.com/iframe.xml – Embed any web page into a wave.
iWave – http://gadget.wave.to/iWave/iWave.xml – Allows you to create a profile on wave to make wave just a little more personal. Uses facebook connect to retrieve your details if you sign in.
Licensing – In Progress – http://wave-license.appspot.com/license_gadget.xml – Creative Commons RDF Embedding – Planning Stage.
Maps – http://hosting.gmodules.com/ig/gadgets/file/101415471413908368316/mappy.xml -Embed Google Map.
Napkin – http://my-wave-gadgets.appspot.com/wave/NapkinGadget.xml – Example of Flash/Flex Wave Gadget, similar to Whiteboard gadget above – source on Google Code.
QuakeBot – In Progress – Server information on the Quake 3 protocol.
Raffly – http://raffly.googlecode.com/svn/trunk/sandbox/raffly-xml1/raffly.xml – Insert this gadget to select a random participant from your wave to be the winner. The winner of what? Well that’s up to you :-)
Ratings – http://google-wave-resources.googlecode.com/svn/trunk/samples/extensions/gadgets/ratings/ratings.xml – Lets participants rate and review a topic (movie, restaurant, etc) in a wave and shows a tally of the result.
Slashdot Gadget – http://www.m1cr0sux0r.com/slashdot.xml – Loads latest Headlines from Slashdot.
Troco – An experimental peer-to-peer currency – http://troco.ourproject.org/gadget/org.ourproject.troco.client.TrocoWaveGadget.gadget.xml – Aims to provide a decentralized complementary community currency system, that is, a peer-to-peer currency system. Also you can see it as an IOU or promissory note based system. More info click here.
Vector Editor – http://jsvectoreditor.googlecode.com/svn/trunk/wave/vectoreditor.xml – A cross platform collaborative real time vector graphics editor.
Whiteboard – http://vps.michaelrose.id.au/canvas.xml – Draw on a virtual whiteboard.
Who is Coming? – http://wave-api.appspot.com/public/gadgets/areyouin/gadget.xml -Show a list of all people that have said whether they will come or not.

Gadget Games
Backgammon – Wish – Remove all of one’s own checkers from the board before one’s opponent can do the same. [Wikipedia]
Battleship – Wish – Displays different board based on user.
Boxes – In Progress – Connect lines to make boxes and win.
Connect 4/Four-in-a-row – In Progress – sdunster@wavesandbox.com – http://www.sdunster.com/wave/four.xml – 2 users + observers, turn locking, just waiting to write win-detection code.
Floodit – http://gadget.wave.to/floodit/game.xml – 2 player race to fill a board with colors.
Magnetic Poetry – http://hosting.gmodules.com/ig/gadgets/file/107558585548952247431/fridge-11.xml – Re-arrange random words to form poetry.
Match them colors! – In Progress – Match 3 / gem matching game.
Othello – Wish – Play Reversi.
Sudoku – http://blah.appspot.com/wave/sudoku/sudoku.xml – Play Sudoku.
The Button – http://hyperthese.net/wave-gadgets/the-button.xml – A useless (I mean USELESS) game.

Hooks
CVS integration – Wish – CVS history can be converted into a wave with playback.
GIT integration – Wish – GIT history can be imported and played back (dffs).
SVN integration – Wish – SVN History can be converted into a wave with playback.

Appearance
Google Wave Scrollbars – http://www.uniformedopinion.com/google-wave-native-scrollbars-extension/google-wave.crx – Changes the wave scrollbars to the default system scrollbars.


Enhanced Google Maps. In case you haven’t noticed, we’ve added yet another Google Map to Nerd Vittles. Now, in addition to showing our location with Google Latitude, we also are displaying your location based upon your IP address. We’ll show you how to add something similar to any LAMP-based Linux system in coming weeks. It’s a powerful technology that has enormous potential. If you’re unfamiliar with Google Maps, click on the Hybrid and Satellite buttons and then check out the scaling and navigation options. Double-click to zoom. Incredible!


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.



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


 
New Vitelity Special. Vitelity has generously offered a new discount for PBX in a Flash users. You now can get an almost half-price DID and 60 free minutes from our special Vitelity sign-up link. If you’re seeking the best flexibility in choosing an area code and phone number plus the lowest entry level pricing plus high quality calls, then Vitelity is the hands-down winner. Vitelity provides Tier A DID inbound service in over 3,000 rate centers throughout the US and Canada. And, when you use our special link to sign up, the Nerd Vittles and PBX in a Flash projects get a few shekels down the road while you get an incredible signup deal as well. The going rate for Vitelity’s DID service is $7.95 a month which includes up to 4,000 incoming minutes on two simultaneous channels with terminations priced at 1.45¢ per minute. Not any more! For PBX in a Flash users, here’s a deal you can’t (and shouldn’t) refuse! Sign up now, and you can purchase a Tier A DID with unlimited incoming calls for just $3.99 a month and you get a free hour of outbound calling to test out their call quality. To check availability of local numbers and tiers of service from Vitelity, click here. Do not use this link to order your DIDs, or you won’t get the special pricing! After the free hour of outbound calling, Vitelity’s rate is just 1.44¢ per minute for outbound calls in the U.S. There is a $35 prepay when you sign up. This covers future usage and any balance is fully refundable if you decide to discontinue service with Vitelity.
 


Some Recent Nerd Vittles Articles of Interest…


For those of you that already have Google Wave accounts, here’s a sample of how a wave will look in a WordPress posting. You can even add content to the wave! This works in Safari and Chrome most of the time, Firefox some of the time (if you turn on Accept 3d Party Cookies), and IE almost never. For those of you that are not part of the Google Wave preview, you’ll just have to wait patiently until Google turns on at least read-only access to this functionality:

A Baker’s Dozen Asterisk Nuggets from the Forums

Whether you’re new to the Open Source VoIP Community or an old-timer, we wonder how many folks actually miss many of the terrific Asterisk® applications that are hidden in message threads on the various Asterisk forums around the globe. In honor of St. Patty’s Day, today we want to take a stroll through the PBX in a Flash forum just to demonstrate what you may be missing by not visiting the forums or subscribing to some of the better syndication feeds.

Skype Gateway to Asterisk. If you read our recent column on integrating a Skype gateway into your Asterisk server, good for you. But, if you missed the forum dialog which followed release of the article, you missed all sorts of enhancements and system integration tips which made the Skype gateway a much better fit on many systems.

CallerID Superfecta. One of the most perplexing issues facing those that implement VoIP telephony solutions is wrestling with CallerID issues which flow from the ongoing Baby Bell phonebook monopoly. Many of you may have tried our CallerID Superfecta application which provides CallerID lookups for FreePBX-based systems using AsteriDex, Google Phonebook, AnyWho, and WhitePages. But, if you’d explored the forum additions to CallerID Superfecta, you would have uncovered an incredibly slick FreePBX installer as well as support for WhoCalled.us and Telcodata plus SugarCRM as well as numerous fixes for syntax changes on the various lookup sources.

Faxing with Asterisk. Other than CalleriD, there’s probably no issue that generates more consternation in the Asterisk community than fax integration. We reintroduced nvfax for Asterisk 1.4 recently. But, if you’d been following the forums, you’d also know that HylaFax and AvantFax now can be easily integrated into PBX in a Flash thanks to the work of Joe Roper and Tony Shiffer.

A2Billing for Asterisk. Another application that’s been difficult to get working with Asterisk has been A2Billing, a sophisticated calling card and PBX billing system. There really never has been a clear, concise cookbook for getting the software installed and properly configured. Once again, thanks to Joe and Tony, this forum thread provides a step-by-step tutorial for getting every facet of A2Billing installed and properly configured.

Asterisk Stickies. This is another promising Asterisk web application for PBX in a Flash that pops up stickies when incoming calls are received. You then can add the contact to your phonebook and also generate the XML code to update the phone directory on Grandstream and Cisco phone sets. It also supports click-to-dial from the web interface. You can keep up with the progress of this developing application in this very active message thread.

Text-to-Speech FreePBX Module. Just today a new TTS module for FreePBX was introduced which lets you generate TTS announcements for use with any FreePBX-based Asterisk system.

Overhead Paging with Asterisk 1.4. Most workplaces need some sort of overhead paging system. With the tips in this thread and any Asterisk 1.4 server, it’s incredibly easy to implement.

Streaming Music on Hold. We introduced streaming audio for Asterisk over three years ago in the Asterisk 1.2 days. A new message thread has updated that technology to support Internet radio using any Asterisk 1.4 server.

Email Alerts on Trunk Failures. For those that rely upon Asterisk systems to do real work, it’s essential to know when access to your carrier has failed so that you can make adjustments to your outbound and inbound trunks. This thread provides a simple tutorial and script to get you started.

Outbound Emails with Asterisk and SendMail. Another one of our Top 5 most perplexing problems with Asterisk is getting an outbound email capability with SendMail working reliably. Part of this is the configuration hassles with SendMail. But service providers such as Comcast have made matters worse by blocking outbound access to port 25 on most non-business accounts. Here’s a message thread that will walk you through configuring SendMail to use Gmail as your outbound SMTP relay host, and you’ll never have an email problem again on your Asterisk server.

Voicemail Notification. Unified messaging may be everyone’s dream but the reality is that it would be nice to be called on your cellphone when a new voicemail arrived at your office. The Voicemail Notification System does just that. And this thread integrates the original design into a FreePBX module.

Configuration Editor for FreePBX. FreePBX stores much of its magic in Asterisk config files. At least in PBX in a Flash, we hide some of these files to protect the integrity of your system. In addition, changes made to some of these files will get overwritten the next time FreePBX is started since it populates a lot of the information in these config files from data stored in MySQL tables. For those that want to learn more about the FreePBX, there now is a configuration file editor which will let you view and edit any FreePBX config file on your system. You’ll find a complete tutorial in the forums.

Hotel-Style Wakeup Calls. A few weeks ago we covered Tony Shiffer’s new add-on module for FreePBX that provides hotel-style wakeup calls for Asterisk systems. This code actually had been available in the forum for several months and is yet another reason to frequently check the new message threads.

Mac OS X Scripting Package. Since publication, a new link to a Treasure Trove of Goodies for Mac OS X has been posted including a link to the new Mac OS X Scripting Package and Asterisk binaries for Mac OS X from Sven Slezak at Mezzo.

Syndication Syntax. Many forums provide a syndication feed link, but many do not. For vBulletin-based forums, the basic syntax for an RSS feed looks like this:

http://fqdn.com/forum/external.php

You can refine the type of feed you want by specifying the type: RSS, RSS2, ATOM, or XML. For example, to pull down a feed from the PBX in a Flash forum, here’s the syntax for the various formats that are supported:

http://pbxinaflash.com/forum/external.php?type=RSS

http://pbxinaflash.com/forum/external.php?type=RSS2

http://pbxinaflash.com/forum/external.php?type=ATOM

http://pbxinaflash.com/forum/external.php?type=XML

You can further refine the feed by narrowing it down to a particular forum of interest. For example, to retrieve the latest threads from the PBX in a Flash Open Discussion forum, the syntax looks like this:

http://pbxinaflash.com/forum/external.php?type=RSS2&forumids=2

Finally, here’s the list of forum ID numbers for the PBX in a Flash forum:

2 – Open Discussion
3 – Help
4 – Endpoints
5 – Trunks
6 – Providers
7 – Wish List
9 – Bug Reporting & Fixes
10 – Add-On Install Instructions

Something We Missed? There are hundreds of additional Asterisk apps hiding in the woodwork. Please share your discoveries by posting a comment and link below. Enjoy!


Want a Bootable PBX in a Flash Drive? Our Atomic Flash bootable USB flash installer for PBX in a Flash has been quite the hit. Special thanks to all of our generous contributors! Atomic Flash provides all of the goodies in the VPN in a Flash system featured last month on Nerd Vittles. You can build a complete turnkey system using almost any current generation PC with a SATA drive and this USB flash installer in less than 15 minutes!

If you’d like to put your name in the hat for a chance to win a free one delivered to your door, just post a comment with your best PBX in a Flash story.1

Be sure to include your real email address which will not be posted. The winner will be chosen by drawing an email address out of a hat (the old fashioned way!) from all of the comments posted over the next several weeks.

And it still isn’t too late to make a contribution of $50 or more to the PBX in a Flash project and get a free Atomic Flash installer delivered to your door as our special thank you gift. See this Nerd Vittles article for details.


New Fonica Special. If you want to communicate with the rest of the telephones in the world, then you’ll need a way to route outbound calls (terminations) to their destination. For outbound calling, we recommend you establish accounts with several providers. We’ve included two of the very best! These include Joe Roper’s new service for PBX in a Flash as well as our old favorite, Vitelity. To get started with the Fonica service, just visit the web site and register. You can choose penny a minute service in the U.S. Or premium service is available for a bit more. Try both. You’ve got nothing to lose! In addition, Fonica offers some of the best international calling rates in the world. And Joe Roper has almost a decade of experience configuring and managing these services. So we have little doubt that you’ll love the service AND the support. To sign up in the USA and be charged in U.S. Dollars, sign up here. To sign up for the European Service and be charged in Euros, sign up here. See the Fonica image which tells you everything you need to know about this terrific new offering. In addition to being first rate service, Fonica is one of the least expensive and most reliable providers on the planet.
 
New Vitelity Special. Vitelity has generously offered a new discount for PBX in a Flash users. You now can get an almost half-price DID and 60 free minutes from our special Vitelity sign-up link. If you’re seeking the best flexibility in choosing an area code and phone number plus the lowest entry level pricing plus high quality calls, then Vitelity is the hands-down winner. Vitelity provides Tier A DID inbound service in over 3,000 rate centers throughout the US and Canada. And, when you use our special link to sign up, the Nerd Vittles and PBX in a Flash projects get a few shekels down the road while you get an incredible signup deal as well. The going rate for Vitelity’s DID service is $7.95 a month which includes up to 4,000 incoming minutes on two simultaneous channels with terminations priced at 1.45¢ per minute. Not any more! For PBX in a Flash users, here’s a deal you can’t (and shouldn’t) refuse! Sign up now, and you can purchase a Tier A DID with unlimited incoming calls for just $3.99 a month and you get a free hour of outbound calling to test out their call quality. To check availability of local numbers and tiers of service from Vitelity, click here. Do not use this link to order your DIDs, or you won’t get the special pricing! After the free hour of outbound calling, Vitelity’s rate is just 1.44¢ per minute for outbound calls in the U.S. There is a $35 prepay when you sign up. This covers future usage and any balance is fully refundable if you decide to discontinue service with Vitelity.
 


Some Recent Nerd Vittles Articles of Interest…

  1. This offer does not extend to those in jurisdictions in which our offer or your participation may be regulated or prohibited by statute or regulation. []

Get Your Email By Telephone: Introducing MailCall for Asterisk 1.4

Well, it's Happy Birthday to Us week at Nerd Vittles. This week marks our Third Anniversary, and today we're publishing our 200th column. Wow! Eighteen months ago, we first introduced MailCall for Asterisk®. It joined dozens of other telephony applications named MailCall with one important difference. Ours is FREE! What do it do? Well, it reads your email messages to you over the telephone. All you have to do is dial up your Asterisk server from any touchtone telephone. Can it handle multiple email accounts? Absolutely. Do the email accounts have to be on the Asterisk server? Nope. Does it work with POP3 and IMAP mail accounts? Yep. Which email messages can it speak? We've tried it successfully with messages from Yahoo, and HotMail, and Google Mail, and Comcast Mail, and RoadRunner, and Outlook Express, and Notes Mail, and Entourage. And it works with plain text messages as well as those with attachments although it doesn't deal with the attachments. No, it can't tell you what kind of picture is lurking in your inbox. Maybe someday. If you happen to be running a current version of PBX in a Flash, then deploying MailCall for Asterisk 1.4 will take you about 15 minutes to set up. For other versions of Asterisk, you'll need to install Apache, PHP, the php-imap library, FreePBX, and the Flite voice processing system. You can scratch around on Nerd Vittles for most of the tutorials. But the easiest way to get this up and running quickly is to install PBX in a Flash and get the latest updates using our tutorial. You can't beat FREE!

Overview. The way MailCall for Asterisk 1.4 works is pretty straight-forward. You add a code snippet to the extensions_custom.conf config file for each mail account you wish to activate. This is where you tell Asterisk which extension to dial to play back your messages. Then you drop a PHP script into the AGI script directory. Finally you create a configuration file for each email account you wish to set up. The config file tells MailCall the name of your provider, your username, your email password, and the 4-digit password you wish to use to access your messages by phone. Once you reload Asterisk 1.4, you'll be off to the races.

Dial the extension and enter your password for this account. MailCall for Asterisk 1.4 will connect to your mail server and tell you how many messages are sitting in your mailbox. Press 1 to play the most recent message. After it plays, you can press 5 to replay the message, press 6 to play the next most recent message in your mailbox, press 4 to play the previous message (if any), press 0 to retrieve a specific message, press * for a list of options, or press # to exit. These are the same buttons you press for these functions in the Asterisk voicemail system, formerly Comedian Mail. We tried not to reinvent the wheel although the options aren't especially intuitive. We've also built a quick-and-dirty web interface to let you test access to your email accounts. The idea is to get PHP working with your email account and then copy the config file settings to your MailCall config file. You'll find it easier to debug connection problems using a web browser rather than using a telephone.

Getting Started. Let's take first things first. Before proceeding with the installation, make sure you are running an Asterisk 1.4 system with all the necessary components outlined above. If you're still running a system with Asterisk 1.2, read our old tutorial instead. Unless you're running PBX in a Flash, you'll need to install and configure Apache, PHP, the php-imap library with all dependencies, SendMail, and the Flite speech synthesis engine. Once you get all of the pieces properly configured and talking to each other, you'll be in the same place as those that used our tutorial to set up PBX in a Flash in about 30 minutes. We've also got a 15-second MailCall installation script for PBX in a Flash users. If you use it, you then can skip the remaining installation steps below and just do the configuring.

Running the PBX in a Flash Install Script. Only use this script if you're running a PBX in a Flash system. It is design-specific and will break things if it is run on other Asterisk 1.4 systems. The remainder of this tutorial will walk you through manually installing the software on other implementations of Asterisk 1.4. On PBX in a Flash systems, log in as root and execute the following commands:

cd /root
wget http://bestof.nerdvittles.com/applications/mailcall/mailcall.pbx
chmod +x mailcall.pbx
./mailcall.pbx
amportal restart

Once you've run the script, you can skip through the installation steps below, but you still need to configure both the web component and the Asterisk component so that MailCall knows how to retrieve your email. It'll just take you a couple of minutes.

Missing Pieces. Unless you used our install script, two important pieces are missing on most out-of-the-box systems including the base install of PBX in a Flash. The first is php-imap support for Apache. And the second is a simple tool to send fax and email messages from within your server. You can test whether your system includes php-imap support (which allows you to access and read from pop3 and imap mail servers) by creating a simple one-line PHP application called test.php in /var/www/html and running it from your web browser. If you care about the security of your web server, do NOT leave this application on your server after the test!!

<?php echo phpinfo() ; ?>

From a web browser, go to http://192.168.0.1/test.php using the correct IP address of your server. Immediately after the Apache HTTP Headers Information section, there will be an alphabetical listing of each of the modules supported on your Apache server. Look through the list and be sure you have an entry that looks something like the following:

imap
IMAP c-Client Version   2004
SSL Support   enabled
Kerberos Support   enabled

To install php-imap support, run the following commands after logging into your server as root:

yum install php-imap
apachectl restart

For the missing mime-construct component, execute the following commands:

cd /usr/local/bin
wget http://nerdvittles.com/trixbox123/mime-construct
chmod +x mime-construct

Installing the Web Interface. To install the web interface that you'll use for testing PHP access to your email account, log into your server as root and issue the following commands:

cd /var/www/html
mkdir readmail
cd readmail
wget http://nerdvittles.com/mailcall/webstuff.zip
unzip webstuff.zip
rm -f webstuff.zip
cp config.php config.bak.php

Testing Your First Mail Account. While you're still in the readmail directory, let's set up your first email account to make sure everything is working. If you've configured an email account previously in Outlook Express or some other mail reader, take a look at your configuration there and write down the settings. We'll need to know the fully-qualified domain name for your mail server, the type of mail account you have (POP3 or IMAP), the port used to access your mail and whether it's encrypted, and your username and email password. Here's what the settings for Gmail accounts should look like:

$MAILSERVER="pop.gmail.com:995/pop3/ssl";
$USER = "yourname@gmail.com" ;
$PW = "yourpassword" ;

If your email domain is hosted by a hosting provider such as our favorite, BlueHost, then here's the way the settings should look for your POP3 account:

$MAILSERVER="yourdomain.org:110/pop3";
$USER = "username+yourdomain.org" ;
$PW = "password" ;

For an IMAP mail account, the settings should look something like the following:

$MAILSERVER="yourdomain.org:143/imap";
$USER = "username+yourdomain.org" ;
$PW = "password" ;

Some ISPs require both your username and the domain as your login name. Others only want your account name. Whatever is working with your current mail client to successfully retrieve your email is what you should use here. Note that you must add both :portnumber and either /pop3 or /imap onto the end of your mail domain entry. We've made a duplicate of the config.php file for you just in case you mess up. Once you have your settings in hand, edit the config.php file in the readmail folder: nano -w config.php. Make the necessary entries and be sure you preserve the quotes around the entries as well as the semicolon at the end of each line. When you're finished, save your changes: Ctrl-X, Y, then Enter. Now open a web browser and go to http://IPaddressOfYourServer/readmail/. You should get a list of messages in your Inbox. When you click on a message, it should display in the browser. Get this working first before proceeding. Don't worry if some of the messages don't look quite right. We made some improvements in the MailCall application after the web interface was completed.

Newbie Alert: We ALWAYS love to hear from the Nerd Vittles Fan Club but ... If you have problems getting this to work, DON'T SEND ME EMAILS ASKING FOR HELP. Post your setup and your problem on the PBX in a Flash Help Forum and someone (maybe even me) will respond. This assists not only you but also anyone else with a similar problem. The blog format used for Nerd Vittles just isn't suitable for tech support ... and neither am I usually.

Modifying Your Dialplan. As indicated above, we need to add some code to the extensions_custom.conf file for each mail account you want to access. The basic code looks like this:

exten => 555,1,Answer
exten => 555,2,Wait(1)
exten => 555,3,Set(TIMEOUT(digit)=7)
exten => 555,4,Set(TIMEOUT(response)=10)
exten => 555,5,Flite("At the beep enter your e-mail password.")
exten => 555,6,Read(PWCODE,beep,4)
exten => 555,7,Flite("Please hold a moment.")
exten => 555,8,AGI(nv-mailcall.php|${PWCODE})
exten => 555,9,Flite("Thank you for calling. Good bye.")
exten => 555,10,Hangup

The only change you need to make is in the extension number (555) on each line. This tells Asterisk what number you'll be calling to retrieve your messages. If you want to access more than one email account, then you simply duplicate the above code with different extension numbers. Just be sure that all 10 lines of each code snippet have the same extension number. If you don't like four-digit phone passwords, you can change the length of 4 to anything that makes you sleep well (in line 6 above). Now open up Admin web interface to FreePBX. Then choose the Tools tab and click Config Edit.Once phpconfig opens, click on extensions_custom.conf. Add the above code in the [from-internal-custom] context at the top of the file. And click the Update button once you've adjusted the extension number to meet your needs.

Installing MailCall for Asterisk. Now we're ready to install the actual application. Log into your server as root and issue the following commands in order:

cd /var/lib/asterisk/agi-bin
wget http://nerdvittles.com/mailcall/mailcall.zip
unzip mailcall.zip
rm -f mailcall.zip
cp nv-config-555.php nv-config.php
chown asterisk:asterisk nv*.php
chmod 775 nv*.php

Configuring MailCall for Your Email Accounts. The zip file contained two files: nv-mailcall.php (the MailCall for Asterisk 1.4 application) and nv-config-555.php (the email config file for extension 555). And we made a backup copy of the config file: nv-config.php. The important point here is that you must create a config file for each mail account you wish to access, and it must be named correctly, or nothing works. The file name is important because that's how the application retrieves information about your mail account. The file naming syntax is pretty obvious: nv-config-extensiontocall.php. Just make sure your config file name matches the extension you used in the dialplan code above. Once you get the config file named correctly, edit the file and personalize it to your mail settings which we tested with the web interface. Be sure to also replace the phone password entry of 1111 with a four-digit numeric password that you will use to access your email. Save your changes and then reload Asterisk: amportal restart. Now pick up a phone on your Asterisk system and dial 555. Presto! You've got email!

Remote Access to MailCall for Asterisk. You may or may not want access to MailCall from phones outside your Asterisk system. If you do, here's a simple way to implement it. In a nutshell, you'll want to set up an account with a provider such as les.net that provides a DID number with free incoming calls. Or just add an extra DID number to your TelaSIP account. Then add an extension number to your system using freePBX and configure it to always forward calls to 555 or whatever number you used for MailCall. Finally, create a Miscellaneous Destination in FreePBX for extension 555. Then you can tell FreePBX to forward the inbound DID calls to this extension.

Adding Additional Mail Accounts to MailCall for Asterisk. Now you'll want to set up a way for the Little Mrs. to check her email, too. Call it an early Valentine's present. Step 1 is to add 10 more lines of dialplan code (as we did above) to your extensions_custom.conf file using a new extension number, e.g. 556. Second, add a new MailCall config file in /var/lib/asterisk/agi-bin for this extension, e.g. nv-config-556.php. Third, edit the new config file to personalize it to your spouse's email settings and add a dial up password. Finally, restart Asterisk: amportal restart. Now dial the extension and be sure it works. Then you're off to impress the Little Mrs. Enjoy!


FreePBX Training Still A Deal... Until Friday. We raved last week about the upcoming FreePBX Training Seminar, and today we want to add a couple of tidbits for your consideration. In addition to some fantastic training and the fine cuisine of Charleston, rumor has it that you're also going to be treated to some once-in-a-lifetime hardware deals on the very finest Asterisk-compatible hardware cards and servers for your business. If you're a reseller, you can easily cover the cost of your training with the savings you'll realize on these products for your customers. Suffice it to say, you're never going to see comparable prices unless you build the hardware yourself. Without getting anyone in trouble, that's all we can say at this time. You'll just have to trust Uncle Ward on this one. And, the FreePBX Team also has announced that this Friday is the last day for the $600 early-signup discount so don't procrastinate. We're looking forward to meeting all of you and showing you a grand old time in our hometown.

Hosting Provider Special. Just an FYI that the Nerd Vittles hosting provider, BlueHost, has raised the bar again on hosting services. For $6.95 a month, you now can host unlimited domains with 600 gigs of disk storage and 6 terabytes a month of bandwidth. Free domain registration is included for as long as you have an account. Their hosting services are flawless! We oughta know. We've tried the best of them. If you haven't tried a web hosting provider, there's never been a better time. Just use our link. You get a terrific hosting service, and we get a little lunch money for our Birthday Bash.


Some Recent Nerd Vittles Articles of Interest...

Ringbinder theme by Themocracy