Showing posts with label smsbox. Show all posts
Showing posts with label smsbox. Show all posts

Thursday, 18 October 2012

Installing and Configuring Kannel OpenSMPPBox


Similar to SMSBoxOpenSMPPBox is a type of box that runs on top of an existing Kannel installation.  However this is a special type of box that will listen to incoming SMPP Connections to allow messages to be sent to and from SMPP Clients allowing you to act as an SMPP Provider.

In this post I will provide basic configuration for installing the additional OpenSMPPBox on top of an existing Kannel Installation. You can find how to install Kannel in my previous post, you must however install this on top of the latest version of kannel, found here.

The user guide for Kannel can be found at http://www.kannel.com/userguide.shtml and the user guide for OpenSMPPBox can be found at http://www.scribd.com/doc/89943592/Opensmpp-Userguide .

1. With Kannel 1.5.0 Installed and working, download the OpenSMPPBox source code, available from multiple sources:

https://redmine.kannel.org/projects/smppbox/repository
or 
https://github.com/pruiz/kannel-opensmppbox

The easiest step is to download the zip file from the above github url:

wget https://github.com/pruiz/kannel-opensmppbox/zipball/master

2. Extract the archive 


unzip master 

3. Change to the directory to compile


cd pruiz-kannel-opensmppbox-b6712e2/

Use the following steps to install:


./configure --prefix=/usr/local/kannel --with-kannel-dir=/usr/local/kannel  (specify Kannel base install directory)

NOTE: [ If you receive error like:


/root/pruiz-kannel-opensmppbox-b6712e2/gw/box-dlr.c:178: undefined reference to `dbpool_destroy'
collect2: ld returned 1 exit status
make[2]: *** [opensmppbox] Error 1

you will need to change to the source directory for your base Kannel installation and re-compile with database support 

./configure --with-mysql or --with-pgsql 
make
make install


Then continue in the OpenSMPPBox directory:

cd pruiz-kannel-opensmppbox-b6712e2/


./configure --prefix=/usr/local/kannel --with-kannel-dir=/usr/local/kannel  (specify Kannel base install directory)
make
make install

You'll notice a new file created in usr/local/kannel/sbin/opensmppbox 

4. Change to the kannel directory

cd /usr/local/kannel

Create a new opensmppbox.conf file with the following content, this is basic without database support. Full parameter list can be found in the user guide. :


group = core
dlr-storage = internal

group = opensmppbox
opensmppbox-id = SMPP
opensmppbox-port = 2775
bearerbox-host = 127.0.0.1
bearerbox-port = 13001
our-system-id = SMPP
smpp-logins = /usr/local/kannel/smpplogins.txt
use-systemid-as-smsboxid = true
route-to-smsc = smsc1 (the smsc you want to send to in kannel.conf, could be your own http smsc)
log-file = /usr/local/kannel/logs/smppbox.log

4. Create an smpplogin.txt file in the specified path above. This will define who can connect over SMPP, refer to the guide for more details. A sample line could look like:

testname testpassword smsc1 *.*.*.* 

This can contain an endless list of entires.

5. Ensure kannel base installation is running. Now run OpenSMPPBox using the following commands:

/usr/local/kannel/sbin/opensmppbox  opensmppbox.conf 

If OpenSMPPBox is running correctly and ready to accept connections the log file will show the following:


 INFO: Waiting for SMPP connections on port 2775.

You box is now ready to accept connections on port 2755 from users defined in smpplogin.txt file.

For further reference and exploration, the user guide for Kannel can be found at http://www.kannel.com/userguide.shtml and the user guide for OpenSMPPBox can be found at http://www.scribd.com/doc/89943592/Opensmpp-Userguide .

Thursday, 1 September 2011

Installing and configuring Kannel SMS Gateway


Kannel is an open source SMS and WAP gateway. It's freely available software used by operators, carriers, mobile aggregators and other users to send and receive SMS messages and mobile content.
Further details of Kannel can be found at Kannel's Website . There are many different ways to implement Kannel so it depends what your need is.

A lot of users setup Kannel to connect to HTTP and SMPP providers in order to send SMS messages. In this post I will show how to install, configure and send your first SMS using the gateway

For reference, the user guide can be found at http://www.kannel.com/userguide.shtml

1. Firstly ensure all software requirements are installed and then download the source from the Kannel Download site.

wget http://www.kannel.com/download/1.4.3/gateway-1.4.3.tar.gz

2. Extract the archive file to directory.

tar -xzvf gateway-1.4.3.tar.gz

3. Change to the directory to compile

cd gateway-1.4.3

We want to install to /usr/local so we complete the following steps


./configure  ---prefix=/usr/local/kannel
make
make install

4. Change to the new directory that has been created

cd /usr/local/kannel

5. All the files for kannel are now located in this directory. In order to get Kannel up and running quickly we need to create a new config file.

Refer the the user guide for all parameters available, however the following configuration file is useful for setting up a main 'bearerbox' with an 'smsbox' in which we can send messages to an SMPP carrier.
Substitute fields highlighted with you own details. Example files can also be found in the original source files.

vi kannel.conf

group = core
dlr-storage = internal
admin-port = 13000
admin-password = password
status-password = password
admin-allow-ip = ''
smsbox-port = 13001
log-level = 0
log-file = "/usr/local/kannel/logs/kannel.log"
box-allow-ip = "127.0.0.1"

group = smsbox
smsbox-id = BOX1
bearerbox-host = 127.0.0.1
sendsms-port = 13013
log-file = "usr/local/kannel/logs/smsbox.log"
log-level = 0
access-log = "usr/local/kannel/logs/access.log"

group = sendsms-user
username = user1
password = password1

group = smsc
smsc = smpp
smsc-id = SMSC1
host = 111.111.111.111
port = 12345
smsc-username = my smsc details
smsc-password = my smsc password
address-range = ""
system-type = ""
transceiver-mode = true


6. To start the gateway run the following command

/usr/local/kannel/sbin/bearerbox kannel.conf

ensure kannel.conf is replaced with the full path to you configuration file.

Start the sms box also

/usr/local/kannel/sbin/smsbox kannel.conf

8. You can view the status of the gateway by typing the following in a browser

localhost:13000/status?password=password

7. To test the functionality of the gateway, in a browser send a new sms message to the gateway using the following url:

http://localhost:13013/cgi-bin/sendsms?username=user1&password=password1&to=0123456789&from=4444&text=testmessage


 For further reference, the user guide can be found at http://www.kannel.com/userguide.shtml