UniMRCP  1.3.0
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
mrcp_start_line.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_start_line.h 2136 2014-07-04 06:33:36Z achaloyan@gmail.com $
17  */
18 
19 #ifndef MRCP_START_LINE_H
20 #define MRCP_START_LINE_H
21 
22 /**
23  * @file mrcp_start_line.h
24  * @brief MRCP Start Line Definition
25  */
26 
27 #include "mrcp_types.h"
28 #include "apt_text_stream.h"
29 
31 
32 /** Request-states used in MRCP response message */
33 typedef enum {
34  /** The request was processed to completion and there will be no
35  more events from that resource to the client with that request-id */
37  /** Indicate that further event messages will be delivered with that request-id */
39  /** The job has been placed on a queue and will be processed in first-in-first-out order */
41 
42  /** Number of request states */
44  /** Unknown request state */
47 
48 /** Status codes */
49 typedef enum {
50  MRCP_STATUS_CODE_UNKNOWN = 0,
51  /* success codes (2xx) */
52  MRCP_STATUS_CODE_SUCCESS = 200,
53  MRCP_STATUS_CODE_SUCCESS_WITH_IGNORE = 201,
54  /* failure codes (4xx) */
55  MRCP_STATUS_CODE_METHOD_NOT_ALLOWED = 401,
56  MRCP_STATUS_CODE_METHOD_NOT_VALID = 402,
57  MRCP_STATUS_CODE_UNSUPPORTED_PARAM = 403,
58  MRCP_STATUS_CODE_ILLEGAL_PARAM_VALUE = 404,
59  MRCP_STATUS_CODE_NOT_FOUND = 405,
60  MRCP_STATUS_CODE_MISSING_PARAM = 406,
61  MRCP_STATUS_CODE_METHOD_FAILED = 407,
62  MRCP_STATUS_CODE_UNRECOGNIZED_MESSAGE = 408,
63  MRCP_STATUS_CODE_UNSUPPORTED_PARAM_VALUE = 409,
64  MRCP_STATUS_CODE_OUT_OF_ORDER = 410,
65  MRCP_STATUS_CODE_RESOURCE_SPECIFIC_FAILURE = 421
67 
68 /** MRCP message types */
69 typedef enum {
70  MRCP_MESSAGE_TYPE_UNKNOWN,
71  MRCP_MESSAGE_TYPE_REQUEST,
72  MRCP_MESSAGE_TYPE_RESPONSE,
73  MRCP_MESSAGE_TYPE_EVENT
75 
76 
77 /** MRCP start-line declaration */
79 
80 /** Start-line of MRCP message */
82  /** MRCP message type */
84  /** Version of protocol in use */
86  /** Specify the length of the message, including the start-line (v2) */
87  apr_size_t length;
88  /** Unique identifier among client and server */
90  /** MRCP method name */
92  /** MRCP method id (associated with method name) */
94  /** Success or failure or other status of the request */
96  /** The state of the job initiated by the request */
98 };
99 
100 /** Initialize MRCP start-line */
102 /** Parse MRCP start-line */
103 MRCP_DECLARE(apt_bool_t) mrcp_start_line_parse(mrcp_start_line_t *start_line, apt_str_t *str, apr_pool_t *pool);
104 /** Generate MRCP start-line */
106 /** Finalize MRCP start-line generation */
107 MRCP_DECLARE(apt_bool_t) mrcp_start_line_finalize(mrcp_start_line_t *start_line, apr_size_t content_length, apt_text_stream_t *text_stream);
108 
109 /** Parse MRCP request-id */
111 /** Generate MRCP request-id */
113 
114 
116 
117 #endif /* MRCP_START_LINE_H */