UniMRCP
1.2.0
Main Page
Related Pages
Data Structures
Files
File List
Globals
All
Data Structures
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Macros
Pages
libs
mrcp-client
include
mrcp_client_session.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_client_session.h 2136 2014-07-04 06:33:36Z achaloyan@gmail.com $
17
*/
18
19
#ifndef MRCP_CLIENT_SESSION_H
20
#define MRCP_CLIENT_SESSION_H
21
22
/**
23
* @file mrcp_client_session.h
24
* @brief MRCP Client Session
25
*/
26
27
#include "
mrcp_client_types.h
"
28
#include "
mrcp_application.h
"
29
#include "
mrcp_session.h
"
30
#include "
mpf_engine.h
"
31
#include "
apt_task_msg.h
"
32
#include "
apt_obj_list.h
"
33
34
APT_BEGIN_EXTERN_C
35
36
/** RTP termination slot declaration */
37
typedef
struct
rtp_termination_slot_t
rtp_termination_slot_t
;
38
39
/** MRCP client session declaration */
40
typedef
struct
mrcp_client_session_t
mrcp_client_session_t
;
41
42
/** Client session states */
43
typedef
enum
{
44
SESSION_STATE_NONE
,
45
SESSION_STATE_GENERATING_OFFER,
46
SESSION_STATE_PROCESSING_ANSWER,
47
SESSION_STATE_TERMINATING
,
48
SESSION_STATE_DISCOVERING
49
}
mrcp_client_session_state_e
;
50
51
/** MRCP client session */
52
struct
mrcp_client_session_t
{
53
/** Session base */
54
mrcp_session_t
base
;
55
/** Application session belongs to */
56
mrcp_application_t
*
application
;
57
/** External object associated with session */
58
void
*
app_obj
;
59
/** Profile to use */
60
mrcp_profile_t
*
profile
;
61
62
/** Media context */
63
mpf_context_t
*
context
;
64
/** Codec manager */
65
const
mpf_codec_manager_t
*
codec_manager
;
66
67
68
/** RTP termination array (mrcp_termination_slot_t) */
69
apr_array_header_t *
terminations
;
70
/** MRCP control channel array (mrcp_channel_t*) */
71
apr_array_header_t *
channels
;
72
73
/** Indicates whether session is already added to session table */
74
apt_bool_t
registered
;
75
76
/** In-progress offer */
77
mrcp_session_descriptor_t
*
offer
;
78
/** In-progress answer */
79
mrcp_session_descriptor_t
*
answer
;
80
81
/** MRCP application active request */
82
const
mrcp_app_message_t
*
active_request
;
83
/** MRCP application request queue */
84
apt_obj_list_t
*
request_queue
;
85
86
/** MPF task message, which construction is in progress */
87
mpf_task_msg_t
*
mpf_task_msg
;
88
89
/** Session state */
90
mrcp_client_session_state_e
state
;
91
/** Status code of the app response to be generated */
92
mrcp_sig_status_code_e
status
;
93
/** Number of in-progress sub requests */
94
apr_size_t
subrequest_count
;
95
/** True, if server unexpectedly closed session/connection */
96
apt_bool_t
disconnected
;
97
};
98
99
/** MRCP channel */
100
struct
mrcp_channel_t
{
101
/** Memory pool */
102
apr_pool_t *
pool
;
103
/** External object associated with channel */
104
void
*
obj
;
105
/** MRCP resource */
106
mrcp_resource_t
*
resource
;
107
/** MRCP session entire channel belongs to */
108
mrcp_session_t
*
session
;
109
/** MRCP control channel */
110
mrcp_control_channel_t
*
control_channel
;
111
/** Media termination */
112
mpf_termination_t
*
termination
;
113
/** Associated RTP termination slot */
114
rtp_termination_slot_t
*
rtp_termination_slot
;
115
116
/** waiting state of control channel */
117
apt_bool_t
waiting_for_channel
;
118
/** waiting state of media termination */
119
apt_bool_t
waiting_for_termination
;
120
};
121
122
/** RTP termination slot */
123
struct
rtp_termination_slot_t
{
124
/** waiting state */
125
apt_bool_t
waiting
;
126
/** RTP termination */
127
mpf_termination_t
*
termination
;
128
/** RTP termination descriptor */
129
mpf_rtp_termination_descriptor_t
*
descriptor
;
130
/** Associated MRCP channel */
131
mrcp_channel_t
*
channel
;
132
/** media descriptor id (index of media in session descriptor) */
133
apr_size_t
id
;
134
};
135
136
137
/** MRCP profile */
138
struct
mrcp_profile_t
{
139
/** Unique profile name */
140
const
char
*
name
;
141
/** Arbitrary tag set/used by user application */
142
const
char
*
tag
;
143
/** MRCP version */
144
mrcp_version_e
mrcp_version
;
145
/** MRCP resource factory */
146
mrcp_resource_factory_t
*
resource_factory
;
147
/** Media engine factory */
148
mpf_engine_factory_t
*
mpf_factory
;
149
/** RTP termination factory */
150
mpf_termination_factory_t
*
rtp_termination_factory
;
151
/** Signaling agent factory */
152
mrcp_sa_factory_t
*
sa_factory
;
153
/** Connection agent factory */
154
mrcp_ca_factory_t
*
ca_factory
;
155
/** Signaling settings */
156
mrcp_sig_settings_t
*
signaling_settings
;
157
/** RTP settings */
158
mpf_rtp_settings_t
*
rtp_settings
;
159
};
160
161
/** MRCP application */
162
struct
mrcp_application_t
{
163
/** External object associated with the application */
164
void
*
obj
;
165
/** Application message handler */
166
mrcp_app_message_handler_f
handler
;
167
/** MRCP client */
168
mrcp_client_t
*
client
;
169
/** Application task message pool */
170
apt_task_msg_pool_t
*
msg_pool
;
171
};
172
173
/** Create channel */
174
mrcp_channel_t
*
mrcp_client_channel_create
(
175
mrcp_client_session_t
*session,
176
mrcp_resource_t
*resource,
177
mpf_termination_t
*termination,
178
mpf_rtp_termination_descriptor_t
*rtp_descriptor,
179
void
*obj);
180
181
/** Create signaling app_message_t request */
182
mrcp_app_message_t
*
mrcp_client_app_signaling_request_create
(
mrcp_sig_command_e
command_id, apr_pool_t *pool);
183
/** Create signaling app_message_t event */
184
mrcp_app_message_t
*
mrcp_client_app_signaling_event_create
(
mrcp_sig_event_e
event_id, apr_pool_t *pool);
185
/** Create control app_message_t */
186
mrcp_app_message_t
*
mrcp_client_app_control_message_create
(apr_pool_t *pool);
187
188
/** Process application message */
189
apt_bool_t
mrcp_client_app_message_process
(
mrcp_app_message_t
*app_message);
190
/** Process MPF message */
191
apt_bool_t
mrcp_client_mpf_message_process
(
mpf_message_container_t
*mpf_message_container);
192
193
/** Process session answer */
194
apt_bool_t
mrcp_client_session_answer_process
(
mrcp_client_session_t
*session,
mrcp_session_descriptor_t
*descriptor);
195
/** Process session termination response */
196
apt_bool_t
mrcp_client_session_terminate_response_process
(
mrcp_client_session_t
*session);
197
/** Process session control response */
198
apt_bool_t
mrcp_client_session_control_response_process
(
mrcp_client_session_t
*session,
mrcp_message_t
*message);
199
/** Process resource discovery response */
200
apt_bool_t
mrcp_client_session_discover_response_process
(
mrcp_client_session_t
*session,
mrcp_session_descriptor_t
*descriptor);
201
/** Process session termination event */
202
apt_bool_t
mrcp_client_session_terminate_event_process
(
mrcp_client_session_t
*session);
203
204
/** Process channel add event */
205
apt_bool_t
mrcp_client_on_channel_add
(
mrcp_channel_t
*channel,
mrcp_control_descriptor_t
*descriptor,
apt_bool_t
status);
206
/** Process channel modify event */
207
apt_bool_t
mrcp_client_on_channel_modify
(
mrcp_channel_t
*channel,
mrcp_control_descriptor_t
*descriptor,
apt_bool_t
status);
208
/** Process channel remove event */
209
apt_bool_t
mrcp_client_on_channel_remove
(
mrcp_channel_t
*channel,
apt_bool_t
status);
210
/** Process message receive event */
211
apt_bool_t
mrcp_client_on_message_receive
(
mrcp_channel_t
*channel,
mrcp_message_t
*message);
212
/** Process disconnect event */
213
apt_bool_t
mrcp_client_on_disconnect
(
mrcp_channel_t
*channel);
214
215
APT_END_EXTERN_C
216
217
#endif
/* MRCP_CLIENT_SESSION_H */
Generated on Sun Jul 6 2014 22:12:45 for UniMRCP by
1.8.3.1