background image

Kannel 1.3.1 User’s Guide

Open Source WAP and SMS gateway

Lars Wirzenius

Gateway architect

Wapit Ltd

[email protected]

http://www.wapit.com

http://www.kannel.org

Kalle Marjola

Manager

Wapit Ltd

[email protected]

http://www.wapit.com

http://www.kannel.org

Andreas Fink

Chairman & CTO

Global Networks Inc.

Summary of Contents for 1.3.1

Page 1: ... 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 ...

Page 2: ...w 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: ...igues 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 Revision History Revision 1 3 1 2006 07 01 ...

Page 4: ...n files 13 Core configuration 13 Running Kannel 20 Starting the gateway 20 Command line options 20 Kannel statuses 21 HTTP administration 22 4 Setting up a WAP gateway 24 WAP gateway configuration 24 Wapbox configuration 24 Running WAP gateway 26 Checking whether the WAP gateway is alive 26 5 Setting up a SMS Gateway 27 Required components 27 SMS gateway configuration 27 SMS centers 27 Nokia CIMD ...

Page 5: ...es 79 GET method for the OTA HTTP interface 79 6 Setting up a SMS WAP gateway 82 SMS WAP gateway configuration 82 Running SMS WAP gateway 82 7 Setting up Push Proxy Gateway 83 Configuring ppg core group for push initiator PI interface 83 Configuring PPG user group variables 84 Finishing ppg configuration 86 Running a push proxy gateway 87 An example using HTTP SMSC 87 An example push tokenised SI ...

Page 6: ...h 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 ISDN terminal 104 E Log files 105 Bearerbox Access Log 105 Log rotation 105 Glossary 107 Bibliography 108 vi ...

Page 7: ...scape Codes 61 5 8 X Kannel Headers 63 5 9 X Kannel Post Headers 64 5 10 SendSMS User Group Variables 66 5 11 DLR Database Field Configuration Group Variables 69 5 12 MySQL Connection Group Variables 71 5 13 OTA Setting Group Variables 72 5 14 OTA Bookmark Group Variables 73 5 15 SMS Push send sms CGI Variables 75 5 16 OTA CGI Variables 80 7 1 PPG core group configuration variables 83 7 2 PPG user...

Page 8: ...f WAP service and have many interesting applications Usually servers know whether some data is new not the users Open Source http www opensource org is a way to formalize the principle of openness by placing the source code of a product under a Open Source compliant software license The BSD license was chosen over other Open Source licenses by the merit of placing the least amount of limitations o...

Page 9: ...roviding content to the phones Figure 1 1 Logical position of WAP gateway and PPG between a phone and a content server The WAP gateway talks to the phone using the WAP protocol stack and translates the requests it receives to normal HTTP Thus content providers can use any HTTP servers and utilize existing know how about HTTP service implementation and administration In addition to protocol transla...

Page 10: ... by the phone over IP bearer for instance CSD or GPRS Because Push Proxy Gateway tokenises SI and SL documents it may fit one SMS message if not it is segmented for transfer Using two bearers seems to be an unnecessary complication But quite simply phones currently operate this way Push over GPRS can only simplify matters Overview of SMS SMS short messaging service is a way to send short 160 chara...

Page 11: ...o serving mobile originated MO SMS messages Kannel also works as an SMS push gateway content providers can request Kannel to send SMS messages to terminals Kannel then determines the correct SMS center to relay the SMS message and sends the SMS message to that SMS center again using SMS center specific protocol This way the content provider does not need to know any SMS center specific protocol ju...

Page 12: ...cBook markup language tools jade jadetex DocBook stylesheets etc see README docbook if you want to format the documentation pre formatted versions are available Hardware requirements are fluffier We haven t benchmarked Kannel yet so there are no hard numbers but a reasonably fast PC workstation 400 MHz Pentium II 128 MB RAM should serve several concurrent users or tens of SMS messages per second w...

Page 13: ...r Kannel consists of three parts 1 User s Guide i e the one you re reading at the moment 2 Architecture and Design in doc arch or at http www kannel 3glab org arch shtml http www kannel 3glab org arch shtml 3 The README and various other text files in the source tree We intend to cover everything you need to install and use Kannel is in User s Guide but the guide is still incomplete in this respec...

Page 14: ...dditional options with defaults type Set defaults for the other options type is either speed or debug The default is debug enable docs default Build documentation b e converting the User Guide and the Architecture Guide from the DocBook markup language to PostScript and HTML disable docs Don t build documentation enable drafts When building documentation include the sections marked as draft disabl...

