Translated using Weblate.
[gammu.git] / include / gammu-call.h
blobf2760c067fde03e1bf74a2bc81a12eaa459e965c
1 /**
2 * \file gammu-call.h
3 * \author Michal Čihař
5 * Call data and functions.
6 */
7 #ifndef __gammu_call_h
8 #define __gammu_call_h
10 /**
11 * \defgroup Call Call
12 * Call entries manipulations.
15 #include <gammu-types.h>
16 #include <gammu-limits.h>
17 #include <gammu-error.h>
18 #include <gammu-statemachine.h>
20 /**
21 * \defgroup Divert Divert
22 * Diversion entries manipulations.
25 /**
26 * Enum with status of call.
28 * \ingroup Call
30 typedef enum {
31 /**
32 * Somebody calls to us
34 GSM_CALL_IncomingCall = 1,
35 /**
36 * We call somewhere
38 GSM_CALL_OutgoingCall,
39 /**
40 * Call started
42 GSM_CALL_CallStart,
43 /**
44 * End of call from unknown side
46 GSM_CALL_CallEnd,
47 /**
48 * End of call from remote side
50 GSM_CALL_CallRemoteEnd,
51 /**
52 * End of call from our side
54 GSM_CALL_CallLocalEnd,
55 /**
56 * Call established. Waiting for answer or dropping
58 GSM_CALL_CallEstablished,
59 /**
60 * Call held
62 GSM_CALL_CallHeld,
63 /**
64 * Call resumed
66 GSM_CALL_CallResumed,
67 /**
68 * We switch to call
70 GSM_CALL_CallSwitched
71 } GSM_CallStatus;
73 /**
74 * Call information.
76 * \ingroup Call
78 typedef struct {
79 /**
80 * Call status.
82 GSM_CallStatus Status;
83 /**
84 * Call ID
86 int CallID;
87 /**
88 * Whether Call ID is available.
90 gboolean CallIDAvailable;
91 /**
92 * Status code.
94 int StatusCode;
95 /**
96 * Remote phone number.
98 unsigned char PhoneNumber[(GSM_MAX_NUMBER_LENGTH + 1) * 2];
99 } GSM_Call;
102 * Defines when diversion is active.
104 * \ingroup Divert
106 typedef enum {
108 * Divert when busy.
110 GSM_DIVERT_Busy = 0x01,
112 * Divert when not answered.
114 GSM_DIVERT_NoAnswer,
116 * Divert when phone off or no coverage.
118 GSM_DIVERT_OutOfReach,
120 * Divert all calls without ringing.
122 GSM_DIVERT_AllTypes
123 } GSM_Divert_DivertTypes;
126 * Which type of calls should be diverted.
128 * \ingroup Divert
130 typedef enum {
132 * Voice calls.
134 GSM_DIVERT_VoiceCalls = 0x01,
136 * Fax calls.
138 GSM_DIVERT_FaxCalls,
140 * Data calls.
142 GSM_DIVERT_DataCalls,
144 * All calls.
146 GSM_DIVERT_AllCalls
147 } GSM_Divert_CallTypes;
150 * Call diversion definition.
152 * \ingroup Divert
154 typedef struct {
156 * When diversion is active.
158 GSM_Divert_DivertTypes DivertType;
160 * Type of call to divert.
162 GSM_Divert_CallTypes CallType;
164 * Timeout for diversion.
166 unsigned int Timeout;
168 * Number where to divert.
170 char Number[(GSM_MAX_NUMBER_LENGTH + 1) * 2];
171 } GSM_CallDivert;
174 * Multiple call diversions.
176 * \ingroup Divert
178 typedef struct {
179 int EntriesNum;
180 GSM_CallDivert Entries[GSM_MAX_CALL_DIVERTS];
181 } GSM_MultiCallDivert;
184 * How to handle number when initiating voice call.
186 * \ingroup Call
188 typedef enum {
190 * Show number.
192 GSM_CALL_ShowNumber = 1,
194 * Hide number.
196 GSM_CALL_HideNumber,
198 * Keep phone default settings.
200 GSM_CALL_DefaultNumberPresence
201 } GSM_CallShowNumber;
204 * Dials number and starts voice call.
206 * \param s State machine pointer.
207 * \param Number Number to dial.
208 * \param ShowNumber Whether we want to display number on phone.
210 * \return Error code
212 * \ingroup Call
214 GSM_Error GSM_DialVoice(GSM_StateMachine * s, char *Number,
215 GSM_CallShowNumber ShowNumber);
217 * Dials service number (usually for USSD).
219 * \param s State machine pointer.
220 * \param Number Number to dial.
222 * \return Error code
224 * \ingroup Call
226 GSM_Error GSM_DialService(GSM_StateMachine * s, char *Number);
229 * Accept current incoming call.
231 * \param s State machine pointer.
232 * \param ID ID of call.
233 * \param all Whether to handle all call and not only the one specified
234 * by ID.
236 * \return Error code
238 * \ingroup Call
240 GSM_Error GSM_AnswerCall(GSM_StateMachine * s, int ID, gboolean all);
243 * Deny current incoming call.
245 * \param s State machine pointer.
246 * \param ID ID of call.
247 * \param all Whether to handle all call and not only the one specified
248 * by ID.
250 * \return Error code
252 * \ingroup Call
254 GSM_Error GSM_CancelCall(GSM_StateMachine * s, int ID, gboolean all);
257 * Holds call.
259 * \param s State machine pointer.
260 * \param ID ID of call.
262 * \return Error code
264 * \ingroup Call
266 GSM_Error GSM_HoldCall(GSM_StateMachine * s, int ID);
269 * Unholds call.
271 * \param s State machine pointer.
272 * \param ID ID of call.
274 * \return Error code
276 * \ingroup Call
278 GSM_Error GSM_UnholdCall(GSM_StateMachine * s, int ID);
281 * Initiates conference call.
283 * \param s State machine pointer.
284 * \param ID ID of call.
286 * \return Error code
288 * \ingroup Call
290 GSM_Error GSM_ConferenceCall(GSM_StateMachine * s, int ID);
293 * Splits call.
295 * \param s State machine pointer.
296 * \param ID ID of call.
298 * \return Error code
300 * \ingroup Call
302 GSM_Error GSM_SplitCall(GSM_StateMachine * s, int ID);
305 * Transfers call.
307 * \param s State machine pointer.
308 * \param ID ID of call.
309 * \param next Switches next call and ignores ID.
311 * \return Error code
313 * \ingroup Call
315 GSM_Error GSM_TransferCall(GSM_StateMachine * s, int ID, gboolean next);
318 * Switches call.
320 * \param s State machine pointer.
321 * \param ID ID of call.
322 * \param next Switches next call and ignores ID.
324 * \return Error code
326 * \ingroup Call
328 GSM_Error GSM_SwitchCall(GSM_StateMachine * s, int ID, gboolean next);
331 * Gets call diverts.
333 * \param s State machine pointer.
334 * \param request Which diverts to get.
335 * \param result Storage for diversions information.
337 * \return Error code
339 * \ingroup Divert
341 GSM_Error GSM_GetCallDivert(GSM_StateMachine *s, GSM_CallDivert *request, GSM_MultiCallDivert *result);
344 * Sets call diverts.
346 * \param s State machine pointer.
347 * \param divert Diversions information to set.
349 * \return Error code
351 * \ingroup Divert
353 GSM_Error GSM_SetCallDivert(GSM_StateMachine * s, GSM_CallDivert * divert);
356 * Cancels all diverts.
358 * \param s State machine pointer.
360 * \return Error code
362 * \ingroup Divert
364 GSM_Error GSM_CancelAllDiverts(GSM_StateMachine * s);
367 * Activates/deactivates noticing about incoming calls.
369 * \param s State machine pointer.
370 * \param enable Whether to enable notifications.
372 * \return Error code
374 * \ingroup Call
376 GSM_Error GSM_SetIncomingCall(GSM_StateMachine * s, gboolean enable);
379 * Sends DTMF (Dual Tone Multi Frequency) tone.
381 * \param s State machine pointer.
382 * \param sequence Sequence to press.
384 * \return Error code
386 * \ingroup Call
388 GSM_Error GSM_SendDTMF(GSM_StateMachine * s, char *sequence);
390 #endif
392 /* Editor configuration
393 * vim: noexpandtab sw=8 ts=8 sts=8 tw=72: