UniMRCP  1.7.0
mrcp_server_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_SERVER_CONNECTION_H
18 #define MRCP_SERVER_CONNECTION_H
19 
20 /**
21  * @file mrcp_server_connection.h
22  * @brief MRCPv2 Server 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 engine
33  * @param listen_ip the IP address to listen on
34  * @param listen_port the port to listen on
35  * @param max_connection_count the number of max MRCPv2 connections
36  * @param force_new_connection the policy used in o/a for connection establishment
37  * @param pool the pool to allocate memory from
38  */
40  const char *id,
41  const char *listen_ip,
42  apr_port_t listen_port,
43  apr_size_t max_connection_count,
44  apt_bool_t force_new_connection,
45  apr_pool_t *pool);
46 
47 /**
48  * Destroy connection agent.
49  * @param agent the agent to destroy
50  */
52 
53 /**
54  * Start connection agent and wait for incoming requests.
55  * @param agent the agent to start
56  */
58 
59 /**
60  * Terminate connection agent.
61  * @param agent the agent to terminate
62  */
64 
65 /**
66  * Set connection event handler.
67  * @param agent the agent to set event hadler for
68  * @param obj the external object to associate with the agent
69  * @param vtable the event handler virtual methods
70  */
73  void *obj,
74  const mrcp_connection_event_vtable_t *vtable);
75 
76 /**
77  * Set MRCP resource factory.
78  * @param agent the agent to set resource factory for
79  * @param resource_factory the MRCP resource factory to set
80  */
83  const mrcp_resource_factory_t *resource_factory);
84 
85 /**
86  * Set rx buffer size.
87  * @param agent the agent to set buffer size for
88  * @param size the size of rx buffer to set
89  */
92  apr_size_t size);
93 
94 /**
95  * Set tx buffer size.
96  * @param agent the agent to set buffer size for
97  * @param size the size of the rx buffer to set
98  */
101  apr_size_t size);
102 
103 /**
104  * Set max shared use count for an MRCPv2 connection.
105  * @param agent the agent to set the parameter for
106  * @param max_shared_use_count the number of max shared use count of an MRCPv2 connection
107  */
110  apr_size_t max_shared_use_count);
111 
112 /**
113  * Set inactivity timeout for an MRCPv2 connection.
114  * @param agent the agent to set the parameter for
115  * @param timeout the inactivity timeout to set in seconds
116  */
119  apr_size_t timeout);
120 
121 /**
122  * Set termination timeout for an MRCPv2 connection.
123  * @param agent the agent to set the parameter for
124  * @param timeout the termination timeout to set in seconds
125  */
128  apr_size_t timeout);
129 
130 /**
131  * Get task.
132  * @param agent the agent to get task from
133  */
135 
136 /**
137  * Get external object.
138  * @param agent the agent to get object from
139  */
141 
142 /**
143  * Get string identifier.
144  * @param agent the agent to get identifier of
145  */
147 
148 
149 /**
150  * Create control channel.
151  * @param agent the agent to create channel for
152  * @param obj the external object to associate with the control channel
153  * @param pool the pool to allocate memory from
154  */
156  mrcp_connection_agent_t *agent,
157  void *obj,
158  apr_pool_t *pool);
159 
160 /**
161  * Add MRCPv2 control channel.
162  * @param channel the control channel to add
163  * @param descriptor the control descriptor
164  */
166  mrcp_control_channel_t *channel,
167  mrcp_control_descriptor_t *descriptor);
168 
169 /**
170  * Modify MRCPv2 control channel.
171  * @param channel the control channel to modify
172  * @param descriptor the control descriptor
173  */
175  mrcp_control_channel_t *channel,
176  mrcp_control_descriptor_t *descriptor);
177 
178 /**
179  * Remove MRCPv2 control channel.
180  * @param channel the control channel to remove
181  */
183 
184 /**
185  * Destroy MRCPv2 control channel.
186  * @param channel the control channel to destroy
187  */
189 
190 /**
191  * Send MRCPv2 message.
192  * @param channel the control channel to send message through
193  * @param message the message to send
194  */
196 
197 
199 
200 #endif /* MRCP_SERVER_CONNECTION_H */
apt_bool_t mrcp_server_control_channel_destroy(mrcp_control_channel_t *channel)
#define MRCP_DECLARE(type)
Definition: mrcp.h:40
struct mrcp_connection_agent_t mrcp_connection_agent_t
Definition: mrcp_connection_types.h:42
void mrcp_server_connection_rx_size_set(mrcp_connection_agent_t *agent, apr_size_t size)
void mrcp_server_connection_tx_size_set(mrcp_connection_agent_t *agent, apr_size_t size)
Definition: mrcp_connection_types.h:65
#define APT_END_EXTERN_C
Definition: apt.h:38
int apt_bool_t
Definition: apt.h:57
void * mrcp_server_connection_agent_object_get(const mrcp_connection_agent_t *agent)
Definition: mrcp_control_descriptor.h:78
mrcp_control_channel_t * mrcp_server_control_channel_create(mrcp_connection_agent_t *agent, void *obj, apr_pool_t *pool)
struct mrcp_resource_factory_t mrcp_resource_factory_t
Definition: mrcp_types.h:76
apt_bool_t mrcp_server_control_channel_add(mrcp_control_channel_t *channel, mrcp_control_descriptor_t *descriptor)
MRCP Connection Types Declaration.
apt_bool_t mrcp_server_control_channel_modify(mrcp_control_channel_t *channel, mrcp_control_descriptor_t *descriptor)
#define APT_BEGIN_EXTERN_C
Definition: apt.h:36
const char * mrcp_server_connection_agent_id_get(const mrcp_connection_agent_t *agent)
void mrcp_server_connection_resource_factory_set(mrcp_connection_agent_t *agent, const mrcp_resource_factory_t *resource_factory)
void mrcp_server_connection_timeout_set(mrcp_connection_agent_t *agent, apr_size_t timeout)
void mrcp_server_connection_max_shared_use_set(mrcp_connection_agent_t *agent, apr_size_t max_shared_use_count)
typedefAPT_BEGIN_EXTERN_C struct apt_task_t apt_task_t
Definition: apt_task.h:31
Thread Execution Abstraction.
apt_bool_t mrcp_server_connection_agent_start(mrcp_connection_agent_t *agent)
apt_bool_t mrcp_server_control_message_send(mrcp_control_channel_t *channel, mrcp_message_t *message)
apt_bool_t mrcp_server_control_channel_remove(mrcp_control_channel_t *channel)
void mrcp_server_connection_term_timeout_set(mrcp_connection_agent_t *agent, apr_size_t timeout)
Definition: mrcp_connection_types.h:51
apt_bool_t mrcp_server_connection_agent_terminate(mrcp_connection_agent_t *agent)
apt_task_t * mrcp_server_connection_agent_task_get(const mrcp_connection_agent_t *agent)
apt_bool_t mrcp_server_connection_agent_destroy(mrcp_connection_agent_t *agent)
Definition: mrcp_message.h:37
void mrcp_server_connection_agent_handler_set(mrcp_connection_agent_t *agent, void *obj, const mrcp_connection_event_vtable_t *vtable)
APT_BEGIN_EXTERN_C mrcp_connection_agent_t * mrcp_server_connection_agent_create(const char *id, const char *listen_ip, apr_port_t listen_port, apr_size_t max_connection_count, apt_bool_t force_new_connection, apr_pool_t *pool)