command_status codes
Every SMPP server response carries a command_status. With 0 everything went fine; with any other value, this table tells you why and what to do.
4 min read
The codes
| Code | Arrives in | Cause | What to do | Closes the connection? |
|---|---|---|---|---|
0x00000000 ESME_ROK | bind_*_resp, | Accepted. | In a submit_sm_resp, store the message_id: receipts carry it. | No |
0x00000001 ESME_RINVMSGLEN | submit_sm_resp | The submit_sm is malformed, or carries no text in either short_message or message_payload. | Check how your client builds the PDU. Do not retry it unchanged. | No |
0x00000002 ESME_RINVCMDLEN | generic_nack | The command_length is out of range (under 16 octets or over 64 KiB) or a string is not NUL-terminated. | Fix how the PDU is built. The connection is closed. | Yes |
0x00000003 ESME_RINVCMDID | generic_nack | The command is not supported: for example query_sm, submit_multi, data_sm, replace_sm or cancel_sm. | Turn that command off in your client. The connection stays open. | No |
0x00000004 ESME_RINVBNDSTS | submit_sm_resp, | The command does not fit the connection state: it arrived before a successful bind (enquire_link included), or it is a submit_sm over a receiver connection. | Bind first, and send over a transmitter or transceiver connection. An unbind without a bind gets this code and also closes the connection. | In some cases (see the cause) |
0x00000005 ESME_RALYBND | bind_*_resp | The connection was already bound, or you reached the connection cap and the new one is a transmitter: the last connection receiving receipts is not closed to make room for it. | Reuse your connections instead of opening more. | No |
0x00000008 ESME_RSYSERR | bind_*_resp, | Hablame internal error. | Retry with a backoff. If it keeps happening, tell us on WhatsApp with your system_id and the time. | No |
0x0000000A ESME_RINVSRCADR | bind_*_resp | You connected from an IP address that is not authorized for your account. | Ask support to authorize that IP address. | No |
0x0000000B ESME_RINVDSTADR | submit_sm_resp | The submit_sm has no destination_addr. | Send the destination number. | No |
0x0000000D ESME_RBINDFAIL | bind_*_resp | The password is wrong, the bind is malformed (and the connection is closed), or there were too many failed attempts: after 5 in one minute from the same IP and system_id, the rest of that minute gets this code even with the right password. | Check the password and wait for the next minute before retrying. | In some cases (see the cause) |
0x0000000F ESME_RINVSYSID | bind_*_resp | The system_id does not exist or the account is disabled. | Check the system_id. If it is right, contact support. | No |
0x00000014 ESME_RMSGQFUL | submit_sm_resp | Hablame cannot take more messages right now. | Retry later, with an increasing backoff. | No |
0x00000045 ESME_RSUBMITFAIL | submit_sm_resp | Your account cannot send right now, for example because it is suspended. | Do not retry in a loop: contact support. | No |
0x00000058 ESME_RTHROTTLED | submit_sm_resp | You went over 3,000 submit_sm per second on that connection, or Hablame is briefly slowing intake to protect itself. | Slow down and retry that message with a backoff. The connection stays open. | No |
generic_nack
When the server cannot reply with the command’s own response, because it does not understand or support it, it replies generic_nack with 0x00000002 or 0x00000003. Responses we did not ask for are ignored without a reply.
Wrong password
A wrong password gets 0x0000000D (ESME_RBINDFAIL), not 0x0000000E (ESME_RINVPASWD): the server never returns that code. Some SMPP clients stop reconnecting for good when they get that code; with 0x0000000D they keep retrying and recover on their own as soon as you fix the password.
When to retry
- Retry with an increasing backoff: 0x00000058, 0x00000014 and 0x00000008. They are temporary.
- Do not retry unchanged: 0x00000001, 0x0000000B and 0x00000003. The problem is in the PDU.
- Check your account before retrying: 0x0000000A, 0x0000000D, 0x0000000F and 0x00000045.