UniMRCP  1.2.0
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
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 
34 
35 /** Size of the buffer used for MRCP rx/tx stream */
36 #define MRCP_STREAM_BUFFER_SIZE 1024
37 
38 /** MRCPv2 connection */
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 */
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) */
58 
59  /** Reference count */
60  apr_size_t access_count;
61  /** Agent list element */
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 */
75  /** MRCP parser to parser MRCP messages out of rx stream */
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 */
84 };
85 
86 /** Create MRCP connection. */
88 
89 /** Destroy MRCP connection. */
91 
92 /** Add Control Channel to MRCP connection. */
94 
95 /** Find Control Channel by Channel Identifier. */
97 
98 /** Remove Control Channel from MRCP connection. */
100 
101 /** Raise disconnect event for each channel from the specified connection. */
103 
105 
106 #endif /* MRCP_CONNECTION_H */