FW: ack_failed_tmp

"Rene Kluwen" <[email protected]>
Newsgroups gmane.comp.mobile.kannel.devel
Message-ID <[email protected]>
Hereby, a small suggestion for smppbox-to-bearerbox-acks.

In case bearerbox queue is full, a temporary failure is returned so the client can try again later.

== Rene
ack_tmp_1.patch (application/octet-stream, 1.4 KB)
Index: gw/smppbox.c
===================================================================
--- gw/smppbox.c	(revision 47)
+++ gw/smppbox.c	(working copy)
@@ -1748,7 +1748,7 @@
     Boxc *box = arg;
     SMPP_PDU *pdu;
     List *pdulist;
-    int dreport;
+    int dreport, errcode;
     Boxc *receiver_box;
     char id[UUID_STR_LEN + 1];
     Octstr *msgid;
@@ -1784,6 +1784,7 @@
 	    uuid_unparse(msg->ack.id, id);
 	    msgid = octstr_create(id);
 	    pdu = dict_get(box->msg_acks, msgid);
+	    errcode = SMPP_ESME_RMSGQFUL; /* in case we get ack_failed_tmp */
 	    if (pdu) {
 		switch (msg->ack.nack) {
 		case ack_buffered:
@@ -1791,17 +1792,19 @@
 			/* we can send the submit_sm_resp as-is */
 			break;
 		case ack_failed:
+			errcode = SMPP_ESME_RSUBMITFAIL;
+			/* no break */
 		case ack_failed_tmp:
 			switch (pdu->type) {
 			case submit_sm_resp:
 				octstr_destroy(pdu->u.submit_sm_resp.message_id);
 				pdu->u.submit_sm_resp.message_id = NULL;
-				pdu->u.submit_sm_resp.command_status = SMPP_ESME_RSUBMITFAIL;
+				pdu->u.submit_sm_resp.command_status = errcode;
 				break;
 			case data_sm_resp:
 				octstr_destroy(pdu->u.data_sm_resp.message_id);
 				pdu->u.data_sm_resp.message_id = NULL;
-				pdu->u.data_sm_resp.command_status = SMPP_ESME_RSUBMITFAIL;
+				pdu->u.data_sm_resp.command_status = errcode;
 				break;
 			default:
 				debug("smppbox", 0, "Getting failure ack on unexpected pdu: %i.", pdu->type);
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.