O'Reilly Emerging Telephony

oreilly.comSafari Books Online.Conferences.
advertisement
MySQL Conference and Expo April 14-17, 2008, Santa Clara, CA
AddThis Social Bookmark Button

Print Subscribe to Telephony Subscribe to Newsletters

Building the iotum Asterisk Module

by Todd Jefferson
06/09/2006

iotum offers a Voice 2.0 call management service, which intelligently filters, ranks, and prioritizes calls based on their relevance to you. Using your contextual information and preferences, iotum knows who's calling, whether you want to take the call, and which phone you want to use.

For gathering context, iotum currently provides a Microsoft Windows application and a Microsoft Outlook plugin, which gathers contextual information from the user's contacts, calenders, and MSN presence, and forwards that to the iotum server.

The iotum server offers an xml-rpc web service to make this information available to call routing applications such as pbxs or phone switches. The pbx or soft switch can integrate with the iotum service by making an xml-rpc call and rerouting the call based on the returned action information.

Asterisk, being open source and extensible, is an excellent place to do such an integration. Asterisk can be extended by writing a module, which is a dynamically loadable shared library that exports an expected set of functions.

figure

Figure 1. The iotum module allows Asterisk to use the iotum service to determine where to route your calls.

When a module is loaded and initialized by Asterisk it can make new functions available to the dial plan. The Asterisk administrator can then call those functions from the dial plan and add the iotum functionality for their users.

The dial plan is a domain-specific language for manipulating calls, media, and other aspects of Asterisk. Offering new functions from a module increases the power of the dial plan language, giving the administrators the ability to offer more features to their users.

The Asterisk source distribution includes an example module file in the apps directory, named app_skel.c . This is about the minimum amount of code required to have a module load into Asterisk and provide new functionality to the dial plan. However, in this file there are some techniques used for which there are now newer and easier alternatives, such as how to extract the parameters passed from the dialplan.

If you're not sure how to do something, look for similar functionality in other Asterisk applications, such as Dial (app_dial.c) or Voicemail (app_voicemail.c).

The iotum server offers an xml-rpc interface to the process call application, and to talk to it we make use of an excellent xml-rpc implementation provided by the xmlrpc-c library. Installing that library is the first step to building the iotum Asterisk module. The iotum Asterisk module also links with these libraries: dl z ssl crypto curl pthread.

After building and installing xmlrpc-c for your server and ensuring the other libraries are available, the next step is to add the iotum module to the asterisk build. After unpacking iotum_asterisk.tar.gz (which can be downloaded at http://www.iotum.com/asterisk/iotum_asterisk.tar.gz):

copy app_iotum.c into the asterisk apps directory 
     eg.  /usr/src/asterisk-1.2/apps

Modify the Makefile in asterisk-1.2/apps by

  1. Adding app_iotum.so to the APPS list
  2. Add this line:
    IOTUMLIBS=/usr/local/lib/libxmlrpc_client.a /usr/local/lib/libxmlrpc.a
    /usr/local/lib/libxmlrpc_xmlparse.a /usr/local/lib/libxmlrpc_xmltok.a
    -ldl -lz -lssl -lcrypto -lcurl -lpthread
  3. Add this new target (make sure the second line starts with a tab):
    app_iotum.so: app_iotum.o
        $(CC) $(SOLINK) -o $@ ${CYGSOLINK} $< ${CYGSOLIB} ${IOTUMLIBS}

Now compile from the main asterisk directory (eg. /usr/src/asterisk-1.2) with:

make install

There's one more important file, iotum.conf. This file lives with all of the asterisk configuration files, usually in /etc/asterisk. It looks like this:

[general]
server=https://ws.myiotum.com
port=443
pbxAccount=
pbxAccountPwd=
conferenceRooms=

The pbxAccount and pbxAccountPwd are provided by iotum when you've signed up for an account. This is the account which has the authority to ask the iotum server to process the incoming calls. To sign up for an iotum account go to www.iotum.com and follow the links under Asterisk. The conferenceRooms setting is a comma delimited list of the MeetMe rooms which have been configured, and are intended for the iotum Asterisk Module's sole use, eg. conferenceRooms=300,301,302,303.

Once this file is created, restart asterisk or connect to the asterisk CLI and load the module:

breadmaster*CLI> load app_iotum.so
 Loaded /usr/lib/asterisk/modules/app_iotum.so => (iotum Relevance Engine Application)
  == Registered application 'iotumRelevance'
  == Registered application 'iotumConfOutgoing'
  == Registered custom function IOTUMRELEVANCE
  == Parsing '/etc/asterisk/iotum.conf': Found
       > iotum: Room 300 added to conference rooms list
       > iotum: Room 301 added to conference rooms list
       > iotum: Room 302 added to conference rooms list
       > iotum: Room 303 added to conference rooms list

Pages: 1, 2

Next Pagearrow




Search Emerging Telephony

Search

Tagged Articles

Be the first to post this article to del.icio.us

Sponsored Resources

  • Inside Lightroom
Advertisement
Sign up today to receive special discounts,
product alerts, and news from O'Reilly.
Privacy Policy >
View Sample Newsletter >
  • Youtube
  • http://www.youtube.com/OreillyMedia
  • Twitter
  • Subscribe
  • View All RSS Feeds >
O'Reilly Media

800-889-8969 or 707-827-7019
Monday-Friday 7:30am-5pm PT
©2011, O'Reilly Media, Inc.
All trademarks and registered trademarks appearing on oreilly.com are the property of their respective owners.
  • About O'Reilly
  • Academic Solutions
  • Contacts
  • Customer Service
  • Careers
  • Press Room
  • Privacy Policy
  • Terms of Service
  • Writing for O'Reilly
  • Community
  • Authors
  • Forums
  • Membership
  • Newsletters
  • RSS Feeds
  • User Groups
  • Partner Sites
  • makezine.com
  • makerfaire.com
  • craftzine.com
  • igniteshow.com
  • PayPal Developer Zone
  • O'Reilly Insights on Forbes.com