1
0
Fork 0

minor fix to handling of dlr on mm4 interface

This commit is contained in:
bagyenda 2007-04-18 12:08:24 +00:00
parent c3a4ddcf67
commit e3aabcccfe
2 changed files with 21 additions and 8 deletions

View File

@ -704,9 +704,18 @@ int mms_sendtoemail(Octstr *from, Octstr *to,
if (mtype == MMS_MSGTYPE_SEND_REQ ||
mtype == MMS_MSGTYPE_RETRIEVE_CONF)
x = "MM4_forward.REQ";
else if (mtype == MMS_MSGTYPE_DELIVERY_IND)
else if (mtype == MMS_MSGTYPE_DELIVERY_IND) {
Octstr *s = http_header_value(headers, octstr_imm("X-Mms-Status"));
x = "MM4_delivery_report.REQ";
else if (mtype == MMS_MSGTYPE_READ_REC_IND)
/* rename status header. */
http_header_remove_all(headers, "X-Mms-Status");
http_header_add(newhdrs, "X-Mms-MM-Status-Code",
s ? octstr_get_cstr(s) : "Unrecognised");
if (!s)
warning(0, "MMS Delivery report with missing Status!");
octstr_destroy(s);
} else if (mtype == MMS_MSGTYPE_READ_REC_IND)
x = "MM4_read_reply_report.REQ";
else {
*error = octstr_format("Invalid message type %s on MM4 outgoing interface!",

View File

@ -52,19 +52,16 @@ static mCfg *cfg;
static List *proxyrelays;
int main(int argc, char *argv[])
{
int cfidx;
Octstr *fname;
MIMEEntity *mm;
MmsMsg *msg;
Octstr *email, *me, *rstatus;
Octstr *email, *me, *rstatus, *fname;
Octstr *home_mmsc = NULL;
List *headers;
Octstr *mm4_type = NULL, *transid, *ack, *msgid, *orig_sys;
Octstr *newmsgid = NULL;
int mtype = -1, mm1_type = -1;
int mtype = -1, mm1_type = -1, cfidx;
char *err = NULL;
mms_lib_init();
@ -188,6 +185,7 @@ int main(int argc, char *argv[])
if (mm4_type) {
unsigned char *x = NULL;
Octstr *y;
int i;
http_header_remove_all(headers, "X-Mms-Message-Type");
@ -200,7 +198,13 @@ int main(int argc, char *argv[])
}
if (x)
http_header_add(headers, "X-Mms-Message-Type", (char *)x);
if ((y = http_header_value(headers, octstr_imm("X-Mms-MM-Status-Code"))) != NULL) {
/* This field is different on MM1. */
http_header_remove_all(headers, "X-Mms-MM-Status-Code");
http_header_add(headers, "X-Mms-Status", octstr_get_cstr(y));
octstr_destroy(y);
}
if (orig_sys == NULL) /* Make it up! */
orig_sys = octstr_format("system-user@%S", xproxy ? xproxy : octstr_imm("unknown"));
} else { /* else assume a normal send message. */