UniMRCP  1.3.0
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
mpf_named_event.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: mpf_named_event.h 2136 2014-07-04 06:33:36Z achaloyan@gmail.com $
17  */
18 
19 #ifndef MPF_NAMED_EVENT_H
20 #define MPF_NAMED_EVENT_H
21 
22 /**
23  * @file mpf_named_event.h
24  * @brief MPF Named Events (RFC4733/RFC2833)
25  */
26 
27 #include "mpf_codec_descriptor.h"
28 
30 
31 /** Named event declaration */
33 
34 
35 /** Named event (RFC4733/RFC2833, out-of-band DTMF) */
37  /** event (DTMF, tone) identifier */
38  apr_uint32_t event_id: 8;
39 #if (APR_IS_BIGENDIAN == 1)
40  /** end of event */
41  apr_uint32_t edge: 1;
42  /** reserved */
43  apr_uint32_t reserved: 1;
44  /** tone volume */
45  apr_uint32_t volume: 6;
46 #else
47  /** tone volume */
48  apr_uint32_t volume: 6;
49  /** reserved */
50  apr_uint32_t reserved: 1;
51  /** end of event */
52  apr_uint32_t edge: 1;
53 #endif
54  /** event duration */
55  apr_uint32_t duration: 16;
56 };
57 
58 /** Create named event descriptor */
59 MPF_DECLARE(mpf_codec_descriptor_t*) mpf_event_descriptor_create(apr_uint16_t sampling_rate, apr_pool_t *pool);
60 
61 /** Check whether the specified descriptor is named event one */
63 
64 /** Convert DTMF character to event identifier */
65 MPF_DECLARE(apr_uint32_t) mpf_dtmf_char_to_event_id(const char dtmf_char);
66 
67 /** Convert event identifier to DTMF character */
68 MPF_DECLARE(char) mpf_event_id_to_dtmf_char(const apr_uint32_t event_id);
69 
70 
72 
73 #endif /* MPF_NAMED_EVENT_H */