Re: [PATCH] cimd2 validity period

2003-02-05 Thread Stipe Tolj
Bruno David Simões Rodrigues wrote:
> 
> Citando Nicholas Rahn <[EMAIL PROTECTED]>:
> 
> > Hi list,
> >
> > Attached is a patch implementing the validity period (relative) for
> > CIMD2 connections.  It has been tested with one of our swiss CIMD2
> > connections.
> >
> > The documentation for the "validity" parameter (sendsms interface) in
> > the User's Guide does not mention that this functionality might not be
> > implemented for certain SMSC types.
> 
> A quick search for validity shows:
> Can set Validity
>   ? ? ? ? y ? ? ? ? y ? ?
> 
> We can't mention for each parameter that "this might work or might not work for
> depending on connected smsc".
> 
> Better solution is to ask smsc developers to implement it and fix documentation ;)

yep, agreed :)

Stipe

[EMAIL PROTECTED]
---
Wapme Systems AG

Vogelsanger Weg 80
40470 Düsseldorf

Tel: +49-211-74845-0
Fax: +49-211-74845-299

E-Mail: [EMAIL PROTECTED]
Internet: http://www.wapme-systems.de
---
wapme.net - wherever you are




Re: [PATCH] cimd2 validity period

2003-02-01 Thread Bruno Rodrigues
On Sáb, 2003-02-01 at 12:21, Nicholas Rahn wrote:
> On Sat, 2003-02-01 at 04:47, Bruno David
> S=?ISO-8859-1?B?aW31ZXMgUm9kcmlndWVz?= wrote:
> > Citando Nicholas Rahn <[EMAIL PROTECTED]>:
> > 
> > > Hi list,
> > > 
> > > Attached is a patch implementing the validity period (relative) for
> > > CIMD2 connections.  It has been tested with one of our swiss CIMD2
> > > connections.
> > > 
> > > The documentation for the "validity" parameter (sendsms interface) in
> > > the User's Guide does not mention that this functionality might not be
> > > implemented for certain SMSC types.  
> > 
> > A quick search for validity shows:
> > Can set Validity
> >   ? ? ? ? y ? ? ? ? y ? ?
> > 
> > We can't mention for each parameter that "this might work or might not work for
> > depending on connected smsc".
> > 
> > Better solution is to ask smsc developers to implement it and fix documentation ;)
> 
> Best solution is for me to actually read that section of the
> documentation before complaining.  ;-)

No, it's good if someone complains. That way someone would remember that
he can do that patch and update documentation :)

> nick

-- 
Bruno Rodrigues <[EMAIL PROTECTED]>



signature.asc
Description: This is a digitally signed message part


Re: [PATCH] cimd2 validity period

2003-02-01 Thread Nicholas Rahn
On Sat, 2003-02-01 at 04:47, Bruno David
S=?ISO-8859-1?B?aW31ZXMgUm9kcmlndWVz?= wrote:
> Citando Nicholas Rahn <[EMAIL PROTECTED]>:
> 
> > Hi list,
> > 
> > Attached is a patch implementing the validity period (relative) for
> > CIMD2 connections.  It has been tested with one of our swiss CIMD2
> > connections.
> > 
> > The documentation for the "validity" parameter (sendsms interface) in
> > the User's Guide does not mention that this functionality might not be
> > implemented for certain SMSC types.  
> 
> A quick search for validity shows:
> Can set Validity
>   ? ? ? ? y ? ? ? ? y ? ?
> 
> We can't mention for each parameter that "this might work or might not work for
> depending on connected smsc".
> 
> Better solution is to ask smsc developers to implement it and fix documentation ;)

Best solution is for me to actually read that section of the
documentation before complaining.  ;-)

When i get a few free minutes, I'll try to create a patch for the doc to
add a 'y' to the "Can set Validity" section for cimd2.

nick






Re: [PATCH] cimd2 validity period

2003-01-31 Thread Bruno David Simões Rodrigues
Citando Nicholas Rahn <[EMAIL PROTECTED]>:

> Hi list,
> 
> Attached is a patch implementing the validity period (relative) for
> CIMD2 connections.  It has been tested with one of our swiss CIMD2
> connections.
> 
> The documentation for the "validity" parameter (sendsms interface) in
> the User's Guide does not mention that this functionality might not be
> implemented for certain SMSC types.  

A quick search for validity shows:
Can set Validity
  ? ? ? ? y ? ? ? ? y ? ?

We can't mention for each parameter that "this might work or might not work for
depending on connected smsc".

Better solution is to ask smsc developers to implement it and fix documentation ;)


> Nick
> 
> 
> 


-- 






Re: [PATCH] cimd2 validity period

