Improved reporting via prov-notify script
Removed prov-notify-script-arg config param
This commit is contained in:
parent
683948a174
commit
df3efbd19c
|
@ -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-04-22 17:11:25.000000000 +0300
|
||||
@@ -544,6 +544,69 @@
|
||||
+++ gateway-1.4.0-patched/gwlib/cfg.def 2005-07-04 10:58:15.000000000 +0300
|
||||
@@ -544,6 +544,68 @@
|
||||
OCTSTR(unified-prefix)
|
||||
)
|
||||
|
||||
|
@ -752,7 +752,6 @@ diff -Naur gateway-1.4.0/gwlib/cfg.def gateway-1.4.0-patched/gwlib/cfg.def
|
|||
+ OCTSTR(detokenizer-module-parameters)
|
||||
+ OCTSTR(detokenizer-library)
|
||||
+ OCTSTR(prov-server-notify-script)
|
||||
+ OCTSTR(prov-server-notify-script-arg)
|
||||
+ OCTSTR(prov-server-sub-status-script)
|
||||
+ OCTSTR(notify-unprovisioned)
|
||||
+ OCTSTR(mms-notify-text)
|
||||
|
|
|
@ -649,8 +649,6 @@ Octstr *mms_queue_add(Octstr *from, List *to,
|
|||
|
||||
close(fd); /* Close queue file, thereby letting go of locks. */
|
||||
|
||||
|
||||
|
||||
done:
|
||||
/* Free the envelope stuff since we do not need it any more, then free e */
|
||||
for (i = 0, n = list_len(e->to); i<n; i++) {
|
||||
|
|
|
@ -202,7 +202,6 @@ MmsBoxSettings *mms_load_mmsbox_settings(Cfg *cfg)
|
|||
octstr_imm("email2mms-relay-prefixes"));
|
||||
|
||||
m->prov_notify = cfg_getx(grp,octstr_imm("prov-server-notify-script"));
|
||||
m->prov_notify_arg = cfg_getx(grp,octstr_imm("prov-server-notify-script-arg"));
|
||||
|
||||
m->prov_getstatus = cfg_getx(grp,octstr_imm("prov-server-sub-status-script"));
|
||||
m->mms_notify_txt = cfg_getx(grp, octstr_imm("mms-notify-text"));
|
||||
|
|
|
@ -102,7 +102,7 @@ typedef struct MmsBoxSettings {
|
|||
int optimize_notification_size;
|
||||
|
||||
Octstr *prov_notify;
|
||||
Octstr *prov_notify_arg;
|
||||
|
||||
Octstr *prov_getstatus;
|
||||
int notify_unprovisioned;
|
||||
Octstr *mms_notify_txt;
|
||||
|
|
|
@ -437,7 +437,7 @@ static int sendNotify(MmsEnvelope *e)
|
|||
notify_prov_server(octstr_get_cstr(settings->prov_notify),
|
||||
to ? octstr_get_cstr(to) : "unknown",
|
||||
prov_notify_event,
|
||||
octstr_get_cstr(settings->prov_notify_arg));
|
||||
rtype ? rtype : "");
|
||||
|
||||
if (msg) mms_destroy(msg);
|
||||
if (phonenum)
|
||||
|
|
|
@ -249,6 +249,7 @@ void fetchmms_proxy(MmsHTTPClientInfo *h)
|
|||
MmsEnvelope *e = NULL;
|
||||
MmsMsg *m = NULL, *mr = NULL;
|
||||
List *rh;
|
||||
char *notify_cmd = NULL, *notify_arg = NULL;
|
||||
int loc, menc = MS_1_1;
|
||||
|
||||
debug("proxy.fetchinterface", 0, " ---> Entered fetch interface <---");
|
||||
|
@ -277,6 +278,8 @@ void fetchmms_proxy(MmsHTTPClientInfo *h)
|
|||
mr = mms_retrieveconf(NULL, NULL, "Error-permanent-message-not-found", "Message not found",
|
||||
settings->system_user, MS_1_1);
|
||||
s = mms_tobinary(mr);
|
||||
notify_cmd = "fetchfailed";
|
||||
notify_arg = "messagenotfound";
|
||||
goto failed;
|
||||
}
|
||||
} else { /* it is in mmbox, so get it from there. */
|
||||
|
@ -289,6 +292,8 @@ void fetchmms_proxy(MmsHTTPClientInfo *h)
|
|||
mr = mms_retrieveconf(NULL, NULL, "Error-permanent-message-not-found", "Message not found",
|
||||
settings->system_user, MS_1_1);
|
||||
s = mms_tobinary(mr);
|
||||
notify_cmd = "fetchfailed";
|
||||
notify_arg = "messagenotfound";
|
||||
goto failed;
|
||||
}
|
||||
menc = MS_1_2;
|
||||
|
@ -309,6 +314,8 @@ void fetchmms_proxy(MmsHTTPClientInfo *h)
|
|||
"Error-permanent-content-unsupported", "No MMS Support",
|
||||
settings->system_user,MS_1_1);
|
||||
s = mms_tobinary(mr);
|
||||
notify_cmd = "fetchfailed";
|
||||
notify_arg = "device-does-not-support-mms";
|
||||
goto failed;
|
||||
} else if (x == 0) {
|
||||
if (outmsg == NULL) { /* Too large so truncated. */
|
||||
|
@ -325,6 +332,8 @@ void fetchmms_proxy(MmsHTTPClientInfo *h)
|
|||
octstr_destroy(xx);
|
||||
|
||||
s = mms_tobinary(mr);
|
||||
notify_cmd = "fetchfailed";
|
||||
notify_arg = "message-too-large-for-device";
|
||||
goto failed;
|
||||
} else {
|
||||
mms_destroy(m);
|
||||
|
@ -349,7 +358,8 @@ void fetchmms_proxy(MmsHTTPClientInfo *h)
|
|||
octstr_get_cstr(h->url), octstr_get_cstr(h->ip));
|
||||
goto failed;
|
||||
}
|
||||
|
||||
|
||||
notify_cmd = "fetched";
|
||||
|
||||
if (e) {
|
||||
e->lastaccess = time(NULL); /* No more notifications requests. */
|
||||
|
@ -374,6 +384,7 @@ void fetchmms_proxy(MmsHTTPClientInfo *h)
|
|||
e ? e->msize : 0, e ? e->msgId : NULL, NULL, NULL, "MM1",
|
||||
h->ua, (loc == MMS_LOC_MMBOX) ? qf : NULL);
|
||||
|
||||
|
||||
goto free_stuff; /* Skip to end. */
|
||||
|
||||
failed:
|
||||
|
@ -401,6 +412,12 @@ void fetchmms_proxy(MmsHTTPClientInfo *h)
|
|||
|
||||
free_stuff:
|
||||
|
||||
if (notify_cmd) /* Inform provisioning server */
|
||||
notify_prov_server(octstr_get_cstr(settings->prov_notify),
|
||||
h->base_client_addr ? octstr_get_cstr(h->base_client_addr) : "unknown",
|
||||
notify_cmd, notify_arg ? notify_arg : "");
|
||||
|
||||
|
||||
http_destroy_headers(rh);
|
||||
if (e) mms_queue_free_env(e);
|
||||
|
||||
|
@ -1535,7 +1552,7 @@ static void sendmms_proxy(MmsHTTPClientInfo *h)
|
|||
notify_prov_server(octstr_get_cstr(settings->prov_notify),
|
||||
h->base_client_addr ? octstr_get_cstr(h->base_client_addr) : "unknown",
|
||||
notify_cmd,
|
||||
octstr_get_cstr(settings->prov_notify_arg));
|
||||
"");
|
||||
|
||||
mms_destroy(m);
|
||||
/* Send reply. */
|
||||
|
|
Loading…
Reference in New Issue