/** Create UniRTSP Signaling Agent */
MRCP_DECLARE(mrcp_sig_agent_t*) mrcp_unirtsp_server_agent_create(const char *id, rtsp_server_config_t *config, apr_pool_t *pool)
{
	apt_task_t *task;
	mrcp_unirtsp_agent_t *agent;
	agent = apr_palloc(pool,sizeof(mrcp_unirtsp_agent_t));
	agent->sig_agent = mrcp_signaling_agent_create(id,agent,MRCP_VERSION_1,pool);
	agent->config = config;

	if(rtsp_config_validate(agent,config,pool) == FALSE) {
		return NULL;
	}

	agent->rtsp_server = rtsp_server_create(
								config->local_ip,
								config->local_port,
								config->max_connection_count,
								agent,
								&session_request_vtable,
								pool);
	if(!agent->rtsp_server) {
		return NULL;
	}
	
	task = rtsp_server_task_get(agent->rtsp_server);
	apt_task_name_set(task,id);
	agent->sig_agent->task = task;

	apt_log(APT_LOG_MARK,APT_PRIO_NOTICE,"Create UniRTSP Agent [%s] %s:%hu [%"APR_SIZE_T_FMT"]",
				id,
				config->local_ip,
				config->local_port,
				config->max_connection_count);
	return agent->sig_agent;
}
/** Create UniRTSP Signaling Agent */
MRCP_DECLARE(mrcp_sig_agent_t*) mrcp_unirtsp_server_agent_create(const char *id, rtsp_server_config_t *config, apr_pool_t *pool)
{
	apt_task_t *task;
	mrcp_unirtsp_agent_t *agent;
	agent = apr_palloc(pool,sizeof(mrcp_unirtsp_agent_t));
	agent->sig_agent = mrcp_signaling_agent_create(id,agent,pool);
	agent->config = config;

	if(rtsp_config_validate(agent,config,pool) == FALSE) {
		return NULL;
	}

	agent->rtsp_server = rtsp_server_create(
							id,
							config->local_ip,
							config->local_port,
							config->max_connection_count,
							agent,
							&session_request_vtable,
							pool);
	if(!agent->rtsp_server) {
		return NULL;
	}

	task = rtsp_server_task_get(agent->rtsp_server);
	agent->sig_agent->task = task;

	return agent->sig_agent;
}