openzap: callwaiting disable

This commit is contained in:
Moises Silva
2010-05-25 16:49:54 -04:00
parent 6c8f0d499f
commit e1b60b4ca3
4 changed files with 26 additions and 7 deletions

View File

@@ -1287,7 +1287,7 @@ OZ_DECLARE(zap_status_t) zap_channel_open(uint32_t span_id, uint32_t chan_id, za
zap_status_t status = ZAP_FAIL;
zap_span_t *span = NULL;
zap_mutex_unlock(globals.mutex);
zap_mutex_lock(globals.mutex);
zap_span_find(span_id, &span);
if (!span || !zap_test_flag(span, ZAP_SPAN_CONFIGURED) || chan_id >= ZAP_MAX_CHANNELS_SPAN) {
@@ -1313,11 +1313,12 @@ OZ_DECLARE(zap_status_t) zap_channel_open(uint32_t span_id, uint32_t chan_id, za
*zchan = NULL;
goto done;
}
status = ZAP_FAIL;
if (zap_test_flag(check, ZAP_CHANNEL_READY) && (!zap_test_flag(check, ZAP_CHANNEL_INUSE) ||
(check->type == ZAP_CHAN_TYPE_FXS && check->token_count == 1))) {
status = ZAP_FAIL;
if ((!zap_test_flag(check, ZAP_CHANNEL_INUSE)) ||
(check->type == ZAP_CHAN_TYPE_FXS &&
check->token_count == 1 &&
zap_channel_test_feature(check, ZAP_CHANNEL_FEATURE_CALLWAITING))) {
if (!zap_test_flag(check, ZAP_CHANNEL_OPEN)) {
status = check->zio->open(check);
if (status == ZAP_SUCCESS) {