This repository has been archived by the owner on Jan 26, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathvoice_hal.h
2554 lines (2379 loc) · 86.5 KB
/
voice_hal.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
/*
* If not stated otherwise in this file or this component's LICENSE file the
* following copyright and licenses apply:
*
* Copyright 2016 RDK Management
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/**
* @file voice_hal.h
* @author sky
* @brief For CCSP Component: CcspTelcoVoIPAgent
*
* @description This header file gives the function call prototypes and structure
* definitions used for the RDK-Broadband hardware abstraction layer for VoIP
*/
/**********************************************************************
module: voice_hal.h
For CCSP Component: CcspTelcoVoIPAgent
---------------------------------------------------------------
description:
This header file gives the function call prototypes and
structure definitions used for the RDK-Broadband
hardware abstraction layer for VoIP
---------------------------------------------------------------
environment:
This HAL layer is intended to support VoIP drivers
through an open API.
Changes may be needed to support different hardware enviornments.
---------------------------------------------------------------
author:
Sky
**********************************************************************/
#ifndef __voice_hal_H__
#define __voice_hal_H__
#include <stdint.h>
#include <stdbool.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <stdint.h>
/**
* @defgroup VOICE_HAL VOICE HAL
*
* @defgroup VOICE_HAL_TYPES VOICE HAL Data Types
* @ingroup VOICE_HAL
*
* @defgroup VOICE_HAL_APIS VOICE HAL APIs
* @ingroup VOICE_HAL
*
**/
/**********************************************************************
CONSTANT DEFINITIONS
**********************************************************************/
/**
* @addtogroup VOICE_HAL_TYPES
* @{
*/
/* Curiously, rdk_error.h only defines RDK_SUCCESS.
* Here, additional Voice specific error codes are defined.
* Follow the general Posix format that negative integers are errors.
*/
#define RETURN_ERROR (-1)
#define RETURN_OK 0
#ifndef RDK_SUCCESS
#define RDK_SUCCESS (0) /*No Error*/
#endif
#define RDK_FAILURE (-1) /*any other failure*/
#define RDK_ERROR_PARAM (-2) /* NULL pointers mainly */
#define RDK_ERROR_RANGE (-3) /* Value provided, but out of permitted range */
#define RDK_ERROR_OOM (-4) /* Out of memory, usually malloc failed */
#undef VOICE_UNSUPPORTED_PARAMS /*Writable Region specific parameter APIs disabled(Currently no datamodel to configure these) */
/**********************************************************************
ENUMERATION DEFINITIONS
**********************************************************************/
typedef enum /* telephone line state */
{
VOICE_HAL_LINE_STATE_UP = 0,
VOICE_HAL_LINE_STATE_INITIALIZING,
VOICE_HAL_LINE_STATE_REGISTERING,
VOICE_HAL_LINE_STATE_UNREGISTERING,
VOICE_HAL_LINE_STATE_ERROR,
VOICE_HAL_LINE_STATE_TESTING,
VOICE_HAL_LINE_STATE_QUIESCENT,
VOICE_HAL_LINE_STATE_DISABLED
} VoiceHalLineStatus_e;
typedef enum /* telephone line state */
{
VOICE_HAL_LINE_DISABLED = 0,
VOICE_HAL_LINE_QUIESCENT,
VOICE_HAL_LINE_ENABLED
} VoiceHalLineEnable_e;
typedef enum /* telephone call status */
{
VOICE_HAL_CALL_STATE_IDLE = 0,
VOICE_HAL_CALL_STATE_CALLING,
VOICE_HAL_CALL_STATE_RINGING,
VOICE_HAL_CALL_STATE_CONNECTING,
VOICE_HAL_CALL_STATE_INCALL,
VOICE_HAL_CALL_STATE_HOLD,
VOICE_HAL_CALL_STATE_DISCONNECTING
} VoiceHalCallState_e;
typedef enum
{
VOICE_HAL_DIAG_STATE_TYPE_NONE = 0,
VOICE_HAL_DIAG_STATE_TYPE_REQUESTED,
VOICE_HAL_DIAG_STATE_TYPE_COMPLETE,
VOICE_HAL_DIAG_STATE_TYPE_ERROR_INTERNAL,
VOICE_HAL_DIAG_STATE_TYPE_ERROR_OTHER
} VoiceHalDiagnosticState_e;
typedef enum
{
VOICE_HAL_NORMAL_DIGIT_MAP = 0,
VOICE_HAL_EMERGENCY_DIGIT_MAP
} VoiceHalDigitMap_e;
typedef enum
{
VOICE_HAL_AF_INET_V4 = 0,
VOICE_HAL_AF_INET_V6
} VoiceHalIpAddressFamily_e;
typedef enum
{
VOICE_HAL_IP_LINK_STATE_DOWN = 0,
VOICE_HAL_IP_LINK_STATE_UP
} VoiceHalIpLinkState_e;
typedef enum
{
VOICE_HAL_S_TIMER = 0,
VOICE_HAL_Z_TIMER
} VoiceHalDigitTimer_e;
typedef enum
{
VOICE_HAL_AUTH_UNAME = 0,
VOICE_HAL_AUTH_PWD
} VoiceHalAuthCredentialType_e;
typedef enum
{
VOICE_PROCESS_STATE_STOP = 0,
VOICE_PROCESS_STATE_START,
VOICE_PROCESS_STATE_RESTART,
VOICE_PROCESS_STATE_FACTORY_DEFAULT
} VoiceProcessStateRequest_e;
typedef enum {
VOICE_PROCESS_STATUS_STOPPED = 0,
VOICE_PROCESS_STATUS_STARTING,
VOICE_PROCESS_STATUS_STARTED,
VOICE_PROCESS_STATUS_STOPPING,
VOICE_PROCESS_STATUS_ERROR
} VoiceProcessStatus_e;
typedef enum
{
VOICE_CALLING_FEATURE_CALL_WAITING = 0,
VOICE_CALLING_FEATURE_MSG_WAIT_INDICATOR,
VOICE_CALLING_FEATURE_CONF_CALL,
VOICE_CALLING_FEATURE_HOLD,
VOICE_CALLING_FEATURE_CALLER_ID,
}VoiceCallFeatureType_e;
/**********************************************************************
STRUCTURE DEFINITIONS
**********************************************************************/
typedef struct
{
bool ResetStatistics; /**< ResetStatistics */
uint32_t PacketsSent; /**< Total number of RTP packets sent for this line. */
uint32_t PacketsReceived; /**< Total number of RTP payload bytes received for this line. */
uint32_t BytesSent; /**< Total number of RTP payload bytes sent for this line. */
uint32_t BytesReceived; /**< Total number of RTP payload bytes received for this line. */
uint32_t PacketsLost; /**< Total number of RTP packets that have been lost for this line. */
uint32_t IncomingCallsReceived; /**< Total incoming calls received. */
uint32_t IncomingCallsAnswered; /**< Total incoming calls answered by the local user. */
uint32_t IncomingCallsConnected; /**< Total incoming calls that successfully completed call setup signalling. */
uint32_t IncomingCallsFailed; /**< Total incoming calls that failed to successfully complete call setup signalling. */
uint32_t OutgoingCallsAttempted; /**< Total outgoing calls attempted. */
uint32_t OutgoingCallsAnswered; /**< Total outgoing calls answered by the remote user. */
uint32_t OutgoingCallsConnected; /**< Total outgoing calls that successfully completed call setup signalling. */
uint32_t OutgoingCallsFailed; /**< Total outgoing calls that failed to successfully complete call setup signaling. */
#ifdef HUB4_SDK_L07
uint32_t CallsDropped; /**< Total calls that were successfully connected (incoming or outgoing), but dropped unexpectedly while in progress without explicit user termination. */
uint32_t TotalCallTime; /**< Cumulative call duration in seconds. */
uint32_t ServerDownTime; /**< The number of seconds the CPE is unable to maintain a connection to the server. SHOULD not include time in which overall network connectivity is unavailable. Applies only to SIP. */
#endif
uint32_t ReceivePacketLossRate; /**< Current receive packet loss rate in percent, calculated as defined in [section 6.4-RFC3550] */
uint32_t FarEndPacketLossRate; /**< Current far end receive packet lost rate in percent, calculated as defined in [Section6.4/RFC3550]. */
uint32_t ReceiveInterarrivalJitter; /**< Current receive interarrival jitter in microseconds. Calculated from J(i) as defined in [Section6.4/RFC3550], with units converted to microseconds. */
uint32_t FarEndInterarrivalJitter; /**< Current Interarrival jitter in microseconds as reported from the far-end device via RTCP. Calculated from J(i) as defined in [Section64./RFC3550], with units converted to microseconds. */
uint32_t RoundTripDelay; /**< Current round trip delay in microseconds calculated as defined in [section 6.4-RFC3550]. */
uint32_t AverageReceiveInterarrivalJitter; /**< Average receive interarrival jitter in microseconds since the beginning of the current call. Calculated as the average of D(i,j) as defined in [Section6.4/RFC3550], with units converted to microseconds.*/
uint32_t AverageFarEndInterarrivalJitter; /**< Average far-end interarrival jitter in microseconds since the beginning of the current call. Calculated as the average of the interarrival jitter values reported by the far-end, with units converted to microseconds. */
uint32_t AverageRoundTripDelay; /**< Average round trip delay in microseconds since the beginning of the current call. Average of the RoundTripDelay statistic accumulated each time the delay is calculated. */
#if HUB4_SDK_L07
uint32_t OverRuns; /**< Total number of times the receive jitter buffer has overrun for this line. */
uint32_t UnderRuns; /**< Total number of times the receive jitter buffer has underrun for this line. */
#endif
} TelcoVoipAgent_VoiceService_Stats_t;
typedef struct
{
bool EnableCallWaiting;
bool EnableMessageWaitingIndicator;
bool EnableConferenceCall;
bool HoldEnable;
bool EnableCallerId;
}
TelcoVoipAgent_Voice_Calling_Features_t, *pTelcoVoipAgent_Voice_Calling_Features_t;
#define VOICE_HAL_USERNAME_LENGTH (40)
#define VOICE_HAL_PASSWORD_LENGTH (40)
/* These values are expected to be UTF-8 to support non-UK deployments */
typedef struct
{
uint8_t UserName[VOICE_HAL_USERNAME_LENGTH];
uint8_t Password[VOICE_HAL_PASSWORD_LENGTH];
}
TelcoVoipAgent_Voice_Credentials_t, *pTelcoVoipAgent_Voice_Credentials_t;
/** @} */ //END OF GROUP VOICE_HAL_TYPES
/*****************************************************************************
*
* Ccsp Telco voice HAL function prototypes
*
*****************************************************************************/
/*****************************************************************************
*
* Basic management
*
*****************************************************************************/
/**
* @addtogroup VOICE_HAL_APIS
* @{
*/
/* voice_hal_Init : */
/**
* @description Init the Voice Hal.
* @param None
*
* @return The status of the operation.
* @retval RDK_SUCCESS if successful.
* @retval RDK_FAILURE if any error is detected
*
* @execution Synchronous.
* @sideeffect None.
*
* @note This function must not suspend and must not invoke any blocking system
* calls.
*
*/
int32_t voice_hal_Init(void);
/* voice_hal_InitDB : */
/**
* @description Retrieves the global information for all shared DBs and makes them accessible locally.
* @param None
*
* @return The status of the operation.
* @retval RDK_SUCCESS if successful.
* @retval RDK_FAILURE if any error is detected
*
* @execution Synchronous.
* @sideeffect None.
*
* @note This function must not suspend and must not invoke any blocking system
* calls.
*
*/
int32_t voice_hal_InitDB(void);
/* voice_hal_Deinit : */
/**
* @description Releases all resources & closes all connections made during voice_hal_Init().
* @param None
*
* @return The status of the operation.
* @retval RDK_SUCCESS if successful.
* @retval RDK_FAILURE if any error is detected
*
* @execution Synchronous.
* @sideeffect None.
*
*
* @note This function must not suspend and must not invoke any blocking system
* calls. Since no sensible action can be taken on the RDK_FAILURE case, just log it & ignore.
*
*/
int32_t voice_hal_Deinit(void);
/* voice_hal_DeinitDB : */
/**
* @description Releases all resources & closes all connections made during voice_hal_InitDB().
* @param None
*
* @return The status of the operation.
* @retval RDK_SUCCESS if successful.
* @retval RDK_FAILURE if any error is detected
*
* @execution Synchronous.
* @sideeffect None.
*
* @note This function must not suspend and must not invoke any blocking system
* calls. Since no sensible action can be taken on the RDK_FAILURE case, just log it & ignore.
*
*/
int32_t voice_hal_DeinitDB(void);
/* voice_hal_setVoiceProcessState /
@description controls the voice process under HAL, to start, stop or restart *
@param uint32_t service - input the voice service
@param enum VoiceProcessStateRequest_e voice_state - can be in following states
VOICE_PROCESS_STATE_STOP
VOICE_PROCESS_STATE_START
VOICE_PROCESS_STATE_RESTART *
@return The status of the operation.
@retval RDK_SUCCESS if successful.
@retval RDK_FAILURE if any error is detected *
@execution Synchronous.
@sideeffect None.
return RDK_SUCCESS;
*/
int32_t voice_hal_setVoiceProcessState(uint32_t service, VoiceProcessStateRequest_e voice_state);
/* voice_hal_getVoiceProcessState /
@description Gets the voice process state that was previously set *
@param uint32_t service - input the voice service
@param enum VoiceProcessStateRequest_e *pvoice_state - can be in following states
VOICE_PROCESS_STATE_STOP
VOICE_PROCESS_STATE_START
VOICE_PROCESS_STATE_RESTART *
@return The status of the operation.
@retval RDK_SUCCESS if successful.
@retval RDK_FAILURE if any error is detected *
@execution Synchronous.
@sideeffect None.
return RDK_SUCCESS;
*/
int32_t voice_hal_getVoiceProcessState(uint32_t service, VoiceProcessStateRequest_e *pvoice_state);
/* voice_hal_getVoiceProcessStatus /
@description gets the current execution state of the voice process under HAL
@param uint32_t service - input the voice service
@param enum VoiceProcessStatus_e *pvoice_status - can be following
VOICE_PROCESS_STATUS_STOPPED
VOICE_PROCESS_STATUS_STARTING
VOICE_PROCESS_STATUS_STARTED
VOICE_PROCESS_STATUS_STOPPING *
@return The status of the operation.
@retval RDK_SUCCESS if successful.
@retval RDK_FAILURE if any error is detected *
@execution Synchronous.
@sideeffect None.
return RDK_SUCCESS;
*/
int32_t voice_hal_getVoiceProcessStatus(uint32_t service, VoiceProcessStatus_e *pvoice_status);
/* voice_hal_getServiceVersion: */
/**
* @description Get a string identifying the voice software present
* @param char *service_version - output a pointer to a null-terminated string identifying the voice software version
* The returned string will be ASCII (7-bit, no Unicode/UTF-8)
* @param uint32_t *pLength - input/output the buffer length
*
* @return The status of the operation.
* @retval RDK_SUCCESS if successful.
* @retval RDK_FAILURE if any error is detected
*
* @execution Synchronous.
* @sideeffect None.
*
*/
int32_t voice_hal_getServiceVersion(char *service_version, uint32_t *pLength);
/* voice_hal_getConfigSoftwareVersion: */
/**
* @description Get a string identifying the software configuration version
* @param char *config_version - output a pointer to a null-terminated string identifying the software configuration version
* The returned string will be ASCII (7-bit, no Unicode/UTF-8)
* @param uint32_t *pLength - input/output the buffer length
*
* @return The status of the operation.
* @retval RDK_SUCCESS if successful.
* @retval RDK_FAILURE if any error is detected
*
* @execution Synchronous.
* @sideeffect None.
*
*/
int32_t voice_hal_getConfigSoftwareVersion(uint32_t service, char *config_version, uint32_t *pLength);
/*****************************************************************************
*
* Service/profile/line/physical interface enumeration
*
*****************************************************************************/
/* voice_hal_getCountServices: */
/**
* @description Get the count of voice services present. Used to enumerate through services
* @param uint32_t *serviceCount - output on return the number of voice services present
*
* @return The status of the operation.
* @retval RDK_SUCCESS if successful.
* @retval RDK_FAILURE if any error is detected
*
* @execution Synchronous.
* @sideeffect None.
*
*/
int32_t voice_hal_getCountServices(uint32_t *serviceCount);
/* voice_hal_getCountProfiles: */
/**
* @description Get the count of profiles present. Used to enumerate through profiles
* @param uint32_t service - input the voice service whose profiles are being queried
* @param uint32_t *profileCount - output on return the number of voice profiles present
*
* @return The status of the operation.
* @retval RDK_SUCCESS if successful.
* @retval RDK_FAILURE if any error is detected
*
* @execution Synchronous.
* @sideeffect None.
*
*/
int32_t voice_hal_getCountProfiles(uint32_t service, uint32_t *profileCount);
/* voice_hal_getCountLines: */
/**
* @description Get the count of voice lines present. Used to enumerate through servcies/profiles/lines
* @param uint32_t service - input the voice service whose profiles are being queried
* @param uint32_t profile - input the profile being queried
* @param uint32_t *lineCount - output on return the number of voice profiles present
*
* @return The status of the operation.
* @retval RDK_SUCCESS if successful.
* @retval RDK_FAILURE if any error is detected
*
* @execution Synchronous.
* @sideeffect None.
*
*/
int32_t voice_hal_getCountLines(uint32_t service, uint32_t profile, uint32_t *lineCount);
/* voice_hal_getCountPhyInterfaces: */
/**
* @description Get the count of physical interfaces present. Used to enumerate them in testing
* @param uint32_t service - input the voice service for which the number of interfaces is being queried
* @param uint32_t *phyCount - output on return the number of v present
*
* @return The status of the operation.
* @retval RDK_SUCCESS if successful.
* @retval RDK_FAILURE if any error is detected
*
* @execution Synchronous.
* @sideeffect None.
*
*/
int32_t voice_hal_getCountPhyInterfaces(uint32_t service, uint32_t *phyCount);
/*** Network interfaces ***/
/* voice_hal_getBoundIfName: */
/**
* @description Get a string idntifying the interface to which this service is bound
*
* @param uint32_t service - input the voice service being queried
* @param char *bound_if_name - output pointer to the name of the interface,
* or the special values 'Any_WAN', 'Any_LAN'.
* @param unsigned int *pLength - input/output the buffer length
*
* @return The status of the operation.
* @retval RDK_SUCCESS if successful.
* @retval RDK_FAILURE if any error is detected
*
* @execution Synchronous.
* @sideeffect None.
*
*/
int32_t voice_hal_getBoundIfName(uint32_t service, char *bound_if_name, uint32_t *pLength);
/* voice_hal_setBoundIfName: */
/**
* @description Set the interface to which the specified service is bound
*
* @param uint32_t service - input the voice service being configured
* @param const char *bound_if_name - input the name of the interface,
* or the special values 'Any_WAN', 'Any_LAN'.
*
* @return The status of the operation.
* @retval RDK_SUCCESS if successful.
* @retval RDK_FAILURE if any error is detected
*
* @execution Synchronous.
* @sideeffect None.
*
*/
int32_t voice_hal_setBoundIfName(uint32_t service, const char *bound_if_name);
/* voice_hal_setIpAddressFamily: */
/**
* @description Set either IPv4 or IPv6 addressing for voice
*
* @param uint32_t service - input the voice service being configured
* @param char *address_family - input the AF type,
*
* @return The status of the operation.
* @retval RDK_SUCCESS if successful.
* @retval RDK_FAILURE if any error is detected
*
* @execution Synchronous.
* @sideeffect None.
*
*/
int32_t voice_hal_setIpAddressFamily(uint32_t service, const char *address_family);
/* voice_hal_getIpAddressFamily: */
/**
* @description get the address family for voice either IPv4 or IPv6
*
* @param uint32_t service - input the voice service being configured
* @param char *p_address_family - output pointer to the AF type,
* @param uint32_t *pLength - input/output the buffer length
*
* @return The status of the operation.
* @retval RDK_SUCCESS if successful.
* @retval RDK_FAILURE if any error is detected
*
* @execution Synchronous.
* @sideeffect None.
* return RDK_SUCCESS;
*/
int32_t voice_hal_getIpAddressFamily(uint32_t service, char *address_family, uint32_t *pLength);
/*****************************************************************************
*
* Link state/address event handlers
*
*****************************************************************************/
/* voice_hal_setLinkState: */
/**
* @description In response to the link state event, set the link state to up or down
*
* @param VoiceHalIpLinkState_e state - input either VOICE_HAL_IP_LINK_STATE_DOWN or VOICE_HAL_IP_LINK_STATE_UP
*
* @return The status of the operation.
* @retval RDK_SUCCESS if successful.
* @retval RDK_FAILURE if any error is detected
*
* @execution Synchronous.
* @sideeffect None.
*
*/
int32_t voice_hal_setLinkState(VoiceHalIpLinkState_e state);
/* voice_hal_setIpWanAddress: */
/**
* @description In response to the ipv4/ipv6_wan_ipaddr events, set the IPv6 WAN address
*
* @param uint32_t service - input the voice service whose IP address is to be set
* @param const char *boundIpAddress - IP address of WAN interface
*
* @return The status of the operation.
* @retval RDK_SUCCESS if successful.
* @retval RDK_FAILURE if any error is detected
*
* @execution Synchronous.
* @sideeffect None.
*
*/
int32_t voice_hal_setIpWanAddress(uint32_t service, const char *boundIpAddress);
/* voice_hal_getIpWanAddress: */
/**
* @description Get the WAN address (IPv4 or IPv6)
*
* @param uint32_t service - input the voice service whose IP address is to be retrieved
* @param char *boundIpAddress - IP address of WAN interface, space is allocated by the caller
* @param uint32_t *pLength - max input buffer length
*
* @return The status of the operation.
* @retval RDK_SUCCESS if successful.
* @retval RDK_FAILURE if any error is detected
*
* @execution Synchronous.
* @sideeffect None.
*
*/
int32_t voice_hal_getIpWanAddress(uint32_t service, char *boundIpAddress, uint32_t *pLength);
/*****************************************************************************
*
* Diagnostics
*
*****************************************************************************/
/* voice_hal_getTestState: */
/**
* @description get the state of the diagnostic test system - ready/busy/in error
*
* @param uint32_t service - input the voice service being configured
* @param char *phy_interface - input the physical network interface being queried
* @param char *testState - output the AF type,
* @param uint32_t *pLength - input/output buffer length
*
* @return The status of the operation.
* @retval RDK_SUCCESS if successful.
* @retval RDK_FAILURE if any error is detected
*
* @execution Synchronous.
* @sideeffect None.
*
*/
int32_t voice_hal_getTestState(uint32_t service, uint32_t phy_interface,
char *testState, uint32_t *pLength);
/* voice_hal_setTestState: */
/**
* @description set the state of the diagnostic test system - requested
*
* @param uint32_t service - input the voice service being configured
* @param uint32_t phy_interface - input the physical network interface being queried
* @param char *testState - state of the diag test,
*
* @return The status of the operation.
* @retval RDK_SUCCESS if successful.
* @retval RDK_FAILURE if any error is detected
*
* @execution Synchronous.
* @sideeffect None.
*
*/
int32_t voice_hal_setTestState(uint32_t service, uint32_t phy_interface,
char *testState);
/* voice_hal_getTestResult: */
/**
* @description get the result of the selected test
*
* @param uint32_t service - input the voice service being queried
* @param uint32_t phy_interface - input the physical network interface being queried
* @param char *test_result - output the test result
* @param uint32_t *pLength - input/output buffer length
*
* @return The status of the operation.
* @retval RDK_SUCCESS if successful.
* @retval RDK_FAILURE if any error is detected
*
* @execution Synchronous.
* @sideeffect None.
*
*/
int32_t voice_hal_getTestResult(uint32_t service, uint32_t phy_interface, char *test_result, uint32_t *pLength);
/* voice_hal_setTestSelector: */
/**
* @description select the test to be performed
*
* @param uint32_t service - input the voice service being queried
* @param uint32_t phy_interface - input the physical network interface being queried
* @param char *test_selector - input the GR-909 test to perform
*
* @return The status of the operation.
* @retval RDK_SUCCESS if successful.
* @retval RDK_FAILURE if any error is detected
*
* @execution Synchronous.
* @sideeffect None.
*
*/
int32_t voice_hal_setTestSelector(uint32_t service, uint32_t phy_interface, char *test_selector);
/* voice_hal_getTestSelector: */
/**
* @description read the number of the most recently performed test
*
* @param uint32_t service - input the voice service being queried
* @param uint32_t phy_interface - input the physical network interface being queried
* @param uint32_t *test_selector - output the GR-909 test last started
* @param uint32_t *pLength - input/output buffer length
*
* @return The status of the operation.
* @retval RDK_SUCCESS if successful.
* @retval RDK_FAILURE if any error is detected
*
* @execution Synchronous.
* @sideeffect None.
*
*/
int32_t voice_hal_getTestSelector(uint32_t service, uint32_t phy_interface, char *testSelector, uint32_t *pLength);
/* voice_hal_getPOSTTipGroundVoltageACParameter: */
/**
* @description get the POST result for Tip Ground Voltage AC
*
* @param uint32_t service - input the voice service index
* @param uint32_t uiPhyInterface - input the uiPhyInterface index
* @param char* pValue - output the POST parameter value
* @param uint32_t* pLength - input/output the buffer size
*
* @return The status of the operation.
* @retval RDK_SUCCESS if successful.
* @retval RDK_FAILURE if any error is detected
* @retval RDK_ERROR_OOM if buffer length insufficient
*
* @execution Synchronous.
* @sideeffect None.
*
*/
int32_t voice_hal_getPOSTTipGroundVoltageACParameter(uint32_t service, uint32_t phy_interface, char *pValue, uint32_t *pLength);
/* voice_hal_getPOSTTipGroundVoltageDCParameter: */
/**
* @description get the POST result for Tip Ground Voltage DC
*
* @param uint32_t service - input the voice service index
* @param uint32_t uiPhyInterface - input the uiPhyInterface index
* @param char* pValue - output the POST parameter value
* @param uint32_t* pLength - input/output the buffer size
*
* @return The status of the operation.
* @retval RDK_SUCCESS if successful.
* @retval RDK_FAILURE if any error is detected
* @retval RDK_ERROR_OOM if buffer length insufficient
*
* @execution Synchronous.
* @sideeffect None.
*
*/
int32_t voice_hal_getPOSTTipGroundVoltageDCParameter(uint32_t service, uint32_t phy_interface, char *pValue, uint32_t *pLength);
/* voice_hal_getPOSTRingGroundVoltageACParameter: */
/**
* @description get the POST result for Ring Ground Voltage AC
*
* @param uint32_t service - input the voice service index
* @param uint32_t uiPhyInterface - input the uiPhyInterface index
* @param char* pValue - output the POST parameter value
* @param uint32_t* pLength - input/output the buffer size
*
* @return The status of the operation.
* @retval RDK_SUCCESS if successful.
* @retval RDK_FAILURE if any error is detected
* @retval RDK_ERROR_OOM if buffer length insufficient
*
* @execution Synchronous.
* @sideeffect None.
*
*/
int32_t voice_hal_getPOSTRingGroundVoltageACParameter(uint32_t service, uint32_t phy_interface, char *pValue, uint32_t *pLength);
/* voice_hal_getPOSTRingGroundVoltageDCParameter: */
/**
* @description get the POST result for Ring Ground Voltage DC
*
* @param uint32_t service - input the voice service index
* @param uint32_t uiPhyInterface - input the uiPhyInterface index
* @param char* pValue - output the POST parameter value
* @param uint32_t* pLength - input/output the buffer size
*
* @return The status of the operation.
* @retval RDK_SUCCESS if successful.
* @retval RDK_FAILURE if any error is detected
* @retval RDK_ERROR_OOM if buffer length insufficient
*
* @execution Synchronous.
* @sideeffect None.
*
*/
int32_t voice_hal_getPOSTRingGroundVoltageDCParameter(uint32_t service, uint32_t phy_interface, char *pValue, uint32_t *pLength);
/* voice_hal_getPOSTTipGroundImpedanceParameter: */
/**
* @description get the POST result for Tip Ground Impedance
*
* @param uint32_t service - input the voice service index
* @param uint32_t uiPhyInterface - input the uiPhyInterface index
* @param char* pValue - output the POST parameter value
* @param uint32_t* pLength - input/output the buffer size
*
* @return The status of the operation.
* @retval RDK_SUCCESS if successful.
* @retval RDK_FAILURE if any error is detected
* @retval RDK_ERROR_OOM if buffer length insufficient
*
* @execution Synchronous.
* @sideeffect None.
*
*/
int32_t voice_hal_getPOSTTipGroundImpedanceParameter(uint32_t service, uint32_t phy_interface, char *pValue, uint32_t *pLength);
/* voice_hal_getPOSTRingGroundImpedanceParameter: */
/**
* @description get the POST result for Ring Ground Impedance
*
* @param uint32_t service - input the voice service index
* @param uint32_t uiPhyInterface - input the uiPhyInterface index
* @param char* pValue - output the POST parameter value
* @param uint32_t* pLength - input/output the buffer size
*
* @return The status of the operation.
* @retval RDK_SUCCESS if successful.
* @retval RDK_FAILURE if any error is detected
* @retval RDK_ERROR_OOM if buffer length insufficient
*
* @execution Synchronous.
* @sideeffect None.
*
*/
int32_t voice_hal_getPOSTRingGroundImpedanceParameter(uint32_t service, uint32_t phy_interface, char *pValue, uint32_t *pLength);
/* voice_hal_getPOSTTipRingImpedanceParameter: */
/**
* @description get the POST result for Tip Ring Impedance
*
* @param uint32_t service - input the voice service index
* @param uint32_t uiPhyInterface - input the uiPhyInterface index
* @param char* pValue - output the POST parameter value
* @param uint32_t* pLength - input/output the buffer size
*
* @return The status of the operation.
* @retval RDK_SUCCESS if successful.
* @retval RDK_FAILURE if any error is detected
* @retval RDK_ERROR_OOM if buffer length insufficient
*
* @execution Synchronous.
* @sideeffect None.
*
*/
int32_t voice_hal_getPOSTTipRingImpedanceParameter(uint32_t service, uint32_t phy_interface, char *pValue, uint32_t *pLength);
/*****************************************************************************
*
* Calling features - call waiting, caller ID ...
*
*****************************************************************************/
/* voice_hal_setCallingFeatures: */
/**
* @description enable or disable the calling features for this line
*
* @param uint32_t service - input the voice service
* @param uint32_t profile - input the voice profile
* @param uint32_t line - input the voice line number
* @param VoiceCallFeatureType_e eFeature - input the voice calling feature type
* @param bool bStatus - input the voice calling feature status
*
* @return The status of the operation.
* @retval RDK_SUCCESS if successful.
* @retval RDK_FAILURE if any error is detected
*
* @execution Synchronous.
* @sideeffect None.
*
*/
int32_t voice_hal_setCallingFeatures(uint32_t service, uint32_t profile, uint32_t line, VoiceCallFeatureType_e eFeature, bool bStatus);
/* voice_hal_getCallingFeatures: */
/**
* @description read the calling features for this line
*
* @param uint32_t service - input the voice service
* @param uint32_t profile - input the voice profile
* @param uint32_t line - input the voice line number
* @param VoiceCallFeatureType_e eFeature - input the voice calling feature type
* @param bool *pStatus - output the voice calling feature status
*
* @return The status of the operation.
* @retval RDK_SUCCESS if successful.
* @retval RDK_FAILURE if any error is detected
*
* @execution Synchronous.
* @sideeffect None.
*
*/
int32_t voice_hal_getCallingFeatures(uint32_t service, uint32_t profile, uint32_t line, VoiceCallFeatureType_e eFeature, bool *pStatus);
/*****************************************************************************
*
* Proxies and servers
*
*****************************************************************************/
/* voice_hal_getOutboundProxyAddresses: */
/**
* @description get a list of the resolved IP addresses from the FQDN of the configured outbound proxy
*
* @param uint32_t service - input the voice service affected
* @param uint32_t profile - input the voice profile affected
* @param uint32_t line - input the voice line number
* @param char **pProxyAddresses - output the list of resolved IP addresses as a null-terminated string
* e.g. "192.168.0.1 192.168.20.10" etc
* @param uint32_t *pLength - input/output buffer length
*
* @return The status of the operation.
* @retval RDK_SUCCESS if successful.
* @retval RDK_FAILURE if any error is detected
*
* @execution Synchronous.
* @sideeffect None.
*
*/
int32_t voice_hal_getOutboundProxyAddresses(uint32_t service, uint32_t profile, uint32_t line, char *pProxyAddresses, uint32_t *pLength);
/* voice_hal_getOutboundProxy: */
/**
* @description get the name/address of the SIP outbound proxy
*
* @param uint32_t service - input the voice service affected
* @param uint32_t profile - input the voice profile affected
* @param char *ipNameAddress - output the name or IP address of Outbound proxy
* e.g. "10.241.16.3" or "proxy.sky.com"
* @param uint32_t *pLength - input/output buffer length
*
* @return The status of the operation.
* @retval RDK_SUCCESS if successful.
* @retval RDK_FAILURE if any error is detected
*
* @execution Synchronous.
* @sideeffect None.
*
*/
int32_t voice_hal_getOutboundProxy(uint32_t service, uint32_t profile, char *ipNameAddress, uint32_t *pLength);
/* voice_hal_setOutboundProxy: */
/**
* @description set the name/address of the SIP outbound proxy
*
* @param uint32_t service - input the voice service affected
* @param uint32_t profile - input the voice profile affected
* @param char *ipNameAddress - input the name or IP address of Outbound proxy
* e.g. "10.241.16.3" or "proxy.sky.com"
*
* @return The status of the operation.
* @retval RDK_SUCCESS if successful.
* @retval RDK_FAILURE if any error is detected
*
* @execution Synchronous.
* @sideeffect None.
*
*/
int32_t voice_hal_setOutboundProxy(uint32_t service, uint32_t profile, const char *ipNameAddress);
/* voice_hal_getOutboundProxyPort: */
/**
* @description get the port of the SIP outbound proxy