Page 15: ...source directory gw bearerbox gw smsbox gw wapbox The version number of the gateway is added to the file names during installation This makes it easier to have several versions installed and makes it easy to go back to an older version if the new version proves problematic Kannel consists of three programs called boxes the bearer box is the interface towards the phones It accepts WAP and SMS messa...

Page 16: ...ackages you x should now be able to run the Kannel init d script that will start Kannel as a WAP gateway Run the script as root etc rc d init d kannel start To stop the gateway just run the same script with the stop parameter etc rc d init d kannel stop If Kannel is already running and you just want to quickly stop and start the gateway e g to set a new configuration option run the script with the...

Page 17: ...sr share doc kannel VERSION or usr doc kannel VERSION depending on if you used the RedHat 7 x or 6 x package 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 Installing Kannel from DEB packages This chapter explains how to install upgrad...

Page 18: ... restart parameter etc init d kannel restart If you don t want Kannel to run as a daemon run update rc d f kannel remove If you want to restore Kannel runing as a daemon you need to add a symbolic link to the Kannel script from the runlevel you want Kannel to run in E g to run Kannel in default runlevel just run update rc d kannel defaults Kannel package starts by default with a wapbox daemon To a...

Page 19: ...xample file that shows how to use the Kannel http administration interface It also has a template for sending SMS messages Aditionally to kannel VERSION deb there s now an optional kannel docs VERSION deb with documentation userguide et al and a kannel extras VERSION deb with contrib and test stuff If you want to test development version use the packages called kannel devel deb 12 ...

Page 20: ...ox part is in the next chapter and smsbox smsc SMS center sms service and sendsms user groups are in the SMS Kannel chapter Configuration file syntax A configuration file consists of groups of configuration variables Groups are separated by empty lines and each variable is defined on its own line Each group in Kannel configuration is distinguished with a group variable Comments are lines that begi...

Page 21: ...to have more control in larger setups Here is an example that illustrates the include statement group core admin port 13000 wapbox port 13002 admin password bar wdp interface name log file var log bearerbox log log level 1 box deny ip box allow ip 127 0 0 1 include wapbox conf include configurations Above is the main kannel conf configuration file that includes the following wapbox conf file with ...

Page 22: ...1 Core Group Variables Variable Value Description group m core This is a mandatory variable admin port m port number The port number in which the bearerbox listens to HTTP administration commands It is NOT the same as the HTTP port of the local www server just invent any port but it must be over 1023 unless you are running Kannel as a root process not recommended admin port ssl o bool If set to tr...

Page 23: ... module will be SSL enabled Your smsboxes will have to connect using SSL to the bearerbox then This is used to secure communication between bearerbox and smsboxes in case they are in seperate networks operated and the TCP communication is not secured on a lower network layer Defaults to no wapbox port c port number Like smsbox port but for wapbox connections If not set Kannel cannot handle WAP tra...

Page 24: ...p allow ip wdp interface name c IP or If this is set Kannel listens to WAP UDP packets incoming to ports 9200 9208 bound to given IP If no specific IP is needed use just an asterisk If UDP messages are listened to wapbox port variable MUST be set log file filename A file in which to write a log This in addition to stdout and any log file defined in command line Log file in core group is only used ...

Page 25: ...For example for Finland an unified prefix 358 00358 0 00 should do the trick If there are several unified prefixes separate their rules with semicolon like 35850 050 35840 040 Note that prefix routing is next to useless now that there are SMSC ID entries To remove prefixes use like 35850 050 35840 040 white list URL Load a list of accepted senders of SMS messages If a sender of an SMS message is n...

Page 26: ...ies that require this http proxy password URL list Password for authenticating proxy use for proxies that require this ssl client certkey file c filename A PEM encoded SSL certificate and private key file to be used with SSL client connections This certificate is used for the HTTPS client side only i e for SMS service requests to SSL enabed HTTP servers ssl server cert file c filename A PEM encode...

Page 27: ...r of messages Set maximum size of incoming message queue After number of messages has hit this value Kannel began to discard them Value 0 means giving strict priority to outgoing messages 1 default means that the queue of infinite length is accepted This works with any normal input use this variable only when Kannel message queues grow very long A sample more complex core group could be something ...

Page 28: ... sets the logging level to INFO This way you won t see a large amount of debugging output the default is DEBUG Full explanation of Kannel command line arguments is below conffile is the name of the configuration file you are using with Kannel The basic distribution packet comes with two sample configuration files smskannel conf and wapkannel conf in gw subdirectory of which the first one is for te...

Page 29: ...here 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 b Suspended The gateway does not accept any new messages from SMS centers nor from UDP ports Neither does it accept new sms and wapbox connections nor sends any messages already in the system onward c I...

