VAS GW fixes for DLR
This commit is contained in:
parent
99318916ea
commit
d973e24c53
|
@ -429,19 +429,15 @@ static int fetch_serviceurl(MmsEnvelope *e,
|
||||||
ms->accept_x_headers, ms->passthro_headers,
|
ms->accept_x_headers, ms->passthro_headers,
|
||||||
err);
|
err);
|
||||||
|
|
||||||
if (base_url)
|
octstr_destroy(base_url);
|
||||||
octstr_destroy(base_url);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
done:
|
done:
|
||||||
if (ctype)
|
octstr_destroy(ctype);
|
||||||
octstr_destroy(ctype);
|
octstr_destroy(rb);
|
||||||
if (rb)
|
http_destroy_headers(rph);
|
||||||
octstr_destroy(rb);
|
octstr_destroy(params);
|
||||||
if (rph)
|
|
||||||
http_destroy_headers(rph);
|
|
||||||
if (params)
|
|
||||||
octstr_destroy(params);
|
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -494,10 +490,9 @@ static int mmsbox_service_dispatch(MmsEnvelope *e)
|
||||||
res = fetch_serviceurl(e, ms, msg, me, keyword, &err);
|
res = fetch_serviceurl(e, ms, msg, me, keyword, &err);
|
||||||
done:
|
done:
|
||||||
|
|
||||||
if (err) {
|
if (err && res != 0)
|
||||||
error(0, "MMSBox error: %s", octstr_get_cstr(err));
|
error(0, "MMSBox error: %s", octstr_get_cstr(err));
|
||||||
octstr_destroy(err);
|
|
||||||
}
|
|
||||||
if (res == -1 || res == 0) /* Fatal error, or success delete queue entry. */
|
if (res == -1 || res == 0) /* Fatal error, or success delete queue entry. */
|
||||||
for (i = 0, n = gwlist_len(e->to); i < n; i++) {
|
for (i = 0, n = gwlist_len(e->to); i < n; i++) {
|
||||||
MmsEnvelopeTo *r = gwlist_get(e->to,i);
|
MmsEnvelopeTo *r = gwlist_get(e->to,i);
|
||||||
|
@ -513,10 +508,9 @@ done:
|
||||||
if (mms_queue_update(e) != 1)
|
if (mms_queue_update(e) != 1)
|
||||||
mms_queue_free_env(e);
|
mms_queue_free_env(e);
|
||||||
|
|
||||||
if (keyword)
|
octstr_destroy(err);
|
||||||
octstr_destroy(keyword);
|
octstr_destroy(keyword);
|
||||||
if (msg)
|
mms_destroy(msg);
|
||||||
mms_destroy(msg);
|
|
||||||
if (me)
|
if (me)
|
||||||
mime_entity_destroy(me);
|
mime_entity_destroy(me);
|
||||||
return 1;
|
return 1;
|
||||||
|
@ -1075,7 +1069,7 @@ static int make_and_queue_msg(Octstr *data, Octstr *ctype, List *reply_headers,
|
||||||
octstr_imm(MM_NAME));
|
octstr_imm(MM_NAME));
|
||||||
info(0, "MMSBox: Queued message from service [%s] to outgoing: %s",
|
info(0, "MMSBox: Queued message from service [%s] to outgoing: %s",
|
||||||
octstr_get_cstr(svc_name), octstr_get_cstr(x));
|
octstr_get_cstr(svc_name), octstr_get_cstr(x));
|
||||||
octstr_destroy(x);
|
*err = x;
|
||||||
res = 0;
|
res = 0;
|
||||||
done:
|
done:
|
||||||
|
|
||||||
|
@ -1086,18 +1080,16 @@ done:
|
||||||
octstr_destroy(allow_adaptations);
|
octstr_destroy(allow_adaptations);
|
||||||
octstr_destroy(from);
|
octstr_destroy(from);
|
||||||
octstr_destroy(xfrom);
|
octstr_destroy(xfrom);
|
||||||
octstr_destroy(subject);
|
octstr_destroy(subject);
|
||||||
if (me)
|
if (me)
|
||||||
mime_entity_destroy(me);
|
mime_entity_destroy(me);
|
||||||
if (m)
|
|
||||||
mms_destroy(m);
|
|
||||||
if (xto)
|
|
||||||
gwlist_destroy(xto, (gwlist_item_destructor_t *)octstr_destroy);
|
|
||||||
if (hdrs)
|
|
||||||
http_destroy_headers(hdrs);
|
|
||||||
|
|
||||||
|
mms_destroy(m);
|
||||||
|
gwlist_destroy(xto, (gwlist_item_destructor_t *)octstr_destroy);
|
||||||
|
http_destroy_headers(hdrs);
|
||||||
octstr_destroy(xservice_code);
|
octstr_destroy(xservice_code);
|
||||||
octstr_destroy(hsvc_code);
|
octstr_destroy(hsvc_code);
|
||||||
|
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1134,7 +1126,7 @@ static void sendmms_func(void *unused)
|
||||||
Octstr *err = NULL;
|
Octstr *err = NULL;
|
||||||
List *cgivar_ctypes = NULL;
|
List *cgivar_ctypes = NULL;
|
||||||
|
|
||||||
int tparse = parse_cgivars(h, body, &cgivars, &cgivar_ctypes);
|
int res = 0, tparse = parse_cgivars(h, body, &cgivars, &cgivar_ctypes);
|
||||||
|
|
||||||
username = http_cgi_variable(cgivars, "username");
|
username = http_cgi_variable(cgivars, "username");
|
||||||
password = http_cgi_variable(cgivars, "password");
|
password = http_cgi_variable(cgivars, "password");
|
||||||
|
@ -1145,7 +1137,7 @@ static void sendmms_func(void *unused)
|
||||||
Octstr *rr_url, *allow_adaptations, *subject = NULL;
|
Octstr *rr_url, *allow_adaptations, *subject = NULL;
|
||||||
List *lto = NULL, *rh = http_create_empty_headers();
|
List *lto = NULL, *rh = http_create_empty_headers();
|
||||||
Octstr *rb = NULL, *base_url;
|
Octstr *rb = NULL, *base_url;
|
||||||
int i, n, res = 0;
|
int i, n;
|
||||||
Octstr *vasid = http_cgi_variable(cgivars, "vasid");
|
Octstr *vasid = http_cgi_variable(cgivars, "vasid");
|
||||||
Octstr *service_code = http_cgi_variable(cgivars, "servicecode");
|
Octstr *service_code = http_cgi_variable(cgivars, "servicecode");
|
||||||
Octstr *mclass = http_cgi_variable(cgivars, "mclass");
|
Octstr *mclass = http_cgi_variable(cgivars, "mclass");
|
||||||
|
@ -1269,17 +1261,19 @@ static void sendmms_func(void *unused)
|
||||||
&err);
|
&err);
|
||||||
if (res < 0)
|
if (res < 0)
|
||||||
rb = octstr_format("Error in message conversion: %S", err);
|
rb = octstr_format("Error in message conversion: %S", err);
|
||||||
|
else
|
||||||
|
rb = octstr_format("Accepted: %S", err ? err : octstr_imm("1"));
|
||||||
} else if (!rb)
|
} else if (!rb)
|
||||||
rb = octstr_imm("Failed to send message");
|
rb = octstr_imm("Failed to send message");
|
||||||
http_send_reply(client, (res == 0) ? HTTP_OK : HTTP_BAD_REQUEST, hh,
|
http_send_reply(client, (res == 0) ? HTTP_OK : HTTP_BAD_REQUEST, hh,
|
||||||
rb ? rb : octstr_imm("Sent"));
|
rb ? rb : octstr_imm("Sent"));
|
||||||
info(0, "MMSBox.mmssend: u=%s, %s",
|
info(0, "MMSBox.mmssend: u=%s, %s [%s]",
|
||||||
u ? octstr_get_cstr(u->user) : "none",
|
u ? octstr_get_cstr(u->user) : "none",
|
||||||
(res == 0) ? "Sent" : "Not Sent");
|
(res == 0) ? "Queued" : "Not Queued",
|
||||||
|
rb ? octstr_get_cstr(rb) : "");
|
||||||
|
|
||||||
if (rh)
|
|
||||||
http_destroy_headers(rh);
|
|
||||||
|
|
||||||
|
http_destroy_headers(rh);
|
||||||
octstr_destroy(ctype);
|
octstr_destroy(ctype);
|
||||||
octstr_destroy(rb);
|
octstr_destroy(rb);
|
||||||
octstr_destroy(base_url);
|
octstr_destroy(base_url);
|
||||||
|
@ -1293,29 +1287,17 @@ static void sendmms_func(void *unused)
|
||||||
password ? octstr_get_cstr(password) : "(null)");
|
password ? octstr_get_cstr(password) : "(null)");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (err) {
|
if (err && res != 0)
|
||||||
error(0, "%s", octstr_get_cstr(err));
|
error(0, "%s", octstr_get_cstr(err));
|
||||||
octstr_destroy(err);
|
octstr_destroy(err);
|
||||||
}
|
|
||||||
|
|
||||||
/* Free the ip and other stuff here. */
|
/* Free the ip and other stuff here. */
|
||||||
octstr_destroy(ip);
|
octstr_destroy(ip);
|
||||||
if (body)
|
octstr_destroy(body);
|
||||||
octstr_destroy(body);
|
octstr_destroy(url);
|
||||||
if (url)
|
http_destroy_cgiargs(cgivars);
|
||||||
octstr_destroy(url);
|
http_destroy_cgiargs(cgivar_ctypes);
|
||||||
|
http_destroy_headers(h);
|
||||||
if (cgivars)
|
http_destroy_headers(hh);
|
||||||
http_destroy_cgiargs(cgivars);
|
|
||||||
|
|
||||||
if (cgivar_ctypes)
|
|
||||||
http_destroy_cgiargs(cgivar_ctypes);
|
|
||||||
|
|
||||||
if (h)
|
|
||||||
http_destroy_headers(h);
|
|
||||||
if (hh)
|
|
||||||
http_destroy_headers(hh);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue