mtc_call_ext.h
8.4 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
/************************************************************************
Copyright (c) 2005-2011 by Juphoon System Software, Inc.
All rights reserved.
This software is confidential and proprietary to Juphoon System,
Inc. No part of this software may be reproduced, stored, transmitted,
disclosed or used in any form or by any means other than as expressly
provided by the written license agreement between Juphoon and its
licensee.
THIS SOFTWARE IS PROVIDED BY JUPHOON "AS IS" AND ANY EXPRESS OR
IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL JUPHOON BE LIABLE FOR ANY DIRECT,
INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
Juphoon System Software, Inc.
Email: support@juphoon.com
Web: http://www.juphoon.com
************************************************************************/
/*************************************************
File name : mtc_call.h
Module : multimedia talk client
Author : leo.lv
Created on : 2011-01-03
Description :
Data structure and function declare required by MTC call
Modify History:
1. Date: Author: Modification:
*************************************************/
#ifndef _MTC_CALL_EXT_H__
#define _MTC_CALL_EXT_H__
/**
* @file mtc_call_ext.h
* @brief MTC Call Interface Functions
*
* This file includes call interface function. Those function is used to manage calls.
*/
#ifdef __cplusplus
extern "C" {
#endif
/** @brief MTC call record file type */
#define MTC_CALL_REC_FILE_PCM "pcm" /**< @brief Pcm content. */
#define MTC_CALL_REC_FILE_WAV "wav" /**< @brief Wav content. */
/** @brief MTC call alert information type */
typedef enum EN_MTC_CALL_ALERT_INFO_TYPE
{
EN_MTC_CALL_ALERT_INFO_NULL, /**< @brief No alert info. */
EN_MTC_CALL_ALERT_INFO_DR0, /**< @brief Bellcore_dr0. */
EN_MTC_CALL_ALERT_INFO_DR1, /**< @brief Bellcore_dr1. */
EN_MTC_CALL_ALERT_INFO_DR2, /**< @brief Bellcore_dr2. */
EN_MTC_CALL_ALERT_INFO_DR3, /**< @brief Bellcore_dr3. */
EN_MTC_CALL_ALERT_INFO_DR4, /**< @brief Bellcore_dr4. */
EN_MTC_CALL_ALERT_INFO_DR5 /**< @brief Bellcore_dr5. */
} EN_MTC_CALL_ALERT_INFO_TYPE;
/** @brief MTC call ealry media direction */
typedef enum EN_MTC_CALL_EM_STATUS_TYPE
{
EN_MTC_CALL_EM_STATUS_INACTIVE, /**< @brief Inactive. */
EN_MTC_CALL_EM_STATUS_SENDONLY, /**< @brief Sendonly. */
EN_MTC_CALL_EM_STATUS_RECVONLY, /**< @brief Recvonly. */
EN_MTC_CALL_EM_STATUS_SENDRECV, /**< @brief Sendrecv. */
} EN_MTC_CALL_EM_STATUS_TYPE;
/**
* @brief MTC session get video size.
*
* @param [in] iCallId The ID of session.
* @param [out] piWidth Video width in pixel of specific session.
* @param [out] piHeight Video height in pixel of specific session.
*
* @retval ZOK on succeed.
* @retval ZFAILED on failure.
*/
MTCFUNC ZINT Mtc_CallGetVideoSize(ZUINT iCallId, ZUINT *piWidth,
ZUINT *piHeight);
/**
* @brief MTC session get remote video size.
*
* @param [in] iCallId The ID of session.
* @param [out] piWidth Video width in pixel of specific session.
* @param [out] piHeight Video height in pixel of specific session.
*
* @retval ZOK on succeed.
* @retval ZFAILED on failure.
*/
MTCFUNC ZINT Mtc_CallGetVideoRemoteSize(ZUINT iCallId, ZUINT *piWidth,
ZUINT *piHeight);
/**
* @brief MTC session get local video size.
*
* @param [in] iCallId The ID of session.
* @param [out] piWidth Video width in pixel of specific session.
* @param [out] piHeight Video height in pixel of specific session.
*
* @retval ZOK on succeed.
* @retval ZFAILED on failure.
*/
MTCFUNC ZINT Mtc_CallGetVideoLocalSize(ZUINT iCallId, ZUINT *piWidth,
ZUINT *piHeight);
/**
* @brief MTC session get Call-ID string.
*
* @param [in] iCallId The ID of session which you want to get.
*
* @return The string of Call-ID.
*
* @see
*/
MTCFUNC ZCONST ZCHAR * Mtc_CallGetSipCallId(ZUINT iCallId);
/**
* @brief MTC session get peer id, based on polices.
*
* @param [in] iCallId The ID of session which you want to get.
* @param [out] ppcDispName The display name of peer user which you have this session with.
* @param [out] ppcUri The URI of peer user which you have this session with.
*
* @retval ZOK on succeed.
* @retval ZFAILED on failure.
*
* Note the result of this function may be different with Mtc_CallGetPeerUri
* because the apply of polices. For example, OIP, OIR, TIP, TIR, and privacy.
*
* @see @ref Mtc_CallGetPeerUri
*/
MTCFUNC ZINT Mtc_CallGetPeerId(ZUINT iCallId, ZCHAR **ppcDispName,
ZCHAR **ppcUri);
/**
* @brief MTC session check if the peer is contains isfocus parameter.
*
* @param [in] iCallId The ID of session.
*
* @retval ZTRUE on peer is focus.
* @retval ZFALSE on peer no focus.
*/
MTCFUNC ZBOOL Mtc_CallPeerIsFocus(ZUINT iCallId);
/**
* @brief MTC session check if the offer/answer exchange is completed.
*
* @param [in] iCallId The ID of session.
*
* @retval ZTRUE on offer has answer.
* @retval ZFALSE on offer has not answer.
*
* @see @ref Mtc_CallGetEarlyMediaStatus
*/
MTCFUNC ZBOOL Mtc_CallHasOfferAnswer(ZUINT iCallId);
/**
* @brief MTC session get alert information type.
*
* @param [in] iCallId The ID of session which you want to get.
*
* @retval @ref EN_MTC_CALL_ALERT_INFO_TYPE.
*
* The information get by this function is actually from Alert-Info header
* in SIP message.
*/
MTCFUNC ZUINT Mtc_CallGetAlertInfo(ZUINT iCallId);
/**
* @brief MTC session get the early media status.
*
* @param [in] iCallId The ID of session which you want to get its early media
* status.
* @param [in] bVideo If ZTRUE, get video status, otherwise get audio status.
*
* @retval @ref EN_MTC_CALL_EM_STATUS_TYPE.
*
* @see @ref Mtc_CallHasOfferAnswer
*/
MTCFUNC ZUINT Mtc_CallGetEarlyMediaStatus(ZUINT iCallId,
ZBOOL bVideo);
/**
* @brief Reccord mic start.
*
* It will reccord from mic to file.
*
* @param [in] pcFileName The reccord file name.
* @param [in] ucFileType The reccord file type, @ref EN_MTC_MFILE_TYPE
*
* @retval ZOK Audio Reccord successfully.
* @retval ZFAILED Audio Reccord failed.
*
* @see @ref Mtc_CallRecMicStop
*/
MTCFUNC ZINT Mtc_CallRecMicStart(ZCONST ZCHAR *pcFileName,
ZUCHAR ucFileType);
/**
* @brief Reccord Audio stop.
*
* @see @ref Mtc_CallRecMicStart
*/
MTCFUNC ZINT Mtc_CallRecMicStop(ZFUNC_VOID);
/**
* @brief MTC session record playout.
*
* @param [in] iCallId The ID of session which you want to record,
* if pCall is invalid, record the mix playout.
* @param [in] pcFileName The reccord file name.
* @param [in] ucFileType The reccord file type, @ref EN_MTC_MFILE_TYPE
*
* @retval ZOK on succeed.
* @retval ZFAILED on failure.
*/
MTCFUNC ZINT Mtc_CallRecPlayStart(ZUINT iCallId, ZCONST ZCHAR *pcFileName,
ZUCHAR ucFileType);
/**
* @brief MTC session stop record playout.
*
* @param [in] iCallId The ID of session which you want to stop record,
* if pCall is invalid, stop record the mix playout.
*
* @retval ZOK on succeed.
* @retval ZFAILED on failure.
*/
MTCFUNC ZINT Mtc_CallRecPlayStop(ZUINT iCallId);
/**
* @brief Query missed call information.
*
* @retval ZOK Query OK.
* @retval ZFAILED Query failed.
*/
MTCFUNC ZINT Mtc_CallQueryMissed(ZFUNC_VOID);
#define MTC_CALL_CONNECTION_STATE_INVALID "INVALID"
#define MTC_CALL_CONNECTION_STATE_IDLE "IDLE"
#define MTC_CALL_CONNECTION_STATE_CONNECTING "CONNECTING"
#define MTC_CALL_CONNECTION_STATE_CONNECTED "CONNECTED"
/**
* @brief Get media connection state of call.
*
* @return Connection state information string,
* MTC_CALL_CONNECTION_STATE_INVALID for invalid call.
*/
MTCFUNC ZCONST ZCHAR * Mtc_CallMediaState(ZUINT iCallId);
#ifdef __cplusplus
}
#endif
#endif /* _MTC_CALL_EXT_H__ */