|
|
|
@ -467,7 +467,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);
|
|
|
|
|
|
|
|
|
|
mmsbox_event_cb(mmc->id, MM7_TAG_DeliveryReportReq, 0,octstr_imm("5.3.0"), 200,
|
|
|
|
|
mmsbox_event_cb(mmc ? mmc->id : NULL, MM7_TAG_DeliveryReportReq, 0,octstr_imm("5.3.0"), 200,
|
|
|
|
|
0, 0, from,
|
|
|
|
|
lto && gwlist_len(lto) > 0 ? gwlist_get(lto,0) : NULL,
|
|
|
|
|
msgid, NULL, NULL, status);
|
|
|
|
@ -539,7 +539,7 @@ static int mm7eaif_receive(MmsBoxHTTPClientInfo *h)
|
|
|
|
|
|
|
|
|
|
/* XXXX handle delivery reports differently. */
|
|
|
|
|
mtype = mms_messagetype(m);
|
|
|
|
|
mm7type = mm7_msgtype_to_soaptype(mtype, 1);
|
|
|
|
|
mm7type = mm7_msgtype_to_soaptype(mtype, 0);
|
|
|
|
|
mh = mms_message_headers(m);
|
|
|
|
|
/* Now get sender and receiver data.
|
|
|
|
|
* for now we ignore adaptation flags.
|
|
|
|
@ -803,7 +803,7 @@ static int mm7http_receive(MmsBoxHTTPClientInfo *h)
|
|
|
|
|
to = octstr_split_words(hto);
|
|
|
|
|
|
|
|
|
|
mtype = mms_messagetype(m);
|
|
|
|
|
mm7type = mm7_msgtype_to_soaptype(mtype, 1);
|
|
|
|
|
mm7type = mm7_msgtype_to_soaptype(mtype, 0);
|
|
|
|
|
mh = mms_message_headers(m);
|
|
|
|
|
|
|
|
|
|
/* find interesting headers. */
|
|
|
|
@ -1631,12 +1631,13 @@ static int sendMsg(MmsEnvelope *e)
|
|
|
|
|
"",
|
|
|
|
|
"", 0,
|
|
|
|
|
e->xqfname,
|
|
|
|
|
e->hdrs);
|
|
|
|
|
if (res == MMS_SEND_OK || res == MMS_SEND_QUEUED)
|
|
|
|
|
e->hdrs);
|
|
|
|
|
if (res == MMS_SEND_OK || res == MMS_SEND_QUEUED) {
|
|
|
|
|
new_msgid = e->msgId ? octstr_duplicate(e->msgId) : octstr_create("00001"); /* Fake it */
|
|
|
|
|
mmsbox_event_cb(NULL, MM7_TAG_SubmitReq, 1, octstr_imm("1.0"), 200,
|
|
|
|
|
mms_msgsize(msg), e->attempts, pfrom,
|
|
|
|
|
to->rcpt,NULL, NULL, e->hdrs, NULL);
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
octstr_destroy(pfrom);
|
|
|
|
|
octstr_destroy(xto);
|
|
|
|
|
} else {
|
|
|
|
@ -1657,14 +1658,7 @@ static int sendMsg(MmsEnvelope *e)
|
|
|
|
|
octstr_destroy(x);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (mmc) {
|
|
|
|
|
if (res == MMS_SEND_OK)
|
|
|
|
|
mmc->mt_pdus++;
|
|
|
|
|
else
|
|
|
|
|
mmc->mt_errors++;
|
|
|
|
|
mmc->last_pdu = time(NULL);
|
|
|
|
|
return_mmsc_conn(mmc); /* important. */
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
done:
|
|
|
|
|
if (res == MMS_SEND_OK || res == MMS_SEND_QUEUED) {
|
|
|
|
|
to->process = 0;
|
|
|
|
@ -1680,6 +1674,16 @@ static int sendMsg(MmsEnvelope *e)
|
|
|
|
|
octstr_imm("Expired") : octstr_imm("Rejected"),
|
|
|
|
|
"MM7-Out", errl);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (mmc) {
|
|
|
|
|
if (res == MMS_SEND_OK || res == MMS_SEND_QUEUED)
|
|
|
|
|
mmc->mt_pdus++;
|
|
|
|
|
else
|
|
|
|
|
mmc->mt_errors++;
|
|
|
|
|
mmc->last_pdu = time(NULL);
|
|
|
|
|
return_mmsc_conn(mmc); /* important. */
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (res == MMS_SEND_ERROR_FATAL)
|
|
|
|
|
to->process = 0; /* No more attempts. */
|
|
|
|
|
|
|
|
|
@ -1949,6 +1953,7 @@ static Octstr *handle_msg(MIMEEntity *mm, Octstr *from, List *to, MmscGrp *mmc)
|
|
|
|
|
} else
|
|
|
|
|
msg = NULL;
|
|
|
|
|
|
|
|
|
|
mm7type = mm7_msgtype_to_soaptype(mm1_type,0);
|
|
|
|
|
me = octstr_format("system-user@%S", myhostname);
|
|
|
|
|
|
|
|
|
|
qdir = get_mmsbox_queue_dir(from, to, mmc, &mmc_id); /* get routing info. */
|
|
|
|
@ -2085,7 +2090,7 @@ static Octstr *handle_msg(MIMEEntity *mm, Octstr *from, List *to, MmscGrp *mmc)
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
mm7type = mm7_msgtype_to_soaptype(mm1_type,1);
|
|
|
|
|
|
|
|
|
|
if (mm7type >= 0) /* Issue event call back */
|
|
|
|
|
mmsbox_event_cb(mmc->id, mm7type, 1, octstr_imm("1.0"), 200,
|
|
|
|
|
mms_msgsize(msg), 0, from,
|
|
|
|
@ -2101,7 +2106,11 @@ static Octstr *handle_msg(MIMEEntity *mm, Octstr *from, List *to, MmscGrp *mmc)
|
|
|
|
|
mmsbox_event_cb(mmc->id, mm7type >= 0 ? mm7type + 1 : MM7_TAG_VASPErrorRsp,
|
|
|
|
|
1, octstr_imm("1.0"), 200,
|
|
|
|
|
size, 0, me, orig_sys, res, NULL, NULL, NULL);
|
|
|
|
|
}
|
|
|
|
|
} else if (mtype == MM4_FORWARD_REQ) /* Or straight up SMTP */
|
|
|
|
|
mmsbox_event_cb(mmc->id, mm7type >= 0 ? mm7type + 1 : MM7_TAG_VASPErrorRsp,
|
|
|
|
|
1, octstr_imm("1.0"), 200,
|
|
|
|
|
0, 0, me, orig_sys, res, NULL, NULL, NULL);
|
|
|
|
|
|
|
|
|
|
octstr_destroy(mm4_type);
|
|
|
|
|
octstr_destroy(transid);
|
|
|
|
|
octstr_destroy(orig_sys);
|
|
|
|
|