Allowed setting of MM7/SOAP interface version
This commit is contained in:
parent
89c9b8eddb
commit
a22898306a
|
@ -1,3 +1,5 @@
|
||||||
|
2007-04-10 P. A. Bagyenda <bagyenda@dsmagic.com>
|
||||||
|
* MM7/SOAP XMLNS string now configurable via setting per-MMC (or per-VASP) interface version
|
||||||
2007-04-02 Vincent Chavanis <vincent@telemaque.fr>
|
2007-04-02 Vincent Chavanis <vincent@telemaque.fr>
|
||||||
* Added group-id field to VAS GW MMC config
|
* Added group-id field to VAS GW MMC config
|
||||||
2007-03-20 P. A. Bagyenda <bagyenda@dsmagic.com>
|
2007-03-20 P. A. Bagyenda <bagyenda@dsmagic.com>
|
||||||
|
|
|
@ -1688,6 +1688,23 @@ vasp-url
|
||||||
This should be one of: soap, eaif
|
This should be one of: soap, eaif
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
|
<tr>
|
||||||
|
<td valign=top >
|
||||||
|
<tt>mm7-version</tt>
|
||||||
|
</td>
|
||||||
|
<td valign=top >
|
||||||
|
String
|
||||||
|
</td>
|
||||||
|
<td valign=top >
|
||||||
|
Optional. The MM7 version to use on this interface. (defaults are "5.1.0" for
|
||||||
|
XML/SOAP, "3.0" for EAIF.) For SOAP, this is
|
||||||
|
used primarily to build the XML Namespace URL. For EAIF it is
|
||||||
|
reported in the HTTP headers.
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
|
||||||
|
|
||||||
<tr>
|
<tr>
|
||||||
<td valign=top >
|
<td valign=top >
|
||||||
<tt>short-code</tt>
|
<tt>short-code</tt>
|
||||||
|
@ -2005,6 +2022,21 @@ Supported configuration parameters are:
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
|
<tr>
|
||||||
|
<td valign=top >
|
||||||
|
<tt>mm7-version</tt>
|
||||||
|
</td>
|
||||||
|
<td valign=top >
|
||||||
|
String
|
||||||
|
</td>
|
||||||
|
<td valign=top >
|
||||||
|
Optional. The MM7 version to use on this interface. (defaults are "5.1.0" for
|
||||||
|
XML/SOAP, "3.0" for EAIF.) For SOAP, this is
|
||||||
|
used primarily to build the XML Namespace URL. For EAIF it is
|
||||||
|
reported in the HTTP headers.
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
|
||||||
<tr>
|
<tr>
|
||||||
<td valign=top >
|
<td valign=top >
|
||||||
<tt>mmsc-url</tt>
|
<tt>mmsc-url</tt>
|
||||||
|
|
|
@ -97,6 +97,7 @@ MULTI_GROUP(mmsproxy,
|
||||||
MULTI_GROUP(mms-vasp,
|
MULTI_GROUP(mms-vasp,
|
||||||
OCTSTR(vasp-id)
|
OCTSTR(vasp-id)
|
||||||
OCTSTR(type)
|
OCTSTR(type)
|
||||||
|
OCTSTR(mm7-version)
|
||||||
OCTSTR(short-code)
|
OCTSTR(short-code)
|
||||||
OCTSTR(vasp-username)
|
OCTSTR(vasp-username)
|
||||||
OCTSTR(vasp-password)
|
OCTSTR(vasp-password)
|
||||||
|
@ -127,6 +128,7 @@ MULTI_GROUP(mmsc,
|
||||||
OCTSTR(incoming-port-ssl)
|
OCTSTR(incoming-port-ssl)
|
||||||
OCTSTR(max-throughput)
|
OCTSTR(max-throughput)
|
||||||
OCTSTR(type)
|
OCTSTR(type)
|
||||||
|
OCTSTR(mm7-version)
|
||||||
)
|
)
|
||||||
|
|
||||||
MULTI_GROUP(mms-service,
|
MULTI_GROUP(mms-service,
|
||||||
|
|
|
@ -360,13 +360,15 @@ static void output_rcpt(char *hdr, List *hdrs, Octstr *p)
|
||||||
http_destroy_headers(l);
|
http_destroy_headers(l);
|
||||||
}
|
}
|
||||||
|
|
||||||
#define XMLNSMM7 "http://www.3gpp.org/ftp/Specs/archive/23_series/23.140/schema/REL-5-MM7-1-2"
|
#define XMLNSMM7 "http://www.3gpp.org/ftp/Specs/archive/23_series/23.140/schema/REL-%d-MM7-%d-%d"
|
||||||
#define SOAP_ENV "SOAP-ENV"
|
#define SOAP_ENV "SOAP-ENV"
|
||||||
|
|
||||||
/* Construct by hand. */
|
/* Construct by hand. */
|
||||||
Octstr *headers_to_soapxml(List *hdrs)
|
static Octstr *headers_to_soapxml(List *hdrs, MM7Version_t *ver)
|
||||||
{
|
{
|
||||||
Octstr *s = octstr_create("<?xml version='1.0' encoding='UTF-8'?>\n");
|
Octstr *s = octstr_create("<?xml version='1.0' encoding='UTF-8'?>\n");
|
||||||
|
Octstr *xmlns = octstr_format(XMLNSMM7, ver->major, ver->minor1, ver->minor2);
|
||||||
|
|
||||||
Octstr *p, *q, *r, *fault, *mtype;
|
Octstr *p, *q, *r, *fault, *mtype;
|
||||||
int i, n;
|
int i, n;
|
||||||
time_t t;
|
time_t t;
|
||||||
|
@ -378,7 +380,7 @@ Octstr *headers_to_soapxml(List *hdrs)
|
||||||
p = http_header_value(hdrs, octstr_imm("TransactionID"));
|
p = http_header_value(hdrs, octstr_imm("TransactionID"));
|
||||||
|
|
||||||
octstr_format_append(s, "<mm7:TransactionID xmlns:mm7=\"%s\" " SOAP_ENV ":mustUnderstand=\"1\">%S</mm7:TransactionID>\n",
|
octstr_format_append(s, "<mm7:TransactionID xmlns:mm7=\"%s\" " SOAP_ENV ":mustUnderstand=\"1\">%S</mm7:TransactionID>\n",
|
||||||
XMLNSMM7, p ? p : octstr_imm("none"));
|
octstr_get_cstr(xmlns), p ? p : octstr_imm("none"));
|
||||||
if (p)
|
if (p)
|
||||||
octstr_destroy(p);
|
octstr_destroy(p);
|
||||||
|
|
||||||
|
@ -406,12 +408,14 @@ Octstr *headers_to_soapxml(List *hdrs)
|
||||||
mtype = http_header_value(hdrs, octstr_imm("MessageType"));
|
mtype = http_header_value(hdrs, octstr_imm("MessageType"));
|
||||||
mtag = mms_string_to_mm7tag(mtype);
|
mtag = mms_string_to_mm7tag(mtype);
|
||||||
|
|
||||||
octstr_format_append(s, "<mm7:%S xmlns:mm7=\"%s\">\n", mtype, XMLNSMM7);
|
octstr_format_append(s, "<mm7:%S xmlns:mm7=\"%s\">\n", mtype, octstr_get_cstr(xmlns));
|
||||||
|
|
||||||
/* Output the details. */
|
/* Output the details. */
|
||||||
p = http_header_value(hdrs, octstr_imm("MM7Version"));
|
if ((p = http_header_value(hdrs, octstr_imm("MM7Version"))) != NULL) {
|
||||||
octstr_format_append(s, "<mm7:MM7Version>%S</mm7:MM7Version>\n", p);
|
octstr_format_append(s, "<mm7:MM7Version>%S</mm7:MM7Version>\n", p);
|
||||||
octstr_destroy(p);
|
octstr_destroy(p);
|
||||||
|
} else
|
||||||
|
octstr_format_append(s, "<mm7:MM7Version>%d.%d.%d</mm7:MM7Version>\n", ver->major, ver->minor1, ver->minor2);
|
||||||
|
|
||||||
p = http_header_value(hdrs, octstr_imm("VASPID"));
|
p = http_header_value(hdrs, octstr_imm("VASPID"));
|
||||||
q = http_header_value(hdrs, octstr_imm("VASID"));
|
q = http_header_value(hdrs, octstr_imm("VASID"));
|
||||||
|
@ -453,7 +457,7 @@ Octstr *headers_to_soapxml(List *hdrs)
|
||||||
octstr_destroy(q);
|
octstr_destroy(q);
|
||||||
}
|
}
|
||||||
octstr_destroy(p);
|
octstr_destroy(p);
|
||||||
|
octstr_destroy(xmlns);
|
||||||
|
|
||||||
/* cycle through rest of headers. */
|
/* cycle through rest of headers. */
|
||||||
|
|
||||||
|
@ -573,7 +577,7 @@ Octstr *headers_to_soapxml(List *hdrs)
|
||||||
return s;
|
return s;
|
||||||
}
|
}
|
||||||
|
|
||||||
int mm7_soapmsg_to_httpmsg(MSoapMsg_t *m, List **hdrs, Octstr **body)
|
int mm7_soapmsg_to_httpmsg(MSoapMsg_t *m, MM7Version_t *ver, List **hdrs, Octstr **body)
|
||||||
{
|
{
|
||||||
MIMEEntity *mime;
|
MIMEEntity *mime;
|
||||||
Octstr *ctype, *s;
|
Octstr *ctype, *s;
|
||||||
|
@ -613,7 +617,7 @@ int mm7_soapmsg_to_httpmsg(MSoapMsg_t *m, List **hdrs, Octstr **body)
|
||||||
mime_replace_headers(xml, hx);
|
mime_replace_headers(xml, hx);
|
||||||
http_destroy_headers(hx);
|
http_destroy_headers(hx);
|
||||||
|
|
||||||
s = headers_to_soapxml(hh);
|
s = headers_to_soapxml(hh,ver);
|
||||||
mime_entity_set_body(xml, s);
|
mime_entity_set_body(xml, s);
|
||||||
octstr_destroy(s);
|
octstr_destroy(s);
|
||||||
|
|
||||||
|
@ -633,7 +637,7 @@ int mm7_soapmsg_to_httpmsg(MSoapMsg_t *m, List **hdrs, Octstr **body)
|
||||||
mime_entity_destroy(c);
|
mime_entity_destroy(c);
|
||||||
} else {
|
} else {
|
||||||
ctype = octstr_imm("text/xml");
|
ctype = octstr_imm("text/xml");
|
||||||
s = headers_to_soapxml(m->envelope);
|
s = headers_to_soapxml(m->envelope, ver);
|
||||||
mime_entity_set_body(mime,s);
|
mime_entity_set_body(mime,s);
|
||||||
octstr_destroy(s);
|
octstr_destroy(s);
|
||||||
}
|
}
|
||||||
|
@ -888,7 +892,7 @@ static MSoapMsg_t *mm7_soap_create(int msgtype, Octstr *otransid)
|
||||||
m->msg = NULL;
|
m->msg = NULL;
|
||||||
|
|
||||||
http_header_add(m->envelope, "MessageType", (char *)mms_mm7tag_to_cstr(msgtype));
|
http_header_add(m->envelope, "MessageType", (char *)mms_mm7tag_to_cstr(msgtype));
|
||||||
http_header_add(m->envelope, "MM7Version", MM7_DEFAULT_VERSION);
|
/* http_header_add(m->envelope, "MM7Version", MM7_DEFAULT_VERSION); */
|
||||||
http_header_add(m->envelope, "TransactionID",
|
http_header_add(m->envelope, "TransactionID",
|
||||||
otransid ? octstr_get_cstr(otransid) : "0000");
|
otransid ? octstr_get_cstr(otransid) : "0000");
|
||||||
return m;
|
return m;
|
||||||
|
|
|
@ -23,11 +23,15 @@
|
||||||
|
|
||||||
typedef struct MSoapMsg_t MSoapMsg_t;
|
typedef struct MSoapMsg_t MSoapMsg_t;
|
||||||
|
|
||||||
|
typedef struct MM7Version_t {
|
||||||
|
int major, minor1, minor2; /* e.g. 5.1.0. */
|
||||||
|
} MM7Version_t;
|
||||||
|
|
||||||
/* Parse SOAP message given http headers and body. */
|
/* Parse SOAP message given http headers and body. */
|
||||||
extern MSoapMsg_t *mm7_parse_soap(List *headers, Octstr *body);
|
extern MSoapMsg_t *mm7_parse_soap(List *headers, Octstr *body);
|
||||||
|
|
||||||
/* Convert SOAP message to http headers and body. */
|
/* Convert SOAP message to http headers and body. */
|
||||||
extern int mm7_soapmsg_to_httpmsg(MSoapMsg_t *m, List **hdrs, Octstr **body);
|
extern int mm7_soapmsg_to_httpmsg(MSoapMsg_t *m, MM7Version_t *ver, List **hdrs, Octstr **body);
|
||||||
|
|
||||||
/* Convert SOAP message to an MMS message. */
|
/* Convert SOAP message to an MMS message. */
|
||||||
extern MmsMsg *mm7_soap_to_mmsmsg(MSoapMsg_t *m, Octstr *from);
|
extern MmsMsg *mm7_soap_to_mmsmsg(MSoapMsg_t *m, Octstr *from);
|
||||||
|
|
|
@ -40,7 +40,7 @@
|
||||||
#define XIP_HEADER "X-WAP-Network-Client-IP"
|
#define XIP_HEADER "X-WAP-Network-Client-IP"
|
||||||
#define MM_NAME "Mbuni"
|
#define MM_NAME "Mbuni"
|
||||||
|
|
||||||
#define EAIF_VERSION "3.0"
|
#define EAIF_VERSION "%d.%d"
|
||||||
|
|
||||||
/* used by mmbox and queue code -- directory stuff. */
|
/* used by mmbox and queue code -- directory stuff. */
|
||||||
#define _TT "0123456789abcdefghijklmnopqrstuvwxyz"
|
#define _TT "0123456789abcdefghijklmnopqrstuvwxyz"
|
||||||
|
|
|
@ -240,7 +240,7 @@ static void mm7soap_receive(MmsHTTPClientInfo *h)
|
||||||
|
|
||||||
done:
|
done:
|
||||||
|
|
||||||
if (mresp && mm7_soapmsg_to_httpmsg(mresp, &rh, &reply_body) == 0)
|
if (mresp && mm7_soapmsg_to_httpmsg(mresp, &h->m->ver, &rh, &reply_body) == 0)
|
||||||
http_send_reply(h->client, hstatus, rh, reply_body);
|
http_send_reply(h->client, hstatus, rh, reply_body);
|
||||||
else
|
else
|
||||||
http_close_client(h->client);
|
http_close_client(h->client);
|
||||||
|
@ -292,7 +292,7 @@ static void mm7eaif_receive(MmsHTTPClientInfo *h)
|
||||||
Octstr *subject = NULL, *otransid = NULL, *msgid = NULL;
|
Octstr *subject = NULL, *otransid = NULL, *msgid = NULL;
|
||||||
Octstr *hfrom = NULL;
|
Octstr *hfrom = NULL;
|
||||||
time_t expiryt = -1, deliveryt = -1;
|
time_t expiryt = -1, deliveryt = -1;
|
||||||
Octstr *qf = NULL;
|
Octstr *qf = NULL, *xver;
|
||||||
int msize = h->body ? octstr_len(h->body) : 0;
|
int msize = h->body ? octstr_len(h->body) : 0;
|
||||||
int dlr;
|
int dlr;
|
||||||
int mtype;
|
int mtype;
|
||||||
|
@ -423,7 +423,10 @@ static void mm7eaif_receive(MmsHTTPClientInfo *h)
|
||||||
}
|
}
|
||||||
|
|
||||||
done:
|
done:
|
||||||
http_header_add(rh, "X-NOKIA-MMSC-Version", EAIF_VERSION);
|
|
||||||
|
xver = octstr_format(EAIF_VERSION, h->m->ver.major, h->m->ver.minor1);
|
||||||
|
http_header_add(rh, "X-NOKIA-MMSC-Version", octstr_get_cstr(xver));
|
||||||
|
octstr_destroy(xver);
|
||||||
|
|
||||||
http_send_reply(h->client, hstatus, rh, octstr_imm(""));
|
http_send_reply(h->client, hstatus, rh, octstr_imm(""));
|
||||||
|
|
||||||
|
@ -577,7 +580,7 @@ static Octstr *mm7soap_send(MmscGrp *mmc, Octstr *from, Octstr *to,
|
||||||
goto done1;
|
goto done1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (mm7_soapmsg_to_httpmsg(mreq, &rh, &body) < 0) {
|
if (mm7_soapmsg_to_httpmsg(mreq, &mmc->ver, &rh, &body) < 0) {
|
||||||
*error = octstr_format("Failed to convert SOAP message to HTTP Msg!");
|
*error = octstr_format("Failed to convert SOAP message to HTTP Msg!");
|
||||||
goto done1;
|
goto done1;
|
||||||
}
|
}
|
||||||
|
@ -667,7 +670,7 @@ static Octstr *mm7eaif_send(MmscGrp *mmc, Octstr *from, Octstr *to,
|
||||||
int mtype = mms_messagetype(m);
|
int mtype = mms_messagetype(m);
|
||||||
int hstatus = HTTP_OK;
|
int hstatus = HTTP_OK;
|
||||||
List *rh = http_create_empty_headers(), *ph = NULL;
|
List *rh = http_create_empty_headers(), *ph = NULL;
|
||||||
Octstr *body = NULL, *rbody = NULL, *url = NULL;
|
Octstr *body = NULL, *rbody = NULL, *url = NULL, *xver;
|
||||||
char *msgtype;
|
char *msgtype;
|
||||||
|
|
||||||
|
|
||||||
|
@ -679,7 +682,10 @@ static Octstr *mm7eaif_send(MmscGrp *mmc, Octstr *from, Octstr *to,
|
||||||
http_header_remove_all(rh, "X-Mms-Allow-Adaptations");
|
http_header_remove_all(rh, "X-Mms-Allow-Adaptations");
|
||||||
http_header_add(rh, "X-NOKIA-MMSC-To", octstr_get_cstr(to));
|
http_header_add(rh, "X-NOKIA-MMSC-To", octstr_get_cstr(to));
|
||||||
http_header_add(rh, "X-NOKIA-MMSC-From", octstr_get_cstr(from));
|
http_header_add(rh, "X-NOKIA-MMSC-From", octstr_get_cstr(from));
|
||||||
http_header_add(rh, "X-NOKIA-MMSC-Version", EAIF_VERSION);
|
|
||||||
|
xver = octstr_format(EAIF_VERSION, mmc->ver.major, mmc->ver.minor1);
|
||||||
|
http_header_add(rh, "X-NOKIA-MMSC-Version", octstr_get_cstr(xver));
|
||||||
|
octstr_destroy(xver);
|
||||||
|
|
||||||
if (mtype == MMS_MSGTYPE_SEND_REQ ||
|
if (mtype == MMS_MSGTYPE_SEND_REQ ||
|
||||||
mtype == MMS_MSGTYPE_RETRIEVE_CONF) {
|
mtype == MMS_MSGTYPE_RETRIEVE_CONF) {
|
||||||
|
|
|
@ -141,6 +141,7 @@ int mms_load_mmsbox_settings(mCfg *cfg, gwthread_func_t *mmsc_handler_func)
|
||||||
MmscGrp *m = gw_malloc(sizeof *m);
|
MmscGrp *m = gw_malloc(sizeof *m);
|
||||||
int ssl = 0;
|
int ssl = 0;
|
||||||
Octstr *type;
|
Octstr *type;
|
||||||
|
Octstr *xver;
|
||||||
|
|
||||||
memset(m, 0, sizeof *m);
|
memset(m, 0, sizeof *m);
|
||||||
|
|
||||||
|
@ -181,7 +182,23 @@ int mms_load_mmsbox_settings(mCfg *cfg, gwthread_func_t *mmsc_handler_func)
|
||||||
else
|
else
|
||||||
warning(0, "MMSBox: Unknown MMSC type [%s]!",
|
warning(0, "MMSBox: Unknown MMSC type [%s]!",
|
||||||
octstr_get_cstr(type));
|
octstr_get_cstr(type));
|
||||||
|
if ((xver = _mms_cfg_getx(x, octstr_imm("mm7-version"))) != NULL &&
|
||||||
|
octstr_len(xver) > 0)
|
||||||
|
sscanf(octstr_get_cstr(xver),
|
||||||
|
"%d.%d.%d",
|
||||||
|
&m->ver.major, &m->ver.minor1, &m->ver.minor2);
|
||||||
|
else { /* Put in some defaults. */
|
||||||
|
if (m->type == SOAP_MMSC) {
|
||||||
|
m->ver.major = 5;
|
||||||
|
m->ver.minor1 = 1;
|
||||||
|
m->ver.minor2 = 2;
|
||||||
|
} else if (m->type == EAIF_MMSC) {
|
||||||
|
m->ver.major = 3;
|
||||||
|
m->ver.minor1 = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
octstr_destroy(xver);
|
||||||
octstr_destroy(type);
|
octstr_destroy(type);
|
||||||
|
|
||||||
if (m->incoming.port > 0 &&
|
if (m->incoming.port > 0 &&
|
||||||
|
|
|
@ -29,6 +29,8 @@ typedef struct MmscGrp {
|
||||||
long throughput; /* Max send rate. */
|
long throughput; /* Max send rate. */
|
||||||
long threadid; /* handler thread. */
|
long threadid; /* handler thread. */
|
||||||
|
|
||||||
|
MM7Version_t ver; /* supported MM7/SOAP version. */
|
||||||
|
|
||||||
Mutex *mutex;
|
Mutex *mutex;
|
||||||
} MmscGrp;
|
} MmscGrp;
|
||||||
|
|
||||||
|
|
|
@ -314,6 +314,22 @@ MmscSettings *mms_load_mmsc_settings(mCfg *cfg, List **proxyrelays)
|
||||||
mv->type = NONE_VASP;
|
mv->type = NONE_VASP;
|
||||||
octstr_destroy(s);
|
octstr_destroy(s);
|
||||||
|
|
||||||
|
mv->ver.major = mv->ver.minor1 = mv->ver.minor2 = 0;
|
||||||
|
if ((s = _mms_cfg_getx(grp, octstr_imm("mm7-version"))) != NULL &&
|
||||||
|
octstr_len(s) > 0)
|
||||||
|
sscanf(octstr_get_cstr(s), "%d.%d.%d", &mv->ver.major, &mv->ver.minor1, &mv->ver.minor2);
|
||||||
|
else {
|
||||||
|
if (mv->type == SOAP_VASP) {
|
||||||
|
mv->ver.major = 5;
|
||||||
|
mv->ver.minor1 = 1;
|
||||||
|
mv->ver.minor2 = 2;
|
||||||
|
} else if (mv->type == EAIF_VASP) {
|
||||||
|
mv->ver.major = 3;
|
||||||
|
mv->ver.minor1 = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
octstr_destroy(s);
|
||||||
|
|
||||||
/* Set the handler vasp accounts. */
|
/* Set the handler vasp accounts. */
|
||||||
if (mms_cfg_get_bool(grp, octstr_imm("mms-to-email-handler"), &ibool) == 0 &&
|
if (mms_cfg_get_bool(grp, octstr_imm("mms-to-email-handler"), &ibool) == 0 &&
|
||||||
ibool) {
|
ibool) {
|
||||||
|
|
|
@ -31,6 +31,7 @@ typedef struct MmsVasp {
|
||||||
enum {SOAP_VASP, EAIF_VASP, NONE_VASP} type;
|
enum {SOAP_VASP, EAIF_VASP, NONE_VASP} type;
|
||||||
Octstr *vasp_username, *vasp_password;
|
Octstr *vasp_username, *vasp_password;
|
||||||
Octstr *vasp_url;
|
Octstr *vasp_url;
|
||||||
|
MM7Version_t ver;
|
||||||
} MmsVasp;
|
} MmsVasp;
|
||||||
|
|
||||||
typedef struct MmscSettings {
|
typedef struct MmscSettings {
|
||||||
|
|
|
@ -554,7 +554,7 @@ static int mm7soap_send(MmsVasp *vasp, Octstr *from, Octstr *to, Octstr *msgId,
|
||||||
goto done1;
|
goto done1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (mm7_soapmsg_to_httpmsg(mreq, &rh, &body) < 0) {
|
if (mm7_soapmsg_to_httpmsg(mreq, &vasp->ver, &rh, &body) < 0) {
|
||||||
*error = octstr_format("Failed to convert SOAP message 2 HTTP Msg!");
|
*error = octstr_format("Failed to convert SOAP message 2 HTTP Msg!");
|
||||||
goto done1;
|
goto done1;
|
||||||
}
|
}
|
||||||
|
@ -631,7 +631,7 @@ static int mm7eaif_send(MmsVasp *vasp, Octstr *from, Octstr *to, Octstr *msgid,
|
||||||
int mtype = mms_messagetype(m);
|
int mtype = mms_messagetype(m);
|
||||||
int hstatus = HTTP_OK;
|
int hstatus = HTTP_OK;
|
||||||
List *rh = http_create_empty_headers(), *ph = NULL;
|
List *rh = http_create_empty_headers(), *ph = NULL;
|
||||||
Octstr *body = NULL, *rbody = NULL, *url = NULL;
|
Octstr *body = NULL, *rbody = NULL, *url = NULL, *xver;
|
||||||
HTTPCaller *caller = http_caller_create();
|
HTTPCaller *caller = http_caller_create();
|
||||||
void *xx;
|
void *xx;
|
||||||
char *msgtype;
|
char *msgtype;
|
||||||
|
@ -645,7 +645,10 @@ static int mm7eaif_send(MmsVasp *vasp, Octstr *from, Octstr *to, Octstr *msgid,
|
||||||
http_header_add(rh, "X-NOKIA-MMSC-From", octstr_get_cstr(from));
|
http_header_add(rh, "X-NOKIA-MMSC-From", octstr_get_cstr(from));
|
||||||
if (msgid)
|
if (msgid)
|
||||||
http_header_add(rh, "X-NOKIA-MMSC-Message-Id", octstr_get_cstr(msgid));
|
http_header_add(rh, "X-NOKIA-MMSC-Message-Id", octstr_get_cstr(msgid));
|
||||||
http_header_add(rh, "X-NOKIA-MMSC-Version", EAIF_VERSION);
|
|
||||||
|
xver = octstr_format(EAIF_VERSION, vasp->ver.major, vasp->ver.minor1);
|
||||||
|
http_header_add(rh, "X-NOKIA-MMSC-Version", octstr_get_cstr(xver));
|
||||||
|
octstr_destroy(xver);
|
||||||
|
|
||||||
if (mtype == MMS_MSGTYPE_SEND_REQ ||
|
if (mtype == MMS_MSGTYPE_SEND_REQ ||
|
||||||
mtype == MMS_MSGTYPE_RETRIEVE_CONF) {
|
mtype == MMS_MSGTYPE_RETRIEVE_CONF) {
|
||||||
|
|
|
@ -1613,7 +1613,7 @@ static void mm7soap_dispatch(MmsHTTPClientInfo *h)
|
||||||
switch (mm7_msgtype(mreq)) {
|
switch (mm7_msgtype(mreq)) {
|
||||||
case MM7_TAG_SubmitReq:
|
case MM7_TAG_SubmitReq:
|
||||||
mm7_get_envelope(mreq, &from, &to, &subject, &vasid, &expiryt, &delivert);
|
mm7_get_envelope(mreq, &from, &to, &subject, &vasid, &expiryt, &delivert);
|
||||||
m = mm7_soap_to_mmsmsg(mreq, from ? from : sender);
|
m = mm7_soap_to_mmsmsg(mreq, from ? from : sender);
|
||||||
if (m) {
|
if (m) {
|
||||||
Octstr *value = NULL;
|
Octstr *value = NULL;
|
||||||
int dlr;
|
int dlr;
|
||||||
|
@ -1750,7 +1750,7 @@ static void mm7soap_dispatch(MmsHTTPClientInfo *h)
|
||||||
done:
|
done:
|
||||||
|
|
||||||
|
|
||||||
if (mresp && mm7_soapmsg_to_httpmsg(mresp, &rh, &reply_body) == 0)
|
if (mresp && mm7_soapmsg_to_httpmsg(mresp, &h->vasp->ver, &rh, &reply_body) == 0)
|
||||||
http_send_reply(h->client, hstatus, rh, reply_body);
|
http_send_reply(h->client, hstatus, rh, reply_body);
|
||||||
else
|
else
|
||||||
http_close_client(h->client);
|
http_close_client(h->client);
|
||||||
|
@ -1803,7 +1803,7 @@ static void mm7eaif_dispatch(MmsHTTPClientInfo *h)
|
||||||
List *mh = NULL;
|
List *mh = NULL;
|
||||||
int hstatus = HTTP_NO_CONTENT;
|
int hstatus = HTTP_NO_CONTENT;
|
||||||
List *rh = http_create_empty_headers();
|
List *rh = http_create_empty_headers();
|
||||||
Octstr *reply_body = NULL, *value;
|
Octstr *reply_body = NULL, *value, *xver;
|
||||||
|
|
||||||
List *to = gwlist_create(), *hto = NULL;
|
List *to = gwlist_create(), *hto = NULL;
|
||||||
Octstr *subject = NULL, *otransid = NULL, *msgid = NULL;
|
Octstr *subject = NULL, *otransid = NULL, *msgid = NULL;
|
||||||
|
@ -1906,7 +1906,10 @@ static void mm7eaif_dispatch(MmsHTTPClientInfo *h)
|
||||||
hstatus = HTTP_INTERNAL_SERVER_ERROR;
|
hstatus = HTTP_INTERNAL_SERVER_ERROR;
|
||||||
|
|
||||||
done:
|
done:
|
||||||
http_header_add(rh, "X-NOKIA-MMSC-Version", EAIF_VERSION);
|
xver = octstr_format(EAIF_VERSION, h->vasp->ver.major, h->vasp->ver.minor1);
|
||||||
|
http_header_add(rh, "X-NOKIA-MMSC-Version", octstr_get_cstr(xver));
|
||||||
|
octstr_destroy(xver);
|
||||||
|
|
||||||
if (msgid)
|
if (msgid)
|
||||||
http_header_add(rh, "X-NOKIA-MMSC-Message-Id", octstr_get_cstr(msgid));
|
http_header_add(rh, "X-NOKIA-MMSC-Message-Id", octstr_get_cstr(msgid));
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue