Skip to content

Commit 2c0e549

Browse files
committed
b2b_entities: preserved leg index when answering call
Introduced in 862fa53, when the `pass-legs-upstream` flag was used and the call was answered by any other leg but the first one, the index of the leg has to be "preserved", otherwise the subsequent requests will contain index 1, not the actual index. (cherry picked from commit 73ef9dd)
1 parent e0511d4 commit 2c0e549

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

  • modules/b2b_entities

modules/b2b_entities/dlg.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3882,6 +3882,7 @@ void b2b_tm_cback(struct cell *t, b2b_table htable, struct tmcb_params *ps)
38823882
{
38833883
b2b_dlginfo_t dlginfo;
38843884
b2b_add_dlginfo_t add_infof= dlg->add_dlginfo;
3885+
int confirmed_leg_id = b2b_get_leg_index(dlg, &to_tag);
38853886

38863887
/* delete all and add the confirmed leg */
38873888
b2b_delete_legs(&dlg->legs);
@@ -3891,6 +3892,8 @@ void b2b_tm_cback(struct cell *t, b2b_table htable, struct tmcb_params *ps)
38913892
LM_ERR("Failed to add dialog leg\n");
38923893
goto error;
38933894
}
3895+
if (confirmed_leg_id >= 0)
3896+
leg->id = confirmed_leg_id;
38943897
dlg->tag[CALLEE_LEG] = leg->tag;
38953898
dlginfo.fromtag = to_tag;
38963899
dlginfo.callid = dlg->callid;

0 commit comments

Comments
 (0)