Instant Messaging and SMS gateway by scd34940


              Instant Messaging and SMS gateway

                                            Antohi Claudiu
                                           Bejan Alexandru

     Babes-Bolyai University, Faculty of Economic Science and Business Administration

                                       Dumanovschi Aurelian

                  Dunarea de Jos University Galati, Faculty of Computer Science
                                          Dumitrache Mihai
         Politehnica University of Bucharest, Faculty of Automatic Control and Computers

Cornelia Tudorie Lecturer, PhD

 is an instant messaging and two-way SMS gateway for our customers web
application and/or stand-alone application. With our product, developers can develop applications
that are using one of our supported instant messaging networks and SMS number to interact with their
          For example, we have developed a twitter client using supported instant
messaging clients. Using our API we were able to interact with users on their instant
messaging client, so in the end we were able to give them all the tools to check their friends updates
and post tweets on But, using SMS service, we are offering a twitter update
service by SMS on a local phone number that is also available internationally.
 is an easy to use gateway for developers, but also for electronic marketers to
apply their interaction ideas on client’s instant messaging software and mobile phones.
          Our application,, is now supporting Yahoo Messenger, Windows/Microsoft
Messenger and Jabber/Gtalk and for the SMS service is using the Romanian Orange carrier, which is
available internationally.

1. Introduction
          These days it’s hard to have an innovative start-up with monetizing possibilities that
can involve a large number of users all across the world. We thought and we studied: what is
one of the most used interaction capable software’s on any computer? The answer was
simple, Instant Messengers.
          More and more companies are using nowadays Instant Messaging services because
they are free; this turns them into the main communication tools with their clients using voice
or just plain text. So, if everyone is using them, why for example don’t we give them some
productivity tools inside Instant Messengers?
          Of course, this is not only a corporate tool; everyone who has an Instant Messaging ID
can be in the target audience of an application developed for Instant Messaging.
 aims to introduce on instant messaging mass interaction capabilities so
any developer can build or integrate into their applications interaction trough easy to use

