1
0
Fork 0

Improved reporting via prov-notify script

Removed prov-notify-script-arg config param
This commit is contained in:
bagyenda 2005-07-04 08:19:18 +00:00
parent 683948a174
commit df3efbd19c
6 changed files with 23 additions and 10 deletions

View File

@ -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 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/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 +++ gateway-1.4.0-patched/gwlib/cfg.def 2005-07-04 10:58:15.000000000 +0300
@@ -544,6 +544,69 @@ @@ -544,6 +544,68 @@
OCTSTR(unified-prefix) 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-module-parameters)
+ OCTSTR(detokenizer-library) + OCTSTR(detokenizer-library)
+ OCTSTR(prov-server-notify-script) + OCTSTR(prov-server-notify-script)
+ OCTSTR(prov-server-notify-script-arg)
+ OCTSTR(prov-server-sub-status-script) + OCTSTR(prov-server-sub-status-script)
+ OCTSTR(notify-unprovisioned) + OCTSTR(notify-unprovisioned)
+ OCTSTR(mms-notify-text) + OCTSTR(mms-notify-text)

View File

@ -649,8 +649,6 @@ Octstr *mms_queue_add(Octstr *from, List *to,
close(fd); /* Close queue file, thereby letting go of locks. */ close(fd); /* Close queue file, thereby letting go of locks. */
done: done:
/* Free the envelope stuff since we do not need it any more, then free e */ /* 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++) { for (i = 0, n = list_len(e->to); i<n; i++) {

View File

@ -202,7 +202,6 @@ MmsBoxSettings *mms_load_mmsbox_settings(Cfg *cfg)
octstr_imm("email2mms-relay-prefixes")); octstr_imm("email2mms-relay-prefixes"));
m->prov_notify = cfg_getx(grp,octstr_imm("prov-server-notify-script")); 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->prov_getstatus = cfg_getx(grp,octstr_imm("prov-server-sub-status-script"));
m->mms_notify_txt = cfg_getx(grp, octstr_imm("mms-notify-text")); m->mms_notify_txt = cfg_getx(grp, octstr_imm("mms-notify-text"));

View File

@ -102,7 +102,7 @@ typedef struct MmsBoxSettings {
int optimize_notification_size; int optimize_notification_size;
Octstr *prov_notify; Octstr *prov_notify;
Octstr *prov_notify_arg;
Octstr *prov_getstatus; Octstr *prov_getstatus;
int notify_unprovisioned; int notify_unprovisioned;
Octstr *mms_notify_txt; Octstr *mms_notify_txt;

View File

@ -437,7 +437,7 @@ static int sendNotify(MmsEnvelope *e)
notify_prov_server(octstr_get_cstr(settings->prov_notify), notify_prov_server(octstr_get_cstr(settings->prov_notify),
to ? octstr_get_cstr(to) : "unknown", to ? octstr_get_cstr(to) : "unknown",
prov_notify_event, prov_notify_event,
octstr_get_cstr(settings->prov_notify_arg)); rtype ? rtype : "");
if (msg) mms_destroy(msg); if (msg) mms_destroy(msg);
if (phonenum) if (phonenum)

View File

@ -249,6 +249,7 @@ void fetchmms_proxy(MmsHTTPClientInfo *h)
MmsEnvelope *e = NULL; MmsEnvelope *e = NULL;
MmsMsg *m = NULL, *mr = NULL; MmsMsg *m = NULL, *mr = NULL;
List *rh; List *rh;
char *notify_cmd = NULL, *notify_arg = NULL;
int loc, menc = MS_1_1; int loc, menc = MS_1_1;
debug("proxy.fetchinterface", 0, " ---> Entered fetch interface <---"); 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", mr = mms_retrieveconf(NULL, NULL, "Error-permanent-message-not-found", "Message not found",
settings->system_user, MS_1_1); settings->system_user, MS_1_1);
s = mms_tobinary(mr); s = mms_tobinary(mr);
notify_cmd = "fetchfailed";
notify_arg = "messagenotfound";
goto failed; goto failed;
} }
} else { /* it is in mmbox, so get it from there. */ } 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", mr = mms_retrieveconf(NULL, NULL, "Error-permanent-message-not-found", "Message not found",
settings->system_user, MS_1_1); settings->system_user, MS_1_1);
s = mms_tobinary(mr); s = mms_tobinary(mr);
notify_cmd = "fetchfailed";
notify_arg = "messagenotfound";
goto failed; goto failed;
} }
menc = MS_1_2; menc = MS_1_2;
@ -309,6 +314,8 @@ void fetchmms_proxy(MmsHTTPClientInfo *h)
"Error-permanent-content-unsupported", "No MMS Support", "Error-permanent-content-unsupported", "No MMS Support",
settings->system_user,MS_1_1); settings->system_user,MS_1_1);
s = mms_tobinary(mr); s = mms_tobinary(mr);
notify_cmd = "fetchfailed";
notify_arg = "device-does-not-support-mms";
goto failed; goto failed;
} else if (x == 0) { } else if (x == 0) {
if (outmsg == NULL) { /* Too large so truncated. */ if (outmsg == NULL) { /* Too large so truncated. */
@ -325,6 +332,8 @@ void fetchmms_proxy(MmsHTTPClientInfo *h)
octstr_destroy(xx); octstr_destroy(xx);
s = mms_tobinary(mr); s = mms_tobinary(mr);
notify_cmd = "fetchfailed";
notify_arg = "message-too-large-for-device";
goto failed; goto failed;
} else { } else {
mms_destroy(m); mms_destroy(m);
@ -349,7 +358,8 @@ void fetchmms_proxy(MmsHTTPClientInfo *h)
octstr_get_cstr(h->url), octstr_get_cstr(h->ip)); octstr_get_cstr(h->url), octstr_get_cstr(h->ip));
goto failed; goto failed;
} }
notify_cmd = "fetched";
if (e) { if (e) {
e->lastaccess = time(NULL); /* No more notifications requests. */ 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", e ? e->msize : 0, e ? e->msgId : NULL, NULL, NULL, "MM1",
h->ua, (loc == MMS_LOC_MMBOX) ? qf : NULL); h->ua, (loc == MMS_LOC_MMBOX) ? qf : NULL);
goto free_stuff; /* Skip to end. */ goto free_stuff; /* Skip to end. */
failed: failed:
@ -401,6 +412,12 @@ void fetchmms_proxy(MmsHTTPClientInfo *h)
free_stuff: 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); http_destroy_headers(rh);
if (e) mms_queue_free_env(e); 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), notify_prov_server(octstr_get_cstr(settings->prov_notify),
h->base_client_addr ? octstr_get_cstr(h->base_client_addr) : "unknown", h->base_client_addr ? octstr_get_cstr(h->base_client_addr) : "unknown",
notify_cmd, notify_cmd,
octstr_get_cstr(settings->prov_notify_arg)); "");
mms_destroy(m); mms_destroy(m);
/* Send reply. */ /* Send reply. */