Fixes for http-post-parameters in mmsbox, better handling of x-mbuni-to header
This commit is contained in:
parent
21546794d8
commit
dd86106119
|
@ -3,7 +3,7 @@ log-file = /tmp/log/mbuni.log
|
||||||
access-log = /tmp/log/access.log
|
access-log = /tmp/log/access.log
|
||||||
log-level = 0
|
log-level = 0
|
||||||
|
|
||||||
group = mmsbox
|
group = mbuni
|
||||||
name = "My MMSC"
|
name = "My MMSC"
|
||||||
hostname = ds.co.ug
|
hostname = ds.co.ug
|
||||||
host-alias = mmsc
|
host-alias = mmsc
|
||||||
|
|
|
@ -722,7 +722,7 @@ diff -Naur gateway-1.4.0/gwlib/cfg.def gateway-1.4.0-patched/gwlib/cfg.def
|
||||||
OCTSTR(unified-prefix)
|
OCTSTR(unified-prefix)
|
||||||
)
|
)
|
||||||
|
|
||||||
+SINGLE_GROUP(mmsbox,
|
+SINGLE_GROUP(mbuni,
|
||||||
+ OCTSTR(name)
|
+ OCTSTR(name)
|
||||||
+ OCTSTR(hostname)
|
+ OCTSTR(hostname)
|
||||||
+ OCTSTR(host-alias)
|
+ OCTSTR(host-alias)
|
||||||
|
|
|
@ -173,6 +173,7 @@ static void add_all_matching_parts(MIMEEntity *plist, MmsServiceUrlParam *pm,
|
||||||
|
|
||||||
if (xctype)
|
if (xctype)
|
||||||
if (TYPE_MATCH(IMAGE_PART,"image/") ||
|
if (TYPE_MATCH(IMAGE_PART,"image/") ||
|
||||||
|
TYPE_MATCH(AUDIO_PART,"audio/") ||
|
||||||
TYPE_MATCH(VIDEO_PART,"video/") ||
|
TYPE_MATCH(VIDEO_PART,"video/") ||
|
||||||
TYPE_MATCH(TEXT_PART,"text/") ||
|
TYPE_MATCH(TEXT_PART,"text/") ||
|
||||||
TYPE_MATCH(SMIL_PART,"application/smil") ||
|
TYPE_MATCH(SMIL_PART,"application/smil") ||
|
||||||
|
@ -496,11 +497,11 @@ int main(int argc, char *argv[])
|
||||||
|
|
||||||
/* Start out-going queue thread. */
|
/* Start out-going queue thread. */
|
||||||
qthread = gwthread_create((gwthread_func_t *)mmsbox_outgoing_queue_runner, &rstop);
|
qthread = gwthread_create((gwthread_func_t *)mmsbox_outgoing_queue_runner, &rstop);
|
||||||
#if 0
|
|
||||||
mms_queue_run(octstr_get_cstr(incoming_qdir),
|
mms_queue_run(octstr_get_cstr(incoming_qdir),
|
||||||
mmsbox_service_dispatch,
|
mmsbox_service_dispatch,
|
||||||
queue_interval, maxthreads, &rstop);
|
queue_interval, maxthreads, &rstop);
|
||||||
#endif
|
|
||||||
/* Wait for the sender thread, then quit. */
|
/* Wait for the sender thread, then quit. */
|
||||||
gwthread_join(qthread); /* Wait for it to die... */
|
gwthread_join(qthread); /* Wait for it to die... */
|
||||||
|
|
||||||
|
@ -908,13 +909,21 @@ static int make_and_queue_msg(Octstr *data, Octstr *ctype, List *reply_headers,
|
||||||
int i, n;
|
int i, n;
|
||||||
for (i = 0, n = list_len(l); i<n; i++) {
|
for (i = 0, n = list_len(l); i<n; i++) {
|
||||||
Octstr *h = NULL, *v = NULL;
|
Octstr *h = NULL, *v = NULL;
|
||||||
|
List *hv = NULL;
|
||||||
|
int j;
|
||||||
http_header_get(l, i, &h, &v);
|
http_header_get(l, i, &h, &v);
|
||||||
|
|
||||||
/* Fix the address. */
|
hv = http_header_split_value(v);
|
||||||
_mms_fixup_address(v);
|
|
||||||
|
|
||||||
list_append(xto, v);
|
for (j = 0; j < list_len(hv); j++) {
|
||||||
|
Octstr *v = list_get(hv, j);
|
||||||
|
/* Fix the address. */
|
||||||
|
_mms_fixup_address(v);
|
||||||
|
list_append(xto, v);
|
||||||
|
}
|
||||||
|
octstr_destroy(v);
|
||||||
octstr_destroy(h);
|
octstr_destroy(h);
|
||||||
|
list_destroy(hv, NULL); /* Don't kill strings since we added them to xto above! */
|
||||||
}
|
}
|
||||||
http_destroy_headers(l);
|
http_destroy_headers(l);
|
||||||
}
|
}
|
||||||
|
|
|
@ -36,7 +36,7 @@ struct SendMmsPortInfo sendmms_port;
|
||||||
|
|
||||||
int mms_load_mmsbox_settings(Cfg *cfg, gwthread_func_t *mmsc_handler_func)
|
int mms_load_mmsbox_settings(Cfg *cfg, gwthread_func_t *mmsc_handler_func)
|
||||||
{
|
{
|
||||||
CfgGroup *grp = cfg_get_single_group(cfg, octstr_imm("mmsbox"));
|
CfgGroup *grp = cfg_get_single_group(cfg, octstr_imm("mbuni"));
|
||||||
CfgGroup *cgrp = cfg_get_single_group(cfg, octstr_imm("core"));
|
CfgGroup *cgrp = cfg_get_single_group(cfg, octstr_imm("core"));
|
||||||
Octstr *gdir, *s;
|
Octstr *gdir, *s;
|
||||||
int send_port_ssl = 0;
|
int send_port_ssl = 0;
|
||||||
|
@ -270,6 +270,10 @@ int mms_load_mmsbox_settings(Cfg *cfg, gwthread_func_t *mmsc_handler_func)
|
||||||
|
|
||||||
if (octstr_get_char(y, ii+1) == '%') {
|
if (octstr_get_char(y, ii+1) == '%') {
|
||||||
switch(ch = octstr_get_char(y, ii+2)) {
|
switch(ch = octstr_get_char(y, ii+2)) {
|
||||||
|
case 'a':
|
||||||
|
p->type = AUDIO_PART; break;
|
||||||
|
case 'b':
|
||||||
|
p->type = WHOLE_BINARY; break;
|
||||||
case 'i':
|
case 'i':
|
||||||
p->type = IMAGE_PART; break;
|
p->type = IMAGE_PART; break;
|
||||||
case 'v':
|
case 'v':
|
||||||
|
@ -280,7 +284,7 @@ int mms_load_mmsbox_settings(Cfg *cfg, gwthread_func_t *mmsc_handler_func)
|
||||||
p->type = SMIL_PART; break;
|
p->type = SMIL_PART; break;
|
||||||
case 'o':
|
case 'o':
|
||||||
p->type = OTHER_PART; break;
|
p->type = OTHER_PART; break;
|
||||||
case 'a':
|
case 'z':
|
||||||
p->type = ANY_PART; break;
|
p->type = ANY_PART; break;
|
||||||
case '%':
|
case '%':
|
||||||
p->type = NO_PART; break;
|
p->type = NO_PART; break;
|
||||||
|
|
|
@ -33,7 +33,7 @@ typedef struct MmscGrp {
|
||||||
|
|
||||||
typedef struct MmsServiceUrlParam {
|
typedef struct MmsServiceUrlParam {
|
||||||
Octstr *name;
|
Octstr *name;
|
||||||
enum {NO_PART, IMAGE_PART, VIDEO_PART,
|
enum {NO_PART, AUDIO_PART, IMAGE_PART, VIDEO_PART,
|
||||||
TEXT_PART, SMIL_PART , OTHER_PART,
|
TEXT_PART, SMIL_PART , OTHER_PART,
|
||||||
ANY_PART, WHOLE_BINARY} type;
|
ANY_PART, WHOLE_BINARY} type;
|
||||||
Octstr *value; /* for generic value (type == NO_PART),
|
Octstr *value; /* for generic value (type == NO_PART),
|
||||||
|
|
|
@ -65,7 +65,7 @@ MmscSettings *mms_load_mmsc_settings(Cfg *cfg, List **proxyrelays)
|
||||||
Octstr *s;
|
Octstr *s;
|
||||||
|
|
||||||
List *l;
|
List *l;
|
||||||
CfgGroup *grp = cfg_get_single_group(cfg, octstr_imm("mmsbox"));
|
CfgGroup *grp = cfg_get_single_group(cfg, octstr_imm("mbuni"));
|
||||||
CfgGroup *cgrp = cfg_get_single_group(cfg, octstr_imm("core"));
|
CfgGroup *cgrp = cfg_get_single_group(cfg, octstr_imm("core"));
|
||||||
MmscSettings *m = gw_malloc(sizeof *m);
|
MmscSettings *m = gw_malloc(sizeof *m);
|
||||||
long port = -1;
|
long port = -1;
|
||||||
|
|
|
@ -37,7 +37,7 @@ int main(int argc, char *argv[])
|
||||||
cfidx = get_and_set_debugs(argc, argv, NULL);
|
cfidx = get_and_set_debugs(argc, argv, NULL);
|
||||||
|
|
||||||
if (argv[cfidx] == NULL)
|
if (argv[cfidx] == NULL)
|
||||||
fname = octstr_imm("mmsc.conf");
|
fname = octstr_imm("mbuni.conf");
|
||||||
else
|
else
|
||||||
fname = octstr_create(argv[cfidx]);
|
fname = octstr_create(argv[cfidx]);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue