[PATCH] Drop intermediate dlr mask

Alexander Malysh <[email protected]>
Newsgroups gmane.comp.mobile.kannel.devel
Message-ID <[email protected]>
Hi all,

this patch drops intermediate dlr mask from Kannel because it make no sense to extract SMPP specific
mask to abstracted Kannel DLR layer. Even more, intermediate dlr mask only used for the sending of
message but maps incoming intermediate DLR to buffered.

Attached patch drops intermediate dlr mask and request intermediate DLRs if buffered dlr mask set. The
same is on the receiver side: if we receive intermediate DLR, we map it to buffered. That means that both
side sending and receiving behave the same.

Alex
intermediate.patch (application/octet-stream, 2.1 KB)
diff --git a/doc/userguide/userguide.xml b/doc/userguide/userguide.xml
index 3157757..23dc5c9 100644
--- a/doc/userguide/userguide.xml
+++ b/doc/userguide/userguide.xml
@@ -9393,7 +9393,6 @@ ssl-server-key-file = "/etc/kannel/key1.pem"
 	<listitem><para>4: message buffered</para></listitem>
 	<listitem><para>8: smsc submit</para></listitem>
 	<listitem><para>16: smsc reject</para></listitem>
-	<listitem><para>32: smsc intermediate notifications</para></listitem>
 	</itemizedlist>
 	If you want multiple report types, you simply add the values together. For example if you want to get delivery success and/or failure
 	you set the <literal>dlr-mask</literal> value to 1+2. and so on. If you specify <literal>dlr-mask</literal> on the URL you pass on to
diff --git a/gw/dlr.h b/gw/dlr.h
index cc6ef53..d7bcc92 100644
--- a/gw/dlr.h
+++ b/gw/dlr.h
@@ -73,7 +73,6 @@
 #define	DLR_BUFFERED        0x04
 #define	DLR_SMSC_SUCCESS    0x08
 #define	DLR_SMSC_FAIL       0x10
-#define	DLR_INTERMEDIATE    0x20
 
 #define DLR_IS_DEFINED(dlr)          (dlr != DLR_UNDEFINED)
 #define DLR_IS_ENABLED(dlr)          (DLR_IS_DEFINED(dlr) && (dlr & (DLR_SUCCESS | DLR_FAIL | DLR_BUFFERED | DLR_SMSC_SUCCESS | DLR_SMSC_FAIL)))
@@ -86,7 +85,6 @@
 #define DLR_IS_BUFFERED(dlr)         (DLR_IS_DEFINED(dlr) && (dlr & DLR_BUFFERED))
 #define DLR_IS_SMSC_SUCCESS(dlr)     (DLR_IS_DEFINED(dlr) && (dlr & DLR_SMSC_SUCCESS))
 #define DLR_IS_SMSC_FAIL(dlr)        (DLR_IS_DEFINED(dlr) && (dlr & DLR_SMSC_FAIL))
-#define DLR_IS_INTERMEDIATE(dlr)     (DLR_IS_DEFINED(dlr) && (dlr & DLR_INTERMEDIATE))
 
 /* DLR initialization routine (abstracted) */
 void dlr_init(Cfg *cfg);
diff --git a/gw/smsc/smsc_smpp.c b/gw/smsc/smsc_smpp.c
index 5675ebb..b7d4275 100644
--- a/gw/smsc/smsc_smpp.c
+++ b/gw/smsc/smsc_smpp.c
@@ -1026,7 +1026,7 @@ static SMPP_PDU *msg_to_pdu(SMPP *smpp, Msg *msg)
     else if (DLR_IS_SUCCESS_OR_FAIL(msg->sms.dlr_mask))
         pdu->u.submit_sm.registered_delivery = 1;
 
-    if (DLR_IS_INTERMEDIATE(msg->sms.dlr_mask))
+    if (DLR_IS_BUFFERED(msg->sms.dlr_mask))
         pdu->u.submit_sm.registered_delivery += 16;
 
     /* set priority */
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.