Page 30: ...rious suspend commands never arrive nor can you restart it via WAP anymore Table 3 3 Kannel HTTP Administration Commands status or status txt Get the current status of the gateway in a text version Tells the current state see above and total number of messages relied and queueing in the system right now Also lists the total number of smsbox and wapbox connections No password required unless status...

Page 31: ...ime the gateway is forced down even if it has still messages in queue flush dlr If Kannel state is suspended this will flush all queued DLR messages in the current storage space Password required start smsc Re start a single SMSC link Password required Additionally the smsc parameter must be given to identify which smsc id should be re started stop smsc Shutdown a single SMSC link Password require...

Page 32: ... wapkannel conf is supplied You may want to take a look at that when setting up a WAP Kannel Wapbox configuration If you have set wapbox port variable in the core configuration group you MUST supply a wapbox group The simplest working wapbox group looks like this group wapbox bearerbox host localhost There is however multiple optional variables for the wapbox group Table 4 1 Wapbox Group Variables...

Page 33: ...ion and an incoming URL of http source some path the result will be http destination some path map url max number If you need more than one mapping set this to the highest number mapping you need The default gives you 10 mappings numbered from 0 to 9 Default 9 map url 0 URL pair Adds a mapping for the left side URL to the given destination URL Repeat these lines with 0 replaced by a number up to m...

Page 34: ...ess WTP SAR connections even while Kannel does not support this feature now Some real phones seem to break connection if fallback to non SAR communication is being tried by the gateway smart errorsr bool If set wapbox will return a valid WML deck describing the eror that occured while processing an WSP request This may be used to have a smarter gateway and let the user know what happend actually R...

Page 35: ...us possibly one or more sendsms user groups For the core group you must set the following variable smsbox port In addition you may be interested to set unified prefix white list and or black list variables See above for details of these variables A sample configuration file smskannel conf is supplied with the standard distribution You may want to take a look at that when setting up an SMS Kannel S...

Page 36: ...ection has an assigned SMSC ID it does NOT automatically mean that messages with identical SMSC ID are routed to it instead configuration variables denied smsc id allowed smsc id and preferred smsc id is used for that denied smsc id id list SMS messages with SMSC ID equal to any of the IDs in this list are never routed to this SMSC Multiple entries are separated with semicolons allowed smsc id id ...

Page 37: ... SMSC If denied prefix is unset only this numbers are allowed If set number are allowed if present in allowed or not in denied list denied prefix prefix list A list of phone number prefixes which are NOT accepted to be sent through this SMSC preferred prefix prefix list As denied prefix but SMS messages with receiver starting with any of these prefixes is preferably sent through this SMSC In a cas...

Page 38: ...here are SMSC ID entries To remove prefixes use like 35850 050 35840 040 alt charset number As some SMS Centers do not follow the standards in character coding an alt charset character conversion is presented This directive acts different for specific SMSC tyles Please see your SMSC module type you want to use for more details In addition to these common variables there are several variables used ...

Page 39: ...r prefix 12345 Variable Value Description host m hostname Machine that runs the SMSC As IP 100 100 100 100 or hostname their machine here port m port number Port number in the smsc host machine smsc username m string Username in the SMSC machine connection account smsc password m string Password in the SMSC machine needed to contact SMSC keepalive number SMSC connection will not be left idle for l...

Page 40: ...der prefix to the empty string CMG UCP EMI 4 0 Kannel supports two types of connections with CMG SMS centers direct TCP IP connections emi_ip or emi2 and ISDN modem X 25 over D channel ISDN is called X 31 connection emi emi2 is a new implementation of the EMI protocol that supports more features and should work more reliably than the old one It is the recommended one to use with TCP IP connections...

Page 41: ...assword string Password in the SMSC machine needed to contact SMSC device c device name The device the modem is connected to like dev ttyS0 ISDN connection only phone c string Phone number to dial to when connecting over a modem to an SMS center our host hostname Optional hostname in which to bind the connection in our end TCP IP connection only our port port number Optional port number in which t...

Page 42: ...le and those this option has no effect If keepalive is larger than idle timeout than keepalive reopens the connection This allows one to poll for pending mobile originated Short Messages at the SMSC keepalive number seconds A keepalive command will be sent to the SMSC connection this many seconds after the last message The right value to use depends on how eager the SMSC is to close idle connectio...

Page 43: ...er commands shall be sent before the a response is received Any command that is sent before the reception of the response will be discarded The second type of flow control is windowing when this parameter is unset or equals 0 In this case a maximum of n commands can be sent before a response is received window number messages When using flow control 0 emi works in windowed flow control mode This v...

