diff --git a/daemon/redis.c b/daemon/redis.c index 532d954ba..8cf19b4a3 100644 --- a/daemon/redis.c +++ b/daemon/redis.c @@ -2032,6 +2032,8 @@ static void json_restore_call(struct redis *r, const str *callid, bool foreign) c->block_dtmf = i; if (!redis_hash_get_int(&i, &call, "block_media")) c->block_media = i ? true : false; + if (!redis_hash_get_int(&i, &call, "call_flags")) + c->call_flags = i; err = "missing 'redis_hosted_db' value"; if (redis_hash_get_unsigned((unsigned int *) &c->redis_hosted_db, &call, "redis_hosted_db")) @@ -2356,6 +2358,7 @@ char* redis_encode_json(struct call *c) { JSON_SET_SIMPLE_STR("recording_metadata", &c->metadata); JSON_SET_SIMPLE("block_dtmf","%i", c->block_dtmf); JSON_SET_SIMPLE("block_media","%i", c->block_media); + JSON_SET_SIMPLE("call_flags","%i", c->call_flags); if ((rec = c->recording)) JSON_SET_SIMPLE_CSTR("recording_meta_prefix", rec->meta_prefix); diff --git a/t/auto-daemon-tests-redis.pl b/t/auto-daemon-tests-redis.pl index 3c052059f..50fe83da2 100755 --- a/t/auto-daemon-tests-redis.pl +++ b/t/auto-daemon-tests-redis.pl @@ -96,6 +96,7 @@ $json_exp = { 'json' => { 'block_dtmf' => '0', 'block_media' => '0', + 'call_flags' => 65536, 'created' => qr/^\d+$/, 'created_from' => qr//, 'created_from_addr' => qr//, @@ -356,6 +357,7 @@ $json_exp = { 'json' => { 'block_dtmf' => '0', 'block_media' => '0', + 'call_flags' => 1376256, 'created' => qr/^\d+$/, 'created_from' => qr//, 'created_from_addr' => qr//, @@ -621,6 +623,7 @@ $json_exp = { 'json' => { 'block_dtmf' => '0', 'block_media' => '0', + 'call_flags' => 65536, 'created' => qr/^\d+$/, 'created_from' => qr//, 'created_from_addr' => qr//, @@ -882,6 +885,7 @@ $json_exp = { 'json' => { 'block_dtmf' => '0', 'block_media' => '0', + 'call_flags' => 1376256, 'created' => qr/^\d+$/, 'created_from' => qr//, 'created_from_addr' => qr//, @@ -1145,6 +1149,7 @@ $json_exp = { 'json' => { 'block_dtmf' => '0', 'block_media' => '0', + 'call_flags' => 1376256, 'created' => qr/^\d+$/, 'created_from' => qr//, 'created_from_addr' => qr//, @@ -1640,6 +1645,7 @@ $json_exp = { 'json' => { 'block_dtmf' => '0', 'block_media' => '0', + 'call_flags' => 0, 'created' => qr//, 'created_from' => qr//, 'created_from_addr' => qr//, @@ -1784,6 +1790,7 @@ $json_exp = { 'json' => { 'block_dtmf' => '0', 'block_media' => '0', + 'call_flags' => 0, 'created' => qr//, 'created_from' => qr//, 'created_from_addr' => qr//, @@ -2025,6 +2032,7 @@ $json_exp = { 'json' => { 'block_dtmf' => '0', 'block_media' => '0', + 'call_flags' => 0, 'created' => qr//, 'created_from' => qr//, 'created_from_addr' => qr//, @@ -2265,6 +2273,7 @@ $json_exp = { 'json' => { 'block_dtmf' => '0', 'block_media' => '0', + 'call_flags' => 0, 'created' => qr//, 'created_from' => qr//, 'created_from_addr' => qr//,