diff --git a/modules/b2b_entities/dlg.c b/modules/b2b_entities/dlg.c index 67e4858b2e..ce3927d7e0 100644 --- a/modules/b2b_entities/dlg.c +++ b/modules/b2b_entities/dlg.c @@ -2526,16 +2526,15 @@ void b2b_tm_cback(struct cell *t, b2b_table htable, struct tmcb_params *ps) if(leg) { LM_DBG("Found existing leg - Nothing to update\n"); - goto done; - } - - leg = b2b_add_leg(dlg, msg, &to_tag); - if(leg == NULL) - { - LM_ERR("Failed to add dialog leg\n"); - goto error; + } else { + leg = b2b_add_leg(dlg, msg, &to_tag); + if(leg == NULL) + { + LM_ERR("Failed to add dialog leg\n"); + goto error; + } + UPDATE_DBFLAG(dlg); } - UPDATE_DBFLAG(dlg); /* PRACK handling */ /* if the provisional reply contains a * Require: 100rel header -> send PRACK */