About Automating Outgoing Phone Calls

You can’t just load up a bunch of phone numbers into a database and start calling them. There are laws. Don’t break them.

Our automated outbound calls fall into three categories which I’ll cover in follow up posts. For now, I wanted to touch on some information anyone should know about before hooking up an application to make phone calls. Particularly when it comes to telemarketing and autodialed calls.

Federal Regulations

Back in 1991, the Telephone Consumer Protection Act was passed. It restricts phone solicitations and the use of automated dialing. It covers SMS messaging and faxing in addition to normal voice calls.

Here are some of the primary restrictions. There are more, so don’t take this as a complete list.

  • Don’t call anyone before 8am or after 9pm. If you do business across time zones, you need to deal with that.
  • You need to maintain you’re own do not call list. If someone asks to be put on it, add their number. You have to honor it for at least five years.
  • Honor the National Do Not Call Registry. See section below
  • Tell people who you are and your phone number or address.
  • Don’t call emergency lines or anyone who’d be charged for your phone call.
  • Don’t call cell phones without prior written consent. That’s right, you’re not allowed to make unsolicited calls to cell phones. Period.
  • As I said above, there are a lot of other rules.

If you break any of the above rules, you can get taken to court.

National Do Not Call Registry

The Do Not Call Registry allows anyone to register their phone number. Telemarketers are never supposed to call any registered number unless the person has given you permission.

You can register to access this database, either via an API or as a downloadable list at the Do Not Call Registry Telemarketer site.

Common Courtesy

Not all calls are unsolicited calls. You may just being trying to confirm a scheduled appointment. Regardless, you want to be courteous to the people you call.

  • Don’t make excessive calls.
  • If you get voicemail, and leave a message, give the person some time to respond. Don’t call back every five minutes until you reach someone.
  • If you talk to someone who requests a call back in three months, you should respect their request. Leave them alone for those three months.

More information

What is a Robocall?

Robocalls include automated phone calls made using autodialers. This includes calls that only contain pre-recorded messages and those where you speak to a live person.

What is an Autodialer?

Any type of equipment or computer software that dials phone numbers without human intervention.

How can you determine if a phone number is a landline or a cell phone?

A variety of sources exist to assist businesses and telemarketers to tell if a number is a mobile number. For example, NeuStar, as the North American Numbering Plan Administrator, the National Pooling Administrator, and the LNP Administrator, makes information available for the purpose of identifying phone numbers assigned to wireless carriers.

Adhearsion: Click to Call

One of the most basic things you can do when you tie an application in with your phone system is implement click-to-call. You click a phone number on your web page, or within your application. It connects you to that phone number.

What the user experiences

From the user’s perspective within our application it goes down like this:

  1. Click a phone number link in the web page.
  2. In a few seconds your phone extension will ring.
  3. You pick it up and you’ll hear your phone number being dialed.

From that point on it’s just a normal phone conversation. You just didn’t have to dial the phone yourself.

What happens behind-the-scenes

You’re logged in, so the application (Nitro for us) knows who you are and you’re phone extension. This is what happens from the application’s point of view:

  1. It shoots an API call with the user info and phone number to our Talkbox (i.e. Adhearsion) server.
  2. The phone call is initated with Asterisk.
  3. The user’s phone extension is rung.
  4. As soon as the user picks it up, the outgoing phone call is initated.

That’s about it. All this assumes is that we have the user’s extension number stored properly in the database. This obviously isn’t much of a benefit if you’re away from your desk. It does alleviate issues with mis-dialed numbers and makes it a little less of a hassle for dialing when it’s an option.

Our Adhearsion Environment

I mentioned in my last post that I’ve been working mostly for Power Home Remodeling Group for a while. Primarily on the app that runs their business. We call it Nitro.

Initially, I plan to focus on our integration with Adhearsion. I’ll keep things to a functional level rather than getting too in-depth technically.

If you’d like more technical details about a topic leave a comment. I can get into specifics if there’s enough interest. The simple reason is that it takes longer to write a post with code examples. I think there’s sufficient value in describing what’s possible at a business level.


