[commit] r7202 - freeswitch/trunk/src/mod/endpoints/mod_sofia
Author: mikej Date: Sun Jan 13 15:08:12 2008 New Revision: 7202 Modified: freeswitch/trunk/src/mod/endpoints/mod_sofia/mod_sofia.c freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia.c Log: fix info send/receive Modified: freeswitch/trunk/src/mod/endpoints/mod_sofia/mod_sofia.c ============================================================================== --- freeswitch/trunk/src/mod/endpoints/mod_sofia/mod_sofia.c (original) +++ freeswitch/trunk/src/mod/endpoints/mod_sofia/mod_sofia.c Sun Jan 13 15:08:12 2008 @@ -760,7 +760,7 @@ 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"), Modified: freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia.c ============================================================================== --- freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia.c (original) +++ freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia.c Sun Jan 13 15:08:12 2008 @@ -2097,7 +2097,7 @@ 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 @@ 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;
participants (1)
-
Freeswitch SVN