UniMRCP  1.3.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 2170 2014-09-09 05:19:48Z 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 #ifdef WIN32
30 #pragma warning(disable: 4127)
31 #endif
32 #include <apr_ring.h>
33 #include "mrcp_connection_types.h"
34 #include "mrcp_stream.h"
35 
37 
38 /** Size of the buffer used for MRCP rx/tx stream */
39 #define MRCP_STREAM_BUFFER_SIZE 1024
40 
41 /** MRCPv2 connection */
43  /** Ring entry */
45 
46  /** Memory pool */
47  apr_pool_t *pool;
48 
49  /** Accepted/Connected socket */
50  apr_socket_t *sock;
51  /** Socket poll descriptor */
52  apr_pollfd_t sock_pfd;
53  /** Local sockaddr */
54  apr_sockaddr_t *l_sockaddr;
55  /** Remote sockaddr */
56  apr_sockaddr_t *r_sockaddr;
57  /** Remote IP */
59  /** String identifier used for traces */
60  const char *id;
61  /** Transparently dump whatever received/sent on transport layer,
62  if verbose is set to TRUE (default) */
64 
65  /** Reference count */
66  apr_size_t access_count;
67  /** Opaque agent */
68  void *agent;
69 
70  /** Table of control channels */
71  apr_hash_t *channel_table;
72 
73  /** Rx buffer */
74  char *rx_buffer;
75  /** Rx buffer size */
76  apr_size_t rx_buffer_size;
77  /** Rx stream */
79  /** MRCP parser to parser MRCP messages out of rx stream */
81 
82  /** Tx buffer */
83  char *tx_buffer;
84  /** Tx buffer size */
85  apr_size_t tx_buffer_size;
86  /** MRCP generator to generate MRCP messages into tx stream */
88 };
89 
90 /** Create MRCP connection. */
92 
93 /** Destroy MRCP connection. */
95 
96 /** Add Control Channel to MRCP connection. */
98 
99 /** Find Control Channel by Channel Identifier. */
101 
102 /** Remove Control Channel from MRCP connection. */
104 
105 /** Raise disconnect event for each channel from the specified connection. */
107 
109 
110 #endif /* MRCP_CONNECTION_H */