Adobe COLDFUSION 9 Manual page 1305

Developing applications
Hide thumbs Also See for COLDFUSION 9:
Table of Contents

Advertisement

DEVELOPING COLDFUSION 9 APPLICATIONS
Using External Resources
CFEvent.Data.registeredDelivery field
The CFEvent.Data.registeredDelivery field indicates whether the message sender has requested a receipt or
acknowledgment. Your application can respond to a request for an SME Delivery Acknowledgement or an SME
Manual/User Acknowledgement. (Only the SMSC sends the other notification types.) For more information on these
notification types, see the SMS 3.4 specification. Appendix B contains detailed information on the information that
you must place in the shortMessage field of the returned acknowledgment message.
Incoming message handling example
The following example code is an SMS-only version of the echo.cfc example that is included in the ColdFusion
gateway/cfc/examples directory. This example shows the minimal code required to receive and respond to an SMS
message.
<cfcomponent displayname="echo" hint="Process events from the test gateway and return echo">
<cffunction name="onIncomingMessage" output="no">
<cfargument name="CFEvent" type="struct" required="yes">
<!--- Get the message --->
<cfset data=cfevent.DATA>
<cfset message="#data.message#">
<!--- where did it come from? --->
<cfset orig="#CFEvent.originatorID#">
<cfset retValue = structNew()>
<cfset retValue.command = "submit">
<cfset retValue.sourceAddress = arguments.CFEVENT.gatewayid>
<cfset retValue.destAddress = arguments.CFEVENT.originatorid>
<cfset retValue.shortMessage = "echo: " & message>
<!--- send the return message back --->
<cfreturn retValue>
</cffunction>
</cfcomponent>
Sending outgoing messages
Your ColdFusion application can send
outgoing message.
The submit command
To send a message to a single destination address in an SMPP SUBMIT_SM PDU, the structure used in the Data
parameter of a
SendGatewayMessage
following fields:
Field
Contents
command
If present, the value must be
shortMessage
The Message contents. specify one of these fields, but not both. The SMPP specification imposes a maximum
size of 254 bytes on the
or
messagePayload
the payload length, followed by the message contents.
messagePayload
destAddress
The address to which to send the message (required).
sourceAddress
The address of this application. You can omit this field if it is specified in the configuration file.
,
, and
submit
submitMulti
function or the return variable of the CFC listener method normally has the
"submit"
. If you omit this field, the event gateway sends a submit message.
shortMessage
field, and some carriers could limit its size further. The
field can contain up to 64 K bytes; it must start with 0x0424, followed by 2 bytes specifying
Last updated 8/5/2010
commands to the event gateway in an
data
1300

Advertisement

Table of Contents
loading

Table of Contents