|
|
|
|
@ -316,7 +316,7 @@ static med_entry_t *medredis_reply_to_entry(redisReply *reply, const char* cid,
|
|
|
|
|
uint8_t all_null = 1;
|
|
|
|
|
|
|
|
|
|
if (reply->elements != 9) {
|
|
|
|
|
L_ERROR("Invalid number of redis reply elements for acc record with cid '%s' and key '%s', expected 8, got %lu, trashing record\n",
|
|
|
|
|
L_ERROR("Invalid number of redis reply elements for acc record with cid '%s' and key '%s', expected 9, got %lu, trashing record\n",
|
|
|
|
|
cid, key, reply->elements);
|
|
|
|
|
medredis_remove_mappings(cid, key);
|
|
|
|
|
medredis_remove_entry(key);
|
|
|
|
|
@ -367,8 +367,13 @@ static med_entry_t *medredis_reply_to_entry(redisReply *reply, const char* cid,
|
|
|
|
|
}
|
|
|
|
|
medredis_check_reply_string(entry, reply, entry->src_leg, "src_leg", sizeof(entry->src_leg), 6, cid, key);
|
|
|
|
|
medredis_check_reply_string(entry, reply, entry->dst_leg, "dst_leg", sizeof(entry->dst_leg), 7, cid, key);
|
|
|
|
|
medredis_check_reply_string(entry, reply, entry->branch_id, "branch_id", sizeof(entry->branch_id), 8, cid, key);
|
|
|
|
|
|
|
|
|
|
if (reply->element[8]->type != REDIS_REPLY_STRING) {
|
|
|
|
|
L_DEBUG("Received Redis reply of cid '%s' using key '%s' doesn't have branch_id >>> old acc record version\n", cid, key);
|
|
|
|
|
g_strlcpy(entry->branch_id, "", sizeof(entry->branch_id));
|
|
|
|
|
} else {
|
|
|
|
|
medredis_check_reply_string(entry, reply, entry->branch_id, "branch_id", sizeof(entry->branch_id), 8, cid, key);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
L_DEBUG("Converted record with cid '%s' and method '%s'\n", entry->callid, entry->sip_method);
|
|
|
|
|
|
|
|
|
|
return entry;
|
|
|
|
|
@ -802,7 +807,13 @@ static int medredis_cleanup_entries(med_entry_t *records, uint64_t count, const
|
|
|
|
|
if (!e->redis)
|
|
|
|
|
continue;
|
|
|
|
|
|
|
|
|
|
snprintf(buffer, sizeof(buffer), "acc:entry::%s:%f:%s", e->callid, e->unix_timestamp, e->branch_id);
|
|
|
|
|
if (strlen(e->branch_id) == 0) {
|
|
|
|
|
// Old ACC record version: it doesn't have branch_id
|
|
|
|
|
snprintf(buffer, sizeof(buffer), "acc:entry::%s:%f", e->callid, e->unix_timestamp);
|
|
|
|
|
}
|
|
|
|
|
else {
|
|
|
|
|
snprintf(buffer, sizeof(buffer), "acc:entry::%s:%f:%s", e->callid, e->unix_timestamp, e->branch_id);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
L_DEBUG("Cleaning up redis entry for %s\n", buffer);
|
|
|
|
|
if (medredis_remove_mappings(e->callid, buffer) != 0) {
|
|
|
|
|
|