2. Interaction on end-user machine
          To prove how this works, we already built an application that uses
          Our first application is (already available at; using
every user will be able to use twitter in their favorite Instant Messaging platform. The flow is
simple, a user has to pair his twitter username and Instant Messaging ID and just in a few
seconds he will start receiving tweets right in his IM window from one of our robots.
          With just some simple commands everyone will be able to do common twitter tasks:

             •   t [status] - to tweet this status
             •   d [username] [message] - to dm that fellow twitter
             •   d [username1,username2,username3,...] [message] - to mass dm
             •   follow [username] - to follow that user
             •   unfollow [username] - to “unfollow” the user
             •   mute - to stop receiving friends updates
             •   talk - to start receiving friends updates again

          For example, if a user wants to tweet about something he will just send a message on
IM to our robot “twipme” on Yahoo Messenger like this “t Hello World!” and will
post on twitter the message “Hello World!”.
        So, is a service built on API and Twitter API. All the messages
collected by IM robots are sent to their service address according to every service
name, in this case to who knows each message from what IM ID is coming and to
what twitter account has to apply those requests. is using as well SMS capabilities, using the same commands like
on Instant Messaging users can post tweets right from their mobile phones by sending a SMS
to our local number with a message in the same format: “t Hello World!”.
        We think that there are a lot of possibilities to implement services just like this one
with just a little bit of creativity.
        To build applications just like we have developed, a gateway for
Instant Messaging and SMS.

3. brief is basically divided into the web service core and the user interface. For
example, a developer will first interact with our application using his browser to access his
dashboard and afterwards, using our easy to use API, he will start develop his own
        Every user has the ability to login into his dashboard to:

            •    See his authentication key
            •    Server URL
            •    Account services statistics
            •    Account robots statistics
            •    Change/Add services
            •    Change/Add robots

        Regarding the API, developers have the ability to:

            •    Send and receive messages from IM and SMS
            •    Make operations on the robots’ contact list
            •    Stop/Start robot
            •    Change robots’ status
4. System architecture

       As mentioned before, is divided into user interface and system core both
interacting with each other but also with the MySQL database.

4.1.1 Framework user interface is based on Symfony framework. Also we did our best to
make it easy to use, so we will turn this into a quick development tool.
       Symfony framework is designed to optimize the development of web applications.
For a shorter development time of complex applications, it separates the business rules, server
logic and presentation views. It contains, also, numerous tools and classes that automate
common tasks, so that the developer can focus on the specifics of the application. It is
database engine-independent, and it is simple to use, in most cases, but still flexible enough to
adapt to complex cases.
       Symfony uses the MVC architecture. Model–view–controller (MVC) is an
architectural pattern used in software engineering. Successful use of the pattern isolates
business logic from user interface, resulting in an application where it is easier to modify
either the visual appearance of the application or the underlying business rules without
affecting the other.

The MVC structure:
       It’s the domain-specific representation of the information on which the application
operates. Domain logic adds meaning to raw data, transforming it into information (for
example, the users total, or total uptime for a server).
       It renders the model into a form suitable for interaction, typically a user interface
element. Multiple views can exist for a single model for different purposes.
       The controller processes and responds to events (user actions) that can do some
changes on the model.

4.1.2 Web interface structure
       After a simple presentation website, and a quick registration procedure (as our
application is in beta, we are not currently charging for our services) developers may login
into their dashboard.

       a. Dashboard

       On the first page, after logging in you are presented with charts with statistics about
       servers, robots or services, but also your 256 bit API key and Secret key.

       b. Services

       The services section is designed so developers can add and maintain the connection
       between their application and the selected robot or SMS number.

       c. Messengers

       This section is a manager for all the running Instant Messaging IDs on our servers but
       also for the active mobile phones connected to the system.
4.1.3 Charts
       Charts are a very important feature inside users control panel because they show the
evolution and how end-users are using the application. As a solution for this problem we have
used XML/SWF Charts.

      XML/SWF Charts is a simple and powerful tool to create attractive charts and graphs
from XML data. It uses Adobe Flash to create the charts, and XML could be created manually
or dynamically from any scripting language.

4.2 System Core uses a distributive system. The core web service and dashboard is
developed in PHP over Symfony and the Dispatcher servers, the ones that manage the IM
clients, is developed in Java, as well as the IM clients and SMS platform.
       At startup each Dispatcher queries polls the core service for it’s configuration and it’s
IM clients’ data. The core keeps track of which instances are on and if some clients are off it
tries to redistribute them to other running instances so that the downtime is reduced.

4.2.1 Java

       Java is a high-level programming language, developed by Sun and released in 1995 as
a core component of Sun Microsystems' Java platform. The language derives much of its
syntax from C and C++ but has a simpler object model and fewer low-level facilities.
       One characteristic of Java is portability, which means that computer programs written
in the Java language must run similarly on any supported hardware/operating-system
       The syntax of Java is largely derived from C++. Unlike C++, which combines the
syntax for structured, generic, and object-oriented programming, Java was built almost
exclusively as an object-oriented language. All code is written inside a class and everything is
an object, with the exception of the intrinsic data types (ordinal and real numbers, boolean
values, and characters), which are not classes for performance reasons.
4.2.2 Information flow inside the system
5. API
        Each user will be provided with two 256 bits keys, an API key and a secret key. The
API key it is transmitted clearly and identifies the request. The secret key signs all API
requests and it is used to validate messages coming from users.

        To communicate with developers have 3 classes of methods:

                •     paip.msg – to send messages. Contains paip.msg.send and
                • – for contacts operations. Contains,
                •     paip.messenger – for operations regarding messengers. Contains
                      paip.messenger.status, paip.messenger.start, paip.messenger.stop,
                      paip.messenger.set_status, paip.messenger.get_status.

        To calculate the md5 packet signature:
                1. all request parameters are ordered alphabetically
                2. a string is built from pairs “<parameter_name><parameter_value>”
                3. the secret key is added at the beginning of the string
                4. the md5 hash of this string is calculated

        Every message has to call a certain service; identifies the requested service
in 4 steps:

              1. The first word of the message is checked into the registered services names
                    on that messenger client.
              2. If the service exists the request is forwarded to the registered service URL, if
                    not, the message continues to be checked.
              3. It is verified if a service exists with the name of that IM client.
              4. If a service exists, it is sent to the application, if not the message is dropped.

6. Instant Messaging Clients now supports 3 Instant Messaging networks: Yahoo Messenger, Windows
Live Messenger and Gtalk and as for the SMS service we provide the service on a local
Orange number.
       One major problem is the difference between IM networks; each one has its own
formatting code. Because of this we have implemented a common format language. Each
message coming from the developer application and each message sent to the application uses
the same formatting technique, but on server each message is converted to each
network standard formatting code. In the end developers will have to know only our standard
formatting language.
       Scalability is an issue, it is possible that an IM client needs more hardware resources;
this is why has the option to isolate a client on a separate machine.
       Currently every IM client supports sending and receiving messages, contact/buddy list
operations and turning that client on/off.

7. Conclusion
       We are looking forward for some improvements in the near future regarding
conference support, avatars and file transfer.
       All in all is an innovative interaction method for applications ready to use
“out of the box”. The entire supported networks sums up to 600 million registered users, so
every application will be available to that audience.



To top