From 49b5b251baf3863501bb94f8d72f118c12097899 Mon Sep 17 00:00:00 2001 From: Anthony Minessale Date: Tue, 26 Jun 2007 01:02:36 +0000 Subject: [PATCH] update git-svn-id: http://svn.openzap.org/svn/openzap/trunk@294 a93c3328-9c30-0410-af19-c9cd2b2d52af --- libs/freetdm/src/zap_isdn.c | 47 ++++++++++++++++++++++--------------- 1 file changed, 28 insertions(+), 19 deletions(-) diff --git a/libs/freetdm/src/zap_isdn.c b/libs/freetdm/src/zap_isdn.c index af4f89d41f..800627d6a2 100644 --- a/libs/freetdm/src/zap_isdn.c +++ b/libs/freetdm/src/zap_isdn.c @@ -88,29 +88,38 @@ static L3INT zap_isdn_931_34(void *pvt, L2UCHAR *msg, L2INT mlen) if (zchan) { switch (changestatus->NewStatus) { case 0: /* change status to "in service" */ - zap_clear_flag_locked(zchan, ZAP_CHANNEL_SUSPENDED); - zap_log(ZAP_LOG_DEBUG, "Channel %d:%d in service\n", zchan->span_id, zchan->chan_id); - switch(zchan->state) { - case ZAP_CHANNEL_STATE_UP: - case ZAP_CHANNEL_STATE_IDLE: - zap_set_state_locked(zchan, ZAP_CHANNEL_STATE_TERMINATING); - break; - case ZAP_CHANNEL_STATE_DOWN: - break; - default: - zap_set_state_locked(zchan, ZAP_CHANNEL_STATE_DOWN); - break; + { + zap_clear_flag_locked(zchan, ZAP_CHANNEL_SUSPENDED); + zap_log(ZAP_LOG_DEBUG, "Channel %d:%d in service\n", zchan->span_id, zchan->chan_id); + switch(zchan->state) { + case ZAP_CHANNEL_STATE_UP: + case ZAP_CHANNEL_STATE_IDLE: + zap_set_state_locked(zchan, ZAP_CHANNEL_STATE_TERMINATING); + break; + case ZAP_CHANNEL_STATE_DOWN: + break; + default: + zap_set_state_locked(zchan, ZAP_CHANNEL_STATE_DOWN); + break; + } } - case 1: /* change status to "maintenance" */ - zap_set_flag_locked(zchan, ZAP_CHANNEL_SUSPENDED); - zap_set_state_locked(zchan, ZAP_CHANNEL_STATE_SUSPENDED); break; - case 2: /* change status to "out of service" */ - zap_set_flag_locked(zchan, ZAP_CHANNEL_SUSPENDED); - zap_set_state_locked(zchan, ZAP_CHANNEL_STATE_SUSPENDED); + case 1: + { /* change status to "maintenance" */ + zap_set_flag_locked(zchan, ZAP_CHANNEL_SUSPENDED); + zap_set_state_locked(zchan, ZAP_CHANNEL_STATE_SUSPENDED); + } + break; + case 2: + { /* change status to "out of service" */ + zap_set_flag_locked(zchan, ZAP_CHANNEL_SUSPENDED); + zap_set_state_locked(zchan, ZAP_CHANNEL_STATE_SUSPENDED); + } break; default: /* unknown */ - break; + { + break; + } } } }