1
0
Fork 0

added reroute reroute-mmsc-id to config

This commit is contained in:
bagyenda 2007-08-27 10:16:26 +00:00
parent b3f9f30919
commit aea228ecc2
6 changed files with 57 additions and 16 deletions

View File

@ -1,3 +1,5 @@
2007-08-27 P. A. Bagyenda <bagyenda@dsmagic.com>
* added 'reroute' and 'reroute-mmsc-id' config. params to VAS GW MMSC configs
2007-08-20 P. A. Bagyenda <bagyenda@dsmagic.com>
* Generalised MMS Queue handling interface to allow different storage/delivery mechanisms.
2007-08-09 P. A. Bagyenda <bagyenda@dsmagic.com>

View File

@ -2266,6 +2266,33 @@ string
</td>
</tr>
<tr>
<td valign=top >
<tt>reroute</tt>
</td>
<td valign=top >
Boolean
</td>
<td valign=top >
If set to <tt>true</tt> all messages received from this MMSC are
routed directly to the outgoing queue (never to an MMS Service).
</td>
</tr>
<tr>
<td valign=top >
<tt>reroute-mmsc-id</tt>
</td>
<td valign=top >
String
</td>
<td valign=top >
If set (and <tt>reroute</tt> is <tt>true</tt>) then all messages
received on this connection will be sent out directly via the MMSC
with the ID set here.
</td>
</tr>
<tr>
<td valign=top >
<tt>mm7-mt-filter-params</tt>

View File

@ -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,

View File

@ -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 */

View File

@ -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);
}

View File

@ -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;