00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #ifndef MRCP_CONTROL_DESCRIPTOR_H
00020 #define MRCP_CONTROL_DESCRIPTOR_H
00021
00022
00023
00024
00025
00026
00027 #include <apr_tables.h>
00028 #include "apt_string.h"
00029 #include "mrcp_connection_types.h"
00030
00031 APT_BEGIN_EXTERN_C
00032
00033
00034 #define TCP_DISCARD_PORT 9
00035
00036
00037
00038 typedef enum {
00039 MRCP_PROTO_TCP,
00040 MRCP_PROTO_TLS,
00041
00042 MRCP_PROTO_COUNT,
00043 MRCP_PROTO_UNKNOWN = MRCP_PROTO_COUNT
00044 }mrcp_proto_type_e;
00045
00046
00047
00048 typedef enum {
00049 MRCP_ATTRIB_SETUP,
00050 MRCP_ATTRIB_CONNECTION,
00051 MRCP_ATTRIB_RESOURCE,
00052 MRCP_ATTRIB_CHANNEL,
00053 MRCP_ATTRIB_CMID,
00054
00055 MRCP_ATTRIB_COUNT,
00056 MRCP_ATTRIB_UNKNOWN = MRCP_ATTRIB_COUNT
00057 }mrcp_attrib_e;
00058
00059
00060
00061 typedef enum {
00062 MRCP_SETUP_TYPE_ACTIVE,
00063 MRCP_SETUP_TYPE_PASSIVE,
00064
00065 MRCP_SETUP_TYPE_COUNT,
00066 MRCP_SETUP_TYPE_UNKNOWN = MRCP_SETUP_TYPE_COUNT
00067 } mrcp_setup_type_e;
00068
00069
00070 typedef enum {
00071 MRCP_CONNECTION_TYPE_NEW,
00072 MRCP_CONNECTION_TYPE_EXISTING,
00073
00074 MRCP_CONNECTION_TYPE_COUNT,
00075 MRCP_CONNECTION_TYPE_UNKNOWN = MRCP_CONNECTION_TYPE_COUNT
00076 } mrcp_connection_type_e;
00077
00078
00079
00080 struct mrcp_control_descriptor_t {
00081
00082 apt_str_t ip;
00083
00084 apr_port_t port;
00085
00086 mrcp_proto_type_e proto;
00087
00088 mrcp_setup_type_e setup_type;
00089
00090 mrcp_connection_type_e connection_type;
00091
00092 apt_str_t resource_name;
00093
00094 apt_str_t session_id;
00095
00096 apr_array_header_t *cmid_arr;
00097
00098 apr_size_t id;
00099 };
00100
00101
00102
00103 MRCP_DECLARE(mrcp_control_descriptor_t*) mrcp_control_descriptor_create(apr_pool_t *pool);
00104
00105
00106 MRCP_DECLARE(mrcp_control_descriptor_t*) mrcp_control_offer_create(apr_pool_t *pool);
00107
00108
00109 MRCP_DECLARE(mrcp_control_descriptor_t*) mrcp_control_answer_create(mrcp_control_descriptor_t *offer, apr_pool_t *pool);
00110
00111
00112 MRCP_DECLARE(void) mrcp_cmid_add(apr_array_header_t *cmid_arr, apr_size_t cmid);
00113
00114
00115 MRCP_DECLARE(apt_bool_t) mrcp_cmid_find(const apr_array_header_t *cmid_arr, apr_size_t cmid);
00116
00117
00118 MRCP_DECLARE(const apt_str_t*) mrcp_proto_get(mrcp_proto_type_e proto);
00119
00120
00121 MRCP_DECLARE(mrcp_proto_type_e) mrcp_proto_find(const apt_str_t *attrib);
00122
00123
00124
00125 MRCP_DECLARE(const apt_str_t*) mrcp_attrib_str_get(mrcp_attrib_e attrib_id);
00126
00127
00128 MRCP_DECLARE(mrcp_attrib_e) mrcp_attrib_id_find(const apt_str_t *attrib);
00129
00130
00131
00132 MRCP_DECLARE(const apt_str_t*) mrcp_setup_type_get(mrcp_setup_type_e setup_type);
00133
00134
00135 MRCP_DECLARE(mrcp_setup_type_e) mrcp_setup_type_find(const apt_str_t *attrib);
00136
00137
00138
00139 MRCP_DECLARE(const apt_str_t*) mrcp_connection_type_get(mrcp_connection_type_e connection_type);
00140
00141
00142 MRCP_DECLARE(mrcp_connection_type_e) mrcp_connection_type_find(const apt_str_t *attrib);
00143
00144
00145 APT_END_EXTERN_C
00146
00147 #endif