diff --git a/mbuni/mmsbox/bearerbox.c b/mbuni/mmsbox/bearerbox.c index 1c2e1e1..6deb11d 100644 --- a/mbuni/mmsbox/bearerbox.c +++ b/mbuni/mmsbox/bearerbox.c @@ -161,7 +161,10 @@ Octstr *mmsbox_get_report_info(MmsMsg *m, MmscGrp *mmsc, Octstr *out_mmc_id, cha Octstr *msgid) { Octstr *res; - if (out_mmc_id != NULL) { /* internal routing. */ + + if (mmsc == NULL) + res = NULL; + else if (out_mmc_id != NULL) { /* internal routing. */ if (m) fixup_relayed_report(m, mmsc, report_type, octstr_imm("")); res = NULL; @@ -430,7 +433,7 @@ static int queue_dlr(MmscGrp *mmc, Octstr *from, Octstr *to, Octstr *msgid, Octs rr_uri = mmsbox_get_report_info(m, mmc, mmc_id, "delivery-report", status, rqh, NULL, 0, msgid); qf = qfs->mms_queue_add(from, lto, NULL, - mmc->id, mmc_id, + mmc ? mmc->id : NULL, mmc_id, 0, time(NULL) + default_msgexpiry, m, NULL, NULL, NULL, rr_uri, NULL, @@ -441,7 +444,7 @@ static int queue_dlr(MmscGrp *mmc, Octstr *from, Octstr *to, Octstr *msgid, Octs NULL); if (qf) { /* Log to access log */ - mms_log("Received DLR", from, lto, -1, msgid, status, mmc->id, "MMSBox", NULL, NULL); + mms_log("Received DLR", from, lto, -1, msgid, status, mmc ? mmc->id : NULL, "MMSBox", NULL, NULL); ret = 0; } else ret = -1;