RE: [PATCH] smsc default-sender & forced-sender

"Oded Arbel" <[email protected]>
Newsgroups gmane.comp.mobile.kannel.devel
Message-ID <[email protected]>
Hi everyone.
 
I have applied the patch and tested some of it's functionality
(global/default sender and applied defaults) and I found that it does
what its advertised to do (or at least, it doesn't break anything
important ;-). I liked the way default-sender overrides global-sender,
but I didn't like the way I still have to set global-sender anyway - but
I guess that cannot be helped. 
along the way I had to put down a small fix for this patch to fix a tiny
memory leak, and here it is attached (it should patch against the CVS
too, but that probably wouldn't work well)
 
Anyway - this one is green on my side.
 
Have fun
 
Oded Arbel
m-Wise Inc.
[email protected]
 
--
Odette : "I thought you hated boys ?"
Verena : "Well, I figured , they're like stray dogs - you have to take
them in, otherwise they run wild and are a danger to society."
 -- from "The Strike"

 



-----Original Message-----
From: Angel Fradejas [mailto:[email protected]]
Sent: Tuesday, February 19, 2002 6:58 PM
To: Kannel Developers
Subject: [PATCH] smsc default-sender & forced-sender


Hi list,
 
Find attached my patch (version 2) to add support for default-sender and
forced-sender smsc config directives. I will explain some points:
 
1) smsbox: precedence of faked_sender, global_sender, from
------------------------------------------------------------
I have normalized the way these directives are applied. As I posted
previously [ with very little feedback I have to say :-( ], MT-replies,
and MT's were treated in different ways. 

I dapply 1) faked_sender then 2) global then 3) from 

obey_request_thread, smsbox_req_handle, smsbox_req_sendota were the
functions responsible for this. I changed smsbox_req_handle,
smsbox_req_sendota to work the same as obey_request_thread.
 
 
2) struct Msg* : applied_defaults
------------------------------------------------------------
Now smsbox and bearerbox records in the Msg* structure the defaults it
applies. This is coded in applied_defaults member. Each default is
represented by one bit, and are available for the rest of modules to
check with dlf_xxxx constants. For example, you could check inside a
smsc driver if global-sender was applied with something like this 
 
     if (msg->sms.applied_defaults & dfl_global_sender) { /*
global-sender was applied */.... }
 

3) config directives default-sender and forced-sender
------------------------------------------------------------
This directives can be established for each smsc. Both are optional.
 
default-sender :   it overrides faked-sender and global-sender, but NOT
&from=
forced-sender  :   as it name implies, it overrides anything. Every
message routed to this smsc will have this sender.
 

I'd greatly appreciate your feedback, bug reporting, flames, anything.
 
Any chance for commiting to cvs?
 
Have fun.
 
Angel Fradejas.
smscconn.patch (application/octet-stream, 413 B)
--- gw/smscconn.c.orig	Wed Feb 20 18:25:51 2002
+++ gw/smscconn.c	Wed Feb 20 18:26:19 2002
@@ -134,7 +134,9 @@
     octstr_destroy(conn->denied_prefix);
     octstr_destroy(conn->allowed_prefix);
     octstr_destroy(conn->preferred_prefix);
+    octstr_destroy(conn->default_sender);
+    octstr_destroy(conn->forced_sender);
     
     mutex_unlock(conn->flow_mutex);
     mutex_destroy(conn->flow_mutex);
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.