2003-01-29 Thread Arne K. Haaje
mandag 27. januar 2003, 13:12, skrev Nicholas Rahn:
> Hi list,
>
> Attached is a patch implementing the validity period (relative) for
> CIMD2 connections.  It has been tested with one of our swiss CIMD2
> connections.
>
> The documentation for the "validity" parameter (sendsms interface) in
> the User's Guide does not mention that this functionality might not be
> implemented for certain SMSC types.  We found that it wasn't implemented
> for CIMD2 only after our clients told us it didn't work.  I'd be willing
> to write an explanation sentence or 2 for the "validity" parameter
> (sendsms interface) of the User's Guide if someone can tell me what
> other SMSCs it works/doesn't work for.

Our operator tells us it will work if we do not also use the permanent 
validity setting - and vice versa.

-- 
Med vennlig hilsen,
Eurobate ASA

Arne K. Haaje
Senior Network Engineer

Eurobate ASA - Postboks 4589 Nydalen - 0404 Oslo - Norway
Phone: +47 23 22 73 73 - Fax: +47 23 22 73 74 - Mob: +47 92 88 44 66
http://www.eurobate.com/





[PATCH] cimd2 validity period

2003-01-29 Thread Nicholas Rahn
Hi list,

Attached is a patch implementing the validity period (relative) for
CIMD2 connections.  It has been tested with one of our swiss CIMD2
connections.

The documentation for the "validity" parameter (sendsms interface) in
the User's Guide does not mention that this functionality might not be
implemented for certain SMSC types.  We found that it wasn't implemented
for CIMD2 only after our clients told us it didn't work.  I'd be willing
to write an explanation sentence or 2 for the "validity" parameter
(sendsms interface) of the User's Guide if someone can tell me what
other SMSCs it works/doesn't work for.

Question: In this patch, the "algorithm" to convert a time in minutes
into a integer according to the GSM 03.40 (section 9.2.3.12) spec was
copied from smsc_at2.c.  Is there a place in kannel where a generic
function like this could be added rather than copying code?


Nick



Index: gw/smsc/smsc_cimd2.c
===
RCS file: /home/cvs/gateway/gw/smsc/smsc_cimd2.c,v
retrieving revision 1.3
diff -u -r1.3 smsc_cimd2.c
--- gw/smsc/smsc_cimd2.c	14 Nov 2002 02:29:25 -	1.3
+++ gw/smsc/smsc_cimd2.c	27 Jan 2003 11:50:42 -
@@ -1207,6 +1207,7 @@
 int spaceleft;
 long truncated;
 int dcs = 0;
+int setvalidity = 0;
 
 gw_assert(msg != NULL);
 gw_assert(msg->type == sms);
@@ -1255,6 +1256,41 @@
"which does not start with the sender-prefix.",
 octstr_get_cstr(msg->sms.sender));
 }
