misc fixes
This commit is contained in:
parent
e090e6795e
commit
be5d0a6bc9
|
@ -1,3 +1,5 @@
|
||||||
|
2008-12-01 P. A. Bagyenda <bagyenda@dsmagic.com>
|
||||||
|
* Misc. fixes to number normalisation in mmsbox
|
||||||
2008-11-26 P. A. Bagyenda <bagyenda@dsmagic.com>
|
2008-11-26 P. A. Bagyenda <bagyenda@dsmagic.com>
|
||||||
* Added validityperiod sendmms cgi param
|
* Added validityperiod sendmms cgi param
|
||||||
* Minor changes to mmsbox CDR logging to improve clarity
|
* Minor changes to mmsbox CDR logging to improve clarity
|
||||||
|
|
|
@ -465,8 +465,10 @@ static MmsEnvelope *pgq_queue_readenvelope(char *qf, char *mms_queuedir, int sho
|
||||||
e->attempts = num_attempts;
|
e->attempts = num_attempts;
|
||||||
|
|
||||||
if (mms_validate_address(e->from) != 0) {
|
if (mms_validate_address(e->from) != 0) {
|
||||||
|
#if 0
|
||||||
mms_warning(0, "pgsql_queue", NULL, "mms_queueread: Mal-formed address [%s] in queue entry %s/%s! "
|
mms_warning(0, "pgsql_queue", NULL, "mms_queueread: Mal-formed address [%s] in queue entry %s/%s! "
|
||||||
"Attempting fixup.", octstr_get_cstr(e->from), mms_queuedir, qf);
|
"Attempting fixup.", octstr_get_cstr(e->from), mms_queuedir, qf);
|
||||||
|
#endif
|
||||||
_mms_fixup_address(&e->from, NULL,NULL,1);
|
_mms_fixup_address(&e->from, NULL,NULL,1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -502,8 +504,10 @@ static MmsEnvelope *pgq_queue_readenvelope(char *qf, char *mms_queuedir, int sho
|
||||||
case 'Z':
|
case 'Z':
|
||||||
t = octstr_create(res);
|
t = octstr_create(res);
|
||||||
if (mms_validate_address(t) != 0) {
|
if (mms_validate_address(t) != 0) {
|
||||||
|
#if 0
|
||||||
mms_warning(0, "pgsql_queue", NULL, "mms_queueread: Mal-formed address [%s] in queue entry %s/%s! "
|
mms_warning(0, "pgsql_queue", NULL, "mms_queueread: Mal-formed address [%s] in queue entry %s/%s! "
|
||||||
"Attempting fixup.", res, mms_queuedir, qf);
|
"Attempting fixup.", res, mms_queuedir, qf);
|
||||||
|
#endif
|
||||||
_mms_fixup_address(&t, NULL,NULL,1);
|
_mms_fixup_address(&t, NULL,NULL,1);
|
||||||
}
|
}
|
||||||
to = gw_malloc(sizeof *to);
|
to = gw_malloc(sizeof *to);
|
||||||
|
|
|
@ -268,8 +268,10 @@ static MmsEnvelope *mms_queue_readenvelope(char *qf, char *mms_queuedir, int sho
|
||||||
case 'F':
|
case 'F':
|
||||||
e->from = octstr_create(res);
|
e->from = octstr_create(res);
|
||||||
if (mms_validate_address(e->from) != 0) {
|
if (mms_validate_address(e->from) != 0) {
|
||||||
|
#if 0
|
||||||
mms_warning(0, "mms_queueread", NULL, "Mal-formed address [%s] in file %s! "
|
mms_warning(0, "mms_queueread", NULL, "Mal-formed address [%s] in file %s! "
|
||||||
"Attempting fixup.", res, xqf);
|
"Attempting fixup.", res, xqf);
|
||||||
|
#endif
|
||||||
_mms_fixup_address(&e->from, NULL, NULL, 1);
|
_mms_fixup_address(&e->from, NULL, NULL, 1);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@ -277,8 +279,10 @@ static MmsEnvelope *mms_queue_readenvelope(char *qf, char *mms_queuedir, int sho
|
||||||
case 'z':
|
case 'z':
|
||||||
t = octstr_create(res);
|
t = octstr_create(res);
|
||||||
if (mms_validate_address(t) != 0) {
|
if (mms_validate_address(t) != 0) {
|
||||||
|
#if 0
|
||||||
mms_warning(0, "mms_queueread", NULL, "Mal-formed address [%s] in file %s! "
|
mms_warning(0, "mms_queueread", NULL, "Mal-formed address [%s] in file %s! "
|
||||||
"Attempting fixup.", res, xqf);
|
"Attempting fixup.", res, xqf);
|
||||||
|
#endif
|
||||||
_mms_fixup_address(&t, NULL, NULL, 1);
|
_mms_fixup_address(&t, NULL, NULL, 1);
|
||||||
}
|
}
|
||||||
to = gw_malloc(sizeof *to);
|
to = gw_malloc(sizeof *to);
|
||||||
|
|
|
@ -875,18 +875,33 @@ void mms_log(char *logmsg, Octstr *from, List *to,
|
||||||
{
|
{
|
||||||
Octstr *xto = octstr_create("");
|
Octstr *xto = octstr_create("");
|
||||||
int i, n = to ? gwlist_len(to) : 0;
|
int i, n = to ? gwlist_len(to) : 0;
|
||||||
|
Octstr *xfrom = from ? octstr_duplicate(from) : NULL;
|
||||||
|
int j = xfrom ? octstr_case_search(xfrom, octstr_imm("/TYPE=PLMN"), 0) : -1;
|
||||||
|
|
||||||
|
if (j >= 0)
|
||||||
|
octstr_delete(xfrom, j, octstr_len(xfrom));
|
||||||
|
|
||||||
|
for (i = 0; i < n; i++) {
|
||||||
|
void *y;
|
||||||
|
Octstr *x = (y = gwlist_get(to,i)) ? octstr_duplicate(y) : NULL;
|
||||||
|
int j = x ? octstr_case_search(x, octstr_imm("/TYPE=PLMN"), 0) : -1;
|
||||||
|
|
||||||
|
if (j >= 0)
|
||||||
|
octstr_delete(x, j, octstr_len(x));
|
||||||
|
|
||||||
for (i = 0; i < n; i++)
|
|
||||||
octstr_format_append(xto,
|
octstr_format_append(xto,
|
||||||
"%s%S",
|
"%s%S",
|
||||||
(i == 0) ? "" : ", ",
|
(i == 0) ? "" : ", ",
|
||||||
gwlist_get(to,i));
|
x);
|
||||||
|
|
||||||
|
octstr_destroy(x);
|
||||||
|
}
|
||||||
|
|
||||||
alog("%s MMS [INT:%s] [ACT:%s] [MMSC:%s] [from:%s] [to:%s] [msgid:%s] [size=%d] [UA:%s] [MMBox:%s]",
|
alog("%s MMS [INT:%s] [ACT:%s] [MMSC:%s] [from:%s] [to:%s] [msgid:%s] [size=%d] [UA:%s] [MMBox:%s]",
|
||||||
logmsg, interface,
|
logmsg, interface,
|
||||||
acct ? octstr_get_cstr(acct) : "",
|
acct ? octstr_get_cstr(acct) : "",
|
||||||
viaproxy ? octstr_get_cstr(viaproxy) : "",
|
viaproxy ? octstr_get_cstr(viaproxy) : "",
|
||||||
from ? octstr_get_cstr(from) : "",
|
xfrom ? octstr_get_cstr(xfrom) : "",
|
||||||
octstr_get_cstr(xto),
|
octstr_get_cstr(xto),
|
||||||
msgid ? octstr_get_cstr(msgid) : "",
|
msgid ? octstr_get_cstr(msgid) : "",
|
||||||
msize,
|
msize,
|
||||||
|
@ -894,6 +909,7 @@ void mms_log(char *logmsg, Octstr *from, List *to,
|
||||||
mmboxloc ? octstr_get_cstr(mmboxloc) : "");
|
mmboxloc ? octstr_get_cstr(mmboxloc) : "");
|
||||||
|
|
||||||
octstr_destroy(xto);
|
octstr_destroy(xto);
|
||||||
|
octstr_destroy(xfrom);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -412,10 +412,14 @@ static int queue_dlr(MmscGrp *mmc, Octstr *from, Octstr *to, Octstr *msgid, Octs
|
||||||
Octstr *qf, *rr_uri = NULL;
|
Octstr *qf, *rr_uri = NULL;
|
||||||
List *rqh = http_create_empty_headers();
|
List *rqh = http_create_empty_headers();
|
||||||
|
|
||||||
|
|
||||||
if (errl)
|
if (errl)
|
||||||
http_header_combine(rqh, errl); /* add status stuff. */
|
http_header_combine(rqh, errl); /* add status stuff. */
|
||||||
|
|
||||||
|
|
||||||
gwlist_append(lto, octstr_duplicate(to));
|
gwlist_append(lto, octstr_duplicate(to));
|
||||||
|
|
||||||
|
|
||||||
qdir = get_mmsbox_queue_dir(from, lto, mmc, &mmc_id); /* get routing info. */
|
qdir = get_mmsbox_queue_dir(from, lto, mmc, &mmc_id); /* get routing info. */
|
||||||
|
|
||||||
rr_uri = mmsbox_get_report_info(m, mmc, mmc_id, "delivery-report", status, rqh, NULL, 0, msgid);
|
rr_uri = mmsbox_get_report_info(m, mmc, mmc_id, "delivery-report", status, rqh, NULL, 0, msgid);
|
||||||
|
|
|
@ -835,7 +835,6 @@ Octstr *get_mmsbox_queue_dir(Octstr *from, List *to, MmscGrp *m,
|
||||||
Octstr *xto = octstr_duplicate(fto);
|
Octstr *xto = octstr_duplicate(fto);
|
||||||
Octstr *xfrom = octstr_duplicate(from);
|
Octstr *xfrom = octstr_duplicate(from);
|
||||||
|
|
||||||
|
|
||||||
if (unified_prefix)
|
if (unified_prefix)
|
||||||
_mms_fixup_address(&xfrom, octstr_get_cstr(unified_prefix), strip_prefixes, 0);
|
_mms_fixup_address(&xfrom, octstr_get_cstr(unified_prefix), strip_prefixes, 0);
|
||||||
if (unified_prefix)
|
if (unified_prefix)
|
||||||
|
@ -854,10 +853,11 @@ Octstr *get_mmsbox_queue_dir(Octstr *from, List *to, MmscGrp *m,
|
||||||
octstr_destroy(xto);
|
octstr_destroy(xto);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (xfrom) {
|
if (xfrom) { /* Check if sender address changed */
|
||||||
octstr_delete(from, 0, octstr_len(from));
|
octstr_delete(from, 0, octstr_len(from));
|
||||||
octstr_append(from, xfrom);
|
octstr_append(from, xfrom);
|
||||||
}
|
}
|
||||||
|
|
||||||
octstr_destroy(xfrom);
|
octstr_destroy(xfrom);
|
||||||
} else
|
} else
|
||||||
_mcid = NULL;
|
_mcid = NULL;
|
||||||
|
|
Loading…
Reference in New Issue