Sqlbox acks

"Rene Kluwen" <[email protected]>
Newsgroups gmane.comp.mobile.kannel.devel
Message-ID <[email protected]>
Does anybody object to this simple patch which will take away a lot of
worries of sqlbox users?

 

It generates an ack to bearerbox if a message is directed to sqlbox itself
(i.e. not to an smsbox).

 

== Rene
sqlbox_acks_1.patch (application/octet-stream, 1.2 KB)
Index: sb-config.h.in
===================================================================
--- sb-config.h.in	(revision 31)
+++ sb-config.h.in	(working copy)
@@ -82,10 +82,6 @@
 /* Define to 1 if you have the <unistd.h> header file. */
 #undef HAVE_UNISTD_H
 
-/* Define to the sub-directory in which libtool stores uninstalled libraries.
-   */
-#undef LT_OBJDIR
-
 /* Name of package */
 #undef PACKAGE
 
Index: gw/sqlbox.c
===================================================================
--- gw/sqlbox.c	(revision 31)
+++ gw/sqlbox.c	(working copy)
@@ -491,7 +491,7 @@
 static void bearerbox_to_sql(void *arg)
 {
     Boxc *conn = (Boxc *)arg;
-    Msg *msg;
+    Msg *msg, *mack;
 
     while (sqlbox_status == SQL_RUNNING) {
         msg = read_from_box(conn->bearerbox_connection, conn);
@@ -522,7 +522,16 @@
                 gw_sql_save_msg(msg, octstr_imm("MO"));
             else
                 gw_sql_save_msg(msg, octstr_imm("DLR"));
+
+	    /* create ack message */
+	    mack = msg_create(ack);
+	    mack->ack.nack = ack_success;
+	    mack->ack.time = msg->sms.time;
+	    uuid_copy(mack->ack.id, msg->sms.id);
+	    send_msg(conn->bearerbox_connection, conn, mack);
+
         }
+
         msg_destroy(msg);
     }
 }
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.