Skip to content

Commit

Permalink
Trigger exactly one callback per early state change.
Browse files Browse the repository at this point in the history
There are several reasons behind this change:
1) Other callbacks are only triggered once for each state change.
2) SNOM phones send several 180 Ringing messages in a row. That triggers
several early dialog callbacks, which in turn trigger several PUBLISH
and NOTIFY through the pua_dialoginfo module. This can potentially lead
to problems.
  • Loading branch information
dsandras committed Jul 25, 2013
1 parent fcc881e commit e82ac66
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions modules/dialog/dlg_handlers.c
Expand Up @@ -470,10 +470,9 @@ static void dlg_onreply(struct cell* t, int type, struct tmcb_params *param)

next_state_dlg( dlg, event, &old_state, &new_state, &unref);

if (new_state==DLG_STATE_EARLY) {
if (new_state==DLG_STATE_EARLY && old_state!=DLG_STATE_EARLY) {
run_dlg_callbacks(DLGCB_EARLY, dlg, rpl, DLG_DIR_UPSTREAM, 0);
if (old_state!=DLG_STATE_EARLY)
if_update_stat(dlg_enable_stats, early_dlgs, 1);
if_update_stat(dlg_enable_stats, early_dlgs, 1);
return;
}

Expand Down

0 comments on commit e82ac66

Please sign in to comment.