From 8124439d44bc93f143b736558220416fe448c8f0 Mon Sep 17 00:00:00 2001 From: bagyenda <> Date: Wed, 8 Aug 2007 05:38:20 +0000 Subject: [PATCH] added params to prov notify script --- mbuni/ChangeLog | 2 ++ mbuni/doc/userguide.shtml | 4 ---- mbuni/mmsc/mmsc_cfg.c | 35 +++++++++++++++++++++++------------ mbuni/mmsc/mmsc_cfg.h | 3 ++- mbuni/mmsc/mmsmobilesender.c | 2 +- mbuni/mmsc/mmsproxy.c | 36 +++++++++++++----------------------- 6 files changed, 41 insertions(+), 41 deletions(-) diff --git a/mbuni/ChangeLog b/mbuni/ChangeLog index b9bf584..94de3d6 100644 --- a/mbuni/ChangeLog +++ b/mbuni/ChangeLog @@ -1,3 +1,5 @@ +2007-08-08 P. A. Bagyenda + * Added User-Agent and UAProf URL arguments to call to prov-notify script in MMC. 2007-08-06 P. A. Bagyenda * Fix for DLR reporting in mmsbox (thanks to Skycore team) * UACapabilities support for MM7/SOAP v6.x (thanks again to Skycore Team) diff --git a/mbuni/doc/userguide.shtml b/mbuni/doc/userguide.shtml index 8b179b4..51f0da2 100644 --- a/mbuni/doc/userguide.shtml +++ b/mbuni/doc/userguide.shtml @@ -99,10 +99,6 @@ This document describes the installation and usage of the MMS Gateway.

Chapter 1: Introduction

-

- This chapter provides an overview of MMS -(short for Multimedia Messaging Service) and the Mbuni MMS Gateway. -

