UniMRCP  1.4.0
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
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  * Get task.
105  * @param agent the agent to get task from
106  */
108 
109 /**
110  * Get external object.
111  * @param agent the agent to get object from
112  */
114 
115 /**
116  * Get string identifier.
117  * @param agent the agent to get identifier of
118  */
120 
121 
122 /**
123  * Create control channel.
124  * @param agent the agent to create channel for
125  * @param obj the external object to associate with the control channel
126  * @param pool the pool to allocate memory from
127  */
129  mrcp_connection_agent_t *agent,
130  void *obj,
131  apr_pool_t *pool);
132 
133 /**
134  * Add MRCPv2 control channel.
135  * @param channel the control channel to add
136  * @param descriptor the control descriptor
137  */
139  mrcp_control_channel_t *channel,
140  mrcp_control_descriptor_t *descriptor);
141 
142 /**
143  * Modify MRCPv2 control channel.
144  * @param channel the control channel to modify
145  * @param descriptor the control descriptor
146  */
148  mrcp_control_channel_t *channel,
149  mrcp_control_descriptor_t *descriptor);
150 
151 /**
152  * Remove MRCPv2 control channel.
153  * @param channel the control channel to remove
154  */
156 
157 /**
158  * Destroy MRCPv2 control channel.
159  * @param channel the control channel to destroy
160  */
162 
163 /**
164  * Send MRCPv2 message.
165  * @param channel the control channel to send message through
166  * @param message the message to send
167  */
169 
170 
172 
173 #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)
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)
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)