Initialize Tizen 2.3
[framework/telephony/libslp-tapi.git] / wearable / TC / testcase / utc_call.c
1 /*
2  * libslp-tapi
3  *
4  * Copyright (c) 2013 Samsung Electronics Co., Ltd. All rights reserved.
5  *
6  * Contact: Ja-young Gu <jygu@samsung.com>
7  *
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
11  *
12  * http://www.apache.org/licenses/LICENSE-2.0
13  *
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.
19  */
20
21 #include <tet_api.h>
22 #include <stdlib.h>
23
24 #include <tapi_common.h>
25 #include <ITapiCall.h>
26 #include <TapiUtility.h>
27
28 #include "util_common.h"
29
30 TapiHandle *handle;
31 enum async_state async_flag;
32
33 char szNumber[TAPI_CALL_DIALDIGIT_LEN_MAX + 1] = "+919535009683";
34 char emer_num[4] = "911";
35 unsigned call_id = 1;
36 unsigned call_id2 = 2;
37
38 TelCallType_t call_type[3] = {
39         TAPI_CALL_TYPE_VOICE,
40         TAPI_CALL_TYPE_DATA,
41         TAPI_CALL_TYPE_E911
42 } ;
43
44 TelCallEmergencyCategory_t emergency_category[9] = {
45         TAPI_CALL_ECC_DEFAULT,
46         TAPI_CALL_ECC_POLICE,
47         TAPI_CALL_ECC_AMBULANCE,
48         TAPI_CALL_ECC_FIREBRIGADE,
49         TAPI_CALL_ECC_MARINEGUARD,
50         TAPI_CALL_ECC_MOUNTAINRESCUE,
51         TAPI_CALL_ECC_MANUAL_ECALL,
52         TAPI_CALL_ECC_AUTO_ECALL,
53         TAPI_CALL_ECC_NONE
54 };
55
56 TelCallAnswerType_t answer_type[4] = {
57         TAPI_CALL_ANSWER_ACCEPT,
58         TAPI_CALL_ANSWER_REJECT,
59         TAPI_CALL_ANSWER_REPLACE,
60         TAPI_CALL_ANSWER_HOLD_AND_ACCEPT
61 } ;
62
63 TelCallEndType_t  end_type[4] = {
64         TAPI_CALL_END,
65         TAPI_CALL_END_ALL,
66         TAPI_CALL_END_ACTIVE_ALL,
67         TAPI_CALL_END_HOLD_ALL
68 } ;
69
70 TelSoundVolume_t sound_volume[10] ={
71         TAPI_SOUND_MUTE,                    
72         TAPI_SOUND_VOLUME_LEVEL_1,
73         TAPI_SOUND_VOLUME_LEVEL_2,
74         TAPI_SOUND_VOLUME_LEVEL_3,
75         TAPI_SOUND_VOLUME_LEVEL_4,
76         TAPI_SOUND_VOLUME_LEVEL_5,
77         TAPI_SOUND_VOLUME_LEVEL_6,
78         TAPI_SOUND_VOLUME_LEVEL_7,
79         TAPI_SOUND_VOLUME_LEVEL_8,
80         TAPI_SOUND_VOLUME_LEVEL_9
81 } ;
82
83 TelSoundRecording_t sound_recording[2] = {
84         TAPI_SOUND_RECORDING_OFF,
85         TAPI_SOUND_RECORDING_ON
86 } ;
87
88 TelSoundDevice_t sound_device[6]  = {
89         TAPI_SOUND_DEVICE_RECEIVER,
90         TAPI_SOUND_DEVICE_SPEAKER_PHONE,
91         TAPI_SOUND_DEVICE_HFK,
92         TAPI_SOUND_DEVICE_HEADSET,
93         TAPI_SOUND_DEVICE_BLUETOOTH, 
94         TAPI_SOUND_DEVICE_EC
95 } ;
96
97 TelSoundType_t sound_type [6] = {
98         TAPI_SOUND_TYPE_VOICE, 
99         TAPI_SOUND_TYPE_KEYTONE, 
100         TAPI_SOUND_TYPE_BELL,
101         TAPI_SOUND_TYPE_MESSAGE,
102         TAPI_SOUND_TYPE_ALARM, 
103         TAPI_SOUND_TYPE_PDA_MISC
104 } ;
105
106 TelSoundPath_t sound_path[11] = {
107         TAPI_SOUND_PATH_HANDSET,
108         TAPI_SOUND_PATH_HEADSET,
109         TAPI_SOUND_PATH_HANDSFREE,
110         TAPI_SOUND_PATH_BLUETOOTH,
111         TAPI_SOUND_PATH_STEREO_BLUETOOTH,
112         TAPI_SOUND_PATH_SPK_PHONE,
113         TAPI_SOUND_PATH_HEADSET_3_5PI,
114         TAPI_SOUND_PATH_BT_NSEC_OFF,
115         TAPI_SOUND_PATH_MIC1, 
116         TAPI_SOUND_PATH_MIC2,
117         TAPI_SOUND_PATH_HEADSET_HAC
118 } ;
119
120 unsigned int extra_vol[2] = { 0, 1 };
121 unsigned int clock_status[2] = { 0, 1 };
122
123
124 TelSoundMuteStatus_t mute_status [2] = {
125         TAPI_SOUND_MUTE_STATUS_OFF,
126         TAPI_SOUND_MUTE_STATUS_ON
127 } ;
128
129 TelSoundNoiseReduction_t sound_noise[2] = {
130         TAPI_SOUND_NOISE_REDUCTION_OFF,
131         TAPI_SOUND_NOISE_REDUCTION_ON
132 } ;
133
134 TelSoundEqualizationMode_t sound_equalization[6] = {
135         TAPI_SOUND_EQUALIZATION_MODE_OFF,
136         TAPI_SOUND_EQUALIZATION_MODE_ON,
137         TAPI_SOUND_EQUALIZATION_MODE_FLAG_OFF,
138         TAPI_SOUND_EQUALIZATION_MODE_FLAG_ON,
139         TAPI_SOUND_EQUALIZATION_MODE_SOFT1,
140         TAPI_SOUND_EQUALIZATION_MODE_SOFT2,
141 } ;
142
143 TelSoundDirection_t sound_direction[2] = {
144         TAPI_SOUND_DIRECTION_LEFT,
145         TAPI_SOUND_DIRECTION_RIGHT,
146 } ;
147
148
149 TelSoundMutePath_t mute_path[3] = {
150         TAPI_SOUND_MUTE_PATH_TX,
151         TAPI_SOUND_MUTE_PATH_RX,
152         TAPI_SOUND_MUTE_PATH_ALL
153 } ;
154
155 /* Dial Call Macro */
156 #define DO_DIAL_CALL(func, param1, param2, param3) \
157         static void on_##func(TapiHandle *handle, int result, void *data, void *user_data) \
158         { \
159                 int *value = user_data; \
160 \
161                 async_flag = ASYNC_DONE; \
162                 util_stop_loop(); \
163 \
164                 if (*value != 0xC0FFEE) { \
165                         dts_fail(#func, "Callback userdata crashed"); \
166                 } \
167         } \
168 \
169         static void utc_##func (TelCallType_t  param1, TelCallEmergencyCategory_t param2, char *param3) \
170         { \
171                 TelCallDial_t info; \
172                 int ret; \
173                 int len;\
174                 int value = 0xC0FFEE; \
175 \
176                 /* with callback */ \
177                 util_init_loop(); \
178 \
179                 async_flag = ASYNC_READY; \
180                 memset(&info, 0, sizeof(TelCallDial_t)); \
181                 len = strlen(param3); \
182                 info.CallType =param1; \
183                 info.Ecc = param2; \
184                 memcpy(info.szNumber, param3, len); \
185                 ret = tel_dial_call (handle, &info, on_##func, &value); \
186                 if (ret != TAPI_API_SUCCESS) { \
187                         dts_fail(#func, "Unexpected return"); \
188                 } \
189 \
190                 util_start_loop(); \
191                 util_free_loop(); \
192 \
193                 if (async_flag != ASYNC_DONE) { \
194                         dts_fail(#func, "Callback not invoked"); \
195                 } \
196 \
197                 dts_pass(#func); \
198         } \
199 \
200         static void utc_fail_##func (TelCallType_t  param1, TelCallEmergencyCategory_t param2, char *param3) \
201         { \
202                 int ret; \
203 \
204                 ret = tel_dial_call (NULL, NULL, NULL,NULL); \
205                 dts_check_ne(#func, ret, TAPI_API_SUCCESS, "Unexpected return"); \
206         }
207
208 /* Answer Call Macro */
209 #define DO_ANSWER_CALL(func, param1, param2) \
210         static void on_##func(TapiHandle *handle, int result, void *data, void *user_data) \
211         { \
212                 int *value = user_data; \
213 \
214                 async_flag = ASYNC_DONE; \
215                 util_stop_loop(); \
216 \
217                 if (*value != 0xC0FFEE) { \
218                         dts_fail(#func, "Callback userdata crashed"); \
219                 } \
220                 if (result != 0x0) { \
221                         dts_fail(#func, "Operation failed"); \
222                 } \
223         } \
224 \
225         static void utc_##func (unsigned int  param1, TelCallAnswerType_t param2) \
226         { \
227                 int ret; \
228                 int value = 0xC0FFEE; \
229 \
230                 /* with callback */ \
231                 util_init_loop(); \
232 \
233                 async_flag = ASYNC_READY; \
234                 ret = tel_answer_call (handle, param1, param2, on_##func, &value); \
235                 if (ret != TAPI_API_SUCCESS) { \
236                         dts_fail(#func, "Unexpected return"); \
237                 } \
238 \
239                 util_start_loop(); \
240                 util_free_loop(); \
241 \
242                 if (async_flag != ASYNC_DONE) { \
243                         dts_fail(#func, "Callback not invoked"); \
244                 } \
245 \
246                 dts_pass(#func); \
247         } \
248 \
249         static void utc_fail_##func (unsigned int  param1, TelCallAnswerType_t param2) \
250         { \
251                 int ret; \
252 \
253                 ret = tel_answer_call (NULL, 0, 0,NULL, NULL); \
254                 dts_check_ne(#func, ret, TAPI_API_SUCCESS, "Unexpected return"); \
255         }
256
257
258 /* End Call Macro */
259 #define DO_END_CALL(func, param1, param2) \
260         static void on_##func(TapiHandle *handle, int result, void *data, void *user_data) \
261         { \
262                 int *value = user_data; \
263 \
264                 async_flag = ASYNC_DONE; \
265                 util_stop_loop(); \
266 \
267                 if (*value != 0xC0FFEE) { \
268                         dts_fail(#func, "Callback userdata crashed"); \
269                 } \
270         } \
271 \
272         static void utc_##func (unsigned int  param1, TelCallEndType_t param2) \
273         { \
274                 int ret; \
275                 int value = 0xC0FFEE; \
276 \
277                 /* with callback */ \
278                 util_init_loop(); \
279 \
280                 async_flag = ASYNC_READY; \
281                 ret = tel_end_call (handle, param1, param2, on_##func, &value); \
282                 if (ret != TAPI_API_SUCCESS) { \
283                         dts_fail(#func, "Unexpected return"); \
284                 } \
285 \
286                 util_start_loop(); \
287                 util_free_loop(); \
288 \
289                 if (async_flag != ASYNC_DONE) { \
290                         dts_fail(#func, "Callback not invoked"); \
291                 } \
292 \
293                 dts_pass(#func); \
294         } \
295 \
296         static void utc_fail_##func (unsigned int  param1, TelCallEndType_t param2) \
297         { \
298                 int ret; \
299 \
300                 ret = tel_end_call (NULL, 0, 0, NULL, NULL); \
301                 dts_check_ne(#func, ret, TAPI_API_SUCCESS, "Unexpected return"); \
302         }
303
304 /* Manage Call Macro (hold/active/spit/transfer */
305 #define DO_MANAGE_CALL(func, param1) \
306         static void on_##func(TapiHandle *handle, int result, void *data, void *user_data) \
307         { \
308                 int *value = user_data; \
309 \
310                 async_flag = ASYNC_DONE; \
311                 util_stop_loop(); \
312 \
313                 if (*value != 0xC0FFEE) { \
314                         dts_fail(#func, "Callback userdata crashed"); \
315                 } \
316         } \
317 \
318         static void utc_##func (unsigned int  param1) \
319         { \
320                 int ret; \
321                 int value = 0xC0FFEE; \
322 \
323                 /* with callback */ \
324                 util_init_loop(); \
325 \
326                 async_flag = ASYNC_READY; \
327                 ret = func (handle, param1, on_##func, &value); \
328                 if (ret != TAPI_API_SUCCESS) { \
329                         dts_fail(#func, "Unexpected return"); \
330                 } \
331 \
332                 util_start_loop(); \
333                 util_free_loop(); \
334 \
335                 if (async_flag != ASYNC_DONE) { \
336                         dts_fail(#func, "Callback not invoked"); \
337                 } \
338 \
339                 dts_pass(#func); \
340         } \
341 \
342         static void utc_fail_##func (unsigned int  param1) \
343         { \
344                 int ret; \
345 \
346                 ret = func (NULL, 0, NULL,NULL); \
347                 dts_check_ne(#func, ret, TAPI_API_SUCCESS, "Unexpected return"); \
348         }
349
350 /* Swap/join Call Macro */
351 #define DO_SWAP_JOIN_CALL(func, param1, param2) \
352         static void on_##func(TapiHandle *handle, int result, void *data, void *user_data) \
353         { \
354                 int *value = user_data; \
355 \
356                 async_flag = ASYNC_DONE; \
357                 util_stop_loop(); \
358 \
359                 if (*value != 0xC0FFEE) { \
360                         dts_fail(#func, "Callback userdata crashed"); \
361                 } \
362         } \
363 \
364         static void utc_##func (unsigned int  param1, unsigned int  param2) \
365         { \
366                 int ret; \
367                 int value = 0xC0FFEE; \
368 \
369                 /* with callback */ \
370                 util_init_loop(); \
371 \
372                 async_flag = ASYNC_READY; \
373                 ret = func (handle, param1, param2, on_##func, &value); \
374                 if (ret != TAPI_API_SUCCESS) { \
375                         dts_fail(#func, "Unexpected return"); \
376                 } \
377 \
378                 util_start_loop(); \
379                 util_free_loop(); \
380 \
381                 if (async_flag != ASYNC_DONE) { \
382                         dts_fail(#func, "Callback not invoked"); \
383                 } \
384 \
385                 dts_pass(#func); \
386         } \
387 \
388         static void utc_fail_##func (unsigned int  param1, unsigned int  param2) \
389         { \
390                 int ret; \
391 \
392                 ret = func (NULL, 0, 0, NULL,NULL); \
393                 dts_check_ne(#func, ret, TAPI_API_SUCCESS, "Unexpected return"); \
394         }
395
396
397 /* Get  Call Volume info Macro */
398 #define DO_GET_CALL_VOLUME_INFO(func, param1, param2) \
399         static void on_##func(TapiHandle *handle, int result, void *data, void *user_data) \
400         { \
401                 int *value = user_data; \
402 \
403                 async_flag = ASYNC_DONE; \
404                 util_stop_loop(); \
405 \
406                 if (*value != 0xC0FFEE) { \
407                         dts_fail(#func, "Callback userdata crashed"); \
408                 } \
409         } \
410 \
411         static void utc_##func (TelSoundDevice_t param1, TelSoundType_t param2) \
412         { \
413                 int ret; \
414                 int value = 0xC0FFEE; \
415 \
416                 /* with callback */ \
417                 util_init_loop(); \
418 \
419                 async_flag = ASYNC_READY; \
420                 ret = tel_get_call_volume_info (handle, param1, param2, on_##func, &value); \
421                 if (ret != TAPI_API_SUCCESS) { \
422                         dts_fail(#func, "Unexpected return"); \
423                 } \
424 \
425                 util_start_loop(); \
426                 util_free_loop(); \
427 \
428                 if (async_flag != ASYNC_DONE) { \
429                         dts_fail(#func, "Callback not invoked"); \
430                 } \
431 \
432                 dts_pass(#func); \
433         } \
434 \
435         static void utc_fail_##func (TelSoundDevice_t param1, TelSoundType_t param2) \
436         { \
437                 int ret; \
438 \
439                 ret = tel_get_call_volume_info (NULL, 0, 0, NULL, NULL); \
440                 dts_check_ne(#func, ret, TAPI_API_SUCCESS, "Unexpected return"); \
441         }
442
443
444 /* Set  Call Volume info Macro */
445 #define DO_SET_CALL_VOLUME_INFO(func, param1, param2, param3) \
446         static void on_##func(TapiHandle *handle, int result, void *data, void *user_data) \
447         { \
448                 int *value = user_data; \
449 \
450                 async_flag = ASYNC_DONE; \
451                 util_stop_loop(); \
452 \
453                 if (*value != 0xC0FFEE) { \
454                         dts_fail(#func, "Callback userdata crashed"); \
455                 } \
456         } \
457 \
458         static void utc_##func (TelSoundDevice_t param1, TelSoundType_t param2, TelSoundVolume_t param3) \
459         { \
460                 TelCallVolumeInfo_t info; \
461                 int ret; \
462                 int value = 0xC0FFEE; \
463 \
464                 /* with callback */ \
465                 util_init_loop(); \
466 \
467                 async_flag = ASYNC_READY; \
468                 memset(&info, 0x0, sizeof(TelCallVolumeInfo_t)); \
469                 info.device = param1; \
470                 info.type = param2; \
471                 info.volume = param3; \
472                 ret = tel_set_call_volume_info (handle, &info, on_##func, &value); \
473                 if (ret != TAPI_API_SUCCESS) { \
474                         dts_fail(#func, "Unexpected return"); \
475                 } \
476 \
477                 util_start_loop(); \
478                 util_free_loop(); \
479 \
480                 if (async_flag != ASYNC_DONE) { \
481                         dts_fail(#func, "Callback not invoked"); \
482                 } \
483 \
484                 dts_pass(#func); \
485         } \
486 \
487         static void utc_fail_##func (TelSoundDevice_t param1, TelSoundType_t param2, TelSoundVolume_t param3) \
488         { \
489                 int ret; \
490 \
491                 ret = tel_set_call_volume_info (NULL, NULL, NULL, NULL); \
492                 dts_check_ne(#func, ret, TAPI_API_SUCCESS, "Unexpected return"); \
493         }
494
495 /* Set  Call sound path Macro */
496 #define DO_SET_CALL_SOUND_PATH(func, param1, param2) \
497         static void on_##func(TapiHandle *handle, int result, void *data, void *user_data) \
498         { \
499                 int *value = user_data; \
500 \
501                 async_flag = ASYNC_DONE; \
502                 util_stop_loop(); \
503 \
504                 if (*value != 0xC0FFEE) { \
505                         dts_fail(#func, "Callback userdata crashed"); \
506                 } \
507         } \
508 \
509         static void utc_##func (TelSoundPath_t param1, unsigned int param2) \
510         { \
511                 TelCallSoundPathInfo_t info; \
512                 int ret; \
513                 int value = 0xC0FFEE; \
514 \
515                 /* with callback */ \
516                 util_init_loop(); \
517 \
518                 async_flag = ASYNC_READY; \
519                 memset(&info, 0x0, sizeof(TelCallSoundPathInfo_t)); \
520                 info.path = param1; \
521                 info.ex_volume = param2; \
522                 ret = tel_set_call_sound_path (handle, &info, on_##func, &value); \
523                 if (ret != TAPI_API_SUCCESS) { \
524                         dts_fail(#func, "Unexpected return"); \
525                 } \
526 \
527                 util_start_loop(); \
528                 util_free_loop(); \
529 \
530                 if (async_flag != ASYNC_DONE) { \
531                         dts_fail(#func, "Callback not invoked"); \
532                 } \
533 \
534                 dts_pass(#func); \
535         } \
536 \
537         static void utc_fail_##func (TelSoundPath_t param1, unsigned int param2) \
538         { \
539                 int ret; \
540 \
541                 ret = tel_set_call_sound_path (NULL, NULL, NULL, NULL); \
542                 dts_check_ne(#func, ret, TAPI_API_SUCCESS, "Unexpected return"); \
543         }
544
545 /* Set  Call mute status Macro */
546 #define DO_SET_CALL_MUTE_STATUS(func, param1, param2) \
547         static void on_##func(TapiHandle *handle, int result, void *data, void *user_data) \
548         { \
549                 int *value = user_data; \
550 \
551                 async_flag = ASYNC_DONE; \
552                 util_stop_loop(); \
553 \
554                 if (*value != 0xC0FFEE) { \
555                         dts_fail(#func, "Callback userdata crashed"); \
556                 } \
557         } \
558 \
559         static void utc_##func (TelSoundMuteStatus_t param1, TelSoundMutePath_t param2) \
560         { \
561                 int ret; \
562                 int value = 0xC0FFEE; \
563 \
564                 /* with callback */ \
565                 util_init_loop(); \
566 \
567                 async_flag = ASYNC_READY; \
568                 ret = tel_set_call_mute_status (handle, param1, param2, on_##func, &value); \
569                 if (ret != TAPI_API_SUCCESS) { \
570                         dts_fail(#func, "Unexpected return"); \
571                 } \
572 \
573                 util_start_loop(); \
574                 util_free_loop(); \
575 \
576                 if (async_flag != ASYNC_DONE) { \
577                         dts_fail(#func, "Callback not invoked"); \
578                 } \
579 \
580                 dts_pass(#func); \
581         } \
582 \
583         static void utc_fail_##func (TelSoundMuteStatus_t param1, TelSoundMutePath_t param2) \
584         { \
585                 int ret; \
586 \
587                 ret = tel_set_call_mute_status (NULL, 0, 0, NULL, NULL); \
588                 dts_check_ne(#func, ret, TAPI_API_SUCCESS, "Unexpected return"); \
589         }
590
591 /* Set  Call Sound Recording Macro */
592 #define DO_SET_CALL_SOUND_RECORDING(func, param1) \
593         static void on_##func(TapiHandle *handle, int result, void *data, void *user_data) \
594         { \
595                 int *value = user_data; \
596 \
597                 async_flag = ASYNC_DONE; \
598                 util_stop_loop(); \
599 \
600                 if (*value != 0xC0FFEE) { \
601                         dts_fail(#func, "Callback userdata crashed"); \
602                 } \
603         } \
604 \
605         static void utc_##func (TelSoundRecording_t param1) \
606         { \
607                 int ret; \
608                 int value = 0xC0FFEE; \
609 \
610                 /* with callback */ \
611                 util_init_loop(); \
612 \
613                 async_flag = ASYNC_READY; \
614                 ret = tel_set_call_sound_recording (handle, &param1, on_##func, &value); \
615                 if (ret != TAPI_API_SUCCESS) { \
616                         dts_fail(#func, "Unexpected return"); \
617                 } \
618 \
619                 util_start_loop(); \
620                 util_free_loop(); \
621 \
622                 if (async_flag != ASYNC_DONE) { \
623                         dts_fail(#func, "Callback not invoked"); \
624                 } \
625 \
626                 dts_pass(#func); \
627         } \
628 \
629         static void utc_fail_##func (TelSoundRecording_t param1) \
630         { \
631                 int ret; \
632 \
633                 ret = tel_set_call_sound_recording (NULL, NULL, NULL, NULL); \
634                 dts_check_ne(#func, ret, TAPI_API_SUCCESS, "Unexpected return"); \
635         }
636
637
638 /* Set  Call Sound Equalization Macro */
639 #define DO_SET_CALL_SOUND_EQUALIZATION(func, param1, param2) \
640         static void on_##func(TapiHandle *handle, int result, void *data, void *user_data) \
641         { \
642                 int *value = user_data; \
643 \
644                 async_flag = ASYNC_DONE; \
645                 util_stop_loop(); \
646 \
647                 if (*value != 0xC0FFEE) { \
648                         dts_fail(#func, "Callback userdata crashed"); \
649                 } \
650         } \
651 \
652         static void utc_##func (TelSoundEqualizationMode_t param1, TelSoundDirection_t param2) \
653         { \
654                 TelCallSoundEqualization_t info; \
655                 int ret; \
656                 int value = 0xC0FFEE; \
657 \
658                 /* with callback */ \
659                 util_init_loop(); \
660 \
661                 async_flag = ASYNC_READY; \
662                 memset(&info, 0x0, sizeof(TelCallSoundEqualization_t)); \
663                 info.mode = param1; \
664                 info.direction = param2 ; \
665                 ret = tel_set_call_sound_equalization (handle, &info, on_##func, &value); \
666                 if (ret != TAPI_API_SUCCESS) { \
667                         dts_fail(#func, "Unexpected return"); \
668                 } \
669 \
670                 util_start_loop(); \
671                 util_free_loop(); \
672 \
673                 if (async_flag != ASYNC_DONE) { \
674                         dts_fail(#func, "Callback not invoked"); \
675                 } \
676 \
677                 dts_pass(#func); \
678         } \
679 \
680         static void utc_fail_##func (TelSoundEqualizationMode_t param1, TelSoundDirection_t param2) \
681         { \
682                 int ret; \
683 \
684                 ret = tel_set_call_sound_equalization (NULL, NULL, NULL, NULL); \
685                 dts_check_ne(#func, ret, TAPI_API_SUCCESS, "Unexpected return"); \
686         }
687
688
689 /* Set  Call Sound Noise Reduction Macro */
690 #define DO_SET_CALL_SOUND_NOISE_REDUCTION(func, param1) \
691         static void on_##func(TapiHandle *handle, int result, void *data, void *user_data) \
692         { \
693                 int *value = user_data; \
694 \
695                 async_flag = ASYNC_DONE; \
696                 util_stop_loop(); \
697 \
698                 if (*value != 0xC0FFEE) { \
699                         dts_fail(#func, "Callback userdata crashed"); \
700                 } \
701         } \
702 \
703         static void utc_##func (TelSoundNoiseReduction_t param1) \
704         { \
705                 int ret; \
706                 int value = 0xC0FFEE; \
707 \
708                 /* with callback */ \
709                 util_init_loop(); \
710 \
711                 async_flag = ASYNC_READY; \
712                 ret = tel_set_call_sound_noise_reduction (handle, param1, on_##func, &value); \
713                 if (ret != TAPI_API_SUCCESS) { \
714                         dts_fail(#func, "Unexpected return"); \
715                 } \
716 \
717                 util_start_loop(); \
718                 util_free_loop(); \
719 \
720                 if (async_flag != ASYNC_DONE) { \
721                         dts_fail(#func, "Callback not invoked"); \
722                 } \
723 \
724                 dts_pass(#func); \
725         } \
726 \
727         static void utc_fail_##func (TelSoundNoiseReduction_t param1) \
728         { \
729                 int ret; \
730 \
731                 ret = tel_set_call_sound_noise_reduction (NULL, 0, NULL, NULL); \
732                 dts_check_ne(#func, ret, TAPI_API_SUCCESS, "Unexpected return"); \
733         }
734
735 /* Set  Call Sound Clock Status Macro */
736 #define DO_SET_CALL_SOUND_CLOCK_STATUS(func, param1) \
737         static void on_##func(TapiHandle *handle, int result, void *data, void *user_data) \
738         { \
739                 int *value = user_data; \
740 \
741                 async_flag = ASYNC_DONE; \
742                 util_stop_loop(); \
743 \
744                 if (*value != 0xC0FFEE) { \
745                         dts_fail(#func, "Callback userdata crashed"); \
746                 } \
747         } \
748 \
749         static void utc_##func (gboolean param1) \
750         { \
751                 int ret; \
752                 int value = 0xC0FFEE; \
753 \
754                 /* with callback */ \
755                 util_init_loop(); \
756 \
757                 async_flag = ASYNC_READY; \
758                 ret = tel_set_call_sound_clock_status (handle, param1, on_##func, &value); \
759                 if (ret != TAPI_API_SUCCESS) { \
760                         dts_fail(#func, "Unexpected return"); \
761                 } \
762 \
763                 util_start_loop(); \
764                 util_free_loop(); \
765 \
766                 if (async_flag != ASYNC_DONE) { \
767                         dts_fail(#func, "Callback not invoked"); \
768                 } \
769 \
770                 dts_pass(#func); \
771         } \
772 \
773         static void utc_fail_##func (gboolean param1) \
774         { \
775                 int ret; \
776 \
777                 ret = tel_set_call_sound_clock_status (NULL, 0, NULL, NULL); \
778                 dts_check_ne(#func, ret, TAPI_API_SUCCESS, "Unexpected return"); \
779         }
780
781
782 /**
783  * tel_call_dtmf
784  *
785  */
786 static void on_tel_call_dtmf (TapiHandle *handle, int result, void *data, void *user_data)
787 {
788         int *value = user_data;
789
790         async_flag = ASYNC_DONE;
791         util_stop_loop ();
792
793         if (*value != 0xC0FFEE) {
794                 dts_fail("tel_call_dtmf", "Callback userdata crashed");
795         }
796 }
797
798 static void utc_tel_call_dtmf ()
799 {
800         int ret;
801         int value = 0xC0FFEE;
802
803         util_init_loop ();
804
805         async_flag = ASYNC_READY;
806         ret = tel_call_dtmf (handle, "1",
807                         on_tel_call_dtmf, &value);
808         if (ret != TAPI_API_SUCCESS) {
809                 dts_fail("tel_call_dtmf", "Unexpected return");
810         }
811
812         util_start_loop ();
813         util_free_loop ();
814
815         if (async_flag != ASYNC_DONE) {
816                 dts_fail("tel_call_dtmf", "Callback not invoked");
817         }
818
819         dts_pass("tel_call_dtmf");
820 }
821
822 static void utc_fail_tel_call_dtmf (void)
823 {
824         int ret;
825
826         ret = tel_call_dtmf (NULL, NULL, NULL, NULL);
827         if (ret == TAPI_API_SUCCESS) {
828                 dts_fail("tel_call_dtmf", "Parameter check failed");
829         }
830
831         ret = tel_call_dtmf (handle, NULL, NULL, NULL);
832         if (ret == TAPI_API_SUCCESS) {
833                 dts_fail("tel_call_dtmf", "Parameter check failed");
834         }
835
836         dts_pass("tel_call_dtmf");
837 }
838
839 /**
840  * tel_deflect_call
841  *
842  */
843 static void on_tel_deflect_call(TapiHandle *handle, int result, void *data, void *user_data)
844 {
845         int *value = user_data;
846
847         async_flag = ASYNC_DONE;
848         util_stop_loop ();
849
850         if (*value != 0xC0FFEE) {
851                 dts_fail("tel_deflect_call", "Callback userdata crashed");
852         }
853 }
854
855 static void utc_tel_deflect_call()
856 {
857         TelCallDeflectDstInfo_t info;
858         int ret;
859         int value = 0xC0FFEE;
860
861         util_init_loop ();
862
863         async_flag = ASYNC_READY;
864         memset(&info, 0x0, sizeof(info));
865         strcpy(info.number, (unsigned char *)"+919535099681");
866
867         ret = tel_deflect_call (handle, call_id, &info,
868                         on_tel_deflect_call, &value);
869         if (ret != TAPI_API_SUCCESS) {
870                 dts_fail("tel_deflect_call", "Unexpected return");
871         }
872
873         util_start_loop ();
874         util_free_loop ();
875
876         if (async_flag != ASYNC_DONE) {
877                 dts_fail("tel_deflect_call", "Callback not invoked");
878         }
879
880         dts_pass("tel_deflect_call");
881 }
882
883 static void utc_fail_tel_deflect_call (void)
884 {
885         int ret;
886
887         ret = tel_deflect_call (NULL, 0, NULL, NULL, NULL);
888         if (ret == TAPI_API_SUCCESS) {
889                 dts_fail("tel_deflect_call", "Parameter check failed");
890         }
891
892         ret = tel_deflect_call (handle, 0, NULL, NULL, NULL);
893         if (ret == TAPI_API_SUCCESS) {
894                 dts_fail("tel_deflect_call", "Parameter check failed");
895         }
896
897         dts_pass("tel_deflect_call");
898 }
899
900 /**
901  * tel_call_status
902  *
903  */
904
905 static void utc_tel_call_status ()
906 {
907         int ret;
908         int value = 0xC0FFEE;
909
910         util_init_loop ();
911
912         async_flag = ASYNC_READY;
913         ret = tel_get_call_status (handle, call_id,
914                         value);
915         if (ret != TAPI_API_SUCCESS) {
916                 dts_fail("tel_call_status", "Unexpected return");
917         }
918
919         util_start_loop ();
920         util_free_loop ();
921
922         if (async_flag != ASYNC_DONE) {
923                 dts_fail("tel_call_status", "Callback not invoked");
924         }
925
926         dts_pass("tel_call_status");
927 }
928
929 static void utc_fail_tel_call_status(void)
930 {
931         int ret;
932
933         ret = tel_get_call_status (NULL, 0, NULL);
934         if (ret == TAPI_API_SUCCESS) {
935                 dts_fail("tel_call_status", "Parameter check failed");
936         }
937
938         ret = tel_get_call_status (handle, 0, NULL);
939         if (ret == TAPI_API_SUCCESS) {
940                 dts_fail("tel_call_status", "Parameter check failed");
941         }
942
943         dts_pass("tel_call_status");
944 }
945
946 /**
947  * tel_call_status_all
948  *
949  */
950 static void on_tel_call_status_all(TapiHandle *handle, int result, void *data, void *user_data)
951 {
952         int *value = user_data;
953
954         async_flag = ASYNC_DONE;
955         util_stop_loop ();
956
957         if (*value != 0xC0FFEE) {
958                 dts_fail("tel_call_status_all", "Callback userdata crashed");
959         }
960 }
961
962 static void utc_tel_call_status_all()
963 {
964         int ret;
965         int value = 0xC0FFEE;
966
967         util_init_loop ();
968
969         async_flag = ASYNC_READY;
970
971         ret = tel_get_call_status_all (handle,
972                         on_tel_call_status_all, &value);
973         if (ret != TAPI_API_SUCCESS) {
974                 dts_fail("tel_call_status_all", "Unexpected return");
975         }
976
977         util_start_loop ();
978         util_free_loop ();
979
980         if (async_flag != ASYNC_DONE) {
981                 dts_fail("tel_call_status_all", "Callback not invoked");
982         }
983
984         dts_pass("tel_call_status_all");
985 }
986
987 static void utc_fail_tel_call_status_all (void)
988 {
989         int ret;
990
991         ret = tel_get_call_status_all (NULL, NULL, NULL);
992         if (ret == TAPI_API_SUCCESS) {
993                 dts_fail("tel_deflect_call", "Parameter check failed");
994         }
995
996         ret = tel_get_call_status_all (handle, NULL, NULL);
997         if (ret == TAPI_API_SUCCESS) {
998                 dts_fail("tel_call_status_all", "Parameter check failed");
999         }
1000
1001         dts_pass("tel_call_status_all");
1002 }
1003
1004 /**
1005  * tel_get_call_mute_status
1006  *
1007  */
1008 static void on_tel_get_call_mute_status (TapiHandle *handle, int result, void *data, void *user_data)
1009 {
1010         int *value = user_data;
1011
1012         async_flag = ASYNC_DONE;
1013         util_stop_loop ();
1014
1015         if (*value != 0xC0FFEE) {
1016                 dts_fail("tel_get_call_mute_status", "Callback userdata crashed");
1017         }
1018 }
1019
1020 static void utc_tel_get_call_mute_status ()
1021 {
1022         int ret;
1023         int value = 0xC0FFEE;
1024
1025         util_init_loop ();
1026
1027         async_flag = ASYNC_READY;
1028         ret = tel_get_call_mute_status (handle, 
1029                         on_tel_get_call_mute_status, &value);
1030         if (ret != TAPI_API_SUCCESS) {
1031                 dts_fail("tel_get_call_mute_status", "Unexpected return");
1032         }
1033
1034         util_start_loop ();
1035         util_free_loop ();
1036
1037         if (async_flag != ASYNC_DONE) {
1038                 dts_fail("tel_get_call_mute_status", "Callback not invoked");
1039         }
1040
1041         dts_pass("tel_get_call_mute_status");
1042 }
1043
1044 static void utc_fail_tel_get_call_mute_status (void)
1045 {
1046         int ret;
1047
1048         ret = tel_get_call_mute_status (NULL, NULL, NULL);
1049         if (ret == TAPI_API_SUCCESS) {
1050                 dts_fail("tel_get_call_mute_status", "Parameter check failed");
1051         }
1052
1053         ret = tel_get_call_mute_status (handle, NULL, NULL);
1054         if (ret == TAPI_API_SUCCESS) {
1055                 dts_fail("tel_get_call_mute_status", "Parameter check failed");
1056         }
1057
1058         dts_pass("tel_get_call_mute_status");
1059 }
1060
1061
1062
1063 /* Dial auto generated functions */
1064
1065 DO_DIAL_CALL(tel_dial_voice_call, call_type[0], emergency_category[8], szNumber)
1066 DO_DIAL_CALL(tel_dial_video_call, call_type[1], emergency_category[8], szNumber)
1067 DO_DIAL_CALL(tel_dial_emergency_call, call_type[2], emergency_category[0], emer_num)
1068
1069 /* Answer auto generated functions */
1070
1071 DO_ANSWER_CALL(tel_answer_accept_call, call_id, answer_type[0])
1072 DO_ANSWER_CALL(tel_answer_reject_call, call_id, answer_type[1])
1073 DO_ANSWER_CALL(tel_answer_replace_call, call_id, answer_type[2])
1074 DO_ANSWER_CALL(tel_answer_hold_and_accept_call, call_id, answer_type[3])
1075
1076 /* End auto generated functions */
1077
1078 DO_END_CALL(tel_end_call, call_id, end_type[0])
1079 DO_END_CALL(tel_end_all_call, call_id, end_type[1])
1080 DO_END_CALL(tel_end_active_all_call, call_id, end_type[2])
1081 DO_END_CALL(tel_end_hold_all_call, call_id, end_type[3])
1082
1083 /* Hold/Active/Split/Transfer auto generated functions */
1084
1085 DO_MANAGE_CALL(tel_hold_call, call_id)
1086 DO_MANAGE_CALL(tel_active_call, call_id)
1087 DO_MANAGE_CALL(tel_split_call, call_id)
1088 DO_MANAGE_CALL(tel_transfer_call, call_id)
1089
1090 /* Swap/Join auto generated functions */
1091
1092 DO_SWAP_JOIN_CALL(tel_swap_call, call_id, call_id2)
1093 DO_SWAP_JOIN_CALL(tel_join_call, call_id, call_id2)
1094
1095
1096 DO_GET_CALL_VOLUME_INFO(tel_get_call_volume_info_receiver, sound_device[0], sound_type[0])
1097 DO_GET_CALL_VOLUME_INFO(tel_get_call_volume_info_speaker_phone, sound_device[1], sound_type[0])
1098 DO_GET_CALL_VOLUME_INFO(tel_get_call_volume_info_hfk, sound_device[2], sound_type[0])
1099 DO_GET_CALL_VOLUME_INFO(tel_get_call_volume_info_headset, sound_device[3], sound_type[0])
1100 DO_GET_CALL_VOLUME_INFO(tel_get_call_volume_info_bluetooth, sound_device[4], sound_type[0])
1101 DO_GET_CALL_VOLUME_INFO(tel_get_call_volume_info_ec, sound_device[5], sound_type[0])
1102
1103 DO_SET_CALL_VOLUME_INFO(tel_set_call_volume_info_receiver_low, sound_device[0], sound_type[0], sound_volume[0])
1104 DO_SET_CALL_VOLUME_INFO(tel_set_call_volume_info_receiver_medium, sound_device[0], sound_type[0], sound_volume[4])
1105 DO_SET_CALL_VOLUME_INFO(tel_set_call_volume_info_receiver_high, sound_device[0], sound_type[0], sound_volume[9])
1106 DO_SET_CALL_VOLUME_INFO(tel_set_call_volume_info_headset_low, sound_device[3], sound_type[0], sound_volume[0])
1107 DO_SET_CALL_VOLUME_INFO(tel_set_call_volume_info_headset_medium, sound_device[3], sound_type[0], sound_volume[4])
1108 DO_SET_CALL_VOLUME_INFO(tel_set_call_volume_info_headset_high, sound_device[3], sound_type[0], sound_volume[9])
1109 DO_SET_CALL_VOLUME_INFO(tel_set_call_volume_info_bluetooth_low, sound_device[4], sound_type[0], sound_volume[0])
1110 DO_SET_CALL_VOLUME_INFO(tel_set_call_volume_info_bluetooth_medium, sound_device[4], sound_type[0], sound_volume[4])
1111 DO_SET_CALL_VOLUME_INFO(tel_set_call_volume_info_bluetooth_high, sound_device[4], sound_type[0], sound_volume[9])
1112
1113 DO_SET_CALL_SOUND_PATH(tel_set_call_sound_path_handset_extra_vol_off, sound_path[0], extra_vol[0])
1114 DO_SET_CALL_SOUND_PATH(tel_set_call_sound_path_handset_extra_vol_on, sound_path[0], extra_vol[1])
1115 DO_SET_CALL_SOUND_PATH(tel_set_call_sound_path_headset_extra_vol_off, sound_path[1], extra_vol[0])
1116 DO_SET_CALL_SOUND_PATH(tel_set_call_sound_path_headset_extra_vol_on, sound_path[1], extra_vol[1])
1117 DO_SET_CALL_SOUND_PATH(tel_set_call_sound_path_handsfree_extra_vol_off, sound_path[2], extra_vol[0])
1118 DO_SET_CALL_SOUND_PATH(tel_set_call_sound_path_handsfree_extra_vol_on, sound_path[2], extra_vol[1])
1119 DO_SET_CALL_SOUND_PATH(tel_set_call_sound_path_bluetooth_extra_vol_off, sound_path[3], extra_vol[0])
1120 DO_SET_CALL_SOUND_PATH(tel_set_call_sound_path_bluetooth_extra_vol_on, sound_path[3], extra_vol[1])
1121 DO_SET_CALL_SOUND_PATH(tel_set_call_sound_path_spk_phone_extra_vol_off, sound_path[5], extra_vol[0])
1122 DO_SET_CALL_SOUND_PATH(tel_set_call_sound_path_spk_phone_extra_vol_on, sound_path[5], extra_vol[1])
1123 DO_SET_CALL_SOUND_PATH(tel_set_call_sound_path_headset_3_5pi_extra_vol_off, sound_path[6], extra_vol[0])
1124 DO_SET_CALL_SOUND_PATH(tel_set_call_sound_path_headset_3_5pi_extra_vol_on, sound_path[6], extra_vol[1])
1125 DO_SET_CALL_SOUND_PATH(tel_set_call_sound_path_bt_nsec_off_extra_vol_off, sound_path[7], extra_vol[0])
1126 DO_SET_CALL_SOUND_PATH(tel_set_call_sound_path_bt_nsec_off_extra_vol_on, sound_path[7], extra_vol[1])
1127 DO_SET_CALL_SOUND_PATH(tel_set_call_sound_path_mic1_extra_vol_off, sound_path[8], extra_vol[0])
1128 DO_SET_CALL_SOUND_PATH(tel_set_call_sound_path_mic1_bluetooth_extra_vol_on, sound_path[8], extra_vol[1])
1129 DO_SET_CALL_SOUND_PATH(tel_set_call_sound_path_mic2_extra_vol_off, sound_path[9], extra_vol[0])
1130 DO_SET_CALL_SOUND_PATH(tel_set_call_sound_path_mic2_extra_vol_on, sound_path[9], extra_vol[1])
1131 DO_SET_CALL_SOUND_PATH(tel_set_call_sound_path_headset_hac_extra_vol_off, sound_path[10], extra_vol[0])
1132 DO_SET_CALL_SOUND_PATH(tel_set_call_sound_path_headset_hac_extra_vol_on, sound_path[10], extra_vol[1])
1133
1134
1135 DO_SET_CALL_MUTE_STATUS(tel_set_call_mute_status_off_tx, mute_status[0], mute_path[0])
1136 DO_SET_CALL_MUTE_STATUS(tel_set_call_mute_status_off_rx, mute_status[0], mute_path[1])
1137 DO_SET_CALL_MUTE_STATUS(tel_set_call_mute_status_off_all, mute_status[0], mute_path[2])
1138 DO_SET_CALL_MUTE_STATUS(tel_set_call_mute_status_on_tx, mute_status[1], mute_path[0])
1139 DO_SET_CALL_MUTE_STATUS(tel_set_call_mute_status_on_rx, mute_status[1], mute_path[1])
1140 DO_SET_CALL_MUTE_STATUS(tel_set_call_mute_status_on_all, mute_status[1], mute_path[2])
1141
1142 DO_SET_CALL_SOUND_RECORDING(tel_set_call_sound_recording_off, sound_recording[0])
1143 DO_SET_CALL_SOUND_RECORDING(tel_set_call_sound_recording_on, sound_recording[1])
1144
1145 DO_SET_CALL_SOUND_EQUALIZATION(tel_set_call_sound_equalization_mode_off_left, sound_equalization [0], sound_direction[0])
1146 DO_SET_CALL_SOUND_EQUALIZATION(tel_set_call_sound_equalization_mode_off_right, sound_equalization [0], sound_direction[1])
1147 DO_SET_CALL_SOUND_EQUALIZATION(tel_set_call_sound_equalization_mode_on_left, sound_equalization [1], sound_direction[0])
1148 DO_SET_CALL_SOUND_EQUALIZATION(tel_set_call_sound_equalization_mode_on_right, sound_equalization [1], sound_direction[1])
1149 DO_SET_CALL_SOUND_EQUALIZATION(tel_set_call_sound_equalization_mode_flag_off_left, sound_equalization [2], sound_direction[0])
1150 DO_SET_CALL_SOUND_EQUALIZATION(tel_set_call_sound_equalization_mode_flag_off_right, sound_equalization [2], sound_direction[1])
1151 DO_SET_CALL_SOUND_EQUALIZATION(tel_set_call_sound_equalization_mode_flag_on_left, sound_equalization [3], sound_direction[0])
1152 DO_SET_CALL_SOUND_EQUALIZATION(tel_set_call_sound_equalization_mode_flag_on_right, sound_equalization [3], sound_direction[1])
1153 DO_SET_CALL_SOUND_EQUALIZATION(tel_set_call_sound_equalization_mode_soft1_left, sound_equalization [4], sound_direction[0])
1154 DO_SET_CALL_SOUND_EQUALIZATION(tel_set_call_sound_equalization_mode_soft1_right, sound_equalization [4], sound_direction[1])
1155 DO_SET_CALL_SOUND_EQUALIZATION(tel_set_call_sound_equalization_mode_soft2_left, sound_equalization [5], sound_direction[0])
1156 DO_SET_CALL_SOUND_EQUALIZATION(tel_set_call_sound_equalization_mode_soft2_right, sound_equalization [5], sound_direction[1])
1157
1158 DO_SET_CALL_SOUND_NOISE_REDUCTION(tel_set_call_sound_reduction_off, sound_noise[0])
1159 DO_SET_CALL_SOUND_NOISE_REDUCTION(tel_set_call_sound_reduction_on, sound_noise[1])
1160
1161 DO_SET_CALL_SOUND_CLOCK_STATUS(tel_set_call_sound_clock_status_off, clock_status[0])
1162 DO_SET_CALL_SOUND_CLOCK_STATUS(tel_set_call_sound_clock_status_on, clock_status[1])
1163
1164
1165 struct tet_testlist tet_testlist[] = {
1166         /* generated TC */
1167         { utc_tel_dial_voice_call, 1 },
1168         { utc_fail_tel_dial_voice_call, 2 },
1169         { utc_tel_dial_video_call, 1 },
1170         { utc_fail_tel_dial_video_call, 2 },
1171         { utc_tel_dial_emergency_call, 1 },
1172         { utc_fail_tel_dial_emergency_call, 2 },
1173         { utc_tel_answer_accept_call, 1 },
1174         { utc_fail_tel_answer_accept_call, 2 },
1175         { utc_tel_answer_reject_call, 1 },
1176         { utc_fail_tel_answer_reject_call, 2 },
1177         { utc_tel_answer_replace_call, 1 },
1178         { utc_fail_tel_answer_replace_call, 2 },
1179         { utc_tel_answer_hold_and_accept_call, 1 },
1180         { utc_fail_tel_answer_hold_and_accept_call, 2 },
1181         { utc_tel_end_call, 1 },
1182         { utc_fail_tel_end_call, 2 },
1183         { utc_tel_end_all_call, 1 },
1184         { utc_fail_tel_end_all_call, 2 },
1185         { utc_tel_end_active_all_call, 1 },
1186         { utc_fail_tel_end_active_all_call, 2 },
1187         { utc_tel_end_hold_all_call, 1 },
1188         { utc_fail_tel_end_hold_all_call, 2 },
1189         { utc_tel_hold_call, 1 },
1190         { utc_fail_tel_hold_call, 2 },
1191         { utc_tel_active_call, 1 },
1192         { utc_fail_tel_active_call, 2 },
1193         { utc_tel_split_call, 1 },
1194         { utc_fail_tel_split_call, 2 },
1195         { utc_tel_transfer_call, 1 },
1196         { utc_fail_tel_transfer_call, 2 },
1197         { utc_tel_swap_call, 1 },
1198         { utc_fail_tel_swap_call, 2 },
1199         { utc_tel_join_call, 1 },
1200         { utc_fail_tel_join_call, 2 },
1201
1202         /* Sound */
1203         
1204         { utc_tel_get_call_volume_info_receiver, 1},
1205         { utc_fail_tel_get_call_volume_info_receiver, 2},
1206         { utc_tel_get_call_volume_info_speaker_phone, 1},
1207         { utc_fail_tel_get_call_volume_info_speaker_phone, 2},
1208         { utc_tel_get_call_volume_info_hfk, 1},
1209         { utc_fail_tel_get_call_volume_info_hfk, 2},
1210         { utc_tel_get_call_volume_info_headset, 1},
1211         { utc_fail_tel_get_call_volume_info_headset, 2},
1212         { utc_tel_get_call_volume_info_bluetooth, 1},
1213         { utc_fail_tel_get_call_volume_info_bluetooth, 2},
1214         { utc_tel_get_call_volume_info_ec, 1},
1215         { utc_fail_tel_get_call_volume_info_ec, 2},
1216         { utc_tel_set_call_volume_info_receiver_low, 1},
1217         { utc_fail_tel_set_call_volume_info_receiver_low, 2},
1218         { utc_tel_set_call_volume_info_receiver_medium, 1},
1219         { utc_fail_tel_set_call_volume_info_receiver_medium, 2},
1220         { utc_tel_set_call_volume_info_receiver_high, 1},
1221         { utc_fail_tel_set_call_volume_info_receiver_high, 2},
1222         { utc_tel_set_call_volume_info_headset_low, 1},
1223         { utc_fail_tel_set_call_volume_info_headset_low, 2},
1224         { utc_tel_set_call_volume_info_headset_medium, 1},
1225         { utc_fail_tel_set_call_volume_info_headset_medium, 2},
1226         { utc_tel_set_call_volume_info_headset_high, 1},
1227         { utc_fail_tel_set_call_volume_info_headset_high, 2},
1228         { utc_tel_set_call_volume_info_bluetooth_low, 1},
1229         { utc_fail_tel_set_call_volume_info_bluetooth_low, 2},
1230         { utc_tel_set_call_volume_info_bluetooth_medium, 1},
1231         { utc_fail_tel_set_call_volume_info_bluetooth_medium, 2},
1232         { utc_tel_set_call_volume_info_bluetooth_high, 1},
1233         { utc_fail_tel_set_call_volume_info_bluetooth_high, 2},
1234         { utc_tel_set_call_sound_path_handset_extra_vol_off, 1},
1235         { utc_fail_tel_set_call_sound_path_handset_extra_vol_off, 2},
1236         { utc_tel_set_call_sound_path_handset_extra_vol_on, 1},
1237         { utc_fail_tel_set_call_sound_path_handset_extra_vol_on, 2},
1238         { utc_tel_set_call_sound_path_headset_extra_vol_off, 1},
1239         { utc_fail_tel_set_call_sound_path_headset_extra_vol_off, 2},
1240         { utc_tel_set_call_sound_path_headset_extra_vol_on, 1},
1241         { utc_fail_tel_set_call_sound_path_headset_extra_vol_on, 2},
1242         { utc_tel_set_call_sound_path_handsfree_extra_vol_off, 1},
1243         { utc_fail_tel_set_call_sound_path_handsfree_extra_vol_off, 2},
1244         { utc_tel_set_call_sound_path_handsfree_extra_vol_on, 1},
1245         { utc_fail_tel_set_call_sound_path_handsfree_extra_vol_on, 2},
1246         { utc_tel_set_call_sound_path_bluetooth_extra_vol_off, 1},
1247         { utc_fail_tel_set_call_sound_path_bluetooth_extra_vol_off, 2},
1248         { utc_tel_set_call_sound_path_bluetooth_extra_vol_on, 1},
1249         { utc_fail_tel_set_call_sound_path_bluetooth_extra_vol_on, 2},
1250         { utc_tel_set_call_sound_path_spk_phone_extra_vol_off, 1},
1251         { utc_fail_tel_set_call_sound_path_spk_phone_extra_vol_off, 2},
1252         { utc_tel_set_call_sound_path_spk_phone_extra_vol_on, 1},
1253         { utc_fail_tel_set_call_sound_path_spk_phone_extra_vol_on, 2},
1254         { utc_tel_set_call_sound_path_headset_3_5pi_extra_vol_off, 1},
1255         { utc_fail_tel_set_call_sound_path_headset_3_5pi_extra_vol_off, 2},
1256         { utc_tel_set_call_sound_path_headset_3_5pi_extra_vol_on, 1},
1257         { utc_fail_tel_set_call_sound_path_headset_3_5pi_extra_vol_on, 2},
1258         { utc_tel_set_call_sound_path_bt_nsec_off_extra_vol_off, 1},
1259         { utc_fail_tel_set_call_sound_path_bt_nsec_off_extra_vol_off, 2},
1260         { utc_tel_set_call_sound_path_bt_nsec_off_extra_vol_on, 1},
1261         { utc_fail_tel_set_call_sound_path_bt_nsec_off_extra_vol_on, 2},
1262         { utc_tel_set_call_sound_path_mic1_extra_vol_off, 1},
1263         { utc_fail_tel_set_call_sound_path_mic1_extra_vol_off, 2},
1264         { utc_tel_set_call_sound_path_mic1_bluetooth_extra_vol_on, 1},
1265         { utc_fail_tel_set_call_sound_path_mic1_bluetooth_extra_vol_on, 2},
1266         { utc_tel_set_call_sound_path_mic2_extra_vol_off, 1},
1267         { utc_fail_tel_set_call_sound_path_mic2_extra_vol_off, 2},
1268         { utc_tel_set_call_sound_path_mic2_extra_vol_on, 1},
1269         { utc_fail_tel_set_call_sound_path_mic2_extra_vol_on, 2},
1270         { utc_tel_set_call_sound_path_headset_hac_extra_vol_off, 1},
1271         { utc_fail_tel_set_call_sound_path_headset_hac_extra_vol_off, 2},
1272         { utc_tel_set_call_sound_path_headset_hac_extra_vol_on, 1},
1273         { utc_fail_tel_set_call_sound_path_headset_hac_extra_vol_on, 2},
1274         { utc_tel_set_call_mute_status_off_tx, 1},
1275         { utc_fail_tel_set_call_mute_status_off_tx, 2},
1276         { utc_tel_set_call_mute_status_off_rx, 1},
1277         { utc_fail_tel_set_call_mute_status_off_rx, 2},
1278         { utc_tel_set_call_mute_status_off_all, 1},
1279         { utc_fail_tel_set_call_mute_status_off_all, 2},
1280         { utc_tel_set_call_mute_status_on_tx, 1},
1281         { utc_fail_tel_set_call_mute_status_on_tx, 2},
1282         { utc_tel_set_call_mute_status_on_rx, 1},
1283         { utc_fail_tel_set_call_mute_status_on_rx, 2},
1284         { utc_tel_set_call_mute_status_on_all, 1},
1285         { utc_fail_tel_set_call_mute_status_on_all, 2},
1286         { utc_tel_set_call_sound_recording_off, 1},
1287         { utc_fail_tel_set_call_sound_recording_off, 2},
1288         { utc_tel_set_call_sound_recording_on, 1},
1289         { utc_fail_tel_set_call_sound_recording_on, 2},
1290         { utc_tel_set_call_sound_equalization_mode_off_left, 1},
1291         { utc_fail_tel_set_call_sound_equalization_mode_off_left, 2 },
1292         { utc_tel_set_call_sound_equalization_mode_off_right, 1},
1293         { utc_fail_tel_set_call_sound_equalization_mode_off_right, 2 },
1294         { utc_tel_set_call_sound_equalization_mode_on_left, 1},
1295         { utc_fail_tel_set_call_sound_equalization_mode_on_left, 2},
1296         { utc_tel_set_call_sound_equalization_mode_on_right, 1},
1297         { utc_fail_tel_set_call_sound_equalization_mode_on_right, 2},
1298         { utc_tel_set_call_sound_equalization_mode_flag_off_left, 1},
1299         { utc_fail_tel_set_call_sound_equalization_mode_flag_off_left, 2},
1300         { utc_fail_tel_set_call_sound_equalization_mode_flag_off_left, 1},
1301         { utc_tel_set_call_sound_equalization_mode_flag_off_right, 1},
1302         { utc_fail_tel_set_call_sound_equalization_mode_flag_off_right, 2},
1303         { utc_tel_set_call_sound_equalization_mode_flag_on_left, 1},
1304         { utc_fail_tel_set_call_sound_equalization_mode_flag_on_left, 2},
1305         { utc_tel_set_call_sound_equalization_mode_flag_on_right, 1},
1306         { utc_fail_tel_set_call_sound_equalization_mode_flag_on_right, 2},
1307         { utc_tel_set_call_sound_equalization_mode_soft1_left, 1},
1308         { utc_fail_tel_set_call_sound_equalization_mode_soft1_left, 2},
1309         { utc_tel_set_call_sound_equalization_mode_soft1_right, 1},
1310         { utc_fail_tel_set_call_sound_equalization_mode_soft1_right, 2},
1311         { utc_tel_set_call_sound_equalization_mode_soft2_left, 1},
1312         { utc_fail_tel_set_call_sound_equalization_mode_soft2_left, 2},
1313         { utc_tel_set_call_sound_equalization_mode_soft2_right, 1},
1314         { utc_fail_tel_set_call_sound_equalization_mode_soft2_right, 2},
1315         { utc_tel_set_call_sound_reduction_off, 1},
1316         { utc_fail_tel_set_call_sound_reduction_off, 2},
1317         { utc_tel_set_call_sound_reduction_on, 1},
1318         { utc_fail_tel_set_call_sound_reduction_on, 2},
1319         { utc_tel_set_call_sound_clock_status_off, 1},
1320         { utc_fail_tel_set_call_sound_clock_status_off, 2},
1321         { utc_tel_set_call_sound_clock_status_on, 1},
1322         { utc_fail_tel_set_call_sound_clock_status_on, 2},
1323
1324
1325         /* custom TC */
1326         { utc_tel_call_dtmf, 1 },
1327         { utc_fail_tel_call_dtmf, 2 },
1328         { utc_tel_deflect_call, 1 },
1329         { utc_fail_tel_deflect_call, 2 },
1330         { utc_tel_call_status, 1 },
1331         { utc_fail_tel_call_status, 2 },
1332         { utc_tel_call_status_all, 1 },
1333         { utc_fail_tel_call_status_all, 2 },
1334         { utc_tel_get_call_mute_status, 1},
1335         { utc_fail_tel_get_call_mute_status, 2},
1336
1337         { NULL, 0 },
1338 };
1339
1340 static void startup (void)
1341 {
1342         /* start of TC */
1343         tet_printf ("\n Call TC start");
1344
1345         handle = tel_init (NULL);
1346 }
1347
1348 static void cleanup (void)
1349 {
1350         tel_deinit (handle);
1351
1352         /* end of TC */
1353         tet_printf ("\n Call TC end");
1354 }
1355
1356 void (*tet_startup) (void) = startup;
1357 void (*tet_cleanup) (void) = cleanup;
1358