MMS offers mobile users enhanced messaging capabilities like the ability to send pictures and diff --git a/mbuni/mmsc/mmsc_cfg.c b/mbuni/mmsc/mmsc_cfg.c index afd0add..590fb81 100644 --- a/mbuni/mmsc/mmsc_cfg.c +++ b/mbuni/mmsc/mmsc_cfg.c @@ -582,26 +582,37 @@ int mms_ind_send(Octstr *prov_cmd, Octstr *to) return res; } -void notify_prov_server(char *cmd, char *from, char *event, char *arg, Octstr *msgid) +void notify_prov_server(char *cmd, char *from, char *event, char *arg, Octstr *msgid, + Octstr *ua, Octstr *uaprof) { Octstr *s; - Octstr *tmp, *tmp2; + Octstr *tmp, *tmp2, *tmp3, *tmp4; if (cmd == NULL || cmd[0] == '\0') return; - tmp = octstr_create(from); + + gw_assert(from); + gw_assert(cmd); + gw_assert(event); + + tmp = octstr_create(from); + tmp2 = msgid ? octstr_duplicate(msgid) : octstr_create(""); + tmp3 = ua ? octstr_duplicate(ua) : octstr_create(""); + tmp4 = uaprof ? octstr_duplicate(uaprof) : octstr_create(""); + escape_shell_chars(tmp); - - tmp2 = msgid ? octstr_duplicate(msgid) : octstr_create(""); escape_shell_chars(tmp2); + escape_shell_chars(tmp3); + escape_shell_chars(tmp4); - s = octstr_format("%s '%s' '%s' '%s' '%s'", cmd, event, - octstr_get_cstr(tmp), arg, octstr_get_cstr(tmp2)); + s = octstr_format("%s '%s' '%S' '%s' '%S' '%S' '%S'", cmd, event, + tmp, arg, tmp2, tmp3, tmp4); + + system(octstr_get_cstr(s)); + + octstr_destroy(s); octstr_destroy(tmp); octstr_destroy(tmp2); - - if (s) { - system(octstr_get_cstr(s)); - octstr_destroy(s); - } + octstr_destroy(tmp3); + octstr_destroy(tmp4); } diff --git a/mbuni/mmsc/mmsc_cfg.h b/mbuni/mmsc/mmsc_cfg.h index 7fad2b5..b585724 100644 --- a/mbuni/mmsc/mmsc_cfg.h +++ b/mbuni/mmsc/mmsc_cfg.h @@ -120,7 +120,8 @@ extern int mms_decodefetchurl(Octstr *fetch_url, Octstr **qf, Octstr **token, int *loc); Octstr *mms_find_sender_ip(List *request_hdrs, Octstr *ip_header, Octstr *ip, int *isv6); -void notify_prov_server(char *cmd, char *from, char *event, char *arg, Octstr *msgid); +void notify_prov_server(char *cmd, char *from, char *event, char *arg, Octstr *msgid, + Octstr *ua, Octstr *uaprof); int mms_ind_send(Octstr *prov_cmd, Octstr *to); #endif diff --git a/mbuni/mmsc/mmsmobilesender.c b/mbuni/mmsc/mmsmobilesender.c index b10b947..e63a8fe 100644 --- a/mbuni/mmsc/mmsmobilesender.c +++ b/mbuni/mmsc/mmsmobilesender.c @@ -452,7 +452,7 @@ static int sendNotify(MmsEnvelope *e) to ? octstr_get_cstr(to) : "unknown", prov_notify_event, rtype ? rtype : "", - e ? e->msgId : NULL); + e ? e->msgId : NULL, NULL, NULL); if (msg) mms_destroy(msg); if (phonenum) diff --git a/mbuni/mmsc/mmsproxy.c b/mbuni/mmsc/mmsproxy.c index facd73a..b2fa0fc 100644 --- a/mbuni/mmsc/mmsproxy.c +++ b/mbuni/mmsc/mmsproxy.c @@ -416,7 +416,8 @@ void fetchmms_proxy(MmsHTTPClientInfo *h) 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 : "", e ? e->msgId : NULL); + notify_cmd, notify_arg ? notify_arg : "", e ? e->msgId : NULL, + h->ua, h->profile_url); http_destroy_headers(rh); @@ -1445,27 +1446,15 @@ static void sendmms_proxy(MmsHTTPClientInfo *h) reply_body = mms_tobinary(mresp); notify_cmd = "deleted"; - if (xflags) - gwlist_destroy(xflags, (gwlist_item_destructor_t *)octstr_destroy); - if (xstates) - gwlist_destroy(xstates, (gwlist_item_destructor_t *)octstr_destroy); - if (required_headers) - gwlist_destroy(required_headers, (gwlist_item_destructor_t *)octstr_destroy); - - if (msgrefs) - gwlist_destroy(msgrefs, (gwlist_item_destructor_t *)octstr_destroy); - - if (msglocs) - gwlist_destroy(msglocs, (gwlist_item_destructor_t *)octstr_destroy); - - if (msgs) - gwlist_destroy(msgs, (gwlist_item_destructor_t *)octstr_destroy); - - if (otherhdrs) - http_destroy_headers(otherhdrs); - - if (otransid) - octstr_destroy(otransid); + + gwlist_destroy(xflags, (gwlist_item_destructor_t *)octstr_destroy); + gwlist_destroy(xstates, (gwlist_item_destructor_t *)octstr_destroy); + gwlist_destroy(required_headers, (gwlist_item_destructor_t *)octstr_destroy); + gwlist_destroy(msgrefs, (gwlist_item_destructor_t *)octstr_destroy); + gwlist_destroy(msglocs, (gwlist_item_destructor_t *)octstr_destroy); + gwlist_destroy(msgs, (gwlist_item_destructor_t *)octstr_destroy); + http_destroy_headers(otherhdrs); + octstr_destroy(otransid); } break; @@ -1482,7 +1471,8 @@ 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, - "", NULL); + "", NULL, + h->ua, h->profile_url); mms_destroy(m); /* Send reply. */