UniMRCP  1.7.0
mrcp_start_line.h
Go to the documentation of this file.
1 /*
2  * Copyright 2008-2015 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 
17 #ifndef MRCP_START_LINE_H
18 #define MRCP_START_LINE_H
19 
20 /**
21  * @file mrcp_start_line.h
22  * @brief MRCP Start Line Definition
23  */
24 
25 #include "mrcp_types.h"
26 #include "apt_text_stream.h"
27 
29 
30 /** Request-states used in MRCP response message */
31 typedef enum {
32  /** The request was processed to completion and there will be no
33  more events from that resource to the client with that request-id */
35  /** Indicate that further event messages will be delivered with that request-id */
37  /** The job has been placed on a queue and will be processed in first-in-first-out order */
39 
40  /** Number of request states */
42  /** Unknown request state */
45 
46 /** Status codes */
47 typedef enum {
48  MRCP_STATUS_CODE_UNKNOWN = 0,
49  /* success codes (2xx) */
50  MRCP_STATUS_CODE_SUCCESS = 200,
51  MRCP_STATUS_CODE_SUCCESS_WITH_IGNORE = 201,
52  /* failure codes (4xx) */
53  MRCP_STATUS_CODE_METHOD_NOT_ALLOWED = 401,
54  MRCP_STATUS_CODE_METHOD_NOT_VALID = 402,
55  MRCP_STATUS_CODE_UNSUPPORTED_PARAM = 403,
56  MRCP_STATUS_CODE_ILLEGAL_PARAM_VALUE = 404,
57  MRCP_STATUS_CODE_NOT_FOUND = 405,
58  MRCP_STATUS_CODE_MISSING_PARAM = 406,
59  MRCP_STATUS_CODE_METHOD_FAILED = 407,
60  MRCP_STATUS_CODE_UNRECOGNIZED_MESSAGE = 408,
61  MRCP_STATUS_CODE_UNSUPPORTED_PARAM_VALUE = 409,
62  MRCP_STATUS_CODE_OUT_OF_ORDER = 410,
63  MRCP_STATUS_CODE_RESOURCE_SPECIFIC_FAILURE = 421
65 
66 /** MRCP message types */
67 typedef enum {
68  MRCP_MESSAGE_TYPE_UNKNOWN,
69  MRCP_MESSAGE_TYPE_REQUEST,
70  MRCP_MESSAGE_TYPE_RESPONSE,
71  MRCP_MESSAGE_TYPE_EVENT
73 
74 
75 /** MRCP start-line declaration */
77 
78 /** Start-line of MRCP message */
80  /** MRCP message type */
82  /** Version of protocol in use */
84  /** Specify the length of the message, including the start-line (v2) */
85  apr_size_t length;
86  /** Unique identifier among client and server */
88  /** MRCP method name */
90  /** MRCP method id (associated with method name) */
92  /** Success or failure or other status of the request */
94  /** The state of the job initiated by the request */
96 };
97 
98 /** Initialize MRCP start-line */
100 /** Parse MRCP start-line */
101 MRCP_DECLARE(apt_bool_t) mrcp_start_line_parse(mrcp_start_line_t *start_line, apt_str_t *str, apr_pool_t *pool);
102 /** Generate MRCP start-line */
104 /** Finalize MRCP start-line generation */
105 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);
106 
107 /** Parse MRCP request-id */
109 /** Generate MRCP request-id */
111 
112 
114 
115 #endif /* MRCP_START_LINE_H */
Definition: mrcp_start_line.h:79
#define MRCP_DECLARE(type)
Definition: mrcp.h:40
apt_bool_t mrcp_start_line_finalize(mrcp_start_line_t *start_line, apr_size_t content_length, apt_text_stream_t *text_stream)
apr_size_t mrcp_method_id
Definition: mrcp_types.h:66
Definition: mrcp_start_line.h:43
Definition: apt_text_stream.h:43
mrcp_method_id method_id
Definition: mrcp_start_line.h:91
#define APT_END_EXTERN_C
Definition: apt.h:38
mrcp_request_id request_id
Definition: mrcp_start_line.h:87
int apt_bool_t
Definition: apt.h:57
apt_bool_t mrcp_start_line_parse(mrcp_start_line_t *start_line, apt_str_t *str, apr_pool_t *pool)
mrcp_request_id mrcp_request_id_parse(const apt_str_t *field)
mrcp_message_type_e message_type
Definition: mrcp_start_line.h:81
mrcp_version_e
Definition: mrcp_types.h:30
Definition: mrcp_start_line.h:38
#define APT_BEGIN_EXTERN_C
Definition: apt.h:36
Basic MRCP Types.
void mrcp_start_line_init(mrcp_start_line_t *start_line)
Definition: mrcp_start_line.h:34
mrcp_request_state_e
Definition: mrcp_start_line.h:31
Definition: apt_string.h:36
apt_bool_t mrcp_request_id_generate(mrcp_request_id request_id, apt_text_stream_t *stream)
apt_bool_t mrcp_start_line_generate(mrcp_start_line_t *start_line, apt_text_stream_t *text_stream)
mrcp_version_e version
Definition: mrcp_start_line.h:83
Definition: mrcp_start_line.h:36
mrcp_status_code_e
Definition: mrcp_start_line.h:47
Definition: mrcp_start_line.h:41
mrcp_request_state_e request_state
Definition: mrcp_start_line.h:95
apr_uint32_t mrcp_request_id
Definition: mrcp_types.h:59
mrcp_status_code_e status_code
Definition: mrcp_start_line.h:93
apt_str_t method_name
Definition: mrcp_start_line.h:89
mrcp_message_type_e
Definition: mrcp_start_line.h:67
Text Stream Parse/Generate Routine.
apr_size_t length
Definition: mrcp_start_line.h:85