Adobe 38043740 - ColdFusion Standard - Mac Development Manual page 1308

Developing applications
Hide thumbs Also See for 38043740 - ColdFusion Standard - Mac:
Table of Contents

Advertisement

DEVELOPING COLDFUSION 9 APPLICATIONS
Using External Resources
Field
Contents
messagePayload
Message data. To convert data to binary format, use the ColdFusion
destAddress
Address to which to send the message.
sourceAddress
Address of this application; can be omitted if specified in the configuration file.
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 the 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
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 documentation 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.
Synchronization mode
You can specify asynchronous or synchronous message mode in the gateway configuration file.
• If you specify asynchronous mode, the
submits the message to service code for sending to the SMSC. ColdFusion logs errors that occur after this point,
such as if a message sent by the gateway to the SMSC times out or if the gateway gets an error response; the
application does not get notified of any errors.
• If you specify synchronous mode (the default), the
gateway gets a response from the SMSC or the attempt to communicate times out. If the message is sent
successfully, the function returns the SMPP message ID string. If an error occurs, the function returns an error
string.
Use synchronous mode if your application must determine whether its messages reach the SMSC. Also use
synchronous mode if the application requests return receipts.
Note: If you use synchronous mode and the SMSC returns the messgeID as a hexadecimal string, ColdFusion converts it
automatically to its decimal value.
method converts an incoming message to binary data, and sends the
function returns an empty string when the gateway
sendGatewayMessage
sendGatewayMessage
Last updated 1/20/2012
toBinary
function.
function does not return until the
1303

Advertisement

Table of Contents
loading

This manual is also suitable for:

Coldfusion 9

Table of Contents