minor fixes re filtering
This commit is contained in:
parent
cc3a502516
commit
3d59903562
|
@ -86,6 +86,7 @@ SINGLE_GROUP(mbuni,
|
||||||
OCTSTR(sendmms-port-ssl)
|
OCTSTR(sendmms-port-ssl)
|
||||||
|
|
||||||
OCTSTR(mmsbox-mt-filter-library)
|
OCTSTR(mmsbox-mt-filter-library)
|
||||||
|
OCTSTR(mmsbox-mt-always-multipart)
|
||||||
)
|
)
|
||||||
|
|
||||||
MULTI_GROUP(mmsproxy,
|
MULTI_GROUP(mmsproxy,
|
||||||
|
|
|
@ -964,6 +964,20 @@ static int make_and_queue_msg(Octstr *data, Octstr *ctype, List *reply_headers,
|
||||||
|
|
||||||
if (mt_filter && mmc) /* filter it too. */
|
if (mt_filter && mmc) /* filter it too. */
|
||||||
mt_filter->filter(&me, msg_url, mmc);
|
mt_filter->filter(&me, msg_url, mmc);
|
||||||
|
|
||||||
|
if (mt_multipart &&
|
||||||
|
octstr_case_search(ctype, octstr_imm("multipart/"), 0) != 0) { /* requires multipart but this one is not, wrap it */
|
||||||
|
MIMEEntity *xm = mime_entity_create();
|
||||||
|
List *h1 = http_create_empty_headers();
|
||||||
|
|
||||||
|
http_header_add(h1, "Content-Type", "multipart/related");
|
||||||
|
mime_replace_headers(xm, h1);
|
||||||
|
mime_entity_add_part(xm, me);
|
||||||
|
|
||||||
|
http_destroy_headers(h1);
|
||||||
|
|
||||||
|
me = xm;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -32,6 +32,7 @@ long mmsbox_maxsendattempts, mmsbox_send_back_off;
|
||||||
long maxthreads = 0;
|
long maxthreads = 0;
|
||||||
double queue_interval = -1;
|
double queue_interval = -1;
|
||||||
Octstr *unified_prefix;
|
Octstr *unified_prefix;
|
||||||
|
int mt_multipart = 0;
|
||||||
|
|
||||||
struct SendMmsPortInfo sendmms_port;
|
struct SendMmsPortInfo sendmms_port;
|
||||||
|
|
||||||
|
@ -159,7 +160,9 @@ int mms_load_mmsbox_settings(mCfg *cfg, gwthread_func_t *mmsc_handler_func)
|
||||||
/* load the filter if any. */
|
/* load the filter if any. */
|
||||||
if ((mt_filter = load_module(grp, "mmsbox-mt-filter-library", "mmsbox_mt_filter")) != NULL)
|
if ((mt_filter = load_module(grp, "mmsbox-mt-filter-library", "mmsbox_mt_filter")) != NULL)
|
||||||
info(0, "MMSBox: Loaded MT Filter [%s]", mt_filter->name);
|
info(0, "MMSBox: Loaded MT Filter [%s]", mt_filter->name);
|
||||||
|
|
||||||
|
mms_cfg_get_bool(grp, octstr_imm("mmsbox-mt-always-multipart"), &mt_multipart);
|
||||||
|
|
||||||
/* Now get sendmms users. */
|
/* Now get sendmms users. */
|
||||||
|
|
||||||
l = mms_cfg_get_multi(cfg, octstr_imm("send-mms-user"));
|
l = mms_cfg_get_multi(cfg, octstr_imm("send-mms-user"));
|
||||||
|
|
|
@ -87,6 +87,7 @@ extern struct SendMmsPortInfo {
|
||||||
} sendmms_port;
|
} sendmms_port;
|
||||||
|
|
||||||
extern struct MmsBoxMTfilter *mt_filter;
|
extern struct MmsBoxMTfilter *mt_filter;
|
||||||
|
extern int mt_multipart;
|
||||||
extern int mms_load_mmsbox_settings(mCfg *cfg, gwthread_func_t *mmsc_handler_func);
|
extern int mms_load_mmsbox_settings(mCfg *cfg, gwthread_func_t *mmsc_handler_func);
|
||||||
extern MmscGrp *get_handler_mmc(Octstr *id, Octstr *to);
|
extern MmscGrp *get_handler_mmc(Octstr *id, Octstr *to);
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Reference in New Issue