UniMRCP
1.2.0
Main Page
Related Pages
Data Structures
Files
File List
Globals
All
Data Structures
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Macros
Pages
libs
mrcpv2-transport
include
mrcp_connection.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_connection.h 2136 2014-07-04 06:33:36Z achaloyan@gmail.com $
17
*/
18
19
#ifndef MRCP_CONNECTION_H
20
#define MRCP_CONNECTION_H
21
22
/**
23
* @file mrcp_connection.h
24
* @brief MRCP Connection
25
*/
26
27
#include <apr_poll.h>
28
#include <apr_hash.h>
29
#include "
apt_obj_list.h
"
30
#include "
mrcp_connection_types.h
"
31
#include "
mrcp_stream.h
"
32
33
APT_BEGIN_EXTERN_C
34
35
/** Size of the buffer used for MRCP rx/tx stream */
36
#define MRCP_STREAM_BUFFER_SIZE 1024
37
38
/** MRCPv2 connection */
39
struct
mrcp_connection_t
{
40
/** Memory pool */
41
apr_pool_t *
pool
;
42
43
/** Accepted/Connected socket */
44
apr_socket_t *
sock
;
45
/** Socket poll descriptor */
46
apr_pollfd_t
sock_pfd
;
47
/** Local sockaddr */
48
apr_sockaddr_t *
l_sockaddr
;
49
/** Remote sockaddr */
50
apr_sockaddr_t *
r_sockaddr
;
51
/** Remote IP */
52
apt_str_t
remote_ip
;
53
/** String identifier used for traces */
54
const
char
*
id
;
55
/** Transparently dump whatever received/sent on transport layer,
56
if verbose is set to TRUE (default) */
57
apt_bool_t
verbose
;
58
59
/** Reference count */
60
apr_size_t
access_count
;
61
/** Agent list element */
62
apt_list_elem_t
*
it
;
63
/** Opaque agent */
64
void
*
agent
;
65
66
/** Table of control channels */
67
apr_hash_t *
channel_table
;
68
69
/** Rx buffer */
70
char
*
rx_buffer
;
71
/** Rx buffer size */
72
apr_size_t
rx_buffer_size
;
73
/** Rx stream */
74
apt_text_stream_t
rx_stream
;
75
/** MRCP parser to parser MRCP messages out of rx stream */
76
mrcp_parser_t
*
parser
;
77
78
/** Tx buffer */
79
char
*
tx_buffer
;
80
/** Tx buffer size */
81
apr_size_t
tx_buffer_size
;
82
/** MRCP generator to generate MRCP messages into tx stream */
83
mrcp_generator_t
*
generator
;
84
};
85
86
/** Create MRCP connection. */
87
mrcp_connection_t
*
mrcp_connection_create
(
void
);
88
89
/** Destroy MRCP connection. */
90
void
mrcp_connection_destroy
(
mrcp_connection_t
*connection);
91
92
/** Add Control Channel to MRCP connection. */
93
apt_bool_t
mrcp_connection_channel_add
(
mrcp_connection_t
*connection,
mrcp_control_channel_t
*channel);
94
95
/** Find Control Channel by Channel Identifier. */
96
mrcp_control_channel_t
*
mrcp_connection_channel_find
(
const
mrcp_connection_t
*connection,
const
apt_str_t
*identifier);
97
98
/** Remove Control Channel from MRCP connection. */
99
apt_bool_t
mrcp_connection_channel_remove
(
mrcp_connection_t
*connection,
mrcp_control_channel_t
*channel);
100
101
/** Raise disconnect event for each channel from the specified connection. */
102
apt_bool_t
mrcp_connection_disconnect_raise
(
mrcp_connection_t
*connection,
const
mrcp_connection_event_vtable_t
*vtable);
103
104
APT_END_EXTERN_C
105
106
#endif
/* MRCP_CONNECTION_H */
Generated on Sun Jul 6 2014 22:12:45 for UniMRCP by
1.8.3.1