Whatever message this page gives is out now! Go check it out!
Field | Contents |
command | If present, the value must be "submit". If you omit this field, the event gateway sends a submit message. |
shortMessage_or_messagePayload | The Message contents. specify one of these fields, but not both. The SMPP specification imposes a maximum size of 254 bytes on the shortMessage field, and some carriers could limit its size further. The messagePayload field can contain up to 64 K bytes; it must start with 0x0424, followed by 2 bytes specifying the payload length, followed by the message contents. |
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. |
<h3>Sending SMS From a Web Page Example</h3>
<cfif IsDefined("form.oncethrough") is "Yes">
<cfif IsDefined("form.SMSMessage") is True AND form.SMSMessage is not "">
<h3>Sending Text Message: </h3>
<cfoutput>#form.SMSMessage#</cfoutput><br>
<cfscript>
/* Create a structure that contains the message. */
msg = structNew();
msg.command = "submit";
msg.destAddress = "5551234";
msg.shortMessage = form.SMSMessage;
ret = sendGatewayMessage("SMS Menu App - 5551212", msg);
</cfscript>
</cfif>
<hr noshade>
</cfif>
<!--- begin by calling the cfform tag --->
<cfform action="command.cfm" method="POST">
SMS Text Message: <cfinput type="Text" name="SMSMessage" value="Sample text Message" required="No" maxlength="160">
<p><input type = "submit" name = "submit" value = "Submit">
<input type = "hidden" name = "oncethrough" value = "Yes">
</cfform>
</body>
</html>Field | Contents |
command | Must be "submitMulti". |
shortMessage_or_messagePayload | The message contents. Specify one of these fields, but not both. The SMPP specification imposes a maximum size of 254 bytes on the shortMessage field, and some carriers could limit its size further. The messagePayload field can contain up to 64 K bytes; it must start with 0x0424, followed by 2 bytes specifying the payload length, followed by the message contents. |
destAddress | A ColdFusion array of destination addresses (required).You cannot specify individual TON and NPI values for these addresses; all must conform to a single setting. |
sourceAddress | The address of this application; you can omit this field if it is specified in the configuration file. |
<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 = "submitmulti"> <cfset retValue.sourceAddress = arguments.CFEVENT.gatewayid> <cfset retValue.destAddresses=arraynew(1)> <!--- One destination is incoming message originator; get the address from CFEvent originator ID. ---> <cfset retValue.destAddresses[1] = arguments.CFEvent.originatorid> <cfset retValue.destAddresses[2] = "555-1235"> <cfset retValue.shortMessage = "echo: " & message> <cfreturn retValue> </cffunction> </cffunction> |
Field | Contents |
command | Must be "data" . |
messagePayload | Message data. To convert data to binary format, use the ColdFusion toBinary function. |
destAddress | Address to which to send the message. |
sourceAddress | Address of this application; can be omitted if specified in the configuration file. |
<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> |
<h3>Sending SMS From a Web Page Example</h3>
<cfif IsDefined("form.oncethrough") is "Yes">
<cfif IsDefined("form.SMSMessage") is True AND form.SMSMessage is not "">
<h3>Sending a Text Message: </h3>
<cfoutput>#form.SMSMessage#</cfoutput><br><br>
<cfscript>
/* Create a structure that contains the message. */
msg = structNew();
msg.command = "submit";
msg.destAddress = "5551234";
msg.shortMessage = form.SMSMessage;
ret = sendGatewayMessage("SMS Menu App - 5551212", msg);
</cfscript>
</cfif>
<cfif isDefined("ret") AND ret NEQ "">
<h3>Text message sent</h3>
<cfoutput>The Message Id is: #ret#</cfoutput>
<br><br>
</cfif>
<hr noshade>
</cfif>
<!--- begin by calling the cfform tag --->
<cfform>
SMS Text Message: <cfinput type="Text" name="SMSMessage"
value="Sample text Message" required="No" maxlength="160">
<p><input type = "submit" name = "submit" value = "Submit">
<input type = "hidden" name = "oncethrough" value = "Yes">
</cfform>params["parameter"]=BinaryDecode("string","binaryencoding"); params["parameter"]=CharsetDecode("string, encoding"); outgoingSMS.optionalParameters=params; |
out.optionalParameterValue="value"; |
Value | Meaning |
0 | (Default) Do not return delivery information. |
1 | Return a receipt if the message is not delivered before the time-out. |
2 | Return a receipt if the message is delivered or fails. |