[PATCH] empty SMS replaced by default message

2006-07-18 Thread Colin Pitrat

Hello,
I sent this patch a few days ago, but I've been told that mail with 
patch attached should be prefixed with [PATCH] so I resend it.


The problem is that judging by fields_to_dcs function in sms.c, an empty
message with an activating MWI flag should result in "discard message"
MWI whereas a non-empty message should result in "store message" MWI.

But when the smsbox handle the message sent by sendsms HTTP interface,
it replace the empty text by a default message. This problem is already
highlighted in the comment in the file. Here is the interesting part of
the file.

/*
  * Empty message? Two alternatives have to be handled:
  *  a) it's a HTTP sms-service reply: either ignore it or
  * substitute the "empty" warning defined
  *  b) it's a sendsms HTTP interface call: leave the message empty
  * if at least a UDH is given.
  *
  * XXX this still does not cover the case when the sendsms interface is
  * used with *no* text and udh. What should we do then?!
  */
  if (octstr_len(msg->sms.msgdata) == 0 && octstr_len(msg->sms.udhdata)
== 0) {
  if (trans != NULL && urltrans_omit_empty(trans))
  return 0;
  else
  msg->sms.msgdata = octstr_duplicate(reply_emptymessage);
  }

My proposition is to replace the if statement in order to check if the
message is a mt_reply (case a) or not.

Regards,
Colin

diff -ur gateway/gw/smsbox.c gateway-new/gw/smsbox.c
--- gateway/gw/smsbox.c 2006-07-13 10:05:57.0 +0200
+++ gateway-new/gw/smsbox.c 2006-07-13 10:20:11.0 +0200
@@ -324,12 +324,8 @@
  *  a) it's a HTTP sms-service reply: either ignore it or
  * substitute the "empty" warning defined
  *  b) it's a sendsms HTTP interface call: leave the message empty
- * if at least a UDH is given.
- *
- * XXX this still does not cover the case when the sendsms interface is
- * used with *no* text and udh. What should we do then?!
  */
-if (octstr_len(msg->sms.msgdata) == 0 && octstr_len(msg->sms.udhdata) == 
0) {
+if (octstr_len(msg->sms.msgdata) == 0 && msg->sms.sms_type == mt_reply) {
 if (trans != NULL && urltrans_omit_empty(trans))
 return 0;
 else



GSM Modem phones

2006-07-18 Thread Vaibhav Solanki
Hello all,
 
When i went through the faq of the kannel site, got the info that    * Nokia Premicell    * Siemens M20    * Wavecom WM02-G1800 modemwill support Kannel.
 
Can anyone suggest any other devices for the same purpose.
Awaiting replies...
 
Thankz 


Re: GSM Modem phones

2006-07-18 Thread Andrija Petrovic

Vaibhav Solanki wrote:

Hello all,
 
When i went through the faq of the kannel site, got the

info that
* Nokia Premicell
* Siemens M20
* Wavecom WM02-G1800 modem
will support Kannel.
 
Can anyone suggest any other devices for the same purpose.

Awaiting replies...
 
Thankz
 

Hi,
We are successfully using the following Siemens GSM modems:

MC39i
TC45
MC35i

but (being well acquainted with the source code) I believe that any 
HayesATcommand-enabled device will do the job.


Regards,
Andrija