4 * Copyright (c) 2011 Samsung Electronics Co., Ltd. All rights reserved.
6 * Contact: Ja-young Gu <jygu@samsung.com>
8 * Licensed under the Apache License, Version 2.0 (the "License");
9 * you may not use this file except in compliance with the License.
10 * You may obtain a copy of the License at
12 * http://www.apache.org/licenses/LICENSE-2.0
14 * Unless required by applicable law or agreed to in writing, software
15 * distributed under the License is distributed on an "AS IS" BASIS,
16 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 * See the License for the specific language governing permissions and
18 * limitations under the License.
24 #include "TelDefines.h"
27 #include "tel_cs_conn.h"
28 #include "tapi_proxy.h"
29 #include "TapiUtility.h"
30 #include "TelUtility.h"
32 extern tapi_dbus_connection_name conn_name;
34 /******************************************************************************
35 *******************************************************************************
37 * G L O B A L V A R I A B L E S
39 ******************************************************************************
40 ******************************************************************************/
44 /******************************************************************************
45 *******************************************************************************
47 * P R O X Y C A L L A P I's
50 ******************************************************************************
51 ******************************************************************************/
55 * Initiate a new call. Call could be either voice or video.
57 * The client specifies the telephone number and the desired call parameters via the
59 * tapi_call_setup_info_t argument. After successful completion of the dial request a call identifier is
61 * returned back to the client via the ptr_call_handle argument. The call identifier is needed to hold,
63 * resume, swap, and terminate the call. It is also needed to monitor the status of the call.
65 * This is an asynchronous API. After successful completion of the request in Phone Alert Event is
67 * published. otherwise Error event is published.
69 * @param[in] * TelCallSetupParams_t telephone number and desired call parameters.
70 * @param[out] * pCallHandle , *pRequestID. Handle of the call. specifies the request identifier.
71 * @Interface Synchronous.
72 * @return int API Result Code.
73 * @exception In case of exceptions return value contains appropriate error code.
74 * @remarks ptr_call_setup_info, and ptr_call_handle can not be NULL.
75 * @see See below API's also.
76 * - tel_answer_call(),
77 * - tel_release_call(),
79 * - tel_retrieve_call(),
82 EXPORT_API int tel_exe_call_mo(const TelCallSetupParams_t *pParams, unsigned int *pCallHandle, int *pRequestID)
86 int api_err = TAPI_API_SUCCESS;
88 TAPI_LIB_DEBUG(LEVEL_DEBUG, "Func Entrance");
90 /* check for invalid ptr etc etc if applicable.... */
91 TAPI_RET_ERR_NUM_IF_FAIL((pParams && pCallHandle && pRequestID ),
92 TAPI_API_INVALID_PTR);
94 num_len = strlen(pParams->szNumber);
96 /* check for invalid ptr etc etc if applicable.... */
97 if ((TAPI_CALL_DIALDIGIT_LEN_MAX < num_len) || (0 >= num_len)) {
98 TAPI_LIB_DEBUG(LEVEL_ERR, "_CALL_ERR_ : Invalid telephone no length [%+d]", num_len);
99 return TAPI_API_INVALID_INPUT;
102 // Do Nothing........
105 if (conn_name.length_of_name == 0) {
106 TAPI_LIB_DEBUG(LEVEL_ERR, "No dbus connection name");
107 return TAPI_API_OPERATION_FAILED;
110 /* check for the RPC link.... */
111 TAPI_RET_ERR_NUM_IF_FAIL(tapi_check_dbus_status(), TAPI_API_SYSTEM_RPC_LINK_DOWN);
113 /* Check input range for possible call types */
114 if ((TAPI_CALL_TYPE_VOICE == pParams->CallType) || (TAPI_CALL_TYPE_DATA == pParams->CallType)
115 || (TAPI_CALL_TYPE_E911 == pParams->CallType)) {
116 TAPI_GLIB_INIT_PARAMS();
118 TAPI_GLIB_ALLOC_PARAMS(in_param1, in_param2, in_param3, in_param4,
119 out_param1, out_param2, out_param3, out_param1);
121 g_array_append_vals(in_param1, pParams, sizeof(TelCallSetupParams_t));
122 g_array_append_vals(in_param4, &conn_name, sizeof(tapi_dbus_connection_name));
124 TAPI_LIB_DEBUG(LEVEL_INFO, "Setup Call: Call Type [%d], Number [%s]",
125 pParams->CallType, pParams->szNumber);
127 TAPI_PRINT_TIME("tel_exe_call_mo() is called..");
129 ret = tapi_send_request(TAPI_CS_SERVICE_CALL, TAPI_CS_CALL_SETUP, in_param1, in_param2, in_param3, in_param4,
130 &out_param1, &out_param2, &out_param3, &out_param4);
133 /* API return value */
134 api_err = g_array_index(out_param1, int, 0);
137 *pRequestID = g_array_index(out_param2, int, 0);
140 *pCallHandle = g_array_index(out_param3, unsigned int, 0);
143 /* RPC API failed, return FALSE to APP */
144 api_err = TAPI_API_SYSTEM_RPC_LINK_DOWN;
145 TAPI_LIB_DEBUG(LEVEL_ALERT, "_CALL_ERR_ : RPC link is down");
148 TAPI_GLIB_FREE_PARAMS(in_param1, in_param2, in_param3, in_param4,
149 out_param1, out_param2, out_param3, out_param4);
152 /* Invalid input range given by the APP. */
153 api_err = TAPI_API_INVALID_INPUT;
154 TAPI_LIB_DEBUG(LEVEL_ERR, "_CALL_ERR_: Invalid Input");
157 TAPI_LIB_DEBUG(LEVEL_INFO, " Returning TapiResult_t [%+d] RequestId [%+d] Hanlde [%+d]", api_err, *pRequestID, *pCallHandle);
163 * Accept or Reject an incoming new call.
165 * Answering an incoming call is possible only when the call status is incoming or waiting.
167 * Client can choose to answer an incoming call, even when an active call exists, by specifying argument
169 * TelCallAnswerType_t. The TelCallAnswerType_t can be accept a single call, or hold a current call and
171 * accept the incoming call, or replace the current active call with waiting incoming call, or reject the call.
173 * @param[in] CallHandle, a call identifier
174 * @param[in] TelCallAnswerType_t, accept / reject /hold and accept etc.
175 * @param[out] pRequestID. specifies the request identifier.
176 * @Interface Asynchronous.
177 * @return int API Result code.
178 * @exception In case of exceptions return value contains appropriate error code.
179 * @remarks tapi_call_handle should refer a call state which is in incoming/waiting state.
180 * @see See below API's also.
181 * - tel_exe_call_mo(),
182 * - tel_release_call(),
184 * - tel_retrieve_call(),
187 EXPORT_API int tel_answer_call(unsigned int CallHandle, TelCallAnswerType_t AnsType, int *pRequestID)
190 int api_err = TAPI_API_SUCCESS;
192 TAPI_LIB_DEBUG(LEVEL_DEBUG,"Func Entrance");
194 /* check for invalid ptr etc etc if applicable.... */
195 TAPI_RET_ERR_NUM_IF_FAIL(pRequestID, TAPI_API_INVALID_PTR);
197 if (conn_name.length_of_name == 0) {
198 TAPI_LIB_DEBUG(LEVEL_ERR, "No dbus connection name");
199 return TAPI_API_OPERATION_FAILED;
202 /* Check the call handle value... */
203 if (CallHandle <= 0) {
204 api_err = TAPI_API_INVALID_CALL_HANDLE;
205 TAPI_LIB_DEBUG(LEVEL_ERR, "_CALL_ERR_ : Invalid Call Handle.");
209 /* Check input range for tapi_answer_type_t */
210 if ((TAPI_CALL_ANSWER_ACCEPT <= AnsType) && (TAPI_CALL_ANSWER_HOLD_AND_ACCEPT >= AnsType)) {
211 /* check for the RPC link.... */
212 TAPI_RET_ERR_NUM_IF_FAIL(tapi_check_dbus_status(), TAPI_API_SYSTEM_RPC_LINK_DOWN);
213 TAPI_GLIB_INIT_PARAMS();
215 TAPI_GLIB_ALLOC_PARAMS(in_param1, in_param2, in_param3, in_param4,
216 out_param1, out_param2, out_param3, out_param4);
218 g_array_append_vals(in_param1, &CallHandle, sizeof(unsigned int));
219 g_array_append_vals(in_param2, &AnsType, sizeof(TelCallAnswerType_t));
220 g_array_append_vals(in_param4, &conn_name, sizeof(tapi_dbus_connection_name));
222 TAPI_LIB_DEBUG(LEVEL_INFO, " Answer Call: Answer Type [%d], Call Handle [%d]",
223 AnsType, CallHandle);
225 TAPI_PRINT_TIME("tel_answer_call() is called..");
227 ret = tapi_send_request(TAPI_CS_SERVICE_CALL, TAPI_CS_CALL_ANSWER, in_param1, in_param2, in_param3, in_param4,
228 &out_param1, &out_param2, &out_param3, &out_param4);
231 /* Get the API error value as out param 1, from the server. */
232 api_err = g_array_index(out_param1, int, 0);
234 /* Get the Request ID as out param 2, from the server. */
235 *pRequestID = g_array_index(out_param2, int, 0);
238 /* RPC API failed, return FALSE to APP */
239 api_err = TAPI_API_SYSTEM_RPC_LINK_DOWN;
240 TAPI_LIB_DEBUG(LEVEL_ALERT, "_CALL_ERR_ : RPC link is down");
243 TAPI_GLIB_FREE_PARAMS(in_param1, in_param2, in_param3, in_param4,
244 out_param1, out_param2, out_param3, out_param4);
248 /* Invalid Input Range */
249 api_err = TAPI_API_INVALID_INPUT;
250 TAPI_LIB_DEBUG(LEVEL_ERR, "_CALL_ERR_: Invalid Answer Type");
253 TAPI_LIB_DEBUG(LEVEL_INFO, "Returning TapiResult_t [%+d], Reuest ID [%+d]", api_err, *pRequestID);
259 * Hangup calls. This is only for calls you dialed or answered with Telephony.
261 * The client specifies the call handle via the call_handle argument.
263 * Upon successful completion of Hangup, the information related to this call handle is destroyed.
265 * client can specify to Hangup a single call, all active calls, or all calls via argument tapi_release_type_t.
267 * @param[in] CallHandle Handle of the call which needs to be Hungup.
268 * @param[out] pRequestID. specifies the request identifier.
269 * @Interface Asynchronous.
270 * @return int API result code.
271 * @exception In case of exceptions return value contains appropriate error code.
272 * @remarks tapi_call_handle should contain a call handle which is in connected or held state.
273 * @see See below API's also.
274 * - tel_exe_call_mo(),
275 * - tel_answer_call(),
277 * - tel_retrieve_call(),
281 EXPORT_API int tel_release_call(unsigned int CallHandle, int *pRequestID)
284 int api_err = TAPI_API_SUCCESS;
286 TAPI_LIB_DEBUG(LEVEL_DEBUG, "Func Entrance");
288 /* check for invalid ptr etc etc if applicable.... */
289 TAPI_RET_ERR_NUM_IF_FAIL(pRequestID, TAPI_API_INVALID_PTR);
291 if (conn_name.length_of_name == 0) {
292 TAPI_LIB_DEBUG(LEVEL_ERR, "No dbus connection name");
293 return TAPI_API_OPERATION_FAILED;
296 if (0 < CallHandle) {
297 /* check for the RPC link.... */
298 TAPI_RET_ERR_NUM_IF_FAIL(tapi_check_dbus_status(), TAPI_API_SYSTEM_RPC_LINK_DOWN);
299 TAPI_GLIB_INIT_PARAMS();
301 TAPI_GLIB_ALLOC_PARAMS(in_param1, in_param2, in_param3, in_param4,
302 out_param1, out_param2, out_param3, out_param4);
304 g_array_append_vals(in_param1, &CallHandle, sizeof(unsigned int));
305 g_array_append_vals(in_param4, &conn_name, sizeof(tapi_dbus_connection_name));
307 TAPI_LIB_DEBUG(LEVEL_INFO, "Release Call: Call Handle [%d]", CallHandle);
309 TAPI_PRINT_TIME("tel_release_call() is called..");
311 ret = tapi_send_request(TAPI_CS_SERVICE_CALL, TAPI_CS_CALL_RELEASE, in_param1, in_param2, in_param3, in_param4,
312 &out_param1, &out_param2, &out_param3, &out_param4);
315 /* Get the API error value as out param 1, from the server. */
316 api_err = g_array_index(out_param1, int, 0);
318 /* Get the Request ID as out param 2, from the server. */
319 *pRequestID = g_array_index(out_param2, int, 0);
322 /* RPC API failed, return FALSE to APP */
323 api_err = TAPI_API_SYSTEM_RPC_LINK_DOWN;
324 TAPI_LIB_DEBUG(LEVEL_ALERT, "_CALL_ERR_ : RPC link is down");
327 TAPI_GLIB_FREE_PARAMS(in_param1, in_param2, in_param3, in_param4,
328 out_param1, out_param2, out_param3, out_param4);
332 /* Invalid Input Range.. */
333 api_err = TAPI_API_INVALID_CALL_HANDLE;
334 TAPI_LIB_DEBUG(LEVEL_ERR, "_CALL_ERR_:: Invalid Call Handle.");
337 TAPI_LIB_DEBUG(LEVEL_INFO, "Returning TapiResult_t [%+d], Reuest ID [%+d]", api_err, *pRequestID);
343 * Hangup calls. This is only for calls you dialed or answered with Telephony.
345 * The client specifies the call handle via the call_handle argument.
347 * Upon successful completion of Hangup, the information related to this call handle is destroyed.
349 * client can specify to Hangup a single call, all active calls, or all calls via argument tapi_release_type_t.
352 * @param[out] pRequestID. specifies the request identifier.
353 * @Interface Asynchronous.
354 * @return int API result code.
355 * @exception In case of exceptions return value contains appropriate error code.
356 * @remarks tapi_call_handle should contain a call handle which is in connected or held state.
357 * @see See below API's also.
358 * - tel_exe_call_mo(),
359 * - tel_answer_call(),
361 * - tel_retrieve_call(),
365 EXPORT_API int tel_release_call_all(int *pRequestID)
368 int api_err = TAPI_API_SUCCESS;
370 TAPI_LIB_DEBUG(LEVEL_DEBUG, "Func Entrance");
372 /* check for invalid ptr etc etc if applicable.... */
373 TAPI_RET_ERR_NUM_IF_FAIL(pRequestID, TAPI_API_INVALID_PTR);
375 /* check for the RPC link.... */
376 TAPI_RET_ERR_NUM_IF_FAIL(tapi_check_dbus_status(),
377 TAPI_API_SYSTEM_RPC_LINK_DOWN);
379 if (conn_name.length_of_name == 0) {
380 TAPI_LIB_DEBUG(LEVEL_ERR, "No dbus connection name");
381 return TAPI_API_OPERATION_FAILED;
383 TAPI_GLIB_INIT_PARAMS();
385 TAPI_GLIB_ALLOC_PARAMS(in_param1, in_param2, in_param3, in_param4,
386 out_param1, out_param2, out_param3, out_param4);
388 TAPI_LIB_DEBUG(LEVEL_DEBUG, "Release all calls:");
390 TAPI_PRINT_TIME("tel_release_call_all() is called..");
392 g_array_append_vals(in_param4, &conn_name, sizeof(tapi_dbus_connection_name));
394 ret = tapi_send_request(TAPI_CS_SERVICE_CALL, TAPI_CS_CALL_RELEASEALL, in_param1, in_param2, in_param3, in_param4,
395 &out_param1, &out_param2, &out_param3, &out_param4);
398 /* Get the API error value as out param 1, from the server. */
399 api_err = g_array_index(out_param1, int, 0);
401 /* Get the Request ID as out param 2, from the server. */
402 *pRequestID = g_array_index(out_param2, int, 0);
405 /* RPC API failed, return FALSE to APP */
406 api_err = TAPI_API_SYSTEM_RPC_LINK_DOWN;
407 TAPI_LIB_DEBUG(LEVEL_ALERT, "_CALL_ERR_ : RPC link is down");
410 TAPI_GLIB_FREE_PARAMS(in_param1, in_param2, in_param3, in_param4,
411 out_param1, out_param2, out_param3, out_param4);
413 TAPI_LIB_DEBUG(LEVEL_INFO, "Returning TapiResult_t [%+d], Reuest ID [%+d]", api_err, *pRequestID);
419 * Hangup calls. This is only for calls you dialed or answered with Telephony.
421 * Upon successful completion of Hangup, the information related to this call handle is destroyed.
425 * @param[out] pRequestID. specifies the request identifier.
426 * @Interface Asynchronous.
427 * @return int API result code.
428 * @exception In case of exceptions return value contains appropriate error code.
429 * @remarks tapi_call_handle should contain a call handle which is in connected or held state.
430 * @see See below API's also.
431 * - tel_exe_call_mo(),
432 * - tel_answer_call(),
434 * - tel_retrieve_call(),
437 EXPORT_API int tel_release_call_all_active(int *pRequestID)
440 int api_err = TAPI_API_SUCCESS;
442 TAPI_LIB_DEBUG(LEVEL_DEBUG, "Func Entrance");
444 /* check for invalid ptr etc etc if applicable.... */
445 TAPI_RET_ERR_NUM_IF_FAIL(pRequestID, TAPI_API_INVALID_PTR);
447 /* check for the RPC link.... */
448 TAPI_RET_ERR_NUM_IF_FAIL(tapi_check_dbus_status(),
449 TAPI_API_SYSTEM_RPC_LINK_DOWN);
451 if (conn_name.length_of_name == 0) {
452 TAPI_LIB_DEBUG(LEVEL_ERR, "No dbus connection name");
453 return TAPI_API_OPERATION_FAILED;
455 TAPI_GLIB_INIT_PARAMS();
457 TAPI_GLIB_ALLOC_PARAMS(in_param1, in_param2, in_param3, in_param4,
458 out_param1, out_param2, out_param3, out_param4);
460 TAPI_LIB_DEBUG(LEVEL_DEBUG, "Release all active calls:");
462 g_array_append_vals(in_param4, &conn_name, sizeof(tapi_dbus_connection_name));
464 ret = tapi_send_request(TAPI_CS_SERVICE_CALL, TAPI_CS_CALL_RELEASEALL_ACTIVE, in_param1, in_param2, in_param3,
465 in_param4, &out_param1, &out_param2, &out_param3, &out_param4);
468 /* Get the API error value as out param 1, from the server. */
469 api_err = g_array_index(out_param1, int, 0);
471 /* Get the Request ID as out param 2, from the server. */
472 *pRequestID = g_array_index(out_param2, int, 0);
475 /* RPC API failed, return FALSE to APP */
476 api_err = TAPI_API_SYSTEM_RPC_LINK_DOWN;
477 TAPI_LIB_DEBUG(LEVEL_ALERT, "_CALL_ERR_ : RPC link is down");
480 TAPI_GLIB_FREE_PARAMS(in_param1, in_param2, in_param3, in_param4,
481 out_param1, out_param2, out_param3, out_param4);
483 TAPI_LIB_DEBUG(LEVEL_INFO, "Returning TapiResult_t [%+d], Reuest ID [%+d]", api_err, *pRequestID);
490 * Hangup all held calls. This is only for calls you dialed or answered with Telephony.
493 * Upon successful completion of Hangup, the information related to this call handle is destroyed.
497 * @param[out] pRequestID. specifies the request identifier.
498 * @Interface Asynchronous.
499 * @return int API result code.
500 * @exception In case of exceptions return value contains appropriate error code.
501 * @remarks tapi_call_handle should contain a call handle which is in connected or held state.
502 * @see See below API's also.
503 * - tel_exe_call_mo(),
504 * - tel_answer_call(),
506 * - tel_retrieve_call(),
509 EXPORT_API int tel_release_call_all_held(int *pRequestID)
512 int api_err = TAPI_API_SUCCESS;
514 TAPI_LIB_DEBUG(LEVEL_DEBUG, "Func Entrance");
516 /* check for invalid ptr etc etc if applicable.... */
517 TAPI_RET_ERR_NUM_IF_FAIL(pRequestID, TAPI_API_INVALID_PTR);
519 /* check for the RPC link.... */
520 TAPI_RET_ERR_NUM_IF_FAIL(tapi_check_dbus_status(),
521 TAPI_API_SYSTEM_RPC_LINK_DOWN);
522 if (conn_name.length_of_name == 0) {
523 TAPI_LIB_DEBUG(LEVEL_ERR, "No dbus connection name");
524 return TAPI_API_OPERATION_FAILED;
526 TAPI_GLIB_INIT_PARAMS();
528 TAPI_GLIB_ALLOC_PARAMS(in_param1, in_param2, in_param3, in_param4,
529 out_param1, out_param2, out_param3, out_param4);
531 TAPI_LIB_DEBUG(LEVEL_DEBUG, "Release all held calls:");
532 g_array_append_vals(in_param4, &conn_name, sizeof(tapi_dbus_connection_name));
534 ret = tapi_send_request(TAPI_CS_SERVICE_CALL, TAPI_CS_CALL_RELEASEALL_HELD, in_param1, in_param2, in_param3,
535 in_param4, &out_param1, &out_param2, &out_param3, &out_param4);
538 /* Get the API error value as out param 1, from the server. */
539 api_err = g_array_index(out_param1, int, 0);
541 /* Get the Request ID as out param 2, from the server. */
542 *pRequestID = g_array_index(out_param2, int, 0);
545 /* RPC API failed, return FALSE to APP */
546 api_err = TAPI_API_SYSTEM_RPC_LINK_DOWN;
547 TAPI_LIB_DEBUG(LEVEL_ALERT, "_CALL_ERR_ : RPC link is down");
550 TAPI_GLIB_FREE_PARAMS(in_param1, in_param2, in_param3, in_param4,
551 out_param1, out_param2, out_param3, out_param4);
553 TAPI_LIB_DEBUG(LEVEL_INFO, "Returning TapiResult_t [%+d], Reuest ID [%+d]", api_err, *pRequestID);
561 * Places a call on hold. This is only for calls you dialed or answered with Telephony.
563 * The client specifies the call handle via the call_handle argument.
565 * @param[in] CallHandle, Hndle of active call.
566 * @param[out] pRequestID. specifies the request identifier.
567 * @return int API result code.
568 * @Interface Asynchronous.
569 * @exception In case of exceptions return value contains appropriate error code.
570 * @remarks tapi_call_handle should refer a call which is in ACTIVE state
571 * @see See below API's also.
572 * - tel_retrieve_call().
575 EXPORT_API int tel_hold_call(unsigned int CallHandle, int *pRequestID)
578 int api_err = TAPI_API_SUCCESS;
580 TAPI_LIB_DEBUG(LEVEL_DEBUG, "Func Entrance");
582 /* check for invalid ptr etc etc if applicable.... */
583 TAPI_RET_ERR_NUM_IF_FAIL(pRequestID, TAPI_API_INVALID_PTR);
585 if (conn_name.length_of_name == 0) {
586 TAPI_LIB_DEBUG(LEVEL_ERR, "No dbus connection name");
587 return TAPI_API_OPERATION_FAILED;
590 /* Check the call handle value... */
591 if (0 < CallHandle) {
592 /* check for the RPC link.... */
593 TAPI_RET_ERR_NUM_IF_FAIL(tapi_check_dbus_status(),
594 TAPI_API_SYSTEM_RPC_LINK_DOWN);
595 TAPI_GLIB_INIT_PARAMS();
597 TAPI_GLIB_ALLOC_PARAMS(in_param1, in_param2, in_param3, in_param4,
598 out_param1, out_param2, out_param3, out_param4);
600 g_array_append_vals(in_param1, &CallHandle, sizeof(unsigned int));
601 g_array_append_vals(in_param4, &conn_name, sizeof(tapi_dbus_connection_name));
603 TAPI_LIB_DEBUG(LEVEL_INFO, "Hold Call Handle [%d]", CallHandle);
605 ret = tapi_send_request(TAPI_CS_SERVICE_CALL, TAPI_CS_CALL_HOLD, in_param1, in_param2, in_param3, in_param4,
606 &out_param1, &out_param2, &out_param3, &out_param4);
609 /* Get the API error value as out param 1, from the server. */
610 api_err = g_array_index(out_param1, int, 0);
612 /* Get the Request ID as out param 2, from the server. */
613 *pRequestID = g_array_index(out_param2, int, 0);
616 /* RPC API failed, return FALSE to APP */
617 api_err = TAPI_API_SYSTEM_RPC_LINK_DOWN;
618 TAPI_LIB_DEBUG(LEVEL_ALERT, "_CALL_ERR_ : RPC link is down");
621 TAPI_GLIB_FREE_PARAMS(in_param1, in_param2, in_param3, in_param4,
622 out_param1, out_param2, out_param3, out_param4);
626 api_err = TAPI_API_INVALID_CALL_HANDLE;
627 TAPI_LIB_DEBUG(LEVEL_ERR, "_CALL_ERR_: Invalid CALL HANDLE");
630 TAPI_LIB_DEBUG(LEVEL_INFO, "Returning TapiResult_t [%+d], Reuest ID [%+d]", api_err, *pRequestID);
637 * Retrieve held calls. This is only for calls you dialed or answered with Telephony.
639 * The client specifies the call handle via the call_handle argument.
641 * @param[in] CallHandle, Handle of the held call
642 * @param[out] pRequestID. specifies the request identifier.
643 * @Interface Asynchronous.
644 * @return int API result code.
645 * @exception In case of exceptions return value contains appropriate error code.
646 * @remarks tapi_call_handle should refer a call which is in HELD state..
649 EXPORT_API int tel_retrieve_call(unsigned int CallHandle, int *pRequestID)
652 int api_err = TAPI_API_SUCCESS;
654 TAPI_LIB_DEBUG(LEVEL_DEBUG, "Func Entrance");
656 /* check for invalid ptr etc etc if applicable.... */
657 TAPI_RET_ERR_NUM_IF_FAIL(pRequestID, TAPI_API_INVALID_PTR);
659 if (conn_name.length_of_name == 0) {
660 TAPI_LIB_DEBUG(LEVEL_ERR, "No dbus connection name");
661 return TAPI_API_OPERATION_FAILED;
664 /* Check the call handle value... */
665 if (0 < CallHandle) {
666 /* check for the RPC link.... */
667 TAPI_RET_ERR_NUM_IF_FAIL(tapi_check_dbus_status(), TAPI_API_SYSTEM_RPC_LINK_DOWN);
668 TAPI_GLIB_INIT_PARAMS();
670 TAPI_GLIB_ALLOC_PARAMS(in_param1, in_param2, in_param3, in_param4,
671 out_param1, out_param2, out_param3, out_param4);
673 g_array_append_vals(in_param1, &CallHandle, sizeof(unsigned int));
674 g_array_append_vals(in_param4, &conn_name, sizeof(tapi_dbus_connection_name));
676 TAPI_LIB_DEBUG(LEVEL_INFO, "Activate Call Handle [%d]", CallHandle);
678 ret = tapi_send_request(TAPI_CS_SERVICE_CALL, TAPI_CS_CALL_ACTIVATE, in_param1, in_param2, in_param3,
679 in_param4, &out_param1, &out_param2, &out_param3, &out_param4);
682 /* Get the API error value as out param 1, from the server. */
683 api_err = g_array_index(out_param1, int, 0);
685 /* Get the Request ID as out param 2, from the server. */
686 *pRequestID = g_array_index(out_param2, int, 0);
689 /* RPC API failed, return FALSE to APP */
690 api_err = TAPI_API_SYSTEM_RPC_LINK_DOWN;
691 TAPI_LIB_DEBUG(LEVEL_ALERT, "_CALL_ERR_ : RPC link is down");
694 TAPI_GLIB_FREE_PARAMS(in_param1, in_param2, in_param3, in_param4,
695 out_param1, out_param2, out_param3, out_param4);
699 api_err = TAPI_API_INVALID_CALL_HANDLE;
700 TAPI_LIB_DEBUG(LEVEL_ERR, "_CALL_ERR_: Invalid CALL HANDLE");
703 TAPI_LIB_DEBUG(LEVEL_INFO, "Returning TapiResult_t [%+d], Reuest ID [%+d]", api_err, *pRequestID);
710 * Swap calls. This is only for calls you dialed or answered with Telephony.
712 * The client specifies the call handles via the active_call and held_call arguments.
714 * Swap is only available for the voice calls.
716 * @param[in] CallHandle1 Handle of the active call.
717 * @param[in] CallHandle2 Handle of the held call.
718 * @param[out] pRequestID. specifies the request identifier.
719 * @Interface Asynchronous.
720 * @return int API result code.
721 * @exception In case of exceptions return value contains appropriate error code.
725 EXPORT_API int tel_swap_call(unsigned int CallHandle1, unsigned int CallHandle2, int *pRequestID)
728 int api_err = TAPI_API_SUCCESS;
730 TAPI_LIB_DEBUG(LEVEL_DEBUG, "Func Entrance");
732 if (conn_name.length_of_name == 0) {
733 TAPI_LIB_DEBUG(LEVEL_ERR, "No dbus connection name");
734 return TAPI_API_OPERATION_FAILED;
737 /* check for invalid ptr etc etc if applicable.... */
738 TAPI_RET_ERR_NUM_IF_FAIL(pRequestID, TAPI_API_INVALID_PTR);
740 if ((0 < CallHandle1) && (0 < CallHandle2)) {
741 if (CallHandle1 == CallHandle2) {
742 return TAPI_API_INVALID_CALL_HANDLE;
745 /* check for the RPC link.... */
746 TAPI_RET_ERR_NUM_IF_FAIL(tapi_check_dbus_status(), TAPI_API_SYSTEM_RPC_LINK_DOWN);
747 TAPI_GLIB_INIT_PARAMS();
749 TAPI_GLIB_ALLOC_PARAMS(in_param1, in_param2, in_param3, in_param4,
750 out_param1, out_param2, out_param3, out_param4);
752 g_array_append_vals(in_param1, &CallHandle1, sizeof(unsigned int));
753 g_array_append_vals(in_param2, &CallHandle2, sizeof(unsigned int));
754 g_array_append_vals(in_param4, &conn_name, sizeof(tapi_dbus_connection_name));
756 TAPI_LIB_DEBUG(LEVEL_INFO, "Swap calls with handles [%d], and [%d]",
757 CallHandle1, CallHandle2);
759 ret = tapi_send_request(TAPI_CS_SERVICE_CALL, TAPI_CS_CALL_SWAP, in_param1, in_param2, in_param3, in_param4,
760 &out_param1, &out_param2, &out_param3, &out_param4);
763 /* Get the API error value as out param 1, from the server. */
764 api_err = g_array_index(out_param1, int, 0);
766 /* Get the Request ID as out param 2, from the server. */
767 *pRequestID = g_array_index(out_param2, int, 0);
770 /* RPC API failed, return FALSE to APP */
771 api_err = TAPI_API_SYSTEM_RPC_LINK_DOWN;
772 TAPI_LIB_DEBUG(LEVEL_ALERT, "_CALL_ERR_ : RPC link is down");
775 TAPI_GLIB_FREE_PARAMS(in_param1, in_param2, in_param3, in_param4,
776 out_param1, out_param2, out_param3, out_param4);
780 api_err = TAPI_API_INVALID_CALL_HANDLE;
781 TAPI_LIB_DEBUG(LEVEL_ERR, "_CALL_ERR_: Invalid CALL HANDLE");
784 TAPI_LIB_DEBUG(LEVEL_INFO, "Returning TapiResult_t [%+d], Reuest ID [%+d]", api_err, *pRequestID);
791 * Setup a conference call.
793 * The client specifies the call handles via the active_call and held_call arguments.
795 * Setup a conference call is only available for the voice calls.
797 * @param[in] CallHandle1 Handle of the active call.
798 * @param[in] CallHandle2 Handle of the held call.
799 * @param[out] pRequestID. specifies the request identifier.
800 * @Interface Asynchronous.
801 * @return int API result code.
802 * @exception In case of exceptions return value contains appropriate error code.
806 EXPORT_API int tel_join_call(unsigned int CallHandle1, unsigned int CallHandle2, int *pRequestID)
809 int api_err = TAPI_API_SUCCESS;
811 TAPI_LIB_DEBUG(LEVEL_DEBUG, "Func Entrance");
813 /* check for invalid ptr etc etc if applicable.... */
814 TAPI_RET_ERR_NUM_IF_FAIL(pRequestID, TAPI_API_INVALID_PTR);
816 if (conn_name.length_of_name == 0) {
817 TAPI_LIB_DEBUG(LEVEL_ERR, "No dbus connection name");
818 return TAPI_API_OPERATION_FAILED;
821 if ((0 < CallHandle1) && (0 < CallHandle2)) {
822 if (CallHandle1 == CallHandle2) {
823 return TAPI_API_INVALID_CALL_HANDLE;
826 /* check for the RPC link.... */
827 TAPI_RET_ERR_NUM_IF_FAIL(tapi_check_dbus_status(), TAPI_API_SYSTEM_RPC_LINK_DOWN);
828 TAPI_GLIB_INIT_PARAMS();
830 TAPI_GLIB_ALLOC_PARAMS(in_param1, in_param2, in_param3, in_param4,
831 out_param1, out_param2, out_param3, out_param4);
833 g_array_append_vals(in_param1, &CallHandle1, sizeof(unsigned int));
834 g_array_append_vals(in_param2, &CallHandle2, sizeof(unsigned int));
835 g_array_append_vals(in_param4, &conn_name, sizeof(tapi_dbus_connection_name));
837 TAPI_LIB_DEBUG(LEVEL_INFO, "Join Calls with Handles [%d], [%d]",
838 CallHandle1, CallHandle2);
840 ret = tapi_send_request(TAPI_CS_SERVICE_CALL, TAPI_CS_CALL_SETUPCONFCALL, in_param1, in_param2, in_param3,
841 in_param4, &out_param1, &out_param2, &out_param3, &out_param4);
844 /* Get the API error value as out param 1, from the server. */
845 api_err = g_array_index(out_param1, int, 0);
847 /* Get the Request ID as out param 2, from the server. */
848 *pRequestID = g_array_index(out_param2, int, 0);
851 /* RPC API failed, return FALSE to APP */
852 api_err = TAPI_API_SYSTEM_RPC_LINK_DOWN;
853 TAPI_LIB_DEBUG(LEVEL_ALERT, "_CALL_ERR_ : RPC link is down");
856 TAPI_GLIB_FREE_PARAMS(in_param1, in_param2, in_param3, in_param4,
857 out_param1, out_param2, out_param3, out_param4);
861 api_err = TAPI_API_INVALID_CALL_HANDLE;
862 TAPI_LIB_DEBUG(LEVEL_ERR, "_CALL_ERR_: Invalid CALL HANDLE");
865 TAPI_LIB_DEBUG(LEVEL_INFO, "Returning TapiResult_t [%+d], Reuest ID [%+d]", api_err, *pRequestID);
872 * Split a call from conference call.
874 * The client specifies the call handle via the call_handle argument.
876 * Split a conference call is only available for the voice calls.
878 * @param[in] CallHandle Handle of the call which needs to be seperated.
879 * @param[out] pRequestID. specifies the request identifier.
880 * @Interface Asynchronous.
881 * @return int API result code.
882 * @exception In case of exceptions return value contains appropriate error code.
886 EXPORT_API int tel_split_call(unsigned int CallHandle, int *pRequestID)
889 int api_err = TAPI_API_SUCCESS;
891 TAPI_LIB_DEBUG(LEVEL_DEBUG,"Func Entrance");
893 /* check for invalid ptr etc etc if applicable.... */
894 TAPI_RET_ERR_NUM_IF_FAIL(pRequestID, TAPI_API_INVALID_PTR);
896 if (conn_name.length_of_name == 0) {
897 TAPI_LIB_DEBUG(LEVEL_ERR, "No dbus connection name");
898 return TAPI_API_OPERATION_FAILED;
901 if ((0 < CallHandle)) {
902 /* check for the RPC link.... */
903 TAPI_RET_ERR_NUM_IF_FAIL(tapi_check_dbus_status(),
904 TAPI_API_SYSTEM_RPC_LINK_DOWN);
905 TAPI_GLIB_INIT_PARAMS();
907 TAPI_GLIB_ALLOC_PARAMS(in_param1, in_param2, in_param3, in_param4,
908 out_param1, out_param2, out_param3, out_param4);
910 g_array_append_vals(in_param1, &CallHandle, sizeof(unsigned int));
911 g_array_append_vals(in_param4, &conn_name, sizeof(tapi_dbus_connection_name));
913 TAPI_LIB_DEBUG(LEVEL_INFO, "Split Call Handle [%d]", CallHandle);
915 ret = tapi_send_request(TAPI_CS_SERVICE_CALL, TAPI_CS_CALL_SPLITCONFCALL, in_param1, in_param2, in_param3,
916 in_param4, &out_param1, &out_param2, &out_param3, &out_param4);
919 /* Get the API error value as out param 1, from the server. */
920 api_err = g_array_index(out_param1, int, 0);
922 /* Get the Request ID as out param 2, from the server. */
923 *pRequestID = g_array_index(out_param2, int, 0);
926 /* RPC API failed, return FALSE to APP */
927 api_err = TAPI_API_SYSTEM_RPC_LINK_DOWN;
928 TAPI_LIB_DEBUG(LEVEL_ALERT, "_CALL_ERR_ : RPC link is down");
931 TAPI_GLIB_FREE_PARAMS(in_param1, in_param2, in_param3, in_param4,
932 out_param1, out_param2, out_param3, out_param4);
935 api_err = TAPI_API_INVALID_CALL_HANDLE;
936 TAPI_LIB_DEBUG(LEVEL_ERR, "_CALL_ERR_: Invalid CALL HANDLE");
939 TAPI_LIB_DEBUG(LEVEL_INFO, "Returning TapiResult_t [%+d], Reuest ID [%+d]", api_err, *pRequestID);
946 * Transfers a call to another call.
948 * client specifies the handle of the calls via active_call, held_call arguments.
950 * Transfer call is only available for the voice calls.
952 * @param[in] CallHandle, Handle of the active call.
953 * @param[out] pRequestID. specifies the request identifier.
954 * @Interface Asynchronous.
955 * @return int API result code.
956 * @exception In case of exceptions return value contains appropriate error code.
960 EXPORT_API int tel_exe_call_explicit_transfer(unsigned int CallHandle, int *pRequestID)
963 int api_err = TAPI_API_SUCCESS;
965 TAPI_LIB_DEBUG(LEVEL_DEBUG, "Func Entrance");
967 /* check for invalid ptr etc etc if applicable.... */
968 TAPI_RET_ERR_NUM_IF_FAIL(pRequestID, TAPI_API_INVALID_PTR);
970 if (conn_name.length_of_name == 0) {
971 TAPI_LIB_DEBUG(LEVEL_ERR, "No dbus connection name");
972 return TAPI_API_OPERATION_FAILED;
975 if (0 < CallHandle) {
976 /* check for the RPC link.... */
977 TAPI_RET_ERR_NUM_IF_FAIL(tapi_check_dbus_status(), TAPI_API_SYSTEM_RPC_LINK_DOWN);
978 TAPI_GLIB_INIT_PARAMS();
980 TAPI_GLIB_ALLOC_PARAMS(in_param1, in_param2, in_param3, in_param4,
981 out_param1, out_param2, out_param3, out_param4);
983 g_array_append_vals(in_param1, &CallHandle, sizeof(unsigned int));
984 g_array_append_vals(in_param4, &conn_name, sizeof(tapi_dbus_connection_name));
986 TAPI_LIB_DEBUG(LEVEL_INFO, "ECT Call Handle [%d]", CallHandle);
988 ret = tapi_send_request(TAPI_CS_SERVICE_CALL, TAPI_CS_CALL_TRANSFERCALL, in_param1, in_param2, in_param3,
989 in_param4, &out_param1, &out_param2, &out_param3, &out_param4);
992 /* Get the API error value as out param 1, from the server. */
993 api_err = g_array_index(out_param1, int, 0);
995 /* Get the Request ID as out param 2, from the server. */
996 *pRequestID = g_array_index(out_param2, int, 0);
999 /* RPC API failed, return FALSE to APP */
1000 api_err = TAPI_API_SYSTEM_RPC_LINK_DOWN;
1001 TAPI_LIB_DEBUG(LEVEL_ALERT, "_CALL_ERR_ : RPC link is down");
1004 TAPI_GLIB_FREE_PARAMS(in_param1, in_param2, in_param3, in_param4,
1005 out_param1, out_param2, out_param3, out_param4);
1009 api_err = TAPI_API_INVALID_CALL_HANDLE;
1010 TAPI_LIB_DEBUG(LEVEL_ERR, "_CALL_ERR_: Invalid CALL HANDLE");
1013 TAPI_LIB_DEBUG(LEVEL_INFO, "Returning TapiResult_t [%+d], Reuest ID [%+d]", api_err, *pRequestID);
1020 * Activate Call Completion to a Busy Subscriber.
1022 * client specifies the handle of the call via call_handle argument.
1024 * Activate CCBS is only available for the voice calls.
1026 * @param[in] CallHandle, Handle of the call.
1027 * @param[out] pRequestID. specifies the request identifier.
1028 * @Interface Asynchronous.
1029 * @return int API result code.
1030 * @exception In case of exceptions return value contains appropriate error code.
1034 EXPORT_API int tel_activate_call_ccbs(unsigned int CallHandle, int *pRequestID)
1036 TS_BOOL ret = FALSE;
1037 int api_err = TAPI_API_SUCCESS;
1039 TAPI_LIB_DEBUG(LEVEL_DEBUG, "Func Entrance");
1041 /* check for invalid ptr etc etc if applicable.... */
1042 TAPI_RET_ERR_NUM_IF_FAIL(pRequestID, TAPI_API_INVALID_PTR);
1044 if (conn_name.length_of_name == 0) {
1045 TAPI_LIB_DEBUG(LEVEL_ERR, "No dbus connection name");
1046 return TAPI_API_OPERATION_FAILED;
1049 /* Check the call handle value... */
1050 if (0 < CallHandle) {
1051 /* check for the RPC link.... */
1052 TAPI_RET_ERR_NUM_IF_FAIL(tapi_check_dbus_status(), TAPI_API_SYSTEM_RPC_LINK_DOWN);
1053 TAPI_GLIB_INIT_PARAMS();
1055 TAPI_GLIB_ALLOC_PARAMS(in_param1, in_param2, in_param3, in_param4,
1056 out_param1, out_param2, out_param3, out_param4);
1058 g_array_append_vals(in_param1, &CallHandle, sizeof(unsigned int));
1059 g_array_append_vals(in_param4, &conn_name, sizeof(tapi_dbus_connection_name));
1061 TAPI_LIB_DEBUG(LEVEL_INFO, "CCBS Call Handle [%d]", CallHandle);
1063 ret = tapi_send_request(TAPI_CS_SERVICE_CALL, TAPI_CS_CALL_ACTIVATECCBS, in_param1, in_param2, in_param3,
1064 in_param4, &out_param1, &out_param2, &out_param3, &out_param4);
1067 /* Get the API error value as out param 1, from the server. */
1068 api_err = g_array_index(out_param1, int, 0);
1070 /* Get the Request ID as out param 2, from the server. */
1071 *pRequestID = g_array_index(out_param2, int, 0);
1074 /* RPC API failed, return FALSE to APP */
1075 api_err = TAPI_API_SYSTEM_RPC_LINK_DOWN;
1076 TAPI_LIB_DEBUG(LEVEL_ALERT, "_CALL_ERR_ : RPC link is down");
1079 TAPI_GLIB_FREE_PARAMS(in_param1, in_param2, in_param3, in_param4,
1080 out_param1, out_param2, out_param3, out_param4);
1083 api_err = TAPI_API_INVALID_CALL_HANDLE;
1084 TAPI_LIB_DEBUG(LEVEL_ERR, "_CALL_ERR_: Invalid CALL HANDLE");
1087 TAPI_LIB_DEBUG(LEVEL_INFO, "Returning TapiResult_t [%+d], Reuest ID [%+d]", api_err, *pRequestID);
1093 * Send DTMF digits to the network.
1095 * Client specifies the Handle of the active call via call_handle argument.
1097 * The handle of the call is voice call only.
1099 * @param[in] tapi_call_dtmf_t DTMF digits.
1100 * @param[out] pRequestID. specifies the request identifier.
1101 * @Interface Asynchronous.
1102 * @return int API result code.
1103 * @exception In case of exceptions return value contains appropriate error code.
1104 * @remarks tapi_call_dtmf_t can not be NULL.
1107 EXPORT_API int tel_send_call_dtmf(const char *pDtmfString, int *pRequestID)
1109 TS_BOOL ret = FALSE;
1111 int app_err = TAPI_API_SUCCESS;
1113 TAPI_LIB_DEBUG(LEVEL_DEBUG, "Func Entrance");
1115 /* check for invalid ptr etc etc if applicable.... */
1116 TAPI_RET_ERR_NUM_IF_FAIL( (pRequestID && pDtmfString), TAPI_API_INVALID_PTR);
1118 if (conn_name.length_of_name == 0) {
1119 TAPI_LIB_DEBUG(LEVEL_ERR, "No dbus connection name");
1120 return TAPI_API_OPERATION_FAILED;
1123 length = strlen(pDtmfString);
1125 /* Check the input value... */
1127 /* check for the RPC link.... */
1128 TAPI_RET_ERR_NUM_IF_FAIL(tapi_check_dbus_status(), TAPI_API_SYSTEM_RPC_LINK_DOWN);
1129 TAPI_GLIB_INIT_PARAMS();
1131 TAPI_GLIB_ALLOC_PARAMS(in_param1, in_param2, in_param3, in_param4,
1132 out_param1, out_param2, out_param3, out_param4);
1134 TAPI_LIB_DEBUG(LEVEL_INFO, "Send DTMF digits [%s] and len [%d]",
1135 pDtmfString, length);
1137 /* to allocate for null termiated string */
1138 g_array_append_vals(in_param1, pDtmfString, (length + 1));
1139 g_array_append_vals(in_param4, &conn_name, sizeof(tapi_dbus_connection_name));
1141 ret = tapi_send_request(TAPI_CS_SERVICE_CALL, TAPI_CS_CALL_DTMF, in_param1, in_param2, in_param3, in_param4,
1142 &out_param1, &out_param2, &out_param3, &out_param4);
1145 /* Get the API error value as out param 1, from the server. */
1146 app_err = g_array_index(out_param1, int, 0);
1148 /* Get the Request ID as out param 2, from the server. */
1149 *pRequestID = g_array_index(out_param2, int, 0);
1152 /* RPC API failed, return FALSE to APP */
1153 app_err = TAPI_API_SYSTEM_RPC_LINK_DOWN;
1154 TAPI_LIB_DEBUG(LEVEL_ALERT, "_CALL_ERR_ : RPC link is down");
1157 TAPI_GLIB_FREE_PARAMS(in_param1, in_param2, in_param3, in_param4,
1158 out_param1, out_param2, out_param3, out_param4);
1161 app_err = TAPI_API_INVALID_INPUT;
1162 TAPI_LIB_DEBUG(LEVEL_ERR, "_CALL_ERR_: Invalid CALL HANDLE");
1165 TAPI_LIB_DEBUG(LEVEL_INFO, "Returning TapiResult_t [%+d], Reuest ID [%+d]", app_err, *pRequestID);
1174 * If informed about an incoming call this call may be redirected to an another destination by
1176 * entering the destination Number. The cleint spcifies the dstiantion number to which the current
1178 * incoming call needs to be redirected is specifed via info argument.
1180 * @param[in] call_handle, Incoming call handle.
1181 * @param[in] TelCallDeflectDstInfo_t Destination Number.
1182 * @param[out] pRequestID. specifies the request identifier.
1183 * @Interface Asynchronous.
1184 * @return int API result code.
1185 * @exception In case of exceptions return value contains appropriate error code.
1186 * @remarks info can not be NULL.
1189 EXPORT_API int tel_deflect_call(unsigned int CallHandle, const TelCallDeflectDstInfo_t *pInfo, int *pRequestID)
1191 TS_BOOL ret = FALSE;
1192 int api_err = TAPI_API_SUCCESS;
1194 TAPI_LIB_DEBUG(LEVEL_DEBUG, "Func Entrance");
1196 if (conn_name.length_of_name == 0) {
1197 TAPI_LIB_DEBUG(LEVEL_ERR, "No dbus connection name");
1198 return TAPI_API_OPERATION_FAILED;
1201 /* check for the input pointer .. */
1202 TAPI_RET_ERR_NUM_IF_FAIL( (pRequestID && pInfo), TAPI_API_INVALID_PTR);
1204 /* Check the input value... */
1205 if (0 < CallHandle) {
1206 /* check for the RPC link.... */
1207 TAPI_RET_ERR_NUM_IF_FAIL(tapi_check_dbus_status(), TAPI_API_SYSTEM_RPC_LINK_DOWN);
1208 TAPI_GLIB_INIT_PARAMS();
1210 TAPI_GLIB_ALLOC_PARAMS(in_param1, in_param2, in_param3, in_param4,
1211 out_param1, out_param2, out_param3, out_param4);
1213 g_array_append_vals(in_param1, &CallHandle, sizeof(unsigned int));
1214 g_array_append_vals(in_param2, pInfo, sizeof(TelCallDeflectDstInfo_t));
1215 g_array_append_vals(in_param4, &conn_name, sizeof(tapi_dbus_connection_name));
1217 TAPI_LIB_DEBUG(LEVEL_INFO, "Deflect Call Handle [%d] to [%s]",
1218 CallHandle, pInfo->number);
1220 ret = tapi_send_request(TAPI_CS_SERVICE_CALL, TAPI_CS_CALL_DEFLECT, in_param1, in_param2, in_param3, in_param4,
1221 &out_param1, &out_param2, &out_param3, &out_param4);
1224 /* Get the API error value as out param 1, from the server. */
1225 api_err = g_array_index(out_param1, int, 0);
1227 /* Get the Request ID as out param 2, from the server. */
1228 *pRequestID = g_array_index(out_param2, int, 0);
1232 /* RPC API failed, return FALSE to APP */
1233 api_err = TAPI_API_SYSTEM_RPC_LINK_DOWN;
1234 TAPI_LIB_DEBUG(LEVEL_ALERT, "_CALL_ERR_ : RPC link is down");
1237 TAPI_GLIB_FREE_PARAMS(in_param1, in_param2, in_param3, in_param4,
1238 out_param1, out_param2, out_param3, out_param4);
1241 api_err = TAPI_API_INVALID_CALL_HANDLE;
1242 TAPI_LIB_DEBUG(LEVEL_ERR, "_CALL_ERR_: Invalid CALL HANDLE");
1245 TAPI_LIB_DEBUG(LEVEL_INFO, " Returning TapiResult_t [%+d], Reuest ID [%+d]", api_err, *pRequestID);
1252 * Get the current calling line identification number.
1254 * The line id is returned via the argument ptr_active_line.
1257 * @param[out] TelCallActiveLine_t current active line id, *pRequestID. specifies the request identifier.
1258 * @Interface Asynchronous.
1259 * @return int API result code.
1260 * @exception In case of exceptions return value contains appropriate error code.
1261 * @remarks TelCallActiveLine_t can not be NULL.
1264 EXPORT_API int tel_get_call_act_line(int *pRequestID)
1266 TS_BOOL ret = FALSE;
1267 int api_err = TAPI_API_SUCCESS;
1269 TAPI_LIB_DEBUG(LEVEL_DEBUG, "Func Entrance");
1271 /* check for invalid ptr etc etc if applicable.... */
1272 TAPI_RET_ERR_NUM_IF_FAIL( pRequestID, TAPI_API_INVALID_PTR);
1274 /* check for the RPC link.... */
1275 TAPI_RET_ERR_NUM_IF_FAIL(tapi_check_dbus_status(), TAPI_API_SYSTEM_RPC_LINK_DOWN);
1277 if (conn_name.length_of_name == 0) {
1278 TAPI_LIB_DEBUG(LEVEL_ERR, "No dbus connection name");
1279 return TAPI_API_OPERATION_FAILED;
1281 TAPI_GLIB_INIT_PARAMS();
1283 TAPI_GLIB_ALLOC_PARAMS(in_param1, in_param2, in_param3, in_param4,
1284 out_param1, out_param2, out_param3, out_param4);
1286 g_array_append_vals(in_param4, &conn_name, sizeof(tapi_dbus_connection_name));
1288 TAPI_LIB_DEBUG(LEVEL_DEBUG, "Get Active Line");
1290 ret = tapi_send_request(TAPI_CS_SERVICE_CALL, TAPI_CS_CALL_GETACTIVELINE, in_param1, in_param2, in_param3,
1291 in_param4, &out_param1, &out_param2, &out_param3, &out_param4);
1294 /* Get the API error value as out param 1, from the server. */
1295 api_err = g_array_index(out_param1, int, 0);
1297 /* Get the Request ID as out param 2, from the server. */
1298 *pRequestID = g_array_index(out_param2, int, 0);
1302 /* RPC API failed, return FALSE to APP */
1303 api_err = TAPI_API_SYSTEM_RPC_LINK_DOWN;
1304 TAPI_LIB_DEBUG(LEVEL_ALERT, "_CALL_ERR_ : RPC link is down");
1307 TAPI_GLIB_FREE_PARAMS(in_param1, in_param2, in_param3, in_param4,
1308 out_param1, out_param2, out_param3, out_param4);
1310 TAPI_LIB_DEBUG(LEVEL_INFO, " Returning TapiResult_t [%+d], Reuest ID [%+d]", api_err, *pRequestID);
1317 * Set the current calling line identification number.
1319 * Client specifies the desired line id via the argument active_line.
1321 * @param[in] TelCallActiveLine_t calling line identification.
1322 * @param[out] pRequestID. specifies the request identifier.
1323 * @Interface Asynchronous.
1324 * @return int API result code.
1325 * @exception In case of exceptions return value contains appropriate error code.
1329 EXPORT_API int tel_set_call_act_line(TelCallActiveLine_t active_line, int *pRequestID)
1331 TS_BOOL ret = FALSE;
1332 int api_err = TAPI_API_SUCCESS;
1334 TAPI_LIB_DEBUG(LEVEL_DEBUG, "Func Entrance");
1336 /* check for invalid ptr etc etc if applicable.... */
1337 TAPI_RET_ERR_NUM_IF_FAIL(pRequestID, TAPI_API_INVALID_PTR);
1339 if (conn_name.length_of_name == 0) {
1340 TAPI_LIB_DEBUG(LEVEL_ERR, "No dbus connection name");
1341 return TAPI_API_OPERATION_FAILED;
1344 if ((TAPI_CALL_ACTIVE_LINE1 == active_line) || (TAPI_CALL_ACTIVE_LINE2 == active_line)) {
1345 /* check for the RPC link.... */
1346 TAPI_RET_ERR_NUM_IF_FAIL(tapi_check_dbus_status(), TAPI_API_SYSTEM_RPC_LINK_DOWN);
1347 TAPI_GLIB_INIT_PARAMS();
1349 TAPI_GLIB_ALLOC_PARAMS(in_param1, in_param2, in_param3, in_param4,
1350 out_param1, out_param2, out_param3, out_param4);
1352 g_array_append_vals(in_param1, &active_line, sizeof(TelCallActiveLine_t));
1353 g_array_append_vals(in_param4, &conn_name, sizeof(tapi_dbus_connection_name));
1355 TAPI_LIB_DEBUG(LEVEL_INFO, "Set Active Line ID [%d]", active_line);
1357 ret = tapi_send_request(TAPI_CS_SERVICE_CALL, TAPI_CS_CALL_SETACTIVELINE, in_param1, in_param2, in_param3,
1358 in_param4, &out_param1, &out_param2, &out_param3, &out_param4);
1361 /* Get the API error value as out param 1, from the server. */
1362 api_err = g_array_index(out_param1, int, 0);
1364 /* Get the Request ID as out param 2, from the server. */
1365 *pRequestID = g_array_index(out_param2, int, 0);
1368 /* RPC API failed, return FALSE to APP */
1369 api_err = TAPI_API_SYSTEM_RPC_LINK_DOWN;
1370 TAPI_LIB_DEBUG(LEVEL_ALERT, "_CALL_ERR_ : RPC link is down");
1373 TAPI_GLIB_FREE_PARAMS(in_param1, in_param2, in_param3, in_param4,
1374 out_param1,out_param2, out_param3, out_param4);
1377 api_err = TAPI_API_INVALID_INPUT;
1378 TAPI_LIB_DEBUG(LEVEL_ERR, "_CALL_ERR_: Invalid input");
1381 TAPI_LIB_DEBUG(LEVEL_INFO, " Returning TapiResult_t [%+d], Reuest ID [%+d]", api_err, *pRequestID);
1387 * @brief This function gets status for the current call identified by Call Handle whenever
1388 * application wants the call status. Call handle must be valid.
1391 * @par Sync (or) Async:
1392 * This is a Synchronous API.
1394 * @par Important Notes:
1401 * @param[in] CallHandle
1402 * - Unique handle for referring the call.
1404 * @param [out] pCallStatus
1405 * - Call status information like destination number, call direction (MO or MT), call type (voice or data etc), whether
1406 * the call is in conference state or not, present call state etc are returned through this parameter.
1408 * @par Async Response Message:
1417 * @return Return Type (int) \n
1418 * - 0 - indicating that the operation has completed successfully. \n
1419 * - Else it will return failure and error code (Refer Doxygen doc or TapiResult_t)
1421 * @par Prospective Clients:
1426 EXPORT_API int tel_get_call_status(unsigned int CallHandle, TelCallStatus_t *pCallStatus)
1428 TS_BOOL ret = FALSE;
1429 int api_err = TAPI_API_SUCCESS;
1431 TAPI_LIB_DEBUG(LEVEL_DEBUG, "Func Entrance");
1432 TAPI_LIB_DEBUG(LEVEL_DEBUG, "CallHandle:[%d]\n",CallHandle);
1434 /* check for invalid ptr etc etc if applicable.... */
1435 TAPI_RET_ERR_NUM_IF_FAIL(pCallStatus, TAPI_API_INVALID_PTR);
1437 if (CallHandle > 0) {
1438 /* check for the RPC link.... */
1439 TAPI_RET_ERR_NUM_IF_FAIL(tapi_check_dbus_status(), TAPI_API_SYSTEM_RPC_LINK_DOWN);
1440 TAPI_GLIB_INIT_PARAMS();
1442 TAPI_GLIB_ALLOC_PARAMS(in_param1, in_param2, in_param3, in_param4,
1443 out_param1, out_param2, out_param3, out_param4);
1445 g_array_append_vals(in_param1, &CallHandle, sizeof(unsigned int));
1447 TAPI_LIB_DEBUG(LEVEL_DEBUG, "Call Service Request: .(Get Call Status)");
1449 ret = tapi_send_request(TAPI_CS_SERVICE_CALL, TAPI_CS_CALL_GETSTATUS, in_param1, in_param2, in_param3,
1450 in_param4, &out_param1, &out_param2, &out_param3, &out_param4);
1453 /* Get the API error value as out param 1, from the server. */
1454 api_err = g_array_index(out_param1, int, 0);
1456 /* Get the call status as out param 3, from the server. */
1457 *pCallStatus = g_array_index(out_param3, TelCallStatus_t , 0);
1460 /* RPC API failed, return FALSE to APP */
1462 api_err = TAPI_API_SYSTEM_RPC_LINK_DOWN;
1465 TAPI_GLIB_FREE_PARAMS(in_param1, in_param2, in_param3, in_param4,
1466 out_param1, out_param2, out_param3, out_param4);
1470 api_err = TAPI_API_INVALID_CALL_HANDLE;
1471 TAPI_LIB_DEBUG(LEVEL_ERR, "#####Invalid Handle");
1474 TAPI_LIB_DEBUG(LEVEL_INFO, " Returning TapiResult_t [%+d]", api_err);
1479 /*================================================================================================*/
1482 * \addtogroup tel_get_call_duration
1487 * @brief This function gets duration of the given call. This is a synchronous function. Duration is accounted from the moment
1488 * the connection is established, i.e. call goes into active state for first time.
1491 * @par Sync (or) Async:
1492 * This is a Synchronous API.
1494 * @par Important Notes:
1501 * @param[in] CallHandle
1502 * - Unique handle for referring the call.
1504 * @param [out] pDurationInSecs
1505 * - The total call duration in seconds from the call connecting time to the present time is returned through this parameter.
1507 * @par Async Response Message:
1516 * @return Return Type (int) \n
1517 * - 0 - indicating that the operation has completed successfully. \n
1518 * - Else it will return failure and error code (Refer Doxygen doc or TapiResult_t)
1520 * @par Prospective Clients:
1526 EXPORT_API int tel_get_call_duration(unsigned int CallHandle, unsigned int *pDurationInSecs)
1528 TS_BOOL ret = FALSE;
1529 int api_err = TAPI_API_SUCCESS;
1531 TAPI_LIB_DEBUG(LEVEL_DEBUG,"Func Entrance \n");
1532 TAPI_LIB_DEBUG(LEVEL_DEBUG,"CallHandle:[%d]\n",CallHandle);
1534 /* check for invalid ptr etc etc if applicable.... */
1535 TAPI_RET_ERR_NUM_IF_FAIL(pDurationInSecs, TAPI_API_INVALID_PTR);
1537 if (CallHandle > 0) {
1538 /* check for the RPC link.... */
1539 TAPI_RET_ERR_NUM_IF_FAIL(tapi_check_dbus_status(), TAPI_API_SYSTEM_RPC_LINK_DOWN);
1540 TAPI_GLIB_INIT_PARAMS();
1542 TAPI_GLIB_ALLOC_PARAMS(in_param1, in_param2, in_param3, in_param4,
1543 out_param1, out_param2, out_param3, out_param4);
1545 g_array_append_vals(in_param1, &CallHandle, sizeof(unsigned int));
1547 TAPI_LIB_DEBUG(LEVEL_DEBUG, "Call Service Request: .(Get Call Duration)");
1549 ret = tapi_send_request(TAPI_CS_SERVICE_CALL, TAPI_CS_CALL_GETDURATION, in_param1, in_param2, in_param3,
1550 in_param4, &out_param1, &out_param2, &out_param3, &out_param4);
1553 /* Get the API error value as out param 1, from the server. */
1554 api_err = g_array_index(out_param1, int, 0);
1556 /* Get the call durations as out param 3, from the server. */
1557 *pDurationInSecs = g_array_index(out_param3, unsigned int , 0);
1560 /* RPC API failed, return FALSE to APP */
1561 *pDurationInSecs = 0;
1562 api_err = TAPI_API_SYSTEM_RPC_LINK_DOWN;
1565 TAPI_GLIB_FREE_PARAMS(in_param1, in_param2, in_param3, in_param4,
1566 out_param1, out_param2, out_param3, out_param4);
1568 TAPI_LIB_DEBUG(LEVEL_INFO, "Returning TapiResult_t [%+d]", api_err);
1571 *pDurationInSecs = 0;
1572 api_err = TAPI_API_INVALID_CALL_HANDLE;
1573 TAPI_LIB_DEBUG(LEVEL_ERR, "#####Invalid Handle.");
1580 * @brief This is a synchronous function returns all call handles within the given conference call.
1583 * @par Sync (or) Async:
1584 * This is a Synchronous API.
1586 * @par Important Notes:
1587 * - Call should be a Multi-party conference call in order to return actual no of calls and call handles in the conference calls.
1593 * @param[in] CallHandle
1594 * - Handle of call which is associated with the conference.
1596 * @param [out] pCallList
1597 * - list of call joined in the conference call. In case there is no active conference. The list will be zero and
1598 * number of calls parameter value will also be zero. Maximum number of calls in a conference can be upto 5
1599 * (Based on 3GPP TS 22.084). Memory allocation for calllist is integer array of size 5.
1601 * @param [out] pNoOfCalls
1602 * - Number of the calls present in conference.
1604 * @par Async Response Message:
1613 * @return Return Type (int) \n
1614 * - 0 - indicating that the operation has completed successfully. \n
1615 * - Else it will return failure and error code (Refer Doxygen doc or TapiResult_t)
1617 * @par Prospective Clients:
1622 EXPORT_API int tel_get_call_conf_list(unsigned int CallHandle, unsigned int *pCallList, int *pNoOfCalls)
1624 TS_BOOL ret = FALSE;
1625 unsigned int * tempCallList;
1626 int api_err = TAPI_API_SUCCESS;
1628 TAPI_LIB_DEBUG(LEVEL_DEBUG,"<PROXY> Func Entrance \n");
1629 TAPI_LIB_DEBUG(LEVEL_DEBUG,"CallHandle:[%d]\n",CallHandle);
1631 /* check for the input pointer .. */
1632 TAPI_RET_ERR_NUM_IF_FAIL( (pCallList && pNoOfCalls), TAPI_API_INVALID_PTR);
1637 if (0 < CallHandle) {
1638 /* check for the RPC link.... */
1639 TAPI_RET_ERR_NUM_IF_FAIL(tapi_check_dbus_status(), TAPI_API_SYSTEM_RPC_LINK_DOWN);
1640 TAPI_GLIB_INIT_PARAMS();
1642 TAPI_GLIB_ALLOC_PARAMS(in_param1, in_param2, in_param3, in_param4,
1643 out_param1, out_param2, out_param3, out_param4);
1645 g_array_append_vals(in_param1, &CallHandle, sizeof(unsigned int));
1647 TAPI_LIB_DEBUG(LEVEL_DEBUG, "Call Service Request: .(Get Conference List)");
1649 ret = tapi_send_request(TAPI_CS_SERVICE_CALL, TAPI_CS_CALL_GETCONFERENCELIST, in_param1, in_param2, in_param3,
1650 in_param4, &out_param1, &out_param2, &out_param3, &out_param4);
1653 /* Get the API error value as out param 1, from the server. */
1654 api_err = g_array_index(out_param1, int, 0);
1656 /* Get the No. of Calls as out param 4, from the server. */
1657 *pNoOfCalls = g_array_index(out_param4, int , 0);
1659 if (*pNoOfCalls > 0) {
1660 /* Get the Call List as out param 3, from the server. */
1661 tempCallList = &g_array_index(out_param3, unsigned int , 0);
1664 tempCallList = NULL;
1667 if (tempCallList != NULL)
1668 memcpy(pCallList, tempCallList, sizeof(unsigned int) * (*pNoOfCalls));
1672 /* RPC API failed, return FALSE to APP */
1673 api_err = TAPI_API_SYSTEM_RPC_LINK_DOWN;
1676 TAPI_GLIB_FREE_PARAMS(in_param1, in_param2, in_param3, in_param4,
1677 out_param1, out_param2, out_param3, out_param4);
1679 TAPI_LIB_DEBUG(LEVEL_INFO, "Returning TapiResult_t [%+d]", api_err);
1682 api_err = TAPI_API_INVALID_CALL_HANDLE;
1683 TAPI_LIB_DEBUG(LEVEL_ERR, "#####Invalid Handle.");
1691 * @brief This function gets voice privacy option mode in phone(CDMA only).
1694 * @par Sync (or) Async:
1695 * This is a Asynchronous API.
1697 * @par Important Notes:
1707 * @param [out] pRequestId
1708 * - Unique identifier for a particular request.
1709 * - Request Id value can be any value from 0 to 255 if the API is returned successfully
1710 * - -1 (INVALID_REQUEST_ID) will be sent in case of failure.
1713 * @par Async Response Message:
1714 * - The event associated with this request is TAPI_EVENT_CALL_GET_PRIVACYMODE_CNF. Asynchronous return status
1715 * is indicated by #TelCallCause_t. #TelCallPrivacyMode_t is included in this event.
1724 * @return Return Type (int) \n
1725 * - 0 - indicating that the operation has completed successfully. \n
1726 * - Else it will return failure and error code (Refer Doxygen doc or TapiResult_t)
1728 * @par Prospective Clients:
1734 EXPORT_API int tel_get_call_privacy_mode(TelCallPrivacyType_t PrivacyType, int *pRequestID)
1736 TS_BOOL ret = FALSE;
1737 int api_err = TAPI_API_SUCCESS;
1739 TAPI_LIB_DEBUG(LEVEL_DEBUG, "Func Entrance");
1741 /* check for invalid ptr etc etc if applicable.... */
1742 TAPI_RET_ERR_NUM_IF_FAIL(pRequestID, TAPI_API_INVALID_PTR);
1744 if (conn_name.length_of_name == 0) {
1745 TAPI_LIB_DEBUG(LEVEL_ERR, "No dbus connection name");
1746 return TAPI_API_OPERATION_FAILED;
1749 if ((TAPI_CALL_PRIVACY_TYPE_MS <= PrivacyType) && (PrivacyType <= TAPI_CALL_PRIVACY_TYPE_CURRENT)) {
1750 /* check for the RPC link.... */
1751 TAPI_RET_ERR_NUM_IF_FAIL(tapi_check_dbus_status(), TAPI_API_SYSTEM_RPC_LINK_DOWN);
1752 TAPI_GLIB_INIT_PARAMS();
1754 TAPI_GLIB_ALLOC_PARAMS(in_param1, in_param2, in_param3, in_param4,
1755 out_param1, out_param2, out_param3, out_param4);
1757 g_array_append_vals(in_param1, &PrivacyType, sizeof(TelCallPrivacyType_t));
1758 g_array_append_vals(in_param4, &conn_name, sizeof(tapi_dbus_connection_name));
1760 TAPI_LIB_DEBUG(LEVEL_INFO, "Get Request PrivacyType:[%d]", PrivacyType);
1762 ret = tapi_send_request(TAPI_CS_SERVICE_CALL, TAPI_CS_CALL_GETPRIVACYMODE, in_param1, in_param2, in_param3,
1763 in_param4, &out_param1, &out_param2, &out_param3, &out_param4);
1766 /* Get the API error value as out param 1, from the server. */
1767 api_err = g_array_index(out_param1, int, 0);
1769 /* Get the Request ID as out param 2, from the server. */
1770 *pRequestID = g_array_index(out_param2, int, 0);
1773 /* RPC API failed, return FALSE to APP */
1774 api_err = TAPI_API_SYSTEM_RPC_LINK_DOWN;
1775 TAPI_LIB_DEBUG(LEVEL_ALERT, "_CALL_ERR_ : RPC link is down");
1778 TAPI_GLIB_FREE_PARAMS(in_param1, in_param2, in_param3, in_param4,
1779 out_param1, out_param2, out_param3, out_param4);
1782 api_err = TAPI_API_INVALID_INPUT;
1783 TAPI_LIB_DEBUG(LEVEL_ERR, "_CALL_ERR_: Invalid input");
1786 TAPI_LIB_DEBUG(LEVEL_INFO, " Returning TapiResult_t [%+d], Reuest ID [%+d]",api_err, *pRequestID);
1793 * @brief This function sets voice privacy option mode in phone. It is available only where call exists(CDMA only).
1795 * Access to this API is limited, we recommand you use Voice Call engine API.
1797 * @par Sync (or) Async:
1798 * This is a Asynchronous API.
1800 * @par Important Notes:
1807 * @param[in] PrivacyMode
1808 * - voice privacy option mode(ENHANCED or STANDARD)
1811 * @param [out] pRequestId
1812 * - Unique identifier for a particular request.
1813 * - Request Id value can be any value from 0 to 255 if the API is returned successfully
1814 * - -1 (INVALID_REQUEST_ID) will be sent in case of failure.
1817 * @par Async Response Message:
1818 * - The event associated with this request is TAPI_EVENT_CALL_SET_PRIVACYMODE_CNF. Asynchronous return status
1819 * is indicated by #TelCallCause_t.
1828 * @return Return Type (int) \n
1829 * - 0 - indicating that the operation has completed successfully. \n
1830 * - Else it will return failure and error code (Refer Doxygen doc or TapiResult_t)
1832 * @par Prospective Clients:
1838 EXPORT_API int tel_set_call_privacy_mode(TelCallVoicePrivacyInfo_t PrivacyInfo, int *pRequestID)
1840 TS_BOOL ret = FALSE;
1841 int api_err = TAPI_API_SUCCESS;
1843 TAPI_LIB_DEBUG(LEVEL_DEBUG, "Func Entrance");
1845 if (conn_name.length_of_name == 0) {
1846 TAPI_LIB_DEBUG(LEVEL_ERR, "No dbus connection name");
1847 return TAPI_API_OPERATION_FAILED;
1850 /* check for invalid ptr etc etc if applicable.... */
1851 TAPI_RET_ERR_NUM_IF_FAIL(pRequestID, TAPI_API_INVALID_PTR);
1853 if (((TAPI_CALL_PRIVACY_TYPE_MS <= PrivacyInfo.PrivacyType) && (TAPI_CALL_PRIVACY_TYPE_CURRENT
1854 >= PrivacyInfo.PrivacyType)) && ((TAPI_CALL_PRIVACY_MODE_STANDARD == PrivacyInfo.PrivacyMode)
1855 || (TAPI_CALL_PRIVACY_MODE_ENHANCED == PrivacyInfo.PrivacyMode))) {
1856 /* check for the RPC link.... */
1857 TAPI_RET_ERR_NUM_IF_FAIL(tapi_check_dbus_status(), TAPI_API_SYSTEM_RPC_LINK_DOWN);
1858 TAPI_GLIB_INIT_PARAMS();
1860 TAPI_GLIB_ALLOC_PARAMS(in_param1, in_param2, in_param3, in_param4,
1861 out_param1, out_param2, out_param3, out_param4);
1863 g_array_append_vals(in_param1, &PrivacyInfo, sizeof(TelCallVoicePrivacyInfo_t));
1864 g_array_append_vals(in_param4, &conn_name, sizeof(tapi_dbus_connection_name));
1866 TAPI_LIB_DEBUG(LEVEL_INFO, "Set PrivacyType:[%d], PrivacyMode:[%d]", PrivacyInfo.PrivacyType, PrivacyInfo.PrivacyMode);
1868 ret = tapi_send_request(TAPI_CS_SERVICE_CALL, TAPI_CS_CALL_SETPRIVACYMODE, in_param1, in_param2, in_param3,
1869 in_param4, &out_param1, &out_param2, &out_param3, &out_param4);
1872 /* Get the API error value as out param 1, from the server. */
1873 api_err = g_array_index(out_param1, int, 0);
1875 /* Get the Request ID as out param 2, from the server. */
1876 *pRequestID = g_array_index(out_param2, int, 0);
1879 /* RPC API failed, return FALSE to APP */
1880 api_err = TAPI_API_SYSTEM_RPC_LINK_DOWN;
1881 TAPI_LIB_DEBUG(LEVEL_ALERT, "_CALL_ERR_ : RPC link is down");
1884 TAPI_GLIB_FREE_PARAMS(in_param1, in_param2, in_param3, in_param4,
1885 out_param1, out_param2, out_param3, out_param4);
1888 api_err = TAPI_API_INVALID_INPUT;
1889 TAPI_LIB_DEBUG(LEVEL_ERR, "_CALL_ERR_: Invalid input");
1892 TAPI_LIB_DEBUG(LEVEL_INFO, " Returning TapiResult_t [%+d], Reuest ID [%+d]", api_err, *pRequestID);
1899 * @brief This function requests to send a Flash with Information Message(CDMA only).
1901 * Access to this API is limited, we recommand you use Voice Call engine API.
1903 * @par Sync (or) Async:
1904 * This is a Asynchronous API.
1906 * @par Important Notes:
1913 * @param[in] pDialNumber
1914 * - this is the calling number for 3 way call. But in the call waiting, this param should be NULL.
1917 * @param [out] pRequestId
1918 * - Unique identifier for a particular request.
1919 * - Request Id value can be any value from 0 to 255 if the API is returned successfully
1920 * - -1 (INVALID_REQUEST_ID) will be sent in case of failure.
1923 * @par Async Response Message:
1924 * - The event associated with this request is TAPI_EVENT_CALL_FLASHINFO_CNF. Asynchronous return status
1925 * is indicated by #TelCallCause_t.
1934 * @return Return Type (int) \n
1935 * - 0 - indicating that the operation has completed successfully. \n
1936 * - Else it will return failure and error code (Refer Doxygen doc or TapiResult_t)
1938 * @par Prospective Clients:
1944 EXPORT_API int tel_exe_call_flash_info(const char *pDialNumber, int *pRequestID)
1946 TS_BOOL ret = FALSE;
1948 int app_err = TAPI_API_SUCCESS;
1950 TAPI_LIB_DEBUG(LEVEL_DEBUG, "Func Entrance");
1952 /* check for invalid ptr etc etc if applicable.... */
1953 TAPI_RET_ERR_NUM_IF_FAIL( pRequestID, TAPI_API_INVALID_PTR);
1956 length = strlen(pDialNumber);
1957 TAPI_LIB_DEBUG(LEVEL_INFO, "DialNumber: [%s] and len:[%d]", pDialNumber, length);
1960 /* check for the RPC link.... */
1961 TAPI_RET_ERR_NUM_IF_FAIL(tapi_check_dbus_status(), TAPI_API_SYSTEM_RPC_LINK_DOWN);
1963 if (conn_name.length_of_name == 0) {
1964 TAPI_LIB_DEBUG(LEVEL_ERR, "No dbus connection name");
1965 return TAPI_API_OPERATION_FAILED;
1967 TAPI_GLIB_INIT_PARAMS();
1969 TAPI_GLIB_ALLOC_PARAMS(in_param1, in_param2, in_param3, in_param4,
1970 out_param1, out_param2, out_param3, out_param4);
1972 /* to allocate for null termiated string */
1975 g_array_append_vals(in_param1, pDialNumber, (length + 1));
1977 g_array_append_vals(in_param4, &conn_name, sizeof(tapi_dbus_connection_name));
1979 ret = tapi_send_request(TAPI_CS_SERVICE_CALL, TAPI_CS_CALL_FLASHINFO, in_param1, in_param2, in_param3, in_param4,
1980 &out_param1, &out_param2, &out_param3, &out_param4);
1983 /* Get the API error value as out param 1, from the server. */
1984 app_err = g_array_index(out_param1, int, 0);
1986 /* Get the Request ID as out param 2, from the server. */
1987 *pRequestID = g_array_index(out_param2, int, 0);
1990 /* RPC API failed, return FALSE to APP */
1991 app_err = TAPI_API_SYSTEM_RPC_LINK_DOWN;
1992 TAPI_LIB_DEBUG(LEVEL_ALERT, "_CALL_ERR_ : RPC link is down");
1995 TAPI_GLIB_FREE_PARAMS(in_param1, in_param2, in_param3, in_param4,
1996 out_param1, out_param2, out_param3, out_param4);
1998 TAPI_LIB_DEBUG(LEVEL_INFO, "Returning TapiResult_t [%+d], Reuest ID [%+d]",app_err, *pRequestID);
2004 * tel_exit_call_emergency_mode
2008 EXPORT_API int tel_exit_call_emergency_mode(int *pRequestID)
2010 TS_BOOL ret = FALSE;
2011 int api_err = TAPI_API_SUCCESS;
2013 TAPI_LIB_DEBUG(LEVEL_DEBUG, "Func Entrance");
2015 /* check for invalid ptr etc etc if applicable.... */
2016 TAPI_RET_ERR_NUM_IF_FAIL( pRequestID, TAPI_API_INVALID_PTR);
2018 /* check for the RPC link.... */
2019 TAPI_RET_ERR_NUM_IF_FAIL(tapi_check_dbus_status(), TAPI_API_SYSTEM_RPC_LINK_DOWN);
2021 if (conn_name.length_of_name == 0) {
2022 TAPI_LIB_DEBUG(LEVEL_ERR, "No dbus connection name");
2023 return TAPI_API_OPERATION_FAILED;
2025 TAPI_GLIB_INIT_PARAMS();
2027 TAPI_GLIB_ALLOC_PARAMS(in_param1, in_param2, in_param3, in_param4,
2028 out_param1, out_param2, out_param3, out_param4);
2030 g_array_append_vals(in_param4, &conn_name, sizeof(tapi_dbus_connection_name));
2032 ret = tapi_send_request(TAPI_CS_SERVICE_CALL, TAPI_CS_CALL_EXITEMERGENCYMODE, in_param1, in_param2, in_param3,
2033 in_param4, &out_param1, &out_param2, &out_param3, &out_param4);
2036 /* Get the API error value as out param 1, from the server. */
2037 api_err = g_array_index(out_param1, int, 0);
2039 /* Get the Request ID as out param 2, from the server. */
2040 *pRequestID = g_array_index(out_param2, int, 0);
2044 api_err = TAPI_API_SYSTEM_RPC_LINK_DOWN;
2045 TAPI_LIB_DEBUG(LEVEL_ALERT, "_CALL_ERR_ : RPC link is down");
2048 TAPI_GLIB_FREE_PARAMS(in_param1, in_param2, in_param3, in_param4,
2049 out_param1, out_param2, out_param3, out_param4);
2051 TAPI_LIB_DEBUG(LEVEL_INFO, " Returning TapiResult_t [%+d], Reuest ID [%+d]", api_err, *pRequestID);
2061 EXPORT_API int tel_get_call_time(unsigned short req_mask, int *pRequestID)
2063 TS_BOOL ret = FALSE;
2064 int api_err = TAPI_API_SUCCESS;
2066 TAPI_LIB_DEBUG(LEVEL_DEBUG, "Func Entrance");
2068 /* check for invalid ptr etc etc if applicable.... */
2069 TAPI_RET_ERR_NUM_IF_FAIL(pRequestID, TAPI_API_INVALID_PTR);
2071 if (conn_name.length_of_name == 0) {
2072 TAPI_LIB_DEBUG(LEVEL_ERR, "No dbus connection name");
2073 return TAPI_API_OPERATION_FAILED;
2076 /* check for the RPC link.... */
2077 TAPI_RET_ERR_NUM_IF_FAIL(tapi_check_dbus_status(), TAPI_API_SYSTEM_RPC_LINK_DOWN);
2078 TAPI_GLIB_INIT_PARAMS();
2080 TAPI_GLIB_ALLOC_PARAMS(in_param1, in_param2, in_param3, in_param4,
2081 out_param1, out_param2, out_param3, out_param4);
2083 g_array_append_vals(in_param1, &req_mask, sizeof(unsigned short));
2084 g_array_append_vals(in_param4, &conn_name, sizeof(tapi_dbus_connection_name));
2086 TAPI_LIB_DEBUG(LEVEL_INFO, "Get Call time req type:[%x]", req_mask);
2088 ret = tapi_send_request(TAPI_CS_SERVICE_CALL, TAPI_CS_CALL_GETCALLTIME, in_param1, in_param2, in_param3, in_param4,
2089 &out_param1, &out_param2, &out_param3, &out_param4);
2092 /* Get the API error value as out param 1, from the server. */
2093 api_err = g_array_index(out_param1, TapiResult_t, 0);
2095 /* Get the Request ID as out param 2, from the server. */
2096 *pRequestID = g_array_index(out_param2, int, 0);
2099 /* RPC API failed, return FALSE to APP */
2100 api_err = TAPI_API_SYSTEM_RPC_LINK_DOWN;
2101 TAPI_LIB_DEBUG(LEVEL_ALERT, "_CALL_ERR_ : RPC link is down");
2104 TAPI_GLIB_FREE_PARAMS(in_param1, in_param2, in_param3, in_param4,
2105 out_param1, out_param2, out_param3, out_param4);
2107 TAPI_LIB_DEBUG(LEVEL_INFO, " Returning TapiResult_t [%+d], Reuest ID [%+d]", api_err, *pRequestID);