WSChannel* WSClientParser::CreateChannel(switch_core_session_t *session) { WSChannel *wsChannel = NULL; // 创建channel // switch_memory_pool_t *pool = switch_core_session_get_pool(session); wsChannel = (WSChannel *)switch_core_alloc(mpPool, sizeof(WSChannel)); wsChannel->session = session; wsChannel->parser = this; wsChannel->uuid_str = switch_core_strdup(mpPool, switch_core_session_get_uuid(session)); switch_log_printf( SWITCH_CHANNEL_UUID_LOG(this->GetUUID()), SWITCH_LOG_INFO, "WSClientParser::CreateChannel( " "this : %p, " "wsChannel : %p " ") \n", this, wsChannel ); if( InitChannel(wsChannel) ) { mpChannel = wsChannel; } else { DestroyChannel(wsChannel); } return wsChannel; }
//销毁频道对象 int32_t CChannelMgt::DestroyChannelByIndex(const ChannelIndex channelIndex) { ChannelPool::CIndex* pIndex = m_channelPool.GetIndex(channelIndex); if (NULL == pIndex) { return E_RS_CHANNELNOTEXIST; } return DestroyChannel(pIndex); }
void WSClientParser::DestroyCall() { switch_log_printf( SWITCH_CHANNEL_UUID_LOG(this->GetUUID()), SWITCH_LOG_INFO, "WSClientParser::DestroyCall( " "this : %p, " "mpChannel : %p " ") \n", this, mpChannel ); if( mpChannel ) { DestroyChannel(mpChannel); mpChannel = NULL; } }
void DestroyChannelConcrete() { DestroyChannel(); }