If you try to send a message, you succeed. A message is sent using the submit_sm method.
The first line displays the result of query_sm, which returns the status of the message. State 2 corresponds to the DELIVERED status (from the SMPP v3.4 specification). This means that the SMSC delivered the message to the mobile device.
The error is generated by the replace_sm method. The replace_sm method will only replace the message that is still in the SMSC, that is, still awaiting delivery. If the message has already been delivered, the SMSC returns an error in the response PDU. The same applies to the cancel_sm method. It only works with messages that are still waiting for delivery.
Johnc source share