Page 44: ...implemented alternative charsets are defined in alt_charsets h and new ones can be added 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 smsc password foo system type VMA address range Variable Value Description host m ...

Page 45: ...t Use value 0 to disable this I O thread smsc username m string The username of the Messaging Entity connecting to the SM SC If the SM SC operator reports that the TELEPATH SYSTEM MANAGER TERMINAL view Control Apps View value Name is SMPP_ZAPVMA_T for the transmitter and SMPP_ZAPVMA_R for the receiver the smsc username value is accordingly SMPP_ZAP Note that this used to be called system id the na...

Page 46: ...ss for connections from a multi homed machine If this is not defined the default device of the machine will be used my number number Optional smsc short number Should be set if smsc sends a different one enquire link interval number Optional the time lapse allowed between operations after which an SMPP entity should interrogate whether it s peer still has an active session The default is 30 second...

Page 47: ...k Defaults to 0 source addr npi number Optional source address NPI setting for the link Defaults to 1 source addr autodetect boolean Optional if defined tries to scan the source address and set TON and NPI settings accordingly If you don t want to autodetect the source address turn this off by setting it to no Defaults to yes dest addr ton number Optional destination address TON setting for the li...

Page 48: ...0x00 deliver_sm decimal submit_sm_resp decimal 0x01 deliver_sm decimal submit_sm_resp hex 0x02 deliver_sm hex submit_sm_resp decimal 0x03 deliver_sm hex submit_sm_resp hex In accordance to the SMPP v3 4 specs the default will be a C string literal if no of the above values is explicitly indicated using the config directive alt charset string Defines which character encoding is used for this specif...

Page 49: ...plementing Sema SMS2000 using X 28 connection wait_report 0 false 1 true Report indicator used by the Sema SMS2000 protocol Optional group smsc smsc ois host 103 102 101 100 port 10000 receive port 10000 ois debug level 0 Variable Value Description host m ip SMSC Host name or IP port m port number SMSC Port number receive port m port number The port in which the SMSC will contact ois debug level n...

Page 50: ...ect to an SMSC having failed to connect initating or during an session The default is 10 seconds source addr ton number Optional source address TON setting for the link Defaults to 1 source addr npi number Optional source address NPI setting for the link Defaults to 1 dest addr ton number Optional destination address TON setting for the link Defaults to 1 dest addr npi number Optional destination ...

Page 51: ...lidityperiod integer 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 Encoded as per the GSM 03 40 standard section 9 2 3 12 Default is 167 meaning 24 hours alt dcs boolean When encoding DCS field internally there are two formats with similar functionality The 0x0X alt dcs false or non p...

Page 52: ...ave slightly different behaviour We need to know what type of modem is used Use auto or omit parameter to have kannel detect the modem type automatically some types should not be autodetected like the Nokia Premicell device m device name The device the modem is connected to like dev ttyS0 speed serial speed in bps The speed in bits per second Default value 0 means to try to use speed from modem de...

Page 53: ...it my number number Optional phone number sms center number SMS Center to send messages sim buffering boolean Whether to enable the so called SIM buffering behaviour of the GSM module if assigned a true value the module will query the message storage memory of the modem and will process and delete any messages found there this does not alter normal behaviour but only add the capability of reading ...

Page 54: ...SIEMENS MODEM M20 detect string could be SIEMENS and detect strign2 M20 init string string Optional initialization string Defaults to AT CNMI 1 2 0 1 0 speed number Serial port hint speed to use Optional Defaults to smsc group speed or autodetect enable hwhs string Optional AT command to enable hardware handshake Defaults to AT IFC 2 2 need sleep boolean Optional Defaults to false Some modems need...

Page 55: ... the modem s default message storage will be used usually SM enable mms boolean Optional defaults to false If enabled kannel would send an AT CMMS 2 if it have more than one message on queue and hopefully will be quickier sending the messages 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 enco...

Page 56: ...ateways and various other relay services when direct SMSC is not available group smsc smsc http system type kannel smsc username nork smsc password z0rK port 13015 send url http localhost 20022 Variable Value Description system type m string Type of HTTP connection kannel is only system currently supported send url m url Location to send MT messages This URL is expanded by used system if need to n...

Page 57: ...SMS centers and the other is much faster and cheaper to use To set up routing systems first give an unique ID for each SMS center or if you want to treat multiple ones completely identical give them identical ID Then use preferred smsc id and denied smsc id to set up the routing to your taste See also SMS PUSH settings sendsms user groups below Feature checklist Not all of Kannel s SMSC drivers su...

