Skip to content

Commit

Permalink
b2b_logic: always terminate a bridge initiator
Browse files Browse the repository at this point in the history
Before this commit, only if the `notify` flag was used, the entity would
have been deleted.

(cherry picked from commit aff2d96)
  • Loading branch information
razvancrainea committed Oct 24, 2024
1 parent c2f1291 commit db624a1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
4 changes: 1 addition & 3 deletions modules/b2b_logic/bridging.c
Original file line number Diff line number Diff line change
Expand Up @@ -1117,9 +1117,7 @@ int b2b_script_bridge(struct sip_msg *msg, str *br_ent1_str, str *br_ent2_str,
goto done;
}

if ((params->flags & B2BL_BR_FLAG_NOTIFY ||
params->flags & B2BL_BR_FLAG_RETURN_AFTER_FAILURE) && entity)
tuple->bridge_initiator = entity;
tuple->bridge_initiator = entity;

cur_route_ctx.flags |= B2BL_RT_DO_UPDATE;

Expand Down
5 changes: 3 additions & 2 deletions modules/b2b_logic/logic.c
Original file line number Diff line number Diff line change
Expand Up @@ -905,9 +905,10 @@ int _b2b_handle_reply(struct sip_msg *msg, b2bl_tuple_t *tuple,
/* Reply from new bridge entity */
if(statuscode >= 200 &&
entity == (tuple->bridge_entities[2]?tuple->bridge_entities[2]:tuple->bridge_entities[1]) &&
tuple->bridge_flags & B2BL_BR_FLAG_NOTIFY && tuple->bridge_initiator != 0)
tuple->bridge_initiator != 0)
{
send_bridge_notify(tuple->bridge_initiator, cur_route_ctx.hash_index, msg);
if (tuple->bridge_flags & B2BL_BR_FLAG_NOTIFY)
send_bridge_notify(tuple->bridge_initiator, cur_route_ctx.hash_index, msg);
if(statuscode == 200 || !(tuple->bridge_flags & B2BL_BR_FLAG_RETURN_AFTER_FAILURE))
{
if (!(tuple->bridge_flags & B2BL_BR_FLAG_DONT_DELETE_BRIDGE_INITIATOR)) {
Expand Down

0 comments on commit db624a1

Please sign in to comment.