UniMRCP  1.3.0
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
mrcp_client.h
Go to the documentation of this file.
1 /*
2  * Copyright 2008-2014 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  * $Id: mrcp_client.h 2251 2014-11-21 02:36:44Z achaloyan@gmail.com $
17  */
18 
19 #ifndef MRCP_CLIENT_H
20 #define MRCP_CLIENT_H
21 
22 /**
23  * @file mrcp_client.h
24  * @brief MRCP Client
25  */
26 
27 #include "mrcp_client_types.h"
28 #include "mpf_rtp_descriptor.h"
29 #include "apt_task.h"
30 
32 
33 /** Event handler used in case of asynchronous start */
34 typedef void (*mrcp_client_handler_f)(apt_bool_t status);
35 
36 /**
37  * Create MRCP client instance.
38  * @return the created client instance
39  */
41 
42 /**
43  * Set asynchronous start mode.
44  * @param client the MRCP client to set mode for
45  * @param handler the event handler to signal start completion
46  */
48 
49 
50 /**
51  * Start message processing loop.
52  * @param client the MRCP client to start
53  * @return the created client instance
54  */
56 
57 /**
58  * Shutdown message processing loop.
59  * @param client the MRCP client to shutdown
60  */
62 
63 /**
64  * Destroy MRCP client.
65  * @param client the MRCP client to destroy
66  */
68 
69 
70 /**
71  * Register MRCP resource factory.
72  * @param client the MRCP client to set resource factory for
73  * @param resource_factory the resource factory to set
74  */
76 
77 /**
78  * Register codec manager.
79  * @param client the MRCP client to set codec manager for
80  * @param codec_manager the codec manager to set
81  */
83 
84 /**
85  * Get registered codec manager.
86  * @param client the MRCP client to get codec manager from
87  */
89 
90 /**
91  * Register media engine.
92  * @param client the MRCP client to set media engine for
93  * @param media_engine the media engine to set
94  */
96 
97 /**
98  * Register RTP termination factory.
99  * @param client the MRCP client to set termination factory for
100  * @param rtp_termination_factory the termination factory
101  * @param name the name of the factory
102  */
103 MRCP_DECLARE(apt_bool_t) mrcp_client_rtp_factory_register(mrcp_client_t *client, mpf_termination_factory_t *rtp_termination_factory, const char *name);
104 
105 /**
106  * Register RTP settings.
107  * @param client the MRCP client to set RTP settings for
108  * @param rtp_settings the settings to set
109  * @param name the name of the settings
110  */
112 
113 /**
114  * Register MRCP signaling agent.
115  * @param client the MRCP client to set signaling agent for
116  * @param signaling_agent the signaling agent to set
117  */
119 
120 /**
121  * Register MRCP signaling settings.
122  * @param client the MRCP client to set signaling settings for
123  * @param signaling_settings the signaling settings to set
124  * @param name the name of the agent
125  */
127 
128 /**
129  * Register MRCP connection agent (MRCPv2 only).
130  * @param client the MRCP client to set connection agent for
131  * @param connection_agent the connection agent to set
132  */
134 
135 /** Create MRCP profile */
137  mrcp_resource_factory_t *resource_factory,
138  mrcp_sig_agent_t *signaling_agent,
139  mrcp_connection_agent_t *connection_agent,
140  mpf_engine_t *media_engine,
141  mpf_termination_factory_t *rtp_factory,
142  mpf_rtp_settings_t *rtp_settings,
143  mrcp_sig_settings_t *signaling_settings,
144  apr_pool_t *pool);
145 
146 /** Create MRCP profile (extended version) */
148  mrcp_version_e mrcp_version,
149  mrcp_resource_factory_t *resource_factory,
150  mrcp_sa_factory_t *sa_factory,
151  mrcp_ca_factory_t *ca_factory,
152  mpf_engine_factory_t *mpf_factory,
153  mpf_termination_factory_t *rtp_factory,
154  mpf_rtp_settings_t *rtp_settings,
155  mrcp_sig_settings_t *signaling_settings,
156  apr_pool_t *pool);
157 
158 /**
159  * Set a tag to the profile.
160  * @param profile the profile to set a tag for
161  * @param tag the tag to set
162  */
163 MRCP_DECLARE(void) mrcp_client_profile_tag_set(mrcp_client_profile_t *profile, const char *tag);
164 
165 /**
166  * Register MRCP profile.
167  * @param client the MRCP client to set profile for
168  * @param profile the profile to set
169  * @param name the name of the profile
170  */
172 
173 /**
174  * Register MRCP application.
175  * @param client the MRCP client to set application for
176  * @param application the application to set
177  * @param name the name of the application
178  */
180 
181 /**
182  * Get memory pool.
183  * @param client the MRCP client to get memory pool from
184  */
185 MRCP_DECLARE(apr_pool_t*) mrcp_client_memory_pool_get(const mrcp_client_t *client);
186 
187 /**
188  * Get media engine by name.
189  * @param client the MRCP client to get media engine from
190  * @param name the name of the media engine to lookup
191  */
192 MRCP_DECLARE(mpf_engine_t*) mrcp_client_media_engine_get(const mrcp_client_t *client, const char *name);
193 
194 /**
195  * Get RTP termination factory by name.
196  * @param client the MRCP client to get from
197  * @param name the name to lookup
198  */
200 
201 /**
202  * Get RTP settings by name
203  * @param client the MRCP client to get from
204  * @param name the name to lookup
205  */
207 
208 /**
209  * Get signaling agent by name.
210  * @param client the MRCP client to get from
211  * @param name the name to lookup
212  */
214 
215 /**
216  * Get signaling settings by name.
217  * @param client the MRCP client to get from
218  * @param name the name to lookup
219  */
221 
222 /**
223  * Get connection agent by name.
224  * @param client the MRCP client to get from
225  * @param name the name to lookup
226  */
228 
229 /**
230  * Get profile by name.
231  * @param client the MRCP client to get from
232  * @param name the name to lookup
233  */
235 
236 /**
237  * Get available profiles.
238  * @param client the MRCP client to get the profile from
239  * @param profiles the array of profiles to be filled in
240  * @param count the max number of profiles on entry; and the number of profiles filled in on exit
241  * @param tag the tag to be used as a filter (no filter is specified if tag is NULL)
242  * @return FALSE if the provided max number of profiles is less than the actual number of profiles
243  */
244 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);
245 
246 /**
247  * Get directory layout.
248  * @param client the MRCP client to get from
249  */
251 
253 
254 #endif /* MRCP_CLIENT_H */