Page 58: ...ompress fields Table 5 3 SMSC driver internal features Feature cimd cimd2 emi emi_ip emi2 smpp sema ois at2 at http fake Can keep idle connections alive n y n n y y y Can send octet data without UDH n y y y y n n y y n y a Can send octet data with UDH N y y y y y n y y y a Can send text messages with UDH n y y y y n n y n y Can receive octet data without UDH n y n n y n y b y y n n Can receive uni...

Page 59: ... data b However it looks like the sema driver can t receive text data c Miscalculates message length Symbol Meaning not yet investigated y driver has this feature and it has been tested y driver probably has this feature has not been tested n driver does not have this feature N driver claims to have this feature but it doesn t work feature is not applicable for this driver Smsbox configuration You...

Page 60: ...specific routing inside bearerbox So if you you own boxes that do pass messages into bearerbox for delivery you may want that answers to those are routed back to your specific smsbox instance i e SMPP or EMI proxying boxes sendsms port c port number The port in which any sendsms HTTP requests are done As with other ports in Kannel can be set as anything desired sendsms port ssl o bool If set to tr...

Page 61: ...ers you cannot set the sender number but it is automatically set as the number of SMSC log file filename As with the bearerbox core group Access log is used to store information about MO and send sms requests Can be named same as the main access log in core group log level number 0 5 access log filename white list URL Load a list of accepted destinations of SMS messages If a destination of an SMS ...

Page 62: ...ill try to convert UCS2 messages received to ISO 8859 1 If it s possible the message will have coding equal to 7 bits and charset equal to iso 8859 1 http request retry integer If set specifies how many retries should be performed for failing HTTP requests of sms services Defaults to 0 which means no retries should be performed and hence no HTTP request queueing is done http queue delay integer If...

Page 63: ...cation to your EMSEs and if an client send a submit_sm PDU smppbox would transform the message into Kannel message representation and inject the message to bearerbox as if it would be an smsbox As you want to assign your clients shortcuts for certain networks or route any inbound traffic from a certain smsc link connected to bearerbox you need to seperate in the scope of bearerbox where the inboun...

Page 64: ...age and by the number of arguments accepted by the service configuration unless catch all configuration variable is used By adding a username and password in the URL in the following manner http luser password host domain port path query we can perform HTTP Basic authentication The simplest service group looks like this group sms service keyword www get url http S This service grabs any SMS with t...

Page 65: ...lon name string Optional name to identify the service in logs If unset keyword is used get url c URL Requested URL The url can include a list of parameters which are parsed before the url is fetched See below for these parameters Also works with plain url post url c URL Requested URL As above but request is done as POST not GET Always matches the keyword regardless of pattern matching See notes on...

Page 66: ...anisms for security reasons accepted smsc id list Accept ONLY SMS messages arriving from SMSC with matching ID a Separate multiple entries with For example if accepted smsc is RL SON accept messages which originate from SMSC with ID set as RL or SON allowed prefix prefix list A list of phone number prefixes of the sender number which are accepted to be received by this service b Multiple entries a...

Page 67: ...umber of the handset is set otherwise not strip keyword bool Used only with POST Remove matched keyword from message text before sending it onward faked sender phone number This number is set as sender Most SMS centers ignore this and use their fixed number instead This option overrides all other sender setting methods max messages number If the message to be sent is longer than maximum length of ...

Page 68: ...essage is split from last or which is included in the previous part split suffix string If the message is split into several ones this string is appended to each message except the last one omit empty bool Normally Kannel sends a warning to the user if there was an empty reply from the service provider If omit empty is set to true Kannel will send nothing at all in such a case header string If spe...

Page 69: ...s way there could be several services with the same keyword and different results Table 5 7 Parameters Escape Codes k the keyword in the SMS request i e the first word in the SMS message s next word from the SMS message starting with the second one i e the first word the keyword is not included problematic characters for URLs are encoded e g becomes 2B S same as s but is converted to useful when u...

Page 70: ...inary coding 2 or UTF16 BE coding 3 If the message was sucessfully recoded from unicode it will be ISO 8859 1 u udh of incoming message 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 ser...

Page 71: ... X Kannel Header username X Kannel Username password X Kannel Password from X Kannel From to X Kannel To text request body charset charset as in Content Type text html charset ISO 8859 1 udh X Kannel UDH smsc X Kannel SMSC flash X Kannel Flash deprecated see X Kannel MClass mclass X Kannel MClass mwi X Kannel MWI coding X Kannel Coding If unset defaults to 1 7 bits if Content Type is text plain te...

