<h1>Project "FreeSWITCH Source" received a push.</h1>
<h2>branch: master updated</h2>
<pre>
via: f28c211c0c69c8f34a8c483cbb5de379a2b96b84 (commit)
from: e7acd4d138e0faa6b4a3cec1667015c430e8f3f6 (commit)
</pre>= COMMIT LOG ===========================================================
<div class="highlight"><pre>committer: Brian West
comments:
FS-3077
<span style="color: #000080; font-weight: bold">diff --git a/src/switch_ivr_async.c b/src/switch_ivr_async.c</span>
<span style="color: #000080; font-weight: bold">index be36013..3afbfb6 100644</span>
<span style="color: #A00000">--- a/src/switch_ivr_async.c</span>
<span style="color: #00A000">+++ b/src/switch_ivr_async.c</span>
<span style="color: #800080; font-weight: bold">@@ -3216,8 +3216,10 @@ static switch_status_t speech_on_dtmf(switch_core_session_t *session, const swit</span>
        switch_status_t status = SWITCH_STATUS_SUCCESS;
        switch_asr_flag_t flags = SWITCH_ASR_FLAG_NONE;
<span style="color: #A00000">-        if (switch_core_asr_feed_dtmf(sth->ah, dtmf, &flags) != SWITCH_STATUS_SUCCESS) {</span>
<span style="color: #A00000">-                switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "Error Feeding DTMF\n");</span>
<span style="color: #00A000">+        if (sth) {</span>
<span style="color: #00A000">+                if (switch_core_asr_feed_dtmf(sth->ah, dtmf, &flags) != SWITCH_STATUS_SUCCESS) {</span>
<span style="color: #00A000">+                        switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_ERROR, "Error Feeding DTMF\n");</span>
<span style="color: #00A000">+                }</span>
        }
        return status;
