MT#55283 support blob64

Change-Id: I18246c941f96761be5134538d0a7032b24b12e84
pull/2100/head
Richard Fuchs 1 month ago
parent c016e3cd89
commit 33e242b250

@ -1492,6 +1492,9 @@ const char *call_ng_main_flags(const ng_parser_t *parser, str *key, parser_arg v
case CSH_LOOKUP("blob"):
out->blob = s;
break;
case CSH_LOOKUP("blob64"):
out->blob64 = s;
break;
case CSH_LOOKUP("bundle"):
case CSH_LOOKUP("BUNDLE"):
return call_ng_flags_str_list(parser, value, call_ng_flags_bundle, out);

@ -1905,6 +1905,17 @@ const char *call_play_media_ng(ng_command_ctx_t *ctx) {
if (err)
return err;
g_autoptr(char) b64dec = NULL;
if (flags.blob64.len && !flags.blob.len) {
b64dec = g_malloc(flags.blob64.len * 3 / 4 + 3);
gint state = 0;
guint save = 0;
size_t out = g_base64_decode_step(flags.blob64.s, flags.blob64.len, (guchar *) b64dec, &state, &save);
flags.blob = STR_LEN(b64dec, out);
}
for (__auto_type l = monologues.head; l; l = l->next) {
struct call_monologue *monologue = l->data;

@ -2289,6 +2289,12 @@ Media files can be provided through one of these keys:
*ng* transport protocol, only very short files can be provided this way, and so this is primarily
useful for testing and debugging.
* `blob64`
Alternative to `blob` which expects a binary media file in base64 encoding.
This is useful for transports which don't natively support binary data
(e.g. JSON).
* `db-id`
Contains an integer. This requires the daemon to be configured for accessing a *MySQL* (or *MariaDB*)

@ -178,6 +178,7 @@ struct sdp_ng_flags {
str file;
str moh_file;
str blob;
str blob64;
str moh_blob;
long long db_id;
long long moh_db_id;

Loading…
Cancel
Save