add sip_liberal_dtmf chanvar and liberal-dtmf profile param to use the maximum methods of DTMF avoiding sticking to the spec which leads to incompatability

This commit is contained in:
Anthony Minessale committed 2011-06-23 17:57:10 -05:00
1 parent 982b7614b0
commit bc7cb400c0
4 files changed
+29 -3

No files matched your search

+2
View File
@@ -245,6 +245,7 @@ typedef enum {
PFLAG_RENEG_ON_HOLD,
PFLAG_RENEG_ON_REINVITE,
PFLAG_RTP_NOTIMER_DURING_BRIDGE,
PFLAG_LIBERAL_DTMF,
/* No new flags below this line */
PFLAG_MAX
} PFLAGS;
@@ -308,6 +309,7 @@ typedef enum {
TFLAG_JB_PAUSED,
TFLAG_3PCC_INVITE,
TFLAG_NOREPLY,
TFLAG_LIBERAL_DTMF,
/* No new flags below this line */
TFLAG_MAX
} TFLAGS;
+14 -1
View File
@@ -2624,6 +2624,12 @@ switch_status_t reconfig_sofia(sofia_profile_t *profile)
} else {
sofia_clear_pflag(profile, PFLAG_LOG_AUTH_FAIL);
}
} else if (!strcasecmp(var, "liberal-dtmf")) {
if (switch_true(val)) {
sofia_set_pflag(profile, PFLAG_LIBERAL_DTMF);
} else {
sofia_clear_pflag(profile, PFLAG_LIBERAL_DTMF);
}
} else if (!strcasecmp(var, "forward-unsolicited-mwi-notify")) {
if (switch_true(val)) {
sofia_set_pflag(profile, PFLAG_FORWARD_MWI_NOTIFY);
@@ -3310,6 +3316,12 @@ switch_status_t config_sofia(int reload, char *profile_name)
} else {
sofia_clear_pflag(profile, PFLAG_LOG_AUTH_FAIL);
}
} else if (!strcasecmp(var, "liberal-dtmf")) {
if (switch_true(val)) {
sofia_set_pflag(profile, PFLAG_LIBERAL_DTMF);
} else {
sofia_clear_pflag(profile, PFLAG_LIBERAL_DTMF);
}
} else if (!strcasecmp(var, "watchdog-enabled")) {
profile->watchdog_enabled = switch_true(val);
} else if (!strcasecmp(var, "watchdog-step-timeout")) {
@@ -6604,7 +6616,8 @@ void sofia_handle_sip_i_info(nua_t *nua, sofia_profile_t *profile, nua_handle_t
goto end;
}
if (dtmf.digit && tech_pvt->dtmf_type == DTMF_INFO) {
if (dtmf.digit && (tech_pvt->dtmf_type == DTMF_INFO ||
sofia_test_pflag(tech_pvt->profile, PFLAG_LIBERAL_DTMF) || sofia_test_flag(tech_pvt, TFLAG_LIBERAL_DTMF))) {
/* queue it up */
switch_channel_queue_dtmf(channel, &dtmf);
+8 -2
View File
@@ -308,7 +308,8 @@ static void generate_m(private_object_t *tech_pvt, char *buf, size_t buflen,
}
if (tech_pvt->dtmf_type == DTMF_2833 && tech_pvt->te > 95) {
if ((tech_pvt->dtmf_type == DTMF_2833 || sofia_test_pflag(tech_pvt->profile, PFLAG_LIBERAL_DTMF) || sofia_test_flag(tech_pvt, TFLAG_LIBERAL_DTMF))
&& tech_pvt->te > 95) {
switch_snprintf(buf + strlen(buf), buflen - strlen(buf), "a=rtpmap:%d telephone-event/8000\na=fmtp:%d 0-16\n", tech_pvt->te, tech_pvt->te);
}
@@ -510,7 +511,8 @@ void sofia_glue_set_local_sdp(private_object_t *tech_pvt, const char *ip, switch
}
if (tech_pvt->dtmf_type == DTMF_2833 && tech_pvt->te > 95) {
if ((tech_pvt->dtmf_type == DTMF_2833 || sofia_test_pflag(tech_pvt->profile, PFLAG_LIBERAL_DTMF) || sofia_test_flag(tech_pvt, TFLAG_LIBERAL_DTMF))
&& tech_pvt->te > 95) {
switch_snprintf(buf + strlen(buf), sizeof(buf) - strlen(buf), "a=rtpmap:%d telephone-event/8000\na=fmtp:%d 0-16\n", tech_pvt->te, tech_pvt->te);
}
if (!sofia_test_pflag(tech_pvt->profile, PFLAG_SUPPRESS_CNG) && tech_pvt->cng_pt && use_cng) {
@@ -2960,6 +2962,10 @@ switch_status_t sofia_glue_activate_rtp(private_object_t *tech_pvt, switch_rtp_f
sofia_set_flag_locked(tech_pvt, TFLAG_SECURE);
}
if ((var = switch_channel_get_variable(tech_pvt->channel, "sip_liberal_dtmf")) && switch_true(var)) {
sofia_set_flag_locked(tech_pvt, TFLAG_LIBERAL_DTMF);
}
if (switch_channel_test_flag(tech_pvt->channel, CF_PROXY_MODE)) {
status = SWITCH_STATUS_SUCCESS;
goto end;