]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
fix seg related to ptime mismatch + CNG + PLC (if you ever get purple ptime mismatch...
authorAnthony Minessale <anthm@freeswitch.org>
Wed, 12 Jan 2011 22:05:08 +0000 (16:05 -0600)
committerAnthony Minessale <anthm@freeswitch.org>
Wed, 12 Jan 2011 22:05:08 +0000 (16:05 -0600)
src/mod/endpoints/mod_sofia/mod_sofia.c

index a0bcdbdbd1da56c6322fd20ee1cc66b1872e1003..85b233d5f30dd08a83d2ae94ddc69d2e102093be 100644 (file)
@@ -43,8 +43,6 @@ SWITCH_MODULE_DEFINITION(mod_sofia, mod_sofia_load, mod_sofia_shutdown, NULL);
 
 struct mod_sofia_globals mod_sofia_globals;
 switch_endpoint_interface_t *sofia_endpoint_interface;
-static switch_frame_t silence_frame = { 0 };
-static char silence_data[13] = "";
 
 #define STRLEN 15
 
@@ -1094,8 +1092,10 @@ static switch_status_t sofia_read_frame(switch_core_session_t *session, switch_f
                                                                                sofia_glue_do_invite(session);
                                                                        }
 #endif
-
-                                                                       *frame = &silence_frame;
+                                                                       *frame = &tech_pvt->read_frame;
+                                                                       switch_set_flag((*frame), SFF_CNG);
+                                                                       (*frame)->datalen = tech_pvt->read_impl.encoded_bytes_per_packet;
+                                                                       memset((*frame)->data, 0, (*frame)->datalen);
                                                                        return SWITCH_STATUS_SUCCESS;
                                                                }
 
@@ -4718,11 +4718,6 @@ SWITCH_MODULE_LOAD_FUNCTION(mod_sofia_load)
        switch_management_interface_t *management_interface;
        struct in_addr in;
 
-       silence_frame.data = silence_data;
-       silence_frame.datalen = sizeof(silence_data);
-       silence_frame.buflen = sizeof(silence_data);
-       silence_frame.flags = SFF_CNG;
-
        memset(&mod_sofia_globals, 0, sizeof(mod_sofia_globals));
        mod_sofia_globals.destroy_private.destroy_nh = 1;
        mod_sofia_globals.destroy_private.is_static = 1;