Page 72: ...ng X Kannel Coding 1 7 Bits 2 8 Bits compress X Kannel Compress validity X Kannel Validity deferred X Kannel Deferred n service name X Kannel Service a or r text request body kannel send all wo unless strip key C charset present in Content Type HTTP Example Conten text plain charset ISO 88 XML Post Kannel can send and receive XML POST with the following format xml version 1 0 DOCTYPE message submi...

Page 73: ... same format as X Kannel UDH Example udh 06050415820000 udh On kannel application from is the smsc id that message arrives and to is the service name On application kannel from contains the credentials user username pass password and account and to corresponds to the smsc id to submit the message user and username are equivalent and only one of them should be used same for pass and password When a...

Page 74: ...s in sms service groups user deny ip IP list As other deny allow IP lists but for this user i e this user is not allowed to do the SMS push HTTP request from other IPs than allowed ones If not set there is no limitations user allow IP IP list forced smsc string Force SMSC ID as a string linked to SMS routing see smsc groups default smsc string If no SMSC ID is given with the send sms request see b...

Page 75: ...f accepted destinations of SMS messages If a destination of an SMS message is not in this list any message received from the HTTP interface is rejected See notes of phone number format from numhash h header file black list URL As white list but SMS messages from these numbers are automatically rejected dlr url URL URL to be fetched if a dlrmask CGI parameter is present Some sample sendsms user gro...

Page 76: ...ge To store DLR information into a MySQL database you may use the dlr storage mysql configuration directive in the core group In addition to that you must have a dlr db group defined that specifies the table field names that are used to the DLR attributes and a mysql connection group that defines the connection to the MySQL server itself Here is the example configuration from doc examples dlr mysq...

Page 77: ...t build in your LibSDB installation when trying to use a specific DB type within the URL DLR database field configuration For external database storage of DLR information in relational database management systems RDMS you will have tospecify which table field are used to represend the stored data This is done via the dlr db group as follows Table 5 11 DLR Database Field Configuration Group Variabl...

Page 78: ...the status of the DLR for a specific message field boxc id m string The table field that is used to store the smsbox connection id that has passed the message for delivery This is required in cases you want to garantee that DLR messages are routed back to the same smsbox conn instance This is done via the smsbox routing If you don t use smsbox routing simply add this field to your database table a...

Page 79: ... m hostname or IP Hostname or IP of a server running a MySQL database to connect to mysql username m username User name for connecting to MySQL database mysql password m password Password for connecting to MySQL database database m string Name of database in MySQL database server to connect to A sample mysql connection group group mysql connection id dlr db host localhost mysql username foo mysql ...

Page 80: ...your WAP services i e http wap company com service string Description of the service ipaddress IP IP address of your WAP gateway phonenumber phone number Phone number used to establish the PPP connection speed number Connection speed 9600 or 14400 Defaults to 9600 bearer string Bearer type data or sms Defaults to data calltype string Call type isdn or analog Defaults to isdn connection string Conn...

Page 81: ... Any string is acceptable but semicolon may cause problems so avoid it and any other special non alphabet characters url URL The address of the HTTP server for your WAP services i e http wap company com name string Description of the service A sample ota bookmark group group ota bookmark ota id wap link url http wap company com service Our company s WAP site And a sendsms user to use with it with ...

Page 82: ...max messages 0 Setting up operator specific services Those running Kannel with several SMS centers might need to define services according to the relying SMS center To achieve this first you need to give an ID name for SMS center connections see above Then use the accepted smsc variable to define which messages can use that service group sms service keyword weather accepted smsc SOL get url http m...

Page 83: ...ote that if your SMS centers do not set the sender phone number but rely on number transmitted you should set faked sender to all sendsms user groups Running SMS gateway Using the HTTP interface to send SMS messages After you have configured Kannel to allow the sendsms service you can send SMS messages via HTTP e g using a WWW browser The URL looks something like this http smsbox host name 13013 c...

Page 84: ...r is used to phone number list Phone number of the receiver To send to multiple receivers separate each entry with space url encoded but note that this can be deactivated via sendsms chars in the smsbox group text string Contents of the message URL encoded as necessary The content can be more than 160 characters but then sendsms user group must have max messages set more than 1 charset string Char...

Page 85: ...lass in DCS Field Accepts values between 1 and 4 for Message Class 0 to 3 A value of 1 sends the message directly to display mclass 2 sends to mobile 3 do SIM and 4 to SIM Toolkit mwi number Optional Sets Message Waiting Indicator bits in DCS field If given the message will be encoded as a Message Waiting Indicator The accepted values are 1 2 3 and 4 for activating the voice fax email and other in...

