0

Is it possible to send some extra data with smpp payload/pdu using custom paramters or any other way. Language API could be any java, jsmpp or any other. Kindly share an example if its possible.

Talal
  • 131
  • 1
  • 1
  • 13

1 Answers1

2

In SMPP specifications, you have this paragraph: "5.3.2 SMPP Optional Parameter Tag definitions" where you find all optional parameters you can add to a PDU.

The below is an example of setting sar_* options to a submit_sm to indicate that it's a part of a long submit_sm (using this python lib: https://github.com/mozes/smpp.pdu):

pdu = SubmitSM()
pdu.params['sar_total_segments'] = 3
pdu.params['sar_segment_seqnum'] = 1
pdu.params['sar_msg_ref_num'] = 56

Anyway, if you need to set your 'vendor specific' options and not to use standard optional parameters, you will need to implement it in you library on client and server sides, you may not find it ready and implemented in any standard library.

You may also think of defining a message structure to send your data (it depends on what you need to do ...), for example, delivery receipts are sent through a standard deliver_sm pdu with a specific message format, here's a method to check if a deliver_sm content represents a delivery receipt or a normal message:

def isDeliveryReceipt(self, DeliverSM):
    """Check whether DeliverSM is a DLR or not, will return None if not
    or a dict with the DLR elements"""
    ret = None

    # Example of DLR content
    # id:IIIIIIIIII sub:SSS dlvrd:DDD submit date:YYMMDDhhmm done
    # date:YYMMDDhhmm stat:DDDDDDD err:E text: . . . . . . . . .
    pattern = r"^id:(?P<id>\d{10}) sub:(?P<sub>\d{3}) dlvrd:(?P<dlvrd>\d{3}) submit date:(?P<sdate>\d{10}) done date:(?P<ddate>\d{10}) stat:(?P<stat>\w{7}) err:(?P<err>\w{3}) text:(?P<text>.*)"
    m = re.search(pattern, DeliverSM.params['short_message'], flags=re.IGNORECASE)
    if m is not None:
        ret = m.groupdict()

    return ret
zfou
  • 891
  • 1
  • 10
  • 33