Minor fixes to dlr handling in mmsbox
This commit is contained in:
parent
7430986871
commit
a2c99daca6
|
@ -1,3 +1,5 @@
|
|||
2007-05-05 P. A. Bagyenda <bagyenda@dsmagic.com>
|
||||
* Minor improvements to DLR handling in mmsbox. (Thanks to Vincent Chavanis <vincent@telemaque.fr>)
|
||||
2007-04-13 P. A. Bagyenda <bagyenda@dsmagic.com>
|
||||
* Minor fixups on handling of MM4 Forward ACK messages.
|
||||
2007-04-12 P. A. Bagyenda <bagyenda@dsmagic.com>
|
||||
|
|
|
@ -86,7 +86,8 @@ static int send_report(Octstr *from, char *report_type, Octstr *status,
|
|||
Octstr *rb = NULL;
|
||||
|
||||
if (!url) {
|
||||
info(0, "Sending delivery-report Failed: 'url' is NULL");
|
||||
info(0, "Sending delivery-report Failed: `url' is NULL, `group_id'=[%s], `msgid'=[%s]",
|
||||
octstr_get_cstr(mmc_gid), octstr_get_cstr(msgid));
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -96,6 +97,7 @@ static int send_report(Octstr *from, char *report_type, Octstr *status,
|
|||
http_header_add(rh, "X-Mbuni-MM-Status", octstr_get_cstr(status));
|
||||
http_header_add(rh, "X-Mbuni-Message-ID", octstr_get_cstr(msgid));
|
||||
http_header_add(rh, "X-Mbuni-MMSC-ID", octstr_get_cstr(mmc_id));
|
||||
http_header_add(rh, "X-Mbuni-MMSC-GID", octstr_get_cstr(mmc_gid));
|
||||
http_header_add(rh, "X-Mbuni-From", octstr_get_cstr(from));
|
||||
|
||||
|
||||
|
@ -109,10 +111,11 @@ static int send_report(Octstr *from, char *report_type, Octstr *status,
|
|||
http_destroy_headers(rh);
|
||||
|
||||
/* At what point do we delete it? For now, when we get a read report,
|
||||
* and also when we get a delivery report that is not 'deferred'
|
||||
* and also when we get a delivery report that is not 'deferred' or sent
|
||||
*/
|
||||
if (strcmp(report_type, "read-report") == 0 ||
|
||||
octstr_case_compare(status, octstr_imm("Deferred")) != 0)
|
||||
(octstr_case_compare(status, octstr_imm("Deferred")) != 0 &&
|
||||
octstr_case_compare(status, octstr_imm("Sent")) != 0))
|
||||
mms_dlr_url_remove(msgid, report_type, mmc_gid);
|
||||
return 0;
|
||||
}
|
||||
|
@ -743,7 +746,7 @@ static Octstr *mm7eaif_send(MmscGrp *mmc, Octstr *from, Octstr *to,
|
|||
if (ret)
|
||||
mms_log2("Sent", from, to, -1, ret, NULL, mmc->id, "MMSBox", NULL, NULL);
|
||||
|
||||
info(0, "Sent to MMC[%s], code=[%d], resp=%s msgid [%s]", octstr_get_cstr(mmc->id),
|
||||
info(0, "Sent to MMC[%s], code=[%d], resp=[%s] msgid [%s]", octstr_get_cstr(mmc->id),
|
||||
hstatus, resp ? octstr_get_cstr(resp) : "(none)", ret ? octstr_get_cstr(ret) : "(none)");
|
||||
|
||||
if (rh)
|
||||
|
@ -792,8 +795,12 @@ static int mms_sendtommsc(MmscGrp *mmc, Octstr *from, Octstr *to, Octstr *transi
|
|||
} mutex_unlock(mmc->mutex); /* release lock */
|
||||
|
||||
if (id) {
|
||||
if (dlr_url) /* remember the url's for reporting purposes. */
|
||||
if (dlr_url) { /* remember the url's for reporting purposes. */
|
||||
mms_dlr_url_put(id, "delivery-report", groupid, dlr_url);
|
||||
send_report(from, "delivery-report",
|
||||
octstr_imm("Sent"), id, mmc->id, groupid);
|
||||
}
|
||||
|
||||
if (rr_url)
|
||||
mms_dlr_url_put(id, "read-report", groupid, rr_url);
|
||||
|
||||
|
|
Loading…
Reference in New Issue