1
0
Fork 0

added mmsc type http

This commit is contained in:
bagyenda 2008-09-11 09:03:59 +00:00
parent 5afec26e5d
commit 671a62699d
16 changed files with 482 additions and 27 deletions

View File

@ -1,3 +1,5 @@
2008-09-11 P. A. Bagyenda <bagyenda@dsmagic.com>
* MMSBox HTTP MMSC type added, for inter-mmsbox message relay
2008-09-08 P. A. Bagyenda <bagyenda@dsmagic.com>
* MMSC admin interface added (start/stop/status of each VASP connection)
* MMSC VASP can now have multiple short codes

View File

@ -286,7 +286,7 @@ provisioned, etc.
<ul>
<li> Support for both SOAP and EAIF connectivity with an operator
MMSC
MMSC (plus a special HTTP-based relay mechanism)
<li> Multiple connections to different MMSC of different types can
be maintained
<li> MMS content can be loaded from file, URL or as the output of a
@ -2258,9 +2258,14 @@ Supported configuration parameters are:
<td valign=top >
Mandatory:
Protocol spoken by this MMSC, one of <tt>soap</tt> for 3GPP MM7
SOAP, <tt>eaif</tt> for Nokia EAIF protocol or <tt>custom</tt> for
SOAP, <tt>eaif</tt> for Nokia EAIF protocol, <tt>http</tt> for
special HTTP-based inter-mmsbox message relay (see below), or <tt>custom</tt> for
a custom implementation handled by a loadable module (see
<tt>mmsc-library</tt> below)
<tt>mmsc-library</tt> below).<br> For <tt>type = http</tt> the VAS GW
will forward the message to the URL provided using HTTP POST, with
CGI parameters: <tt>mms</tt> &ndash; the binary mms, <tt>from</tt>
&ndash; the sender address, <tt>to</tt> &ndash; the recipient
address. This allows fast inter-mmsbox message exchange.
</td>
</tr>

View File

@ -111,6 +111,9 @@ SINGLE_GROUP(mbuni,
OCTSTR(event-logger-module)
OCTSTR(event-logger-module-parameters)
OCTSTR(mm5-module)
OCTSTR(mm5-module-parameters)
)
MULTI_GROUP(mmsproxy,

View File

@ -361,8 +361,8 @@ MSoapMsg_t *mm7_parse_soap(List *headers, Octstr *body)
mime_entity_destroy(mime);
if (start)
mime_entity_destroy(start);
if (xml)
octstr_destroy(xml);
octstr_destroy(xml);
return smsg;
}

View File

@ -293,6 +293,10 @@ VNSTRING(MM7_5, "StatusText",MM7_TAG_StatusText)
VNSTRING(MM7_5, "Subject",MM7_TAG_Subject)
VNSTRING(MM7_5, "SubmitReq",MM7_TAG_SubmitReq)
VNSTRING(MM7_5, "SubmitRsp",MM7_TAG_SubmitRsp)
VNSTRING(MM7_5, "GetDeviceProfileReq",MM7_TAG_GetDeviceProfileReq)
VNSTRING(MM7_5, "GetDeviceProfileRsp",MM7_TAG_GetDeviceProfileRsp)
VNSTRING(MM7_5, "TimeStamp",MM7_TAG_TimeStamp)
VNSTRING(MM7_5, "To",MM7_TAG_To)
VNSTRING(MM7_5, "TransactionID",MM7_TAG_TransactionID)

View File

