0

Please is it possible to set The unique message identifier, that will later be returned in the DLR for reference purpose.

Let me explain my current process below:

My approach is we send a message to the smsc gateway we get an id from smsc, we save this id and when DLR comes we match the id from the dlr to the id we previously save (because we push million of messages for a short period this approach isn't optimal for us, the back and forth to the database).

what I will like to acheive is if there is a way we can add a parameter to the submit message to smsc and retrieve this id when the dlr comes back.

I am using https://github.com/podshumok/python-smpplib for python and https://github.com/uudashr/jsmpp for java

EDIT

Below is my PDU for Submit SM

{'ms_msg_wait_facilities': None, 'priority_flag': None, 'language_indicator': None, 'its_reply_type': None, '_sequence': 2, 'registered_delivery': True, 'schedule_delivery_time': None, 'sm_default_msg_id': None, 'callback_num_pres_ind': None, 'source_subaddress': None, '_length': 70, 'user_response_code': None, 'sar_msg_ref_num': None, 'short_message': 'Lets Test MT\n', 'privacy_indicator': None, 'user_message_reference': 12, 'sar_total_segments': None, 'dest_addr_ton': 1, 'callback_num': None, 'sar_segment_seqnum': None, '_client': <smpplib.client.Client object at 0x7f2058a6a910>, 'service_type': None, 'source_addr_ton': 1, 'payload_type': None, 'validity_period': None, 'destination_addr': '2349*********', 'esm_class': 0, 'status': 0, 'display_time': None, 'source_addr': '7****', 'replace_if_present_flag': None, 'dest_subaddress': None, 'sm_length': 13, 'data_coding': 0, 'its_session_info': None, 'destination_port': None, 'ussd_service_op': None, 'sms_signal': None, 'protocol_id': 100, 'ms_validity': None, 'source_addr_npi': 1, 'source_addr_subunit': None, 'dest_addr_npi': 1, 'client': <smpplib.client.Client object at 0x7f2058a6a910>, 'command': 'submit_sm', 'more_messages_to_send': None, 'dest_addr_subunit': None, 'source_port': None, 'number_of_messages': None, 'alert_on_message_delivery': None}

Below I have the PDU for DeliverSM:

{'priority_flag': '0', 'message_state': None, 'language_indicator': None, 'callback_num': None, 'payload_type': None, 'replace_if_present_flag': '0', 'schedule_delivery_time': '', 'sm_default_msg_id': '0', 'source_subaddress': None, 'user_response_code': None, 'sar_total_segments': None, 'short_message': 'id:157de861 sub:001 dlvrd:000 submit date:1705171812 done date:1705171812 stat:UNDELIV err:255', 'privacy_indicator': None, 'user_message_reference': None, 'sar_msg_ref_num': None, 'dest_addr_ton': '1', 'sar_segment_seqnum': None, 'esm_class': '4', '_sequence': 67108866, 'service_type': '', 'source_addr_ton': '1', 'validity_period': '', 'destination_addr': '7****', '_client': <smpplib.client.Client object at 0x7f2058a6a910>, 'status': 0, 'source_addr': '234********', 'registered_delivery': '0', 'dest_subaddress': None, 'message_payload': None, 'sm_length': '94', 'data_coding': '0', 'destination_port': None, 'source_addr_npi': '1', 'protocol_id': '0', 'network_error_code': None, 'its_session_info': None, 'dest_addr_npi': '1', 'length': 145, 'client': <smpplib.client.Client object at 0x7f2058a6a910>, 'command': 'deliver_sm', 'source_port': None, 'receipted_message_id': None}

2 Answers2

1

There is an optional user_message_reference TLV parameter that can be set to your message ID for reference, however, I'd suggest testing first, in case your SMSC doesn't support it.

pilsetnieks
  • 10,330
  • 12
  • 48
  • 60
  • Thanks will try it out now – Kolawole Balogun May 17 '17 at 18:05
  • It seems that your SMSC simply doesn't support this parameter. The SMPP standard doesn't have any other way to put your reference ID in, so I'd ask your SMSC, whether they could support the parameter and if not, then are there any other options - maybe they have some custom solution for this, though it is unlikely. – pilsetnieks May 17 '17 at 18:47
  • thanks so much @pilsetnieks. will have to look for a way around it then. Really appreciate – Kolawole Balogun May 17 '17 at 18:55
  • 1
    Why don't you simply use message_id returned on submit, write it to your database, so upon DR you can match the record (I suggest you match together with the recipient number also provided in DR as sender number) – Marvin Jul 07 '17 at 09:25
0

For my async SMPP client, naz; what I did was:

  • When it sends a SUBMIT_SM request to SMSC, it keeps a record of the sequence_number somewhere(in-memmory or database etc)
  • Since SMSC always returns that sequence_number in SUBMIT_SM_RESP; get the sequnce_number and look it up from where we had saved it.

That will work for SUBMIT_SM & SUBMIT_SM_RESP. You will need some other mechanism for relating SUBMIT_SM & DELIVER_SM. That is where user_message_reference comes in. Unfortunately, some/most SMSCs do not support user_message_reference

Komu
  • 14,174
  • 2
  • 28
  • 22