Browse Source

MT#57977 store call_flags into Redis

Change-Id: I9c95cccbaacbe6da8363688acb913aa057ccf9b6
dzenichev/fictitious
Richard Fuchs 2 years ago
parent
commit
7fe1145b83
2 changed files with 12 additions and 0 deletions
  1. +3
    -0
      daemon/redis.c
  2. +9
    -0
      t/auto-daemon-tests-redis.pl

+ 3
- 0
daemon/redis.c View File

@ -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);


+ 9
- 0
t/auto-daemon-tests-redis.pl View File

@ -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//,


Loading…
Cancel
Save