UniMRCP  1.2.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 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 
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 
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 */
75 
76  /** In-progress offer */
78  /** In-progress answer */
80 
81  /** MRCP application active request */
83  /** MRCP application request queue */
85 
86  /** MPF task message, which construction is in progress */
88 
89  /** Session state */
91  /** Status code of the app response to be generated */
93  /** Number of in-progress sub requests */
94  apr_size_t subrequest_count;
95  /** True, if server unexpectedly closed session/connection */
97 };
98 
99 /** MRCP channel */
101  /** Memory pool */
102  apr_pool_t *pool;
103  /** External object associated with channel */
104  void *obj;
105  /** MRCP resource */
107  /** MRCP session entire channel belongs to */
109  /** MRCP control channel */
111  /** Media termination */
113  /** Associated RTP termination slot */
115 
116  /** waiting state of control channel */
118  /** waiting state of media termination */
120 };
121 
122 /** RTP termination slot */
124  /** waiting state */
126  /** RTP termination */
128  /** RTP termination descriptor */
130  /** Associated MRCP channel */
132  /** media descriptor id (index of media in session descriptor) */
133  apr_size_t id;
134 };
135 
136 
137 /** MRCP profile */
139  /** Unique profile name */
140  const char *name;
141  /** Arbitrary tag set/used by user application */
142  const char *tag;
143  /** MRCP version */
145  /** MRCP resource factory */
147  /** Media engine factory */
149  /** RTP termination factory */
151  /** Signaling agent factory */
153  /** Connection agent factory */
155  /** Signaling settings */
157  /** RTP settings */
159 };
160 
161 /** MRCP application */
163  /** External object associated with the application */
164  void *obj;
165  /** Application message handler */
167  /** MRCP client */
169  /** Application task message pool */
171 };
172 
173 /** Create channel */
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 */
183 /** Create signaling app_message_t event */
185 /** Create control app_message_t */
187 
188 /** Process application message */
190 /** Process MPF message */
192 
193 /** Process session answer */
195 /** Process session termination response */
197 /** Process session control response */
199 /** Process resource discovery response */
201 /** Process session termination event */
203 
204 /** Process channel add event */
206 /** Process channel modify event */
208 /** Process channel remove event */
210 /** Process message receive event */
212 /** Process disconnect event */
214 
216 
217 #endif /* MRCP_CLIENT_SESSION_H */