UniMRCP
1.3.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 2251 2014-11-21 02:36:44Z 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_client_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
/** RTP termination array (mrcp_termination_slot_t) */
68
apr_array_header_t *
terminations
;
69
/** MRCP control channel array (mrcp_channel_t*) */
70
apr_array_header_t *
channels
;
71
72
/** Indicates whether session is already added to session table */
73
apt_bool_t
registered
;
74
75
/** In-progress offer */
76
mrcp_session_descriptor_t
*
offer
;
77
/** In-progress answer */
78
mrcp_session_descriptor_t
*
answer
;
79
80
/** MRCP application active request */
81
const
mrcp_app_message_t
*
active_request
;
82
/** MRCP application request queue */
83
apt_obj_list_t
*
request_queue
;
84
85
/** MPF task message, which construction is in progress */
86
mpf_task_msg_t
*
mpf_task_msg
;
87
88
/** Session state */
89
mrcp_client_session_state_e
state
;
90
/** Status code of the app response to be generated */
91
mrcp_sig_status_code_e
status
;
92
/** Number of in-progress sub requests */
93
apr_size_t
subrequest_count
;
94
/** True, if server unexpectedly closed session/connection */
95
apt_bool_t
disconnected
;
96
};
97
98
/** MRCP channel */
99
struct
mrcp_channel_t
{
100
/** Memory pool */
101
apr_pool_t *
pool
;
102
/** External object associated with channel */
103
void
*
obj
;
104
/** MRCP resource */
105
mrcp_resource_t
*
resource
;
106
/** MRCP session entire channel belongs to */
107
mrcp_session_t
*
session
;
108
/** MRCP control channel */
109
mrcp_control_channel_t
*
control_channel
;
110
/** Media termination */
111
mpf_termination_t
*
termination
;
112
/** Associated RTP termination slot */
113
rtp_termination_slot_t
*
rtp_termination_slot
;
114
115
/** waiting state of control channel */
116
apt_bool_t
waiting_for_channel
;
117
/** waiting state of media termination */
118
apt_bool_t
waiting_for_termination
;
119
};
120
121
/** RTP termination slot */
122
struct
rtp_termination_slot_t
{
123
/** waiting state */
124
apt_bool_t
waiting
;
125
/** RTP termination */
126
mpf_termination_t
*
termination
;
127
/** RTP termination descriptor */
128
mpf_rtp_termination_descriptor_t
*
descriptor
;
129
/** Associated MRCP channel */
130
mrcp_channel_t
*
channel
;
131
/** media descriptor id (index of media in session descriptor) */
132
apr_size_t
id
;
133
};
134
135
/** MRCP client profile */
136
struct
mrcp_client_profile_t
{
137
/** Unique profile name */
138
const
char
*
name
;
139
/** Arbitrary tag set/used by user application */
140
const
char
*
tag
;
141
/** MRCP version */
142
mrcp_version_e
mrcp_version
;
143
/** MRCP resource factory */
144
mrcp_resource_factory_t
*
resource_factory
;
145
/** Media engine factory */
146
mpf_engine_factory_t
*
mpf_factory
;
147
/** RTP termination factory */
148
mpf_termination_factory_t
*
rtp_termination_factory
;
149
/** Signaling agent factory */
150
mrcp_sa_factory_t
*
sa_factory
;
151
/** Connection agent factory */
152
mrcp_ca_factory_t
*
ca_factory
;
153
/** Signaling settings */
154
mrcp_sig_settings_t
*
signaling_settings
;
155
/** RTP settings */
156
mpf_rtp_settings_t
*
rtp_settings
;
157
};
158
159
/** MRCP application */
160
struct
mrcp_application_t
{
161
/** External object associated with the application */
162
void
*
obj
;
163
/** Application message handler */
164
mrcp_app_message_handler_f
handler
;
165
/** MRCP client */
166
mrcp_client_t
*
client
;
167
/** Application task message pool */
168
apt_task_msg_pool_t
*
msg_pool
;
169
};
170
171
/** Create channel */
172
mrcp_channel_t
*
mrcp_client_channel_create
(
173
mrcp_client_session_t
*session,
174
mrcp_resource_t
*resource,
175
mpf_termination_t
*termination,
176
mpf_rtp_termination_descriptor_t
*rtp_descriptor,
177
void
*obj);
178
179
/** Create signaling app_message_t request */
180
mrcp_app_message_t
*
mrcp_client_app_signaling_request_create
(
mrcp_sig_command_e
command_id, apr_pool_t *pool);
181
/** Create signaling app_message_t event */
182
mrcp_app_message_t
*
mrcp_client_app_signaling_event_create
(
mrcp_sig_event_e
event_id, apr_pool_t *pool);
183
/** Create control app_message_t */
184
mrcp_app_message_t
*
mrcp_client_app_control_message_create
(apr_pool_t *pool);
185
186
/** Process application message */
187
apt_bool_t
mrcp_client_app_message_process
(
mrcp_app_message_t
*app_message);
188
/** Process MPF message */
189
apt_bool_t
mrcp_client_mpf_message_process
(
mpf_message_container_t
*mpf_message_container);
190
191
/** Process session answer */
192
apt_bool_t
mrcp_client_session_answer_process
(
mrcp_client_session_t
*session,
mrcp_session_descriptor_t
*descriptor);
193
/** Process session termination response */
194
apt_bool_t
mrcp_client_session_terminate_response_process
(
mrcp_client_session_t
*session);
195
/** Process session control response */
196
apt_bool_t
mrcp_client_session_control_response_process
(
mrcp_client_session_t
*session,
mrcp_message_t
*message);
197
/** Process resource discovery response */
198
apt_bool_t
mrcp_client_session_discover_response_process
(
mrcp_client_session_t
*session,
mrcp_session_descriptor_t
*descriptor);
199
/** Process session termination event */
200
apt_bool_t
mrcp_client_session_terminate_event_process
(
mrcp_client_session_t
*session);
201
202
/** Process channel add event */
203
apt_bool_t
mrcp_client_on_channel_add
(
mrcp_channel_t
*channel,
mrcp_control_descriptor_t
*descriptor,
apt_bool_t
status);
204
/** Process channel modify event */
205
apt_bool_t
mrcp_client_on_channel_modify
(
mrcp_channel_t
*channel,
mrcp_control_descriptor_t
*descriptor,
apt_bool_t
status);
206
/** Process channel remove event */
207
apt_bool_t
mrcp_client_on_channel_remove
(
mrcp_channel_t
*channel,
apt_bool_t
status);
208
/** Process message receive event */
209
apt_bool_t
mrcp_client_on_message_receive
(
mrcp_channel_t
*channel,
mrcp_message_t
*message);
210
/** Process disconnect event */
211
apt_bool_t
mrcp_client_on_disconnect
(
mrcp_channel_t
*channel);
212
213
APT_END_EXTERN_C
214
215
#endif
/* MRCP_CLIENT_SESSION_H */
Generated on Mon Feb 2 2015 19:41:39 for UniMRCP by
1.8.3.1