From e3a62ffecfb55e14fdc3f73b4d5803396b333ee5 Mon Sep 17 00:00:00 2001 From: Moises Silva Date: Sat, 15 Aug 2009 19:15:49 +0000 Subject: [PATCH] small fix to avoid annoying veto warning when trying to move state from PROGRESS_MEDIA to PROGRESS git-svn-id: http://svn.openzap.org/svn/openzap/trunk@794 a93c3328-9c30-0410-af19-c9cd2b2d52af --- libs/openzap/src/ozmod/ozmod_libpri/ozmod_libpri.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/libs/openzap/src/ozmod/ozmod_libpri/ozmod_libpri.c b/libs/openzap/src/ozmod/ozmod_libpri/ozmod_libpri.c index 195af19ed9..b15f2dfac7 100644 --- a/libs/openzap/src/ozmod/ozmod_libpri/ozmod_libpri.c +++ b/libs/openzap/src/ozmod/ozmod_libpri/ozmod_libpri.c @@ -726,6 +726,11 @@ static int on_ringing(lpwrap_pri_t *spri, lpwrap_pri_event_t event_type, pri_eve if (zchan) { zap_log(ZAP_LOG_DEBUG, "-- Ringing on channel %d:%d\n", spri->span->span_id, pevent->ringing.channel); + /* we may get on_ringing even when we're already in ZAP_CHANNEL_STATE_PROGRESS_MEDIA */ + if (zchan->state == ZAP_CHANNEL_STATE_PROGRESS_MEDIA) { + /* dont try to move to STATE_PROGRESS to avoid annoying veto warning */ + return 0; + } zap_set_state_locked(zchan, ZAP_CHANNEL_STATE_PROGRESS); } else { zap_log(ZAP_LOG_DEBUG, "-- Ringing on channel %d:%d %s but it's not in use?\n", spri->span->span_id,