Added group-id to VAS GW config
This commit is contained in:
parent
a8c3ddccf7
commit
d6292f03d9
|
@ -1,3 +1,5 @@
|
||||||
|
2007-04-02 Vincent Chavanis <vincent@telemaque.fr>
|
||||||
|
* 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>
|
||||||
* Major corrections to MM4 functionality, bringing conformance to 3GPP TS 23.140 (Thanks to Deon van der Merwe <deonvandermerwe@gmail.com> for funding)
|
* Major corrections to MM4 functionality, bringing conformance to 3GPP TS 23.140 (Thanks to Deon van der Merwe <deonvandermerwe@gmail.com> for funding)
|
||||||
2007-03-09 P. A. Bagyenda <bagyenda@dsmagic.com>
|
2007-03-09 P. A. Bagyenda <bagyenda@dsmagic.com>
|
||||||
|
|
|
@ -1924,6 +1924,7 @@ sent via SMTP to the proxy.
|
||||||
<tt>
|
<tt>
|
||||||
group = mmsc<br>
|
group = mmsc<br>
|
||||||
id = testone<br>
|
id = testone<br>
|
||||||
|
group-id = mmc1<br>
|
||||||
mmsc-url = http://mbuni:test@192.168.129.52:8080/eaif<br>
|
mmsc-url = http://mbuni:test@192.168.129.52:8080/eaif<br>
|
||||||
incoming-username = user<br>
|
incoming-username = user<br>
|
||||||
incoming-password = pass<br>
|
incoming-password = pass<br>
|
||||||
|
@ -1974,6 +1975,21 @@ Supported configuration parameters are:
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
|
<tr>
|
||||||
|
<td valign=top >
|
||||||
|
<tt>group-id</tt>
|
||||||
|
|
||||||
|
</td>
|
||||||
|
<td valign=top >
|
||||||
|
String
|
||||||
|
</td>
|
||||||
|
<td valign=top >
|
||||||
|
Optional:
|
||||||
|
Can be used to group different MMCs for purposes of receiving DLRs,
|
||||||
|
etc.
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
|
||||||
<tr>
|
<tr>
|
||||||
<td valign=top >
|
<td valign=top >
|
||||||
<tt>type</tt>
|
<tt>type</tt>
|
||||||
|
|
|
@ -115,6 +115,7 @@ MULTI_GROUP(send-mms-user,
|
||||||
|
|
||||||
MULTI_GROUP(mmsc,
|
MULTI_GROUP(mmsc,
|
||||||
OCTSTR(id)
|
OCTSTR(id)
|
||||||
|
OCTSTR(group-id)
|
||||||
OCTSTR(mmsc-url)
|
OCTSTR(mmsc-url)
|
||||||
OCTSTR(incoming-username)
|
OCTSTR(incoming-username)
|
||||||
OCTSTR(incoming-password)
|
OCTSTR(incoming-password)
|
||||||
|
|
|
@ -278,7 +278,7 @@ static int mms_unpack_well_known_field(List *unpacked, int field_type,
|
||||||
ret = wsp_field_value(context, &val);
|
ret = wsp_field_value(context, &val);
|
||||||
|
|
||||||
if (parse_error(context)) {
|
if (parse_error(context)) {
|
||||||
warning(0, "Faulty header [code=%d], skipping remaining headers.", field_type);
|
warning(0, "Faulty header [code = %d], skipping remaining headers.", field_type);
|
||||||
parse_skip_to_limit(context);
|
parse_skip_to_limit(context);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
|
@ -78,15 +78,17 @@ done:
|
||||||
}
|
}
|
||||||
|
|
||||||
static int send_report(Octstr *from, char *report_type, Octstr *status,
|
static int send_report(Octstr *from, char *report_type, Octstr *status,
|
||||||
Octstr *msgid, Octstr *mmc_id)
|
Octstr *msgid, Octstr *mmc_id, Octstr *mmc_gid)
|
||||||
{
|
{
|
||||||
|
|
||||||
Octstr *url = mms_dlr_url_get(msgid, report_type, mmc_id);
|
Octstr *url = mms_dlr_url_get(msgid, report_type, mmc_gid);
|
||||||
List *rh, *rph = NULL;
|
List *rh, *rph = NULL;
|
||||||
Octstr *furl = NULL, *rb = NULL;
|
Octstr *furl = NULL, *rb = NULL;
|
||||||
|
|
||||||
if (!url)
|
if (!url) {
|
||||||
|
info(0, "Sending delivery-report Failed: 'url' is NULL");
|
||||||
return 0;
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
rh = http_create_empty_headers();
|
rh = http_create_empty_headers();
|
||||||
|
|
||||||
|
@ -113,7 +115,7 @@ static int send_report(Octstr *from, char *report_type, Octstr *status,
|
||||||
*/
|
*/
|
||||||
if (strcmp(report_type, "read-report") == 0 ||
|
if (strcmp(report_type, "read-report") == 0 ||
|
||||||
octstr_case_compare(status, octstr_imm("Deferred")) != 0)
|
octstr_case_compare(status, octstr_imm("Deferred")) != 0)
|
||||||
mms_dlr_url_remove(msgid, report_type, mmc_id);
|
mms_dlr_url_remove(msgid, report_type, mmc_gid);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -140,7 +142,7 @@ static void mm7soap_receive(MmsHTTPClientInfo *h)
|
||||||
if (mreq)
|
if (mreq)
|
||||||
msgtype = mms_mm7tag_to_cstr(mm7_msgtype(mreq));
|
msgtype = mms_mm7tag_to_cstr(mm7_msgtype(mreq));
|
||||||
debug("mmsbox.mm7sendinterface", 0,
|
debug("mmsbox.mm7sendinterface", 0,
|
||||||
" --> Enterred mm7dispatch interface, mreq=%s mtype = %s <-- ",
|
" --> Enterred mm7dispatch interface, mreq=[%s] mtype=[%s] <-- ",
|
||||||
mreq ? "Ok" : "Null",
|
mreq ? "Ok" : "Null",
|
||||||
mreq ? (char *)msgtype : "Null");
|
mreq ? (char *)msgtype : "Null");
|
||||||
|
|
||||||
|
@ -204,7 +206,8 @@ static void mm7soap_receive(MmsHTTPClientInfo *h)
|
||||||
info(0, "Sending delivery-report [FROM:%s] [VALUE:%s] [DESC:%s] [MSGID:%s]",
|
info(0, "Sending delivery-report [FROM:%s] [VALUE:%s] [DESC:%s] [MSGID:%s]",
|
||||||
octstr_get_cstr(from), octstr_get_cstr(value), octstr_get_cstr(desc),
|
octstr_get_cstr(from), octstr_get_cstr(value), octstr_get_cstr(desc),
|
||||||
octstr_get_cstr(h->m->id));
|
octstr_get_cstr(h->m->id));
|
||||||
send_report(from, "delivery-report", value, msgid, h->m->id);
|
send_report(from, "delivery-report",
|
||||||
|
value, msgid, h->m->id, h->m->group_id);
|
||||||
|
|
||||||
if (desc)
|
if (desc)
|
||||||
octstr_destroy(desc);
|
octstr_destroy(desc);
|
||||||
|
@ -219,7 +222,9 @@ static void mm7soap_receive(MmsHTTPClientInfo *h)
|
||||||
msgid = mm7_soap_header_value(mreq, octstr_imm("MessageID"));
|
msgid = mm7_soap_header_value(mreq, octstr_imm("MessageID"));
|
||||||
value = mm7_soap_header_value(mreq, octstr_imm("MMStatus"));
|
value = mm7_soap_header_value(mreq, octstr_imm("MMStatus"));
|
||||||
|
|
||||||
send_report(from, "read-report", value, msgid, h->m->id);
|
send_report(from,
|
||||||
|
"read-report", value, msgid,
|
||||||
|
h->m->id, h->m->group_id);
|
||||||
|
|
||||||
if (value)
|
if (value)
|
||||||
octstr_destroy(value);
|
octstr_destroy(value);
|
||||||
|
@ -397,7 +402,7 @@ static void mm7eaif_receive(MmsHTTPClientInfo *h)
|
||||||
case MMS_MSGTYPE_DELIVERY_IND:
|
case MMS_MSGTYPE_DELIVERY_IND:
|
||||||
value = http_header_value(mh, octstr_imm("X-Mms-Status"));
|
value = http_header_value(mh, octstr_imm("X-Mms-Status"));
|
||||||
value2 = http_header_value(mh, octstr_imm("Message-ID"));
|
value2 = http_header_value(mh, octstr_imm("Message-ID"));
|
||||||
send_report(hfrom, "delivery-report", value, value2, h->m->id);
|
send_report(hfrom, "delivery-report", value, value2, h->m->id, h->m->group_id);
|
||||||
|
|
||||||
if (value)
|
if (value)
|
||||||
octstr_destroy(value);
|
octstr_destroy(value);
|
||||||
|
@ -408,7 +413,7 @@ static void mm7eaif_receive(MmsHTTPClientInfo *h)
|
||||||
case MMS_MSGTYPE_READ_ORIG_IND:
|
case MMS_MSGTYPE_READ_ORIG_IND:
|
||||||
value = http_header_value(mh, octstr_imm("X-Mms-Read-Status"));
|
value = http_header_value(mh, octstr_imm("X-Mms-Read-Status"));
|
||||||
value2 = http_header_value(mh, octstr_imm("Message-ID"));
|
value2 = http_header_value(mh, octstr_imm("Message-ID"));
|
||||||
send_report(hfrom, "read-report", value, value2, h->m->id);
|
send_report(hfrom, "read-report", value, value2, h->m->id, h->m->group_id);
|
||||||
|
|
||||||
if (value)
|
if (value)
|
||||||
octstr_destroy(value);
|
octstr_destroy(value);
|
||||||
|
@ -780,9 +785,9 @@ static int mms_sendtommsc(MmscGrp *mmc, Octstr *from, Octstr *to, Octstr *transi
|
||||||
|
|
||||||
if (id) {
|
if (id) {
|
||||||
if (dlr_url) /* remember the url's for reporting purposes. */
|
if (dlr_url) /* remember the url's for reporting purposes. */
|
||||||
mms_dlr_url_put(id, "delivery-report", mmc->id, dlr_url);
|
mms_dlr_url_put(id, "delivery-report", mmc->group_id, dlr_url);
|
||||||
if (rr_url)
|
if (rr_url)
|
||||||
mms_dlr_url_put(id, "read-report", mmc->id, rr_url);
|
mms_dlr_url_put(id, "read-report", mmc->group_id, rr_url);
|
||||||
|
|
||||||
octstr_destroy(id);
|
octstr_destroy(id);
|
||||||
return MMS_SEND_OK;
|
return MMS_SEND_OK;
|
||||||
|
@ -886,7 +891,7 @@ static int sendMsg(MmsEnvelope *e)
|
||||||
send_report(to->rcpt, "delivery-report",
|
send_report(to->rcpt, "delivery-report",
|
||||||
(e->expiryt != 0 && e->expiryt < tnow) ?
|
(e->expiryt != 0 && e->expiryt < tnow) ?
|
||||||
octstr_imm("Expired") : octstr_imm("Rejected"),
|
octstr_imm("Expired") : octstr_imm("Rejected"),
|
||||||
e->msgId, mmc->id);
|
e->msgId, mmc->id, mmc->group_id);
|
||||||
if (res == MMS_SEND_ERROR_FATAL)
|
if (res == MMS_SEND_ERROR_FATAL)
|
||||||
to->process = 0; /* No more attempts. */
|
to->process = 0; /* No more attempts. */
|
||||||
|
|
||||||
|
|
|
@ -24,7 +24,7 @@
|
||||||
#include "mms_queue.h"
|
#include "mms_queue.h"
|
||||||
|
|
||||||
#define MAXTRIES 10
|
#define MAXTRIES 10
|
||||||
static int dlr_entry_fname(char *msgid, char *rtype, Octstr *mmc_id, Octstr **efname)
|
static int dlr_entry_fname(char *msgid, char *rtype, Octstr *mmc_gid, Octstr **efname)
|
||||||
{
|
{
|
||||||
char d1[2], d2[3], fbuf[512], *p;
|
char d1[2], d2[3], fbuf[512], *p;
|
||||||
unsigned long h = _mshash(msgid);
|
unsigned long h = _mshash(msgid);
|
||||||
|
@ -53,7 +53,7 @@ static int dlr_entry_fname(char *msgid, char *rtype, Octstr *mmc_id, Octstr **ef
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
t = octstr_format("%S-%s_%s", mmc_id, msgid, rtype); /* Put mmc id into name. */
|
t = octstr_format("%S-%s_%s", mmc_gid, msgid, rtype); /* Put mmc id into name. */
|
||||||
|
|
||||||
octstr_replace(t, octstr_imm("/"), octstr_imm("$")); /* XXX safe in all cases?? */
|
octstr_replace(t, octstr_imm("/"), octstr_imm("$")); /* XXX safe in all cases?? */
|
||||||
s = octstr_format("%s/%S", fbuf, t);
|
s = octstr_format("%s/%S", fbuf, t);
|
||||||
|
@ -81,9 +81,9 @@ static int dlr_entry_fname(char *msgid, char *rtype, Octstr *mmc_id, Octstr **ef
|
||||||
return fd;
|
return fd;
|
||||||
}
|
}
|
||||||
|
|
||||||
void mms_dlr_url_put(Octstr *msgid, char *rtype, Octstr *mmc_id, Octstr *dlr_url)
|
void mms_dlr_url_put(Octstr *msgid, char *rtype, Octstr *mmc_gid, Octstr *dlr_url)
|
||||||
{
|
{
|
||||||
int fd = dlr_entry_fname(octstr_get_cstr(msgid), rtype, mmc_id, NULL);
|
int fd = dlr_entry_fname(octstr_get_cstr(msgid), rtype, mmc_gid, NULL);
|
||||||
|
|
||||||
if (fd >= 0) {
|
if (fd >= 0) {
|
||||||
octstr_write_data(dlr_url, fd, 0);
|
octstr_write_data(dlr_url, fd, 0);
|
||||||
|
@ -91,9 +91,9 @@ void mms_dlr_url_put(Octstr *msgid, char *rtype, Octstr *mmc_id, Octstr *dlr_url
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Octstr *mms_dlr_url_get(Octstr *msgid, char *rtype, Octstr *mmc_id)
|
Octstr *mms_dlr_url_get(Octstr *msgid, char *rtype, Octstr *mmc_gid)
|
||||||
{
|
{
|
||||||
int fd = dlr_entry_fname(octstr_get_cstr(msgid), rtype, mmc_id, NULL);
|
int fd = dlr_entry_fname(octstr_get_cstr(msgid), rtype, mmc_gid, NULL);
|
||||||
FILE *f;
|
FILE *f;
|
||||||
|
|
||||||
if (fd >= 0 && (f = fdopen(fd, "r+")) != NULL) {
|
if (fd >= 0 && (f = fdopen(fd, "r+")) != NULL) {
|
||||||
|
@ -110,10 +110,10 @@ Octstr *mms_dlr_url_get(Octstr *msgid, char *rtype, Octstr *mmc_id)
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
void mms_dlr_url_remove(Octstr *msgid, char *rtype, Octstr *mmc_id)
|
void mms_dlr_url_remove(Octstr *msgid, char *rtype, Octstr *mmc_gid)
|
||||||
{
|
{
|
||||||
Octstr *fname = NULL;
|
Octstr *fname = NULL;
|
||||||
int fd = dlr_entry_fname(octstr_get_cstr(msgid), rtype, mmc_id, &fname);
|
int fd = dlr_entry_fname(octstr_get_cstr(msgid), rtype, mmc_gid, &fname);
|
||||||
|
|
||||||
if (fname)
|
if (fname)
|
||||||
unlink(octstr_get_cstr(fname));
|
unlink(octstr_get_cstr(fname));
|
||||||
|
|
|
@ -15,9 +15,9 @@
|
||||||
#include "mmsbox_cfg.h"
|
#include "mmsbox_cfg.h"
|
||||||
|
|
||||||
extern int rstop;
|
extern int rstop;
|
||||||
void mms_dlr_url_put(Octstr *msgid, char *rtype, Octstr *mmc_id, Octstr *dlr_url);
|
void mms_dlr_url_put(Octstr *msgid, char *rtype, Octstr *mmc_gid, Octstr *dlr_url);
|
||||||
Octstr *mms_dlr_url_get(Octstr *msgid, char *rtype, Octstr *mmc_id);
|
Octstr *mms_dlr_url_get(Octstr *msgid, char *rtype, Octstr *mmc_gid);
|
||||||
void mms_dlr_url_remove(Octstr *msgid, char *rtype, Octstr *mmc_id);
|
void mms_dlr_url_remove(Octstr *msgid, char *rtype, Octstr *mmc_gid);
|
||||||
void mmsc_receive_func(MmscGrp *m);
|
void mmsc_receive_func(MmscGrp *m);
|
||||||
void mmsbox_outgoing_queue_runner(int *rstop);
|
void mmsbox_outgoing_queue_runner(int *rstop);
|
||||||
|
|
||||||
|
|
|
@ -145,6 +145,12 @@ int mms_load_mmsbox_settings(mCfg *cfg, gwthread_func_t *mmsc_handler_func)
|
||||||
memset(m, 0, sizeof *m);
|
memset(m, 0, sizeof *m);
|
||||||
|
|
||||||
m->id = _mms_cfg_getx(x, octstr_imm("id"));
|
m->id = _mms_cfg_getx(x, octstr_imm("id"));
|
||||||
|
if (octstr_len(m->id) < 1)
|
||||||
|
panic(0,"Missing required value `mmsc-id' in config file!");
|
||||||
|
m->group_id = _mms_cfg_getx(x, octstr_imm("group-id"));
|
||||||
|
if (octstr_len(m->group_id) < 1)
|
||||||
|
m->group_id = octstr_duplicate(m->id);
|
||||||
|
|
||||||
m->mmsc_url = _mms_cfg_getx(x, octstr_imm("mmsc-url"));
|
m->mmsc_url = _mms_cfg_getx(x, octstr_imm("mmsc-url"));
|
||||||
|
|
||||||
m->allowed_prefix = mms_cfg_get(x, octstr_imm("allowed-prefix"));
|
m->allowed_prefix = mms_cfg_get(x, octstr_imm("allowed-prefix"));
|
||||||
|
@ -153,8 +159,11 @@ int mms_load_mmsbox_settings(mCfg *cfg, gwthread_func_t *mmsc_handler_func)
|
||||||
m->incoming.allow_ip = mms_cfg_get(x, octstr_imm("allow-ip"));
|
m->incoming.allow_ip = mms_cfg_get(x, octstr_imm("allow-ip"));
|
||||||
m->incoming.deny_ip = mms_cfg_get(x, octstr_imm("deny-ip"));
|
m->incoming.deny_ip = mms_cfg_get(x, octstr_imm("deny-ip"));
|
||||||
|
|
||||||
info(0, "MMSC[%s], allow=[%s], deny=[%s]", octstr_get_cstr(m->id),
|
info(0, "MMSC[%s], allow=[%s], deny=[%s] group_id=[%s]",
|
||||||
octstr_get_cstr(m->incoming.allow_ip), octstr_get_cstr(m->incoming.deny_ip));
|
octstr_get_cstr(m->id),
|
||||||
|
octstr_get_cstr(m->incoming.allow_ip),
|
||||||
|
octstr_get_cstr(m->incoming.deny_ip),
|
||||||
|
octstr_get_cstr(m->group_id));
|
||||||
|
|
||||||
m->incoming.user = _mms_cfg_getx(x, octstr_imm("incoming-username"));
|
m->incoming.user = _mms_cfg_getx(x, octstr_imm("incoming-username"));
|
||||||
m->incoming.pass = _mms_cfg_getx(x, octstr_imm("incoming-password"));
|
m->incoming.pass = _mms_cfg_getx(x, octstr_imm("incoming-password"));
|
||||||
|
|
|
@ -16,6 +16,7 @@
|
||||||
|
|
||||||
typedef struct MmscGrp {
|
typedef struct MmscGrp {
|
||||||
Octstr *id; /* MMSC id (for logging). */
|
Octstr *id; /* MMSC id (for logging). */
|
||||||
|
Octstr *group_id; /* GROUP MMSC id (used for qf). */
|
||||||
Octstr *mmsc_url; /* URL at which MMSC can be reached. */
|
Octstr *mmsc_url; /* URL at which MMSC can be reached. */
|
||||||
struct {
|
struct {
|
||||||
Octstr *user, *pass;
|
Octstr *user, *pass;
|
||||||
|
|
Loading…
Reference in New Issue