User Guide

Table Of Contents
1082 Chapter 44: Using the SMS Event Gateway
To use the SMS simulator:
1.
Ensure that you have started the SMS test server and configured and started an SMS event
gateway instance in ColdFusion MX Administrator.
2.
Run SMSClient.bat in Windows or SMSClient.sh on UNIX or Linux. These files are located
in the cf_root\WEB-INF\cfusion\bin directory on J2EE configurations and the cf_root\bin
directory on server configurations.
If you installed a pure Java version of ColdFusion MX, for example, on Apple OS X systems,
enter the following command to start the simulator:
java -jar cf_root/WEB-INF/cfusion/lib/smpp.jar
3.
A dialog box appears, requesting the server, port, username, password, and the phone number
to use for this device. The simulator sends this phone number as the source address, and accepts
SMS messages sent by the SMSC server to it using this number as the destination address.
To connect to the SMS test server, accept the default values and specify an arbitrary phone
number; you can also specify any username-password pair that is configured in the
cf_root\WEB-INF\cfusion\lib\sms-test-users.cfg file or cf_root\lib\sms-test-users.cfg or file.
4.
Click Connect.
5.
The SMS device simulator client appears. In the Send SMS To field, enter a phone number in
the address-range property specified in the configuration file of the SMS event gateway that you
want to send messages to.
6.
Type a message directly into the message field (to the left of the Send button), or use the
simulator keypad to enter the message.
7.
Click the Send button.
The client simulator has a Connection menu with options to connect and disconnect from the
SMSC server, and to check the connection. The connection information appears in a status line
at the bottom of the client.
Sample SMS application
The following CFC implements a simple employee phone directory lookup application. The user
sends an message containing some part of the name to be looked up (a space requests all names).
The
onIncomingMessage response depends on the number matches.
If there is no match, the onIncomingMessage function returns a message indicating that there
are no matches.
If there is one match, the function returns the name, department, and phone number.
If there are up to ten matches, the function returns a list of the names preceded by a number
that the user can enter to get the detailed information.
If there are over ten matches, the function returns a list of only the first ten names. A more
complex application might let the user get multiple lists of messages to provide access to all
names.
If the user enters a number, and previously got a multiple-match list, the application returns
the information for the name that corresponds to the number.