From 2a25a4cd3e994507f3f848edf8e4e97da4d483da Mon Sep 17 00:00:00 2001
From: bagyenda <>
Date: Fri, 24 Mar 2006 16:26:05 +0000
Subject: [PATCH] - Changes to mm7/soap module to please java packages (Resin
-- SOAP-ENV header prefered) - Removal of outdated config params
---
mbuni/doc/examples/mmsc.conf | 2 --
mbuni/doc/userguide.shtml | 24 ------------------------
mbuni/mmlib/mms_cfg.def | 2 --
mbuni/mmlib/mms_mm7soap.c | 26 ++++++++++++++------------
mbuni/mmsc/mmsc_cfg.c | 9 ---------
mbuni/mmsc/mmsc_cfg.h | 1 -
6 files changed, 14 insertions(+), 50 deletions(-)
diff --git a/mbuni/doc/examples/mmsc.conf b/mbuni/doc/examples/mmsc.conf
index ab5d148..38fc575 100644
--- a/mbuni/doc/examples/mmsc.conf
+++ b/mbuni/doc/examples/mmsc.conf
@@ -7,7 +7,6 @@ group = mbuni
name = "My MMSC"
hostname = ds.co.ug
host-alias = mmsc
-local-mmsc-domains = dsmagic.com
local-prefixes = 037;+25637;25637
storage-directory = /tmp/spool
max-send-threads = 5
@@ -31,7 +30,6 @@ billing-module-parameters = "/tmp/log/cdr.log"
content-adaptation = true
notify-unprovisioned = yes
mms-notify-text = "You have received a multimedia message from %S, go to XXX to view it"
-mm-box-host = local.ds.co.ug
mms-notify-unprovisioned-text = "This is a test"
mms-to-email-txt = "This is a multimedia message (HTML suppressed)"
mms-to-email-html = "This is a multimedia message powered by Digital Solutions"
diff --git a/mbuni/doc/userguide.shtml b/mbuni/doc/userguide.shtml
index 666f3a0..8af76ca 100644
--- a/mbuni/doc/userguide.shtml
+++ b/mbuni/doc/userguide.shtml
@@ -632,9 +632,6 @@ hostname
host-alias
= mmsc
-local-mmsc-domains=
-mbuni.org,service.com
-
local-prefixes
= 075;+25675;25675
@@ -757,27 +754,6 @@ lists all the configuration directives. The column Mode
notifications. If you do not supply a host alias, the gateway will create a long form URL (http://hostname:port/msgtoken) when it sends notifications
-
-
- local-mmsc-domains
-
- |
-
-
- MMSC
-
- |
-
-
- List of
- Internet domains (comma separated)
- |
-
- A list of
- internet domains that should be considered local to this MMS gateway. Email
- or MMS messages received destined to these domains should be treated as local
- |
-
local-prefixes
|
diff --git a/mbuni/mmlib/mms_cfg.def b/mbuni/mmlib/mms_cfg.def
index 03324e9..3bec284 100644
--- a/mbuni/mmlib/mms_cfg.def
+++ b/mbuni/mmlib/mms_cfg.def
@@ -43,7 +43,6 @@ SINGLE_GROUP(mbuni,
OCTSTR(name)
OCTSTR(hostname)
OCTSTR(host-alias)
- OCTSTR(local-mmsc-domains)
OCTSTR(local-prefixes)
OCTSTR(storage-directory)
OCTSTR(max-send-threads)
@@ -73,7 +72,6 @@ SINGLE_GROUP(mbuni,
OCTSTR(notify-unprovisioned)
OCTSTR(mms-notify-text)
OCTSTR(mms-notify-unprovisioned-text)
- OCTSTR(mm-box-host)
OCTSTR(mms-to-email-txt)
OCTSTR(mms-to-email-html)
OCTSTR(mms-message-too-large-txt)
diff --git a/mbuni/mmlib/mms_mm7soap.c b/mbuni/mmlib/mms_mm7soap.c
index 00c88cf..0c3e5bc 100644
--- a/mbuni/mmlib/mms_mm7soap.c
+++ b/mbuni/mmlib/mms_mm7soap.c
@@ -354,6 +354,8 @@ static void output_rcpt(char *hdr, List *hdrs, Octstr *p)
}
#define XMLNSMM7 "http://www.3gpp.org/ftp/Specs/archive/23_series/23.140/schema/REL-5-MM7-1-2"
+#define SOAP_ENV "SOAP-ENV"
+
/* Construct by hand. */
Octstr *headers_to_soapxml(List *hdrs)
{
@@ -364,16 +366,16 @@ Octstr *headers_to_soapxml(List *hdrs)
int mtag;
octstr_append_cstr(s,
- "\n"
- "\n");
+ "<" SOAP_ENV ":Envelope xmlns:" SOAP_ENV "=\"http://schemas.xmlsoap.org/soap/envelope/\">\n"
+ "<" SOAP_ENV ":Header>\n");
p = http_header_value(hdrs, octstr_imm("TransactionID"));
- octstr_format_append(s, "%S\n",
+ octstr_format_append(s, "%S\n",
XMLNSMM7, p ? p : octstr_imm("none"));
if (p)
octstr_destroy(p);
- octstr_append_cstr(s, "\n\n");
+ octstr_append_cstr(s, "" SOAP_ENV ":Header>\n<" SOAP_ENV ":Body>\n");
fault = http_header_value(hdrs, octstr_imm("Fault"));
@@ -381,7 +383,7 @@ Octstr *headers_to_soapxml(List *hdrs)
Octstr *fc = http_header_value(hdrs, octstr_imm("faultcode"));
Octstr *fs = http_header_value(hdrs, octstr_imm("faultstring"));
- octstr_append_cstr(s, "\n");
+ octstr_append_cstr(s, "<" SOAP_ENV ":Fault>\n");
if (fc) {
octstr_format_append(s, "%S\n", fc);
octstr_destroy(fc);
@@ -397,7 +399,7 @@ Octstr *headers_to_soapxml(List *hdrs)
mtype = http_header_value(hdrs, octstr_imm("MessageType"));
mtag = mms_string_to_mm7tag(mtype);
- octstr_format_append(s, "<%S xmlns=\"%s\">\n", mtype, XMLNSMM7);
+ octstr_format_append(s, "\n", mtype, XMLNSMM7);
/* Output the details. */
p = http_header_value(hdrs, octstr_imm("MM7Version"));
@@ -547,18 +549,18 @@ Octstr *headers_to_soapxml(List *hdrs)
if (h) octstr_destroy(h);
if (v) octstr_destroy(v);
}
- octstr_format_append(s, "%S>\n", mtype);
+ octstr_format_append(s, "\n", mtype);
octstr_destroy(mtype);
if (fault) {
octstr_append_cstr(s, "\n");
- octstr_append_cstr(s, "\n");
+ octstr_append_cstr(s, "" SOAP_ENV ":Fault>\n");
octstr_destroy(fault);
}
- octstr_append_cstr(s, "\n");
- octstr_append_cstr(s, "\n");
+ octstr_append_cstr(s, "" SOAP_ENV ":Body>\n");
+ octstr_append_cstr(s, "" SOAP_ENV ":Envelope>\n");
return s;
}
@@ -619,7 +621,7 @@ int mm7_soapmsg_to_httpmsg(MSoapMsg_t *m, List **hdrs, Octstr **body)
}
http_header_add(mime->headers, "Content-Type", octstr_get_cstr(ctype));
- http_header_add(mime->headers, "SOAPAction", "\"\"");
+ http_header_add(mime->headers, "SOAPAction", "\"some-url\"");
mime_entity_body_and_headers(mime, body, hdrs);
@@ -1029,7 +1031,7 @@ MSoapMsg_t *mm7_make_resp(MSoapMsg_t *mreq, int status, Octstr *msgid)
if (!MM7_SOAP_STATUS_OK(status)) {
http_header_add(mresp->envelope, "Fault", ""); /* do we really need these? XXX */
- http_header_add(mresp->envelope, "faultcode", "env:Server");
+ http_header_add(mresp->envelope, "faultcode", "" SOAP_ENV ":Server");
http_header_add(mresp->envelope, "faultstring", "Server error");
}
diff --git a/mbuni/mmsc/mmsc_cfg.c b/mbuni/mmsc/mmsc_cfg.c
index ccb7e25..ece10fc 100644
--- a/mbuni/mmsc/mmsc_cfg.c
+++ b/mbuni/mmsc/mmsc_cfg.c
@@ -83,15 +83,6 @@ MmscSettings *mms_load_mmsc_settings(mCfg *cfg, List **proxyrelays)
if (proxyrelays)
*proxyrelays = mms_proxy_relays(cfg);
- s = _mms_cfg_getx(grp, octstr_imm("local-mmsc-domains"));
-
- if (s) {
- l = octstr_split(s, octstr_imm(","));
- octstr_destroy(s);
- } else
- l = list_create();
- m->local_domains = l;
-
if (mms_cfg_get_int(grp, octstr_imm("max-send-threads"), &m->maxthreads) == -1)
m->maxthreads = 10;
diff --git a/mbuni/mmsc/mmsc_cfg.h b/mbuni/mmsc/mmsc_cfg.h
index 96aa6ba..f9a1da0 100644
--- a/mbuni/mmsc/mmsc_cfg.h
+++ b/mbuni/mmsc/mmsc_cfg.h
@@ -36,7 +36,6 @@ typedef struct MmsVasp {
typedef struct MmscSettings {
Octstr *system_user;
Octstr *name, *hostname, *host_alias;
- List *local_domains;
Octstr *unified_prefix, *local_prefix;
Octstr *sendmail;
Octstr *global_queuedir, *mm1_queuedir, *mm4_queuedir;