User Guide

Table Of Contents
1078 Chapter 44: Using the SMS Event Gateway
The data command
To send binary data to a single destination address in an SMPP DATA_SM PDU, the Data
parameter of a
SendGatewayMessage function or the return variable of the CFC listener method
must have the following fields:
You can also set optional fields in the structure, such as a field that requests a delivery receipt. For
a complete list of fields, see “data command” in CFML Reference. For detailed descriptions of
these fields, see the documentation for the SUBMIT_MULTI PDU in the SMPP3.4
specification, which you can download from the SMS Forum at www.smsforum.net/.
Example: Using the data command
The following example onIncomingMessage method converts an incoming message to binary
data, and sends the binary version of the message back to the originator address:
<cffunction name="onIncomingMessage" output="no">
<cfargument name="CFEvent" type="struct" required="yes">
<!--- Get the message. --->
<cfset data=CFEvent.DATA>
<cfset message="#data.message#">
<!--- Create the return structure. --->
<cfset retValue = structNew()>
<cfset retValue.command = "data">
<!--- Sending to incoming message originator; get value from CFEvent. --->
<cfset retValue.destAddress = arguments.CFEvent.originatorid>
<cfset retValue.messagePayload = tobinary(tobase64("echo: " & message))>
<cfreturn retValue>
</cffunction>
Controlling SMS message sending and response
This section describes some of the more common options for sending messages, and how they
affect your application. For information on other ways to configure outgoing message, see the
SMPP specification.
This section describes the following topics:
Synchronization mode
Message disposition notification
Validity period
Field Contents
command Must be
“data”.
messagePayload Message data. To convert data to binary format, use the ColdFusion MX
toBinary function.
destAddress Address to which to send the message.
sourceAddress Address of this application; can be omitted if specified in the configuration file.