UniMRCP  1.3.0
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
mrcp_control_descriptor.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_control_descriptor.h 2136 2014-07-04 06:33:36Z achaloyan@gmail.com $
17  */
18 
19 #ifndef MRCP_CONTROL_DESCRIPTOR_H
20 #define MRCP_CONTROL_DESCRIPTOR_H
21 
22 /**
23  * @file mrcp_control_descriptor.h
24  * @brief MRCPv2 Control Descriptor
25  */
26 
27 #include <apr_tables.h>
28 #include "apt_string.h"
29 #include "mrcp_connection_types.h"
30 
32 
33 /** TCP discard port used in offer/answer */
34 #define TCP_DISCARD_PORT 9
35 
36 
37 /** MRCPv2 proto transport */
38 typedef enum {
39  MRCP_PROTO_TCP,
40  MRCP_PROTO_TLS,
41 
42  MRCP_PROTO_COUNT,
43  MRCP_PROTO_UNKNOWN = MRCP_PROTO_COUNT
45 
46 
47 /** MRCPv2 attributes */
48 typedef enum {
49  MRCP_ATTRIB_SETUP,
50  MRCP_ATTRIB_CONNECTION,
51  MRCP_ATTRIB_RESOURCE,
52  MRCP_ATTRIB_CHANNEL,
53  MRCP_ATTRIB_CMID,
54 
55  MRCP_ATTRIB_COUNT,
56  MRCP_ATTRIB_UNKNOWN = MRCP_ATTRIB_COUNT
58 
59 
60 /** MRCPv2 setup attributes */
61 typedef enum {
62  MRCP_SETUP_TYPE_ACTIVE,
63  MRCP_SETUP_TYPE_PASSIVE,
64 
65  MRCP_SETUP_TYPE_COUNT,
66  MRCP_SETUP_TYPE_UNKNOWN = MRCP_SETUP_TYPE_COUNT
68 
69 /** MRCPv2 connection attributes */
70 typedef enum {
71  MRCP_CONNECTION_TYPE_NEW,
72  MRCP_CONNECTION_TYPE_EXISTING,
73 
74  MRCP_CONNECTION_TYPE_COUNT,
75  MRCP_CONNECTION_TYPE_UNKNOWN = MRCP_CONNECTION_TYPE_COUNT
77 
78 
79 /** MRCPv2 control descriptor */
81  /** IP address */
83  /** Port */
84  apr_port_t port;
85  /** Protocol type */
87  /** Setup type */
89  /** Connection type */
91  /** Resource name */
93  /** Session identifier */
95  /** Array of cmid attributes */
96  apr_array_header_t *cmid_arr;
97  /** Base identifier */
98  apr_size_t id;
99 };
100 
101 
102 /** Create MRCP control descriptor */
104 
105 /** Create MRCP control offer */
107 
108 /** Create MRCP control answer */
110 
111 /** Add cmid to cmid_arr */
112 MRCP_DECLARE(void) mrcp_cmid_add(apr_array_header_t *cmid_arr, apr_size_t cmid);
113 
114 /** Find cmid in cmid_arr */
115 MRCP_DECLARE(apt_bool_t) mrcp_cmid_find(const apr_array_header_t *cmid_arr, apr_size_t cmid);
116 
117 /** Get MRCP protocol transport name by identifier */
119 
120 /** Find MRCP protocol transport identifier by name */
122 
123 
124 /** Get MRCP attribute name by identifier */
126 
127 /** Find MRCP attribute identifier by name */
129 
130 
131 /** Get MRCP setup type name by identifier */
133 
134 /** Find MRCP setup type identifier by name */
136 
137 
138 /** Get MRCP connection type name by identifier */
140 
141 /** Find MRCP connection type identifier by name */
143 
144 
146 
147 #endif /* MRCP_CONTROL_DESCRIPTOR_H */