1
0
Fork 0

minor fixes re filtering

This commit is contained in:
bagyenda 2007-07-19 19:45:24 +00:00
parent cc3a502516
commit 3d59903562
4 changed files with 20 additions and 1 deletions

View File

@ -86,6 +86,7 @@ SINGLE_GROUP(mbuni,
OCTSTR(sendmms-port-ssl)
OCTSTR(mmsbox-mt-filter-library)
OCTSTR(mmsbox-mt-always-multipart)
)
MULTI_GROUP(mmsproxy,

View File

@ -964,6 +964,20 @@ static int make_and_queue_msg(Octstr *data, Octstr *ctype, List *reply_headers,
if (mt_filter && mmc) /* filter it too. */
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;
}
}

View File

@ -32,6 +32,7 @@ long mmsbox_maxsendattempts, mmsbox_send_back_off;
long maxthreads = 0;
double queue_interval = -1;
Octstr *unified_prefix;
int mt_multipart = 0;
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. */
if ((mt_filter = load_module(grp, "mmsbox-mt-filter-library", "mmsbox_mt_filter")) != NULL)
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. */
l = mms_cfg_get_multi(cfg, octstr_imm("send-mms-user"));

View File

@ -87,6 +87,7 @@ extern struct SendMmsPortInfo {
} sendmms_port;
extern struct MmsBoxMTfilter *mt_filter;
extern int mt_multipart;
extern int mms_load_mmsbox_settings(mCfg *cfg, gwthread_func_t *mmsc_handler_func);
extern MmscGrp *get_handler_mmc(Octstr *id, Octstr *to);
#endif