1
0
Fork 0

Added content-adpatation config param to turn on/off content adaptation

This commit is contained in:
bagyenda 2005-07-15 05:44:23 +00:00
parent 472b5fb4b1
commit be06cd60ce
6 changed files with 33 additions and 10 deletions

View File

@ -28,6 +28,7 @@ billing-module-parameters = "/tmp/log/cdr.log"
# billing-library = billdemo.so
#prov-server-notify-script = ~/src/mmprov/provnotify.sh
#prov-server-sub-status-script = ~/src/mmprov/rcptstatus.sh
content-adaptation = yes
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

View File

@ -961,6 +961,19 @@ lists all the configuration directives</p>
fields. Default: false
&nbsp; &nbsp;</td>
</tr>
<tr>
<td valign=top >
<tt>content-adaptation</tt>
&nbsp; &nbsp;</td>
<td valign=top >
Boolean
&nbsp; &nbsp;</td>
<td valign=top >
Set this to false to turn off content adaptation in Mbuni. This will
cause the MMSC to ignore client capabilities when sending messages,
and could cause problems so beware! Default: true
&nbsp; &nbsp;</td>
</tr>
<tr>
<td valign=top >

View File

@ -717,8 +717,8 @@ diff -Naur gateway-1.4.0/gw/xml_shared.h gateway-1.4.0-patched/gw/xml_shared.h
/*
diff -Naur gateway-1.4.0/gwlib/cfg.def gateway-1.4.0-patched/gwlib/cfg.def
--- gateway-1.4.0/gwlib/cfg.def 2004-06-28 18:18:35.000000000 +0300
+++ gateway-1.4.0-patched/gwlib/cfg.def 2005-07-04 10:58:15.000000000 +0300
@@ -544,6 +544,68 @@
+++ gateway-1.4.0-patched/gwlib/cfg.def 2005-07-15 08:08:36.000000000 +0300
@@ -544,6 +544,69 @@
OCTSTR(unified-prefix)
)
@ -764,6 +764,7 @@ diff -Naur gateway-1.4.0/gwlib/cfg.def gateway-1.4.0-patched/gwlib/cfg.def
+ OCTSTR(mms-client-ip-header)
+ OCTSTR(allow-ip-type)
+ OCTSTR(optimize-notification-size)
+ OCTSTR(content-adaptation)
+)
+
+MULTI_GROUP(mmsproxy,

View File

@ -311,11 +311,15 @@ MmsBoxSettings *mms_load_mmsbox_settings(Cfg *cfg, List **proxyrelays)
if (cfg_get_bool(&m->allow_ip_type, grp, octstr_imm("allow-ip-type")) < 0)
m->allow_ip_type = 1;
cfg_get_bool(&m->optimize_notification_size, grp, octstr_imm("optimize-notification-size"));
if (cfg_get_bool(&m->content_adaptation, grp, octstr_imm("content-adaptation")) < 0)
m->content_adaptation = 1;
if (qdir)
octstr_destroy(qdir);
/* Now load the VASP list. */
l = cfg_get_multi_group(cfg, octstr_imm("mms-vasp"));
m->vasp_list = list_create();

View File

@ -100,6 +100,7 @@ typedef struct MmsBoxSettings {
int allow_ip_type;
int optimize_notification_size;
int content_adaptation;
Octstr *prov_notify;

View File

@ -280,20 +280,22 @@ void fetchmms_proxy(MmsHTTPClientInfo *h)
}
menc = MS_1_2;
}
/* Adapt content. */
/* Adapt content, if turned on. */
transid = mms_maketransid(octstr_get_cstr(qf), settings->host_alias);
if (h->prof) {
if (settings->content_adaptation) {
MmsMsg *outmsg = NULL;
int x = mms_transform_msg(m, h->prof, &outmsg);
if (x == -1) { /* Temporary failure, we need to fetch profile. */
mr = mms_retrieveconf(NULL, transid, "Error-transient-failure", "Mobile MMS Settings not found",
mr = mms_retrieveconf(NULL, transid, "Error-transient-failure",
"Mobile MMS Settings not found",
settings->system_user,MS_1_1);
s = mms_tobinary(mr);
goto failed;
} else if (x < 0) { /* Doesn't support MMS */
mr = mms_retrieveconf(NULL, transid,
"Error-permanent-content-unsupported", "No MMS Support",
"Error-permanent-content-unsupported",
"No MMS Support",
settings->system_user,MS_1_1);
s = mms_tobinary(mr);
notify_cmd = "fetchfailed";
@ -301,7 +303,8 @@ void fetchmms_proxy(MmsHTTPClientInfo *h)
goto failed;
} else if (x == 0) {
if (outmsg == NULL) { /* Too large so truncated. */
Octstr *xx = octstr_format(octstr_get_cstr(settings->mms_toolarge), (e) ? e->from : h->client_addr);
Octstr *xx = octstr_format(octstr_get_cstr(settings->mms_toolarge),
(e) ? e->from : h->client_addr);
mr = mms_retrieveconf(NULL, transid,
#if 0
@ -321,7 +324,7 @@ void fetchmms_proxy(MmsHTTPClientInfo *h)
mms_destroy(m);
m = outmsg;
}
}
}
}
mr = mms_retrieveconf(m, transid, "Error-permanent-message-not-found", NULL,