UniMRCP  1.7.0
mrcp_control_descriptor.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_CONTROL_DESCRIPTOR_H
18 #define MRCP_CONTROL_DESCRIPTOR_H
19 
20 /**
21  * @file mrcp_control_descriptor.h
22  * @brief MRCPv2 Control Descriptor
23  */
24 
25 #include <apr_tables.h>
26 #include "apt_string.h"
27 #include "mrcp_connection_types.h"
28 
30 
31 /** TCP discard port used in offer/answer */
32 #define TCP_DISCARD_PORT 9
33 
34 
35 /** MRCPv2 proto transport */
36 typedef enum {
37  MRCP_PROTO_TCP,
38  MRCP_PROTO_TLS,
39 
40  MRCP_PROTO_COUNT,
41  MRCP_PROTO_UNKNOWN = MRCP_PROTO_COUNT
43 
44 
45 /** MRCPv2 attributes */
46 typedef enum {
47  MRCP_ATTRIB_SETUP,
48  MRCP_ATTRIB_CONNECTION,
49  MRCP_ATTRIB_RESOURCE,
50  MRCP_ATTRIB_CHANNEL,
51  MRCP_ATTRIB_CMID,
52 
53  MRCP_ATTRIB_COUNT,
54  MRCP_ATTRIB_UNKNOWN = MRCP_ATTRIB_COUNT
56 
57 
58 /** MRCPv2 setup attributes */
59 typedef enum {
60  MRCP_SETUP_TYPE_ACTIVE,
61  MRCP_SETUP_TYPE_PASSIVE,
62 
63  MRCP_SETUP_TYPE_COUNT,
64  MRCP_SETUP_TYPE_UNKNOWN = MRCP_SETUP_TYPE_COUNT
66 
67 /** MRCPv2 connection attributes */
68 typedef enum {
69  MRCP_CONNECTION_TYPE_NEW,
70  MRCP_CONNECTION_TYPE_EXISTING,
71 
72  MRCP_CONNECTION_TYPE_COUNT,
73  MRCP_CONNECTION_TYPE_UNKNOWN = MRCP_CONNECTION_TYPE_COUNT
75 
76 
77 /** MRCPv2 control descriptor */
79  /** IP address */
81  /** Port */
82  apr_port_t port;
83  /** Protocol type */
85  /** Setup type */
87  /** Connection type */
89  /** Resource name */
91  /** Session identifier */
93  /** Array of cmid attributes */
94  apr_array_header_t *cmid_arr;
95  /** Base identifier */
96  apr_size_t id;
97 };
98 
99 
100 /** Create MRCP control descriptor */
102 
103 /** Create MRCP control offer */
105 
106 /** Create MRCP control answer */
108 
109 /** Copy MRCP control offer */
111 
112 /** Compare MRCP control descriptors */
114 
115 /** Add cmid to cmid_arr */
116 MRCP_DECLARE(void) mrcp_cmid_add(apr_array_header_t *cmid_arr, apr_size_t cmid);
117 
118 /** Find cmid in cmid_arr */
119 MRCP_DECLARE(apt_bool_t) mrcp_cmid_find(const apr_array_header_t *cmid_arr, apr_size_t cmid);
120 
121 /** Get MRCP protocol transport name by identifier */
123 
124 /** Find MRCP protocol transport identifier by name */
126 
127 
128 /** Get MRCP attribute name by identifier */
130 
131 /** Find MRCP attribute identifier by name */
133 
134 
135 /** Get MRCP setup type name by identifier */
137 
138 /** Find MRCP setup type identifier by name */
140 
141 
142 /** Get MRCP connection type name by identifier */
144 
145 /** Find MRCP connection type identifier by name */
147 
148 
150 
151 #endif /* MRCP_CONTROL_DESCRIPTOR_H */
#define MRCP_DECLARE(type)
Definition: mrcp.h:40
mrcp_connection_type_e connection_type
Definition: mrcp_control_descriptor.h:88
apt_str_t session_id
Definition: mrcp_control_descriptor.h:92
#define APT_END_EXTERN_C
Definition: apt.h:38
apt_bool_t mrcp_control_descriptors_compare(const mrcp_control_descriptor_t *descriptor1, const mrcp_control_descriptor_t *descriptor2)
int apt_bool_t
Definition: apt.h:57
Definition: mrcp_control_descriptor.h:78
mrcp_attrib_e mrcp_attrib_id_find(const apt_str_t *attrib)
mrcp_proto_type_e proto
Definition: mrcp_control_descriptor.h:84
const apt_str_t * mrcp_setup_type_get(mrcp_setup_type_e setup_type)
const apt_str_t * mrcp_attrib_str_get(mrcp_attrib_e attrib_id)
mrcp_setup_type_e
Definition: mrcp_control_descriptor.h:59
MRCP Connection Types Declaration.
apr_port_t port
Definition: mrcp_control_descriptor.h:82
#define APT_BEGIN_EXTERN_C
Definition: apt.h:36
mrcp_proto_type_e
Definition: mrcp_control_descriptor.h:36
mrcp_setup_type_e mrcp_setup_type_find(const apt_str_t *attrib)
apt_str_t ip
Definition: mrcp_control_descriptor.h:80
mrcp_control_descriptor_t * mrcp_control_answer_create(const mrcp_control_descriptor_t *offer, apr_pool_t *pool)
mrcp_control_descriptor_t * mrcp_control_offer_copy(const mrcp_control_descriptor_t *offer, apr_pool_t *pool)
mrcp_setup_type_e setup_type
Definition: mrcp_control_descriptor.h:86
apr_size_t id
Definition: mrcp_control_descriptor.h:96
mrcp_proto_type_e mrcp_proto_find(const apt_str_t *attrib)
mrcp_control_descriptor_t * mrcp_control_descriptor_create(apr_pool_t *pool)
mrcp_connection_type_e
Definition: mrcp_control_descriptor.h:68
mrcp_attrib_e
Definition: mrcp_control_descriptor.h:46
mrcp_control_descriptor_t * mrcp_control_offer_create(apr_pool_t *pool)
Definition: apt_string.h:36
apr_array_header_t * cmid_arr
Definition: mrcp_control_descriptor.h:94
apt_bool_t mrcp_cmid_find(const apr_array_header_t *cmid_arr, apr_size_t cmid)
apt_str_t resource_name
Definition: mrcp_control_descriptor.h:90
mrcp_connection_type_e mrcp_connection_type_find(const apt_str_t *attrib)
const apt_str_t * mrcp_connection_type_get(mrcp_connection_type_e connection_type)
const apt_str_t * mrcp_proto_get(mrcp_proto_type_e proto)
String Representation.
void mrcp_cmid_add(apr_array_header_t *cmid_arr, apr_size_t cmid)