Skip to content

Commit

Permalink
dialog: try to get a options/reinvite last direction
Browse files Browse the repository at this point in the history
Signed-off-by: Peter Lemenkov <lemenkov@gmail.com>
  • Loading branch information
lemenkov committed Sep 28, 2022
1 parent dd7edcd commit 7eb2c1c
Showing 1 changed file with 22 additions and 2 deletions.
24 changes: 22 additions & 2 deletions modules/dialog/dlg_timer.c
Original file line number Diff line number Diff line change
Expand Up @@ -840,7 +840,17 @@ void dlg_options_routine(unsigned int ticks , void * attr)
shm_free(it);
it = curr;

init_dlg_term_reason(dlg,"Ping Timeout",sizeof("Ping Timeout")-1);
if (dlg->legs[DLG_CALLER_LEG].reply_received == DLG_PING_FAIL)
init_dlg_term_reason(dlg,"Downstream Ping Timeout",sizeof("Downstream Ping Timeout")-1);
else if (dlg->legs[callee_idx(dlg)].reply_received == DLG_PING_FAIL)
init_dlg_term_reason(dlg,"Upstream Ping Timeout",sizeof("Upstream Ping Timeout")-1);
else{
LM_WARN("Ping Timeout: flags[%u] caller rr[%u] callee rr[%u]\n",
dlg->flags,
dlg->legs[DLG_CALLER_LEG].reply_received,
dlg->legs[callee_idx(dlg)].reply_received);
init_dlg_term_reason(dlg,"Ping Timeout",sizeof("Ping Timeout")-1);
}
/* FIXME - maybe better not to send BYE both ways as we know for
* sure one end in down . */
dlg_end_dlg(dlg,0,1);
Expand Down Expand Up @@ -937,7 +947,17 @@ void dlg_reinvite_routine(unsigned int ticks , void * attr)
shm_free(it);
it = curr;

init_dlg_term_reason(dlg,"ReINVITE Ping Timeout",sizeof("ReINVITE Ping Timeout")-1);
if (dlg->legs[DLG_CALLER_LEG].reinvite_confirmed == DLG_PING_FAIL)
init_dlg_term_reason(dlg,"Downstream ReINVITE Ping Timeout",sizeof("Downstream ReINVITE Ping Timeout")-1);
else if (dlg->legs[callee_idx(dlg)].reinvite_confirmed == DLG_PING_FAIL)
init_dlg_term_reason(dlg,"Upstream ReINVITE Ping Timeout",sizeof("Upstream ReINVITE Ping Timeout")-1);
else{
LM_WARN("Ping Timeout: flags[%u] caller rc[%u] callee rc[%u]\n",
dlg->flags,
dlg->legs[DLG_CALLER_LEG].reinvite_confirmed,
dlg->legs[callee_idx(dlg)].reinvite_confirmed);
init_dlg_term_reason(dlg,"ReINVITE Ping Timeout",sizeof("ReINVITE Ping Timeout")-1);
}
/* FIXME - maybe better not to send BYE both ways as we know for
* sure one end in down . */
dlg_end_dlg(dlg,0,1);
Expand Down

0 comments on commit 7eb2c1c

Please sign in to comment.