diff --git a/mbuni/misc-patches/mbuni-kannel-patch-full b/mbuni/misc-patches/mbuni-kannel-patch-full index faecb9b..5d77bec 100644 --- a/mbuni/misc-patches/mbuni-kannel-patch-full +++ b/mbuni/misc-patches/mbuni-kannel-patch-full @@ -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) diff --git a/mbuni/mmlib/mms_queue.c b/mbuni/mmlib/mms_queue.c index b410a1e..987bf83 100644 --- a/mbuni/mmlib/mms_queue.c +++ b/mbuni/mmlib/mms_queue.c @@ -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); iprov_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")); diff --git a/mbuni/mmlib/mms_util.h b/mbuni/mmlib/mms_util.h index 8f124ea..fd072c1 100644 --- a/mbuni/mmlib/mms_util.h +++ b/mbuni/mmlib/mms_util.h @@ -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; diff --git a/mbuni/mmsc/mmsmobilesender.c b/mbuni/mmsc/mmsmobilesender.c index 7d00e08..d505495 100644 --- a/mbuni/mmsc/mmsmobilesender.c +++ b/mbuni/mmsc/mmsmobilesender.c @@ -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) diff --git a/mbuni/mmsc/mmsproxy.c b/mbuni/mmsc/mmsproxy.c index c153ca9..cf91867 100644 --- a/mbuni/mmsc/mmsproxy.c +++ b/mbuni/mmsc/mmsproxy.c @@ -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. */