]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
add execute_on_media_timeout var
authorAnthony Minessale <anthm@freeswitch.org>
Tue, 16 Oct 2012 16:48:16 +0000 (12:48 -0400)
committerAnthony Minessale <anthm@freeswitch.org>
Tue, 16 Oct 2012 16:48:16 +0000 (12:48 -0400)
src/mod/endpoints/mod_sofia/mod_sofia.c

index d3a8b8a104e6eef1a9d4c8fdfd390f427e3e5d14..939ced971a50d336800f7c1c90338860176b0eee 100644 (file)
@@ -1094,6 +1094,16 @@ static switch_status_t sofia_read_frame(switch_core_session_t *session, switch_f
                                                sofia_clear_flag_locked(tech_pvt, TFLAG_SIP_HOLD);
                                                switch_channel_clear_flag(channel, CF_LEG_HOLDING);
                                        }
+                                       
+                                       if (switch_channel_get_variable(tech_pvt->channel, "execute_on_media_timeout")) {
+                                               *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);
+                                               switch_channel_execute_on(tech_pvt->channel, "execute_on_media_timeout");
+                                               return SWITCH_STATUS_SUCCESS;
+                                       }
+
 
                                        switch_channel_hangup(tech_pvt->channel, SWITCH_CAUSE_MEDIA_TIMEOUT);
                                }