static apt_bool_t mrcp_server_agent_channel_remove(mrcp_connection_agent_t *agent, mrcp_control_channel_t *channel) { mrcp_connection_t *connection = channel->connection; mrcp_connection_channel_remove(connection,channel); apt_log(APT_LOG_MARK,APT_PRIO_INFO,"Remove Control Channel <%s> [%d]", channel->identifier.buf, apr_hash_count(connection->channel_table)); if(!connection->access_count) { if(connection == agent->null_connection) { if(apt_list_is_empty(agent->connection_list) == TRUE) { apt_log(APT_LOG_MARK,APT_PRIO_DEBUG,"Destroy Pending Connection"); mrcp_connection_destroy(agent->null_connection); agent->null_connection = NULL; agent->connection_list = NULL; } } else if(!connection->sock) { mrcp_connection_remove(agent,connection); /* set connection to be destroyed on channel destroy */ apt_log(APT_LOG_MARK,APT_PRIO_DEBUG,"Mark Connection for Late Destroy"); channel->connection = connection; channel->removed = TRUE; } } /* send response */ return mrcp_control_channel_remove_respond(agent->vtable,channel,TRUE); }
static apt_bool_t mrcp_server_agent_channel_remove(mrcp_connection_agent_t *agent, mrcp_control_channel_t *channel) { mrcp_connection_t *connection = channel->connection; if(connection) { mrcp_connection_channel_remove(connection,channel); apt_log(APT_LOG_MARK,APT_PRIO_INFO,"Remove Control Channel <%s> [%d]", channel->identifier.buf, apr_hash_count(connection->channel_table)); if(!connection->access_count) { if(!connection->sock) { mrcp_connection_remove(agent,connection); /* set connection to be destroyed on channel destroy */ apt_log(APT_LOG_MARK,APT_PRIO_DEBUG,"Mark Connection for Removal %s",connection->id); channel->connection = connection; channel->removed = TRUE; } } } else { apr_hash_set(agent->pending_channel_table,channel->identifier.buf,channel->identifier.length,NULL); apt_log(APT_LOG_MARK,APT_PRIO_INFO,"Remove Pending Control Channel <%s> [%d]", channel->identifier.buf, apr_hash_count(agent->pending_channel_table)); } /* send response */ return mrcp_control_channel_remove_respond(agent->vtable,channel,TRUE); }
static apt_bool_t mrcp_client_agent_channel_remove(mrcp_connection_agent_t *agent, mrcp_control_channel_t *channel) { if(channel->connection) { mrcp_connection_t *connection = channel->connection; mrcp_connection_channel_remove(connection,channel); apt_log(APT_PRIO_INFO,"Remove Control Channel <%s> [%d]", channel->identifier.buf, apr_hash_count(connection->channel_table)); if(!connection->access_count) { mrcp_client_agent_connection_remove(agent,connection); /* set connection to be destroyed on channel destroy */ channel->connection = connection; channel->removed = TRUE; } } /* send response */ return mrcp_control_channel_remove_respond(agent->vtable,channel); }