3

I'm trying to query the status of an SMS sent via perl Net:SMPP module using query_sm.

I populate my submit_sm PDU as follows:

$resp_pdu1 = $smpp->submit_sm(
destination_addr => '12345678910',
short_message    => 'test message',
source_addr_ton => 0x05,
source_addr_npi => 0x00,
source_addr => 'testing',
dest_addr_ton => 0x02,
dest_addr_npi => 0x01,
data_coding => 0x00,
esm_class => 0x00,
) or die;

I pass the message id returned in submit_sm_rsp PDU as follows to my query_sm PDU:

$msg_id = $resp_pdu1->{message_id};
print $msg_id;print "\n";
$resp_pdu2 = $smpp->query_sm(
message_id => $msg_id,
source_addr_ton => 0x05,
source_addr_npi => 0x00,
source_addr => 'testing',
) or die;

My perl script runs without any errors and the message is received by MS , there are no errors while binding and unbinding to the SMSC.Examining a wireshark dump of the SMPP packets shows "Message ID invalid" in query_sm_rsp with error code 0x0C. I have checked and the message_id returned by submit_sm_rsp which I passed onto the query_sm PDU is the same. Any hints on why I'm getting this error?

mk_gocs
  • 58
  • 6
  • This problem may be cased by different formats of message identifiers in ubmit_sm_resp and query_sm PDUs. For example some SMSC may respond with decimal number but require hex for quirey_sm. I would recommend you to add logs by setting "$Net::SMPP::trace = 1" to see more details. – michael.bochkaryov Apr 27 '13 at 09:31
  • thanks for your suggestion. I did think that it might have been a problem of formatting message_id. For example the type of message_id that gets returned in the submit_sm_rsp is 6b743a5d. The SMSC I'm connecting to I think does not reply with decimal number. It's answering with a hex string or rather a hex value in a string. I was passing the message_id retrieved as is to the query_sm PDU. Do you mean that I should try converting it into a hex string and than pass it to query_sm. I turned on the SMPP trace and the flow of request response header and body was normal with no errors. – mk_gocs Apr 28 '13 at 10:05
  • You should first check with your SMSC provider formats of message_id expected in **submit_sm_resp** and **query_sm** commands. Then you need to convert message_id in appropriate form for query_sm command. Also this possible that on encoding message_id it is sent as string instead of number. This case you need to use pack() to encode message_id properly. – michael.bochkaryov May 08 '13 at 13:41

1 Answers1

1

Which SMPP mode does the SMSC operate in? My guess is - if the SMSC doesn't operate in store & forward mode then it might not keep the state of the message after sending it. In such a case, you could get an error upon querying the SMSC even though the message is delivered to the MS.

Johannes Liebermann
  • 811
  • 1
  • 10
  • 20
  • I suspected this would be the case. The SMSC does return an error upon querying for the sent SMS. SMPP version was 3.3 – mk_gocs Sep 11 '13 at 08:33