I'm having a confusion on how to receive delivery receipt from ESME to SMSC?
For Example : If i terminate an Message from SMSC to ESME,then how can ESME sends delivery receipt for the corresponding Message received from SMSC.
If SUBMIT_SM is used for sending the delivery receipt to SMSC,then How can the SMSC differentiates a Normal Text Message and a Delivery Receipt from ESME?
Thanks in advance. :)
Within the SUBMIT_SM message, there is a field called "esm_class" which will allow you to send a delivery receipt to the SMSC. From the SMPP specification 5.0 page 125 the field contains a number of flags that can be set depending upon what kind of message you are sending. The flags for delivery receipts are below.
xx0001xx Short Message contains MC Delivery Receipt Message Type (bits 2 and 5)
xx1000xx Short Message contains Intermediate Delivery Notification
xx0010xx Short Message contains Delivery Acknowledgement
I believe that you will need to send an Intermediate Delivery Notification then a Delivery Acknowledgement message to the SMSC. The Intermediate Delivery Notification is probably optional.
Note that this is highly dependent on what is implemented in the SMSC. It's possible that the SMSC does not even handle these delivery receipts and perhaps will assume that the SMS has been delivered when you send the SUBMIT_SM_RESP in response to the SUBMIT_SM, or perhaps as soon as the SUBMIT_SM message is sent. You will need to test what happens.
Related
I would like to send 1000 messages and retransmit only those that failed. Is there any way?
Are there any methods to identify each failed message, such as a unique message ID?
As you can see, there is no identifiable message ID.
Is actually possible that only one message should be resent as in this case?
Should I resend only this message or all the bulk?
Should I use Exponential Backoff? Then, Where can I find example source?
I'm working on an app that requires to read the reply of a particular sms message sent and update the Database, i know i can use SmsManager (Pending Intent) class to know the status of the message (Like SENT or DELIVERED) and also broadcast receiver for receiving sms but i want to be able to read the user reply to that sms.
There can be multiple message sent at a particular time which i want to be able to differentiate between response for each sms.
Is there a way to attach something like an id to sms and get it back when i receive the reply or how can i achieve this? most of the tutorials online only cover how to listen to the status and how to receive new sms.
I have a use case where i need to send one or more messages to a single sns topic in one asyncPublish sns call. Is there a possible way by which i can do that ?
The Publish() command:
Sends a message to an Amazon SNS topic or sends a text message (SMS message) directly to a phone number.
It only sends a single message.
In jms (v1.0) subscriber client ack mode, message.acknowledge() is the only way to send an ack back to server(broker) side. The actual behaviour is if client ack to message3 then message sender(broker) client acks to all messages up to message3[1].
i.e
msg1, msg2, msg3 is delivered to the client in order.
Client process messages ACK for every message, msg1, msg2 and msg3. >> OK
Knowing the actual behaviour client acks as batches(batch size=3), so asks to msg3 > OK (all messages upto msg3 get acked)
In scenario 1 and 2, broker get notified that client ACK to all 3 messages delivered. And client also actually process all 3 and ACK back.
Consider following scenario :
a. msg1 comes to client.
b. failed to process msg1. So avoid ack back. (msg1 never processed or acked from client side)
c. msg2 comes and successfully processed. And ack to msg2.
Therefore in the above scenario client ack does not guarantee the delivery of msg1.
Please explain is there a workaround to guaranteed delivery when batch process with client ack through JMS 1.0 spec.
[1] http://docs.oracle.com/javaee/7/api/javax/jms/Message.html#acknowledge
According to the spec:
By invoking acknowledge on a consumed message, a client acknowledges all messages consumed by the session that the message was delivered to.
So, the deal is to not acknowledge any more messages in a session where a message has failed.
Instead, if you detect a failure, you could either:
Tear down the session (or even Connection).
Invoke recover on your Session. That will restart message delivery with the oldest unacknowledged message.
I have SMPP server, use CloudHoper.
When I get a message I should return a delivery report.
Please, tell me, how I can do it?
At this moment I return SubmitSmResp...
Of course you still need to answer the SubmitSm PDU with a SubmitSmResp PDU as you do now.
A delivery report is a "special" DeliverSm PDU which is generated in your SMPP server and sent additionally to your client. See SMPP 3.4 Appendix B how it is formatted (https://github.com/twitter/cloudhopper-smpp/blob/master/src/etc/SMPP_v3_4_Issue1_2.pdf). You also need to set esmClass of the DeliverSm PDU to 0x04 to indicate it's a delivery report.
If your client is using a transceiver bind, you can use the same session to send the DeliverSm PDU to, otherwise you need use the clients receiver session. If no active session is available you need to queue the DeliverSm PDU.
The main question is when to send the delivery report. First of all, you may send only a delivery report, if the client requested one, by setting the 4th bit of the SubmitSm esmClass.
Although, if your client is using a transceiver connection, don't send it directly in the firePduRequestReceived handler. The client may receive it before it receives the SubmitSmResp. Additionally this delivery report would not have more value than the SubmitSmResp itself.
So there are three cases when you may generate this delivery report and queue it until you have a proper session from your client to send it to:
1) When you receive some external event indicating that the former SubmitSm was actually processed (e.g. delivered) by it's destination.
2) When you are able to forward the SubmitSm to the next processing unit.
3) When you detect any error or the SubmtSm expired
Create a DELIVER_SM for that message and send that to the client.