}
} else if (!strcasecmp(var, "rfc2833-pt")) {
profile->te = (switch_payload_t) atoi(val);
- } else if (!strcasecmp(var, "cng-pt")) {
+ } else if (!strcasecmp(var, "cng-pt") && !(profile->pflags & PFLAG_SUPPRESS_CNG)) {
profile->cng_pt = (switch_payload_t) atoi(val);
} else if (!strcasecmp(var, "vad")) {
if (!strcasecmp(val, "in")) {
} else if (!strcasecmp(var, "supress-cng") || !strcasecmp(var, "suppress-cng")) {
if (switch_true(val)) {
profile->pflags |= PFLAG_SUPPRESS_CNG;
+ profile->cng_pt = 0;
} else {
profile->pflags &= ~PFLAG_SUPPRESS_CNG;
}
}
} else if (!strcasecmp(var, "rfc2833-pt")) {
profile->te = (switch_payload_t) atoi(val);
- } else if (!strcasecmp(var, "cng-pt")) {
+ } else if (!strcasecmp(var, "cng-pt") && !(profile->pflags & PFLAG_SUPPRESS_CNG)) {
profile->cng_pt = (switch_payload_t) atoi(val);
} else if (!strcasecmp(var, "sip-port")) {
profile->sip_port = atoi(val);
} else if (!strcasecmp(var, "supress-cng") || !strcasecmp(var, "suppress-cng")) {
if (switch_true(val)) {
profile->pflags |= PFLAG_SUPPRESS_CNG;
+ profile->cng_pt = 0;
}
} else if (!strcasecmp(var, "NDLB-to-in-200-contact")) {
if (switch_true(val)) {
switch_snprintf(buf + strlen(buf), sizeof(buf) - strlen(buf), " %d", tech_pvt->te);
}
- if (tech_pvt->cng_pt && use_cng) {
+ if (!(tech_pvt->profile->pflags & PFLAG_SUPPRESS_CNG) && tech_pvt->cng_pt && use_cng) {
switch_snprintf(buf + strlen(buf), sizeof(buf) - strlen(buf), " %d", tech_pvt->cng_pt);
}
if (tech_pvt->dtmf_type == DTMF_2833 && 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 (tech_pvt->cng_pt && use_cng) {
+ if (!(tech_pvt->profile->pflags & PFLAG_SUPPRESS_CNG) && tech_pvt->cng_pt && use_cng) {
switch_snprintf(buf + strlen(buf), sizeof(buf) - strlen(buf), "a=rtpmap:%d CN/8000\n", tech_pvt->cng_pt);
if (!tech_pvt->rm_encoding) {
tech_pvt->cng_pt = 0;
tech_pvt->dtmf_type = profile->dtmf_type;
- if (tech_pvt->bcng_pt) {
- tech_pvt->cng_pt = tech_pvt->bcng_pt;
- } else if (!tech_pvt->cng_pt) {
- tech_pvt->cng_pt = profile->cng_pt;
+ if (!(tech_pvt->profile->pflags & PFLAG_SUPPRESS_CNG)) {
+ if (tech_pvt->bcng_pt) {
+ tech_pvt->cng_pt = tech_pvt->bcng_pt;
+ } else if (!tech_pvt->cng_pt) {
+ tech_pvt->cng_pt = profile->cng_pt;
+ }
}
tech_pvt->session = session;
flags |= SWITCH_RTP_FLAG_RAW_WRITE;
}
- if (tech_pvt->cng_pt) {
+ if (tech_pvt->profile->pflags & PFLAG_SUPPRESS_CNG) {
+ tech_pvt->cng_pt = 0;
+ } else if (tech_pvt->cng_pt) {
flags |= SWITCH_RTP_FLAG_AUTO_CNG;
}
if (tech_pvt->te) {
switch_rtp_set_telephony_event(tech_pvt->rtp_session, tech_pvt->te);
}
- if (tech_pvt->cng_pt) {
+ if (tech_pvt->cng_pt && !(tech_pvt->profile->pflags & PFLAG_SUPPRESS_CNG)) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Set comfort noise payload to %u\n", tech_pvt->cng_pt);
switch_rtp_set_cng_pt(tech_pvt->rtp_session, tech_pvt->cng_pt);
}
}
}
- if (!cng_pt && !strcasecmp(rm_encoding, "CN")) {
+ if (!(tech_pvt->profile->pflags & PFLAG_SUPPRESS_CNG) && !cng_pt && !strcasecmp(rm_encoding, "CN")) {
cng_pt = tech_pvt->cng_pt = (switch_payload_t) map->rm_pt;
if (tech_pvt->rtp_session) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Set comfort noise payload to %u\n", cng_pt);