minor fix to mmsbox
This commit is contained in:
parent
421c6f6856
commit
b36fe80262
|
@ -3,7 +3,7 @@
|
|||
*
|
||||
* Misc. functions
|
||||
*
|
||||
* Copyright (C) 2003 - 2005, Digital Solutions Ltd. - http://www.dsmagic.com
|
||||
* Copyright (C) 2003 - 2008, Digital Solutions Ltd. - http://www.dsmagic.com
|
||||
*
|
||||
* Paul Bagyenda <bagyenda@dsmagic.com>
|
||||
*
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
*
|
||||
* Misc. functions
|
||||
*
|
||||
* Copyright (C) 2003 - 2005, Digital Solutions Ltd. - http://www.dsmagic.com
|
||||
* Copyright (C) 2003 - 2008, Digital Solutions Ltd. - http://www.dsmagic.com
|
||||
*
|
||||
* Paul Bagyenda <bagyenda@dsmagic.com>
|
||||
*
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
*
|
||||
* MMSC handler functions: Receive and send MMS messages to MMSCs
|
||||
*
|
||||
* Copyright (C) 2003 - 2007, Digital Solutions Ltd. - http://www.dsmagic.com
|
||||
* Copyright (C) 2003 - 2008, Digital Solutions Ltd. - http://www.dsmagic.com
|
||||
*
|
||||
* Paul Bagyenda <bagyenda@dsmagic.com>
|
||||
*
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
*
|
||||
* MMSBOX: MMS Content engine
|
||||
*
|
||||
* Copyright (C) 2003 - 2005, Digital Solutions Ltd. - http://www.dsmagic.com
|
||||
* Copyright (C) 2003 - 2008, Digital Solutions Ltd. - http://www.dsmagic.com
|
||||
*
|
||||
* Paul Bagyenda <bagyenda@dsmagic.com>
|
||||
*
|
||||
|
@ -937,7 +937,7 @@ static int make_and_queue_msg(Octstr *data, Octstr *ctype, List *reply_headers,
|
|||
xservice_code = octstr_duplicate(hsvc_code);
|
||||
|
||||
if (from)
|
||||
_mms_fixup_address(&from, unified_prefix ? octstr_get_cstr(unified_prefix) : NULL, 1);
|
||||
_mms_fixup_address(&from, NULL, 1); /* Don't normalise. */
|
||||
|
||||
/* Now get the data. */
|
||||
if (octstr_case_compare(ctype, octstr_imm("application/vnd.wap.mms-message")) == 0)
|
||||
|
@ -1286,7 +1286,7 @@ static void sendmms_func(void *unused)
|
|||
|
||||
if ((from = http_cgi_variable(cgivars, "from")) != NULL) {
|
||||
from = octstr_duplicate(from);
|
||||
_mms_fixup_address(&from, unified_prefix ? octstr_get_cstr(unified_prefix) : NULL, 1);
|
||||
_mms_fixup_address(&from, NULL, 1);
|
||||
if (from)
|
||||
HTTP_REPLACE_HEADER(rh, "X-Mbuni-From", octstr_get_cstr(from));
|
||||
octstr_destroy(from);
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
*
|
||||
* MMSBox CFG: MMBox configuration and misc. functions
|
||||
*
|
||||
* Copyright (C) 2003 - 2005, Digital Solutions Ltd. - http://www.dsmagic.com
|
||||
* Copyright (C) 2003 - 2008, Digital Solutions Ltd. - http://www.dsmagic.com
|
||||
*
|
||||
* Paul Bagyenda <bagyenda@dsmagic.com>
|
||||
*
|
||||
|
@ -457,12 +457,7 @@ MmscGrp *get_handler_mmc(Octstr *id, Octstr *to, Octstr *from)
|
|||
MmscGrp *mmc = NULL, *res = NULL;
|
||||
int i, n;
|
||||
Octstr *phonenum = NULL, *xfrom = NULL;
|
||||
|
||||
if (id)
|
||||
for (i = 0, n = gwlist_len(mmscs); i < n; i++)
|
||||
if ((mmc = gwlist_get(mmscs, i)) != NULL &&
|
||||
mmc->id && octstr_compare(mmc->id, id) == 0)
|
||||
return mmc;
|
||||
int has_criteria = 0;
|
||||
|
||||
if (octstr_search_char(to, '@', 0) > 0 ||
|
||||
octstr_case_search(to, octstr_imm("/TYPE=IPv"), 0) > 0) /* For emails, or ip take first mmsc. */
|
||||
|
@ -491,12 +486,23 @@ MmscGrp *get_handler_mmc(Octstr *id, Octstr *to, Octstr *from)
|
|||
does_prefix_match(mmc->denied_sender_prefix, xfrom) != 0)
|
||||
continue; /* matches. */
|
||||
|
||||
has_criteria = has_criteria || mmc->denied_prefix ||
|
||||
mmc->allowed_prefix || mmc->denied_sender_prefix || mmc->allowed_sender_prefix;
|
||||
res = mmc; /* otherwise it matches, so go away. */
|
||||
break;
|
||||
}
|
||||
|
||||
octstr_destroy(phonenum);
|
||||
octstr_destroy(xfrom);
|
||||
|
||||
if (res && has_criteria) /* choice driven by allowed/denied settings */
|
||||
return res;
|
||||
else if (res == NULL && id) /* try sending it back the way it came. */
|
||||
for (i = 0, n = gwlist_len(mmscs); i < n; i++)
|
||||
if ((mmc = gwlist_get(mmscs, i)) != NULL &&
|
||||
mmc->id && octstr_compare(mmc->id, id) == 0)
|
||||
return mmc;
|
||||
|
||||
return res;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue