From: Anthony Minessale Date: Fri, 12 Sep 2008 18:39:30 +0000 (+0000) Subject: protect the innocent X-Git-Tag: v1.0.6~38^2~317 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=fffbcd503e987e4a9c33a62b70b5b13914cfba72;p=thirdparty%2Ffreeswitch.git protect the innocent git-svn-id: http://svn.openzap.org/svn/openzap/trunk@556 a93c3328-9c30-0410-af19-c9cd2b2d52af --- diff --git a/libs/openzap/src/ozmod/ozmod_analog/ozmod_analog.c b/libs/openzap/src/ozmod/ozmod_analog/ozmod_analog.c index a17d70e85c..f6b0c75df7 100644 --- a/libs/openzap/src/ozmod/ozmod_analog/ozmod_analog.c +++ b/libs/openzap/src/ozmod/ozmod_analog/ozmod_analog.c @@ -719,6 +719,11 @@ static __inline__ zap_status_t process_event(zap_span_t *span, zap_event_t *even switch(event->enum_id) { case ZAP_OOB_RING_START: { + if (event->channel->type != ZAP_CHAN_TYPE_FXO) { + zap_log(ZAP_LOG_ERROR, "Cannot get a RING_START event on a non-fxo channel, please check your config.\n"); + zap_set_state_locked(event->channel, ZAP_CHANNEL_STATE_DOWN); + goto end; + } if (!event->channel->ring_count && (event->channel->state == ZAP_CHANNEL_STATE_DOWN && !zap_test_flag(event->channel, ZAP_CHANNEL_INTHREAD))) { zap_set_state_locked(event->channel, ZAP_CHANNEL_STATE_GET_CALLERID); event->channel->ring_count = 1; @@ -785,6 +790,9 @@ static __inline__ zap_status_t process_event(zap_span_t *span, zap_event_t *even } } } + + end: + if (locked) { zap_mutex_unlock(event->channel->mutex); }