@ -556,6 +556,215 @@ static int mm7eaif_receive(MmsBoxHTTPClientInfo *h)
return http_status_class(hstatus) == HTTP_STATUS_SUCCESSFUL ? 0 : -1;
}
static int mm7http_receive(MmsBoxHTTPClientInfo *h)
{
MmsMsg *m = NULL;
List *mh = NULL;
int hstatus = HTTP_OK;
List *rh = http_create_empty_headers();
Octstr *reply_body = NULL, *value;
List *to = NULL;
Octstr *hto = NULL, *subject = NULL, *msgid = NULL;
Octstr *hfrom = NULL, *body;
time_t expiryt = -1, deliveryt = -1;
Octstr *qf = NULL, *mmc_id = NULL, *qdir = NULL, *s;
int msize;
int dlr;
int mtype;
List *cgivars_ctypes = NULL;
parse_cgivars(h->headers, h->body, &h->cgivars, &cgivars_ctypes);
hfrom = http_cgi_variable(h->cgivars, "from");
hto = http_cgi_variable(h->cgivars, "to");
body = http_cgi_variable(h->cgivars, "mms");
msize = octstr_len(body);
debug("mmsbox.mm7http.sendinterface", 0,
" --> Enterred http-mmsc send interface, blen=[%d] <--- ",
msize);
if (hto == NULL) {
http_header_add(rh, "Content-Type", "text/plain");
hstatus = HTTP_BAD_REQUEST;
reply_body = octstr_format("Missing 'to' argument");
goto done;
} else if (hfrom == NULL) {
http_header_add(rh, "Content-Type", "text/plain");
hstatus = HTTP_BAD_REQUEST;
reply_body = octstr_format("Missing 'from' argument");
goto done;
} else if (body == NULL || /* A message is required, and must parse */
(m = mms_frombinary(body, hfrom ? hfrom : octstr_imm("anon@anon"))) == NULL) {
http_header_add(rh, "Content-Type", "text/plain");
hstatus = HTTP_BAD_REQUEST;
reply_body = octstr_format("Unexpected MMS message, no content?");
goto done;
}
to = octstr_split_words(hto);
mtype = mms_messagetype(m);
mh = mms_message_headers(m);
/* find interesting headers. */
subject = http_header_value(mh, octstr_imm("Subject"));
/* Find expiry and delivery times */
if ((s = http_header_value(mh, octstr_imm("X-Mms-Expiry"))) != NULL) {
expiryt = date_parse_http(s);
octstr_destroy(s);
} else
expiryt = time(NULL) + DEFAULT_EXPIRE;
if ((s = http_header_value(mh, octstr_imm("X-Mms-Delivery-Time"))) != NULL) {
deliveryt = date_parse_http(s);
octstr_destroy(s);
} else
deliveryt = 0;
qdir = get_mmsbox_queue_dir(hfrom, to, h->m, &mmc_id); /* get routing info. */
switch(mtype) {
case MMS_MSGTYPE_SEND_REQ:
case MMS_MSGTYPE_RETRIEVE_CONF:
/* Get Message ID */
if ((msgid = http_cgi_variable(h->cgivars, "message-id")) != NULL)
mms_replace_header_value(m, "Message-ID", octstr_get_cstr(msgid));
if ((value = http_header_value(mh, octstr_imm("X-Mms-Delivery-Report"))) != NULL &&
octstr_case_compare(value, octstr_imm("Yes")) == 0)
dlr = 1;
else
dlr = 0;
octstr_destroy(value);
if (deliveryt < 0)
deliveryt = time(NULL);
if (expiryt < 0)
expiryt = time(NULL) + DEFAULT_EXPIRE;
mms_remove_headers(m, "Bcc");
mms_remove_headers(m, "X-Mms-Delivery-Time");
mms_remove_headers(m, "X-Mms-Expiry");
mms_remove_headers(m, "X-Mms-Sender-Visibility");
MOD_SUBJECT(m, h->m, hfrom);
/* Save it, put message id in header, return. */
qf = qfs->mms_queue_add(hfrom, to, subject,
h->m->id, mmc_id,
deliveryt, expiryt, m, NULL,
NULL, NULL,
NULL, NULL,
NULL,
dlr,
octstr_get_cstr(qdir),
"MM7/HTTP-IN",
octstr_imm(MM_NAME));
if (qf) {
/* Log to access log */
mms_log("Received", hfrom, to, msize, msgid, NULL, h->m->id, "MMSBox", h->ua, NULL);
hstatus = HTTP_OK;
} else
hstatus = HTTP_INTERNAL_SERVER_ERROR;
break;
case MMS_MSGTYPE_DELIVERY_IND:
if (mmc_id != NULL) { /* internal routing. */
qf = qfs->mms_queue_add(hfrom, to, NULL,
h->m->id, mmc_id,
0, time(NULL) + default_msgexpiry, m, NULL,
NULL, NULL,
NULL, NULL,
NULL,
0,
octstr_get_cstr(qdir),
"MM7/HTTP-IN",
octstr_imm(MM_NAME));
if (qf) {
/* Log to access log */
mms_log("Received DLR", hfrom, to, -1, NULL, NULL, h->m->id, "MMSBox", h->ua, NULL);
hstatus = HTTP_OK;
} else
hstatus = HTTP_INTERNAL_SERVER_ERROR;
} else {
Octstr *value = http_header_value(mh, octstr_imm("X-Mms-Status"));
Octstr *value2 = http_header_value(mh, octstr_imm("Message-ID"));
mmsbox_send_report(hfrom, "delivery-report", NULL, value, value2,
h->m->id, h->m->group_id, NULL, NULL, -1);
octstr_destroy(value);
octstr_destroy(value2);
}
break;
case MMS_MSGTYPE_READ_ORIG_IND:
if (mmc_id != NULL) { /* internal routing. */
qf = qfs->mms_queue_add(hfrom, to, NULL,
h->m->id, mmc_id,
0, time(NULL) + default_msgexpiry, m, NULL,
NULL, NULL,
NULL, NULL,
NULL,
0,
octstr_get_cstr(qdir),
"MM7/HTTP-IN",
octstr_imm(MM_NAME));
if (qf) {
/* Log to access log */
mms_log("Received RR", hfrom, to, -1, NULL, NULL, h->m->id, "MMSBox", h->ua, NULL);
hstatus = HTTP_NO_CONTENT;
} else
hstatus = HTTP_INTERNAL_SERVER_ERROR;
} else {
Octstr *value = http_header_value(mh, octstr_imm("X-Mms-Read-Status"));
Octstr *value2 = http_header_value(mh, octstr_imm("Message-ID"));
mmsbox_send_report(hfrom, "read-report", NULL, value, value2, h->m->id,
h->m->group_id, NULL, NULL, -1);
octstr_destroy(value);
octstr_destroy(value2);
}
break;
}
done:
http_header_add(rh, "X-Mbuni-Version", VERSION);
http_send_reply(h->client, hstatus, rh, qf ? qf : octstr_imm(""));
gwlist_destroy(to, (gwlist_item_destructor_t *)octstr_destroy);
octstr_destroy(subject);
octstr_destroy(qf);
octstr_destroy(mmc_id);
http_destroy_headers(mh);
http_destroy_headers(rh);
if (m)
mms_destroy(m);
http_destroy_cgiargs(cgivars_ctypes);
return http_status_class(hstatus) == HTTP_STATUS_SUCCESSFUL ? 0 : -1;
}
static void dispatch_mm7_recv(List *rl)
{
@ -582,9 +791,11 @@ static void dispatch_mm7_recv(List *rl)
m->id ? octstr_get_cstr(m->id) : "(none)");
} else if (h->m->type == SOAP_MMSC)
ret = mm7soap_receive(h);
else
else if (h->m->type == EAIF_MMSC)
ret = mm7eaif_receive(h);
else
ret = mm7http_receive(h);
h->m->last_pdu = time(NULL);
if (ret == 0)
@ -876,6 +1087,60 @@ static Octstr *mm7eaif_send(MmscGrp *mmc, Octstr *from, Octstr *to,
}
static Octstr *mm7http_send(MmscGrp *mmc, Octstr *from, Octstr *to,
MmsMsg *m, Octstr **error,
int *retry)
{
Octstr *ret = NULL;
int mtype = mms_messagetype(m);
int hstatus = HTTP_OK;
List *rh, *ph = NULL;
Octstr *body = NULL, *rbody = NULL;
Octstr *mms;
MIMEEntity *form_data = make_multipart_formdata();
mms_info(0, "MM7", mmc->id, "MMSBox: Send [http] to MMC[%s], msg type [%s], from %s, to %s",
mmc ? octstr_get_cstr(mmc->id) : "",
mms_message_type_to_cstr(mtype),
octstr_get_cstr(from), octstr_get_cstr(to));
mms = mms_tobinary(m);
add_multipart_form_field(form_data, "to", "text/plain", NULL, to);
add_multipart_form_field(form_data, "from", "text/plain", NULL, from);
add_multipart_form_field(form_data, "mms", "application/vnd.wap.mms-message", NULL, mms);
rh = mime_entity_headers(form_data);
body = mime_entity_body(form_data);
hstatus = mmsbox_url_fetch_content(HTTP_METHOD_POST, mmc->mmsc_url, rh, body, &ph, &rbody);
if (http_status_class(hstatus) != HTTP_STATUS_SUCCESSFUL) {
*error = octstr_format("Failed to contact MMC[url=%S] => HTTP returned status = %d !",
mmc->mmsc_url, hstatus);
} else {
ret = rbody ? octstr_duplicate(rbody) : NULL;
if (ret)
octstr_strip_blanks(ret);
}
*retry = (ret == NULL && (http_status_class(hstatus) == HTTP_STATUS_SERVER_ERROR || hstatus < 0));
if (ret)
mms_log2("Sent", from, to, -1, ret, NULL, mmc->id, "MMSBox", NULL, NULL);
http_destroy_headers(rh);
octstr_destroy(body);
http_destroy_headers(ph);
octstr_destroy(rbody);
octstr_destroy(mms);
mime_entity_destroy(form_data);
return ret;
}
static int mms_sendtommsc(MmscGrp *mmc, Octstr *from, Octstr *to, Octstr *transid,
Octstr *orig_transid,
Octstr *linkedid, char *vasid, Octstr *service_code,
@ -893,6 +1158,8 @@ static int mms_sendtommsc(MmscGrp *mmc, Octstr *from, Octstr *to, Octstr *transi
id = mm7soap_send(mmc, from, to, transid, linkedid, vasid, service_code, hdrs, m, err, &retry);
else if (mmc->type == EAIF_MMSC)
id = mm7eaif_send(mmc, from, to, transid, vasid, hdrs, m, err, &retry);
else if (mmc->type == HTTP_MMSC)
id = mm7http_send(mmc, from, to, m, err, &retry);
else if (mmc->type == CUSTOM_MMSC && mmc->custom_started)
id = mmc->fns->send_msg(mmc->data,
from, to, transid, linkedid, vasid,

View File

@ -918,7 +918,7 @@ static int make_and_queue_msg(Octstr *data, Octstr *ctype, List *reply_headers,
#if 0 /* don't route via sender, instead use allow/deny settings. */
if (!mmc && e)
mmc = e->fromproxy;
mmc = octstr_duplicate(e->fromproxy);
#endif
/* Get the from address. */
if (faked_sender)
@ -1156,6 +1156,7 @@ done:
octstr_destroy(rr_url);
octstr_destroy(mclass);
octstr_destroy(prio);
octstr_destroy(mmc);
octstr_destroy(allow_adaptations);
octstr_destroy(from);
octstr_destroy(xfrom);

View File

@ -476,7 +476,8 @@ static void mmsbox_start_mmsc_conn(MmscGrp *m, gwthread_func_t *mmsc_handler_fun
m->incoming.port = 0; /* so we don't listen on it. */
}
if (mmsc_handler_func && m->incoming.port > 0) { /* Only start threads if func passed and ... */
if (mmsc_handler_func &&
m->incoming.port > 0) { /* Only start threads if func passed and ... */
if ((m->threadid = gwthread_create(mmsc_handler_func, m)) < 0)
ERROR("MMSBox: Failed to start MMSC handler thread for MMSC[%s]: %s!",
octstr_get_cstr(m->id), strerror(errno));
@ -550,6 +551,8 @@ MmscGrp *start_mmsc_from_conf(mCfg *cfg, mCfgGrp *x, gwthread_func_t *mmsc_handl
m->type = EAIF_MMSC;
else if (octstr_case_compare(type, octstr_imm("soap")) == 0)
m->type = SOAP_MMSC;
else if (octstr_case_compare(type, octstr_imm("http")) == 0)
m->type = HTTP_MMSC;
else if (octstr_case_compare(type, octstr_imm("custom")) == 0) {
m->type = CUSTOM_MMSC;
m->settings = _mms_cfg_getx(cfg, x, octstr_imm("custom-settings"));

View File

@ -32,7 +32,7 @@ typedef struct MmscGrp {
} incoming; /* user, pass, port (and whether SSL) that MMSC uses to connect to us. */
Octstr *allowed_prefix, *denied_prefix;
Octstr *allowed_sender_prefix, *denied_sender_prefix;
enum {UNKNOWN_MMSC = -1, CUSTOM_MMSC, SOAP_MMSC, EAIF_MMSC} type; /* type of connection. */
enum {UNKNOWN_MMSC = -1, CUSTOM_MMSC, SOAP_MMSC, EAIF_MMSC, HTTP_MMSC} type; /* type of connection. */
double throughput; /* Max send rate. */
long threadid; /* handler thread. */

View File

@ -2,7 +2,7 @@ libmms = $(top_builddir)/mmlib/libmms.a
libmmsc = libmmsc.a
noinst_LIBRARIES = libmmsc.a
libmmsc_a_SOURCES = mmsc_cfg.c mms_detokenize.c mms_resolve.c mms_billing.c mms_detokenize_shell.c mms_resolve_shell.c mms_billing_shell.c
libmmsc_a_SOURCES = mmsc_cfg.c mms_detokenize.c mms_resolve.c mms_billing.c mms_detokenize_shell.c mms_resolve_shell.c mms_billing_shell.c mmsc_mm5.c
bin_PROGRAMS = mmsc mmsfromemail mmssend
mmsc_SOURCES = mmsc.c mmsglobalsender.c mmsmobilesender.c mmsrelay.c mmsproxy.c
@ -10,4 +10,4 @@ mmsc_LDADD = $(libmmsc) $(libmms)
mmsfromemail_LDADD = $(libmmsc) $(libmms)
mmssend_LDADD = $(libmmsc) $(libmms)
EXTRA_DIST = mms_billing.h mms_detokenize_shell.h mms_billing_shell.h mms_resolve_shell.h mmsc_cfg.h mms_detokenize.h mmsrelay.h mms_resolve.h
EXTRA_DIST = mms_billing.h mms_detokenize_shell.h mms_billing_shell.h mms_resolve_shell.h mmsc_cfg.h mms_detokenize.h mmsrelay.h mms_resolve.h mmsc_mm5.h

View File

@ -41,7 +41,7 @@ static Octstr *mms_resolve(Octstr * phonenum, void *module_data, void *settings_
fp = popen(octstr_get_cstr(s), "r");
octstr_destroy(s);
fgets(buf, 4096, fp);
fgets(buf, sizeof buf, fp);
s = octstr_create(buf);
octstr_strip_crlfs(s);

View File

@ -42,8 +42,10 @@ void mms_cleanup_mmsc_settings(MmscSettings *settings)
mms_info(0, "mmsc", NULL,"Admin port on %d, shutdown", (int)settings->admin_port);
}
mms_cfg_destroy(settings->cfg);
settings->qfs->mms_cleanup_queue_module();
if (settings->mm5)
settings->mm5->cleanup();
delete_stale_vasps(settings, 1);
mms_event_logger_cleanup();
}
@ -91,6 +93,14 @@ MmscSettings *mms_load_mmsc_settings(Octstr *fname, List **proxyrelays)
octstr_destroy(s);
}
if ((m->mm5 = _mms_load_module(cfg, grp, "mm5-module", "mm5_funcs", shell_mm5)) != NULL) {
Octstr *s = mms_cfg_get(cfg, grp, octstr_imm("mm5-module"));
if (m->mm5->init(octstr_get_cstr(s)) != 0)
panic(0, "Mmsc: Failed to initialise MM5 module!");
octstr_destroy(s);
}
m->hostname = mms_cfg_get(cfg, grp, octstr_imm("hostname"));
if (octstr_len(m->hostname) == 0)

View File

@ -17,6 +17,7 @@
#include "mms_billing_shell.h"
#include "mms_detokenize_shell.h"
#include "mms_queue.h"
#include "mmsc_mm5.h"
typedef struct MmsProxyRelay {
Octstr *host;
@ -121,7 +122,8 @@ typedef struct MmscSettings {
MmsVasp *mms2email, *mms2mobile;
MmscMM5FuncStruct *mm5; /* If we have loaded an mm5 module, this is it. */
/* Stuff for the admin interface. */
long admin_port;
Octstr *admin_allow_ip, *admin_deny_ip;

108
mbuni/mmsc/mmsc_mm5.c Normal file
View File

@ -0,0 +1,108 @@
/*
* Mbuni - Open Source MMS Gateway
*
* MM5 interface, query/save mapping from msisdn to uaprof string/url
*
* Copyright (C) 2003 - 2008, Digital Solutions Ltd. - http://www.dsmagic.com
*
* Paul Bagyenda <bagyenda@dsmagic.com>
*
* This program is free software, distributed under the terms of
* the GNU General Public License, with a few exceptions granted (see LICENSE)
*/
#include <stdio.h>
#include <stdlib.h>
#include "mmsc_mm5.h"
#include "mms_util.h"
static char cmd[1024] = "true";
static int mm5_shell_init(char *shell_cmd)
{
strncpy(cmd, shell_cmd, sizeof cmd);
return 0;
}
static void mm5_shell_update(char *phonenum, char *uaprof_url, char *ua_string)
{
Octstr *x;
Octstr *y;
Octstr *z;
Octstr *s;
if (phonenum == NULL)
return;
x = uaprof_url ? octstr_create(uaprof_url) : octstr_imm("");
y = ua_string ? octstr_create(ua_string) : octstr_imm("");
z = octstr_create(phonenum);
escape_shell_chars(x);
escape_shell_chars(y);
escape_shell_chars(z);
s = octstr_format("%s '%S' '%S' '%S'", cmd, z, x, y);
system(octstr_get_cstr(s));
octstr_destroy(s);
octstr_destroy(x);
octstr_destroy(y);
octstr_destroy(z);
}
static int mm5_shell_query(char *phonenum, char uaprof_url[], char *ua_string,
int buflen)
{
FILE *fp;
char buf[4096], *p;
int ret;
Octstr *z;
Octstr *s;
if (phonenum == NULL)
return -1;
z = octstr_create(phonenum);
escape_shell_chars(z);
s = octstr_format("%s '%S'", cmd, z);
if ((fp = popen(octstr_get_cstr(s), "r")) != NULL) {
if (uaprof_url) {
uaprof_url[0] = 0;
p = fgets(buf, sizeof buf, fp);
if (p)
strncpy(uaprof_url, p, buflen);
}
if (ua_string) {
ua_string[0] = 0;
p = fgets(buf, sizeof buf, fp);
if (p)
strncpy(ua_string, p, buflen);
}
pclose(fp);
ret = 0;
} else
ret = -1;
octstr_destroy(s);
octstr_destroy(z);
return ret;
}
static void shell_cleanup(void)
{
}
MmscMM5FuncStruct _x = {
mm5_shell_init,
mm5_shell_update,
mm5_shell_query,
shell_cleanup
}, *shell_mm5 = &_x;

45
mbuni/mmsc/mmsc_mm5.h Normal file
View File

@ -0,0 +1,45 @@
/*
* Mbuni - Open Source MMS Gateway
*
* MM5 interface, query/save mapping from msisdn to uaprof string/url
*
* Copyright (C) 2003 - 2008, Digital Solutions Ltd. - http://www.dsmagic.com
*
* Paul Bagyenda <bagyenda@dsmagic.com>
*
* This program is free software, distributed under the terms of
* the GNU General Public License, with a few exceptions granted (see LICENSE)
*/
#ifndef __MMS_MM5_INCLUDED__
#define __MMS_MM5_INCLUDED__
#include <time.h>
#include "gwlib/gwlib.h"
/* mm5 module. This file provides prototypes for all mm5 interface functions.
*
*/
typedef struct MmscMM5FuncStruct {
/* This function is called once to initialise the mm5 interface module. Return a generic object,
* which is passed with each request.
*/
int (*init)(char *settings);
/* Save the UaProf URL and UserAgent string for given phone number. */
void (*update)(char *phonenum,
char *uaprof_url, char *ua_string);
/* Query for the uaprof and ua string. Return them in the buffers provided.
* return 0 on success, -1 on error.
*/
int (*query)(char *phonenum, char uaprof_url[], char *ua_string,
int buflen);
void (*cleanup)(void);
} MmscMM5FuncStruct;
/* Any module must export a symbol of the above type, with name 'mm5_funcs' */
extern MmscMM5FuncStruct *shell_mm5; /* Handler when using shell script. */
#endif

View File

@ -109,19 +109,11 @@ static void mm1proxy(void)
else
h.client_addr = octstr_duplicate(h.base_client_addr);
} else { /* A bare number, normalise it. */
#if 0
normalize_number(octstr_get_cstr(settings->unified_prefix), &h.base_client_addr);
#else
mms_normalize_phonenum(&h.base_client_addr,
octstr_get_cstr(settings->unified_prefix),
settings->strip_prefixes);
#endif
if (octstr_case_search(h.base_client_addr, octstr_imm("TYPE="),0) < 0)
h.client_addr = octstr_format("%S/TYPE=PLMN", h.base_client_addr);
else
h.client_addr = octstr_duplicate(h.base_client_addr);
_mms_fixup_address(&h.base_client_addr,
octstr_get_cstr(settings->unified_prefix),
settings->strip_prefixes, 0);
h.client_addr = octstr_format("%S/TYPE=PLMN", h.base_client_addr);
}
debug("mmsproxy", 0,
" Request, ip=%s, base_client_addr=%s, client_addr=%s, url=%s ",
@ -218,6 +210,13 @@ void fetchmms_proxy(MmsHTTPClientInfo *h)
debug("proxy.fetchinterface", 0, " ---> Entered fetch interface: url=%s <---",
h->url ? octstr_get_cstr(h->url) : "none");
/* handle mm5 */
if (settings->mm5)
settings->mm5->update(octstr_get_cstr(h->base_client_addr),
h->profile_url ? octstr_get_cstr(h->profile_url) : NULL,
h->ua ? octstr_get_cstr(h->ua) : NULL);
rh = http_create_empty_headers();
http_header_add(rh, "Pragma", "no-cache");
http_header_add(rh, "Cache-Control", "no-cache");
@ -464,6 +463,12 @@ static void sendmms_proxy(MmsHTTPClientInfo *h)
" --> Enterred sendmms interface, blen=%d <--- ",
msize);
/* handle mm5 */
if (settings->mm5)
settings->mm5->update(octstr_get_cstr(h->base_client_addr),
h->profile_url ? octstr_get_cstr(h->profile_url) : NULL,
h->ua ? octstr_get_cstr(h->ua) : NULL);
http_header_add(rh, "Pragma", "no-cache");
http_header_add(rh, "Cache-Control", "no-cache");