static switch_status_t channel_on_destroy(switch_core_session_t *session)
{
- switch_channel_t *channel = NULL;
- private_t *tech_pvt = NULL;
+ //switch_channel_t *channel = NULL;
+ //private_t *tech_pvt = NULL;
- channel = switch_core_session_get_channel(session);
- assert(channel != NULL);
+ //channel = switch_core_session_get_channel(session);
+ //tech_pvt = switch_core_session_get_private(session);
- tech_pvt = switch_core_session_get_private(session);
- assert(tech_pvt != NULL);
return SWITCH_STATUS_SUCCESS;
}
struct private_object *tech_pvt = NULL;
tech_pvt = switch_core_session_get_private(session);
- switch_assert(tech_pvt != NULL);
- if (tech_pvt->rtp_session) {
- switch_rtp_destroy(&tech_pvt->rtp_session);
- switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "NUKE RTP\n");
- tech_pvt->rtp_session = NULL;
- }
+ if (tech_pvt) {
+ if (tech_pvt->rtp_session) {
+ switch_rtp_destroy(&tech_pvt->rtp_session);
+ switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "NUKE RTP\n");
+ tech_pvt->rtp_session = NULL;
+ }
- if (switch_core_codec_ready(&tech_pvt->read_codec)) {
- switch_core_codec_destroy(&tech_pvt->read_codec);
- }
+ if (switch_core_codec_ready(&tech_pvt->read_codec)) {
+ switch_core_codec_destroy(&tech_pvt->read_codec);
+ }
- if (switch_core_codec_ready(&tech_pvt->write_codec)) {
- switch_core_codec_destroy(&tech_pvt->write_codec);
+ if (switch_core_codec_ready(&tech_pvt->write_codec)) {
+ switch_core_codec_destroy(&tech_pvt->write_codec);
+ }
}
-
return SWITCH_STATUS_SUCCESS;
}
{
private_t *tech_pvt = switch_core_session_get_private(session);
- switch_assert(tech_pvt != NULL);
-
- if (switch_core_codec_ready(&tech_pvt->read_codec)) {
- switch_core_codec_destroy(&tech_pvt->read_codec);
- }
-
- if (!switch_core_codec_ready(&tech_pvt->write_codec)) {
- switch_core_codec_destroy(&tech_pvt->write_codec);
+ if (tech_pvt) {
+ if (switch_core_codec_ready(&tech_pvt->read_codec)) {
+ switch_core_codec_destroy(&tech_pvt->read_codec);
+ }
+
+ if (!switch_core_codec_ready(&tech_pvt->write_codec)) {
+ switch_core_codec_destroy(&tech_pvt->write_codec);
+ }
}
return SWITCH_STATUS_SUCCESS;
switch_assert(channel != NULL);
tech_pvt = switch_core_session_get_private(session);
- switch_assert(tech_pvt != NULL);
-
- switch_core_timer_destroy(&tech_pvt->timer);
- if (switch_core_codec_ready(&tech_pvt->read_codec)) {
- switch_core_codec_destroy(&tech_pvt->read_codec);
- }
-
- if (switch_core_codec_ready(&tech_pvt->write_codec)) {
- switch_core_codec_destroy(&tech_pvt->write_codec);
+ if (tech_pvt) {
+ switch_core_timer_destroy(&tech_pvt->timer);
+
+ if (switch_core_codec_ready(&tech_pvt->read_codec)) {
+ switch_core_codec_destroy(&tech_pvt->read_codec);
+ }
+
+ if (switch_core_codec_ready(&tech_pvt->write_codec)) {
+ switch_core_codec_destroy(&tech_pvt->write_codec);
+ }
}
\r
static switch_status_t on_destroy(switch_core_session_t *session)\r
{\r
- switch_channel_t *channel = switch_core_session_get_channel(session);\r
+ //switch_channel_t *channel = switch_core_session_get_channel(session);\r
opal_private_t *tech_pvt = (opal_private_t *) switch_core_session_get_private(session);\r
\r
- if (tech_pvt->read_codec.implementation) {\r
- switch_core_codec_destroy(&tech_pvt->read_codec);\r
- }\r
+ if (tech_pvt) {\r
+ if (tech_pvt->read_codec.implementation) {\r
+ switch_core_codec_destroy(&tech_pvt->read_codec);\r
+ }\r
\r
- if (tech_pvt->write_codec.implementation) {\r
- switch_core_codec_destroy(&tech_pvt->write_codec);\r
- }\r
+ if (tech_pvt->write_codec.implementation) {\r
+ switch_core_codec_destroy(&tech_pvt->write_codec);\r
+ }\r
\r
- if (tech_pvt->vid_read_codec.implementation) {\r
- switch_core_codec_destroy(&tech_pvt->vid_read_codec);\r
- }\r
+ if (tech_pvt->vid_read_codec.implementation) {\r
+ switch_core_codec_destroy(&tech_pvt->vid_read_codec);\r
+ }\r
\r
- if (tech_pvt->vid_write_codec.implementation) {\r
- switch_core_codec_destroy(&tech_pvt->vid_write_codec);\r
- }\r
+ if (tech_pvt->vid_write_codec.implementation) {\r
+ switch_core_codec_destroy(&tech_pvt->vid_write_codec);\r
+ }\r
\r
- if (tech_pvt->read_timer.timer_interface) {\r
- switch_core_timer_destroy(&tech_pvt->read_timer);\r
- }\r
+ if (tech_pvt->read_timer.timer_interface) {\r
+ switch_core_timer_destroy(&tech_pvt->read_timer);\r
+ }\r
\r
- if (tech_pvt->vid_read_timer.timer_interface) {\r
- switch_core_timer_destroy(&tech_pvt->vid_read_timer);\r
+ if (tech_pvt->vid_read_timer.timer_interface) {\r
+ switch_core_timer_destroy(&tech_pvt->vid_read_timer);\r
+ }\r
}\r
\r
- switch_core_session_unset_read_codec(session);\r
- switch_core_session_unset_write_codec(session);\r
- \r
return SWITCH_STATUS_SUCCESS;\r
-\r
}\r
\r
/* this function has to be called with the original session beause the FSConnection might already be destroyed and we \r
assert(channel != NULL);
tech_pvt = switch_core_session_get_private(session);
- assert(tech_pvt != NULL);
-
-
- if (switch_core_codec_ready(&tech_pvt->read_codec)) {
- switch_core_codec_destroy(&tech_pvt->read_codec);
- }
- if (switch_core_codec_ready(&tech_pvt->write_codec)) {
- switch_core_codec_destroy(&tech_pvt->write_codec);
+ if (tech_pvt) {
+ if (switch_core_codec_ready(&tech_pvt->read_codec)) {
+ switch_core_codec_destroy(&tech_pvt->read_codec);
+ }
+
+ if (switch_core_codec_ready(&tech_pvt->write_codec)) {
+ switch_core_codec_destroy(&tech_pvt->write_codec);
+ }
}
return SWITCH_STATUS_SUCCESS;
return SWITCH_STATUS_SUCCESS;
}
-static switch_status_t channel_on_hangup(switch_core_session_t * session)
+static switch_status_t channel_on_destroy(switch_core_session_t * session)
{
- switch_channel_t *channel = NULL;
+ //switch_channel_t *channel = NULL;
private_t *tech_pvt = NULL;
- channel = switch_core_session_get_channel(session);
- switch_assert(channel != NULL);
+ //channel = switch_core_session_get_channel(session);
+ //switch_assert(channel != NULL);
tech_pvt = switch_core_session_get_private(session);
- switch_assert(tech_pvt != NULL);
-
- if (switch_core_codec_ready(&tech_pvt->read_codec)) {
- switch_core_codec_destroy(&tech_pvt->read_codec);
- }
- if (switch_core_codec_ready(&tech_pvt->write_codec)) {
- switch_core_codec_destroy(&tech_pvt->write_codec);
+ if (tech_pvt) {
+ if (switch_core_codec_ready(&tech_pvt->read_codec)) {
+ switch_core_codec_destroy(&tech_pvt->read_codec);
+ }
+
+ if (switch_core_codec_ready(&tech_pvt->write_codec)) {
+ switch_core_codec_destroy(&tech_pvt->write_codec);
+ }
}
return SWITCH_STATUS_SUCCESS;
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "%s SOFIA DESTROY\n", switch_channel_get_name(channel));
- if (switch_core_codec_ready(&tech_pvt->read_codec)) {
- switch_core_codec_destroy(&tech_pvt->read_codec);
- }
-
- if (switch_core_codec_ready(&tech_pvt->write_codec)) {
- switch_core_codec_destroy(&tech_pvt->write_codec);
- }
+ if (tech_pvt) {
+ if (switch_core_codec_ready(&tech_pvt->read_codec)) {
+ switch_core_codec_destroy(&tech_pvt->read_codec);
+ }
+
+ if (switch_core_codec_ready(&tech_pvt->write_codec)) {
+ switch_core_codec_destroy(&tech_pvt->write_codec);
+ }
- switch_core_session_unset_read_codec(session);
- switch_core_session_unset_write_codec(session);
+ switch_core_session_unset_read_codec(session);
+ switch_core_session_unset_write_codec(session);
- switch_mutex_lock(tech_pvt->profile->flag_mutex);
- tech_pvt->profile->inuse--;
- switch_mutex_unlock(tech_pvt->profile->flag_mutex);
+ switch_mutex_lock(tech_pvt->profile->flag_mutex);
+ tech_pvt->profile->inuse--;
+ switch_mutex_unlock(tech_pvt->profile->flag_mutex);
- sofia_glue_deactivate_rtp(tech_pvt);
+ sofia_glue_deactivate_rtp(tech_pvt);
+ }
return SWITCH_STATUS_SUCCESS;
static switch_status_t unicall_on_destroy(switch_core_session_t *session)
{
- switch_channel_t *channel;
+ //switch_channel_t *channel;
private_t *tech_pvt;
- channel = switch_core_session_get_channel(session);
- assert(channel != NULL);
+ //channel = switch_core_session_get_channel(session);
+ //assert(channel != NULL);
+
tech_pvt = switch_core_session_get_private(session);
- assert(tech_pvt != NULL);
- if (switch_core_codec_ready(&tech_pvt->read_codec))
- switch_core_codec_destroy(&tech_pvt->read_codec);
- if (switch_core_codec_ready(&tech_pvt->write_codec))
- switch_core_codec_destroy(&tech_pvt->write_codec);
+ if (tech_pvt) {
+ if (switch_core_codec_ready(&tech_pvt->read_codec))
+ switch_core_codec_destroy(&tech_pvt->read_codec);
+ if (switch_core_codec_ready(&tech_pvt->write_codec))
+ switch_core_codec_destroy(&tech_pvt->write_codec);
+ }
return SWITCH_STATUS_SUCCESS;