1
0
Fork 0

minor fix to mmsbox

This commit is contained in:
bagyenda 2007-09-20 15:23:27 +00:00
parent 281b7c220b
commit a87514cc02
3 changed files with 15 additions and 11 deletions

View File

@ -202,7 +202,6 @@ static void mm7soap_receive(MmsHTTPClientInfo *h)
octstr_destroy(sx); octstr_destroy(sx);
} }
qf = qfs->mms_queue_add(from, to, subject, qf = qfs->mms_queue_add(from, to, subject,
h->m->id, mmc_id, h->m->id, mmc_id,
delivert, expiryt, m, linkedid, delivert, expiryt, m, linkedid,

View File

@ -485,17 +485,20 @@ Octstr *get_mmsbox_queue_dir(Octstr *from, List *to, MmscGrp *m,
Octstr **mmc_id) { Octstr **mmc_id) {
if (m->reroute) { if (m->reroute) {
*mmc_id = octstr_duplicate(m->reroute_mmsc_id); *mmc_id = m->reroute_mmsc_id ? octstr_duplicate(m->reroute_mmsc_id) : NULL;
return outgoing_qdir; return outgoing_qdir;
} else { } else {
Octstr *_mcid, *fto = NULL, *qdir = NULL; Octstr *_mcid, *qdir = NULL;
if (gwlist_len(to) > 0) { /* we route based on first recipient XXX */ if (gwlist_len(to) > 0) { /* we route based on first recipient XXX */
Octstr *r = gwlist_get(to, 0); Octstr *fto = gwlist_extract_first(to);
fto = r ? octstr_duplicate(r) : NULL;
} normalize_number(octstr_get_cstr(unified_prefix), &fto);
_mcid = rfs->mmsbox_resolve(from,fto,octstr_get_cstr(m->id), rfs_data, rfs_settings);
_mcid = rfs->mmsbox_resolve(from,fto,octstr_get_cstr(m->id), rfs_data, rfs_settings); gwlist_insert(to, 0, fto); /* put it back, after modification. */
} else
_mcid = NULL;
if (_mcid == NULL || octstr_len(_mcid) == 0) { if (_mcid == NULL || octstr_len(_mcid) == 0) {
*mmc_id = NULL; *mmc_id = NULL;
@ -504,8 +507,9 @@ Octstr *get_mmsbox_queue_dir(Octstr *from, List *to, MmscGrp *m,
*mmc_id = octstr_duplicate(_mcid); *mmc_id = octstr_duplicate(_mcid);
qdir = outgoing_qdir; qdir = outgoing_qdir;
} }
octstr_destroy(_mcid); octstr_destroy(_mcid);
octstr_destroy(fto);
return qdir; return qdir;
} }
return 0; return 0;

View File

@ -30,7 +30,7 @@ static int _shell_resolvermodule_fini(void *module_data)
return 0; return 0;
} }
static Octstr *_shell_resolve(Octstr *pfrom, Octstr *pto, void *module_data, void *settings_p) static Octstr *_shell_resolve(Octstr *pfrom, Octstr *pto, char *in_mmc, void *module_data, void *settings_p)
{ {
Octstr *s; Octstr *s;
FILE *fp; FILE *fp;
@ -39,8 +39,9 @@ static Octstr *_shell_resolve(Octstr *pfrom, Octstr *pto, void *module_data, voi
if (script == NULL || octstr_len(script) == 0) if (script == NULL || octstr_len(script) == 0)
return 0; return 0;
s = octstr_format("%s '%s' '%s' ", s = octstr_format("%s '%s' '%s' '%s'",
octstr_get_cstr(script), octstr_get_cstr(pfrom), octstr_get_cstr(pto)); octstr_get_cstr(script), octstr_get_cstr(pfrom), octstr_get_cstr(pto),
in_mmc);
fp = popen(octstr_get_cstr(s), "r"); fp = popen(octstr_get_cstr(s), "r");
octstr_destroy(s); octstr_destroy(s);