From 0992a2097168852945f51756d94f943eac5b6e1e Mon Sep 17 00:00:00 2001 From: Richard Fuchs Date: Wed, 1 Apr 2015 14:44:46 -0400 Subject: [PATCH] it's possible not to have any monologues - segfault fix --- daemon/call.c | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/daemon/call.c b/daemon/call.c index 307b9bfe9..b26380851 100644 --- a/daemon/call.c +++ b/daemon/call.c @@ -2528,15 +2528,17 @@ void call_destroy(struct call *c) { m->totalstats.total_managed_sess += 1; - ml = c->monologues->data; - if (ml->term_reason==TIMEOUT) { - m->totalstats.total_timeout_sess++; - } else if (ml->term_reason==SILENT_TIMEOUT) { - m->totalstats.total_silent_timeout_sess++; - } else if (ml->term_reason==REGULAR) { - m->totalstats.total_regular_term_sess++; - } else if (ml->term_reason==FORCED) { - m->totalstats.total_forced_term_sess++; + if (c->monologues) { + ml = c->monologues->data; + if (ml->term_reason==TIMEOUT) { + m->totalstats.total_timeout_sess++; + } else if (ml->term_reason==SILENT_TIMEOUT) { + m->totalstats.total_silent_timeout_sess++; + } else if (ml->term_reason==REGULAR) { + m->totalstats.total_regular_term_sess++; + } else if (ml->term_reason==FORCED) { + m->totalstats.total_forced_term_sess++; + } } timeval_multiply(&m->totalstats.total_average_call_dur,&m->totalstats.total_average_call_dur,m->totalstats.total_managed_sess-1);