]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
wait for it...
authorMathieu Rene <mrene@avgs.ca>
Fri, 10 Aug 2012 17:40:27 +0000 (13:40 -0400)
committerMathieu Rene <mrene@avgs.ca>
Fri, 10 Aug 2012 17:40:27 +0000 (13:40 -0400)
src/mod/endpoints/mod_media_gateway/media_gateway.c
src/mod/endpoints/mod_sofia/rtp.c

index 134b609a27334d681b569529802bd1834c4ccf65..3652946bceb2ac118dda84cd35e97857a4bb710c 100644 (file)
@@ -127,8 +127,8 @@ switch_status_t megaco_activate_termination(mg_termination_t *term)
         switch_event_add_header_string(var_event, SWITCH_STACK_BOTTOM, kCODEC, term->u.rtp.codec);
         
         switch_event_add_header_string(var_event, SWITCH_STACK_BOTTOM, kMEDIATYPE, mg_media_type2str(term->u.rtp.media_type));
-       switch_event_add_header_string(var_event, SWITCH_STACK_BOTTOM, "fax_enable_t38", "true");
-       switch_event_add_header_string(var_event, SWITCH_STACK_BOTTOM, "rtp_execute_on_image", "t38_gateway peer nocng");
+        switch_event_add_header_string(var_event, SWITCH_STACK_BOTTOM, "fax_enable_t38", "true");
+        switch_event_add_header_string(var_event, SWITCH_STACK_BOTTOM, "rtp_execute_on_image", "t38_gateway peer nocng");
     } else if (term->type == MG_TERM_TDM) {
         switch_snprintf(dialstring, sizeof dialstring, "tdm/%s", term->name);
         
@@ -143,14 +143,14 @@ switch_status_t megaco_activate_termination(mg_termination_t *term)
         /* A UUID is present, check if the channel still exists */
         switch_core_session_t *session;
         if ((session = switch_core_session_locate(term->uuid))) {
-           switch_channel_t *channel = switch_core_session_get_channel(session);
+            switch_channel_t *channel = switch_core_session_get_channel(session);
             switch_event_add_header_string(var_event, SWITCH_STACK_BOTTOM, "command", "media_modify");
             
-            switch_core_session_receive_event(session, &var_event);
-
-                       if (term->u.rtp.t38_options) {
+            if (term->u.rtp.t38_options) {
                                switch_channel_set_private(channel, "t38_options", term->u.rtp.t38_options);
                        }
+            
+            switch_core_session_receive_event(session, &var_event);
 
             switch_core_session_rwunlock(session);
             
index 4eb43b146c7c62d9daf5350afb533e800e32c325..d6284cc20a7fe4f6340884458e80e14de14eb9ed 100644 (file)
@@ -509,7 +509,7 @@ static switch_status_t channel_receive_event(switch_core_session_t *session, swi
        }
         
         if (compare_var(event, channel, kRFC2833PT)) {
-            const char *szpt = switch_channel_get_variable(channel, kRFC2833PT);
+            const char *szpt = switch_event_get_header(event, kRFC2833PT);
             int pt = !zstr(szpt) ? atoi(szpt) : 0;
 
                        tech_pvt->rfc2833_pt = pt;
@@ -525,7 +525,7 @@ static switch_status_t channel_receive_event(switch_core_session_t *session, swi
         }
 
        if (compare_var(event, channel, kMEDIATYPE)) {
-               const char *newmode = switch_channel_get_variable(channel, kMEDIATYPE);
+               const char *newmode = switch_event_get_header(event, kMEDIATYPE);
                
                if (!strcmp(newmode, "image")) {
                        switch_channel_set_variable(tech_pvt->channel, "has_t38", "true");