Page 86: ...it mask Optional Request for delivery reports with the state of the sent message The value is a bit mask composed of 1 Delivered to phone 2 Non Delivered to Phone 4 Queued on SMSC 8 Delivered to SMSC 16 Non Delivered to SMSC Must set dlr url on sendsms user group or use the dlrurl CGI variable dlrurl string url Optional If dlrmask is given this is the url to be fetched Must be urlencoded pid byte ...

Page 87: ...ages 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 You may either pass an HTTP request as GET method or POST method to the HTTP interface If you want to send a configuration that is defined within Kannel s configuration file itself you have to pas...

Page 88: ...AME PPP_AUTHNAME VALUE yourusername PARM NAME PPP_AUTHSECRET VALUE yourauthsecret PARM NAME CSD_CALLTYPE VALUE ISDN PARM NAME CSD_CALLSPEED VALUE 9600 CHARACTERISTIC CHARACTERISTIC TYPE URL VALUE http wap company com CHARACTERISTIC TYPE NAME PARM NAME NAME VALUE Your WAP Company CHARACTERISTIC CHARACTERISTIC LIST A bookmark document looks like this xml version 1 0 DOCTYPE CHARACTERISTIC_LIST SYSTE...

Page 89: ...hat is to receive the OTA configuration message from string Phone number of the sender This field is usually overridden by the SMS Center or it can be overridden by faked sender variable in the sendsms user group If this variable is not set smsbox global sender is used smsc string Optional virtual smsc id from which the message is supposed to have arrived This is used for routing purposes if any d...

Page 90: ...teway configuration Configuration is done as explained in previous chapters you simply have to include all the data from both chapters into the configuration file Running SMS WAP gateway There are no special tricks to this just launch both the smsbox and the wapbox in addition to the bearerbox using multiple hosts if needed 83 ...

Page 91: ...s make configuring simpler IPs here are always denied even when they are mentioned in the allowed IPs list Ppg url is a simple stamp used for routing requests to the right service You can change this stamp by setting push url configuration variable group ppg ppg url wappush ppg port 8080 concurrent pushes 100 users 1024 ppg allow ip 194 100 32 125 127 0 0 1 ppg deny ip 194 100 32 89 194 100 32 103...

Page 92: ...PG Obviously both of them must reside inside same firewall Default true If this variable is true all security variables are ignored even though they may be present ppg deny ip ip list PPG will not accept pushes from these IPs Wildcards are allowed If this attribute is missing no IP is denied by this list ppg allow ip ip list PPG will accept pushes from these and only these IPs Wildcards are allowe...

Page 93: ...r ppg username string Username for this user ppg password string Password for this user allowed prefix number list Phone number prefixes allowed in pushes coming from this pi These prefixes must conform international phone number format denied prefix number list Phone number prefixes denied in pushes coming from this pi These prefixes must conform international phone number format white list url D...

Page 94: ...ps core wapbox smsc and smsbox These are configured normal way only smsc group may have push specific variables Note that following configurations are only an example you may need more complex ones Bearerbox setup does not require any new variables group core admin port 13000 smsbox port 13001 wapbox port 13002 admin password b wdp interface name log file filename log level 1 box deny ip box allow...

Page 95: ... in the front of an existing sendsms service capable to send SMS data messages and to to understand HTTP requests generated by HTTP SMSC See next chapter Then you need only configure SMSC configuration send url to point to sendsms service An example push tokenised SI document HTTP SMSC generates a HTTP get request when it get a sendmessage event expressed in unicode The content gateway or the send...

Page 96: ... the address type is a phone number TYPE PLMN network defaults to GSM and bearer to SMS if it is a IP address TYPE IPv4 network defaults to GSM and bearer to CSD So following minimal pap document works xml version 1 0 DOCTYPE pap PUBLIC WAPFORUM DTD PAP EN http www wapforum org DTD pap_1 0 dtd pap push message push id 9fjeo39jf084 pi com address address value WAPPUSH 358408676001 TYPE PLMN ppg car...

Page 97: ...ion files within the core group to be used for the HTTP sides You can use one or both sides of the SSL support There is no mandatory to use both if only one is desired Using SSL client support To use the client support please use the following configuration directive within the core group group core ssl client certkey file filename Now you are able to use https scheme URLs within your WML decks an...

Page 98: ...nane 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 ppg ssl port 8090 ssl server cert file home aarno kannelcvs gateway gw cert1 pem ssl server key file home aarno kannelcvs gateway gw key1 pem PPG uses a separate port for HTTPS traffic so so you must de...

