mirror of
https://github.com/signalwire/freeswitch.git
synced 2025-08-02 15:10:40 +00:00
fix info send/receive
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@7202 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
parent
4596cc2e4a
commit
f1bca1a83a
@ -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);
|
return switch_rtp_queue_rfc2833(tech_pvt->rtp_session, dtmf);
|
||||||
|
|
||||||
case DTMF_INFO:
|
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,
|
nua_info(tech_pvt->nh,
|
||||||
//NUTAG_WITH_THIS(tech_pvt->profile->nua),
|
//NUTAG_WITH_THIS(tech_pvt->profile->nua),
|
||||||
SIPTAG_CONTENT_TYPE_STR("application/dtmf-relay"),
|
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 &&
|
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) {
|
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 */
|
/* Try and find signal information in the payload */
|
||||||
if ((signal_ptr = switch_stristr("Signal=", sip->sip_payload->pl_data))) {
|
if ((signal_ptr = switch_stristr("Signal=", sip->sip_payload->pl_data))) {
|
||||||
/* move signal_ptr where we need it (right past Signal=) */
|
/* 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))) {
|
if ((signal_ptr = switch_stristr("Duration=", sip->sip_payload->pl_data))) {
|
||||||
int tmp;
|
int tmp;
|
||||||
signal_ptr += 8;
|
signal_ptr += 9;
|
||||||
if ((tmp = atoi(signal_ptr)) < 0) {
|
if ((tmp = atoi(signal_ptr)) <= 0) {
|
||||||
tmp = SWITCH_DEFAULT_DTMF_DURATION;
|
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;
|
dtmf.digit = *sip->sip_payload->pl_data;
|
||||||
} else {
|
} else {
|
||||||
goto fail;
|
goto fail;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user