ESME_RINVMSGLEN in SMPP
What is ESME_RINVMSGLEN?
ESME_RINVMSGLEN (Error Code: 0x00000004) is an SMPP error that indicates an invalid message length in an SMPP request.
Possible Causes
- The message length exceeds the allowed limit (typically 254 or 160 characters for certain encodings).
- The message length is zero (empty message).
- Incorrect encoding causing unexpected length calculation.
- Corrupt or malformed PDU (Protocol Data Unit) being sent.
- Incorrect concatenation of long messages (splitting issues).
When Does It Happen?
This error occurs when submitting an SMPP PDU (e.g., submit_sm
, data_sm
) where the message length parameter does not conform to the expected length constraints set by the SMSC.
Example SMPP PDU Transaction
The following is an example of an incorrect submit_sm
PDU that could trigger the ESME_RINVMSGLEN
error:
0000003C 00000004 00000000 00000001 74657374 000101 35363137 38363530 30303000 0000 0000 0000 00000000 00000000 00
Issue: The message length field is set to zero, which results in an invalid message length error.
Another incorrect PDU where the message exceeds the allowed length:
00000100 00000004 00000000 00000002 74657374 000101 35363137 38363530 30303000 0000 0000 0000 00000000 00000100 (Too long)
How to Solve It?
- Ensure the message length is within the allowed limits (check SMSC restrictions).
- Validate encoding (e.g., UCS2 messages take 2 bytes per character).
- Ensure proper concatenation of long messages using
sar_msg_ref_num
,sar_total_segments
, etc. - Check for empty messages before sending.
- Verify the PDU format to ensure it is correctly structured.
If the issue persists, enable SMPP debugging on your client or SMS gateway to inspect the raw PDUs being transmitted.
More information
- SMPP operation ESME_ROK
- How to solve ESME_RINVCMDLEN in SMPP
- ESME RINVMSGLEN SMPP error code
- ESME_RINVCMDID SMPP error code
- ESME_RINVBNDSTS SMPP error code
- ESME_RALYBND SMPP error code
- ESME_RINVPRTFLG SMPP error code
- ESME_RINVREGDLVFLG SMPP error code
- ESME_RSYSERR SMPP error code
- ESME_RINVSRCADR SMPP error code
- ESME_RINVDSTADR SMPP error code
- SMPP Error Invalid Message ID
- ESME_RBINDFAIL SMPP error code
- ESME_RINVPASWD SMPP error code
- ESME_RINVSYSID SMPP error code
- ESME_RCANCELFAIL SMPP error code
- ESME_RREPLACEFAIL SMPP error code
- ESME_RMSGQFUL SMPP error code
- ESME_RINVSERTYP SMPP error code
- ESME_RINVNUMDESTS SMPP error code
- ESME_RINVDLNAME SMPP error code
- ESME_RINVDESTFLAG SMPP error code
- ESME_RINVSUBREP SMPP error code
- ESME_RINVESMCLASS SMPP error code
- ESME_RCNTSUBDL SMPP error code
- ESME_RSUBMITFAIL SMPP error code
- ESME_RINVSRCTON SMPP error code
- ESME_RINVSRCNPI SMPP error code
- ESME_RINVDSTTON SMPP error code
- ESME_RINVDSTNPI SMPP error code
- ESME_RINVSYSTYP SMPP error code
- ESME_RINVREPFLAG SMPP error code
- ESME_RINVNUMMSGS SMPP error code
- ESME_RTHROTTLED SMPP error code
- ESME_RINVSCHED SMPP error code
- ESME_RINVEXPIRY SMPP error code
- ESME_RINVDFTMSGID SMPP error code
- ESME_RX_T_APPN SMPP error code
- ESME_RX_P_APPN SMPP error code
- ESME_RX_R_APPN SMPP error code
- ESME_RQUERYFAIL SMPP error code
- ESME_RINVTLVSTREAM SMPP error code
- ESME_RTLVNOTALLWD SMPP error code
- ESME_RINVTLVLEN SMPP error code
- ESME_RMISSINGTLV SMPP error code
- ESME_RINVTLVVAL SMPP error code
- ESME_RDELIVERYFAILURE SMPP error code
- ESME_RUNKNOWNERR SMPP error code
- ESME_RSERTYPUNAUTH SMPP error code
- ESME_RPROHIBITED
- ESME_RSERTYPUNAVAIL SMPP error code
- ESME_RSERTYPDENIED SMPP error code
- ESME_RINVDCS SMPP error code
- ESME_RINVSRCADDRSUBUNIT SMPP error code
- ESME_RINVBCASTFREQINT SMPP error code
- ESME_RINVBCASTALIAS_NAME SMPP error code
- ESME_RINVBCASTAREAFMT SMPP error code
- ESME_RINVNUMBCAST_AREAS SMPP error code
- ESME_RINVBCASTCNTTYPE SMPP error code
- ESME_RINVBCASTMSGCLASS SMPP error code
- ESME_RBCASTFAIL SMPP error code
- ESME_RBCASTQUERYFAIL SMPP error code
- ESME_RBCASTCANCELFAIL SMPP error code
- ESME_RINVBCAST_REP SMPP error code
- ESME_RINVBCASTSRVGRP SMPP error code
- ESME_RINVBCASTCHANIND SMPP error code
- Reserved SMPP error code