UniMRCP  1.7.0
mrcp_client_connection.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_CONNECTION_H
18 #define MRCP_CLIENT_CONNECTION_H
19 
20 /**
21  * @file mrcp_client_connection.h
22  * @brief MRCPv2 Client Connection
23  */
24 
25 #include "apt_task.h"
26 #include "mrcp_connection_types.h"
27 
29 
30 /**
31  * Create connection agent.
32  * @param id the identifier of the agent
33  * @param max_connection_count the number of max MRCPv2 connections
34  * @param offer_new_connection the connection establishment policy in o/a
35  * @param pool the pool to allocate memory from
36  */
38  const char *id,
39  apr_size_t max_connection_count,
40  apt_bool_t offer_new_connection,
41  apr_pool_t *pool);
42 
43 /**
44  * Destroy connection agent.
45  * @param agent the agent to destroy
46  */
48 
49 /**
50  * Start connection agent and wait for incoming requests.
51  * @param agent the agent to start
52  */
54 
55 /**
56  * Terminate connection agent.
57  * @param agent the agent to terminate
58  */
60 
61 
62 /**
63  * Set connection event handler.
64  * @param agent the agent to set event hadler for
65  * @param obj the external object to associate with the agent
66  * @param vtable the event handler virtual methods
67  */
70  void *obj,
71  const mrcp_connection_event_vtable_t *vtable);
72 
73 /**
74  * Set MRCP resource factory.
75  * @param agent the agent to set resource factory for
76  * @param resource_factory the MRCP resource factory to set
77  */
80  const mrcp_resource_factory_t *resource_factory);
81 /**
82  * Set rx buffer size.
83  * @param agent the agent to set buffer size for
84  * @param size the size of rx buffer to set
85  */
88  apr_size_t size);
89 
90 /**
91  * Set tx buffer size.
92  * @param agent the agent to set buffer size for
93  * @param size the size of the rx buffer to set
94  */
97  apr_size_t size);
98 
99 /**
100  * Set max shared use count for an MRCPv2 connection.
101  * @param agent the agent to set the parameter for
102  * @param max_shared_use_count the number of max shared use count of an MRCPv2 connection
103  */
106  apr_size_t max_shared_use_count);
107 
108 /**
109  * Set request timeout.
110  * @param agent the agent to set timeout for
111  * @param timeout the timeout to set
112  */
115  apr_size_t timeout);
116 
117 /**
118  * Get task.
119  * @param agent the agent to get task from
120  */
122 
123 /**
124  * Get external object.
125  * @param agent the agent to get object from
126  */
128 
129 /**
130  * Get string identifier.
131  * @param agent the agent to get identifier of
132  */
134 
135 
136 /**
137  * Create control channel.
138  * @param agent the agent to create channel for
139  * @param obj the external object to associate with the control channel
140  * @param pool the pool to allocate memory from
141  */
143  mrcp_connection_agent_t *agent,
144  void *obj,
145  apr_pool_t *pool);
146 
147 /**
148  * Add MRCPv2 control channel.
149  * @param channel the control channel to add
150  * @param descriptor the control descriptor
151  */
153  mrcp_control_channel_t *channel,
154  mrcp_control_descriptor_t *descriptor);
155 
156 /**
157  * Modify MRCPv2 control channel.
158  * @param channel the control channel to modify
159  * @param descriptor the control descriptor
160  */
162  mrcp_control_channel_t *channel,
163  mrcp_control_descriptor_t *descriptor);
164 
165 /**
166  * Remove MRCPv2 control channel.
167  * @param channel the control channel to remove
168  */
170 
171 /**
172  * Destroy MRCPv2 control channel.
173  * @param channel the control channel to destroy
174  */
176 
177 /**
178  * Send MRCPv2 message.
179  * @param channel the control channel to send message through
180  * @param message the message to send
181  */
183 
184 /**
185  * Set the logger object.
186  * @param channel the control channel to set the object for
187  * @param log_obj the object to set
188  */
190 
191 
193 
194 #endif /* MRCP_CLIENT_CONNECTION_H */
#define MRCP_DECLARE(type)
Definition: mrcp.h:40
void * mrcp_client_connection_agent_object_get(const mrcp_connection_agent_t *agent)
struct mrcp_connection_agent_t mrcp_connection_agent_t
Definition: mrcp_connection_types.h:42
APT_BEGIN_EXTERN_C mrcp_connection_agent_t * mrcp_client_connection_agent_create(const char *id, apr_size_t max_connection_count, apt_bool_t offer_new_connection, apr_pool_t *pool)
Definition: mrcp_connection_types.h:65
#define APT_END_EXTERN_C
Definition: apt.h:38
int apt_bool_t
Definition: apt.h:57
Definition: mrcp_control_descriptor.h:78
apt_bool_t mrcp_client_control_channel_add(mrcp_control_channel_t *channel, mrcp_control_descriptor_t *descriptor)
apt_task_t * mrcp_client_connection_agent_task_get(const mrcp_connection_agent_t *agent)
struct mrcp_resource_factory_t mrcp_resource_factory_t
Definition: mrcp_types.h:76
mrcp_control_channel_t * mrcp_client_control_channel_create(mrcp_connection_agent_t *agent, void *obj, apr_pool_t *pool)
apt_bool_t mrcp_client_connection_agent_terminate(mrcp_connection_agent_t *agent)
MRCP Connection Types Declaration.
#define APT_BEGIN_EXTERN_C
Definition: apt.h:36
apt_bool_t mrcp_client_connection_agent_destroy(mrcp_connection_agent_t *agent)
apt_bool_t mrcp_client_control_channel_modify(mrcp_control_channel_t *channel, mrcp_control_descriptor_t *descriptor)
apt_bool_t mrcp_client_connection_agent_start(mrcp_connection_agent_t *agent)
void mrcp_client_connection_max_shared_use_set(mrcp_connection_agent_t *agent, apr_size_t max_shared_use_count)
void mrcp_client_connection_agent_handler_set(mrcp_connection_agent_t *agent, void *obj, const mrcp_connection_event_vtable_t *vtable)
void mrcp_client_connection_timeout_set(mrcp_connection_agent_t *agent, apr_size_t timeout)
typedefAPT_BEGIN_EXTERN_C struct apt_task_t apt_task_t
Definition: apt_task.h:31
void mrcp_client_control_channel_log_obj_set(mrcp_control_channel_t *channel, void *log_obj)
void mrcp_client_connection_rx_size_set(mrcp_connection_agent_t *agent, apr_size_t size)
Thread Execution Abstraction.
apt_bool_t mrcp_client_control_channel_remove(mrcp_control_channel_t *channel)
const char * mrcp_client_connection_agent_id_get(const mrcp_connection_agent_t *agent)
apt_bool_t mrcp_client_control_message_send(mrcp_control_channel_t *channel, mrcp_message_t *message)
Definition: mrcp_connection_types.h:51
apt_bool_t mrcp_client_control_channel_destroy(mrcp_control_channel_t *channel)
Definition: mrcp_message.h:37
void mrcp_client_connection_tx_size_set(mrcp_connection_agent_t *agent, apr_size_t size)
void mrcp_client_connection_resource_factory_set(mrcp_connection_agent_t *agent, const mrcp_resource_factory_t *resource_factory)