REVISION HISTORY
EDITION | ISSUED DATE | REMARK |
---|---|---|
1st | 1st of August 2012 | Draft "XML-RPC Server version 3.12" and "XML-RPC Client in PHP version" |
COPYRIGHT
Copyright © 2012 MOBITEK System Sdn. Bhd. All rights reserved.
No part of this document may be reproduced, distributed, stored in a retrieval system or translated into any language, in any form or by any means, electronic, mechanical, magnetic, optical, photocopying, manual or otherwise, without the prior written permission of MOBITEK System Sdn. Bhd (hereafter referred as “MOBITEK”).
DISCLAIMER
MOBITEK makes no representations or warranties with respect to the contents hereof and specifically disclaims any implied warranties of merchantability or fitness for any particular purpose.
Furthermore, MOBITEK reserves the right to revise this publication and to make changes from time to time in the contents hereof without obligation to notify any person of such revision or changes.
Trademarks and Registered Trademarks Products and product names mentioned in this document may be trademarks or registered trademarks of their respective owners.
ACKNOWLEDGEMENT
(this section is intentionally omitted)
INTRODUCTION
MOBITEK® SMS Gateway Development Kit (SGDK) contains various development kits or software components. SGDK allows software developer and system integrator (SD/SI) to build SMS gateway, SMS application and SMS solution.
One of the kits or components is SMS Application Programming Interface (SMS API ). API is “a specification intended to be used as an interface by software components to communicate with each other.” (source: http://en.wikipedia.org/wiki/Application_programming_interface)
Why use API? Because “a good API makes it easier to develop a program by providing all the building blocks. A programmer then puts the blocks together.” (source: http://www.webopedia.com/TERM/A/API.html)
There are variuos forms of API:-
-
ActiveX or COM by Microsoft
-
Java API by Oracle
-
XML-RPC by Dave Winer of UserLand Software and Microsoft
Previously, MOBITEK had been focusing on developing API on Microsoft OS. Now MOBITEK has developed a new SMS API, MOBITEK® SMS API: XML-RPC that can be used in Linux OS. It is based on XML-RPC.
So what is XML-RPC? “It’s a spec and a set of implementations that allow software running on disparate operating systems, running in different environments to make procedure calls over the Internet. It’s remote procedure calling using HTTP as the transport and XML as the encoding. XML-RPC is designed to be as simple as possible, while allowing complex data structures to be transmitted, processed and returned.” (source: http://xmlrpc.scripting.com/)
BENEFITS OF XML-RPC
-
Simple to use;
-
Programming language independent – it can be used with Perl, Java, Python, C, C++, PHP and many other programming languages.
-
Remote calling – application can call the API from remote machine (PC/server), ie. make remote procedure calls over HTTP;
-
OS independent – implementations are available for Unix, Linux, Windows and the Macintosh.”
(source: http://tldp.org/HOWTO/XML-RPC-HOWTO/xmlrpc-howto-intro.html)
SYSTEM REQUIREMENTS
-
XML-RPC Server must be running in Linux OS based on Debian and Fedora.
-
XML-RPC Client can be run in any of these OS:-
-
Windows
-
Linux
-
MAC
-
-
XML-RPC Client/Application can be developed by using any one of these programming languages:-
-
PHP
-
Java
-
.Net
-
C++\
-
PERL
-
many more…
-
-
MOBITEK® Q24 SMS MODEM (TYPE SGDK)
-
SIM card
LIMITATIONS
-
SMS API in XML-RPC is a beta product, it is not meant for deployment.
LICENCE AGREEMENT
-
MOBITEK® SMS API: XML-RPC (hereafter refer as “API”) is given free of charge. It is completely free of any registration, licensing or deployment fees. It may be deployed freely for use with any third-party software, whether for commercial purpose or not.
-
The API is supplied on “as-is” basis. You must bear all risks when using it. Therefore, no warranty and support is given.
-
API must be used together with the MOBITEK® Q24 SMS MODEM (TYPE SGDK) or modem supplied by MOBITEK.
-
MOBITEK shall not be held liable for any loss nor damage as a result of using the API .
-
API is at beta stage. It is a pre-release version. It may or may not be compatible with the final version of the API will. MOBITEK may change it for the final version.
-
MOBITEK may not release a final version of this API.
-
MOBITEK may or may not provide any fix nor patch for the API.
-
It is not recommended to use the API to build an application that will be deployed.
-
It is recommended to use the API for the purpose of research and development.
-
You grant MOBITEK, without charge, the right to use, share and commercialize your feedback in any way and for any purpose.
-
MOBITEK makes no warranty, express nor implied.
-
You have the ability to give feedback about the API to MOBITEK by writing to support2010@mobitek.com.my
-
The functionality of API depends on the model of the wireless/SMS/GSM modem. Certain model does not support all the functions.
INSTALLATION GUIDE FOR XML-RPC SERVER
-
Connect MOBITEK® Q24 SMS MODEM (TYPE SGDK) with the USB port of Linux PC.
-
By default, the the modem will be connected at USB port – “/dev/ttyUSB0”.
-
-
Create a new subfolder called “SMS_Server_3.12”.
-
Unzip the zip file called “SMS_Server_3.12.zip” and copy contents to your “SMS_Server_3.12” folder.
-
To get help on using the XML-RPC Server, in command line, goto the “SMS_Server_3.12” folder and type in the command mark red:-
user@Debian:~/SMS_Server_3.12$ ./SMS_Server_3.12 -h Usage: SMS_Server_3.12 [options] Options: -h, --help show this help message and exit -i <IP address e.g. 192.168.0.1>, --ip=<IP address e.g. 192.168.0.1> set the IP address of the local host/SMS server -p <port number e.g. 8000>, --ip_port=<port number e.g. 8000> set the port number of the local host/SMS server -c <e.g. /dev/ttyS0 or /dev/ttyUSB0>, --com_port=<e.g. /dev/ttyS0 or /dev/ttyUSB0> set the com port where GSM modem is connected
-
To start the XML-RPC Server, in command line type
user@Debian:~/SMS_Server_3.12$ ./SMS_Server_3.12 --ip=192.168.10.204 --ip_port=8800 --com_port=/dev/ttyUSB0
-
“ip” is the IP address of the local host/SMS server; it is also where your XML-RPC Client must point to;
-
“ip_port” is set the port number of the local host/SMS server; it is also where your XML-RPC Client must point to;
-
“com_port” is the com port where GSM modem is connected to.
-
-
If the XML-RPC Server is configured and started, this message will appear on screen:-
Sat Jul 7 16:51:57 2012 || SMS server has established a connection with SMS modem at COM port '/dev/ttyUSB0'. Sat Jul 7 16:51:57 2012 || SMS server has been initialized at 192.168.10.204:8800. Waiting for request from client.
INSTALLATION GUIDE FOR XML-RPC CLIENT (PHP)
-
Unzip the PHP sample code that contains:-
-
CheckSMS_Index_1.0.php
-
CheckSMS_Total_1.0.php
-
Delete_SMS_1.0.php
-
Read_SMS_1.1.php
-
Send_SMS_1.1.php
-
xmlrpc.inc
-
-
If necessary, copy the XML-RPC library file “xmlrpc.inc” to the folder “lib” of PHP server.
-
Edit the IP address and port number (mark red) to match them with the XML-RPC Server.
//-------------- XML RPC Client Configuration ...................... //create connection string to SMS Server (XML-RPC Server) 5$c=new xmlrpc_client("http://192.168.0.204:8888");
-
Use any web browser to run the PHP sample code.