Page 99: ...imply add the values togeter For example if you want to get delivery success and or failure you set the dlrmask value to 1 2 and so on If you specify dlrmask on the URL you pass on to kannel you also need to specify dlrurl dlrurlshould contain the URL to which kannel should place a HTTP requests once the delivery report is ready to be delivered back to your system An example transaction would work...

Page 100: ...edure 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 This is currently the best location for asking help and reporting bugs Please include configuration file and version number 93 ...

Page 101: ...Appendix A Using the fake WAP sender This appendix explains how to use the fake WAP sender to test the gateway 94 ...

Page 102: ...configuration group accepts all common smsc configuration group variables like smsc id preferred smsc id or denied smsc id which can be used to test out routing systems and diverted services before setting up real SMS center connections If you include a fakesmsc group when bearerbox is connected to real SMS centers you should add the connect allow ip variable to prevent unauthorized use To set up ...

Page 103: ... as one argument it must be put in quotation marks Message type must be one of the following text data and udh Here s an example of using each test fakesmsc i 0 01 v 1 m 1000 100 300 text echo this message test fakesmsc i 0 01 m 1000 100 300 data echo these chars 03 04 7f test fakesmsc m 1 100 500 udh 0eudh stuff here main message For text the rest of the argument is taken as the literal message F...

Page 104: ...n m max 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 In addition fakesmsc accepts all common Kannel Command line options like verbosity 97 ...

Page 105: ...58408676001 TYPE PLMN ppg carrier com quality of service priority low delivery method unconfirmed network required true network GSM bearer required true bearer SMS push message pap Because the push content is sended to the phone over SMS rigth value for network required and bearer required is true for network GSM and for bearer SMS However you can omit these values alltogether if you use a phone n...

Page 106: ...ntains in addition of wapbox and bearerbox two test programs test_ppg simulating push initiator and test_http_server simulating a SMSC center accepting pushed content sended over SMS You can find both of these programs in test directory and they both are short and easily editable To set up a test environment you must first configure a push proxy gateway setting flag trusted pi true makes testing e...

Page 107: ...ame ppg username password ppg password content_file control_file Table C 1 Test_ppg s command line options Switch Value Description c string Use content qualifier string instead of default si service indication Allowed values are wml si sl sia multipart nil and scrap Nil and scrap are used for debugging purposes Wml does work with some older phone simulators a string Use application id string inst...

Page 108: ...gram Use IP address of our virtual machine easiest way to get this is to ping your virtual machine name in the dos prompt window Your bearer is in this case IP An example pap document follows xml version 1 0 DOCTYPE pap PUBLIC WAPFORUM DTD PAP EN http www wapforum org DTD pap_1 0 dtd pap push message push id 9fjeo39jf084 pi com deliver before timestamp 2001 09 28T06 45 00Z deliver after timestamp ...

Page 109: ...The client tries to log in to PPG number times before discarding the push request Default is 2 pi ssl boolean Mandatory parameter for HTTPS connection Does the client use HTTPS connection Default is no ssl client certkey file filename Mandatory parameter for HTTPS connection File containing the client s ssl certificate and private key ssl trusted ca file filename Mandatory paramenter for HTTPS con...

Page 110: ... Proxy Gateway Directive Value Description content file filename Mandatory value File containing pap request s content document username string Mandatory value PPG service user s username password string Mandatory value PPG service user s password 103 ...

Page 111: ...d information In this example we assume your modem is connected to the serial port ttyS0 COM 1 S0 2345 respawn sbin mgetty ttyS0 x 6 D dev ttyS0 We need to start the pppd automatically when mgetty receives an AutoPPP request Add the next line to etc mgetty sendfax login config AutoPPP usr sbin pppd file etc ppp options server In etc mgetty sendfax mgetty config you might need to change the connect...

Page 112: ...2 168 0 20 Configure your phone this example is for Nokia 7110 homepage http yourhost hello wml connection type continuous connection security off bearer data dial up number your phone number ip address IP of host running bearerbox auth type normal data call type analogue data call speed 9600 username wapuser password wappswd ISDN terminal This section needs to be written 105 ...

Page 113: ...dump 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 A typical way of administering log files is to rotate the logs on a regular basis using a tool such as logrotate A sample logrotate scrip...

Page 114: ...ppendix 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 107 ...

Page 115: ...d a SMS from mobile to application MT Mobile Terminated a SMS from application to mobile MWI Message Waiting Indicator See BIBLIO 3GPP 23038 MClass Message Class See BIBLIO 3GPP 23038 Coding Message Coding See BIBLIO 3GPP 23038 108 ...

Page 116: ...p 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 109 ...

Reviews: