]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
mod_sofia: Resolved issue #1547 - SIP INFO not working
authorMoises Silva <moy@sangoma.com>
Wed, 28 Sep 2011 15:56:19 +0000 (11:56 -0400)
committerMoises Silva <moy@sangoma.com>
Wed, 28 Sep 2011 16:14:37 +0000 (12:14 -0400)
           The dtmf_type member was incorrectly being set to NONE if the SDP
           does not advertise RFC2833 support (which has nothing to do with SIP INFO)

src/mod/endpoints/mod_sofia/mod_sofia.c
src/mod/endpoints/mod_sofia/sofia_glue.c

index 3165484b0e6c0a1fe84362a8f87b9f78d13e1145..2f78a4182b4fd14f2ec8170f5d8dc256dd6ef770 100644 (file)
@@ -1359,10 +1359,12 @@ static switch_status_t sofia_send_dtmf(switch_core_session_t *session, const swi
        switch (dtmf_type) {
        case DTMF_2833:
                {
+                       switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "Enqueuing RFC2833 DTMF %c of length %d\n", dtmf->digit, dtmf->duration);
                        return switch_rtp_queue_rfc2833(tech_pvt->rtp_session, dtmf);
                }
        case DTMF_INFO:
                {
+                       switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "Sending INFO DTMF %c of length %d\n", dtmf->digit, dtmf->duration);
                        snprintf(message, sizeof(message), "Signal=%c\r\nDuration=%d\r\n", dtmf->digit, dtmf->duration / 8);
                        switch_mutex_lock(tech_pvt->sofia_mutex);
                        nua_info(tech_pvt->nh, SIPTAG_CONTENT_TYPE_STR("application/dtmf-relay"), SIPTAG_PAYLOAD_STR(message), TAG_END());
@@ -1370,6 +1372,9 @@ static switch_status_t sofia_send_dtmf(switch_core_session_t *session, const swi
                }
                break;
        case DTMF_NONE:
+               {
+                       switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "Discarding DTMF %c of length %d, DTMF type is NONE\n", dtmf->digit, dtmf->duration);
+               }
                break;
        default:
                switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_WARNING, "Unhandled DTMF type!\n");
index 062da61a983ba8d535de3e47fc607ceb50a2c117..ae10ccc0aa0038219fbb7d5f645e32f404500dc4 100644 (file)
@@ -4847,10 +4847,12 @@ uint8_t sofia_glue_negotiate_sdp(switch_core_session_t *session, const char *r_s
                                        }
                                }
                        } else {
-                               switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "Disable 2833 dtmf\n");
-                               switch_channel_set_variable(tech_pvt->channel, "dtmf_type", "none");
-                               tech_pvt->dtmf_type = DTMF_NONE;
-                               te = tech_pvt->recv_te = 0;
+                               if (tech_pvt->dtmf_type == DTMF_2833) {
+                                       switch_log_printf(SWITCH_CHANNEL_SESSION_LOG(session), SWITCH_LOG_DEBUG, "Disable 2833 dtmf\n");
+                                       switch_channel_set_variable(tech_pvt->channel, "dtmf_type", "none");
+                                       tech_pvt->dtmf_type = DTMF_NONE;
+                                       te = tech_pvt->recv_te = 0;
+                               }
                        }