added reroute-add-sender flag to mmsbox config
This commit is contained in:
parent
a69feb2eb9
commit
c58cfafec5
|
@ -1,3 +1,5 @@
|
||||||
|
2007-11-07 P. A. Bagyenda <bagyenda@dsmagic.com>
|
||||||
|
* Added reroute-add-sender-to-subject config param for MMSBox
|
||||||
2007-09-25 P. A. Bagyenda <bagyenda@dsmagic.com>
|
2007-09-25 P. A. Bagyenda <bagyenda@dsmagic.com>
|
||||||
* Added flag to conditionally remove mm7: XML namespace prefix
|
* Added flag to conditionally remove mm7: XML namespace prefix
|
||||||
2007-09-18 P. A. Bagyenda <bagyenda@dsmagic.com>
|
2007-09-18 P. A. Bagyenda <bagyenda@dsmagic.com>
|
||||||
|
|
|
@ -2367,6 +2367,20 @@ string
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
|
<tr>
|
||||||
|
<td valign=top >
|
||||||
|
<tt>reroute-add-sender-to-subject</tt>
|
||||||
|
</td>
|
||||||
|
<td valign=top >
|
||||||
|
Boolean
|
||||||
|
</td>
|
||||||
|
<td valign=top >
|
||||||
|
If <tt>reroute</tt> is <tt>true</tt> and this flag is also true then all messages
|
||||||
|
received on this connection are re-routed, and the original sender
|
||||||
|
is added to the message subject line
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
|
||||||
<tr>
|
<tr>
|
||||||
<td valign=top >
|
<td valign=top >
|
||||||
<tt>mm7-mt-filter-params</tt>
|
<tt>mm7-mt-filter-params</tt>
|
||||||
|
|
|
@ -142,6 +142,7 @@ MULTI_GROUP(mmsc,
|
||||||
OCTSTR(mm7-mt-filter-params)
|
OCTSTR(mm7-mt-filter-params)
|
||||||
OCTSTR(reroute)
|
OCTSTR(reroute)
|
||||||
OCTSTR(reroute-mmsc-id)
|
OCTSTR(reroute-mmsc-id)
|
||||||
|
OCTSTR(reroute-add-sender-to-subject)
|
||||||
OCTSTR(mmsc-library)
|
OCTSTR(mmsc-library)
|
||||||
OCTSTR(custom-settings)
|
OCTSTR(custom-settings)
|
||||||
)
|
)
|
||||||
|
|
|
@ -25,6 +25,20 @@
|
||||||
|
|
||||||
#include "mmsbox.h"
|
#include "mmsbox.h"
|
||||||
|
|
||||||
|
#define MOD_SUBJECT(msg, mmc,xfrom) do { \
|
||||||
|
if ((mmc)->reroute_mod_subject) { \
|
||||||
|
Octstr *s = mms_get_header_value((msg),octstr_imm("Subject")); \
|
||||||
|
Octstr *f = octstr_duplicate(xfrom); \
|
||||||
|
int _i; \
|
||||||
|
if (s == NULL) s = octstr_create(""); \
|
||||||
|
if ((_i = octstr_search(f, octstr_imm("/TYPE="), 0)) >= 0) \
|
||||||
|
octstr_delete(f, _i, octstr_len(f)); \
|
||||||
|
octstr_format_append(s, " (from %S)", (f)); \
|
||||||
|
mms_replace_header_value((msg), "Subject", octstr_get_cstr(s)); \
|
||||||
|
octstr_destroy(s); octstr_destroy(f); \
|
||||||
|
} \
|
||||||
|
} while(0)
|
||||||
|
|
||||||
typedef struct MmsHTTPClientInfo {
|
typedef struct MmsHTTPClientInfo {
|
||||||
HTTPClient *client;
|
HTTPClient *client;
|
||||||
Octstr *ua;
|
Octstr *ua;
|
||||||
|
@ -166,7 +180,8 @@ static void mm7soap_receive(MmsHTTPClientInfo *h)
|
||||||
goto done;
|
goto done;
|
||||||
}
|
}
|
||||||
|
|
||||||
mm7_get_envelope(mreq, &from, &to, &subject, &vasid, &expiryt, &delivert, &uaprof, &uaprof_tstamp);
|
mm7_get_envelope(mreq, &from, &to, &subject, &vasid,
|
||||||
|
&expiryt, &delivert, &uaprof, &uaprof_tstamp);
|
||||||
|
|
||||||
if (!from)
|
if (!from)
|
||||||
from = octstr_imm("anon@anon");
|
from = octstr_imm("anon@anon");
|
||||||
|
@ -202,6 +217,8 @@ static void mm7soap_receive(MmsHTTPClientInfo *h)
|
||||||
octstr_destroy(sx);
|
octstr_destroy(sx);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
MOD_SUBJECT(m, h->m, from);
|
||||||
|
|
||||||
qf = qfs->mms_queue_add(from, to, subject,
|
qf = qfs->mms_queue_add(from, to, subject,
|
||||||
h->m->id, mmc_id,
|
h->m->id, mmc_id,
|
||||||
delivert, expiryt, m, linkedid,
|
delivert, expiryt, m, linkedid,
|
||||||
|
@ -434,6 +451,8 @@ static void mm7eaif_receive(MmsHTTPClientInfo *h)
|
||||||
mms_remove_headers(m, "X-Mms-Expiry");
|
mms_remove_headers(m, "X-Mms-Expiry");
|
||||||
mms_remove_headers(m, "X-Mms-Sender-Visibility");
|
mms_remove_headers(m, "X-Mms-Sender-Visibility");
|
||||||
|
|
||||||
|
MOD_SUBJECT(m, h->m, hfrom);
|
||||||
|
|
||||||
/* Save it, put message id in header, return. */
|
/* Save it, put message id in header, return. */
|
||||||
qf = qfs->mms_queue_add(hfrom, to, subject,
|
qf = qfs->mms_queue_add(hfrom, to, subject,
|
||||||
h->m->id, mmc_id,
|
h->m->id, mmc_id,
|
||||||
|
|
|
@ -269,6 +269,7 @@ int mms_load_mmsbox_settings(mCfg *cfg, gwthread_func_t *mmsc_handler_func)
|
||||||
m->use_mt_filter = 0;
|
m->use_mt_filter = 0;
|
||||||
|
|
||||||
mms_cfg_get_bool(x, octstr_imm("reroute"), &m->reroute);
|
mms_cfg_get_bool(x, octstr_imm("reroute"), &m->reroute);
|
||||||
|
mms_cfg_get_bool(x, octstr_imm("reroute-add-sender-to-subject"), &m->reroute_mod_subject);
|
||||||
m->reroute_mmsc_id = mms_cfg_get(x, octstr_imm("reroute-mmsc-id"));
|
m->reroute_mmsc_id = mms_cfg_get(x, octstr_imm("reroute-mmsc-id"));
|
||||||
if (m->reroute_mmsc_id != NULL && m->reroute == 0)
|
if (m->reroute_mmsc_id != NULL && m->reroute == 0)
|
||||||
warning(0, "MMSBox: reroute-mmsc-id parameter set but reroute=false!");
|
warning(0, "MMSBox: reroute-mmsc-id parameter set but reroute=false!");
|
||||||
|
|
|
@ -36,6 +36,8 @@ typedef struct MmscGrp {
|
||||||
|
|
||||||
int reroute; /* whether messages from this mmsc are re-routed outwards. */
|
int reroute; /* whether messages from this mmsc are re-routed outwards. */
|
||||||
Octstr *reroute_mmsc_id;
|
Octstr *reroute_mmsc_id;
|
||||||
|
|
||||||
|
int reroute_mod_subject; /* Set to true if we'll change subject line on reroute. */
|
||||||
MM7Version_t ver; /* supported MM7/SOAP version. */
|
MM7Version_t ver; /* supported MM7/SOAP version. */
|
||||||
int use_mt_filter; /* whether to use MT filter on this connection. */
|
int use_mt_filter; /* whether to use MT filter on this connection. */
|
||||||
Mutex *mutex;
|
Mutex *mutex;
|
||||||
|
|
|
@ -36,6 +36,7 @@ typedef struct MmsResolverFuncStruct {
|
||||||
Octstr *(*mms_resolve)(Octstr * phonenum, void *module_data, void *settings, void *proxyrelays);
|
Octstr *(*mms_resolve)(Octstr * phonenum, void *module_data, void *settings, void *proxyrelays);
|
||||||
|
|
||||||
int (*mms_resolvermodule_fini)(void *module_data);
|
int (*mms_resolvermodule_fini)(void *module_data);
|
||||||
|
|
||||||
} MmsResolverFuncStruct;
|
} MmsResolverFuncStruct;
|
||||||
|
|
||||||
extern MmsResolverFuncStruct mms_resolvefuncs; /* The module must expose this symbol. */
|
extern MmsResolverFuncStruct mms_resolvefuncs; /* The module must expose this symbol. */
|
||||||
|
|
Loading…
Reference in New Issue