Skip to content

Commit

Permalink
pua_dialoginfo: do not blindly load all dialogs
Browse files Browse the repository at this point in the history
 - only dialogs with "dlg_peer" vals should be registered for callbacks
  • Loading branch information
ovidiusas committed Nov 28, 2013
1 parent 25289f0 commit c631abc
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions modules/pua_dialoginfo/pua_dialoginfo.c
Expand Up @@ -400,13 +400,16 @@ __dialog_sendpublish(struct dlg_cell *dlg, int type, struct dlg_cb_params *_para
static void
__dialog_loaded(struct dlg_cell *dlg, int type, struct dlg_cb_params *_params)
{
/* register dialog callbacks which triggers sending PUBLISH */
if (dlg_api.register_dlgcb(dlg,
DLGCB_FAILED| DLGCB_CONFIRMED | DLGCB_TERMINATED | DLGCB_EXPIRED |
DLGCB_RESPONSE_WITHIN | DLGCB_EARLY,
__dialog_sendpublish, 0, 0) != 0) {
LM_ERR("cannot register callback for interesting dialog types\n");
}
str peer_uri= {0, 0};
if(dlg_api.fetch_dlg_value(dlg, &peer_dlg_var, &peer_uri, 1)==0 && peer_uri.len!=0) {
/* register dialog callbacks which triggers sending PUBLISH */
if (dlg_api.register_dlgcb(dlg,
DLGCB_FAILED| DLGCB_CONFIRMED | DLGCB_TERMINATED | DLGCB_EXPIRED |
DLGCB_RESPONSE_WITHIN | DLGCB_EARLY,
__dialog_sendpublish, 0, 0) != 0) {
LM_ERR("cannot register callback for interesting dialog types\n");
}
}
}


Expand Down

0 comments on commit c631abc

Please sign in to comment.