UniMRCP  1.3.0
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
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 
35 
36 /** RTP termination slot declaration */
38 
39 /** MRCP client session declaration */
41 
42 /** Client session states */
43 typedef enum {
45  SESSION_STATE_GENERATING_OFFER,
46  SESSION_STATE_PROCESSING_ANSWER,
48  SESSION_STATE_DISCOVERING
50 
51 /** MRCP client session */
53  /** Session base */
55  /** Application session belongs to */
57  /** External object associated with session */
58  void *app_obj;
59  /** Profile to use */
61 
62  /** Media context */
64  /** 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 */
74 
75  /** In-progress offer */
77  /** In-progress answer */
79 
80  /** MRCP application active request */
82  /** MRCP application request queue */
84 
85  /** MPF task message, which construction is in progress */
87 
88  /** Session state */
90  /** Status code of the app response to be generated */
92  /** Number of in-progress sub requests */
93  apr_size_t subrequest_count;
94  /** True, if server unexpectedly closed session/connection */
96 };
97 
98 /** MRCP channel */
100  /** Memory pool */
101  apr_pool_t *pool;
102  /** External object associated with channel */
103  void *obj;
104  /** MRCP resource */
106  /** MRCP session entire channel belongs to */
108  /** MRCP control channel */
110  /** Media termination */
112  /** Associated RTP termination slot */
114 
115  /** waiting state of control channel */
117  /** waiting state of media termination */
119 };
120 
121 /** RTP termination slot */
123  /** waiting state */
125  /** RTP termination */
127  /** RTP termination descriptor */
129  /** Associated MRCP channel */
131  /** media descriptor id (index of media in session descriptor) */
132  apr_size_t id;
133 };
134 
135 /** MRCP client profile */
137  /** Unique profile name */
138  const char *name;
139  /** Arbitrary tag set/used by user application */
140  const char *tag;
141  /** MRCP version */
143  /** MRCP resource factory */
145  /** Media engine factory */
147  /** RTP termination factory */
149  /** Signaling agent factory */
151  /** Connection agent factory */
153  /** Signaling settings */
155  /** RTP settings */
157 };
158 
159 /** MRCP application */
161  /** External object associated with the application */
162  void *obj;
163  /** Application message handler */
165  /** MRCP client */
167  /** Application task message pool */
169 };
170 
171 /** Create channel */
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 */
181 /** Create signaling app_message_t event */
183 /** Create control app_message_t */
185 
186 /** Process application message */
188 /** Process MPF message */
190 
191 /** Process session answer */
193 /** Process session termination response */
195 /** Process session control response */
197 /** Process resource discovery response */
199 /** Process session termination event */
201 
202 /** Process channel add event */
204 /** Process channel modify event */
206 /** Process channel remove event */
208 /** Process message receive event */
210 /** Process disconnect event */
212 
214 
215 #endif /* MRCP_CLIENT_SESSION_H */