Skip to content

Commit

Permalink
b2b_entities: handle case where callback is not yet registered
Browse files Browse the repository at this point in the history
  • Loading branch information
razvancrainea committed Feb 20, 2024
1 parent 1bea6e1 commit 8c16de4
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions modules/b2b_entities/dlg.c
Original file line number Diff line number Diff line change
Expand Up @@ -1366,8 +1366,12 @@ int b2b_prescript_f(struct sip_msg *msg, void *uparam)
return SCB_DROP_MSG;
}
} else {
b2b_cback(msg, &b2b_key, B2B_REQUEST, logic_key.s?&logic_key:0,
dlg->param, b2b_cb_flags);
if (!b2b_cback)
LM_DBG("calback not yet registered for [%.*s]\n",
(logic_key.s?logic_key.len:0), (logic_key.s?logic_key.s:""));
else
b2b_cback(msg, &b2b_key, B2B_REQUEST, logic_key.s?&logic_key:0,
dlg->param, b2b_cb_flags);

if(logic_key.s)
pkg_free(logic_key.s);
Expand Down Expand Up @@ -3670,8 +3674,12 @@ void b2b_tm_cback(struct cell *t, b2b_table htable, struct tmcb_params *ps)
goto error1;
}
} else {
b2b_cback(msg, b2b_key, B2B_REPLY, logic_key.s?&logic_key:0,
b2b_param, b2b_cb_flags);
if (!b2b_cback)
LM_DBG("calback not yet registered for [%.*s]\n",
(logic_key.s?logic_key.len:0), (logic_key.s?logic_key.s:""));
else
b2b_cback(msg, b2b_key, B2B_REPLY, logic_key.s?&logic_key:0,
b2b_param, b2b_cb_flags);
if(logic_key.s)
{
pkg_free(logic_key.s);
Expand Down

0 comments on commit 8c16de4

Please sign in to comment.