This action might not be possible to undo. Are you sure you want to continue?
In order for an application to send a SMS, it generally has to communicate with a Mobile Network Operator (MNO) over the Internet. To understand in more detail consider the following example. A Media service provider wants to send a program timetable as an SMS to its end customers. The application is running on a Linux based java application server. One of the main requirements is to send an SMS through an SMSC, and this SMSC service is provided by one of the mobile network operators. Before diving deeper into the subject, let's go through some of the technical jargon. SMSC: stands for the Short Message Service Center and is part of the telecommunications network to deliver the SMS. It enables the external application to integrate via the Internet. • SMPP: stands for the Short Message PeertoPeer (SMPP) and it’s a protocol which is used to exchange the SMS between SMSC and external entities like business applications. There are various versions of SMPP, including 3.3, 3.4 and 5.0. In this article version 3.4 is used. (Means the SMSC supports the version 3.4, more details from http://opensmpp.logica.com/ • Kannel SMS gateway it is an open source WAP and SMS gateway used to provide short message service (SMS). Currently it runs on the Linux platform and provides a high level HTTP service for submitting SMS requests. It supports many protocols to connect with the SMSC and even supports the GSM modem. (For more details see www.kannel.org) Now back to our example This media service provider wants to connect with the SMSC by using the SMPP protocol. Implementing the protocol takes some time, so why reinvent the wheel? Therefore the service provider plans to use the Kannel SMS gateway to connect with the SMSC. At the development phase it is important to test the SMSC integration, but most of the time it won't be possible to test with the production SMSC and of course each SMS is an added cost. Therefore to test the integration an SMPP SMSC simulator will be used. From http://www.seleniumsoftware.com/downloads.html it's possible to download a free simulator. This simulator is a Java application and by default it will be running on port 2775. It is configurable from the property file SMPPSim/conf/smppsim.props.
Setting up the Kannel Server
Let's now look into setting up the Kannel Server. Kannel is deployed on Linux systems (at the moment Windows platform is not supported; possibly using a virtual machine it could be run under Windows). Please be sure to include mysql support (or any other database support) when compiling the Kannel. It will be used to store the intermediate message between Kannel and SMSC specially the SMS delivery receipts. Let’s assume, Kannel is deployed in /usr/local/kannel. Actually Kannel is a composed of 3 main components which are bearerbox, smsbox and wapbox. To run the Kannel, following 2 components must be started in a sequence. • /usr/local/kannel/sbin/bearerbox (This handles the connections with SMSC or gsm modem) • /usr/local/kannel/sbin/smsbox (This provides an http service to send the SMS
. When using MySQL the following properties should be added in the configuration file. All these fields will have the datatype as varchar. Then kannel will store the results in memory and return it to the application when it's requested via callback URL.DLR table structure group = dlr-db id = mydlr table = kannel_dlr field-smsc = smsc field-timestamp = timestamp field-destination = destination field-source = source field-service = service field-url = url field-mask = mask field-status = status field-boxc-id = boxc_id Table kannel_dlr will have field from SMSC to boxc_id. Configuring the core (bearerbox core) group = core admin-port = 6000 smsbox-port = 6001 admin-password = 'mysecrect' dlr-storage = mysql It has more properties such as allowed IP list and other security related settings. It's more reliable to use a database in the production. This configuration file will have multiple sections. #--.mysql connection group = mysql-connection id = mydlr host = dbhost username = user password = secrect database = kannelDb max-connections = 1 #---. but for testing it could be set to dlr-storage = internal. We'll look into a sample configuration file (mytestkannel.conf). This information will be stored in a database (according to the configuration it will be in MySQL) for an intermediate use and will be processed again when the application requests for a delivery report. Both these boxes need a configuration file which contains the setting details. let's go through the first section. When Kannel submits the SMS to the SMSC. (More details can be retrieved from the Kannel documentation/user guide). 1. When running for production care should be taken to set it up appropriately for your application dlr-storage = mysql means to store the intermediate process results in a table and read it back when its needed. or any other information as a delivery report back to the Kannel. then SMSC will return the results whether the SMS has been delivered or lost.through the bearerbox) First bearerbox should be started then smsbox should be started.
When it ready for production. (It can be done in SMPPSim/conf/smppsim. This section will contain all the necessary details for the smsBox to run. Configuring the smsBox In the same configuration file. For testing we’ll be setting up with the SMSC simulator. Let’s look into setting up the SMSC. Log files and console will display errors when they occur. Kannel components have been started.host.conf then .com</a> port = 2775 receive-port = 2775 smsc-username = 'smppclient' smsc-password = password system-type = 'VMA' service-type = 'test' interface-version = 34 address-range = '' msg-id-type = 0 Username and password can be changed in the SMPP SMSC simulator.host. More details from the Kannel user guide. Make sure to set the log level to "debug" when developing. then we have to only change the IP address or port. First start the SMPP SMSC simulator.conf. Kannel will send this message every 30 second. Next start the Kannel components in following order.com" target="_blank">test. client and the SMSC will be sending enquire_link messages to check whether either end are active./smsbox mytestkannel. Let's fire up the engines. 3. According to the SMPP protocol. Now we have set up Kannel to use the SMSC simulator. we'll be adding another section.This is connection to smpp simulater group = smsc smsc = smpp smsc-id = testsmsc host = <a href="http://test.com</a> sendsms-port = 6013 global-sender = 6013 We have to setup a user/password. Simulator has started. Connecting to the SMSC Kannel bearerbox has to connect with the SMSC. . #---.host. group = smsbox bearerbox-host = <a href="http://test.com" target="_blank">test.host.props). which will be used to access the http service to submit the SMS. By default. group = sendsms-user username = peter password = ford default-smsc = testsmsc Starting the server Now the entire configuration is done.2./bearerbox mytestkannel. . SMPPSim/startsmppsim. Ok. Ok.sh Make sure Java path is setup.
//callback URL is <a href="http://test. in.com/dlr?type=%d&receiver=%p&reply= %A&time=%t&usr=%n&message=%b" target="_blank">http://test.host.out. Binary message could be OTA configurations. param. param.toString()).println('Submit request=' + param.Depending on the SMSC. param. Now we write some simple Java code which is going to send the SMS.append( 'Hello mobile world'). etc.append('&dlr-mask='). //its a bit mask value or simply we can set it to 1 to receive the successful delivered SMS.append('%0B%05%04%0B%84%00%00%00%03%6E%03%01').host.toString()). When sending the binary message. //mobile number which will receive the SMS Note that we can send normal text messages as well as binary messages.append('1')..append('&text=').host. //Its the encoded URL which informs the kannel that the delivery message should be submited to the following callback URL. // any alphanumeric address param. It will be using the HTTP GET method to submit the request.append('cust'). URLConnection con = aPortUrl. Now we have submitted the SMS request and the delivery receipt will be delivered by replacing the values in the callback URL.append('&udh='). (See this article for more details on sending binary messages). it should be changed. result=' + aResult. Let's look at sending a normal text message message. //it could contain 256 chars param.append('47xxxxxx').append('7').append('%01%06%2F%1F%').append('?username=peter'). WAP push.append('&to='). Sending the request: URL aPortUrl = new URL(param. param.com/dlr?type= %d&receiver=%p&reply=%A&time=%t&usr=%n&message=%b</a> //More information form the documentation System..readLine()) != null) aResult.append('&text=').com:6013/cgi-bin/sendsms" target="_blank">http://test.close(). StringBuffer aResult = new StringBuffer(). param.append('<a href="http://test. This callback URL is a Servlet which will simply get the parameter and .com:6013/cgi-bin/sendsms</a>'). param.host. System. String inputLine. BufferedReader in = new BufferedReader( new InputStreamReader(con. while ((inputLine = in.append('&dlr-url=').append(inputLine).append('http%3a%2f%2ftest%2ehost%2ecom %2fdlr%2fdlr%3ftype%3d%25d%26receiver%3d%25p%26reply%3d%25A%26time%3d%25t%26usr %3d%25n%26message%3d%25a'). //Its the DCS field and setting it to be 8bit binary message Now setting the delivery report callback URL: param.out.append('&coding=').println('. StringBuffer param = new StringBuffer().append('&from='). param.toString()). ringtones .openConnection().getInputStream())). param. remember to encode the message.append('&password=ford').
Hope it helps to start using these technologies. This is a just a scratch on the surface of Kannel. . SMPP and SMSC.value from the URL and logged it to a file or database for tracing purpose.
This action might not be possible to undo. Are you sure you want to continue?
We've moved you to where you read on your other device.
Get the full title to continue listening from where you left off, or restart the preview.