Skip to content

Commit

Permalink
dialog: setting dlg_flag parameter is no longer mandatory
Browse files Browse the repository at this point in the history
- dlg_manage() can be used to start tracking the dialog
- using flags can still be used, the parameter has to be set as well as
  the appropriate transaction flag
  • Loading branch information
miconda committed Oct 19, 2015
1 parent cc8ff05 commit 974abf6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 7 deletions.
5 changes: 1 addition & 4 deletions modules/dialog/dialog.c
Expand Up @@ -496,10 +496,7 @@ static int mod_init(void)
return -1;

/* param checkings */
if (dlg_flag==-1) {
LM_ERR("no dlg flag set!!\n");
return -1;
} else if (dlg_flag>MAX_FLAG) {
if (dlg_flag>MAX_FLAG) {
LM_ERR("invalid dlg flag %d!!\n",dlg_flag);
return -1;
}
Expand Down
6 changes: 3 additions & 3 deletions modules/dialog/dlg_handlers.c
Expand Up @@ -55,7 +55,7 @@
#include "dlg_var.h"

static str rr_param; /*!< record-route parameter for matching */
static int dlg_flag; /*!< flag for dialog tracking */
static int dlg_flag_mask=0; /*!< flag for dialog tracking */
static pv_spec_t *timeout_avp; /*!< AVP for timeout setting */
static int default_timeout; /*!< default dialog timeout */
static int seq_match_mode; /*!< dlg_match mode */
Expand Down Expand Up @@ -107,7 +107,7 @@ void init_dlg_handlers(char *rr_param_p, int dlg_flag_p,
rr_param.s = rr_param_p;
rr_param.len = strlen(rr_param.s);

dlg_flag = 1<<dlg_flag_p;
if(dlg_flag_p>=0) dlg_flag_mask = 1<<dlg_flag_p;

timeout_avp = timeout_avp_p;
default_timeout = default_timeout_p;
Expand Down Expand Up @@ -711,7 +711,7 @@ void dlg_onreq(struct cell* t, int type, struct tmcb_params *param)
}
}
if (dlg==NULL) {
if((req->flags&dlg_flag)!=dlg_flag)
if((req->flags&dlg_flag_mask)!=dlg_flag_mask)
return;
LM_DBG("dialog creation on config flag\n");
dlg_new_dialog(req, t, 1);
Expand Down

0 comments on commit 974abf6

Please sign in to comment.