UniMRCP  1.7.0
mrcp_client.h
Go to the documentation of this file.
1 /*
2  * Copyright 2008-2015 Arsen Chaloyan
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 #ifndef MRCP_CLIENT_H
18 #define MRCP_CLIENT_H
19 
20 /**
21  * @file mrcp_client.h
22  * @brief MRCP Client
23  */
24 
25 #include "mrcp_client_types.h"
26 #include "mpf_rtp_descriptor.h"
27 #include "apt_task.h"
28 
30 
31 /** Event handler used in case of asynchronous start */
32 typedef void (*mrcp_client_handler_f)(apt_bool_t status);
33 
34 /**
35  * Create MRCP client instance.
36  * @return the created client instance
37  */
39 
40 /**
41  * Set asynchronous start mode.
42  * @param client the MRCP client to set mode for
43  * @param handler the event handler to signal start completion
44  */
46 
47 
48 /**
49  * Start message processing loop.
50  * @param client the MRCP client to start
51  * @return the created client instance
52  */
54 
55 /**
56  * Shutdown message processing loop.
57  * @param client the MRCP client to shutdown
58  */
60 
61 /**
62  * Destroy MRCP client.
63  * @param client the MRCP client to destroy
64  */
66 
67 
68 /**
69  * Register MRCP resource factory.
70  * @param client the MRCP client to set resource factory for
71  * @param resource_factory the resource factory to set
72  */
74 
75 /**
76  * Register codec manager.
77  * @param client the MRCP client to set codec manager for
78  * @param codec_manager the codec manager to set
79  */
81 
82 /**
83  * Get registered codec manager.
84  * @param client the MRCP client to get codec manager from
85  */
87 
88 /**
89  * Register media engine.
90  * @param client the MRCP client to set media engine for
91  * @param media_engine the media engine to set
92  */
94 
95 /**
96  * Register RTP termination factory.
97  * @param client the MRCP client to set termination factory for
98  * @param rtp_termination_factory the termination factory
99  * @param name the name of the factory
100  */
101 MRCP_DECLARE(apt_bool_t) mrcp_client_rtp_factory_register(mrcp_client_t *client, mpf_termination_factory_t *rtp_termination_factory, const char *name);
102 
103 /**
104  * Register RTP settings.
105  * @param client the MRCP client to set RTP settings for
106  * @param rtp_settings the settings to set
107  * @param name the name of the settings
108  */
110 
111 /**
112  * Register MRCP signaling agent.
113  * @param client the MRCP client to set signaling agent for
114  * @param signaling_agent the signaling agent to set
115  */
117 
118 /**
119  * Register MRCP signaling settings.
120  * @param client the MRCP client to set signaling settings for
121  * @param signaling_settings the signaling settings to set
122  * @param name the name of the agent
123  */
125 
126 /**
127  * Register MRCP connection agent (MRCPv2 only).
128  * @param client the MRCP client to set connection agent for
129  * @param connection_agent the connection agent to set
130  */
132 
133 /** Create MRCP profile */
135  mrcp_resource_factory_t *resource_factory,
136  mrcp_sig_agent_t *signaling_agent,
137  mrcp_connection_agent_t *connection_agent,
138  mpf_engine_t *media_engine,
139  mpf_termination_factory_t *rtp_factory,
140  mpf_rtp_settings_t *rtp_settings,
141  mrcp_sig_settings_t *signaling_settings,
142  apr_pool_t *pool);
143 
144 /** Create MRCP profile (extended version) */
146  mrcp_version_e mrcp_version,
147  mrcp_resource_factory_t *resource_factory,
148  mrcp_sa_factory_t *sa_factory,
149  mrcp_ca_factory_t *ca_factory,
150  mpf_engine_factory_t *mpf_factory,
151  mpf_termination_factory_t *rtp_factory,
152  mpf_rtp_settings_t *rtp_settings,
153  mrcp_sig_settings_t *signaling_settings,
154  apr_pool_t *pool);
155 
156 /**
157  * Set a tag to the profile.
158  * @param profile the profile to set a tag for
159  * @param tag the tag to set
160  */
161 MRCP_DECLARE(void) mrcp_client_profile_tag_set(mrcp_client_profile_t *profile, const char *tag);
162 
163 /**
164  * Register MRCP profile.
165  * @param client the MRCP client to set profile for
166  * @param profile the profile to set
167  * @param name the name of the profile
168  */
170 
171 /**
172  * Register MRCP application.
173  * @param client the MRCP client to set application for
174  * @param application the application to set
175  * @param name the name of the application
176  */
178 
179 /**
180  * Get memory pool.
181  * @param client the MRCP client to get memory pool from
182  */
183 MRCP_DECLARE(apr_pool_t*) mrcp_client_memory_pool_get(const mrcp_client_t *client);
184 
185 /**
186  * Get media engine by name.
187  * @param client the MRCP client to get media engine from
188  * @param name the name of the media engine to lookup
189  */
190 MRCP_DECLARE(mpf_engine_t*) mrcp_client_media_engine_get(const mrcp_client_t *client, const char *name);
191 
192 /**
193  * Get RTP termination factory by name.
194  * @param client the MRCP client to get from
195  * @param name the name to lookup
196  */
198 
199 /**
200  * Get RTP settings by name
201  * @param client the MRCP client to get from
202  * @param name the name to lookup
203  */
205 
206 /**
207  * Get signaling agent by name.
208  * @param client the MRCP client to get from
209  * @param name the name to lookup
210  */
212 
213 /**
214  * Get signaling settings by name.
215  * @param client the MRCP client to get from
216  * @param name the name to lookup
217  */
219 
220 /**
221  * Get connection agent by name.
222  * @param client the MRCP client to get from
223  * @param name the name to lookup
224  */
226 
227 /**
228  * Get profile by name.
229  * @param client the MRCP client to get from
230  * @param name the name to lookup
231  */
233 
234 /**
235  * Get available profiles.
236  * @param client the MRCP client to get the profile from
237  * @param profiles the array of profiles to be filled in
238  * @param count the max number of profiles on entry; and the number of profiles filled in on exit
239  * @param tag the tag to be used as a filter (no filter is specified if tag is NULL)
240  * @return FALSE if the provided max number of profiles is less than the actual number of profiles
241  */
242 MRCP_DECLARE(apt_bool_t) mrcp_client_profiles_get(const mrcp_client_t *client, mrcp_client_profile_t *profiles[], apr_size_t *count, const char *tag);
243 
244 /**
245  * Get directory layout.
246  * @param client the MRCP client to get from
247  */
249 
251 
252 #endif /* MRCP_CLIENT_H */
mrcp_connection_agent_t * mrcp_client_connection_agent_get(const mrcp_client_t *client, const char *name)
#define MRCP_DECLARE(type)
Definition: mrcp.h:40
apt_bool_t mrcp_client_start(mrcp_client_t *client)
typedefAPT_BEGIN_EXTERN_C struct mrcp_client_t mrcp_client_t
Definition: mrcp_client_types.h:32
Definition: mrcp_client_session.h:137
struct mrcp_connection_agent_t mrcp_connection_agent_t
Definition: mrcp_connection_types.h:42
apt_bool_t mrcp_client_profile_register(mrcp_client_t *client, mrcp_client_profile_t *profile, const char *name)
apt_bool_t mrcp_client_rtp_settings_register(mrcp_client_t *client, mpf_rtp_settings_t *rtp_settings, const char *name)
mrcp_client_profile_t * mrcp_client_profile_get(const mrcp_client_t *client, const char *name)
struct apt_dir_layout_t apt_dir_layout_t
Definition: apt_dir_layout.h:38
Definition: mpf_rtp_descriptor.h:128
#define APT_END_EXTERN_C
Definition: apt.h:38
apt_bool_t mrcp_client_resource_factory_register(mrcp_client_t *client, mrcp_resource_factory_t *resource_factory)
int apt_bool_t
Definition: apt.h:57
mrcp_sig_agent_t * mrcp_client_signaling_agent_get(const mrcp_client_t *client, const char *name)
mpf_engine_t * mrcp_client_media_engine_get(const mrcp_client_t *client, const char *name)
apt_bool_t mrcp_client_signaling_agent_register(mrcp_client_t *client, mrcp_sig_agent_t *signaling_agent)
struct mpf_engine_factory_t mpf_engine_factory_t
Definition: mpf_types.h:33
mrcp_client_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_version_e
Definition: mrcp_types.h:30
Definition: mrcp_sig_agent.h:33
typedefAPT_BEGIN_EXTERN_C struct mpf_engine_t mpf_engine_t
Definition: mpf_types.h:30
struct mrcp_resource_factory_t mrcp_resource_factory_t
Definition: mrcp_types.h:76
apt_dir_layout_t * mrcp_client_dir_layout_get(const mrcp_client_t *client)
mrcp_client_profile_t * mrcp_client_profile_create_ex(mrcp_version_e mrcp_version, mrcp_resource_factory_t *resource_factory, mrcp_sa_factory_t *sa_factory, mrcp_ca_factory_t *ca_factory, mpf_engine_factory_t *mpf_factory, mpf_termination_factory_t *rtp_factory, mpf_rtp_settings_t *rtp_settings, mrcp_sig_settings_t *signaling_settings, apr_pool_t *pool)
#define APT_BEGIN_EXTERN_C
Definition: apt.h:36
apr_pool_t * mrcp_client_memory_pool_get(const mrcp_client_t *client)
Definition: mpf_termination_factory.h:30
apt_bool_t mrcp_client_profiles_get(const mrcp_client_t *client, mrcp_client_profile_t *profiles[], apr_size_t *count, const char *tag)
apt_bool_t mrcp_client_shutdown(mrcp_client_t *client)
apt_bool_t mrcp_client_rtp_factory_register(mrcp_client_t *client, mpf_termination_factory_t *rtp_termination_factory, const char *name)
mrcp_sig_settings_t * mrcp_client_signaling_settings_get(const mrcp_client_t *client, const char *name)
void mrcp_client_profile_tag_set(mrcp_client_profile_t *profile, const char *tag)
Definition: mrcp_sig_agent.h:52
struct mrcp_ca_factory_t mrcp_ca_factory_t
Definition: mrcp_connection_types.h:45
apt_bool_t mrcp_client_signaling_settings_register(mrcp_client_t *client, mrcp_sig_settings_t *signaling_settings, const char *name)
mrcp_client_t * mrcp_client_create(apt_dir_layout_t *dir_layout)
mpf_rtp_settings_t * mrcp_client_rtp_settings_get(const mrcp_client_t *client, const char *name)
Definition: mrcp_client_session.h:161
Thread Execution Abstraction.
void mrcp_client_async_start_set(mrcp_client_t *client, mrcp_client_handler_f handler)
apt_bool_t mrcp_client_media_engine_register(mrcp_client_t *client, mpf_engine_t *media_engine)
APT_BEGIN_EXTERN_C typedef void(* mrcp_client_handler_f)(apt_bool_t status)
Definition: mrcp_client.h:32
apt_bool_t mrcp_client_destroy(mrcp_client_t *client)
mpf_termination_factory_t * mrcp_client_rtp_factory_get(const mrcp_client_t *client, const char *name)
apt_bool_t mrcp_client_application_register(mrcp_client_t *client, mrcp_application_t *application, const char *name)
MRCP Client Types.
MPF RTP Stream Descriptor.
apt_bool_t mrcp_client_connection_agent_register(mrcp_client_t *client, mrcp_connection_agent_t *connection_agent)
struct mrcp_sa_factory_t mrcp_sa_factory_t
Definition: mrcp_sig_types.h:36
const mpf_codec_manager_t * mrcp_client_codec_manager_get(const mrcp_client_t *client)
struct mpf_codec_manager_t mpf_codec_manager_t
Definition: mpf_types.h:39
apt_bool_t mrcp_client_codec_manager_register(mrcp_client_t *client, mpf_codec_manager_t *codec_manager)