added strip-prefixes option for mmsc
This commit is contained in:
parent
67d8049f1b
commit
fedce613cf
|
@ -1,3 +1,5 @@
|
||||||
|
2011-01-05 P. A. Bagyenda <bagyenda@dsmagic.com>
|
||||||
|
* Added strip-prefixes option for each mmsc connection (mmsbox)
|
||||||
2011-01-04 P. A. Bagyenda <bagyenda@dsmagic.com>
|
2011-01-04 P. A. Bagyenda <bagyenda@dsmagic.com>
|
||||||
* mm1 mmsbox plugin fix Thanks to Piotr Isajew (pki at ex.com.pl)
|
* mm1 mmsbox plugin fix Thanks to Piotr Isajew (pki at ex.com.pl)
|
||||||
2011-01-03 P. A. Bagyenda <bagyenda@dsmagic.com>
|
2011-01-03 P. A. Bagyenda <bagyenda@dsmagic.com>
|
||||||
|
|
|
@ -906,7 +906,7 @@ lists all the configuration directives. The column <b>Mode</b>
|
||||||
</td>
|
</td>
|
||||||
<td valign=top >
|
<td valign=top >
|
||||||
A semi-colon (;) separated string of prefixes that should (if
|
A semi-colon (;) separated string of prefixes that should (if
|
||||||
found) be stripped of the phone number <i>prior</i> to number
|
found) be stripped off the phone number <i>prior</i> to number
|
||||||
normalisation as described below. Only the first prefix that matches
|
normalisation as described below. Only the first prefix that matches
|
||||||
will be stripped.
|
will be stripped.
|
||||||
</td>
|
</td>
|
||||||
|
@ -2771,6 +2771,22 @@ string
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
|
||||||
|
<tr>
|
||||||
|
<td valign=top >
|
||||||
|
<tt>strip-prefixes</tt>
|
||||||
|
</td>
|
||||||
|
|
||||||
|
|
||||||
|
<td valign=top >
|
||||||
|
Number list
|
||||||
|
</td>
|
||||||
|
<td valign=top >
|
||||||
|
A semi-colon (;) separated string of prefixes that should (if
|
||||||
|
found) be stripped off the phone number prior to sending message. Only the first prefix that matches
|
||||||
|
will be stripped.
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
|
||||||
<tr>
|
<tr>
|
||||||
<td valign=top >
|
<td valign=top >
|
||||||
<tt>reroute</tt>
|
<tt>reroute</tt>
|
||||||
|
|
|
@ -196,6 +196,8 @@ MULTI_GROUP(mmsc,
|
||||||
OCTSTR(strip-domain)
|
OCTSTR(strip-domain)
|
||||||
|
|
||||||
OCTSTR(max-recipients)
|
OCTSTR(max-recipients)
|
||||||
|
|
||||||
|
OCTSTR(strip-prefixes)
|
||||||
)
|
)
|
||||||
|
|
||||||
MULTI_GROUP(mms-service,
|
MULTI_GROUP(mms-service,
|
||||||
|
|
|
@ -1790,6 +1790,10 @@ static int sendMsg(MmsEnvelope *e)
|
||||||
octstr_format_append(x, "@%S",
|
octstr_format_append(x, "@%S",
|
||||||
mmc && octstr_str_compare(mmc->mmsc_url, "*") != 0 ? mmc->mmsc_url :
|
mmc && octstr_str_compare(mmc->mmsc_url, "*") != 0 ? mmc->mmsc_url :
|
||||||
octstr_imm("unknown"));
|
octstr_imm("unknown"));
|
||||||
|
|
||||||
|
if (mmc && mmc->strip_prefixes) /* strip prefixes */
|
||||||
|
_mms_fixup_address(&x, NULL, mmc->strip_prefixes, 1);
|
||||||
|
if (x)
|
||||||
gwlist_append(xto, x);
|
gwlist_append(xto, x);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1857,13 +1861,13 @@ static int sendMsg(MmsEnvelope *e)
|
||||||
octstr_destroy(new_msgid);
|
octstr_destroy(new_msgid);
|
||||||
octstr_destroy(err);
|
octstr_destroy(err);
|
||||||
http_destroy_headers(errl);
|
http_destroy_headers(errl);
|
||||||
|
gwlist_destroy(lto, NULL);
|
||||||
|
|
||||||
e->lasttry = tnow;
|
e->lasttry = tnow;
|
||||||
if (qfs->mms_queue_update(e) == 1) {
|
if (qfs->mms_queue_update(e) == 1) {
|
||||||
e = NULL;
|
e = NULL;
|
||||||
break; /* Queue entry gone. */
|
break; /* Queue entry gone. */
|
||||||
}
|
}
|
||||||
gwlist_destroy(lto, NULL);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -667,6 +667,12 @@ static MmscGrp *start_mmsc_from_conf(mCfg *cfg, mCfgGrp *x, List *warnings, List
|
||||||
m->max_recipients <= 0)
|
m->max_recipients <= 0)
|
||||||
m->max_recipients = 1;
|
m->max_recipients = 1;
|
||||||
|
|
||||||
|
if ((s = mms_cfg_get(cfg, x, octstr_imm("strip-prefixes"))) != NULL) {
|
||||||
|
m->strip_prefixes = octstr_split(s, octstr_imm(";"));
|
||||||
|
octstr_destroy(s);
|
||||||
|
} else
|
||||||
|
m->strip_prefixes = NULL;
|
||||||
|
|
||||||
if (mms_cfg_get_int(cfg,x, octstr_imm("maximum-request-size"), &m->max_pkt_size) < 0 ||
|
if (mms_cfg_get_int(cfg,x, octstr_imm("maximum-request-size"), &m->max_pkt_size) < 0 ||
|
||||||
m->max_pkt_size <= 0)
|
m->max_pkt_size <= 0)
|
||||||
m->max_pkt_size = DEFAULT_MAX_PKT_SIZE;
|
m->max_pkt_size = DEFAULT_MAX_PKT_SIZE;
|
||||||
|
@ -1310,6 +1316,7 @@ static void free_mmsc_struct (MmscGrp *m)
|
||||||
|
|
||||||
octstr_destroy(m->settings);
|
octstr_destroy(m->settings);
|
||||||
mutex_destroy(m->mutex);
|
mutex_destroy(m->mutex);
|
||||||
|
gwlist_destroy(m->strip_prefixes, (void *)octstr_destroy);
|
||||||
|
|
||||||
gw_free(m);
|
gw_free(m);
|
||||||
}
|
}
|
||||||
|
|
|
@ -84,6 +84,8 @@ typedef struct MmscGrp {
|
||||||
int strip_domain; /* MM4 only */
|
int strip_domain; /* MM4 only */
|
||||||
|
|
||||||
long max_recipients; /* Max recpients per transaction */
|
long max_recipients; /* Max recpients per transaction */
|
||||||
|
|
||||||
|
List *strip_prefixes; /* List of prefixes to be stripped before sending out*/
|
||||||
} MmscGrp;
|
} MmscGrp;
|
||||||
|
|
||||||
#define DEFAULT_MAX_PKT_SIZE 1024*1024
|
#define DEFAULT_MAX_PKT_SIZE 1024*1024
|
||||||
|
|
Loading…
Reference in New Issue