<span style="color: #800080; font-weight: bold">@@ -3231,6 +3233,7 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_stop_detect_speech(switch_core_sessio</span>
        switch_assert(channel != NULL);
        if ((sth = switch_channel_get_private(channel, SWITCH_SPEECH_KEY))) {
                switch_channel_set_private(channel, SWITCH_SPEECH_KEY, NULL);
<span style="color: #00A000">+                switch_core_event_hook_remove_recv_dtmf(session, speech_on_dtmf);</span>
                switch_core_media_bug_remove(session, &sth->bug);
                return SWITCH_STATUS_SUCCESS;
        }
<span style="color: #800080; font-weight: bold">@@ -3265,14 +3268,13 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_resume_detect_speech(switch_core_sess</span>
SWITCH_DECLARE(switch_status_t) switch_ivr_detect_speech_load_grammar(switch_core_session_t *session, char *grammar, char *name)
{
        switch_channel_t *channel = switch_core_session_get_channel(session);
<span style="color: #A00000">-        switch_asr_flag_t flags = SWITCH_ASR_FLAG_NONE;</span>
        struct speech_thread_handle *sth = switch_channel_get_private(channel, SWITCH_SPEECH_KEY);
        switch_status_t status;
        if (sth) {
                if ((status = switch_core_asr_load_grammar(sth->ah, grammar, name)) != SWITCH_STATUS_SUCCESS) {
                        switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "Error loading Grammar\n");
<span style="color: #A00000">-                        switch_core_asr_close(sth->ah, &flags);</span>
<span style="color: #00A000">+                        switch_ivr_stop_detect_speech(session);</span>
                }
                return status;
        }
<span style="color: #800080; font-weight: bold">@@ -3307,14 +3309,13 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_detect_speech_start_input_timers(swit</span>
SWITCH_DECLARE(switch_status_t) switch_ivr_detect_speech_unload_grammar(switch_core_session_t *session, const char *name)
{
        switch_channel_t *channel = switch_core_session_get_channel(session);
<span style="color: #A00000">-        switch_asr_flag_t flags = SWITCH_ASR_FLAG_NONE;</span>
        struct speech_thread_handle *sth = switch_channel_get_private(channel, SWITCH_SPEECH_KEY);
        switch_status_t status;
        if (sth) {
                if ((status = switch_core_asr_unload_grammar(sth->ah, name)) != SWITCH_STATUS_SUCCESS) {
                        switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "Error unloading Grammar\n");
<span style="color: #A00000">-                        switch_core_asr_close(sth->ah, &flags);</span>
<span style="color: #00A000">+                        switch_ivr_stop_detect_speech(session);</span>
                }
                return status;
        }
<span style="color: #800080; font-weight: bold">@@ -3324,14 +3325,13 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_detect_speech_unload_grammar(switch_c</span>
SWITCH_DECLARE(switch_status_t) switch_ivr_detect_speech_enable_grammar(switch_core_session_t *session, const char *name)
{
        switch_channel_t *channel = switch_core_session_get_channel(session);
<span style="color: #A00000">-        switch_asr_flag_t flags = SWITCH_ASR_FLAG_NONE;</span>
        struct speech_thread_handle *sth = switch_channel_get_private(channel, SWITCH_SPEECH_KEY);
        switch_status_t status;
        if (sth) {
                if ((status = switch_core_asr_enable_grammar(sth->ah, name)) != SWITCH_STATUS_SUCCESS) {
                        switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "Error enabling Grammar\n");
<span style="color: #A00000">-                        switch_core_asr_close(sth->ah, &flags);</span>
<span style="color: #00A000">+                        switch_ivr_stop_detect_speech(session);</span>
                }
                return status;
        }
<span style="color: #800080; font-weight: bold">@@ -3341,14 +3341,13 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_detect_speech_enable_grammar(switch_c</span>
SWITCH_DECLARE(switch_status_t) switch_ivr_detect_speech_disable_grammar(switch_core_session_t *session, const char *name)
{
        switch_channel_t *channel = switch_core_session_get_channel(session);
<span style="color: #A00000">-        switch_asr_flag_t flags = SWITCH_ASR_FLAG_NONE;</span>
        struct speech_thread_handle *sth = switch_channel_get_private(channel, SWITCH_SPEECH_KEY);
        switch_status_t status;
        if (sth) {
                if ((status = switch_core_asr_disable_grammar(sth->ah, name)) != SWITCH_STATUS_SUCCESS) {
                        switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "Error disabling Grammar\n");
<span style="color: #A00000">-                        switch_core_asr_close(sth->ah, &flags);</span>
<span style="color: #00A000">+                        switch_ivr_stop_detect_speech(session);</span>
                }
                return status;
        }
<span style="color: #800080; font-weight: bold">@@ -3358,14 +3357,13 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_detect_speech_disable_grammar(switch_</span>
SWITCH_DECLARE(switch_status_t) switch_ivr_detect_speech_disable_all_grammars(switch_core_session_t *session)
{
        switch_channel_t *channel = switch_core_session_get_channel(session);
<span style="color: #A00000">-        switch_asr_flag_t flags = SWITCH_ASR_FLAG_NONE;</span>
        struct speech_thread_handle *sth = switch_channel_get_private(channel, SWITCH_SPEECH_KEY);
        switch_status_t status;
        if (sth) {
                if ((status = switch_core_asr_disable_all_grammars(sth->ah)) != SWITCH_STATUS_SUCCESS) {
                        switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "Error disabling all Grammars\n");
<span style="color: #A00000">-                        switch_core_asr_close(sth->ah, &flags);</span>
<span style="color: #00A000">+                        switch_ivr_stop_detect_speech(session);</span>
                }
                return status;
        }
<span style="color: #800080; font-weight: bold">@@ -3397,7 +3395,7 @@ SWITCH_DECLARE(switch_status_t) switch_ivr_detect_speech(switch_core_session_t *</span>
        if (sth) {
                if (switch_core_asr_load_grammar(sth->ah, grammar, name) != SWITCH_STATUS_SUCCESS) {
                        switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "Error loading Grammar\n");
<span style="color: #A00000">-                        switch_core_asr_close(sth->ah, &flags);</span>
<span style="color: #00A000">+                        switch_ivr_stop_detect_speech(session);</span>
                        return SWITCH_STATUS_FALSE;
                }
</pre></div>
========================================================================<pre>
Summary of changes:
src/switch_ivr_async.c | 24 +++++++++++-------------
1 files changed, 11 insertions(+), 13 deletions(-)
</pre>
<p>this email was generated because of /git/your-repo.git/hooks/post-receive by the file /git-core/contrib/hooks/post-receive-email<br />
For more info, see <a href="http://blog.chomperstomp.com/?p=630">http://blog.chomperstomp.com/?p=630</a>
-- <br />
FreeSWITCH Source</p>