Skip Menu |

This queue is for tickets about the Net-SMPP CPAN distribution.

Report information
The Basics
Id: 39357
Status: new
Priority: 0/
Queue: Net-SMPP

People
Owner: Nobody in particular
Requestors: bas [...] baspeters.com
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: 1.11
Fixed in: (no value)



Subject: Optional parameters "message_state" and "receipted_message_id" broken in deliver_sm
Disclaimer: I'm new to perl and it is not my usual language, so please forgive me if I am not in the position to give the best solution. The piece of code below is typical for a DELIVER_SM response: %resp=('seq'=>$sequence_number, 'destination_addr'=>$source_addr, 'source_addr'=>$destination_addr, 'short_message'=>$msg, 'esm_class'=>4, 'message_state'=>2, 'receipted_message_id' => $message_id); $resp{'cmd'}=0x00000005; $c->deliver_sm(%resp); There are two major flaws in the last two response parameters, message_state and receipted_message_id. message_state: According to the SMPP specifications this should be a single byte containing a number from 1 to 8 When it is set like in the example above, the number is put correctly in the PDU logging, but is sent incorrectly to the SMPP client. It turns out that not the byte, but the char representation of the byte is used. Hence the workaround for this problem is to do a char conversion like this: 'message_state'=>chr(2) receipted_message_id: According to the SMPP specifications this should be a C-String (null terminated) Most strings are C-Strings in the SMPP parameters and are nicely translated by net:smpp so the developer does not need to supply the chr(0) at the end. For this parameter however, this conversion is not done. The only workaround for this problem is to specify it hardcoded: 'receipted_message_id' => $message_id. "\0" Tested on FreeBSD 6.2 AMD64 on perl v5.8.8 using NET:SMPP 1.11