Helping ordinary people create extraordinary websites!
GET OUR NEWSLETTER
Your Email:
 

Build a WAP Gateway On Linux

By Manas Ranjan Behera
2005-05-27


Working with the gateway

Now study the basic steps for using the gateway and testing it with a WAP-enabled mobile phone simulator. Essentially, you'll be dealing with the bearerbox and the wapbox (the executables you've just created).

Configuring the gateway
The bearerbox and wapbox are the main working modules of the gateway, and must be configured before configuring the gateway. These two modules are controlled by a configuration file that has wapbox and bearerbox groups.

A configuration file consists of groups of configuration variables. Groups are separated by empty lines, with each variable defined on its own line (each group in Kannel configuration is distinguished with a group variable). Lines beginning with a hash mark (#) are comments and should be ignored.

A variable definition line has the name of the variable, the equal sign (=), and the value of the variable. The name of the variable can contain any character except white spaces and equal signs. The value of the variable is a string, with or without quotation marks around it. Quotation marks are needed if the variable begins or ends with a white space or contains special characters. A normal C escape character syntax works inside quotation marks.

Working with configuration files
I'm including an example of the configuration file that I used for this project; it is the basic file with which the gateway runs. There is, however, a list of other attributes available to control the gateway. You can learn about them by referring to the Kannel User Guide.

Listing 1. Sample configuration file for the gateway


#The sample.conf file which is the core configuration file
#for running the WAP Gateway
#Start of Configuration File

group = core
admin-port = 13000
admin-port-ssl = false
admin-password = rose123
status-password = rose123
admin-deny-ip = "205.158.62.76"
admin-allow-ip = "*.*.*.*"
wapbox-port = 13002
box-deny-ip = "205.158.62.76"
box-allow-ip = "*.*.*.*"
udp-deny-ip = "205.158.62.76"
udp-allow-ip = "*.*.*.*"
wdp-interface-name = "*"
log-file = "my_kannel.log"
log-level = 1

#The wapbox group for WAP gateway configuration
group = wapbox
bearerbox-host = localhost
timer-freq = 1
log-file = "my_wap.log"
log-level = 1
#End of Configuration File

Understanding the various attributes given in the sample configuration file
A group contains the ID of the group to which it relates. If the ID is core, then it's the bearerbox configuration; otherwise, a wapbox ID is for the wapbox configuration. The admin-port identifies the port through which the HTTP administration is to be done. The various other attributes of the group bearerbox and wapbox are described in Tables 2 and 3. The mandatory fields are denoted by an m, o is optional, and c is conditional.

Table 1. Configuration file attributes for the bearerbox

VariableValueDescription
group (m)coreThis is a mandatory variable.
admin-port (m)port-numberThe port number in which the bearerbox listens to HTTP administration commands. It can reach any port and must be over 1023.
admin-port-ssl (o)boolIf set to true, an SSL-enabled administration HTTP server is used instead of the default nonsecure plain HTTP server. Default is 'no'.
admin-password (m)stringPassword for HTTP administration commands.
status-passwordstringPassword to request Kannel status. If not set, no password is required; if set, either this or admin-password can be used.
admin-deny-ipIP-listThese lists can be used to prevent connection from the specified IP addresses.
admin-allow-ipIP-listCan be used as a wild card.
wapbox-port (c)port-numberPort for wapbox connections. If not set, Kannel cannot handle WAP traffic.
box-deny-ipIP-listThese lists can be used to prevent box connections from the specified IP addresses.
box-allow-ipIP-listSame as admin. It allows IP.
udp-deny-ipIP-listDenying UDP packets from a given IP.
udp-allow-ipIP-listAllowing UDP packets from an IP.
wdp-interface-name(c)IP or *If this is set, Kannel listens to WAP UDP packets incoming to ports 9200 through 9208, bound to given IP. If no specific IP is needed, use just an asterisk (*).
log-filefilenameA file in which to write a log. This is in addition to stdout and any log file defined in the command line. Log-file in core group is only used by the bearerbox.
log-levelnumber 0..5Minimum level of logfile events logged. 0 is for debug, 1 for info, 2 for warning, 3 for error and 4 for panic.

Table 2. Configuration file attributes for the wapbox

VariableValueDescription
group (m)wapboxThis is a mandatory variable.
bearerbox-host (m)hostnameThe machine hosting the bearerbox.
timer-freqvalue-in-secondsThe frequency with which timers are checked out. Default is 1.
log-filefilenameAs with bearerbox "core" group.
log-level number0 through 5Meaning same as in bearerbox.



Tutorial Pages:
» Basic steps for setting up a WAP gateway
» Kannel gateway architecture
» Basic software and hardware requirements
» Setting up the gateway
» Working with the gateway
» Starting the gateway
» Administering the gateway through an HTTP interface
» Testing with a WAP-enabled mobile phone simulator
» In conclusion
» Resources


First published by IBM DeveloperWorks


 | Bookmark
Related Tutorials:
» How to Install PHP 5 on Linux
» How to Install Apache 2 on Linux
» How to Install MySQL 5.0 on Linux
» SMB Caching
» Mound --Bind
» Tar Wild Card Interpretation

Advertise with Us!


Tutorials Scripts Web Hosting Developer Manuals
Resources