Hi there, a) Is there *any* way at all to prevent kannel from sending SMS messages to a SMSC outside of certain hours? We're only allowed to send SMS messages to customers during (for example) Mon-Fri 9am-5pm.
I don't think the 'deferred' or 'validity' options of sendsms are useful in this situation. I would have thought that this would be a common requirement, but I have searched through all the archives to of this Users mailing list at http://www.kannel.org/pipermail/users/ and couldn't find anything. I think I have a fairly good knowledge of kannel by now, and have read through the entire user guide http://www.kannel.org/download/1.4.1/userguide-1.4.1/userguide.html . We definitely do have a lot of code in our application that will schedule SMS messages and will not send any messages to kannel outside the above time window. This works fine, but of course once the message gets to kannel, I can't see a way of telling kannel to *not* send the message at certain times. The reason it's important is that on some occassions the SMSC gets quite loaded, so of course kannel queues up the messages and starts falling behind. There's nothing stopping kannel to then send a queued message at 7pm for example. I see that I can put kannel into a "Suspended" state. From the user guide: Suspended. The gateway does not accept any new messages from SMS centers nor from UDP ports. Neither does it accept new sms and wapbox connections nor sends any messages already in the system onward. Sounds good in theory - maybe I could set up a cron job put kannel into a Suspended state at 5pm, and put it back into the normal Running state at 9am? But when kannel is placed into a Suspended state, I'm not sure if it's guaranteed what happens to i) Existing queued messages in kannel that haven't yet been sent out. ii) New messages that come into kannel. We do have the 'store-file' configuration setting active, which says: A file in which any received SMS messages are stored until they are successfully handled. By using this variable, no SMS messages are lost in Kannel, but theoretically some messages can duplicate when system is taken down violently. But I don't know if it's also guaranteed to not lose messages when placing kannel into a Suspended state. For ii) above (i.e. a new message comes into kannel while it's in a Suspended state), I observe that: - Sending the message to kannel with the usual 'sendsms' does cause kannel to accept the message. - But this message will not appear in the store-file file while kannel is Suspended. I can't even see it appear in the normal bearerbox access log. It only appears in these places when kannel is put back into the normal Running state. The implication of this is that if kannel happens to go down or get restarted while in a Suspended state, any new messages at least (ii) would get lost? Not sure what would happen to i) . For a test, I did try to bring down/restart kannel while in a Suspended state, and it was just chaos - I had lots and lots of trouble trying to bring kannel back up. It just hung a lot and did everything it could to refuse to come back up, all without logging anything at all to its usual log files so I couldn't see what it was doing. b) Currently our kannel server handles - 1) adhoc SMS messages which can be sent out at any time, and - 2) SMS messages for which I want to restrict the sending times, as described above. If you do have a solution to implement this restriction for 2) I assume I will have to separate out 1) and 2) so that each is sent to a separate server. (E.g. if I Suspend the kannel server for 2. then 1. won't work). But if there is a way to do the configuration to make both 1) and 2) still exist on the same server, then please let me know.
