]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
t38
authorMathieu Rene <mrene@avgs.ca>
Fri, 10 Aug 2012 11:22:07 +0000 (07:22 -0400)
committerMathieu Rene <mrene@avgs.ca>
Fri, 10 Aug 2012 11:22:07 +0000 (07:22 -0400)
src/mod/endpoints/mod_media_gateway/media_gateway.c
src/mod/endpoints/mod_sofia/rtp.c

index bd9401b419229c96f4bfb52d756cf0b1fb1cb792..3590762cb5d2fbd17dff7158ec6216189a92883c 100644 (file)
@@ -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) {
index 279e5a5ac157dbb0dd119b419b8d410c6225434b..9f0bc0147f6baf718872e638ae295227c7975819 100644 (file)
@@ -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 {