[PATCH] RE: Sqlbox acks
"Rene Kluwen" <[email protected]>
| Newsgroups | gmane.comp.mobile.kannel.devel |
|---|---|
| Message-ID | <[email protected]> |
Sorry, previous patch contained a memory leak. From: [email protected] [mailto:[email protected]] On Behalf Of Rene Kluwen Sent: Thursday, 12 August, 2010 21:05 To: [email protected] Subject: Sqlbox acks 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_2.patch
(application/octet-stream, 858 B)
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,17 @@
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(mack);
+
}
+
msg_destroy(msg);
}
}