1
0
Fork 0

*** empty log message ***

This commit is contained in:
bagyenda 2009-10-14 03:36:32 +00:00
parent 4f185a7032
commit ab8828922d
9 changed files with 35 additions and 8 deletions

View File

@ -1,3 +1,8 @@
2009-10-14 P. A. Bagyenda <bagyenda@dsmagic.com>
* Added Billing info to mmssend (thanks to Vincent CHAVANIS <v.chavanis at telemaque.fr>)
* Fix for automake 1.1 (thanks to Vincent CHAVANIS <v.chavanis at telemaque.fr>)
* MMSC resolver module now takes two extra arguments: src interface (whence message received)
and ID of sender on that interface (e.g. vaspid)
2009-10-13 P. A. Bagyenda <bagyenda@dsmagic.com>
* Minor bug in mms_cfg.c -- get_bool fails if using pgsql for configs
2009-09-08 P. A. Bagyenda <bagyenda@dsmagic.com>

View File

@ -4,7 +4,9 @@ set -e
# Check for automake
amvers="no"
if automake-1.10 --version >/dev/null 2>&1; then
if automake-1.11 --version >/dev/null 2>&1; then
amvers="-1.11"
elif automake-1.10 --version >/dev/null 2>&1; then
amvers="-1.10"
elif automake-1.9 --version >/dev/null 2>&1; then
amvers="-1.9"

View File

@ -25,7 +25,8 @@ static int mms_resolvermodule_fini(void *module_data)
return 0;
}
static Octstr *mms_resolve(Octstr * phonenum, void *module_data, void *settings_p, void *proxyrelays_p)
static Octstr *mms_resolve(Octstr * phonenum, char *src_int, char *src_id,
void *module_data, void *settings_p, void *proxyrelays_p)
{
/* Most custom implementations of this library will probably just ignore the two last arguments,
* but this one needs them

View File

@ -33,7 +33,8 @@ typedef struct MmsResolverFuncStruct {
*
* Return NULL on error, otherwise an Octstr
*/
Octstr *(*mms_resolve)(Octstr * phonenum, void *module_data, void *settings, void *proxyrelays);
Octstr *(*mms_resolve)(Octstr *phonenum, char *src_int, char *src_id,
void *module_data, void *settings, void *proxyrelays);
int (*mms_resolvermodule_fini)(void *module_data);

View File

@ -28,7 +28,8 @@ static int mms_resolvermodule_fini(void *module_data)
return 0;
}
static Octstr *mms_resolve(Octstr * phonenum, void *module_data, void *settings_p, void *proxyrelays_p)
static Octstr *mms_resolve(Octstr *phonenum, char *src_int, char *src_id,
void *module_data, void *settings_p, void *proxyrelays_p)
{
Octstr *s;
FILE *fp;
@ -37,7 +38,9 @@ static Octstr *mms_resolve(Octstr * phonenum, void *module_data, void *settings_
if (script == NULL || octstr_len(script) == 0)
return 0;
s = octstr_format("%s '%s' ", octstr_get_cstr(script), octstr_get_cstr(phonenum));
s = octstr_format("%s '%s' '%s' '%s'",
octstr_get_cstr(script), octstr_get_cstr(phonenum) ,
src_int ? src_int : "", src_id ? src_id : "");
fp = popen(octstr_get_cstr(s), "r");
octstr_destroy(s);

View File

@ -98,6 +98,7 @@ int main(int argc, char *argv[])
if (xto && ttype == TPLMN) /* Get the home mmsc domain for this recipient. */
home_mmsc = settings->mms_resolvefuncs->mms_resolve(xto,
"MM4", xproxy ? octstr_get_cstr(xproxy) : NULL,
settings->mms_resolver_module_data,
settings, proxyrelays);
if (!xto ||

View File

@ -267,6 +267,8 @@ static int sendMsg(MmsEnvelope *e)
settings->strip_prefixes);
#endif
if ((mmsc = settings->mms_resolvefuncs->mms_resolve(phonenum,
e->src_interface,
e->vaspid ? octstr_get_cstr(e->vaspid) : NULL,
settings->mms_resolver_module_data,
settings, proxyrelays))) {
mms_info(0, "MM2", NULL, "mmsc for \"%s\" resolved to: \"%s\"",

View File

@ -1911,8 +1911,9 @@ static void mm7proxy(void *unused)
h.ip ? octstr_get_cstr(h.ip) : "",
h.vasp && h.vasp->id ? octstr_get_cstr(h.vasp->id) : "(null)");
/* Dump headers, url etc. */
#if 1
#if 0
/* Dump headers, url etc. */
http_header_dump(h.headers);
if (h.body) octstr_dump(h.body, 0);
if (h.ip) octstr_dump(h.ip, 0);

View File

@ -20,6 +20,7 @@
static Octstr *from;
static Octstr *binfo;
static List *to;
static Octstr *data;
static int savetommbox;
@ -53,7 +54,13 @@ static int find_own(int i, int argc, char *argv[])
else if (argv[i][1] == 'r') {
dlr = 1;
return 0;
} else
} else if (argv[i][1] == 'B')
if (i + 1 < argc) {
binfo = octstr_create(argv[i+1]);
return 1;
} else
return -1;
else
return -1;
}
@ -148,6 +155,10 @@ int main(int argc, char *argv[])
http_header_add(h, "X-Mbuni-Tool", "mmssend");
http_header_add(h, "X-Mbuni-CalledFrom", "Terminal");
if (binfo) {
mms_info(0, "add.info", NULL, "Adding extra headers billing info `X-Mms-Binfo' :");
http_header_add(h, "X-Mms-Binfo", octstr_get_cstr(binfo));
}
s = settings->qfs->mms_queue_add(from, to, NULL, NULL, NULL, time(NULL),
time(NULL) + settings->default_msgexpiry, m,
NULL,