Step By Step Guide to Deploy SMS Gateway


Pre Reading

SMPP Protocol

Pre Requisite of Deployment

  1. Web Server – IIS 7 (or higher) or Apache 2 (or higher)
  2. PHP with MySQL support

Package Structure

  1. SMPP Client
    1. Application Binary
      1. Windows Version: smppapp.exe
      2. Linux Version (Binary 32 bit): smppapp
      3. Linux Version (Binary 64 bit): smppapp
    2. Configuration File
      1. conf.ini
  2. Content Delivery Engine
    1. Web Service
      1. cde.php
    2. Configuration File
      1. commoncde.php
  3. SMS Sending Web Service
    1. Web Service
      1. SendSingleSMS.php
      2. SendMoltipleSMS.php
    2. Configuration File
      1. config.php
    3. Supporting Files
      1. commonlib.php
  4. O&M Panel
  5. Database

Directory Structure

This document describes the general steps of deployment. Thus it will describe the general steps only using some standard terminology for both Windows and Linux machines.

The following Symbols will be used throughout the document. These Symbols have to be translated for specific deployment scenario as applicable.

No Symbol Description Example
1. $SMPPapp Path to the SMPP application and conf.ini For WindowsD:SMPPFor linux


2. $SMSGW_WS Path to SMSGW Web Services folders under which cde.php and related files will be located. The path is with reference to the environment (can be test or production) For Windows, C:\inetpubwwwrootSMSFor Linux, /var/www/html/SMS
3. $SMS_DB Name of the SMSGW Database smsgw_2_0
4. $SMS_DB_PATH Path to MySQL Databases MySQLDatabase
5. $SMS_DB_HOST IP of the database server where the Database will be running X.X.X.X

Deployment Steps

The deployment can be done following the steps mentioned below sequentially in the desired environment.

  1. Application Deployment
    1. Copy the application and conf.ini to $SMPPapp
    2. Create a folder named “Log” in $SMPPapp
    3. Change the “conf.ini” file as required (described more detail in later)
  2. Web Service Deployment
    1. Copy the folders “SendSMS” and “CDE” to $SMSGW_WS
    2. Change the Database information in “commoncde.php” under “CDE” folder
    3. Change the parameters in “config.php” under “SendSMS” folder
  3. O&M Panel  Deployment
    1. Copy the folder “smsgateway” to $SMSGW_WS
    2. Change the parameters in “config.php” under “smsgatewayConfig” folder
  4. Database Deployment
    1. Execute SMSGW database script in $SMS_DB to $SMS_DB_HOST

Configure SMSGW

  1. Change in config.ini


x.x.x.x   xxxx                  // IP of the Operator’s SMSC and Portx.x.x.x   xxxx                 // IP of the Operator’s SMSC and Portgr19088 gt19088 9               // User Name, Password and Protocol of SMPP Gateway

gr19088 gt19088 0              // User Name, Password and Protocol of SMPP Gateway

1 0 1 1 5 0

Get /smsgwcde_test/cde.php?mn=%s&msg=%s&sc=%s&rempc=%s HTTP/1.1     //cde.php location

HOST: localhost      // Host address of cde.php

80                             // Port number of the host     //  Host IP address     // Host Address

root                       //Database user name

mysqlpass           //Database password

smsgw_2_0      //Database name




Get /smsgwcde_test/cde.php?mn=%s&msg=%s&sc=%s HTTP/1.1

HOST: localhost


50           //TPS (Milisecond)

3              //Retry Count

1              //Long SMS

order by refID asc limit 200

LOG/     //LOG directory



Service Temporarily Unavailable


10  //Retry Delay in Min

1                                                                                                                              //SNMP_ENABLED     //SNMP_MANAGER_HOST_IP

162                                                                                                         //SNMP_MANAGER_PORT_NO                   //SNMP_LOCAL_IP

0                                                                                                              //SNMP_LOCAL_PORT                  //SNMP_AGENT_IP

0                                                                                                                              //LOG_LEVEL

0                                                                                                                              //LOG_DESTINATION                                                                  //LOG_HOST

3470                                                                                                       //LOG_PORT

SMSGW                                                                                               //LOG_COMPONENT

SMSGW1                                                             //LOG_INSTANCE

120                                                                         //DELIVERED_TIME_DELAY          seconds

0                                                                              //DELIVERY_RECEIVED_ENNABLE

SUBMITTED                                                        //UPDATE_STATUS

  1. Change in “commoncde.php”


<?PHPerror_reporting(0);function getmyserver(){

return “localhost”;           //Database Host IP


function getmyid()


return “user”;   //Database user name


function getmypass()


return ” mysqlpass “; //Replace with your password


function getmydb(){

return “sms_gateway”;



  1. Change in “config.php”


$dbtype=”mysql”;$Server=”localhost”;     //DB Host name$UserID=”user”;            //DB user name

$Password=”mysqlpass”;  //DB user password


How to run

From Linux console

  1. Go to $SMPPapp directory
  2. chmod 777 smpp
  3. Type ./smpp
  4. Press Enter

Check process

  1. Type ps –ef|grep smppapp in console
  2. Following output will be shown in screen

SMSGW1:[~]# ps -ef | grep smpp

root     13306 13304 95 01:19 pts/0    16:21:59 ./smp

root     18826 18607  0 18:23 pts/1    00:00:00 grep smpp

Here Green line shows that smpp application is running


 From webmin

    1. Create three custom button like following.

  1. Click Start->SMSGW-1-101

Check process

  1. Click SMSGW-Status
  2. Following output will be shown in panel

From Windows console

  1. Go to the $SMPPapp directory
  2. Double click the smppapp.exe

  1. Go to Task manager
  2. Click process tab
  3. Then you can see the process name as the below screenshot.

From AppMonitor

    1. Configure smppapp in AppMonitor as follows:

  1. Click Star button.

How to test SMS Gateway

We can send SMS through following two way

  1. By inserting text directly in smsoutbox
  2. Through following API


Following is an example of sending sms by calling API

We need to hit following link in browser|Test

smsoutbox table entry

Further Readings

  1. SMS Service Development Fundamentals
  2. How to create custom button in webmin
  3. How to configure AppMonitor to run an application
[feather_share size="24" show="twitter, google_plus, facebook, linkedin, mail " hide="reddit, pinterest, tumblr"]

We love to hear from you