- Improved handling of retrieve-conf message received on send interfaces
This commit is contained in:
parent
bbeb0c91e3
commit
c42ddb8aa5
|
@ -1645,6 +1645,22 @@ MmsMsg *mms_sendconf(char *errstr, char *msgid, char *transid, int isforward, in
|
|||
return m;
|
||||
}
|
||||
|
||||
int mms_make_sendreq(MmsMsg *retrieveconf)
|
||||
{
|
||||
|
||||
gw_assert(retrieveconf);
|
||||
|
||||
if (retrieveconf->message_type == MMS_MSGTYPE_SEND_REQ)
|
||||
return 0;
|
||||
|
||||
gw_assert(retrieveconf->message_type == MMS_MSGTYPE_RETRIEVE_CONF);
|
||||
|
||||
retrieveconf->message_type = MMS_MSGTYPE_SEND_REQ;
|
||||
mms_replace_header_value(retrieveconf, "X-Mms-Message-Type",
|
||||
(char *)mms_message_type_to_cstr(MMS_MSGTYPE_SEND_REQ));
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int mms_replace_header_value(MmsMsg *msg, char *hname, char *value)
|
||||
{
|
||||
|
|
|
@ -118,4 +118,10 @@ int mms_clearbody(MmsMsg *msg);
|
|||
* Use function with extreme caution! It should be for testing only really!!!!
|
||||
*/
|
||||
int mms_putbody(MmsMsg *msg, void *body, int ismultipart);
|
||||
|
||||
/* Convert a retrieve_conf message to a send_req messagre
|
||||
* checked runtime error to pass anything but a send_req/retrieve_conf.
|
||||
* returns 0 on success.
|
||||
*/
|
||||
int mms_make_sendreq(MmsMsg *retrieveconf);
|
||||
#endif
|
||||
|
|
|
@ -338,6 +338,7 @@ static void mm7eaif_receive(MmsHTTPClientInfo *h)
|
|||
|
||||
switch(mtype) {
|
||||
case MMS_MSGTYPE_SEND_REQ:
|
||||
case MMS_MSGTYPE_RETRIEVE_CONF:
|
||||
|
||||
/* Get Message ID */
|
||||
if ((msgid = http_header_value(h->headers, octstr_imm("X-NOKIA-MMSC-Message-Id"))) == NULL)
|
||||
|
@ -652,9 +653,11 @@ static Octstr *mm7eaif_send(MmscGrp *mmc, Octstr *from, Octstr *to,
|
|||
http_header_add(rh, "X-NOKIA-MMSC-From", octstr_get_cstr(from));
|
||||
http_header_add(rh, "X-NOKIA-MMSC-Version", EAIF_VERSION);
|
||||
|
||||
if (mtype == MMS_MSGTYPE_SEND_REQ)
|
||||
if (mtype == MMS_MSGTYPE_SEND_REQ ||
|
||||
mtype == MMS_MSGTYPE_RETRIEVE_CONF) {
|
||||
msgtype = "MultiMediaMessage";
|
||||
else if (mtype == MMS_MSGTYPE_DELIVERY_IND)
|
||||
mms_make_sendreq(m); /* ensure it is a sendreq. */
|
||||
} else if (mtype == MMS_MSGTYPE_DELIVERY_IND)
|
||||
msgtype = "DeliveryReport";
|
||||
else
|
||||
msgtype = "ReadReply";
|
||||
|
|
|
@ -416,7 +416,7 @@ static int mmsbox_service_dispatch(MmsEnvelope *e)
|
|||
Octstr *err = NULL, *keyword = NULL;
|
||||
MmsService *ms;
|
||||
|
||||
gw_assert(e->msgtype == MMS_MSGTYPE_SEND_REQ);
|
||||
gw_assert(e->msgtype == MMS_MSGTYPE_SEND_REQ || e->msgtype == MMS_MSGTYPE_RETRIEVE_CONF);
|
||||
|
||||
if ((msg = mms_queue_getdata(e)) == NULL) {
|
||||
err = octstr_format("Failed to read message for queue entry %s!",
|
||||
|
|
|
@ -639,9 +639,13 @@ static int mm7eaif_send(MmsVasp *vasp, Octstr *from, Octstr *to, Octstr *msgid,
|
|||
http_header_add(rh, "X-NOKIA-MMSC-Message-Id", octstr_get_cstr(msgid));
|
||||
http_header_add(rh, "X-NOKIA-MMSC-Version", EAIF_VERSION);
|
||||
|
||||
if (mtype == MMS_MSGTYPE_SEND_REQ)
|
||||
if (mtype == MMS_MSGTYPE_SEND_REQ ||
|
||||
mtype == MMS_MSGTYPE_RETRIEVE_CONF) {
|
||||
msgtype = "MultiMediaMessage";
|
||||
else if (mtype == MMS_MSGTYPE_DELIVERY_IND)
|
||||
|
||||
mms_make_sendreq(m); /* ensure it is a sendreq. */
|
||||
|
||||
} else if (mtype == MMS_MSGTYPE_DELIVERY_IND)
|
||||
msgtype = "DeliveryReport";
|
||||
else
|
||||
msgtype = "ReadReply";
|
||||
|
|
Loading…
Reference in New Issue