Juan, AFAIK, the max-messages and omit-empty should be used when you answer the messages asynchronously:
* Kannel receives an SMS from sender 1234567890 to shortcode 4321. * Kannel check the routing and GET the request to http://my-url/my-script.php Now, my-script.php could act in different ways regarding the answer to that message: a) It could answer synchronously, with a set of headers and a text content. b) It could act asynchronously: print nothing and make a new request to the sendsms interface (or maybe an sqlbox query). In case "a", you should set max-messages to non-zero. Otherwise, the client will get nothing. In case "b", you should set max-messages to ZERO, since the response will be a new request and the client shouldn't get anything from the script. In this particular scenario, if you set max-messages to non-zero you'll get an "empty response from...". In my own experience, I usually set max-messages = 0 and use the sendsms or sqlbox interfaces to answer messages. In that scenario, the omit-empty setting it's irrelevant, unless I try to queue an empty message to sendsms (which would be a blatant BUG on my code, BTW). Hope it helps, Alejandro. On 1/30/07, Juan Nin <[EMAIL PROTECTED]> wrote:
Hi! I got doubts about how the exact combination of the omit-empty and max-messages parametrs should be... When I receive messages through Kannel, I invoke PHP scripts through get-url and then post the reply back through sendsms. So I have on each sms-service an "omit-empty = true" in order for Kannel not to send the "empty reply from service provider" message. I aslo have "max-messages = 0" for this to work... Now, some time ago, I added a new smsc-service, where I had the same conf as the previous one, but had to take out the "max-messages = 0" of the second one for it to work... So this worked: group = sms-service keyword = default omit-empty = true max-messages = 0 accepted-smsc-regex=^ab- get-url = "http://myHost.tld/myScript.php?smsc_id=%i&short_code=%P&phone=%p&message=%a" group = sms-service keyword = default omit-empty = true get-url = "http://myOtherHost.tld/myScript.php?smsc_id=%i&short_code=%P&phone=%p&message=%a" accepted-smsc-regex=^bb- On my initial conf I had "max-messages = 0" on the second sms-service too, but while having it, messages were never sent to the second PHP script When I took it out, both sms-services worked fine But nowadays I realize that I have other sms-services, where I also include the "max-messages = 0" directive, and they work fine... So my question is... when do you have to use it and when not?? I believe that on my first conf I didn't have a default sms-service as I have today: # Default # group = sms-service keyword = default omit-empty = true text = "No service specified" Can it be that I had that problem for not having this default service? If it's like that, should I then add the "max-messages = 0" to all the other sms-services? If that's the case, then why all work the same, while some have it and some don't? Sorry if it's a silly question... Thanks in advance, Juan
-- Alejandro Guerrieri Magicom http://www.magicom-bcn.net/ LinkedIn: http://www.linkedin.com/in/aguerrieri