Kannel WAP and SMS gateway User Manual

Open source wap and sms gateway
Table of Contents

Advertisement

Kannel 1.3.1 User's Guide
Open Source WAP and SMS gateway
Lars Wirzenius
Gateway architect
Wapit Ltd
liw@wapit.com
http://www.wapit.com
http://www.kannel.org
Kalle Marjola
Manager
Wapit Ltd
rpr@wapit.com
http://www.wapit.com
http://www.kannel.org
Andreas Fink
Chairman & CTO
Global Networks Inc.

Advertisement

Table of Contents
loading

Summary of Contents for Kannel WAP and SMS gateway

  • Page 1 Kannel 1.3.1 User’s Guide Open Source WAP and SMS gateway Lars Wirzenius Gateway architect http://www.wapit.com http://www.kannel.org Kalle Marjola http://www.wapit.com http://www.kannel.org Andreas Fink Chairman & CTO Global Networks Inc. Wapit Ltd liw@wapit.com Manager Wapit Ltd rpr@wapit.com...
  • Page 2 andreas@fink.org http://www.smsrelay.com http://www.gni.ch Bruno Rodrigues bruno.rodrigues@litux.org http://litux.org/bruno Stipe Tolj CTO & CIO Wapme Systems AG tolj@wapme-systems.de http://www.wapme.de http://www.kannel.org Aarno Syvänen Chief MMS Developer Global Networks Inc. as@gni.ch http://www.gni.ch...
  • Page 3 Lars Wirzenius, Kalle Marjola, Andreas Fink, Bruno Rodrigues, Stipe Tolj, and Aarno Syvänen Abstract This document describes how to install and use Kannel, the Open Source WAP and SMS Gateway originally developed by Wapit Ltd (now out of business) and now being developed further by the open source community, namely the Kannel Group.
  • Page 4: Table Of Contents

    5. Setting up a SMS Gateway...27 Required components...27 SMS gateway configuration ...27 SMS centers...27 Nokia CIMD 1.37 and 2.0...30 CMG UCP/EMI 4.0 ...32 SMPP 3.4 ...36 Sema Group SMS2000 OIS 4.0 and 5.0 ...40 SM/ASI (for CriticalPath InVoke SMS Center 4.x)...41 GSM modem...42...
  • Page 5 Smsbox configuration...51 Smsbox routing inside bearerbox ...55 SMS-service configurations...56 How sms-service interprets the HTTP response...62 Extended headers ...63 Kannel POST ...64 XML Post...64 SendSMS-user configurations ...65 External delivery report (DLR) storage...67 Internal DLR storage...68 MySQL DLR storage...68 LibSDB DLR storage...68 DLR database field configuration ...69 MySQL connection configuration ...70 Over-The-Air configurations ...71...
  • Page 6 C. Setting up a test environment for Push Proxy Gateway...97 Creating push content and control document for testing ...97 Starting necessary programs ...98 Using Nokia Toolkit as a part of a developing environment...100 Testing PAP protocol over HTTPS ...100 D. Setting up a dial-up line...103 Analog modem ...103...
  • Page 7 List of Tables 3-1. Core Group Variables ...14 3-2. Kannel Command Line Options...20 3-3. Kannel HTTP Administration Commands ...22 4-1. Wapbox Group Variables...24 5-1. SMSC Group Variables ...27 5-2. SMSC driver features ...49 5-3. SMSC driver internal features ...50 5-4. Smsbox Group Variables ...52 5-5.
  • Page 8: Introduction

    Chapter 1. Introduction This chapter introduces WAP and SMS in general terms, and explains the role of the gateway in WAP and SMS, outlining their duties and features. It also explains why the Kannel project was started in the first place, and why it is open source. With hundreds of millions of mobile phones in use all over the world, the market for services targeted at mobile users is mind-bogglingly immense.
  • Page 9: Overview Of Wap

    Chapter 1. Introduction intermittent bandwidth, and extremely awkward input mechanisms. Most existing HTML pages do not work on mobiles phones, and never will. WAP defines a completely new markup language, the Wireless Markup Language (WML), which is simpler and much more strictly defined than HTML. It also defines a scripting language, WMLScript, which all browsers are required to support.
  • Page 10: Overview Of Wap Push

    SMS center responsible for that number (plus possibly many others). This SMS center then sends the message onward to specified receiver in intra- or Internet, using an SMS center specific protocol. For example, a Nokia SMS center uses CIMD protocol.
  • Page 11: Features

    Figure 1-2. Logical position of SMS gateway between a phone and a content server. An SMS gateway can also be used to relay SMS messages from one GSM network to another, if the networks do not roam messages normally. Kannel works as an SMS gateway, talking with many different kind of SMS centers, and relaying the messages onward to content providers, as HTTP queries.
  • Page 12 The Gnome XML library (known as gnome-xml and libxml), version 2.2.5 or newer. See • http://xmlsoft.org/xml.html. GNU Make. • Posix threads (pthread.h). • GNU Bison 1.28 if you modify the WMLScript compiler. • DocBook markup language tools (jade, jadetex, DocBook stylesheets, etc; see README.docbook), if •...
  • Page 13: Installing The Gateway

    Chapter 2. Installing the gateway This chapter explains how the gateway can be installed, either from a source code package or by using a pre-compiled binary version. The goal of this chapter is to get the gateway compiled and all the files in the correct places;...
  • Page 14: Compiling The Gateway

    GNU autoconf, if you want to modify the configuration script. • Compiling the gateway If you are using Kannel on a supported platform, or one that is similar enough to one, compiling Kannel is trivial. After you have unpacked the source package of your choosing, or after you have checked out the source code from CVS, enter the following commands: ./configure make...
  • Page 15: Installing The Gateway

    You may need to add compilations flags to configure: CFLAGS=’-pthread’ ./configure The above, for instance, seems to be required on FreeBSD. If you want to develop Kannel, you probably want to add CFLAGS that make your compiler use warning messages. For example, for GCC: CFLAGS=’-Wall -O2 -g’...
  • Page 16 Installing Kannel 1. Download the binary RPM packet from the Kannel web site. 2. Log in as root: su - 3. Install the RPM package: rpm -ivh kannel-VERSION.i386.rpm Upgrading Kannel 1. Download the binary RPM packet from the Kannel web site. 2.
  • Page 17: Installing Kannel From Deb Packages

    cd /etc/rc.d/rc5.d/ ln -s ../init.d/kannel S91kannel ln -s ../init.d/kannel K91kannel To run Kannel as a SMS gateway you need to edit the configuration file which is at /etc/kannel/kannel.conf. In the same directory there is an example file called smskannel.conf. It has some basic examples of the configuration groups needed to run Kannel as a SMS gateway.
  • Page 18 3. Install or upgrade the DEB package: dpkg -i kannel- .deb VERSION Removing Kannel 1. Log in as root: 2. Remove the package keeping configuration files: dpkg --remove kannel 3. Remove the package completely: dpkg --purge kannel After you have installed Kannel from the DEB packages you should now be able to run the Kannel init.d script that will start Kannel as a WAP gateway.
  • Page 19 Chapter 2. Installing the gateway The documentation will be installed at /usr/share/doc/kannel/. In the Kannel documentation directory there is a html file called control.html. It is an example file that shows how to use the Kannel http administration interface. It also has a template for sending SMS messages.
  • Page 20: Using The Gateway

    Chapter 3. Using the gateway This chapter explains how the gateway core, bearerbox, is configured and used. It covers the configuration file, keeping an eye on the gateway while it is running, and using the HTTP interface to control the gateway. After this chapter there is distinct chapter for each kind of gateway use: WAP gateway, SMS gateway and combined gateway.
  • Page 21: Inclusion Of Configuration Files

    Chapter 3. Using the gateway Lines 1 and 6 are comment lines. Line 5 separates the two groups. The remaining lines define variables. The group type is defined by the group variable value. The various variables that are understood in each type of configuration group are explained below. Some variable values are marked as .
  • Page 22: Core Configuration

    Core configuration Configuration for Kannel MUST always include a group for general bearerbox configuration. This group is named as ’core’ in configuration file, and should be the first group in the configuration file. As its simplest form, ’core’ group looks like this: group = core admin-port = 13000 admin-password = f00bar...
  • Page 23 Variable admin-deny-ip admin-allow-ip smsbox-port (c) smsbox-port-ssl (o) wapbox-port (c) wapbox-port-ssl (o) Value IP-list port-number bool port-number bool Chapter 3. Using the gateway Description These lists can be used to prevent connection from given IP addresses. Each list can have several addresses, separated with semicolons (’;’).
  • Page 24 Variable box-deny-ip box-allow-ip udp-deny-ip udp-allow-ip wdp-interface-name (c) log-file log-level access-log Value IP-list IP-list IP or ’*’ filename number 0..5 filename Chapter 3. Using the gateway Description These lists can be used to prevent box connections from given IP addresses. Each list can have several addresses, separated with semicolons (’;’).
  • Page 25 Variable unified-prefix white-list black-list Value prefix-list Chapter 3. Using the gateway Description String to unify received phone numbers, for SMSC routing and to ensure that SMS centers can handle them properly. This is applied to ’sender’ number when receiving SMS messages from SMS Center and for ’receiver’...
  • Page 26 Variable store-file http-proxy-host http-proxy-port http-proxy-exceptions http-proxy-username http-proxy-password ssl-client-certkey-file ssl-server-cert-file (c) ssl-server-key-file (c) Value filename hostname port-number URL-list username URL-list filename filename filename Chapter 3. Using the gateway Description A file in which any received SMS messages are stored until they are successfully handled. By using this variable, no SMS messages are lost in Kannel, but theoretically some messages can...
  • Page 27 Variable ssl-trusted-ca-file dlr-storage maximum-queue-length A sample more complex ’core’ group could be something like this: group = core admin-port = 13000 admin-password = f00bar status-password = sTat admin-deny-ip = " * . * . * . * " admin-allow-ip = "127.0.0.1;200.100.0. * " smsbox-port = 13003 wapbox-port = 13004 box-deny-ip = "...
  • Page 28: Running Kannel

    Running Kannel To start the gateway, you need to start each box you need. You always need the bearer box, and depending on whether you want WAP and SMS gateways you need to start the WAP and SMS boxes. If you want, you can run several of them, but we’ll explain the simple case of only running one each.
  • Page 29: Kannel Statuses

    --verbosity level places --debug places file-name --logfile file-name level --fileverbosity level --suspended --isolated --tryhttp Kannel statuses In Kannel, there are four states for the program (which currently directly only apply to bearerbox): a. Running. The gateway accepts, proceeds and relies messages normally. This is the default state for the bearerbox.
  • Page 30: Http Administration

    The state can be changed via HTTP administration interface (see below), and shutdown can also be initiated via TERM or INT signal from terminal. In addition, the bearerbox can be started already in suspended or isolated state with -S or -I command line option, see above. HTTP administration Kannel can be controlled via an HTTP administration interface.
  • Page 31 shutdown flush-dlr start-smsc stop-smsc Chapter 3. Using the gateway Bring down the gateway, by setting state to ’shutdown’. After a shutdown is initiated, there is no other chance to resume normal operation. However, ’status’ command still works. Password required. If shutdown is sent for a second time, the gateway is forced down, even if it has still messages in queue.
  • Page 32: Setting Up A Wap Gateway

    Chapter 4. Setting up a WAP gateway This chapter tells you how to set Kannel up as a WAP gateway. WAP gateway configuration To set up a WAP Kannel, you have to edit the ’core’ group in the configuration file, and define the ’wapbox’...
  • Page 33 Variable map-url map-url-max map-url-0 device-home Chapter 4. Setting up a WAP gateway Value URL-pair number URL-pair Description The pair is separated with space. Adds a single mapping for the left side URL to the given destination. If you append an asterisk ‘*’...
  • Page 34: Running Wap Gateway

    Variable log-file log-level syslog-level force-sar smart-errorsr Running WAP gateway WAP Gateway is ran as explained in previous chapter. Checking whether the WAP gateway is alive You can check whether the WAP gateway (both the bearerbox and the wapbox) is alive by fetching the kannel:alive Chapter 4.
  • Page 35: Setting Up A Sms Gateway

    Chapter 5. Setting up a SMS Gateway This chapter is a more detailed guide on how to set up Kannel as an SMS gateway. Required components To set up an SMS gateway, you need, in addition to a machine running Kannel, access to (an operator’s) SMS center, or possibly to multiple ones.
  • Page 36 Variable group (m) smsc (m) smsc-id denied-smsc-id allowed-smsc-id preferred-smsc-id Chapter 5. Setting up a SMS Gateway Value smsc string string id-list id-list id-list Description This is a mandatory variable Identifies the SMS center type. See below for a complete list. An optional name or id for the smsc.
  • Page 37 Variable allowed-prefix denied-prefix preferred-prefix Chapter 5. Setting up a SMS Gateway Value prefix-list prefix-list prefix-list Description A list of phone number prefixes which are accepted to be sent through this SMSC. Multiple entries are separated with semicolon (’;’). For example, "040;050"...
  • Page 38: Nokia Cimd 1.37 And 2.0

    NOTE: SMS center configuration variables are a bit incomplete, and will be updated as soon as people responsible for the protocols are contacted. Meanwhile, please have patience. Nokia CIMD 1.37 and 2.0 Support for CIMD 1.37 is quite old and will be removed in a future version of Kannel. Please let us know if you still need it.
  • Page 39 group = smsc smsc = cimd host = 100.101.102.103 port = 600 smsc-username = foo smsc-password = bar The driver for CIMD2 is a "receiving SME" and expects the SMSC to be configured for that. It also expects the SMSC to automatically send stored messages as soon as Kannel logs in (this is the normal configuration).
  • Page 40: Cmg Ucp/Emi 4.0

    Variable sender-prefix CMG UCP/EMI 4.0 Kannel supports two types of connections with CMG SMS centers: direct TCP/IP connections ( ) and ISDN/modem (X.25 over D channel ISDN is called X.31) connection ( emi2 implementation of the EMI protocol that supports more features and should work more reliably than the old one.
  • Page 41 Variable host (c) port (c) alt-host alt-port smsc-username smsc-password device (c) phone (c) our-host our-port receive-port appname Chapter 5. Setting up a SMS Gateway Value hostname port-number hostname port-number string string device-name string hostname port-number port-number string Description Machine that runs SMSC. As IP (100.100.100.100) or hostname (their.machine.here) Port number in the SMSC host...
  • Page 42 Variable connect-allow-ip idle-timeout keepalive wait-ack Chapter 5. Setting up a SMS Gateway Value IP-list number (seconds) number (seconds) number (seconds) Description If set, only connections from these IP addresses are accepted to receive-port. TCP/IP connection only. If this option is set to a value larger than 0, then the connection will be closed after the configured amount of seconds...
  • Page 43 Variable wait-ack-expire flow-control window throughput retry Chapter 5. Setting up a SMS Gateway Value number number number (messages) number (messages/sec) boolean Description Defines what kind of action should be taken if the the ack of a message expires. The options for this value are: 0x00 - disconnect/reconnect, (default) 0x01 - as is now, requeue, but...
  • Page 44: Smpp 3.4

    Variable my-number alt-charset SMPP 3.4 This implements Short Message Peer to Peer (SMPP) Protocol 3.4 in a manner that should also be compatible with 3.3. Sample configuration: group = smsc smsc = smpp host = 123.123.123.123 port = 600 receive-port = 700 smsc-username = "STT"...
  • Page 45 Variable transceiver-mode receive-port smsc-username (m) smsc-password (m) system-type (m) Chapter 5. Setting up a SMS Gateway Value bool port-number string string string Description Attempt to use a TRANSCEIVER mode connection to the SM-SC. It uses the standard transmit ’port’, there is no need to set ’receive-port’.
  • Page 46 Variable interface-version address-range (m) our-host my-number enquire-link-interval max-pending-submits Chapter 5. Setting up a SMS Gateway Value number string string number number number Description Change the "interface version" parameter sent from Kannel to a value other then 0x34 (for SMPP v3.4). the value entered here should be the hexadecimal representation of the interface version parameter.
  • Page 47 Variable reconnect-delay source-addr-ton source-addr-npi source-addr-autodetect dest-addr-ton dest-addr-npi Chapter 5. Setting up a SMS Gateway Value number number number boolean number number Description Optional the time between attemps to connect an ESME to an SMSC having failed to connect initating or during an SMPP session.
  • Page 48: Sema Group Sms2000 Ois 4.0 And 5.0

    Variable msg-id-type alt-charset Sema Group SMS2000 OIS 4.0 and 5.0 The 4.0 implementation is over Radio PAD (X.28). Following configuration variables are needed, and if Chapter 5. Setting up a SMS Gateway Value number string Description Optional, specifies which number base the SMSC is using for the message ID numbers in the corresponding submit_sm_resp...
  • Page 49: Sm/Asi (For Criticalpath Invoke Sms Center 4.X)

    you find out the more exact meaning, please send a report. The 5.0 implementation uses X.25 access gateway. group = smsc smsc = sema device = /dev/tty0 smsc_nua = (X121 smsc address) home_nua = (x121 radio pad address) wait_report = 0/1 (0 means false, 1 means true) Variable device (m) smsc_nua (m)
  • Page 50: Gsm Modem

    smsc-username = foo smsc-password = foo Variable host (m) port (m) smsc-username (m) smsc-password (m) reconnect-delay source-addr-ton source-addr-npi dest-addr-ton dest-addr-npi priority GSM modem Kannel can use a GSM modem as an SMS center. group = smsc smsc = at modemtype = wavecom device = /dev/ttyS0 Chapter 5.
  • Page 51 Chapter 5. Setting up a SMS Gateway Value string device-name string integer boolean Modems Wavecom Nokia Premicell Siemens M20 (this modem have some bugs) Siemens TC35 Falcom Description Modems from different manufacturers have slightly different behaviour. We need to know what type of modem is used.
  • Page 52: Gsm Modem 2

    = /dev/ttyS0 speed = 9600 pin = 2345 Variable modemtype device (m) speed Chapter 5. Setting up a SMS Gateway Modems Nokia 6210, 7110, 8210 (tested). Probably other Nokia phones too. Ericsson Value string device-name serial speed in bps string...
  • Page 53 Variable validityperiod retry keepalive my-number sms-center sim-buffering Chapter 5. Setting up a SMS Gateway Value integer boolean seconds number number boolean Description How long the message will be valid, i.e., how long the SMS center (the real one, not the phone acting as one for Kannel) will try to send the message to the recipient.
  • Page 54 Modem definitions are now multiple groups present in kannel.conf, either directly or, for example, by including the example modems.conf. (See Inclusion of configuration files) Variable group name detect-string detect-string2 init-string speed enable-hwhs need-sleep no-pin no-smsc Chapter 5. Setting up a SMS Gateway Value modems string...
  • Page 55: Fake Smsc

    Variable sendline-sleep keepalive-cmd message-storage enable-mms A note about delivery reports and GSM modems: while it is possible (and supported) to receive delivery reports on GSM modems, it may not work for you. if you encounter problems, check that your modem’s init string (if not the default) is set to correctly allow the modem to send delivery reports using unsolicted notification (check your modem’s manual).
  • Page 56: Http-Based Relay And Content Gateways

    group = smsc smsc = fake port = 10000 connect-allow-ip = 127.0.0.1 Variable host (m) port (m) connect-allow-ip HTTP-based relay and content gateways This special "SMSC" is used for HTTP based connections with other gateways and various other relay services, when direct SMSC is not available. group = smsc smsc = http system-type = kannel...
  • Page 57: Using Multiple Sms Centers

    Variable port (m) connect-allow-ip smsc-username smsc-password Using multiple SMS centers If you have several SMS center connections (multiple operators or a number of GSM modems) you need to configure one smsc group per SMS center (or GSM modem). When doing this, you might want to use routing systems to rout messages to specific centers - for example, you have 2 operator SMS centers, and the other is much faster and cheaper to use.
  • Page 58: Smsc Driver Internal Features

    Feature cimd cimd2 emi_ip Can set Validity Can set Deferred Can set PID Can set RPI Can send Unicode Can send 8 bits Correctly send GSM alphabet Notes: a. To use mclass coding Table 5-3. SMSC driver internal features Feature cimd cimd2 emi_ip Can keep idle connections alive...
  • Page 59: Smsbox Configuration

    Feature cimd cimd2 emi_ip Correctly encodes when sending Correctly encodes when sending ä Correctly encodes when sending Can receive in text messages Can receive in text messages ä Can receive in text messages Can shut down idle connections Notes: a. Does not mark it as octet data b.
  • Page 60: Smsbox Group Variables

    SMSBox inherits from core the following fields: smsbox-port http-proxy-port http-proxy-host http-proxy-username http-proxy-password http-proxy-exceptions ssl-certkey-file Table 5-4. Smsbox Group Variables Variable group (m) bearerbox-host (m) smsbox-id (o) sendsms-port (c) sendsms-port-ssl (o) sendsms-url (o) sendota-url (o) Chapter 5. Setting up a SMS Gateway Value smsbox hostname...
  • Page 61 Variable sendsms-chars global-sender log-file log-level access-log white-list black-list reply-couldnotfetch Chapter 5. Setting up a SMS Gateway Value string phone-number filename number 0..5 filename string Description Only these characters are allowed in ’to’ field when send-SMS service is requested via HTTP. Naturally, you should allow at least .
  • Page 62 Variable reply-couldnotrepresent reply-requestfailed reply-emptymessage mo-recode http-request-retry http-queue-delay A typical ’smsbox’ group could be something like this: group = smsbox bearerbox-host = localhost sendsms-port = 13131 sendsms-chars = "0123456789 " global-sender = 123456 access-log = "kannel.access" log-file = "smsbox.log" Chapter 5. Setting up a SMS Gateway Value string string...
  • Page 63: Smsbox Routing Inside Bearerbox

    log-level = 0 Smsbox routing inside bearerbox The communication link between bearerbox and smsbox has been designed for the purpose of load-balancing via random assignment. Which means, bearerbox holds all smsc connections and passes inbound message to one of the connected smsboxes. So you have a determined route for outbound messages, but no determinated route for inbound messages.
  • Page 64: Sms-Service Configurations

    Variable smsc-ids shortcuts SMS-service configurations Now that you have an SMS center connection to send and receive SMS messages you need to define services for incoming messages. This is done via ’sms-service’ configuration groups. These groups define SMS services in the smsbox, so they are only used by the smsbox. Each service is recognized from the first word in an SMS message and by the number of arguments accepted by the service configuration (unless catch-all...
  • Page 65 Variable keyword (m) aliases name get-url (c) post-url (c) post-xml (c) file (c) Chapter 5. Setting up a SMS Gateway Value word word-list string filename Description Services are identified by the first word in the SMS Each ‘%s’ in the URL corresponds to one word in the SMS message.
  • Page 66 Variable text (c) exec (c) accepted-smsc allowed-prefix denied-prefix Chapter 5. Setting up a SMS Gateway Value string string id-list prefix-list prefix-list Description Predefined text answer. Only if there is neither set. file Escape codes (parameters) are usable here, too. Executes the given shell command as the current UID of the running smsbox user and returns the output to...
  • Page 67 Variable allowed-receiver-prefix denied-receiver-prefix catch-all send-sender strip-keyword faked-sender max-messages accept-x-kannel-headers Chapter 5. Setting up a SMS Gateway Value prefix-list prefix-list bool bool bool phone-number number bool Description A list of phone number prefixes of the receiver number which are accepted to be received by this service.
  • Page 68 Variable assume-plain-text concatenation split-chars split-suffix omit-empty header footer prefix Chapter 5. Setting up a SMS Gateway Value bool bool string string bool string string string Description If client does not set Content-Type for reply, it is normally application/octet-stream which is then handled as data in kannel.
  • Page 69: Parameters (Escape Codes)

    Variable suffix white-list black-list Notes: a. Even if this service is denied, kannel still searches for other service which accepts the message, or default service. b. Like in accepted-smsc, kannel still searches for other service which accepts the message. This way there could be several services with the same keyword and different results.
  • Page 70: How Sms-Service Interprets The Http Response

    Some sample ’sms-service’ groups: group = sms-service keyword = nop text = "You asked nothing and I did it!" catch-all = true group = sms-service keyword = complex get-url = "http://host/service?sender=%p&text=%r" accept-x-kannel-headers = true max-messages = 3 concatenation = true group = sms-service keyword = default text = "No action specified"...
  • Page 71: Extended Headers

    text/html text/vnd.wap.wml text/xml application/octet-stream Extended headers Kannel uses and accepts several X-Kannel headers to be used with SMS-services. Table 5-8. X-Kannel Headers SMSPush equivalent username password from text charset smsc flash mclass coding validity deferred dlrmask dlrurl account alt-dcs Chapter 5. Setting up a SMS Gateway Tags are removed, rest is chopped to fit an SMS message.
  • Page 72: Kannel Post

    Kannel POST Kannel can do POST if is contains a service Table 5-9. X-Kannel Post Headers Parameter (escape code) equivalent %p (from) %P (to) %t (time) %u (udh) %i (smsc) - (mclass) - (pid) - (alt-dcs) - (mwi) %c (coding) - (compress) - (validity) - (deferred)
  • Page 73 <alt-dcs>alt-dcs</alt-dcs> </dcs> <pid>pid</pid> <statusrequest> <dlr-mask>dlr-mask</dlr-mask> <dlr-url>dlr-url</dlr-url> </statusrequest> <from> <user>username</user> <username>username</username> <pass>password</pass> <password>password</password> <account>account</account> </from> <to>smsc-id</to> <from>smsc-id</from> <to>service-name</to> </submit> </message> There could be several entries for make sence in sms-service Note: Davi: I still have to test binary and unicode <ud> content is the same format as X-Kannel-UDH On kannel->application,...
  • Page 74: Sendsms-User Configurations

    SendSMS-user configurations To enable an SMS push, you must set ’sendsms-user’ groups. Each of these groups define one account, which can be used for the SMS push, via HTTP interface (see below) Table 5-10. SendSMS-User Group Variables Variable group (m) username (m) password (m) name...
  • Page 75 Variable allowed-prefix denied-prefix white-list black-list dlr-url Some sample ’sendsms-user’ groups: group = sendsms-user username = simple password = elpmis group = sendsms-user username = complex password = 76ftY user-deny-ip = " * . * . * . * " user-allow-ip = "123.234.123.234" max-messages = 3 concatenation = true forced-smsc = SOL...
  • Page 76: External Delivery Report (Dlr) Storage

    Chapter 5. Setting up a SMS Gateway External delivery report (DLR) storage Delivery reports are supported by default internaly, which means all DLRs are stored in the memory of the bearerbox process. This is problematic if bearerbox crashes or you take the process down in a controlled way, but there are still DLRs open.
  • Page 77: Dlr Database Field Configuration

    In addition to that you must have a used to the DLR attributes and a sdb-connection Here is the example configuration from group = sdb-connection id = mydlr url = "mysql:host=localhost:db=dlr:uid=foo:pwd=bar" group = dlr-db id = mydlr table = dlr field-smsc = smsc field-timestamp = ts field-destination = destination...
  • Page 78 Variable field-timestamp (m) field-destination (m) field-service (m) field-url (m) field-mask (m) field-status (m) field-boxc-id (m) A sample ’dlr-db’ group: group = dlr-db id = dlr-db table = dlr field-smsc = smsc field-timestamp = ts field-destination = destination field-service = service field-url = url field-mask = mask field-status = status...
  • Page 79: Mysql Connection Configuration

    MySQL connection configuration For several reasons external storage may be required to handle dynamical issues, i.e. DLRs, sms-service, sendsms-user, ota-setting, ota-bookmark definitions and so on. To define a MySQL database connection you simple need to specify a mysql-connection Table 5-12. MySQL Connection Group Variables Variable group id (m)
  • Page 80: Ota Setting Group Variables

    phone as a XML document, but this method is perhaps more suitable for continous provisioning. If you want to send multiple OTA configurations through the smsbox and you do not want to send XML documents, you will have to declare a Table 5-13.
  • Page 81: Setting Up More Complex Services

    phonenumber = 013456789 bearer = data calltype = analog connection = cont pppsecurity = off authentication = normal login = wapusr secret = thepasswd And a ’sendsms-user’ to use with it. With concatenation enabled: group = sendsms-user username = otauser password = foo max-messages = 2 concatenation = 1...
  • Page 82: Redirected Replies

    Chapter 5. Setting up a SMS Gateway Redirected replies The basic service system always sends the answer back to original requester, but sometimes the content server needs to send something to other terminals or delay the answer. To create such systems, an SMS push is used.
  • Page 83: Running Sms Gateway

    accepted-smsc = B get-url = "..." As can be seen, the smsc-id variable is used to prevent messages originally from the other SMS center from being denied-smsc-id sent through the other one. Finally ’sms-service’ groups are defined with only accept messages from certain SMS center. If you want to use SMS push services, requesters should then set the ’sendsms-user’...
  • Page 84 password pass from text charset Chapter 5. Setting up a SMS Gateway string string phone number list string string string Password associated with given . Must match username corresponding field in the ’sendsms-user’ group of the Kannel configuration, or ’Authorization failed’ is returned.
  • Page 85 smsc flash mclass coding Chapter 5. Setting up a SMS Gateway string number number number number Optional virtual smsc-id from which the message is supposed to have arrived. This is used for routing purposes, if any denied or preferred SMS centers are set up in SMS center configuration.
  • Page 86 validity number (minutes) deferred number (minutes) dlrmask number (bit mask) dlrurl string (url) byte alt-dcs number number Chapter 5. Setting up a SMS Gateway Optional. If given, kannel will inform SMS Center that it should only try to send the message for this many minutes.
  • Page 87: Using The Http Interface To Send Ota Configuration Messages

    account Notes: a. To set number of messages, use YY are the number of messages, in HEX, and XX are Using the HTTP interface to send OTA configuration messages OTA messages can be sent to mobile phones or devices to auto-configure the settings for WAP. They are actually complex SMS messages with UDH and sent as concatenated messages if too long (and compiled if necessary).
  • Page 88: Ota Cgi Variables

    You can send either settings or bookmark, set CGI variable type accordingly. Default for this variable is settings. Here is an example XML document (this one contains CSD settings for logging in to a mobile service; note that you must store DTD locally): <?xml version="1.0"?>...
  • Page 89 otaid username password from smsc text type Chapter 5. Setting up a SMS Gateway string string string number string string XML document string Name or ID of the ’ota-setting’ group in Kannel configuration that should be sent to the phone. This variable is optional.
  • Page 90: Setting Up A Sms&Wap Gateway

    Chapter 6. Setting up a SMS&WAP gateway This chapter tells you how to set Kannel up as a combined WAP and SMS gateway. SMS&WAP gateway configuration Configuration is done as explained in previous chapters, you simply have to include all the data from both chapters into the configuration file.
  • Page 91: Setting Up Push Proxy Gateway

    Chapter 7. Setting up Push Proxy Gateway This chapter explains how to set up a push proxy gateway (PPG). An example configuration file are given. A working push proxy gateway is described. Configuring ppg core group, for push initiator (PI) interface PPG configuration group defines gateway’s service interface.
  • Page 92: Configuring Ppg User Group Variables

    Variable ssl-server-key-file ppg-url global-sender concurrent-pushes users trusted-pi ppg-deny-ip ppg-allow-ip default-smsc Configuring PPG user group variables In addition of pi lists similar to the core group, ppg configuration spesific to a certain user contains variables used for authentication and enforcing restrictions to phone numbers pi may contact. All Chapter 7.
  • Page 93: Ppg User Group Configuration Variables

    variables are elaborated in table 7.2. As an example, let us see how to configure a ppg user (a pi, named here ’picom’) allowed to send pushes only from a specified ip. group = wap-push-user wap-push-user = picom ppg-username = foo ppg-password = bar allow-ip = 62.254.217.163 It goes without saying that in real systems you must use more complex passwords than bar.
  • Page 94: Finishing Ppg Configuration

    Variable deny-ip default-smsc forced-smsc Finishing ppg configuration PPG uses SMS for sending SI to the phone and an IP bearer to fetch content specified by it (see chapter Overview of WAP Push). This means both wapbox and bearer smsc connections are in use. So your push proxy gateway configuration file must contain groups core, wapbox, smsc and smsbox.
  • Page 95: Running A Push Proxy Gateway

    smsc = http smsc-id = HTTP port = 10000 system-type = kannel smsc-username = foo smsc-password = bar no-sender = true no-coding = true send-url = http://host:port/path To set up smsbox. This group will eventually disappear, use here only necessary configuration variables. group = smsbox bearerbox-host = localhost Kannel sources contain a sample push configuration file...
  • Page 96: Default Network And Bearer Used By Push Proxy Gateway

    Default network and bearer used by push proxy gateway If network and bearer attributes of the pap control document are missing or set any, Kannel uses address type for routing purposes: if the address type is a phone number (TYPE=PLMN), network defaults to GSM and bearer to SMS;...
  • Page 97: Using Ssl For Http

    Chapter 8. Using SSL for HTTP This chapter explains how you can use SSL to ensure secure HTTP communication on both, client and server side. Beware that the gateway, is acting in both roles of the HTTP model: 1. as HTTP client, i.e. for requesting URLs while acting as WAP gateway and while fetching information for the SMS services.
  • Page 98: Using Ssl Server Support For Ppg Https Interface

    Using SSL server support for the sendsms HTTP interface To use the SSL-enabled HTTP server please use the following configuration directive within the core and smsbox groups group = core ssl-server-cert-file = "filename" ssl-server-key-file = "filenane" group = smsbox sendsms-port-ssl = true Using SSL server support for PPG HTTPS interface If you want use PAP over HTTPS, (it is, a https scheme) add following directives to the ppg core group: group = ppg...
  • Page 99: Delivery Reports

    Chapter 9. Delivery Reports This chapter explains how to set up kannel to deliver delivery reports. Delivery reports are a method to tell your system if the message has arrived on the destination phone. There are different things which can happen to a message on the way to the phone which are: Message gets rejected by the SMSC (unknown subscriber, invalid destination number etc).
  • Page 100: Getting Help And Reporting Bugs

    Chapter 10. Getting help and reporting bugs This chapter explains where to find help with problems related to the gateway, and the preferred procedure for reporting bugs and sending corrections to them. The Kannel development mailing list is devel@kannel.3glab.org. To subscribe, send mail to devel-subscribe@kannel.3glab.org (mailto:devel-subscribe@kannel.3glab.org).
  • Page 101: Using The Fake Wap Sender

    Appendix A. Using the fake WAP sender This appendix explains how to use the fake WAP sender to test the gateway.
  • Page 102: Using The Fake Sms Center

    Appendix B. Using the fake SMS center Fakesmsc is a simple testing tool to test out Kannel and its SMS services. It cannot be used to send messages to mobile terminals, it is just a simulated SMS center with no connection to real terminals. Setting up fakesmsc This section sums up needed steps to set up system for fakesmsc use.
  • Page 103: Fake Messages

    Options and messages are explained below, but as a quick example, a typical startup can go like this: test/fakesmsc -i 0.1 -m 100 "100 200 text nop" "100 300 text echo this" This tells fakesmsc to connect to bearerbox at localhost:10000 (default) and send a hundred messages with an interval of 0.1 seconds.
  • Page 104 Switch In addition, fakesmsc accepts all common Kannel Command line options like Appendix B. Using the fake SMS center Value Description Send a maximum of max messages. Value -1 means that an unlimited number of messages is sent. Default -1. Using 0 can be useful to listen for messages sent via other channels.
  • Page 105: Setting Up A Test Environment For Push Proxy Gateway

    Appendix C. Setting up a test environment for Push Proxy Gateway This appendix explains how to set a test environment for PPG. This contains a simulated SMSC, for instance a http server simulation (this is used as example, because it is simplest) and a simulated push initiator.
  • Page 106: Starting Necessary Programs

    si-expires="2002-06-30T00:00:00Z"> Want to test a fetch? </indication> </si> Note that the date value of the si-expires attribute contains trailing zeroes. They are OK here, because SI tokenizer removes them. But phones does not accept them in the final SMS data message. You should probably use action="signal-high"...
  • Page 107: C-1. Test_Ppg's Command Line Options

    second one pap control document. (For command line options, see Table C.1.). For example doing one push(you can simplify push url by setting a ppg configuration variable, see "Setting up push proxy gateway"; q flag here prevents dumping of test_ppg program debugging information): test/test_ppg -q http://ppg-host-name:ppg-port/ppg-url [content_file] [control_file] This presumes that you have set trusted-pi true.
  • Page 108: Using Nokia Toolkit As A Part Of A Developing Environment

    (if it works properly) in error situations is dropping the offending message. Nokia Toolkit, instead, displays push headers, decompiles tokenised documents and outputs debugging information. It is not, of course, a carbon copy of a real phone. But it is still usefull for checking spec conformance of push servers.
  • Page 109: C-2. Test_Ppg's Configuration File Directives

    group = test-ppg retries = 2 pi-ssl = yes ssl-client-certkey-file = /home/aarno/kannelcvs/gateway/gw/certkey.pem group = configuration push-url = https://localhost:8900/wappush pap-file = /home/aarno/test/ipnoqos.txt content-file = /home/aarno/test/si.txt username = foo password = bar With a configuration file, you can do a push by typing: test/test_ppg -q [configuration_file] Table C-2.
  • Page 110 Directive content-file username password Appendix C. Setting up a test environment for Push Proxy Gateway Value filename string string Description Mandatory value. File containing pap request’s content document. Mandatory value. PPG service user’s username. Mandatory value. PPG service user’s password.
  • Page 111: Setting Up A Dial-Up Line

    Note: this is not the connect speed between the WAP client and the server modem. If you are e.g. going to use a Nokia 7110 as the server side modem you need to change the speed to 19200.
  • Page 112: Isdn Terminal

    In /etc/ppp/pap-secrets add the username and password for the ppp account. The IP address is the one assigned to the phone. wapuser * wappswd 192.168.0.20 Configure your phone (this example is for Nokia 7110) homepage http:/yourhost/hello.wml connection type continuous connection security off...
  • Page 113: Log Files

    Appendix E. Log files This appendix describes the log file format. Bearerbox Access Log 2001-01-01 12:00:00 Sent SMS [SMSC:smsc] [SVC:sms] [from:12345] [to:67890] [flags:0:1:0:0:0] [msg:11:Hello World] [udh:0] Variable Date Result SMSC from Flags Message Text User Data Header Log rotation If Kannel is configured so that the bearerbox, wapbox and/or smsbox log to file each of these log files will continue to grow unless administered in some way (this is especially true if access logs are created and/or the log level is set to debug).
  • Page 114 Appendix E. Log files daily missingok rotate 365 compress delaycompress notifempty create 640 kannel adm sharedscripts postrotate killall -HUP bearerbox smsbox wapbox || true > /dev/null 2> /dev/null endscript...
  • Page 115: Glossary

    Glossary Mobile Originated - a SMS from mobile to application Mobile Terminated - a SMS from application to mobile Message Waiting Indicator (See [BIBLIO-3GPP-23038]) MClass Message Class (See [BIBLIO-3GPP-23038]) Coding Message Coding (See [BIBLIO-3GPP-23038])
  • Page 116: Bibliography

    Bibliography RFC 2616 - Hypertext Transfer Protocol -- HTTP/1.1, http://www.w3.org/Protocols/rfc2616/rfc2616.html, Request for Comments: 2616, The Internet Society, 1999. 3GPP 23.038, http://www.3gpp.org/ftp/Specs/latest/Rel-5/23_series/23038-500.zip, ..., 3GPP, ?. 3GPP 23.040, http://www.3gpp.org/ftp/Specs/latest/Rel-5/23_series/23040-530.zip, ..., 3GPP, ?.

This manual is also suitable for:

1.3.1

Table of Contents