User Guide

SMS gateway message sending commands 1051
Example
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>