Our production environment lives on a number of virtual servers hosted in our corporate hosting center. Our current setup includes five web servers, five transaction servers and a single server which runs Asterisk and Adhearsion.

The transaction servers run cron jobs, background processes and our call loop which feeds our phone system with numbers to be called. More on that in a future post.

On our Asterisk/Adhearsion server we also have a separate application running on it we call Talkbox. This is a custom Adhearsion app with PowerHRG’s business logic. It runs as a service and communicates back and forth with our main Nitro application via API calls.

So what does Power Home Remodeling Group do?

PowerHRG sells windows, siding, doors, roofing and a few other products. We make a lot of phone calls to do that.

The majority are appointment confirmations and marketing calls. Around 48,000 outgoing calls every day. Yes. All with a single Asterisk/Adhearsion server.


Adhearsion is described as an

open-source voice application development framework.

It actually does a bit more. We’ve tied it into our LDAP server so our phone systems and applications use the same info and security. Adhearsion can even integrate over XMPP (Jabber) to support stuff like instant messaging.

In my next post, I’ll start talking about some of our specific uses of Adhearsion. Stay tuned.

Happy New Year 2015

Now that 2015 is here I’m feeling more and more like a bad parent to my site. My new resolution is to change that.

Actually, my full resolution is to get into a daily practice of writing. Writing creatively was something I really loved doing at one point and I want to start that again. While writing somewhat technical blog posts for this site isn’t out of my imagination, writing is writing. So I plan to mix it up.

A long time ago…

Where did this come from? I’ve always loved reading. I’ve always loved comic books and would go to local conventions. One artist who worked for a company called Comico in the late 80’s frequented those local conventions. His name was Reggie Byers. For Comico, he was doing the art for some of their line of Macross comics. He started his own company and comic around a character named Shuriken.

For the hell of it, I ended up writing scripts for a three issue story arc for Shuriken and just sent it to him. He liked it and wanted me to write more. In fact, Reggie was starting up a second series entitled The Blade of Shuriken and he wanted me to the be writer. Images are hard to find, but here’s one that has my name in the credits!

