libsangoma  1
libsangoma.h
Go to the documentation of this file.
1 /*******************************************************************************/
39 #ifndef _LIBSANGOMA_H
40 #define _LIBSANGOMA_H
41 
42 #ifdef __linux__
43 #ifndef __LINUX__
44 /* most wanpipe driver headers require __LINUX__ to be defined */
45 #define __LINUX__
46 #endif
47 #endif
48 
49 #ifdef __cplusplus
50 extern "C" { /* for C++ users */
51 #endif
52 
53 #include <stdio.h>
54 
55 
60 #define WANPIPE_TDM_API 1
61 
62 /*TODO: LIBSANGOMA_VERSION_CODE should be generated out of LIBSANGOMA_LT_CURRENT and friends in configure.in */
63 
68 #define LIBSANGOMA_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + (c))
69 
74 #define LIBSANGOMA_VERSION_CODE LIBSANGOMA_VERSION(3,3,0)
75 
81 #define LIBSANGOMA_VERSION_STR "3.3.0"
82 
83 #define WP_API_FEATURE_ANALOG_STATS 1
84 
85 struct sangoma_wait_obj;
86 #define sangoma_wait_obj_t struct sangoma_wait_obj
87 
88 
99 #define SANGOMA_DECLARE_TDM_API_CMD(_name_) wanpipe_api_t _name_
100 
101 #define SANGOMA_INIT_TDM_API_CMD(_name_) memset(&_name_,0,sizeof(_name_)); \
102  SANGOMA_INIT_TDM_API_CMD_RESULT(_name_)
103 
104 #define SANGOMA_INIT_TDM_API_CMD_RESULT(_name_) (_name_).wp_cmd.result = SANG_STATUS_GENERAL_ERROR
105 
106 #define SANGOMA_DECLARE_INIT_TDM_API_CMD(_name_) wanpipe_tdm_api_t _name_; SANGOMA_INIT_TDM_API_CMD(_name_);
107 
108 
109 #if defined(WIN32) || defined(WIN64)
110 #ifndef __WINDOWS__
111 #define __WINDOWS__
112 #endif
113 #include <windows.h>
114 #include <winioctl.h>
115 #include <conio.h>
116 #include <stddef.h>
117 #include <stdlib.h>
118 #include <time.h>
119 
124 #ifdef __COMPILING_LIBSANGOMA__
125 # define _LIBSNG_CALL __declspec(dllexport) __cdecl
126 #else
127 # ifdef __LIBSANGOMA_IS_STATIC_LIB__
128 /* libsangoma is static lib OR 'compiled in' */
129 # define _LIBSNG_CALL __cdecl
130 # else
131 /* compiling an application which will use libsangoma.dll */
132 # define _LIBSNG_CALL __declspec(dllimport) __cdecl
133 # endif
134 #endif /* __COMPILING_LIBSANGOMA__ */
135 
140 #define SANGOMA_INFINITE_API_POLL_WAIT INFINITE
141 #define SANGOMA_WAIT_INFINITE INFINITE
142 
147 #define sangoma_msleep(x) Sleep(x)
148 
154 #define sangoma_ctime(time) _ctime64(time)
155 
156 #else
157 /* L I N U X */
158 #include <stdlib.h>
159 #include <stdarg.h>
160 #include <ctype.h>
161 #include <unistd.h>
162 #include <sys/time.h>
163 #include <sys/socket.h>
164 #include <sys/ioctl.h>
165 #include <sys/types.h>
166 #include <sys/stat.h>
167 #include <sys/signal.h>
168 #include <sys/select.h>
169 #include <sys/wait.h>
170 #include <sys/resource.h>
171 #include <netinet/in.h>
172 #include <string.h>
173 #include <errno.h>
174 #include <fcntl.h>
175 #include <net/if.h>
176 #include <poll.h>
177 #include <signal.h>
178 #include <pthread.h>
179 #include <stdint.h>
180 
185 #define _LIBSNG_CALL
186 
191 #define INVALID_HANDLE_VALUE -1
192 
197 #define SANGOMA_INFINITE_API_POLL_WAIT -1
198 #define SANGOMA_WAIT_INFINITE -1
199 
241 #define __cdecl
242 
243 #ifndef FALSE
244 #define FALSE 0
245 #endif
246 
247 #ifndef TRUE
248 #define TRUE 1
249 #endif
250 
251 #define sangoma_msleep(x) usleep(x*1000)
252 #define _getch getchar
253 #define Sleep sangoma_msleep
254 #define _stricmp strcmp
255 #define _snprintf snprintf
256 #define _vsnprintf vsnprintf
257 
258 typedef int HANDLE;
259 typedef int DWORD;
260 typedef char TCHAR;
261 
262 
263 #if 0
264 typedef int BOOL;
265 typedef unsigned char UCHAR;
266 typedef unsigned long ULONG;
267 typedef unsigned short USHORT;
268 typedef unsigned char * LPSTR;
269 typedef unsigned char * PUCHAR;
270 typedef void * PVOID;
271 typedef unsigned int UINT;
272 #endif
273 
274 typedef void * LPTHREAD_START_ROUTINE;
275 typedef pthread_mutex_t CRITICAL_SECTION;
276 
277 #define EnterCriticalSection(arg) pthread_mutex_lock(arg)
278 /* On success, pthread_mutex_trylock() returns 0. On error, non-zero value is returned. */
279 #define TryEnterCriticalSection(arg) (pthread_mutex_trylock(arg)==0 ? 1 : 0)
280 #define LeaveCriticalSection(arg) pthread_mutex_unlock(arg)
281 #define InitializeCriticalSection(arg) pthread_mutex_init(arg, NULL);
282 
283 typedef struct tm SYSTEMTIME;
284 typedef char * LPCTSTR;
285 
291 #define sangoma_ctime(time) ctime((time_t*)time)
292 
293 #endif/* WIN32 */
294 
295 
307 #ifdef LIBSANGOMA_LIGHT
308 #include "wanpipe_api_iface.h"
309 #include "wanpipe_api_hdr.h"
310 #include "sdla_te1.h"
311 #include "wanpipe_events.h"
312 #include "wanpipe_api_deprecated.h"
313 #else
314 #include "wanpipe_api.h"
315 
316 #ifdef WP_API_FEATURE_LIBSNG_HWEC
317 # include "wanpipe_events.h"
318 # include "wanec_api.h"
319 # include "wanec_iface_api.h"
320 #endif
321 #endif
322 
323 
324 #ifdef __LINUX__
325 #include "wanpipe_kernel.h"
326 #endif
327 
338 typedef int32_t sangoma_status_t;
339 
348 #define FNAME_LEN 100
349 #define LIBSNG_FUNC_DBG() if(0)printf("%s(): line:%d\n", __FUNCTION__, __LINE__)
350 #define LIBSNG_DBG_PRINT if(0)printf
351 
357 
365 {
375 
376 #define DECODE_SANGOMA_WAIT_OBJECT_TYPE(type)\
377  type == SANGOMA_GENERIC_WAIT_OBJ ? "SANGOMA_GENERIC_WAIT_OBJ" :\
378  type == SANGOMA_DEVICE_WAIT_OBJ ? "SANGOMA_DEVICE_WAIT_OBJ" :\
379  type == SANGOMA_DEVICE_WAIT_OBJ_SIG ? "SANGOMA_DEVICE_WAIT_OBJ_SIG" :\
380  "Invalid Wait Object type!"
381 
382 /*
383  * Possible flags for sangoma waitable objects
384  * this definitions MUST match POLLIN, POLLOUT and POLLPRI
385  * SANG_WAIT_OBJ_IS_SIGNALED has no posix equivalent though
386  * Users are encouraged to use this flags instead of the system ones
387  */
388 typedef enum _sangoma_wait_obj_flags {
389  SANG_WAIT_OBJ_HAS_INPUT = WP_POLLIN,
390  SANG_WAIT_OBJ_HAS_OUTPUT = WP_POLLOUT,
391  SANG_WAIT_OBJ_HAS_EVENTS = WP_POLLPRI,
392  SANG_WAIT_OBJ_IS_SIGNALED = 0x400 /* matches GNU extension POLLMSG */
393 } sangoma_wait_obj_flags_t;
394 
395 /*
396  * Note for data format of Input/Output and Bit-order in libsangoma API.
397  * The bit-order depends on Span/Channel configuration.
398  *
399  * TDM_CHAN_VOICE_API - expected input is ulaw/alaw, output is ulaw/alaw,
400  * TDM_SPAN_VOICE_API - expected input is ulaw/alaw, output is ulaw/alaw
401  *
402  * DATA_API - data can be in any format, not bitswapped by AFT hardware
403  * API - data can be in any format, not bitswapped by AFT hardware
404 */
405 
406 /************************************************************/
420 
421 
432 #define __sangoma_open_tdmapi_span_chan __sangoma_open_api_span_chan
433 
442 sng_fd_t _LIBSNG_CALL sangoma_open_api_span(int span);
443 
450 sng_fd_t _LIBSNG_CALL sangoma_open_dev_by_name(const char *dev_name);
451 
452 
464 #ifndef LIBSANGOMA_TDMAPI_CTRL
465 #define LIBSANGOMA_TDMAPI_CTRL 1
466 #endif
467 
477 
487 
497 
498 
499 
508 
509 
510 
520 
521 
522 /************************************************************/
541 int _LIBSNG_CALL sangoma_writemsg(sng_fd_t fd, void *hdrbuf, int hdrlen,
542  void *databuf, unsigned short datalen, int flag);
543 
544 
559 int _LIBSNG_CALL sangoma_readmsg(sng_fd_t fd, void *hdrbuf, int hdrlen,
560  void *databuf, int datalen, int flag);
561 
562 
563 
564 
565 /************************************************************/
576 sangoma_status_t _LIBSNG_CALL sangoma_waitfor(sangoma_wait_obj_t *sangoma_wait_obj, uint32_t inflags, uint32_t *outflags, int32_t timeout);
577 
588 sangoma_status_t _LIBSNG_CALL sangoma_waitfor_many(sangoma_wait_obj_t *sangoma_wait_objects[], uint32_t in_flags[], uint32_t out_flags[],
589  uint32_t number_of_sangoma_wait_objects, int32_t system_wait_timeout);
590 
600 sangoma_status_t _LIBSNG_CALL sangoma_wait_obj_create(sangoma_wait_obj_t **sangoma_wait_object, sng_fd_t fd, sangoma_wait_obj_type_t object_type);
601 
608 sangoma_status_t _LIBSNG_CALL sangoma_wait_obj_delete(sangoma_wait_obj_t **sangoma_wait_object);
609 
616 sangoma_status_t _LIBSNG_CALL sangoma_wait_obj_signal(sangoma_wait_obj_t *sangoma_wait_object);
617 
624 sng_fd_t _LIBSNG_CALL sangoma_wait_obj_get_fd(sangoma_wait_obj_t *sangoma_wait_object);
625 
634 void _LIBSNG_CALL sangoma_wait_obj_set_context(sangoma_wait_obj_t *sangoma_wait_object, void *context);
635 
643 PVOID _LIBSNG_CALL sangoma_wait_obj_get_context(sangoma_wait_obj_t *sangoma_wait_object);
644 
645 
646 /************************************************************/
658 
659 
668 
679 int _LIBSNG_CALL sangoma_tdm_set_usr_period(sng_fd_t fd, wanpipe_api_t *tdm_api, int period);
680 
689 
698 
699 
709 
728 
738 
739 
748 int _LIBSNG_CALL sangoma_tdm_enable_rbs_events(sng_fd_t fd, wanpipe_api_t *tdm_api, int poll_in_sec);
749 
758 
768 int _LIBSNG_CALL sangoma_tdm_write_rbs(sng_fd_t fd, wanpipe_api_t *tdm_api, int channel, unsigned char rbs);
769 
780 int _LIBSNG_CALL sangoma_tdm_read_rbs(sng_fd_t fd, wanpipe_api_t *tdm_api, int channel, unsigned char *rbs);
781 
792 
803 
804 
805 #ifdef WP_API_FEATURE_FAX_EVENTS
806 
816 
827 
838 
839 #endif
840 
841 
852 
863 
874 
885 
896 
907 
908 
919 
930 
941 
952 
963 int _LIBSNG_CALL sangoma_tdm_enable_tone_events(sng_fd_t fd, wanpipe_api_t *tdm_api, uint16_t tone_id);
964 
975 
986 
997 
1008 
1019 
1030 
1041 
1052 int _LIBSNG_CALL sangoma_tdm_get_fe_alarms(sng_fd_t fd, wanpipe_api_t *tdm_api, unsigned int *alarms);
1053 
1054 
1055 
1056 #ifdef WP_API_FEATURE_LINK_STATUS
1057 # ifndef LIBSANGOMA_GET_LINKSTATUS
1058 
1062 # define LIBSANGOMA_GET_LINKSTATUS 1
1063 # endif
1064 
1074 int _LIBSNG_CALL sangoma_get_link_status(sng_fd_t fd, wanpipe_api_t *tdm_api, unsigned char *current_status);
1075 
1076 #endif
1077 
1078 /* set current Line Connection state - Connected/Disconnected */
1079 #ifndef LIBSANGOMA_GET_FESTATUS
1080 
1084 #define LIBSANGOMA_GET_FESTATUS 1
1085 #endif
1086 
1095 int _LIBSNG_CALL sangoma_set_fe_status(sng_fd_t fd, wanpipe_api_t *tdm_api, unsigned char new_status);
1096 
1097 
1098 
1099 #ifdef WP_API_FEATURE_BUFFER_MULT
1100 
1108 int _LIBSNG_CALL sangoma_tdm_set_buffer_multiplier(sng_fd_t fd, wanpipe_api_t *tdm_api, unsigned int multiplier);
1109 
1110 #endif
1111 
1112 
1123 
1134 
1135 
1144 
1145 
1154 int _LIBSNG_CALL sangoma_set_tx_queue_sz(sng_fd_t fd, wanpipe_api_t *tdm_api, int size);
1155 
1164 
1173 int _LIBSNG_CALL sangoma_set_rx_queue_sz(sng_fd_t fd, wanpipe_api_t *tdm_api, int size);
1174 
1175 
1176 #ifndef LIBSANGOMA_GET_HWCODING
1177 
1181 #define LIBSANGOMA_GET_HWCODING 1
1182 #endif
1183 
1192 
1193 
1194 
1195 #ifndef LIBSANGOMA_GET_HWDTMF
1196 
1200 #define LIBSANGOMA_GET_HWDTMF 1
1201 #endif
1202 
1212 
1223 
1224 
1225 #ifdef WP_API_FEATURE_EC_CHAN_STAT
1226 
1238 
1239 #endif
1240 
1241 #ifdef WP_API_FEATURE_HWEC_PERSIST
1242 
1253 #endif
1254 
1263 int _LIBSNG_CALL sangoma_span_chan_toif(int span, int chan, char *interface_name);
1264 
1273 int _LIBSNG_CALL sangoma_span_chan_fromif(char *interface_name, int *span, int *chan);
1274 
1275 
1284 int _LIBSNG_CALL sangoma_interface_wait_up(int span, int chan, int sectimeout);
1285 
1295 
1304 int _LIBSNG_CALL sangoma_get_firmware_version(sng_fd_t fd, wanpipe_api_t *tdm_api, unsigned char *ver);
1305 
1314 int _LIBSNG_CALL sangoma_get_cpld_version(sng_fd_t fd, wanpipe_api_t *tdm_api, unsigned char *ver);
1315 
1325 int _LIBSNG_CALL sangoma_get_aft_customer_id(sng_fd_t fd, unsigned char *out_customer_id);
1326 
1327 #ifdef WP_API_FEATURE_LED_CTRL
1328 
1337 int _LIBSNG_CALL sangoma_port_led_ctrl(sng_fd_t fd, unsigned char led_state);
1338 
1339 #endif
1340 
1341 
1342 #ifdef WP_API_FEATURE_FE_RW
1343 
1353 int _LIBSNG_CALL sangoma_fe_reg_write(sng_fd_t fd, uint32_t offset, uint8_t data);
1354 
1363 int _LIBSNG_CALL sangoma_fe_reg_read(sng_fd_t fd, uint32_t offset, uint8_t *data);
1364 #endif
1365 
1375 
1384 
1393 int _LIBSNG_CALL sangoma_set_rm_rxflashtime(sng_fd_t fd, wanpipe_api_t *tdm_api, int rxflashtime);
1394 
1395 #ifdef WP_API_FEATURE_RM_GAIN
1396 
1404 int _LIBSNG_CALL sangoma_set_rm_tx_gain(sng_fd_t fd, wanpipe_api_t *tdm_api, int value);
1405 
1406 
1415 int _LIBSNG_CALL sangoma_set_rm_rx_gain(sng_fd_t fd, wanpipe_api_t *tdm_api, int value);
1416 
1417 #endif /* WP RM GAIN feature */
1418 
1427 int _LIBSNG_CALL sangoma_tdm_set_polarity(sng_fd_t fd, wanpipe_api_t *tdm_api, int polarity);
1428 
1438 int _LIBSNG_CALL sangoma_tdm_txsig_onhooktransfer(sng_fd_t fd, wanpipe_api_t *tdm_api);
1439 
1440 
1441 #ifdef WP_API_FEATURE_LOOP
1442 
1450 
1459 #endif
1460 
1461 /************************************************************/
1478 
1479 #ifdef WP_API_FEATURE_LOGGER
1480 
1481 sangoma_status_t _LIBSNG_CALL sangoma_logger_cmd_exec(sng_fd_t fd, wp_logger_cmd_t *logger_cmd);
1482 
1494 sangoma_status_t _LIBSNG_CALL sangoma_logger_read_event(sng_fd_t fd, wp_logger_cmd_t *logger_cmd);
1495 
1503 sangoma_status_t _LIBSNG_CALL sangoma_logger_flush_buffers(sng_fd_t fd, wp_logger_cmd_t *logger_cmd);
1504 
1512 sangoma_status_t _LIBSNG_CALL sangoma_logger_get_statistics(sng_fd_t fd, wp_logger_cmd_t *logger_cmd);
1513 
1521 sangoma_status_t _LIBSNG_CALL sangoma_logger_reset_statistics(sng_fd_t fd, wp_logger_cmd_t *logger_cmd);
1522 
1530 sangoma_status_t _LIBSNG_CALL sangoma_logger_get_open_handle_counter(sng_fd_t fd, wp_logger_cmd_t *logger_cmd);
1531 
1539 sangoma_status_t _LIBSNG_CALL sangoma_logger_get_logger_level(sng_fd_t fd, wp_logger_cmd_t *logger_cmd);
1540 
1548 sangoma_status_t _LIBSNG_CALL sangoma_logger_set_logger_level(sng_fd_t fd, wp_logger_cmd_t *logger_cmd);
1549 
1550 #endif /* WP LOGGER FEATURE */
1551 
1552 
1553 #ifdef WP_API_FEATURE_DRIVER_GAIN
1554 
1562 int _LIBSNG_CALL sangoma_set_tx_gain(sng_fd_t fd, wanpipe_api_t *tdm_api, float gain_val);
1563 
1572 int _LIBSNG_CALL sangoma_set_rx_gain(sng_fd_t fd, wanpipe_api_t *tdm_api, float gain_val);
1573 
1582 
1591 #endif
1592 
1593 #ifndef LIBSANGOMA_LIGHT
1594 
1595 /************************************************************/
1613 int _LIBSNG_CALL sangoma_driver_port_start(sng_fd_t fd, port_management_struct_t *port_mgmnt, unsigned short port_no);
1614 
1615 
1630 int _LIBSNG_CALL sangoma_driver_port_stop(sng_fd_t fd, port_management_struct_t *port_mgmnt, unsigned short port_no);
1631 
1632 
1649 int _LIBSNG_CALL sangoma_driver_port_set_config(sng_fd_t fd, port_cfg_t *port_cfg, unsigned short port_no);
1650 
1651 
1665 int _LIBSNG_CALL sangoma_driver_port_get_config(sng_fd_t fd, port_cfg_t *port_cfg, unsigned short port_no);
1666 
1667 
1680 int _LIBSNG_CALL sangoma_driver_get_hw_info(sng_fd_t fd, port_management_struct_t *port_mgmnt, unsigned short port_no);
1681 
1682 
1696 int _LIBSNG_CALL sangoma_driver_get_version(sng_fd_t fd, port_management_struct_t *port_mgmnt, unsigned short port_no);
1697 
1698 
1699 
1700 
1701 #ifdef WP_API_FEATURE_HARDWARE_RESCAN
1702 
1714 int _LIBSNG_CALL sangoma_driver_hw_rescan(sng_fd_t fd, port_management_struct_t *port_mgmnt, int *detected_port_cnt);
1715 #endif
1716 
1733 int _LIBSNG_CALL sangoma_write_port_config_on_persistent_storage(hardware_info_t *hardware_info, port_cfg_t *port_cfg, unsigned short port_no);
1734 
1735 
1736 /************************************************************/
1748 
1749 
1750 #endif /* LIBSANGOMA_LIGHT */
1751 
1752 
1753 /*================================================================
1754  * DEPRECATED Function Calls - Not to be used any more
1755  * Here for backward compatibility
1756  *================================================================*/
1757 
1758 
1759 #ifndef LIBSANGOMA_SET_FESTATUS
1760 
1764 #define LIBSANGOMA_SET_FESTATUS 1
1765 #endif
1766 
1777 int _LIBSNG_CALL sangoma_get_fe_status(sng_fd_t fd, wanpipe_api_t *tdm_api, unsigned char *current_status);
1778 
1779 
1780 
1792 int _LIBSNG_CALL sangoma_tdm_set_codec(sng_fd_t fd, wanpipe_api_t *tdm_api, int codec);
1793 
1805 
1806 
1816 sng_fd_t _LIBSNG_CALL sangoma_create_socket_by_name(char *device, char *card);
1817 
1827 int _LIBSNG_CALL sangoma_interface_toi(char *interface_name, int *span, int *chan);
1828 
1829 
1840 int _LIBSNG_CALL sangoma_tdm_set_power_level(sng_fd_t fd, wanpipe_api_t *tdm_api, int power);
1841 
1852 
1853 
1854 
1855 
1856 #ifdef WP_API_FEATURE_LIBSNG_HWEC
1857 
1894 sangoma_status_t _LIBSNG_CALL sangoma_hwec_config_init(char *device_name, wan_custom_param_t custom_params[], unsigned int number_of_custom_params);
1895 
1912 sangoma_status_t _LIBSNG_CALL sangoma_hwec_config_release(char *device_name);
1913 
1932 sangoma_status_t _LIBSNG_CALL sangoma_hwec_config_operation_mode(char *device_name, int mode, unsigned int fe_chan_map);
1933 
1951 sangoma_status_t _LIBSNG_CALL sangoma_hwec_config_power_on(char *device_name, unsigned int fe_chan_map);
1952 
1971 sangoma_status_t _LIBSNG_CALL sangoma_hwec_config_power_off(char *device_name, unsigned int fe_chan_map);
1972 
1996 sangoma_status_t _LIBSNG_CALL sangoma_hwec_enable(char *device_name, unsigned int fe_chan_map);
1997 
2019 sangoma_status_t _LIBSNG_CALL sangoma_hwec_disable(char *device_name, unsigned int fe_chan_map);
2020 
2062 sangoma_status_t _LIBSNG_CALL sangoma_hwec_config_channel_parameter(char *device_name, char *parameter, char *parameter_value, unsigned int channel_map);
2063 
2086 sangoma_status_t _LIBSNG_CALL sangoma_hwec_config_tone_detection(char *device_name, int tone_id, int enable, unsigned int fe_chan_map, unsigned char port_map);
2087 
2104 sangoma_status_t _LIBSNG_CALL sangoma_hwec_print_statistics(char *device_name, int full, unsigned int fe_chan_map);
2105 
2123 sangoma_status_t _LIBSNG_CALL sangoma_hwec_audio_buffer_load(char *device_name, char *filename, char pcmlaw, int *out_buffer_id);
2124 
2139  sangoma_status_t _LIBSNG_CALL sangoma_hwec_audio_mem_buffer_load(char *device_name, unsigned char *buffer, unsigned int in_size, char pcmlaw, int *out_buffer_id);
2140 
2152 sangoma_status_t _LIBSNG_CALL sangoma_hwec_audio_buffer_unload(char *device_name, int in_buffer_id);
2153 
2179 sangoma_status_t _LIBSNG_CALL sangoma_hwec_audio_buffer_playout(char *device_name, unsigned int fe_chan_map,
2180  unsigned char port, int in_buffer_id, int start,
2181  int repeat_cnt, int duration);
2182 
2194 sangoma_status_t _LIBSNG_CALL sangoma_hwec_config_verbosity(int verbosity_level);
2195 
2207 void _LIBSNG_CALL sangoma_hwec_initialize_custom_parameter_structure(wan_custom_param_t *custom_param, char *parameter_name, char *parameter_value);
2208 
2209 
2231 sangoma_status_t _LIBSNG_CALL sangoma_hwec_get_channel_statistics(sng_fd_t fd, unsigned int fe_chan,
2232  int *hwec_api_return_code, wanec_chan_stats_t *wanec_chan_stats, int verbose, int reset);
2233 
2234 
2254  int *hwec_api_return_code, wanec_chip_stats_t *wanec_chip_stats, int verbose, int reset);
2255 
2256 
2274  int *hwec_api_return_code, wanec_chip_image_t *wanec_chip_image, int verbose);
2275 
2276 #ifdef WP_API_FEATURE_LIBSNG_HWEC_DTMF_REMOVAL
2277 
2296 sangoma_status_t _LIBSNG_CALL sangoma_hwec_set_hwdtmf_removal(sng_fd_t fd, unsigned int fe_chan,
2297  int *hwec_api_return_code, int enable, int verbose);
2298 #endif /* WP_API_FEATURE_LIBSNG_HWEC */
2299 #endif
2300 
2301 
2302 
2303 #ifdef WP_API_FEATURE_SS7_FORCE_RX
2304 
2312 #endif
2313 
2314 #ifdef WP_API_FEATURE_SS7_CFG_STATUS
2315 
2324 #endif
2325 
2326 
2327 #ifdef __cplusplus
2328 }
2329 #endif/* __WINDOWS__ */
2330 
2331 
2332 #if defined(__WINDOWS__)
2333 
2334 #ifdef __cplusplus
2335 extern "C" { /* for C++ users */
2336 #endif
2337 
2338 sangoma_status_t _LIBSNG_CALL sangoma_unload_driver();
2339 sangoma_status_t _LIBSNG_CALL sangoma_load_driver();
2340 void _LIBSNG_CALL sangoma_reset_port_numbers();
2341 sangoma_status_t _LIBSNG_CALL sangoma_get_driver_version_from_registry(char *out_buffer, int out_buffer_length);
2342 sangoma_status_t _LIBSNG_CALL sangoma_set_driver_mode_of_all_hw_devices(int driver_mode);
2343 
2344 #ifdef __cplusplus
2345 }
2346 #endif/* __WINDOWS__ */
2347 
2348 #else
2349 
2350 #define sangoma_open_tdmapi_span_chan sangoma_open_api_span_chan
2351 #define sangoma_open_tdmapi_span sangoma_open_api_span
2352 #define sangoma_open_tdmapi_ctrl sangoma_open_api_ctrl
2353 #define sangoma_tdm_get_fe_status sangoma_get_fe_status
2354 #define sangoma_socket_close sangoma_close
2355 #define sangoma_tdm_get_hw_coding sangoma_get_hw_coding
2356 #define sangoma_tdm_set_fe_status sangoma_set_fe_status
2357 #define sangoma_tdm_get_link_status sangoma_get_link_status
2358 #define sangoma_tdm_flush_bufs sangoma_flush_bufs
2359 #define sangoma_tdm_cmd_exec sangoma_cmd_exec
2360 #define sangoma_tdm_read_event sangoma_read_event
2361 #define sangoma_readmsg_tdm sangoma_readmsg
2362 #define sangoma_readmsg_socket sangoma_readmsg
2363 #define sangoma_sendmsg_socket sangoma_writemsg
2364 #define sangoma_writemsg_tdm sangoma_writemsg
2365 #define sangoma_create_socket_intr sangoma_open_api_span_chan
2366 #endif
2367 
2368 #endif /* _LIBSANGOMA_H */
2369 
sng_fd_t _LIBSNG_CALL __sangoma_open_api_span_chan(int span, int chan)
Open a Device based on Span/Chan values.
Definition: libsangoma.c:1740
sangoma_status_t _LIBSNG_CALL sangoma_logger_get_logger_level(sng_fd_t fd, wp_logger_cmd_t *logger_cmd)
Get current level (types of events) of Wanpipe Logger.
Definition: libsangoma.c:2586
int _LIBSNG_CALL sangoma_driver_port_set_config(sng_fd_t fd, port_cfg_t *port_cfg, unsigned short port_no)
Set Port&#39;s &quot;Volatile&quot; configuration. The configuration will not persist between system restarts...
int _LIBSNG_CALL sangoma_wait_obj_signal(sangoma_wait_obj_t *sng_wait_obj)
Set wait object to a signaled state.
Definition: libsangoma.c:1353
int _LIBSNG_CALL sangoma_tdm_disable_rxhook_events(sng_fd_t fd, wanpipe_api_t *tdm_api)
Disable RX HOOK Events (Analog Only)
Definition: libsangoma.c:2686
sangoma_status_t _LIBSNG_CALL sangoma_hwec_config_power_off(char *device_name, unsigned int fe_chan_map)
Set the channel state in the echo canceller to POWER OFF. This disables echo cancellatio logic inside...
sangoma_status_t _LIBSNG_CALL sangoma_hwec_disable(char *device_name, unsigned int fe_chan_map)
Force AFT FPGA to bypass the echo canceller. This command effectively disables echo cancellation sinc...
int _LIBSNG_CALL sangoma_tdm_enable_ring_events(sng_fd_t fd, wanpipe_api_t *tdm_api)
Enable RING Events (Analog Only)
Definition: libsangoma.c:2696
int _LIBSNG_CALL sangoma_flush_stats(sng_fd_t fd, wanpipe_api_t *tdm_api)
Flush/Reset device statistics.
Definition: libsangoma.c:3299
int _LIBSNG_CALL sangoma_get_full_cfg(sng_fd_t fd, wanpipe_api_t *tdm_api)
Read tdm api device configuration.
Definition: libsangoma.c:2026
sangoma_status_t _LIBSNG_CALL sangoma_hwec_config_operation_mode(char *device_name, int mode, unsigned int fe_chan_map)
Modify channel operation mode.
void * LPTHREAD_START_ROUTINE
LPTHREAD_START_ROUTINE type mapped to unsigned char *, Ported from Windows.
Definition: libsangoma.h:274
int _LIBSNG_CALL sangoma_disable_bri_bchan_loopback(sng_fd_t fd, wanpipe_api_t *tdm_api, int channel)
Disable BRI Bchannel loopback - used when debugging bri device.
Definition: libsangoma.c:2900
_sangoma_wait_obj_type
Definition: libsangoma.h:364
sangoma_status_t _LIBSNG_CALL sangoma_hwec_config_release(char *device_name)
Release resources allocated by sangoma_hwec_config_init(). For single-port cards, such as A101 and A2...
int _LIBSNG_CALL sangoma_get_driver_version(sng_fd_t fd, wanpipe_api_t *tdm_api, wan_driver_version_t *drv_ver)
Get Device Driver Version Number.
Definition: libsangoma.c:2982
int _LIBSNG_CALL sangoma_tdm_get_hwec_persist_status(sng_fd_t fd, wanpipe_api_t *tdm_api)
Check if hwec persis mode is on: On persist mode hwec is always enabled.
Definition: libsangoma.c:2254
int _LIBSNG_CALL sangoma_read_event(sng_fd_t fd, wanpipe_api_t *tdm_api)
Read API Events.
Definition: libsangoma.c:2426
sangoma_status_t _LIBSNG_CALL sangoma_hwec_get_chip_image_info(sng_fd_t fd, int *hwec_api_return_code, wanec_chip_image_t *wanec_chip_image, int verbose)
Get information about Firmware Image of EC chip.
enum _sangoma_wait_obj_type sangoma_wait_obj_type_t
Wait object type definition.
int _LIBSNG_CALL sangoma_port_led_ctrl(sng_fd_t fd, unsigned char led_ctrl)
Control the LED ligths of the TDM port. On (led set based on link status) Off (turn off all led)...
Definition: libsangoma.c:3068
sangoma_status_t _LIBSNG_CALL sangoma_logger_reset_statistics(sng_fd_t fd, wp_logger_cmd_t *logger_cmd)
Reset Wanpipe Logger statistics.
Definition: libsangoma.c:2574
sangoma_status_t _LIBSNG_CALL sangoma_hwec_audio_buffer_load(char *device_name, char *filename, char pcmlaw, int *out_buffer_id)
Load audio buffer to EC chip. The buffer can be played out using the sangoma_hwec_audio_buffer_playou...
int _LIBSNG_CALL sangoma_mgmt_cmd(sng_fd_t fd, wan_udp_hdr_t *wan_udp)
Execute Sangoma Management Command.
int _LIBSNG_CALL sangoma_tdm_enable_rxhook_events(sng_fd_t fd, wanpipe_api_t *tdm_api)
Enable RX HOOK Events (Analog Only)
Definition: libsangoma.c:2676
sng_fd_t _LIBSNG_CALL sangoma_open_driver_ctrl(int port_no)
Open a Global Driver Control Device.
int _LIBSNG_CALL sangoma_set_rm_tx_gain(sng_fd_t fd, wanpipe_api_t *tdm_api, int value)
set tx gain for FXO/FXS module
Definition: libsangoma.c:3317
sng_fd_t _LIBSNG_CALL sangoma_wait_obj_get_fd(sangoma_wait_obj_t *sng_wait_obj)
Get fd device file descriptor which was the &#39;fd&#39; parameter for sangoma_wait_obj_create(), not useful for generic objects.
Definition: libsangoma.c:1382
int _LIBSNG_CALL sangoma_get_aft_customer_id(sng_fd_t fd, unsigned char *out_customer_id)
Get Customer-specific ID from AFT hardware, the default value is 0xFF, any change requires special ar...
Definition: libsangoma.c:3044
WANPIPE(tm) Driver API Headers and Defines.
int _LIBSNG_CALL sangoma_tdm_get_usr_period(sng_fd_t fd, wanpipe_api_t *tdm_api)
Get Tx/Rx Period in Milliseconds.
Definition: libsangoma.c:2142
sangoma_status_t _LIBSNG_CALL sangoma_hwec_get_global_chip_statistics(sng_fd_t fd, int *hwec_api_return_code, wanec_chip_stats_t *wanec_chip_stats, int verbose, int reset)
Get Global statistics from EC chip.
int _LIBSNG_CALL sangoma_set_rx_queue_sz(sng_fd_t fd, wanpipe_api_t *tdm_api, int size)
Get Tx Queue Size for this channel.
Definition: libsangoma.c:2969
int _LIBSNG_CALL sangoma_tdm_get_power_level(sng_fd_t fd, wanpipe_api_t *tdm_api)
Get Configured Power Level.
Definition: libsangoma.c:2313
sangoma_status_t _LIBSNG_CALL sangoma_hwec_audio_buffer_playout(char *device_name, unsigned int fe_chan_map, unsigned char port, int in_buffer_id, int start, int repeat_cnt, int duration)
Start playing out an audio buffer previously loaded by sangoma_hwec_audio_buffer_load().
int _LIBSNG_CALL sangoma_tdm_disable_loop(sng_fd_t fd, wanpipe_api_t *tdm_api)
Disable channel loop.
Definition: libsangoma.c:3378
int _LIBSNG_CALL sangoma_get_link_status(sng_fd_t fd, wanpipe_api_t *tdm_api, unsigned char *current_status)
Get Device Link Status (Connected/Disconnected)
Definition: libsangoma.c:2876
int _LIBSNG_CALL sangoma_writemsg(sng_fd_t fd, void *hdrbuf, int hdrlen, void *databuf, unsigned short datalen, int flag)
Write Data to device.
Definition: libsangoma.c:1913
sng_fd_t _LIBSNG_CALL sangoma_open_api_ctrl(void)
Open a Global Control Device.
Definition: libsangoma.c:1750
int _LIBSNG_CALL sangoma_get_firmware_version(sng_fd_t fd, wanpipe_api_t *tdm_api, unsigned char *ver)
Get Hardware/Firmware Version.
Definition: libsangoma.c:3004
int _LIBSNG_CALL sangoma_cmd_exec(sng_fd_t fd, wanpipe_api_t *tdm_api)
Execute Sangoma API Command.
Definition: libsangoma.c:2004
int _LIBSNG_CALL sangoma_tdm_txsig_onhook(sng_fd_t fd, wanpipe_api_t *tdm_api)
Tranmsmit TX SIG ON HOOK (Analog Only)
Definition: libsangoma.c:2776
sangoma_status_t _LIBSNG_CALL sangoma_hwec_config_channel_parameter(char *device_name, char *parameter, char *parameter_value, unsigned int channel_map)
Modify channel configuration parameters.
Generic object that can be signaled but is not associated to any sangoma device.
Definition: libsangoma.h:369
int _LIBSNG_CALL sangoma_set_tx_queue_sz(sng_fd_t fd, wanpipe_api_t *tdm_api, int size)
Get Tx Queue Size for this channel.
Definition: libsangoma.c:2939
int _LIBSNG_CALL sangoma_interface_toi(char *interface_name, int *span, int *chan)
Convert Span &amp; Chan to interface name.
Definition: libsangoma.c:1577
int _LIBSNG_CALL sangoma_tdm_enable_dtmf_events(sng_fd_t fd, wanpipe_api_t *tdm_api)
Enable DTMF Detection on Octasic chip (if hw supports it)
Definition: libsangoma.c:2636
int _LIBSNG_CALL sangoma_flush_event_bufs(sng_fd_t fd, wanpipe_api_t *tdm_api)
Flush only event buffers from current channel.
Definition: libsangoma.c:2353
int _LIBSNG_CALL sangoma_tdm_disable_rm_dtmf_events(sng_fd_t fd, wanpipe_api_t *tdm_api)
Disable DTMF Detection on Analog/Remora SLIC Chip.
Definition: libsangoma.c:2666
int sng_fd_t
Windows/Unix file handle abstraction.
sangoma_status_t _LIBSNG_CALL sangoma_logger_get_open_handle_counter(sng_fd_t fd, wp_logger_cmd_t *logger_cmd)
Get Counter of open Handles/File Descriptors of Wanpipe Logger.
Definition: libsangoma.c:2580
int _LIBSNG_CALL sangoma_tdm_disable_fax_events(sng_fd_t fd, wanpipe_api_t *tdm_api)
Disable FAX Detection on Octasic chip (if hw supports it)
Definition: libsangoma.c:2611
int _LIBSNG_CALL sangoma_tdm_set_power_level(sng_fd_t fd, wanpipe_api_t *tdm_api, int power)
Set Power Level - so only data matching the power level would be passed up.
Definition: libsangoma.c:2298
int _LIBSNG_CALL sangoma_tdm_set_usr_period(sng_fd_t fd, wanpipe_api_t *tdm_api, int period)
Set Tx/Rx Period in Milliseconds.
Definition: libsangoma.c:2126
int _LIBSNG_CALL sangoma_flush_tx_bufs(sng_fd_t fd, wanpipe_api_t *tdm_api)
Flush only tx buffers from current channel.
Definition: libsangoma.c:2345
sangoma_status_t _LIBSNG_CALL sangoma_hwec_print_statistics(char *device_name, int full, unsigned int fe_chan)
Read and print Chip/Channel statistics from EC chip.
Sangoma object associated to some device which cannot be signaled (cannot call sangoma_wait_obj_signa...
Definition: libsangoma.h:371
int _LIBSNG_CALL sangoma_tdm_disable_ring_trip_detect_events(sng_fd_t fd, wanpipe_api_t *tdm_api)
Disable RING TRIP Events (Analog Only)
Definition: libsangoma.c:2746
int HANDLE
file handle type int, Ported from Windows
Definition: libsangoma.h:258
int _LIBSNG_CALL sangoma_span_chan_fromif(char *interface_name, int *span, int *chan)
Convert Interace Name to Span &amp; Chan.
Definition: libsangoma.c:1640
sangoma_status_t _LIBSNG_CALL sangoma_logger_flush_buffers(sng_fd_t fd, wp_logger_cmd_t *logger_cmd)
Flush Wanpipe Logger internal buffers.
Definition: libsangoma.c:2562
int _LIBSNG_CALL sangoma_driver_port_get_config(sng_fd_t fd, port_cfg_t *port_cfg, unsigned short port_no)
Retrieve Port&#39;s &quot;Volatile&quot; configuration.
sng_fd_t _LIBSNG_CALL sangoma_open_api_span_chan(int span, int chan)
Open a Device based on Span/Chan values.
Definition: libsangoma.c:1682
Sangoma object that is associated to a device AND can be signaled.
Definition: libsangoma.h:373
Wanpipe UDP Structure used for Maintenance and Debugging.
Definition: wanpipe_api.h:92
int _LIBSNG_CALL sangoma_get_rx_queue_sz(sng_fd_t fd, wanpipe_api_t *tdm_api)
Get Rx Queue Size for this channel.
Definition: libsangoma.c:2951
TDM API channel statistics.
int _LIBSNG_CALL sangoma_tdm_enable_ring_detect_events(sng_fd_t fd, wanpipe_api_t *tdm_api)
Enable RING DETECT Events (Analog Only)
Definition: libsangoma.c:2716
int _LIBSNG_CALL sangoma_tdm_enable_tone_events(sng_fd_t fd, wanpipe_api_t *tdm_api, uint16_t tone_id)
Transmit a TONE on this device (Analog Only)
Definition: libsangoma.c:2796
int32_t sangoma_status_t
return status from sangoma APIs
Definition: libsangoma.h:338
int _LIBSNG_CALL sangoma_tdm_enable_ring_trip_detect_events(sng_fd_t fd, wanpipe_api_t *tdm_api)
Enable RING TRIP Events (Analog Only)
Definition: libsangoma.c:2736
int _LIBSNG_CALL sangoma_tdm_disable_rbs_events(sng_fd_t fd, wanpipe_api_t *tdm_api)
Disable RBS Events for a device.
Definition: libsangoma.c:2370
sangoma_status_t _LIBSNG_CALL sangoma_hwec_config_power_on(char *device_name, unsigned int fe_chan_map)
Set the channel state in the echo canceller to NORMAL/POWER ON. This enables echo cancelation logic i...
int _LIBSNG_CALL sangoma_readmsg(sng_fd_t fd, void *hdrbuf, int hdrlen, void *databuf, int datalen, int flag)
Read Data from device.
Definition: libsangoma.c:1842
int _LIBSNG_CALL sangoma_set_rm_rxflashtime(sng_fd_t fd, wanpipe_api_t *tdm_api, int rxflashtime)
Set rxflashtime for FXS module Wink-Flash Event.
Definition: libsangoma.c:3307
int _LIBSNG_CALL sangoma_fe_reg_write(sng_fd_t fd, uint32_t offset, uint8_t data)
Write to a front end register.
Definition: libsangoma.c:3092
int _LIBSNG_CALL sangoma_tdm_write_rbs(sng_fd_t fd, wanpipe_api_t *tdm_api, int channel, unsigned char rbs)
Write RBS Bits on a device.
Definition: libsangoma.c:2378
int _LIBSNG_CALL sangoma_tdm_get_hw_ec(sng_fd_t fd, wanpipe_api_t *tdm_api)
Check if hw echo cancelation support is available.
Definition: libsangoma.c:2205
int start(sangoma_interface *sang_if)
Run the main sangoma interface hanlder code.
Definition: sample.cpp:153
int _LIBSNG_CALL sangoma_tdm_enable_rm_dtmf_events(sng_fd_t fd, wanpipe_api_t *tdm_api)
Enable DTMF Detection on Analog/Remora SLIC Chip.
Definition: libsangoma.c:2656
int _LIBSNG_CALL sangoma_tdm_read_rbs(sng_fd_t fd, wanpipe_api_t *tdm_api, int channel, unsigned char *rbs)
Read RBS Bits on a device.
Definition: libsangoma.c:2387
sangoma_status_t _LIBSNG_CALL sangoma_wait_obj_create(sangoma_wait_obj_t **sangoma_wait_object, sng_fd_t fd, sangoma_wait_obj_type_t object_type)
Create a wait object that will be used with sangoma_waitfor_many() API.
Definition: libsangoma.c:1239
#define _LIBSNG_CALL
Not used in Linux.
Definition: libsangoma.h:185
sangoma_status_t _LIBSNG_CALL sangoma_logger_get_statistics(sng_fd_t fd, wp_logger_cmd_t *logger_cmd)
Get Wanpipe Logger statistics.
Definition: libsangoma.c:2568
int _LIBSNG_CALL sangoma_tdm_enable_hwec(sng_fd_t fd, wanpipe_api_t *tdm_api)
Enable HWEC on this channel.
Definition: libsangoma.c:2819
int _LIBSNG_CALL sangoma_tdm_disable_tone_events(sng_fd_t fd, wanpipe_api_t *tdm_api)
Enable TONE Events (Analog Only)
Definition: libsangoma.c:2807
int _LIBSNG_CALL sangoma_interface_wait_up(int span, int chan, int sectimeout)
Wait for a sangoma device to come up (ie: Linux wait for /dev/wanpipex_1 to come up) ...
Definition: libsangoma.c:1608
int _LIBSNG_CALL sangoma_tdm_get_codec(sng_fd_t fd, wanpipe_api_t *tdm_api)
Get Configured TDM Codec per chan.
Definition: libsangoma.c:2103
int _LIBSNG_CALL sangoma_set_fe_status(sng_fd_t fd, wanpipe_api_t *tdm_api, unsigned char new_status)
Set Device Link Status (Connected/Disconnected)
Definition: libsangoma.c:2890
int _LIBSNG_CALL sangoma_tdm_get_hw_dtmf(sng_fd_t fd, wanpipe_api_t *tdm_api)
Check if hwdtmf support is available.
Definition: libsangoma.c:2185
int _LIBSNG_CALL sangoma_driver_hw_rescan(sng_fd_t fd, port_management_struct_t *port_mgmnt, int *cnt)
Rescan the pci and usb bus for newly added hardware.
wp_api_hdr_t sangoma_api_hdr_t
Backward comaptible define of wp_api_hdr_t.
Definition: libsangoma.h:356
int _LIBSNG_CALL sangoma_get_hw_coding(sng_fd_t fd, wanpipe_api_t *tdm_api)
Get HW Voice Coding (ulaw/alaw)
Definition: libsangoma.c:2164
int _LIBSNG_CALL sangoma_driver_get_hw_info(sng_fd_t fd, port_management_struct_t *port_mgmnt, unsigned short port_no)
Retrieve information about a single instance of Sangoma hardware.
int _LIBSNG_CALL sangoma_tdm_get_hwec_chan_status(sng_fd_t fd, wanpipe_api_t *tdm_api)
Check if hw echo cancelation is enabled on current timeslot.
Definition: libsangoma.c:2228
int _LIBSNG_CALL sangoma_tdm_txsig_offhook(sng_fd_t fd, wanpipe_api_t *tdm_api)
Tranmsmit TX SIG OFF HOOK (Analog Only)
Definition: libsangoma.c:2786
sangoma_status_t _LIBSNG_CALL sangoma_hwec_config_init(char *device_name, wan_custom_param_t custom_params[], unsigned int number_of_custom_params)
Load Firmware image onto EC chip and allocated per-port resources in HWEC API. All chip-wide configur...
WANPIPE(tm) Driver API Interface -.
int _LIBSNG_CALL sangoma_get_fe_status(sng_fd_t fd, wanpipe_api_t *tdm_api, unsigned char *current_status)
Get Device Link Status (Connected/Disconnected)
Definition: libsangoma.c:2860
int _LIBSNG_CALL sangoma_tdm_disable_ring_events(sng_fd_t fd, wanpipe_api_t *tdm_api)
Disable RING Events (Analog Only)
Definition: libsangoma.c:2706
int _LIBSNG_CALL sangoma_get_open_cnt(sng_fd_t fd, wanpipe_api_t *tdm_api)
Get device open count.
Definition: libsangoma.c:1762
char TCHAR
TCHAN type mapped to char, Ported from Windows.
Definition: libsangoma.h:260
sangoma_status_t _LIBSNG_CALL sangoma_logger_set_logger_level(sng_fd_t fd, wp_logger_cmd_t *logger_cmd)
Set current level (types of events) of Wanpipe Logger.
Definition: libsangoma.c:2592
deprecated, use SANGOMA_GENERIC_WAIT_OBJ
Definition: libsangoma.h:367
int _LIBSNG_CALL sangoma_tdm_disable_ring_detect_events(sng_fd_t fd, wanpipe_api_t *tdm_api)
Disable RING DETECT Events (Analog Only)
Definition: libsangoma.c:2726
int DWORD
DWORD type is int, Ported from Windows.
Definition: libsangoma.h:259
int _LIBSNG_CALL sangoma_get_stats(sng_fd_t fd, wanpipe_api_t *tdm_api, wanpipe_chan_stats_t *stats)
Get Device Statistics. Statistics will be available in tdm_api-&gt;wp_cmd.stats structure.
Definition: libsangoma.c:3281
int _LIBSNG_CALL sangoma_clear_tx_gain(sng_fd_t fd, wanpipe_api_t *tdm_api)
Clear tx gain from device, set it to 0.0.
WANPIPE(tm) Driver API - Provides FULL Wanpipe Driver API Support.
int _LIBSNG_CALL sangoma_tdm_set_codec(sng_fd_t fd, wanpipe_api_t *tdm_api, int codec)
Set TDM Codec per chan.
Definition: libsangoma.c:2082
Wanpipe API Command Structure.
sangoma_status_t _LIBSNG_CALL sangoma_hwec_config_verbosity(int verbosity_level)
Set Verbosity level of EC API Driver and Library. The level controls amount of data printed to stdout...
int _LIBSNG_CALL sangoma_clear_rx_gain(sng_fd_t fd, wanpipe_api_t *tdm_api)
Clear rx gain from device, set it to 0.0.
int _LIBSNG_CALL sangoma_span_chan_toif(int span, int chan, char *interface_name)
Convert Span &amp; Chan to interface name.
Definition: libsangoma.c:1566
int _LIBSNG_CALL sangoma_enable_bri_bchan_loopback(sng_fd_t fd, wanpipe_api_t *tdm_api, int channel)
Enable BRI Bchannel loopback - used when debugging bri device.
Definition: libsangoma.c:2911
int _LIBSNG_CALL sangoma_tdm_txsig_kewl(sng_fd_t fd, wanpipe_api_t *tdm_api)
Tranmsmit TX SIG KEWL START (Analog Only)
Definition: libsangoma.c:2756
void _LIBSNG_CALL sangoma_hwec_initialize_custom_parameter_structure(wan_custom_param_t *custom_param, char *parameter_name, char *parameter_value)
Initialize Custom Paramter structure.
sangoma_status_t _LIBSNG_CALL sangoma_wait_obj_delete(sangoma_wait_obj_t **sangoma_wait_object)
De-allocate all resources in a wait object.
Definition: libsangoma.c:1320
void _LIBSNG_CALL sangoma_close(sng_fd_t *fd)
Close device file descriptor.
Definition: libsangoma.c:1818
int _LIBSNG_CALL sangoma_get_tx_queue_sz(sng_fd_t fd, wanpipe_api_t *tdm_api)
Get Tx Queue Size for this channel.
Definition: libsangoma.c:2922
sng_fd_t _LIBSNG_CALL sangoma_open_dev_by_name(const char *dev_name)
Open API device using it&#39;s name. For example: Linux: w1g1, Windows wanpipe1_if1.
Definition: libsangoma.c:1717
int _LIBSNG_CALL sangoma_tdm_get_fe_alarms(sng_fd_t fd, wanpipe_api_t *tdm_api, unsigned int *alarms)
Get Front End Alarms (T1/E1 Only)
Definition: libsangoma.c:2841
int _LIBSNG_CALL sangoma_ss7_force_rx(sng_fd_t fd, wanpipe_api_t *tdm_api)
Force the firmware to pass up a repeating frame.
Definition: libsangoma.c:3400
PVOID _LIBSNG_CALL sangoma_wait_obj_get_context(sangoma_wait_obj_t *sng_wait_obj)
Retrieve the user context (if any) that was set via sangoma_wait_obj_set_context. ...
Definition: libsangoma.c:1406
sng_fd_t _LIBSNG_CALL sangoma_logger_open(void)
Open a Global Logger Device.
Definition: libsangoma.c:1756
int _LIBSNG_CALL sangoma_tdm_enable_fax_events(sng_fd_t fd, wanpipe_api_t *tdm_api)
Enable FAX Detection on Octasic chip (if hw supports it)
Definition: libsangoma.c:2601
sng_fd_t _LIBSNG_CALL sangoma_create_socket_by_name(char *device, char *card)
Open a device based on a interface and card name.
Definition: libsangoma.c:1778
int _LIBSNG_CALL sangoma_tdm_enable_loop(sng_fd_t fd, wanpipe_api_t *tdm_api)
Enable channel loop: All rx data will be transmitted back out.
Definition: libsangoma.c:3367
int _LIBSNG_CALL sangoma_tdm_txsig_start(sng_fd_t fd, wanpipe_api_t *tdm_api)
Tranmsmit TX SIG START (Analog Only)
Definition: libsangoma.c:2766
sangoma_status_t _LIBSNG_CALL sangoma_hwec_enable(char *device_name, unsigned int fe_chan_map)
Redirect audio stream from AFT FPGA to EC chip. This command effectively enables echo cancellation si...
int _LIBSNG_CALL sangoma_driver_get_version(sng_fd_t fd, port_management_struct_t *port_mgmnt, unsigned short port_no)
Retrieve Driver Version BEFORE any communication interface is configured and sangoma_get_driver_versi...
int _LIBSNG_CALL sangoma_tdm_enable_rbs_events(sng_fd_t fd, wanpipe_api_t *tdm_api, int poll_in_sec)
Enable RBS Events on a device.
Definition: libsangoma.c:2361
Wanpipe API Header Structure.
sangoma_status_t _LIBSNG_CALL sangoma_logger_read_event(sng_fd_t fd, wp_logger_cmd_t *logger_cmd)
Read Wanpipe Logger Events.
Definition: libsangoma.c:2556
int _LIBSNG_CALL sangoma_tdm_get_usr_mtu_mru(sng_fd_t fd, wanpipe_api_t *tdm_api)
Get Tx/Rx MTU/MRU in bytes.
Definition: libsangoma.c:2276
int _LIBSNG_CALL sangoma_tdm_get_hw_fax(sng_fd_t fd, wanpipe_api_t *tdm_api)
Get HW FAX Detection State (Enable or Disabled) on Octasic chip (if hw supports it) ...
Definition: libsangoma.c:2621
int _LIBSNG_CALL sangoma_driver_port_stop(sng_fd_t fd, port_management_struct_t *port_mgmnt, unsigned short port_no)
Start a Port, create Sangoma Communication interfaces.
int _LIBSNG_CALL sangoma_tdm_set_buffer_multiplier(sng_fd_t fd, wanpipe_api_t *tdm_api, unsigned int multiplier)
Set voice tx/rx buffer multiplier.
Definition: libsangoma.c:2406
int _LIBSNG_CALL sangoma_fe_reg_read(sng_fd_t fd, uint32_t offset, uint8_t *data)
Read front end register.
Definition: libsangoma.c:3134
int _LIBSNG_CALL sangoma_ss7_get_cfg_status(sng_fd_t fd, wanpipe_api_t *tdm_api, wan_api_ss7_cfg_status_t *ss7_cfg_status)
Get current ss7 hw configuration.
Definition: libsangoma.c:3410
int _LIBSNG_CALL sangoma_driver_port_start(sng_fd_t fd, port_management_struct_t *port_mgmnt, unsigned short port_no)
Start a Port, create Sangoma Communication interfaces.
sangoma_status_t _LIBSNG_CALL sangoma_hwec_config_tone_detection(char *device_name, int tone_id, int enable, unsigned int fe_chan_map, unsigned char port_map)
Enable/Disable tone detection (such as DTMF) of channels from channel map.
int _LIBSNG_CALL sangoma_get_cpld_version(sng_fd_t fd, wanpipe_api_t *tdm_api, unsigned char *ver)
Get AFT CPLD Version.
Definition: libsangoma.c:3024
int _LIBSNG_CALL sangoma_flush_bufs(sng_fd_t fd, wanpipe_api_t *tdm_api)
Flush all (tx/rx/event) buffers from current channel.
Definition: libsangoma.c:2329
int _LIBSNG_CALL sangoma_tdm_disable_hwec(sng_fd_t fd, wanpipe_api_t *tdm_api)
Disable HWEC on this channel.
Definition: libsangoma.c:2827
int _LIBSNG_CALL sangoma_tdm_disable_dtmf_events(sng_fd_t fd, wanpipe_api_t *tdm_api)
Disable DTMF Detection on Octasic chip (if hw supports it)
Definition: libsangoma.c:2646
int _LIBSNG_CALL sangoma_set_rm_rx_gain(sng_fd_t fd, wanpipe_api_t *tdm_api, int value)
set rx gain for FXO/FXS module
Definition: libsangoma.c:3328
int _LIBSNG_CALL sangoma_flush_rx_bufs(sng_fd_t fd, wanpipe_api_t *tdm_api)
Flush only rx buffers from current channel.
Definition: libsangoma.c:2337