Skip to content

Commit

Permalink
b2b_logic: ignore replies to NOTIFYs sent while bridging
Browse files Browse the repository at this point in the history
This will get rid of the races between the processing of the replies for the
NOTIFY and the subsequent BYE sent to the bridge initiator. The entity
might be already deleted as a result of handling the 200 OK for the BYE
before we try to do a lookup again for handling the NOTIFY reply. These
races would not produce any significant negative effects but OpenSIPS
would log unnecessary 'No b2b_key match found' errors.

(cherry picked from commit a72cfbe)
  • Loading branch information
rvlad-patrascu committed Mar 30, 2023
1 parent 9f5e437 commit b17e4fe
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions modules/b2b_logic/logic.c
Original file line number Diff line number Diff line change
Expand Up @@ -626,6 +626,7 @@ int process_bridge_notify(b2bl_entity_id_t *entity, unsigned int hash_index, str
memset(&req_data, 0, sizeof(b2b_req_data_t));
PREP_REQ_DATA(entity);
req_data.method = &method_notify;
req_data.no_cb = 1;
req_data.client_headers = &entity->hdrs;
req_data.body = 0;
if (!msg) {
Expand Down Expand Up @@ -1490,10 +1491,6 @@ int _b2b_handle_reply(struct sip_msg *msg, b2bl_tuple_t *tuple,
statuscode);

/* if the scenario state is B2B_BRIDGING_STATE -> we should have a reply for INVITE */
/* extract the method from Cseq header */

if(method_value == METHOD_NOTIFY) goto done1; /* Silently ignore reply on NOTIFY */

if(method_value != METHOD_INVITE)
{
LM_ERR("Wrong scenario state [B2B_BRIDGING_STATE] for this"
Expand Down

0 comments on commit b17e4fe

Please sign in to comment.