UniMRCP  1.5.0
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
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  * Set request timeout.
100  * @param agent the agent to set timeout for
101  * @param timeout the timeout to set
102  */
105  apr_size_t timeout);
106 
107 /**
108  * Get task.
109  * @param agent the agent to get task from
110  */
112 
113 /**
114  * Get external object.
115  * @param agent the agent to get object from
116  */
118 
119 /**
120  * Get string identifier.
121  * @param agent the agent to get identifier of
122  */
124 
125 
126 /**
127  * Create control channel.
128  * @param agent the agent to create channel for
129  * @param obj the external object to associate with the control channel
130  * @param pool the pool to allocate memory from
131  */
133  mrcp_connection_agent_t *agent,
134  void *obj,
135  apr_pool_t *pool);
136 
137 /**
138  * Add MRCPv2 control channel.
139  * @param channel the control channel to add
140  * @param descriptor the control descriptor
141  */
143  mrcp_control_channel_t *channel,
144  mrcp_control_descriptor_t *descriptor);
145 
146 /**
147  * Modify MRCPv2 control channel.
148  * @param channel the control channel to modify
149  * @param descriptor the control descriptor
150  */
152  mrcp_control_channel_t *channel,
153  mrcp_control_descriptor_t *descriptor);
154 
155 /**
156  * Remove MRCPv2 control channel.
157  * @param channel the control channel to remove
158  */
160 
161 /**
162  * Destroy MRCPv2 control channel.
163  * @param channel the control channel to destroy
164  */
166 
167 /**
168  * Send MRCPv2 message.
169  * @param channel the control channel to send message through
170  * @param message the message to send
171  */
173 
174 /**
175  * Set the logger object.
176  * @param channel the control channel to set the object for
177  * @param log_obj the object to set
178  */
180 
181 
183 
184 #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_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)