In this answer, I have shared my experience with SMPP. I have not used Talend ESB.
As per the SMPP 3.4 spec, sections 4.8, 5.2.28 and 6.1 provide description about the query_sm and query_sm_resp pdus. Here are some key points:
- query_sm
- Can only be requested by a ESME.
- Can be issued on a previously issued submit_sm, data_sm or submit_multi_sm pdu.
- source_addr, source_addr_ton, source_addr_npi sent and message_id received from the *_resp object are used on the query_sm pdu.
- qeury_sm_resp
- command_status can indicate the overall outcome of the query_sm pdu. Section 5.1.3 enlists all the values. You should check the API provider to know correct values to use.
- message_state indicates the state of the requested pdu. See section 5.2.28.
- error_code indicates error occurred in the network, if any. You should check the API provider to know correct values to use.
I would be curios to know what motivated you to use query_sm. query_sm pdus are rarely used in real life. At work, we process billions of SMS everyday from all major US carriers and we rarely get any query_sm.
Alternatives to query_sm would be "Delivery Receipt", yet not so much supported by most platforms. The immediate platform you are connected to can give you some info.