From ac4def6cd879af324647e9f66df9b403126bc401 Mon Sep 17 00:00:00 2001 From: irungentoo Date: Thu, 26 Jun 2014 17:42:37 -0400 Subject: [PATCH] Fixed possible bug if more than one ringing msi packet was sent to us. --- toxav/msi.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/toxav/msi.c b/toxav/msi.c index 060e52a4..38ff4b41 100644 --- a/toxav/msi.c +++ b/toxav/msi.c @@ -1204,6 +1204,12 @@ int handle_recv_ringing ( MSISession *session, MSICall *call, MSIMessage *msg ) pthread_mutex_lock(&session->mutex); + if ( call->ringing_timer_id ) { + LOGGER_WARNING("Call already ringing"); + pthread_mutex_unlock(&session->mutex); + return 0; + } + LOGGER_DEBUG("Session: %p Handling 'ringing' on call: %s", session, call->id ); call->ringing_timer_id = event.timer_alloc ( handle_timeout, call, call->ringing_tout_ms );