60 #define WANPIPE_TDM_API 1
68 #define LIBSANGOMA_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + (c))
74 #define LIBSANGOMA_VERSION_CODE LIBSANGOMA_VERSION(3,3,0)
81 #define LIBSANGOMA_VERSION_STR "3.3.0"
83 #define WP_API_FEATURE_ANALOG_STATS 1
85 struct sangoma_wait_obj;
86 #define sangoma_wait_obj_t struct sangoma_wait_obj
99 #define SANGOMA_DECLARE_TDM_API_CMD(_name_) wanpipe_api_t _name_
101 #define SANGOMA_INIT_TDM_API_CMD(_name_) memset(&_name_,0,sizeof(_name_)); \
102 SANGOMA_INIT_TDM_API_CMD_RESULT(_name_)
104 #define SANGOMA_INIT_TDM_API_CMD_RESULT(_name_) (_name_).wp_cmd.result = SANG_STATUS_GENERAL_ERROR
106 #define SANGOMA_DECLARE_INIT_TDM_API_CMD(_name_) wanpipe_tdm_api_t _name_; SANGOMA_INIT_TDM_API_CMD(_name_);
109 #if defined(WIN32) || defined(WIN64)
114 #include <winioctl.h>
124 #ifdef __COMPILING_LIBSANGOMA__
125 # define _LIBSNG_CALL __declspec(dllexport) __cdecl
127 # ifdef __LIBSANGOMA_IS_STATIC_LIB__
129 # define _LIBSNG_CALL __cdecl
132 # define _LIBSNG_CALL __declspec(dllimport) __cdecl
140 #define SANGOMA_INFINITE_API_POLL_WAIT INFINITE
141 #define SANGOMA_WAIT_INFINITE INFINITE
147 #define sangoma_msleep(x) Sleep(x)
154 #define sangoma_ctime(time) _ctime64(time)
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>
191 #define INVALID_HANDLE_VALUE -1
197 #define SANGOMA_INFINITE_API_POLL_WAIT -1
198 #define SANGOMA_WAIT_INFINITE -1
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
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;
275 typedef pthread_mutex_t CRITICAL_SECTION;
277 #define EnterCriticalSection(arg) pthread_mutex_lock(arg)
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);
283 typedef struct tm SYSTEMTIME;
284 typedef char * LPCTSTR;
291 #define sangoma_ctime(time) ctime((time_t*)time)
307 #ifdef LIBSANGOMA_LIGHT
310 #include "sdla_te1.h"
311 #include "wanpipe_events.h"
312 #include "wanpipe_api_deprecated.h"
316 #ifdef WP_API_FEATURE_LIBSNG_HWEC
317 # include "wanpipe_events.h"
318 # include "wanec_api.h"
319 # include "wanec_iface_api.h"
325 #include "wanpipe_kernel.h"
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
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!"
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
393 } sangoma_wait_obj_flags_t;
432 #define __sangoma_open_tdmapi_span_chan __sangoma_open_api_span_chan
464 #ifndef LIBSANGOMA_TDMAPI_CTRL
465 #define LIBSANGOMA_TDMAPI_CTRL 1
542 void *databuf,
unsigned short datalen,
int flag);
560 void *databuf,
int datalen,
int flag);
576 sangoma_status_t
_LIBSNG_CALL sangoma_waitfor(sangoma_wait_obj_t *sangoma_wait_obj, uint32_t inflags, uint32_t *outflags, int32_t timeout);
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);
634 void _LIBSNG_CALL sangoma_wait_obj_set_context(sangoma_wait_obj_t *sangoma_wait_object,
void *context);
805 #ifdef WP_API_FEATURE_FAX_EVENTS
1056 #ifdef WP_API_FEATURE_LINK_STATUS
1057 # ifndef LIBSANGOMA_GET_LINKSTATUS
1062 # define LIBSANGOMA_GET_LINKSTATUS 1
1079 #ifndef LIBSANGOMA_GET_FESTATUS
1084 #define LIBSANGOMA_GET_FESTATUS 1
1099 #ifdef WP_API_FEATURE_BUFFER_MULT
1176 #ifndef LIBSANGOMA_GET_HWCODING
1181 #define LIBSANGOMA_GET_HWCODING 1
1195 #ifndef LIBSANGOMA_GET_HWDTMF
1200 #define LIBSANGOMA_GET_HWDTMF 1
1225 #ifdef WP_API_FEATURE_EC_CHAN_STAT
1241 #ifdef WP_API_FEATURE_HWEC_PERSIST
1327 #ifdef WP_API_FEATURE_LED_CTRL
1342 #ifdef WP_API_FEATURE_FE_RW
1395 #ifdef WP_API_FEATURE_RM_GAIN
1441 #ifdef WP_API_FEATURE_LOOP
1479 #ifdef WP_API_FEATURE_LOGGER
1481 sangoma_status_t
_LIBSNG_CALL sangoma_logger_cmd_exec(
sng_fd_t fd, wp_logger_cmd_t *logger_cmd);
1553 #ifdef WP_API_FEATURE_DRIVER_GAIN
1593 #ifndef LIBSANGOMA_LIGHT
1701 #ifdef WP_API_FEATURE_HARDWARE_RESCAN
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);
1759 #ifndef LIBSANGOMA_SET_FESTATUS
1764 #define LIBSANGOMA_SET_FESTATUS 1
1856 #ifdef WP_API_FEATURE_LIBSNG_HWEC
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);
2152 sangoma_status_t
_LIBSNG_CALL sangoma_hwec_audio_buffer_unload(
char *device_name,
int in_buffer_id);
2180 unsigned char port,
int in_buffer_id,
int start,
2181 int repeat_cnt,
int duration);
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);
2254 int *hwec_api_return_code, wanec_chip_stats_t *wanec_chip_stats,
int verbose,
int reset);
2274 int *hwec_api_return_code, wanec_chip_image_t *wanec_chip_image,
int verbose);
2276 #ifdef WP_API_FEATURE_LIBSNG_HWEC_DTMF_REMOVAL
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);
2303 #ifdef WP_API_FEATURE_SS7_FORCE_RX
2314 #ifdef WP_API_FEATURE_SS7_CFG_STATUS
2332 #if defined(__WINDOWS__)
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
sng_fd_t _LIBSNG_CALL __sangoma_open_api_span_chan(int span, int chan)
Open a Device based on Span/Chan values.
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.
int _LIBSNG_CALL sangoma_driver_port_set_config(sng_fd_t fd, port_cfg_t *port_cfg, unsigned short port_no)
Set Port's "Volatile" 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.
int _LIBSNG_CALL sangoma_tdm_disable_rxhook_events(sng_fd_t fd, wanpipe_api_t *tdm_api)
Disable RX HOOK Events (Analog Only)
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)
int _LIBSNG_CALL sangoma_flush_stats(sng_fd_t fd, wanpipe_api_t *tdm_api)
Flush/Reset device statistics.
int _LIBSNG_CALL sangoma_get_full_cfg(sng_fd_t fd, wanpipe_api_t *tdm_api)
Read tdm api device configuration.
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.
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.
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.
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.
int _LIBSNG_CALL sangoma_read_event(sng_fd_t fd, wanpipe_api_t *tdm_api)
Read API Events.
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)...
sangoma_status_t _LIBSNG_CALL sangoma_logger_reset_statistics(sng_fd_t fd, wp_logger_cmd_t *logger_cmd)
Reset Wanpipe Logger statistics.
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)
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
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 'fd' parameter for sangoma_wait_obj_create(), not useful for generic objects.
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...
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.
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.
int _LIBSNG_CALL sangoma_tdm_get_power_level(sng_fd_t fd, wanpipe_api_t *tdm_api)
Get Configured Power Level.
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.
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)
int _LIBSNG_CALL sangoma_writemsg(sng_fd_t fd, void *hdrbuf, int hdrlen, void *databuf, unsigned short datalen, int flag)
Write Data to device.
sng_fd_t _LIBSNG_CALL sangoma_open_api_ctrl(void)
Open a Global Control Device.
int _LIBSNG_CALL sangoma_get_firmware_version(sng_fd_t fd, wanpipe_api_t *tdm_api, unsigned char *ver)
Get Hardware/Firmware Version.
int _LIBSNG_CALL sangoma_cmd_exec(sng_fd_t fd, wanpipe_api_t *tdm_api)
Execute Sangoma API Command.
int _LIBSNG_CALL sangoma_tdm_txsig_onhook(sng_fd_t fd, wanpipe_api_t *tdm_api)
Tranmsmit TX SIG ON HOOK (Analog Only)
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.
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.
int _LIBSNG_CALL sangoma_interface_toi(char *interface_name, int *span, int *chan)
Convert Span & Chan to interface name.
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)
int _LIBSNG_CALL sangoma_flush_event_bufs(sng_fd_t fd, wanpipe_api_t *tdm_api)
Flush only event buffers from current channel.
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.
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.
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)
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.
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.
int _LIBSNG_CALL sangoma_flush_tx_bufs(sng_fd_t fd, wanpipe_api_t *tdm_api)
Flush only tx buffers from current channel.
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...
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)
int HANDLE
file handle type int, Ported from Windows
int _LIBSNG_CALL sangoma_span_chan_fromif(char *interface_name, int *span, int *chan)
Convert Interace Name to Span & Chan.
sangoma_status_t _LIBSNG_CALL sangoma_logger_flush_buffers(sng_fd_t fd, wp_logger_cmd_t *logger_cmd)
Flush Wanpipe Logger internal buffers.
int _LIBSNG_CALL sangoma_driver_port_get_config(sng_fd_t fd, port_cfg_t *port_cfg, unsigned short port_no)
Retrieve Port's "Volatile" configuration.
sng_fd_t _LIBSNG_CALL sangoma_open_api_span_chan(int span, int chan)
Open a Device based on Span/Chan values.
Sangoma object that is associated to a device AND can be signaled.
Wanpipe UDP Structure used for Maintenance and Debugging.
int _LIBSNG_CALL sangoma_get_rx_queue_sz(sng_fd_t fd, wanpipe_api_t *tdm_api)
Get Rx Queue Size for this channel.
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)
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)
int32_t sangoma_status_t
return status from sangoma APIs
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)
int _LIBSNG_CALL sangoma_tdm_disable_rbs_events(sng_fd_t fd, wanpipe_api_t *tdm_api)
Disable RBS Events for a device.
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.
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.
int _LIBSNG_CALL sangoma_fe_reg_write(sng_fd_t fd, uint32_t offset, uint8_t data)
Write to a front end register.
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.
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.
int start(sangoma_interface *sang_if)
Run the main sangoma interface hanlder code.
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.
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.
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.
#define _LIBSNG_CALL
Not used in Linux.
sangoma_status_t _LIBSNG_CALL sangoma_logger_get_statistics(sng_fd_t fd, wp_logger_cmd_t *logger_cmd)
Get Wanpipe Logger statistics.
int _LIBSNG_CALL sangoma_tdm_enable_hwec(sng_fd_t fd, wanpipe_api_t *tdm_api)
Enable HWEC on this channel.
int _LIBSNG_CALL sangoma_tdm_disable_tone_events(sng_fd_t fd, wanpipe_api_t *tdm_api)
Enable TONE Events (Analog Only)
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) ...
int _LIBSNG_CALL sangoma_tdm_get_codec(sng_fd_t fd, wanpipe_api_t *tdm_api)
Get Configured TDM Codec per chan.
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)
int _LIBSNG_CALL sangoma_tdm_get_hw_dtmf(sng_fd_t fd, wanpipe_api_t *tdm_api)
Check if hwdtmf support is available.
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.
int _LIBSNG_CALL sangoma_get_hw_coding(sng_fd_t fd, wanpipe_api_t *tdm_api)
Get HW Voice Coding (ulaw/alaw)
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.
int _LIBSNG_CALL sangoma_tdm_txsig_offhook(sng_fd_t fd, wanpipe_api_t *tdm_api)
Tranmsmit TX SIG OFF HOOK (Analog Only)
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)
int _LIBSNG_CALL sangoma_tdm_disable_ring_events(sng_fd_t fd, wanpipe_api_t *tdm_api)
Disable RING Events (Analog Only)
int _LIBSNG_CALL sangoma_get_open_cnt(sng_fd_t fd, wanpipe_api_t *tdm_api)
Get device open count.
char TCHAR
TCHAN type mapped to char, Ported from Windows.
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.
deprecated, use SANGOMA_GENERIC_WAIT_OBJ
int _LIBSNG_CALL sangoma_tdm_disable_ring_detect_events(sng_fd_t fd, wanpipe_api_t *tdm_api)
Disable RING DETECT Events (Analog Only)
int DWORD
DWORD type is int, Ported from Windows.
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->wp_cmd.stats structure.
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.
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 & Chan to interface name.
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.
int _LIBSNG_CALL sangoma_tdm_txsig_kewl(sng_fd_t fd, wanpipe_api_t *tdm_api)
Tranmsmit TX SIG KEWL START (Analog Only)
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.
void _LIBSNG_CALL sangoma_close(sng_fd_t *fd)
Close device file descriptor.
int _LIBSNG_CALL sangoma_get_tx_queue_sz(sng_fd_t fd, wanpipe_api_t *tdm_api)
Get Tx Queue Size for this channel.
sng_fd_t _LIBSNG_CALL sangoma_open_dev_by_name(const char *dev_name)
Open API device using it's name. For example: Linux: w1g1, Windows wanpipe1_if1.
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)
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.
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. ...
sng_fd_t _LIBSNG_CALL sangoma_logger_open(void)
Open a Global Logger Device.
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)
sng_fd_t _LIBSNG_CALL sangoma_create_socket_by_name(char *device, char *card)
Open a device based on a interface and card name.
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.
int _LIBSNG_CALL sangoma_tdm_txsig_start(sng_fd_t fd, wanpipe_api_t *tdm_api)
Tranmsmit TX SIG START (Analog Only)
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.
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.
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.
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) ...
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.
int _LIBSNG_CALL sangoma_fe_reg_read(sng_fd_t fd, uint32_t offset, uint8_t *data)
Read front end register.
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.
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.
int _LIBSNG_CALL sangoma_flush_bufs(sng_fd_t fd, wanpipe_api_t *tdm_api)
Flush all (tx/rx/event) buffers from current channel.
int _LIBSNG_CALL sangoma_tdm_disable_hwec(sng_fd_t fd, wanpipe_api_t *tdm_api)
Disable HWEC on this channel.
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)
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
int _LIBSNG_CALL sangoma_flush_rx_bufs(sng_fd_t fd, wanpipe_api_t *tdm_api)
Flush only rx buffers from current channel.