How expire the pending delivery reports after few hours in kannel - kannel

I am using kannel as sms gateway, sometimes My end operator not proving any delivery repose for messages. All pending dlrs are queuing in my redis storage.
Is there anyway, expire the dlrs after couple hours without appending validity period while sending

Related

How do i keep smpp 3.4 connection active without timeout

I have implemented this golang smpp package (https://github.com/fiorix/go-smpp) in my platform. After sending few SMS, i get a timeout and the sending stops. i.e Sending bulk sms messages to 5,000 contacts, only 500 contacts receive the message then there is a timeout. Kindly help with your suggestions on ow i can sustain the sending without the timeout.
Some of my smpp settings are;
EnquireLink: time.Duration(120) * time.Second,
EnquireLinkTimeout: time.Duration(122) * time.Second,
If you connect with SMPP as client to some SMPP server, the server will impose a idle timeout on your connection and drop the connection. From your side, you must ensure your EnquireLink is shorter than what the server expects, so your client will keep the connection busy and server won't drop it.
I would go for 10 seconds... SMPP is very light protocol (compared to HTTP etc) and one EnquireLink message every 10 seconds is not going to hurt.
I believe EnquireLink setting is how frequent you send EnquireLink and EnquireLinkTimeout is how long you allow the for the server to respond to it - which could be much shorter. So try:
EnquireLink: 10 seconds
EnquireLinkTimeout: 2seconds

SMS Delivery Reports

If you sent out an SMS message from a SMS Gateway, will send it to the mobile network so how we get the perfect result for SMS delivery..? they send us the number of successfully send message but not in detail like sent Successful on this numbers and for this number are failure
It totally depends on what SMS gateway you use, what destinations you send to (even within a country there are differences between operators)
You have 3 options really, and these are country/SMS route dependant:
No DLR support
Network DLR (so you get updates if the NETWORK has received the SMS)
Handset DLR (you will get updates if the HANDSET has received the SMS)
The handset DLR is the most reliable, but in general, depending on DLR for delivery stats is not something you want to do too much. Operators fake these (antispam measures), SMS route suppliers sometimes fake them to be able to offer lower pricing (by not submitting 10% of the messages for example), etc.
Only way to be sure if an SMS is delivered is by using testing services.
There are a number of them around. If you use services like Messagebird or BudgetSMS.net, you can get the DLR updates pushed to your server, for further processing on your end (they are linked to the sent SMS itself)

only 3 thread to access spring service layer at a time while keeping other request in buffer

We have an utility for sending an email to customers. Currently we are using outlook for sending an emails, But once we send multiple email at a time we get the following error msg.
DEBUG SMTP: MessagingException while sending
com.sun.mail.smtp.SMTPSendFailedException: 432 4.3.2 STOREDRV.ClientSubmit; sender thread limit exceeded
After debugging its found that we can't send 3 mails at a time. So thought another approach to send msgs by queuing the request and process the 3 request at a time while keeping other in buffer.
Note: Don't want to use any msq queuing service (like rabbitMQ etc)
Your suggests/inputs will be really helpful for me.
Thanks
If you are using MS Office SMTP (I guess from the error message), there is a limit on concurrent connection.
Documentation
Under the new limit, up to three concurrent connections are allowed to send email messages at the same time.

Watson IoT QoS1/2 Retries

Does anyone know what the Watson IoT broker does if publishes a QoS1 o 2 message and doesn't receive the appropriate acknowledgement from the client? Does it implement a time out (say 20 seconds or so) and then resend the message again? It seems that some brokers do this while others only resend the message on a new connection (if retain is set to 1 of course). The MQTT spec is a little vague on this point.
the message would be considered in-flight for the client that hasn’t acknowledged it, and that message redelivery will only occur when that client disconnects and reconnects (but only if the client was clean session = 0)
For QoS1 and 2:
At least once (QoS1)
With quality of service level 1 (QoS1), the message is always delivered at least once. If a failure occurs before an acknowledgment is received by the sender, a message can be delivered multiple times. The message must be stored locally at the sender until the sender receives confirmation that the message was published by the receiver. The message is stored in case the message must be sent again.
Exactly once (QoS2)
The "exactly once" quality of service level 2 (QoS2) is the safest, but slowest mode of transfer. The message is always delivered exactly once and must also be stored locally at the sender, until the sender receives confirmation that the message was published by the receiver. The message is stored in case the message must be sent again. With quality of service level 2, a more sophisticated handshaking and acknowledgment sequence is used than for level 1 to ensure that messages are not duplicated
MQTT keep alive interval
The MQTT keep alive interval, which is measured in seconds, defines the maximum time that can pass without communication between the client and broker. The MQTT client must ensure that, in the absence of any other communication with the broker, a PINGREQ packet is sent. The keep alive interval allows both the client and the broker to detect that the network failed, resulting in a broken connection, without needing to wait for the TCP/IP timeout period to be reached.
If your Watson IoT Platform MQTT clients use shared subscriptions, the keep alive interval value can be set only to between 1 and 3600 seconds. If a value of 0 or a value that is greater than 3600 is requested, the Watson IoT Platform broker sets the keep alive interval to 3600 seconds.
Retained messages
Watson IoT Platform provides limited support for the retained messages feature of MQTT messaging. If the retained message flag is set to true in an MQTT message that is sent from a device, gateway, or application to Watson IoT Platform, the message is handled as an unretained message. Watson IoT Platform organizations are not authorized to publish retained messages. The Watson IoT Platform service overrides the retained message flag when it is set to true and processes the message as if the retained message flag is set to false.

Rails 3.0 intermittent Connection timed out, execution expired errors

We're on four Amazon EC2 instances (one load balancer, one db, and two app) and are constantly getting random timeouts. We get at least one a day, sometimes more. Here are some examples:
Errno::ETIMEDOUT: Connection timed out - connect(2)
/usr/local/rvm/rubies/ruby-1.9.2-p180/lib/ruby/1.9.1/net/smtp.rb:546:in `initialize'
and
Timeout::Error: execution expired
[GEM_ROOT]/gems/activemodel-3.0.9/lib/active_model/attribute_methods.rb:354:in `match'
I'm not sure how to debug these as they are not related to application code or server load. CPU usage usually hovers below 10% with the biggest spike going up to 60%. The spikes are most likely due to running backups and do not correspond with the times of the timeout errors.
How can these types of errors be tracked down?
The first timeout looks like a legit connection timeout sending mail via SMTP. Are you hosting your own SMTP server or using a service?
Looks like sendgrid has been experiencing delays/timeouts the last couple of days:
We're currently seeing lots of volume in our queues and emails may be delayed for a short period. Stay tuned for updates. #status
Fix for SMTP Service Timeout/Fails
Setup a local mail relay that will hold mail and re-send if there are failures like this. We use a local Postfix relay in production for just this problem (so ActiveMailer uses sendmail to Postfix, which queues up mail and delivers via SMTP relay to Sendgrid).

Resources