]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
[mod_loopback] remember dtmf in channel var null_channel_dtmf_queued
authorSeven Du <dujinfang@gmail.com>
Tue, 19 Nov 2019 14:17:13 +0000 (22:17 +0800)
committerAndrey Volk <andywolk@gmail.com>
Mon, 30 Dec 2019 23:05:25 +0000 (03:05 +0400)
src/mod/endpoints/mod_loopback/mod_loopback.c

index cf52370aa8784e8fab64af80d3576bf63d442963..6e1d629abf14e4a457b97766d846bfb710dd9e16 100644 (file)
@@ -1461,10 +1461,16 @@ static switch_status_t null_channel_on_consume_media(switch_core_session_t *sess
 static switch_status_t null_channel_send_dtmf(switch_core_session_t *session, const switch_dtmf_t *dtmf)
 {
        null_private_t *tech_pvt = NULL;
+       switch_channel_t *channel = switch_core_session_get_channel(session);
+       const char *dtmf_str = switch_channel_get_variable(channel, "null_channel_dtmf_queued");
 
        tech_pvt = switch_core_session_get_private(session);
        switch_assert(tech_pvt != NULL);
 
+       if (!dtmf_str) dtmf_str = "";
+
+       switch_channel_set_variable_printf(channel, "null_channel_dtmf_queued", "%s%c", dtmf_str, dtmf->digit);
+
        return SWITCH_STATUS_SUCCESS;
 }