+}
+
+/* Add the validity period if necessary.  This sets the relative validity
+ * period as this is the description of the "validity" parameter of the
+ * sendsms interface.
+ *
+ * Convert from minutes to GSM 03.40 specification (section 9.2.3.12).
+ * 0-143   = 0 to 12 hours in 5 minute increments.
+ * 144-167 = 12hrs30min to 24hrs in 30 minute increments.
+ * 168-196 = 2days to 30days in 1 day increments.
+ * 197-255 = 5weeks to 63weeks in 1 week increments.
+ *
+ * This code was copied from smsc_at2.c. 
+ */
+if (msg->sms.validity) {
+  if (msg->sms.validity > 635040)
+	setvalidity = 255;
+  if (msg->sms.validity >= 50400 && msg->sms.validity <= 635040)
+	setvalidity = (msg->sms.validity - 1) / 7 / 24 / 60 + 192 + 1;
+  if (msg->sms.validity > 43200 && msg->sms.validity < 50400)
+	setvalidity = 197;
+  if (msg->sms.validity >= 2880 && msg->sms.validity <= 43200)
+	setvalidity = (msg->sms.validity - 1) / 24 / 60 + 166 + 1;
+  if (msg->sms.validity > 1440 && msg->sms.validity < 2880)
+	setvalidity = 168;
+  if (msg->sms.validity >= 750 && msg->sms.validity <= 1440)
+	setvalidity = (msg->sms.validity - 720 - 1) / 30 + 143 + 1;
+  if (msg->sms.validity > 720 && msg->sms.validity < 750)
+	setvalidity = 144;
+  if (msg->sms.validity >= 5 && msg->sms.validity <= 720)
+	setvalidity = (msg->sms.validity - 1) / 5 - 1 + 1;
+  if (msg->sms.validity < 5)
+	setvalidity = 0;
+
+  packet_add_int_parm(packet, P_VALIDITY_PERIOD_RELATIVE, setvalidity);
 }
 
 /* Explicitly ask not to get status reports.



Re: [PATCH] cimd2 validity period

2003-01-27 Thread Stipe Tolj
Nicholas Rahn wrote:
> 
> Attached is a patch implementing the validity period (relative) for
> CIMD2 connections.  It has been tested with one of our swiss CIMD2
> connections.

patch commited to cvs.

> The documentation for the "validity" parameter (sendsms interface) in
> the User's Guide does not mention that this functionality might not be
> implemented for certain SMSC types.  We found that it wasn't implemented
> for CIMD2 only after our clients told us it didn't work.  I'd be willing
> to write an explanation sentence or 2 for the "validity" parameter
> (sendsms interface) of the User's Guide if someone can tell me what
> other SMSCs it works/doesn't work for.

yep, that would be great.

> Question: In this patch, the "algorithm" to convert a time in minutes
> into a integer according to the GSM 03.40 (section 9.2.3.12) spec was
> copied from smsc_at2.c.  Is there a place in kannel where a generic
> function like this could be added rather than copying code?

hmm, that's a good hint. We should have a "shared" file that
incorporates the GSM specific routines?!

Stipe

[EMAIL PROTECTED]
---
Wapme Systems AG

Vogelsanger Weg 80
40470 Düsseldorf

Tel: +49-211-74845-0
Fax: +49-211-74845-299

E-Mail: [EMAIL PROTECTED]
Internet: http://www.wapme-systems.de
---
wapme.net - wherever you are






[PATCH] cimd2 validity period

2003-01-27 Thread Nicholas Rahn
Hi list,

Attached is a patch implementing the validity period (relative) for
CIMD2 connections.  It has been tested with one of our swiss CIMD2
connections.

The documentation for the "validity" parameter (sendsms interface) in
the User's Guide does not mention that this functionality might not be
implemented for certain SMSC types.  We found that it wasn't implemented
for CIMD2 only after our clients told us it didn't work.  I'd be willing
to write an explanation sentence or 2 for the "validity" parameter
(sendsms interface) of the User's Guide if someone can tell me what
other SMSCs it works/doesn't work for.

Question: In this patch, the "algorithm" to convert a time in minutes
into a integer according to the GSM 03.40 (section 9.2.3.12) spec was
copied from smsc_at2.c.  Is there a place in kannel where a generic
function like this could be added rather than copying code?


Nick



Index: gw/smsc/smsc_cimd2.c
===
RCS file: /home/cvs/gateway/gw/smsc/smsc_cimd2.c,v
retrieving revision 1.3
diff -u -r1.3 smsc_cimd2.c
--- gw/smsc/smsc_cimd2.c	14 Nov 2002 02:29:25 -	1.3
+++ gw/smsc/smsc_cimd2.c	27 Jan 2003 11:50:42 -
@@ -1207,6 +1207,7 @@
 int spaceleft;
 long truncated;
 int dcs = 0;
+int setvalidity = 0;
 
 gw_assert(msg != NULL);
 gw_assert(msg->type == sms);
@@ -1255,6 +1256,41 @@
"which does not start with the sender-prefix.",
 octstr_get_cstr(msg->sms.sender));
 }
+}
+
+/* Add the validity period if necessary.  This sets the relative validity
+ * period as this is the description of the "validity" parameter of the
+ * sendsms interface.
+ *
+ * Convert from minutes to GSM 03.40 specification (section 9.2.3.12).
+ * 0-143   = 0 to 12 hours in 5 minute increments.
+ * 144-167 = 12hrs30min to 24hrs in 30 minute increments.
+ * 168-196 = 2days to 30days in 1 day increments.
+ * 197-255 = 5weeks to 63weeks in 1 week increments.
+ *
+ * This code was copied from smsc_at2.c. 
+ */
+if (msg->sms.validity) {
+  if (msg->sms.validity > 635040)
+	setvalidity = 255;
+  if (msg->sms.validity >= 50400 && msg->sms.validity <= 635040)
+	setvalidity = (msg->sms.validity - 1) / 7 / 24 / 60 + 192 + 1;
+  if (msg->sms.validity > 43200 && msg->sms.validity < 50400)
+	setvalidity = 197;
+  if (msg->sms.validity >= 2880 && msg->sms.validity <= 43200)
+	setvalidity = (msg->sms.validity - 1) / 24 / 60 + 166 + 1;
+  if (msg->sms.validity > 1440 && msg->sms.validity < 2880)
+	setvalidity = 168;
+  if (msg->sms.validity >= 750 && msg->sms.validity <= 1440)
+	setvalidity = (msg->sms.validity - 720 - 1) / 30 + 143 + 1;
+  if (msg->sms.validity > 720 && msg->sms.validity < 750)
+	setvalidity = 144;
+  if (msg->sms.validity >= 5 && msg->sms.validity <= 720)
+	setvalidity = (msg->sms.validity - 1) / 5 - 1 + 1;
+  if (msg->sms.validity < 5)
+	setvalidity = 0;
+
+  packet_add_int_parm(packet, P_VALIDITY_PERIOD_RELATIVE, setvalidity);
 }
 
 /* Explicitly ask not to get status reports.