I don’t know why so few of us turned up on Saturday for the VoIP Drupal hackathon. As a way to integrate voice and SMS into a Drupal site, the VoIP modules form a door throught which Drupal can move into a vast world of touch tone telephones, smart telephones, and text messaging, and therefore toward integrating a huge range of users in developing regions who use those technologies instead of desktop or laptop computers. Perhaps Boston isn’t the right place or November the right month for a workshop (although the weather was quite nice), but just four of us gathered to get the low-down on VoIP Drupal from Leo Burd, a research scientist at MIT’s Media Lab and Center for Civic Media.
Together with just a couple other developers, he is putting together modules that support Twilio and Tropo, two cloud platforms that are highly scalable and provide telephone and SMS capabilities accessible from different countries. For cases where those services are not available or desirable, VoIP Drupal provides support for Free/SWITCH, an open source telephony platform, via the Plivo communication framework/API.
Most of the time we played with the scripting language using the VoIP Drupal sandbox. The scripting language is a domain-specific language for VoIP built on top of Drupal’s module language, PHP. It has about 15 commands to create interactive calls doing such things as recording and playing back audio, handling input from the telephone keypad, managing conference calls, and sending and receiving SMS messages. A trivial script I created went like this:
$script->addSetVoice('woman'); $script->addSetLanguage('fr'); $script->addSay('Voici un message. Ne répondez pas.'); $script->addHangup();
(The scripting language requires you to create the $script object first, but the sandbox does that for you silently.) When I played this back, I got a pretty authentic sounding Parisian voice, having even the suitably cavalier tone when she told me not to talk in return (although she was tolerant of my spelling mistakes).
Of course, much richer applications are available through the scripting language. It is mostly linear, although you can define and call subroutines, you can set and retrieve variables, and there is a primitive assembly-language-like statement that lets you branch to a label based on a condition. Furthermore, the modules’ full power is available through a PHP API. The Drupal administration menu allows you to specify a script to play when the site makes an outgoing call, a script to play when someone calls the site’s phone number, and a script to play when someone sends a text message to the site’s phone number.
Burd showed off a site put together by a non-profit in Dorchester (a low-income area of Boston, Mass.) together with the MIT Center for Civic Media. A group of young students recorded some descriptions of nearby locations of interest. These locations display plaques with a phone number for the web site and an extension unique for their location. Someone dialing in hears the message and is invited to record his or her own opinions or stories about that part of the city. Attendees today were so impressed that they said, if this application could be released as a drop-in module, it would boost the use of the VoIP modules immediately.
Just a few of the many uses for VoIP in Drupal include:
The equivalent of mass mailings via voice calls and SMS, so you can send messages, for instance, to people who sign up for political campaigns
Letting visitors leave voice mail or add verbal comments to the site
Embedding a phone interface on the web page so people can make VoIP calls directly from your site, with no extra stand-alone software such as Skype
Providing a conference call service through your site
Letting people sign up for groups to receive SMS messages on chosen topics of interest
More modules are under construction; an overview is available on the Drupal web site. A messaging module lets you send a voice message that is delivered in by phone, email, or SMS, as preferred by the site’s visitor. The modules are developed for Drupal version 6, but Burd plans to create Drupal 7 modules as soon as the version 6 ones reach their 1.0 release, depending on interest from the community.
Of the underlying services supported, Twilio offers voice generation for four languages. Tropo supports voice generation for 24 languages, and can also do speech-to-text. Both of those companies have been very friendly to the VoIP Drupal project and promote it at Drupal conferences. Free/SWITCH and Plivo require you to do a lot of the work that Twilio and Tropo will do for you. But Free/SWITCH is useful for areas without Twilio or Tropo support, and for high volume use because it tends to cost less under those circumstances. Free/SWITCH also give the programmer more control over the server and allows you to run everything from the same box. Overall, VoIP Drupal represents another step toward an Internet where communicating by voice is taken for granted.
Posting in this series are listed in a bit.ly bundle.