Friday, July 11, 2008

Setting optional parameters in the SMS Gateway

Paul Hastings sent me a questions yesterday about the ColdFusion SMS Event Gateway. He wanted to know how users could set their own optional parameters in the text messages sent from the gateway. He blogged my answer, which means I can just link to it without writing it up myself.

A few notes: If the gateway receives optional parameters in a message, it will be included in the data struct that is returned to the onIncomingMessage CFC function under the "optionalParameters" key. CFDump to a file or console is your friend in these cases.

If you do not format the key (has to be able to be parsed by the Java Short.decode(String) function) or the value (must be a byte[], which in CFML is a "binary object") correctly the setting is silently ignored.

This functionality has been in the SMS Gateway since 7.0.2. It is not in the 7 or 8 documentation, which is bad, but we will correct this moving forward.


Blake Burdeen said...

That post was great - it also works for optional params being sent (MO) to a CF/Gateway by an SMSC.

Is there a similar 'undocumented' feature that allows for access to 'receipted_message_id' within the deliver_sm pdu (not the optional tlv/params). We don't see it anywhere in a dump of the event obj.

Blake Burdeen said...

Just to clarify -

this element is showing at the packet level as a TLV (within optional params). However, it has a tag of 0x001e which maps to receipted_message_id (which is unlike all the successful TLVs we've been able to handle with CF - such as 0x2150). CF seems to just ignore this one completely.

Tom said...


I asked one the (current) CF engineers to take a look at send you a response.

Blake Burdeen said...

Thanks - really appreciate it.

Paul Hastings said...

tom, was wondering if you think optionalParameters would handle "Segmentation and Reassembly (SAR)" TLV? been beating my head against the wall over this w/a couple of vendors. can't use UDH as one byte of that has to be null (0) & cf's never liked that.


Tom said...


You should be able to format a value with a null in it by making a CF 'binary' object somehow with the null in it. I don't have an example off hand as my CFML is rusty (all about the Flex now).

6tenkid said...

I'm getting an error on my page that reads:' is null or not an object
code: 0

Any idea where this coming from and what I should do to repair it? Thanks for your help.

Mobi Shastra said...

Great Post! Thanks for Sharing