From a6fdb6610d46992e6882ae73381ccf6be24db968 Mon Sep 17 00:00:00 2001 From: Razvan Crainea Date: Thu, 5 Nov 2020 11:47:04 +0200 Subject: [PATCH] dialog: update contact & SDPs for replicated updates (cherry picked from commit 52e6c425b101ce56d7eb35cb413faacbb9309f1a) --- modules/dialog/dlg_replication.c | 29 ++++++++++++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) diff --git a/modules/dialog/dlg_replication.c b/modules/dialog/dlg_replication.c index 6d3f6f957e7..970c5ce49b6 100644 --- a/modules/dialog/dlg_replication.c +++ b/modules/dialog/dlg_replication.c @@ -365,7 +365,34 @@ int dlg_replicated_update(bin_packet_t *packet) goto error; } - bin_skip_str(packet, 12); + /* route set */ + bin_skip_str(packet, 2); + + /* sync caller and callee contact */ + bin_pop_str(packet, &st); + shm_str_sync(&dlg->legs[DLG_CALLER_LEG].contact, &st); + bin_pop_str(packet, &st); + shm_str_sync(&dlg->legs[callee_idx(dlg)].contact, &st); + + /* from & to URIs set */ + bin_skip_str(packet, 2); + + /* sync SDPs */ + bin_pop_str(packet, &st); + shm_str_sync(&dlg->legs[DLG_CALLER_LEG].in_sdp, &st); + bin_pop_str(packet, &st); + shm_str_sync(&dlg->legs[DLG_CALLER_LEG].out_sdp, &st); + bin_pop_str(packet, &st); + shm_str_sync(&dlg->legs[callee_idx(dlg)].in_sdp, &st); + bin_pop_str(packet, &st); + shm_str_sync(&dlg->legs[callee_idx(dlg)].out_sdp, &st); + + /* sync advertised caller and callee contacts */ + bin_pop_str(packet, &st); + shm_str_sync(&dlg->legs[DLG_CALLER_LEG].adv_contact, &st); + bin_pop_str(packet, &st); + shm_str_sync(&dlg->legs[callee_idx(dlg)].adv_contact, &st); + bin_pop_str(packet, &vars); bin_pop_str(packet, &profiles); bin_pop_int(packet, &dlg->user_flags);