/** Create factory of signaling agents */ static mrcp_sa_factory_t* unimrcp_client_sa_factory_create(unimrcp_client_loader_t *loader, const apr_xml_elem *elem) { mrcp_sa_factory_t *sa_factory = NULL; mrcp_sig_agent_t *sig_agent; char *uac_name; char *state; char *uac_list_str = apr_pstrdup(loader->pool,cdata_text_get(elem)); do { uac_name = apr_strtok(uac_list_str, ",", &state); if(uac_name) { sig_agent = mrcp_client_signaling_agent_get(loader->client,uac_name); if(sig_agent) { if(!sa_factory) sa_factory = mrcp_sa_factory_create(loader->pool); mrcp_sa_factory_agent_add(sa_factory,sig_agent); } else { apt_log(APT_LOG_MARK,APT_PRIO_WARNING,"Unknown UAC Name <%s>",uac_name); } } uac_list_str = NULL; /* make sure we pass NULL on subsequent calls of apr_strtok() */ } while(uac_name); return sa_factory; }
/** Create MRCP profile */ MRCP_DECLARE(mrcp_profile_t*) mrcp_client_profile_create( mrcp_resource_factory_t *resource_factory, mrcp_sig_agent_t *signaling_agent, mrcp_connection_agent_t *connection_agent, mpf_engine_t *media_engine, mpf_termination_factory_t *rtp_factory, mpf_rtp_settings_t *rtp_settings, mrcp_sig_settings_t *signaling_settings, apr_pool_t *pool) { mrcp_sa_factory_t *sa_factory = NULL; mrcp_ca_factory_t *ca_factory = NULL; mpf_engine_factory_t *mpf_factory = NULL; mrcp_version_e mrcp_version = MRCP_VERSION_2; if(!connection_agent) mrcp_version = MRCP_VERSION_1; if(signaling_agent) { sa_factory = mrcp_sa_factory_create(pool); mrcp_sa_factory_agent_add(sa_factory,signaling_agent); } if(connection_agent) { ca_factory = mrcp_ca_factory_create(pool); mrcp_ca_factory_agent_add(ca_factory,connection_agent); } if(media_engine) { mpf_factory = mpf_engine_factory_create(pool); mpf_engine_factory_engine_add(mpf_factory,media_engine); } return mrcp_client_profile_create_ex( mrcp_version, resource_factory, sa_factory, ca_factory, mpf_factory, rtp_factory, rtp_settings, signaling_settings, pool); }