]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
change logic to declinatio mortuus obfirmo
authorAnthony Minessale <anthony.minessale@gmail.com>
Fri, 13 Mar 2009 18:52:35 +0000 (18:52 +0000)
committerAnthony Minessale <anthony.minessale@gmail.com>
Fri, 13 Mar 2009 18:52:35 +0000 (18:52 +0000)
git-svn-id: http://svn.openzap.org/svn/openzap/trunk@698 a93c3328-9c30-0410-af19-c9cd2b2d52af

libs/openzap/src/include/openzap.h
libs/openzap/src/ozmod/ozmod_isdn/ozmod_isdn.c

index c85233a949ba8b6d81f16f32fa77a4a3185a94d5..3bb87a806d53639ab260be3ffbb0ceafc4cf3810 100644 (file)
@@ -712,6 +712,16 @@ static __inline__ void zap_set_flag_all(zap_span_t *span, uint32_t flag)
        zap_mutex_unlock(span->mutex);
 }
 
+static __inline__ void zap_clear_flag_all(zap_span_t *span, uint32_t flag)
+{
+       uint32_t j;
+       zap_mutex_lock(span->mutex);
+       for(j = 1; j <= span->chan_count; j++) {
+               zap_clear_flag_locked((span->channels[j]), flag);
+       }
+       zap_mutex_unlock(span->mutex);
+}
+
 #endif
 
 /* For Emacs:
index ec8e7cde6d17ce68a4405fa48f14226d53ee1ce9..f8bb7ef7a838676343710bf5aa5bad372bae9eff 100644 (file)
@@ -1387,16 +1387,14 @@ static __inline__ zap_status_t process_event(zap_span_t *span, zap_event_t *even
                                        zap_set_state_locked(event->channel, ZAP_CHANNEL_STATE_RESTART);
                                }
                        }
-
-                       if (event->channel->type == ZAP_CHAN_TYPE_DQ921) {
-                               zap_log(ZAP_LOG_WARNING, "Stopping ISDN for span %s\n", span->name);
-                               span->stop(span);
-                       }
+                       
 
                        zap_set_flag(event->channel, ZAP_CHANNEL_SUSPENDED);
+
+                       
                        zap_channel_get_alarms(event->channel);
                        isdn_data->sig_cb(&sig);
-                       zap_log(ZAP_LOG_WARNING, "channel %d:%d (%d:%d) has alarms [%s]\n", 
+                       zap_log(ZAP_LOG_WARNING, "channel %d:%d (%d:%d) has alarms! [%s]\n", 
                                        event->channel->span_id, event->channel->chan_id, 
                                        event->channel->physical_span_id, event->channel->physical_chan_id, 
                                        event->channel->last_error);
@@ -1404,11 +1402,9 @@ static __inline__ zap_status_t process_event(zap_span_t *span, zap_event_t *even
                break;
        case ZAP_OOB_ALARM_CLEAR:
                {
-
-                       if (event->channel->type == ZAP_CHAN_TYPE_DQ921) {
-                               zap_log(ZAP_LOG_WARNING, "Resuming ISDN for span %s\n", span->name);
-                               span->start(span);
-                       }
+                       
+                       zap_log(ZAP_LOG_WARNING, "channel %d:%d (%d:%d) alarms Cleared!\n", event->channel->span_id, event->channel->chan_id,
+                                       event->channel->physical_span_id, event->channel->physical_chan_id);
 
                        sig.event_id = ZAP_OOB_ALARM_CLEAR;
                        zap_clear_flag(event->channel, ZAP_CHANNEL_SUSPENDED);
@@ -1705,6 +1701,10 @@ static void *zap_isdn_run(zap_thread_t *me, void *obj)
                        {
                                errs = 0;
                                if (flags & ZAP_READ) {
+
+                                       if (zap_test_flag(isdn_data->dchan, ZAP_CHANNEL_SUSPENDED)) {
+                                               zap_clear_flag_all(span, ZAP_CHANNEL_SUSPENDED);
+                                       }
                                        len = sizeof(frame);
                                        if (zap_channel_read(isdn_data->dchan, frame, &len) == ZAP_SUCCESS) {
 #ifdef IODEBUG