From 540c2a91dafad0d100b9ab2909a30fd27d780556 Mon Sep 17 00:00:00 2001 From: Mathieu Rene Date: Fri, 10 Aug 2012 07:22:07 -0400 Subject: [PATCH] t38 --- src/mod/endpoints/mod_media_gateway/media_gateway.c | 9 +++++++++ src/mod/endpoints/mod_sofia/rtp.c | 9 ++++----- 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/src/mod/endpoints/mod_media_gateway/media_gateway.c b/src/mod/endpoints/mod_media_gateway/media_gateway.c index bd9401b419..3590762cb5 100644 --- a/src/mod/endpoints/mod_media_gateway/media_gateway.c +++ b/src/mod/endpoints/mod_media_gateway/media_gateway.c @@ -147,6 +147,10 @@ switch_status_t megaco_activate_termination(mg_termination_t *term) switch_core_session_receive_event(session, &var_event); + if (term->u.rtp.t38_options) { + switch_channel_set_private(channel, "t38_options", term->u.rtp.t38_options); + } + switch_core_session_rwunlock(session); switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Sent refresh to channel [%s], for termination [%s]\n", term->uuid, term->name); @@ -170,6 +174,11 @@ switch_status_t megaco_activate_termination(mg_termination_t *term) switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "Termination [%s] successfully instanciated as [%s] [%s]\n", term->name, dialstring, switch_core_session_get_uuid(session)); channel = switch_core_session_get_channel(session); switch_channel_set_private(channel, PVT_MG_TERM, term); + + if (term->u.rtp.t38_options) { + switch_channel_set_private(channel, "t38_options", term->u.rtp.t38_options); + } + switch_core_event_hook_add_recv_dtmf(session, mg_on_dtmf); if (term->type == MG_TERM_TDM) { diff --git a/src/mod/endpoints/mod_sofia/rtp.c b/src/mod/endpoints/mod_sofia/rtp.c index 279e5a5ac1..9f0bc0147f 100644 --- a/src/mod/endpoints/mod_sofia/rtp.c +++ b/src/mod/endpoints/mod_sofia/rtp.c @@ -40,7 +40,7 @@ #define kPTIME "ptime" #define kPT "pt" #define kRFC2833PT "rfc2833_pt" -#define kMODE "mode" +#define kMEDIATYPE "media_type" #define kRATE "rate" static struct { @@ -524,9 +524,8 @@ static switch_status_t channel_receive_event(switch_core_session_t *session, swi switch_rtp_set_telephony_event(tech_pvt->rtp_session, pt); } - if (compare_var(event, channel, kMODE)) { - const char *newmode = switch_channel_get_variable(channel, kMODE); - const char *mode = switch_channel_get_variable(channel, kMODE); + if (compare_var(event, channel, kMEDIATYPE)) { + const char *newmode = switch_channel_get_variable(channel, kMEDIATYPE); if (!strcmp(newmode, "image")) { switch_channel_set_variable(tech_pvt->channel, "has_t38", "true"); @@ -535,7 +534,7 @@ static switch_status_t channel_receive_event(switch_core_session_t *session, swi switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_INFO, "Got IMAGE description\n"); } - switch_channel_set_variable(channel, kMODE, newmode); + switch_channel_set_variable(channel, kMEDIATYPE, newmode); } } else {