Skip to content

Commit

Permalink
ims_dialog: bugfix for registering dialog callbacks
Browse files Browse the repository at this point in the history
- bugfix for registering dialog callbacks
- in Rx scenarios of parallel forking (several INVITEs with same CALLID
  and FROMTAG sent to PCSCF) and INVITE for orig and term handled in
  same PCSCF (means also INVITEs with identical  CALLID and FROMTAG) the wrong
  dialog is selected for registering the callback (i.e. the callback
  for sending STR) when 200OK from terminator is processed.
- Root cause is that dialog is searched with callid-fromtag-totag but at
  the time of dialog insertion (processing of INVITE) no totag is available.
- fix is to get ctx dialog at 200OK processing before suspending the
  transaction - save dialog until AAA is received - use this dialog for
  registering the STR callback.
  • Loading branch information
Peter Friedrich authored and henningw committed Mar 30, 2020
1 parent 974c50a commit e2a1b96
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 11 deletions.
9 changes: 2 additions & 7 deletions src/modules/ims_dialog/dlg_cb.c
Expand Up @@ -100,15 +100,10 @@ void destroy_dlg_callbacks(unsigned int types)
}
}

int register_dlgcb_nodlg(str *callid, str *ftag, str *ttag,
int types, dialog_cb f,

int register_dlgcb_nodlg(struct dlg_cell *dlg, int types, dialog_cb f,
void *param, param_free_cb ff )
{
struct dlg_cell *dlg;

unsigned int dir = DLG_DIR_NONE;
dlg = get_dlg(callid, ftag, ttag, &dir); //increments ref count!

if (!dlg) {
LM_ERR("Can't find dialog to register callback\n");
return -1;
Expand Down
5 changes: 2 additions & 3 deletions src/modules/ims_dialog/dlg_cb.h
Expand Up @@ -51,8 +51,7 @@ typedef void (param_free_cb) (void *param);
typedef int (*ims_register_dlgcb_f)(struct dlg_cell* dlg, int cb_types,
dialog_cb f, void *param, param_free_cb ff);

typedef int (*ims_register_dlgcb_nodlg_f)(str *callid, str *ftag, str *ttag,
int cb_types, dialog_cb f, void *param, param_free_cb ff);
typedef int (*ims_register_dlgcb_nodlg_f)(struct dlg_cell* dlg, int cb_types, dialog_cb f, void *param, param_free_cb ff);

/* method to set a variable within a dialog */
//typedef int (*set_dlg_variable_f)( struct dlg_cell* dlg,
Expand Down Expand Up @@ -103,7 +102,7 @@ void destroy_dlg_callbacks(unsigned int type);

void destroy_dlg_callbacks_list(struct dlg_callback *cb);

int register_dlgcb_nodlg(str *callid, str *ftag, str *ttag, int types, dialog_cb f, void *param, param_free_cb ff );
int register_dlgcb_nodlg(struct dlg_cell* dlg, int types, dialog_cb f, void *param, param_free_cb ff);
int register_dlgcb( struct dlg_cell* dlg, int types, dialog_cb f, void *param, param_free_cb ff);

void run_create_callbacks(struct dlg_cell *dlg, struct sip_msg *msg);
Expand Down
1 change: 0 additions & 1 deletion src/modules/ims_dialog/dlg_handlers.c
Expand Up @@ -1965,4 +1965,3 @@ struct dlg_cell *dlg_get_msg_dialog(sip_msg_t *msg) {
return dlg;
}


0 comments on commit e2a1b96

Please sign in to comment.