]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
FS-4709 this is the right way to do this part
authorAnthony Minessale <anthm@freeswitch.org>
Tue, 26 Feb 2013 21:32:19 +0000 (15:32 -0600)
committerAnthony Minessale <anthm@freeswitch.org>
Tue, 26 Feb 2013 21:32:19 +0000 (15:32 -0600)
src/include/switch_channel.h
src/switch_channel.c

index 0f9d0f9b4c0a0849270387734d2be027d8da65c0..73eb7f102603c0d828a8857eaf68003a598bf2ec 100644 (file)
@@ -552,7 +552,7 @@ SWITCH_DECLARE(switch_status_t) switch_channel_dtmf_unlock(switch_channel_t *cha
   \param dtmf digit
   \return SWITCH_STATUS_SUCCESS if successful
 */
-SWITCH_DECLARE(switch_status_t) switch_channel_queue_dtmf(_In_ switch_channel_t *channel, _In_ switch_dtmf_t *dtmf);
+SWITCH_DECLARE(switch_status_t) switch_channel_queue_dtmf(_In_ switch_channel_t *channel, _In_ const switch_dtmf_t *dtmf);
 SWITCH_DECLARE(switch_status_t) switch_channel_queue_dtmf_string(_In_ switch_channel_t *channel, _In_ const char *dtmf_string);
 
 /*!
index 68aea4f4093126b07cd3827e6095ba445177f2f7..aa31df0ad379a2efbee349e36058296ca876ba88 100644 (file)
@@ -389,7 +389,7 @@ SWITCH_DECLARE(switch_size_t) switch_channel_has_dtmf(switch_channel_t *channel)
        return has;
 }
 
-SWITCH_DECLARE(switch_status_t) switch_channel_queue_dtmf(switch_channel_t *channel, switch_dtmf_t *dtmf)
+SWITCH_DECLARE(switch_status_t) switch_channel_queue_dtmf(switch_channel_t *channel, const switch_dtmf_t *dtmf)
 {
        switch_status_t status;
        void *pop;
@@ -398,13 +398,13 @@ SWITCH_DECLARE(switch_status_t) switch_channel_queue_dtmf(switch_channel_t *chan
 
        switch_assert(dtmf);
 
-       if (sensitive) {
-               switch_set_flag(dtmf, DTMF_FLAG_SENSITIVE);
-       }
-
        switch_mutex_lock(channel->dtmf_mutex);
        new_dtmf = *dtmf;
 
+       if (sensitive) {
+               switch_set_flag((&new_dtmf), DTMF_FLAG_SENSITIVE);
+       }
+
        if ((status = switch_core_session_recv_dtmf(channel->session, dtmf) != SWITCH_STATUS_SUCCESS)) {
                goto done;
        }