提交 f1bca1a8 authored 作者: Michael Jerris's avatar Michael Jerris

fix info send/receive

git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@7202 d0543943-73ff-0310-b7d9-9358b9ac24b2
上级 4596cc2e
......@@ -760,7 +760,7 @@ static switch_status_t sofia_send_dtmf(switch_core_session_t *session, const swi
return switch_rtp_queue_rfc2833(tech_pvt->rtp_session, dtmf);
case DTMF_INFO:
snprintf(message, sizeof(message), "Signal=%c\r\nDuration=%d\r\n", dtmf->digit, dtmf->duration);
snprintf(message, sizeof(message), "Signal=%c\r\nDuration=%d\r\n", dtmf->digit, dtmf->duration / 8);
nua_info(tech_pvt->nh,
//NUTAG_WITH_THIS(tech_pvt->profile->nua),
SIPTAG_CONTENT_TYPE_STR("application/dtmf-relay"),
......
......@@ -2097,7 +2097,7 @@ void sofia_handle_sip_i_info(nua_t *nua, sofia_profile_t *profile, nua_handle_t
if (sip && sip->sip_content_type && sip->sip_content_type->c_type && sip->sip_content_type->c_subtype &&
sip->sip_payload && sip->sip_payload->pl_data) {
if (!strcasecmp(sip->sip_content_type->c_type, "dtmf") && !strcasecmp(sip->sip_content_type->c_subtype, "relay")) {
if (!strncasecmp(sip->sip_content_type->c_type, "application", 11) && !strcasecmp(sip->sip_content_type->c_subtype, "dtmf-relay")) {
/* Try and find signal information in the payload */
if ((signal_ptr = switch_stristr("Signal=", sip->sip_payload->pl_data))) {
/* move signal_ptr where we need it (right past Signal=) */
......@@ -2110,13 +2110,13 @@ void sofia_handle_sip_i_info(nua_t *nua, sofia_profile_t *profile, nua_handle_t
if ((signal_ptr = switch_stristr("Duration=", sip->sip_payload->pl_data))) {
int tmp;
signal_ptr += 8;
if ((tmp = atoi(signal_ptr)) < 0) {
signal_ptr += 9;
if ((tmp = atoi(signal_ptr)) <= 0) {
tmp = SWITCH_DEFAULT_DTMF_DURATION;
}
dtmf.duration = tmp;
dtmf.duration = tmp * 8;
}
} else if (!strcasecmp(sip->sip_content_type->c_type, "application") && !strcasecmp(sip->sip_content_type->c_subtype, "dtmf")) {
} else if (!strncasecmp(sip->sip_content_type->c_type, "application", 11) && !strcasecmp(sip->sip_content_type->c_subtype, "dtmf")) {
dtmf.digit = *sip->sip_payload->pl_data;
} else {
goto fail;
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论