From aea228ecc29dee52bc44a10845fb7d32baa9f1c1 Mon Sep 17 00:00:00 2001 From: bagyenda <> Date: Mon, 27 Aug 2007 10:16:26 +0000 Subject: [PATCH] added reroute reroute-mmsc-id to config --- mbuni/ChangeLog | 2 ++ mbuni/doc/userguide.shtml | 27 +++++++++++++++++++++++++++ mbuni/mmlib/mms_cfg.def | 2 ++ mbuni/mmsbox/bearerbox.c | 34 ++++++++++++++++++---------------- mbuni/mmsbox/mmsbox_cfg.c | 6 ++++++ mbuni/mmsbox/mmsbox_cfg.h | 2 ++ 6 files changed, 57 insertions(+), 16 deletions(-) diff --git a/mbuni/ChangeLog b/mbuni/ChangeLog index 7cdca0a..3570870 100644 --- a/mbuni/ChangeLog +++ b/mbuni/ChangeLog @@ -1,3 +1,5 @@ +2007-08-27 P. A. Bagyenda + * added 'reroute' and 'reroute-mmsc-id' config. params to VAS GW MMSC configs 2007-08-20 P. A. Bagyenda * Generalised MMS Queue handling interface to allow different storage/delivery mechanisms. 2007-08-09 P. A. Bagyenda diff --git a/mbuni/doc/userguide.shtml b/mbuni/doc/userguide.shtml index 4ea21d7..bd43091 100644 --- a/mbuni/doc/userguide.shtml +++ b/mbuni/doc/userguide.shtml @@ -2266,6 +2266,33 @@ string + + + reroute + + + Boolean + + + If set to true all messages received from this MMSC are + routed directly to the outgoing queue (never to an MMS Service). + + + + + + reroute-mmsc-id + + + String + + + If set (and reroute is true) then all messages + received on this connection will be sent out directly via the MMSC + with the ID set here. + + + mm7-mt-filter-params diff --git a/mbuni/mmlib/mms_cfg.def b/mbuni/mmlib/mms_cfg.def index a6fd208..94d5ec4 100644 --- a/mbuni/mmlib/mms_cfg.def +++ b/mbuni/mmlib/mms_cfg.def @@ -138,6 +138,8 @@ MULTI_GROUP(mmsc, OCTSTR(mm7-version) OCTSTR(mm7-soap-xmlns) OCTSTR(mm7-mt-filter-params) + OCTSTR(reroute) + OCTSTR(reroute-mmsc-id) ) MULTI_GROUP(mms-service, diff --git a/mbuni/mmsbox/bearerbox.c b/mbuni/mmsbox/bearerbox.c index b680d38..8ec9d73 100644 --- a/mbuni/mmsbox/bearerbox.c +++ b/mbuni/mmsbox/bearerbox.c @@ -151,7 +151,6 @@ static void mm7soap_receive(MmsHTTPClientInfo *h) int status = 1000; unsigned char *msgtype = (unsigned char *)""; Octstr *qf = NULL; - if (h->body) mreq = mm7_parse_soap(h->headers, h->body); @@ -202,14 +201,15 @@ static void mm7soap_receive(MmsHTTPClientInfo *h) octstr_destroy(sx); } qf = qfs->mms_queue_add(from, to, subject, - h->m->id, NULL, - delivert, expiryt, m, linkedid, - NULL, NULL, - NULL, NULL, - qh, - dlr, - octstr_get_cstr(incoming_qdir), - octstr_imm(MM_NAME)); + h->m->id, h->m->reroute ? h->m->reroute_mmsc_id : NULL, + delivert, expiryt, m, linkedid, + NULL, NULL, + NULL, NULL, + qh, + dlr, + h->m->reroute ? octstr_get_cstr(outgoing_qdir) : + octstr_get_cstr(incoming_qdir), + octstr_imm(MM_NAME)); msgid = mms_maketransid(octstr_get_cstr(qf), octstr_imm(MM_NAME)); mms_log("Received", from, to, -1, msgid, NULL, h->m->id, "MMSBox", h->ua, NULL); @@ -389,13 +389,15 @@ static void mm7eaif_receive(MmsHTTPClientInfo *h) /* Save it, put message id in header, return. */ qf = qfs->mms_queue_add(hfrom, to, subject, - h->m->id, NULL, deliveryt, expiryt, m, NULL, - NULL, NULL, - NULL, NULL, - NULL, - dlr, - octstr_get_cstr(incoming_qdir), - octstr_imm(MM_NAME)); + h->m->id, h->m->reroute ? h->m->reroute_mmsc_id : NULL, + deliveryt, expiryt, m, NULL, + NULL, NULL, + NULL, NULL, + NULL, + dlr, + h->m->reroute ? octstr_get_cstr(outgoing_qdir) : + octstr_get_cstr(incoming_qdir), + octstr_imm(MM_NAME)); if (qf) { /* Log to access log */ diff --git a/mbuni/mmsbox/mmsbox_cfg.c b/mbuni/mmsbox/mmsbox_cfg.c index 13a305b..1d6d108 100644 --- a/mbuni/mmsbox/mmsbox_cfg.c +++ b/mbuni/mmsbox/mmsbox_cfg.c @@ -300,6 +300,12 @@ int mms_load_mmsbox_settings(mCfg *cfg, gwthread_func_t *mmsc_handler_func) octstr_destroy(s); } else m->use_mt_filter = 0; + + mms_cfg_get_bool(x, octstr_imm("reroute"), &m->reroute); + m->reroute_mmsc_id = mms_cfg_get(x, octstr_imm("reroute-mmsc-id")); + if (m->reroute_mmsc_id != NULL && m->reroute == 0) + warning(0, "MMSBox: reroute-mmsc-id parameter set but reroute=false!"); + m->mutex = mutex_create(); gwlist_append(mmscs, m); } diff --git a/mbuni/mmsbox/mmsbox_cfg.h b/mbuni/mmsbox/mmsbox_cfg.h index a836f74..8b35e0f 100644 --- a/mbuni/mmsbox/mmsbox_cfg.h +++ b/mbuni/mmsbox/mmsbox_cfg.h @@ -31,6 +31,8 @@ typedef struct MmscGrp { long throughput; /* Max send rate. */ long threadid; /* handler thread. */ + int reroute; /* whether messages from this mmsc are re-routed outwards. */ + Octstr *reroute_mmsc_id; MM7Version_t ver; /* supported MM7/SOAP version. */ int use_mt_filter; /* whether to use MT filter on this connection. */ Mutex *mutex;