From 14519d193cabf300428fff7c51e264de76ead09e Mon Sep 17 00:00:00 2001 From: Anthony Minessale Date: Wed, 30 Apr 2008 15:17:55 +0000 Subject: [PATCH] fix some analog issues brought about by too much concentration on digital git-svn-id: http://svn.openzap.org/svn/openzap/trunk@465 a93c3328-9c30-0410-af19-c9cd2b2d52af --- libs/freetdm/.update | 2 +- libs/freetdm/mod_openzap/mod_openzap.c | 12 ++++-------- libs/freetdm/src/zap_analog.c | 6 ++---- 3 files changed, 7 insertions(+), 13 deletions(-) diff --git a/libs/freetdm/.update b/libs/freetdm/.update index 23063c4325..4ad7659099 100644 --- a/libs/freetdm/.update +++ b/libs/freetdm/.update @@ -1 +1 @@ -Fri Jan 25 19:07:34 EST 2008 +Wed Apr 30 10:51:26 EDT 2008 diff --git a/libs/freetdm/mod_openzap/mod_openzap.c b/libs/freetdm/mod_openzap/mod_openzap.c index eade1be790..c9469dbb96 100644 --- a/libs/freetdm/mod_openzap/mod_openzap.c +++ b/libs/freetdm/mod_openzap/mod_openzap.c @@ -159,16 +159,15 @@ static void stop_hold(const char *uuid) channel = switch_core_session_get_channel(session); switch_channel_stop_broadcast(channel); switch_channel_wait_for_flag(channel, CF_BROADCAST, SWITCH_FALSE, 2000); + switch_core_session_rwunlock(session); } } -static void start_hold(const char *uuid, const char *music) +static void start_hold(const char *uuid, const char *stream) { switch_core_session_t *session; switch_channel_t *channel; - const char *stream = NULL; - if (!uuid) { return; @@ -177,11 +176,8 @@ static void start_hold(const char *uuid, const char *music) if ((session = switch_core_session_locate(uuid))) { channel = switch_core_session_get_channel(session); - if (!(stream = switch_channel_get_variable(channel, SWITCH_HOLD_MUSIC_VARIABLE))) { - stream = music; - if (switch_strlen_zero(stream)) { - stream = globals.hold_music; - } + if (switch_strlen_zero(stream) && !(stream = switch_channel_get_variable(channel, SWITCH_HOLD_MUSIC_VARIABLE))) { + stream = globals.hold_music; } if (!switch_strlen_zero(stream)) { diff --git a/libs/freetdm/src/zap_analog.c b/libs/freetdm/src/zap_analog.c index 3b1246961b..40fb6977ff 100644 --- a/libs/freetdm/src/zap_analog.c +++ b/libs/freetdm/src/zap_analog.c @@ -416,7 +416,7 @@ static void *zap_analog_channel_run(zap_thread_t *me, void *obj) break; case ZAP_CHANNEL_STATE_DIALTONE: { - zap_channel_done(zchan); + memset(&zchan->caller_data, 0, sizeof(zchan->caller_data)); *dtmf = '\0'; dtmf_offset = 0; zap_buffer_zero(dt_buffer); @@ -447,7 +447,7 @@ static void *zap_analog_channel_run(zap_thread_t *me, void *obj) break; case ZAP_CHANNEL_STATE_GET_CALLERID: { - zap_channel_done(zchan); + memset(&zchan->caller_data, 0, sizeof(zchan->caller_data)); zap_channel_command(zchan, ZAP_COMMAND_ENABLE_CALLERID_DETECT, NULL); continue; } @@ -464,7 +464,6 @@ static void *zap_analog_channel_run(zap_thread_t *me, void *obj) { zchan->caller_data.hangup_cause = ZAP_CAUSE_NORMAL_CIRCUIT_CONGESTION; if (zap_test_flag(zchan, ZAP_CHANNEL_OFFHOOK) && !zap_test_flag(zchan, ZAP_CHANNEL_OUTBOUND)) { - zap_channel_done(zchan); zap_buffer_zero(dt_buffer); teletone_run(&ts, zchan->span->tone_map[ZAP_TONEMAP_BUSY]); indicate = 1; @@ -476,7 +475,6 @@ static void *zap_analog_channel_run(zap_thread_t *me, void *obj) case ZAP_CHANNEL_STATE_ATTN: { if (zap_test_flag(zchan, ZAP_CHANNEL_OFFHOOK) && !zap_test_flag(zchan, ZAP_CHANNEL_OUTBOUND)) { - zap_channel_done(zchan); zap_buffer_zero(dt_buffer); teletone_run(&ts, zchan->span->tone_map[ZAP_TONEMAP_ATTN]); indicate = 1;