From 6b35184a7ed2e716bf899481e11287d7b9909db8 Mon Sep 17 00:00:00 2001 From: bagyenda <> Date: Wed, 6 May 2009 07:24:57 +0000 Subject: [PATCH] *** empty log message *** --- mbuni/ChangeLog | 1 + mbuni/mmsc/mmsmobilesender.c | 20 ++++++++++++-------- 2 files changed, 13 insertions(+), 8 deletions(-) diff --git a/mbuni/ChangeLog b/mbuni/ChangeLog index 8b1062d..a6eb971 100644 --- a/mbuni/ChangeLog +++ b/mbuni/ChangeLog @@ -1,6 +1,7 @@ 2009-05-05 P. A. Bagyenda * MMSC fix: don't send subject in notification if size optimisation turned on * Added mm1-queue-run-interval config option, so that MM1 queue can be processed at different interval + * Fixed: When MM1 notification attempts exceed maximum, do not delete message, rather wait for expiry 2009-03-28 P. A. Bagyenda * Improved pgsql-queue module: re-connect to db if connections die, only allocate as many connections as needed 2009-03-05 P. A. Bagyenda diff --git a/mbuni/mmsc/mmsmobilesender.c b/mbuni/mmsc/mmsmobilesender.c index c38f3fb..898db9f 100644 --- a/mbuni/mmsc/mmsmobilesender.c +++ b/mbuni/mmsc/mmsmobilesender.c @@ -175,19 +175,22 @@ static int sendNotify(MmsEnvelope *e) if (e->expiryt != 0 && /* Handle message expiry. */ e->expiryt < tnow) { - err = octstr_format("MMSC error: Message expired while sending to %S!", to); + err = octstr_format("MM1 error: Message expired while sending to %S!", to); res = MMS_SEND_ERROR_FATAL; prov_notify_event = "failedfetch"; rtype = "Expired"; goto done; } else if (e->attempts >= settings->maxsendattempts) { - err = octstr_format("MMSC error: Failed to deliver to %S after %ld attempts!", - to, e->attempts); - res = MMS_SEND_ERROR_FATAL; + err = octstr_format("MM1: Maximum delivery attempts [%d] to %S reached. Delivery suspended!", + e->attempts, to); + res = MMS_SEND_OK; - prov_notify_event = "failedfetch"; - rtype = "Expired"; + e->sendt = e->expiryt + 1; /* no retry until expiry */ + if (settings->qfs->mms_queue_update(e) != 1) + settings->qfs->mms_queue_free_env(e); + e = NULL; goto done; + } else if (e->lastaccess != 0) { e->sendt = e->expiryt + 1; res = MMS_SEND_OK; @@ -367,8 +370,9 @@ static int sendNotify(MmsEnvelope *e) (int)(time(NULL) - tnow)); - if (res == MMS_SEND_ERROR_FATAL && xto && e) { - xto->process = 0; /* No more attempts to deliver, delete this. */ + if (xto && e) { + if (res == MMS_SEND_ERROR_FATAL) + xto->process = 0; /* No more attempts to deliver, delete this. */ if (settings->qfs->mms_queue_update(e) == 1) e = NULL; /* Queue entry gone. */ else