Unfortunately, the series was short lived. One of the victims of an economic bubble bursting within the comics industry. I ended up writing about twelve scripts. Only four were published (Blade of Shuriken #2-#5). Regardless, I had a lot of fun writing them. I thank Reggie for giving me the opportunity. It was a very exciting experience for me.

This year for this site…

Getting back to this technical site, I still am primarily a Ruby on Rails coder. A couple of side projects with PHP, but primarily Ruby.

Back in 2007, I started working with a company in the northeast, Power Home Remodeling Group. At the time, they ran their business off a mixture of Excel spreadsheets and a Microsoft Access-based application that would have problems if more than one person was in it at the same time. I’m involved in writing the software that has taken them from that system, already having growing pains, to what is now a web-based application servicing over 1,300 employees company-wide. While I started alone, we’ve grown a small team of developers, but it’s still hard to keep up with the demand for what they want and need.

PowerHRG doesn’t sound like an exciting company since they sell windows, roofing, siding and a couple of other products. But the complexity of the business and the technology required to support it can be quite interesting. I’m going to write about some of that over this year.

What I’ll be focusing on in my first series of articles will be on something I don’t recall reading a lot of blog posts about in the recent past: telephony. Power’s app has strong ties to their phone system. The interface for this is Adhearsion. We are lucky enough to work closely together with the awesome team at Mojolingo, who are the current maintainers of the Adhearsion codebase.

Stay tuned…

What I’ve been working on

For the past few years I’ve been working with Stephen P. Anderson on a few things.

The Mental Notes card deck is a brainstorming tool. “Each card describes one insight into human behavior and suggests ways to apply this to the design of Web sites, Web apps, and software applications.”

In addition to those, we’ve launched a few sites for a client.

After The Meeting is a site that helps you focus on what typically happens not during a meeting, but after. It helps attendees keep track of what action items they were assigned and pokes you at times to get them done if you’re running late. It’s particularly helpful to project managers who can, at a glance, get status updates. And after a few weeks, you get a report card report telling you how successful everyone’s been on what they committed to.

Part of After the Meeting is a way to make a formal agreement with someone. This is a bit stronger than a simple to-do item as there are stakes for the success or failure of the task.

Promise Play takes those formal agreements out of meetings so it’s just you and one of your Facebook friends. We’re still polishing it up, but it’s free to use.

Other than that, I’m slowly working on a redesign of this site and looking forward to a project that’s been on the back-burner for a little while.

Deploying a Rails app with Thinking Sphinx

If you’re using or investigated full-text search options you’ve likely come across some really great comments about Sphinx. It’s fast and has a lot of great features.

For a Rails application, there are a few plugins which make it easy to use Sphinx. The main two at this time are UltraSphinx and Thinking Sphinx. I chose Thinking Sphinx for my project mostly because it can keep the Sphinx indexes current in close to real-time as things are added to the database using delta indexes. UltraSphinx can use delta indexes, but doesn’t seem to be as real-time at updating them as ThinkingSphinx. If I’m wrong, please correct me.

Now that I’m using Thinking Sphinx I eventually had to deploy it. Since I didn’t find much info about deploying it using “Capistrano”:http://capify.org here’s what I did to get deployments running smoothly.

Sphinx Index Location

While Sphinx is fast, you still probably don’t want to have to re-create your indexes on every deployment. I have my indexes getting created into my shared path and an :after_symlink task deals with making sure my app is pointing to the right place.

  desc "Re-establish symlinks"
  task :after_symlink do
    run <<-CMD
      rm -fr #{release_path}/db/sphinx &&
      ln -nfs #{shared_path}/db/sphinx #{release_path}/db/sphinx

Stopping and Starting Sphinx

Thinking Sphinx follows convention rather than configuration. Before any index Thinking Sphinx re-creates your configuration file based on the information in your models. Since it re-creates it, I have it ignored in my repository. As such, the configuration file does not exist on a fresh deploy.

I created some tasks to stop, start and restart Sphinx using the rake commands that come with Thinking Sphinx. One problem I ran into right away was the absence of the config/production.sphinx.conf file that’s expected when you run the thinking_sphinx:start task. Luckily, there’s another rake task called thinking_sphinx:configure which re-creates the configuration file without performing a full index.

While there is a thinkning_sphinx:restart task, that doesn’t give me the opportunity to re-create the config file prior to starting Sphinx up again.

  desc "Stop the sphinx server"
  task :stop_sphinx , :roles => :app do
    run "cd #{current_path} && rake thinking_sphinx:stop RAILS_ENV=production"
  desc "Start the sphinx server" 
  task :start_sphinx, :roles => :app do
    run "cd #{current_path} && rake thinking_sphinx:configure RAILS_ENV=production && rake thinking_sphinx:start RAILS_ENV=production"
  desc "Restart the sphinx server"
  task :restart_sphinx, :roles => :app do

Restarting the App

Now that the Sphinx tasks are there, you just have to update the applications’s :restart task to restart Sphinx when you restart your app.

  desc "Restart mongrel"
  task :restart, :roles => :app do
    sudo restart_mongrel

A full version of the example deploy.rb is pastied.

How to get a good designer to do something within your budget

I overheard someone talking about not being able to find a designer to help them with a web project for less than a certain hourly rate. It’s not the hourly rate that matters, it’s the overall cost.

Here are some tips for getting a good designer to help you out regardless of cost:

  • It’s who you know. You need to get out and meet with designers. In the Dallas area, Refresh Dallas is a good venue for this. Sometimes designers need development work, too, so maybe you can sync up on something. Especially if you’re around a big city, there will be a similar group.
  • Better yet, work with good designers. If you do good work, they’ll remember and want to work with you more and give you some slack on price when you need it. They’ll recommend you to others, too.
  • Tell them what you’ve got to spend up front. They’ll tell you what they can do. It’s possible all you need is a one page template and if you ask them to simply design a site, that typically entails much more effort. Some of the better designers I know ask for a budget outright so they know what they can offer within the constraints.
  • If they can’t be of service, ask if they know anyone who could. Designers often know other designers.