• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

Chapter 32. Integrating with SMS and IM > Responding to SMS Messages

Responding to SMS Messages

Sending messages is one thing, responding to them is a different matter. As with IM gateway, our SMS gateway is always listening for incoming messages to answer. Modify your gateway CFC (sms.cfc) as below:

<cffunction name="onIncomingMessage"> 
        <cfargument name="CFEvent" type="struct" required="YES"> 
        <!--- Generate and return the message.---> 
        <cfscript> 
        msg = structNew(); 
        msg.command = "submit"; 
        msg.destAddress = arguments.CFEvent.originatorID; 
        msg.shortMessage = Trim(arguments.CFEvent.data.message); 
        
        return msg;
        </cfscript>
</cffunction> 


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint