Fixed typo in error message.
[gsmd2.git] / src / call_interface.h
blobf52f4c126c0901f15d95b268dff939d9db8ab217
1 /*
2 * call_interface.h
4 * Copyright(C) 2007,2008 Ixonos Plc
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2, or (at your option)
9 * any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Boston, MA 02111.
22 * Written by
23 * Jukka Honkela
24 * Yi Zheng
25 * Matti Katila
26 * Vesa Pikki
27 * Heikki Paajanen
31 #ifndef CALL_INTERFACE
32 #define CALL_INTERFACE
35 /**
36 * @brief voice call interface provice voice call service such as dial accept or
37 * hangup a call
39 typedef struct CallInterface CallInterface;
41 struct CallInterface
44 gpointer priv;
46 gpointer vendor_priv;
48 /***************************Method calls***********************************/
52 /**
53 * @brief makes a call
54 * @param call call interface pointer
55 * @param ipc_data data for ipc
56 * @param number the phone number to call
58 void (*initiate) (CallInterface *call,
59 gpointer ipc_data,
60 const char* number,
61 const char* type);
63 /**
64 * @brief Activates a call (either incoming or held)
65 * @param call call interface pointer
66 * @param ipc_data data for ipc
67 * @param id call's id
69 void (*activate) (CallInterface *call,
70 gpointer ipc_data,
71 gint id);
74 /**
75 * @brief Adds specified call to conference
76 * @param call call interface pointer
77 * @param ipc_data data for ipc
78 * @param id call's id
80 void (*activate_conference) (CallInterface *call,
81 gpointer ipc_data,
82 gint id);
84 /**
85 * @brief Hangup a call. Hangup the current call or cancel the call
86 * request
87 * @param call call interface pointer
88 * @param ipc_data data for ipc
89 * @param message TODO what's this?
90 * @param id index of the call to hang up
92 void (*release) (CallInterface *call,
93 gpointer ipc_data,
94 const gchar *message,
95 const gint id);
97 /**
98 * @brief Place active call to hold.
100 * @param call call interface pointer
101 * @param ipc_data data for ipc
103 void (*hold_active) (CallInterface *call,
104 gpointer ipc_data);
107 * @brief Join calls.
109 * @param call call interface pointer
110 * @param ipc_data data for ipc
112 void (*join) (CallInterface *call,
113 gpointer ipc_data);
116 * @brief Transfer calls.
118 * @param call call interface pointer
119 * @param ipc_data data for ipc
121 void (*transfer) (CallInterface *call,
122 gpointer ipc_data,
123 const gchar *number);
126 * @brief Hangup all calls.
127 * @param call call interface pointer
128 * @param ipc_data data for ipc
129 * @param message TODO what's this?
131 void (*release_all) (CallInterface *call,
132 gpointer ipc_data,
133 const gchar *message);
136 * @brief Releases all held calls.
137 * @param call call interface pointer
138 * @param ipc_data data for ipc
139 * @param message TODO what's this?
141 void (*release_held) (CallInterface *call,
142 gpointer ipc_data,
143 const gchar *message);
147 * @brief Lists current calls (held and active)
148 * @param call call interface pointer
149 * @param ipc_data data for ipc
151 void (*list_calls) (CallInterface *call,
152 gpointer ipc_data);
155 * @brief Set Dtmf of modem
156 * @param call call interface poniter
157 * @param ipc_data data for ipc
158 * @param str Dtmf string
160 void (*send_dtmf) (CallInterface *call,
161 gpointer ipc_data);
164 * @brief Get emergency number
165 * @param call call interface poniter
166 * @param ipc_data data for ipc
168 void (*emergency) (CallInterface *call,
169 gpointer ipc_data);
175 typedef struct _CallIPCInterface CallIPCInterface;
177 struct _CallIPCInterface
180 gpointer priv;
182 /**************************Replies to method calls*************************/
185 * @brief sends a reply to ipc that phone call has been made
186 * @param call_ipc call IPC interface pointer
187 * @param ipc_data data for ipc
188 * @param id newly initiated phone call's id
190 void (*initiate_reply) (CallIPCInterface *call_ipc,
191 gpointer ipc_data,
192 const gint id);
196 * @brief sends a reply to ipc that phone call has been activated
197 * @param call_ipc call IPC interface pointer
198 * @param ipc_data data for ipc
200 void (*activate_reply) (CallIPCInterface *call_ipc,
201 gpointer ipc_data);
204 * @brief sends a reply to ipc that phone call has been added to
205 * conference
206 * @param call_ipc call IPC interface pointer
207 * @param ipc_data data for ipc
209 void (*activate_conference_reply) (CallIPCInterface *call_ipc,
210 gpointer ipc_data);
213 * @brief sends a reply to ipc that active and held calls have been joined and released
214 * @param call_ipc call IPC interface pointer
215 * @param ipc_data data for ipc
217 void (*join_reply) (CallIPCInterface *call_ipc,
218 gpointer ipc_data);
221 * @brief sends a reply to ipc that a phone call has been released (hung up)
222 * @param call_ipc call IPC interface pointer
223 * @param ipc_data data for ipc
225 void (*release_reply) (CallIPCInterface *call_ipc,
226 gpointer ipc_data);
229 * @brief sends a reply to ipc that dtmf has been sent
230 * @param call_ipc call IPC interface pointer
231 * @param ipc_data data for ipc
232 * @param mode
234 void (*send_dtmf_reply) (CallIPCInterface *call_ipc,
235 gpointer ipc_data,
236 const char *mode);
239 * @brief sends a reply to ipc with the emergency number
240 * @param call_ipc call IPC interface pointer
241 * @param ipc_data data for ipc
242 * @param number emergency number
244 void (*emergency_reply) (CallIPCInterface *call_ipc,
245 gpointer ipc_data,
246 const char* number);
249 * @brief send a reply to set DTMF duration function
250 * @param call_ipc call IPC interface pointer
251 * @param ipc_data data for ipc
253 void (*set_dtmf_duration_reply) (CallIPCInterface *call_ipc,
254 gpointer ipc_data);
257 * @brief send a reply to get DTMF duration function
258 * @param call_ipc call IPC interface pointer
259 * @param ipc_data data for ipc
260 * @param duration dtmf duration
262 void (*get_dtmf_duration_reply) (CallIPCInterface *call_ipc,
263 gpointer ipc_data,
264 const gint duration);
267 * @brief send a reply to release all function
268 * @param call_ipc call IPC interface pointer
269 * @param ipc_data data for ipc
271 void (*release_all_reply) (CallIPCInterface *call_ipc,
272 gpointer ipc_data);
276 * @brief send a reply to release held function
277 * @param call_ipc call IPC interface pointer
278 * @param ipc_data data for ipc
280 void (*release_held_reply) (CallIPCInterface *call_ipc,
281 gpointer ipc_data);
284 * @brief send a reply to list calls function
285 * @param call_ipc call IPC interface pointer
286 * @param ipc_data data for ipc
287 * @param calls active calls
289 void (*list_calls_reply) (CallIPCInterface *call_ipc,
290 gpointer ipc_data,
291 GArray *calls);
294 * @brief sends a reply to get send identification function
295 * @param call_ipc call IPC interface pointer
296 * @param ipc_data data for ipc
297 * @param mode ??
299 void (*get_send_identification_reply) (CallIPCInterface *call_ipc,
300 gpointer ipc_data,
301 gboolean mode);
304 * @brief sends a reply to set send identification function
305 * @param call_ipc call IPC interface pointer
306 * @param ipc_data data for ipc
308 void (*set_send_identification_reply) (CallIPCInterface *call_ipc,
309 gpointer ipc_data);
310 /*********************Error replies to method calls************************/
313 * @brief sends an error reply to ipc
314 * @param call_ipc pointer to call IPC interface struct
315 * @param ipc_data ipc data
316 * @param error pointer to GError describing error
318 void (*initiate_error) (CallIPCInterface *call_ipc,
319 gpointer ipc_data,
320 GError *error);
325 * @brief sends an error reply to ipc
326 * @param call_ipc pointer to call IPC interface struct
327 * @param ipc_data ipc data
328 * @param error pointer to GError describing error
330 void (*activate_error) (CallIPCInterface *call_ipc,
331 gpointer ipc_data,
332 GError *error);
335 * @brief sends an error reply to ipc
336 * @param call_ipc pointer to call IPC interface struct
337 * @param ipc_data ipc data
338 * @param error pointer to GError describing error
340 void (*activate_conference_error) (CallIPCInterface *call_ipc,
341 gpointer ipc_data,
342 GError *error);
345 * @brief sends an error reply to ipc
346 * @param call_ipc pointer to call IPC interface struct
347 * @param ipc_data ipc data
348 * @param error pointer to GError describing error
350 void (*release_error) (CallIPCInterface *call_ipc,
351 gpointer ipc_data,
352 GError *error);
355 * @brief sends an error reply to ipc
356 * @param call_ipc pointer to call IPC interface struct
357 * @param ipc_data ipc data
358 * @param error pointer to GError describing error
360 void (*join_error) (CallIPCInterface *call_ipc,
361 gpointer ipc_data,
362 GError *error);
365 * @brief sends an error reply to ipc
366 * @param call_ipc pointer to call IPC interface struct
367 * @param ipc_data ipc data
368 * @param error pointer to GError describing error
370 void (*release_all_error) (CallIPCInterface *call_ipc,
371 gpointer ipc_data,
372 GError *error);
375 * @brief sends an error reply to ipc
376 * @param call_ipc pointer to call IPC interface struct
377 * @param ipc_data ipc data
378 * @param error pointer to GError describing error
380 void (*release_held_error) (CallIPCInterface *call_ipc,
381 gpointer ipc_data,
382 GError *error);
385 * @brief sends an error reply to ipc
386 * @param call_ipc pointer to call IPC interface struct
387 * @param ipc_data ipc data
388 * @param error pointer to GError describing error
390 void (*send_dtmf_error) (CallIPCInterface *call_ipc,
391 gpointer ipc_data,
392 GError *error);
395 * @brief sends an error reply to ipc
396 * @param call_ipc pointer to call IPC interface struct
397 * @param ipc_data ipc data
398 * @param error pointer to GError describing error
400 void (*emergency_error) (CallIPCInterface *call_ipc,
401 gpointer ipc_data,
402 GError *error);
406 * @brief sends an error reply to ipc
407 * @param call_ipc pointer to call IPC interface struct
408 * @param ipc_data ipc data
409 * @param error pointer to GError describing error
411 void (*set_dtmf_duration_error) (CallIPCInterface *call_ipc,
412 gpointer ipc_data,
413 GError *error);
416 * @brief sends an error reply to ipc
417 * @param call_ipc pointer to call IPC interface struct
418 * @param ipc_data ipc data
419 * @param error pointer to GError describing error
421 void (*get_dtmf_duration_error) (CallIPCInterface *call_ipc,
422 gpointer ipc_data,
423 GError *error);
426 * @brief sends an error reply to ipc
427 * @param call_ipc call IPC interface pointer
428 * @param ipc_data data for ipc
429 * @param error pointer to GError describing error
431 void (*list_calls_error) (CallIPCInterface *call_ipc,
432 gpointer ipc_data,
433 GError *error);
436 * @brief sends an error reply to ipc
437 * @param call_ipc call IPC interface pointer
438 * @param ipc_data data for ipc
439 * @param error pointer to GError describing error
441 void (*set_send_identification_error) (CallIPCInterface *call_ipc,
442 gpointer ipc_data,
443 GError *error);
446 * @brief sends an error reply to ipc
447 * @param call_ipc call IPC interface pointer
448 * @param ipc_data data for ipc
449 * @param error pointer to GError describing error
451 void (*get_send_identification_error) (CallIPCInterface *call_ipc,
452 gpointer ipc_data,
453 GError *error);
455 /********************************Signals***********************************/
460 * @brief call progress signal is emited to provide additional information
461 * on call's progress
463 void (*call_status) (CallIPCInterface *call_ipc,
464 const gint id,
465 const gchar *status,
466 GHashTable *properties
472 #endif