|
libsangoma
1
|
Wanpipe API Library header for Sangoma AFT T1/E1/Analog/BRI/Serial Hardware -. More...
#include <stdio.h>#include <stdlib.h>#include <stdarg.h>#include <ctype.h>#include <unistd.h>#include <sys/time.h>#include <sys/socket.h>#include <sys/ioctl.h>#include <sys/types.h>#include <sys/stat.h>#include <sys/signal.h>#include <sys/select.h>#include <sys/wait.h>#include <sys/resource.h>#include <netinet/in.h>#include <string.h>#include <errno.h>#include <fcntl.h>#include <net/if.h>#include <poll.h>#include <signal.h>#include <pthread.h>#include <stdint.h>#include "wanpipe_api.h"#include "wanpipe_events.h"#include "wanec_api.h"#include "wanec_iface_api.h"

Go to the source code of this file.
Macros | |
| #define | WANPIPE_TDM_API 1 |
| Used by compiler and driver to enable TDM API. | |
| #define | LIBSANGOMA_VERSION(a, b, c) (((a) << 16) + ((b) << 8) + (c)) |
| LibSangoma Macro to check the Version Number. | |
| #define | LIBSANGOMA_VERSION_CODE LIBSANGOMA_VERSION(3,3,0) |
| LibSangoma Current Version Number to be checked against the LIBSANGOMA_VERSION Macro. | |
| #define | LIBSANGOMA_VERSION_STR "3.3.0" |
| LibSangoma Version in string format. | |
| #define | WP_API_FEATURE_ANALOG_STATS 1 |
| #define | sangoma_wait_obj_t struct sangoma_wait_obj |
| #define | SANGOMA_DECLARE_TDM_API_CMD(_name_) wanpipe_api_t _name_ |
| Instantiate/Declare a tdm api cmd strucure. | |
| #define | SANGOMA_INIT_TDM_API_CMD(_name_) |
| Initialize the tdm api cmd structure. Set to 0. More... | |
| #define | SANGOMA_INIT_TDM_API_CMD_RESULT(_name_) (_name_).wp_cmd.result = SANG_STATUS_GENERAL_ERROR |
| Initialize the 'result' in wanpipe_api_t to SANG_STATUS_GENERAL_ERROR. | |
| #define | SANGOMA_DECLARE_INIT_TDM_API_CMD(_name_) wanpipe_tdm_api_t _name_; SANGOMA_INIT_TDM_API_CMD(_name_); |
| Declare and initialize the tdm api cmd structure. | |
| #define | _LIBSNG_CALL |
| Not used in Linux. | |
| #define | INVALID_HANDLE_VALUE -1 |
| Invalid file handle value -1, Ported from Windows. | |
| #define | SANGOMA_INFINITE_API_POLL_WAIT -1 |
| Infinite poll timeout value -1, Ported from Windows. | |
| #define | SANGOMA_WAIT_INFINITE -1 |
| #define | __cdecl |
| Ported from Windows. | |
| #define | FALSE 0 |
| FALSE value is 0, Ported from Windows. | |
| #define | TRUE 1 |
| TRUE value is 1, Ported from Windows. | |
| #define | sangoma_msleep(x) usleep(x*1000) |
| milisecond sleep function | |
| #define | _getch getchar |
| get character, Ported from Windows | |
| #define | Sleep sangoma_msleep |
| milisecond sleep function | |
| #define | _stricmp strcmp |
| _stricmp type mapped to _stricmp, Ported from Windows | |
| #define | _snprintf snprintf |
| _snprintf type mapped to snprintf, Ported from Windows | |
| #define | _vsnprintf vsnprintf |
| #define | EnterCriticalSection(arg) pthread_mutex_lock(arg) |
| #define | TryEnterCriticalSection(arg) (pthread_mutex_trylock(arg)==0 ? 1 : 0) |
| #define | LeaveCriticalSection(arg) pthread_mutex_unlock(arg) |
| #define | InitializeCriticalSection(arg) pthread_mutex_init(arg, NULL); |
| #define | sangoma_ctime(time) ctime((time_t*)time) |
| Convert a time value to a string. More... | |
| #define | FNAME_LEN 100 |
| string length of a file name | |
| #define | LIBSNG_FUNC_DBG() if(0)printf("%s(): line:%d\n", __FUNCTION__, __LINE__) |
| #define | LIBSNG_DBG_PRINT if(0)printf |
| #define | DECODE_SANGOMA_WAIT_OBJECT_TYPE(type) |
| #define | __sangoma_open_tdmapi_span_chan __sangoma_open_api_span_chan |
| #define | LIBSANGOMA_TDMAPI_CTRL 1 |
| Global control device feature. | |
| #define | LIBSANGOMA_GET_LINKSTATUS 1 |
| Get Link Status feature. | |
| #define | LIBSANGOMA_GET_FESTATUS 1 |
| Get Front End Status feature. | |
| #define | LIBSANGOMA_GET_HWCODING 1 |
| Get HW Coding Feature. | |
| #define | LIBSANGOMA_GET_HWDTMF 1 |
| HW DTMF Feature. | |
| #define | LIBSANGOMA_SET_FESTATUS 1 |
| Set Front End Status Feature. | |
| #define | sangoma_open_tdmapi_span_chan sangoma_open_api_span_chan |
| #define | sangoma_open_tdmapi_span sangoma_open_api_span |
| #define | sangoma_open_tdmapi_ctrl sangoma_open_api_ctrl |
| #define | sangoma_tdm_get_fe_status sangoma_get_fe_status |
| #define | sangoma_socket_close sangoma_close |
| #define | sangoma_tdm_get_hw_coding sangoma_get_hw_coding |
| #define | sangoma_tdm_set_fe_status sangoma_set_fe_status |
| #define | sangoma_tdm_get_link_status sangoma_get_link_status |
| #define | sangoma_tdm_flush_bufs sangoma_flush_bufs |
| #define | sangoma_tdm_cmd_exec sangoma_cmd_exec |
| #define | sangoma_tdm_read_event sangoma_read_event |
| #define | sangoma_readmsg_tdm sangoma_readmsg |
| #define | sangoma_readmsg_socket sangoma_readmsg |
| #define | sangoma_sendmsg_socket sangoma_writemsg |
| #define | sangoma_writemsg_tdm sangoma_writemsg |
| #define | sangoma_create_socket_intr sangoma_open_api_span_chan |
| Backward compatible open span chan call. | |
Typedefs | |
| typedef int | HANDLE |
| file handle type int, Ported from Windows | |
| typedef int | DWORD |
| DWORD type is int, Ported from Windows. | |
| typedef char | TCHAR |
| TCHAN type mapped to char, Ported from Windows. | |
| typedef void * | LPTHREAD_START_ROUTINE |
| LPTHREAD_START_ROUTINE type mapped to unsigned char *, Ported from Windows. | |
| typedef pthread_mutex_t | CRITICAL_SECTION |
| typedef struct tm | SYSTEMTIME |
| typedef char * | LPCTSTR |
| typedef int32_t | sangoma_status_t |
| return status from sangoma APIs More... | |
| typedef wp_api_hdr_t | sangoma_api_hdr_t |
| Backward comaptible define of wp_api_hdr_t. | |
| typedef enum _sangoma_wait_obj_type | sangoma_wait_obj_type_t |
| Wait object type definition. | |
|
typedef enum _sangoma_wait_obj_flags | sangoma_wait_obj_flags_t |
Enumerations | |
| enum | _sangoma_wait_obj_type { UNKNOWN_WAIT_OBJ = 0, SANGOMA_GENERIC_WAIT_OBJ = 0, SANGOMA_DEVICE_WAIT_OBJ, SANGOMA_DEVICE_WAIT_OBJ_SIG } |
| enum | _sangoma_wait_obj_flags { SANG_WAIT_OBJ_HAS_INPUT = WP_POLLIN, SANG_WAIT_OBJ_HAS_OUTPUT = WP_POLLOUT, SANG_WAIT_OBJ_HAS_EVENTS = WP_POLLPRI, SANG_WAIT_OBJ_IS_SIGNALED = 0x400 } |
Functions | |
| sng_fd_t _LIBSNG_CALL | sangoma_open_api_span_chan (int span, int chan) |
| Open a Device based on Span/Chan values. More... | |
| sng_fd_t _LIBSNG_CALL | __sangoma_open_api_span_chan (int span, int chan) |
| Open a Device based on Span/Chan values. More... | |
| sng_fd_t _LIBSNG_CALL | sangoma_open_api_span (int span) |
| 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. More... | |
| sng_fd_t _LIBSNG_CALL | sangoma_open_api_ctrl (void) |
| Open a Global Control Device. More... | |
| sng_fd_t _LIBSNG_CALL | sangoma_logger_open (void) |
| Open a Global Logger Device. More... | |
| sng_fd_t _LIBSNG_CALL | sangoma_open_driver_ctrl (int port_no) |
| Open a Global Driver Control Device. More... | |
| void _LIBSNG_CALL | sangoma_close (sng_fd_t *fd) |
| Close device file descriptor. More... | |
| int _LIBSNG_CALL | sangoma_get_open_cnt (sng_fd_t fd, wanpipe_api_t *tdm_api) |
| Get device open count. More... | |
| int _LIBSNG_CALL | sangoma_writemsg (sng_fd_t fd, void *hdrbuf, int hdrlen, void *databuf, unsigned short datalen, int flag) |
| Write Data to device. More... | |
| int _LIBSNG_CALL | sangoma_readmsg (sng_fd_t fd, void *hdrbuf, int hdrlen, void *databuf, int datalen, int flag) |
| Read Data from device. More... | |
| sangoma_status_t _LIBSNG_CALL | sangoma_waitfor (sangoma_wait_obj_t *sangoma_wait_obj, uint32_t inflags, uint32_t *outflags, int32_t timeout) |
| sangoma_status_t _LIBSNG_CALL | sangoma_waitfor_many (sangoma_wait_obj_t *sangoma_wait_objects[], uint32_t in_flags[], uint32_t out_flags[], uint32_t number_of_sangoma_wait_objects, int32_t system_wait_timeout) |
| 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. More... | |
| sangoma_status_t _LIBSNG_CALL | sangoma_wait_obj_delete (sangoma_wait_obj_t **sangoma_wait_object) |
| De-allocate all resources in a wait object. More... | |
| sangoma_status_t _LIBSNG_CALL | sangoma_wait_obj_signal (sangoma_wait_obj_t *sangoma_wait_object) |
| Set wait object to a signaled state. More... | |
| sng_fd_t _LIBSNG_CALL | sangoma_wait_obj_get_fd (sangoma_wait_obj_t *sangoma_wait_object) |
| Get fd device file descriptor which was the 'fd' parameter for sangoma_wait_obj_create(), not useful for generic objects. More... | |
| void _LIBSNG_CALL | sangoma_wait_obj_set_context (sangoma_wait_obj_t *sangoma_wait_object, void *context) |
| PVOID _LIBSNG_CALL | sangoma_wait_obj_get_context (sangoma_wait_obj_t *sangoma_wait_object) |
| Retrieve the user context (if any) that was set via sangoma_wait_obj_set_context. More... | |
| int _LIBSNG_CALL | sangoma_cmd_exec (sng_fd_t fd, wanpipe_api_t *tdm_api) |
| Execute Sangoma API Command. More... | |
| int _LIBSNG_CALL | sangoma_get_full_cfg (sng_fd_t fd, wanpipe_api_t *tdm_api) |
| Read tdm api device configuration. More... | |
| 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. More... | |
| int _LIBSNG_CALL | sangoma_tdm_get_usr_period (sng_fd_t fd, wanpipe_api_t *tdm_api) |
| Get Tx/Rx Period in Milliseconds. More... | |
| 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. More... | |
| int _LIBSNG_CALL | sangoma_flush_bufs (sng_fd_t fd, wanpipe_api_t *tdm_api) |
| Flush all (tx/rx/event) buffers from current channel. More... | |
| int _LIBSNG_CALL | sangoma_flush_rx_bufs (sng_fd_t fd, wanpipe_api_t *tdm_api) |
| Flush only rx buffers from current channel. More... | |
| int _LIBSNG_CALL | sangoma_flush_tx_bufs (sng_fd_t fd, wanpipe_api_t *tdm_api) |
| Flush only tx buffers from current channel. More... | |
| int _LIBSNG_CALL | sangoma_flush_event_bufs (sng_fd_t fd, wanpipe_api_t *tdm_api) |
| Flush only event buffers from current channel. More... | |
| 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. More... | |
| int _LIBSNG_CALL | sangoma_tdm_disable_rbs_events (sng_fd_t fd, wanpipe_api_t *tdm_api) |
| Disable RBS Events for a device. More... | |
| 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. More... | |
| 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. More... | |
| 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) More... | |
| 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) More... | |
| 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) More... | |
| 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) More... | |
| 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) More... | |
| 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. More... | |
| 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. More... | |
| int _LIBSNG_CALL | sangoma_tdm_enable_rxhook_events (sng_fd_t fd, wanpipe_api_t *tdm_api) |
| Enable RX HOOK Events (Analog Only) More... | |
| int _LIBSNG_CALL | sangoma_tdm_disable_rxhook_events (sng_fd_t fd, wanpipe_api_t *tdm_api) |
| Disable RX HOOK Events (Analog Only) More... | |
| int _LIBSNG_CALL | sangoma_tdm_enable_ring_events (sng_fd_t fd, wanpipe_api_t *tdm_api) |
| Enable RING Events (Analog Only) More... | |
| int _LIBSNG_CALL | sangoma_tdm_disable_ring_events (sng_fd_t fd, wanpipe_api_t *tdm_api) |
| Disable RING Events (Analog Only) More... | |
| int _LIBSNG_CALL | sangoma_tdm_enable_ring_detect_events (sng_fd_t fd, wanpipe_api_t *tdm_api) |
| Enable RING DETECT Events (Analog Only) More... | |
| int _LIBSNG_CALL | sangoma_tdm_disable_ring_detect_events (sng_fd_t fd, wanpipe_api_t *tdm_api) |
| Disable RING DETECT Events (Analog Only) More... | |
| 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) More... | |
| 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) More... | |
| 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) More... | |
| int _LIBSNG_CALL | sangoma_tdm_disable_tone_events (sng_fd_t fd, wanpipe_api_t *tdm_api) |
| Enable TONE Events (Analog Only) More... | |
| int _LIBSNG_CALL | sangoma_tdm_txsig_onhook (sng_fd_t fd, wanpipe_api_t *tdm_api) |
| Tranmsmit TX SIG ON HOOK (Analog Only) More... | |
| int _LIBSNG_CALL | sangoma_tdm_txsig_offhook (sng_fd_t fd, wanpipe_api_t *tdm_api) |
| Tranmsmit TX SIG OFF HOOK (Analog Only) More... | |
| int _LIBSNG_CALL | sangoma_tdm_txsig_start (sng_fd_t fd, wanpipe_api_t *tdm_api) |
| Tranmsmit TX SIG START (Analog Only) More... | |
| int _LIBSNG_CALL | sangoma_tdm_txsig_kewl (sng_fd_t fd, wanpipe_api_t *tdm_api) |
| Tranmsmit TX SIG KEWL START (Analog Only) More... | |
| int _LIBSNG_CALL | sangoma_tdm_enable_hwec (sng_fd_t fd, wanpipe_api_t *tdm_api) |
| Enable HWEC on this channel. More... | |
| int _LIBSNG_CALL | sangoma_tdm_disable_hwec (sng_fd_t fd, wanpipe_api_t *tdm_api) |
| Disable HWEC on this channel. More... | |
| 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) More... | |
| 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) More... | |
| 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) More... | |
| 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. More... | |
| 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. More... | |
| 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. More... | |
| int _LIBSNG_CALL | sangoma_get_tx_queue_sz (sng_fd_t fd, wanpipe_api_t *tdm_api) |
| Get Tx Queue Size for this channel. More... | |
| 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. More... | |
| int _LIBSNG_CALL | sangoma_get_rx_queue_sz (sng_fd_t fd, wanpipe_api_t *tdm_api) |
| Get Rx Queue Size for this channel. More... | |
| 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. More... | |
| int _LIBSNG_CALL | sangoma_get_hw_coding (sng_fd_t fd, wanpipe_api_t *tdm_api) |
| Get HW Voice Coding (ulaw/alaw) More... | |
| int _LIBSNG_CALL | sangoma_tdm_get_hw_dtmf (sng_fd_t fd, wanpipe_api_t *tdm_api) |
| Check if hwdtmf support is available. More... | |
| 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. More... | |
| 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. More... | |
| 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. More... | |
| int _LIBSNG_CALL | sangoma_span_chan_toif (int span, int chan, char *interface_name) |
| Convert Span & Chan to interface name. More... | |
| int _LIBSNG_CALL | sangoma_span_chan_fromif (char *interface_name, int *span, int *chan) |
| Convert Interace Name to Span & Chan. More... | |
| 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) More... | |
| 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. More... | |
| int _LIBSNG_CALL | sangoma_get_firmware_version (sng_fd_t fd, wanpipe_api_t *tdm_api, unsigned char *ver) |
| Get Hardware/Firmware Version. More... | |
| int _LIBSNG_CALL | sangoma_get_cpld_version (sng_fd_t fd, wanpipe_api_t *tdm_api, unsigned char *ver) |
| Get AFT CPLD Version. More... | |
| 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 arrangement with Sangoma Technologies. More... | |
| int _LIBSNG_CALL | sangoma_port_led_ctrl (sng_fd_t fd, unsigned char led_state) |
| Control the LED ligths of the TDM port. On (led set based on link status) Off (turn off all led). Used to visually identify a phisical port from software. More... | |
| int _LIBSNG_CALL | sangoma_fe_reg_write (sng_fd_t fd, uint32_t offset, uint8_t data) |
| Write to a front end register. More... | |
| int _LIBSNG_CALL | sangoma_fe_reg_read (sng_fd_t fd, uint32_t offset, uint8_t *data) |
| Read front end register. More... | |
| 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. More... | |
| int _LIBSNG_CALL | sangoma_flush_stats (sng_fd_t fd, wanpipe_api_t *tdm_api) |
| Flush/Reset device statistics. More... | |
| 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. More... | |
| 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 More... | |
| 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 More... | |
| int _LIBSNG_CALL | sangoma_tdm_set_polarity (sng_fd_t fd, wanpipe_api_t *tdm_api, int polarity) |
| int _LIBSNG_CALL | sangoma_tdm_txsig_onhooktransfer (sng_fd_t fd, wanpipe_api_t *tdm_api) |
| 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. More... | |
| int _LIBSNG_CALL | sangoma_tdm_disable_loop (sng_fd_t fd, wanpipe_api_t *tdm_api) |
| Disable channel loop. More... | |
| int _LIBSNG_CALL | sangoma_read_event (sng_fd_t fd, wanpipe_api_t *tdm_api) |
| Read API Events. More... | |
| sangoma_status_t _LIBSNG_CALL | sangoma_logger_cmd_exec (sng_fd_t fd, wp_logger_cmd_t *logger_cmd) |
| sangoma_status_t _LIBSNG_CALL | sangoma_logger_read_event (sng_fd_t fd, wp_logger_cmd_t *logger_cmd) |
| Read Wanpipe Logger Events. More... | |
| sangoma_status_t _LIBSNG_CALL | sangoma_logger_flush_buffers (sng_fd_t fd, wp_logger_cmd_t *logger_cmd) |
| Flush Wanpipe Logger internal buffers. More... | |
| sangoma_status_t _LIBSNG_CALL | sangoma_logger_get_statistics (sng_fd_t fd, wp_logger_cmd_t *logger_cmd) |
| Get Wanpipe Logger statistics. More... | |
| sangoma_status_t _LIBSNG_CALL | sangoma_logger_reset_statistics (sng_fd_t fd, wp_logger_cmd_t *logger_cmd) |
| Reset Wanpipe Logger statistics. More... | |
| 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. More... | |
| 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. More... | |
| 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. More... | |
| int _LIBSNG_CALL | sangoma_set_tx_gain (sng_fd_t fd, wanpipe_api_t *tdm_api, float gain_val) |
| int _LIBSNG_CALL | sangoma_set_rx_gain (sng_fd_t fd, wanpipe_api_t *tdm_api, float gain_val) |
| 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. More... | |
| 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. More... | |
| 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. More... | |
| 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. More... | |
| 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. Before calling this function please stop the port by calling sangoma_driver_port_stop(). After calling this function please start the port by calling sangoma_driver_port_start(). More... | |
| 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. More... | |
| 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. More... | |
| 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_version() can not be called. More... | |
| int _LIBSNG_CALL | sangoma_driver_hw_rescan (sng_fd_t fd, port_management_struct_t *port_mgmnt, int *detected_port_cnt) |
| Rescan the pci and usb bus for newly added hardware. More... | |
| int _LIBSNG_CALL | sangoma_write_port_config_on_persistent_storage (hardware_info_t *hardware_info, port_cfg_t *port_cfg, unsigned short port_no) |
| int _LIBSNG_CALL | sangoma_mgmt_cmd (sng_fd_t fd, wan_udp_hdr_t *wan_udp) |
| Execute Sangoma Management Command. More... | |
| 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) More... | |
| int _LIBSNG_CALL | sangoma_tdm_set_codec (sng_fd_t fd, wanpipe_api_t *tdm_api, int codec) |
| Set TDM Codec per chan. More... | |
| int _LIBSNG_CALL | sangoma_tdm_get_codec (sng_fd_t fd, wanpipe_api_t *tdm_api) |
| Get Configured TDM Codec per chan. More... | |
| sng_fd_t _LIBSNG_CALL | sangoma_create_socket_by_name (char *device, char *card) |
| Open a device based on a interface and card name. More... | |
| int _LIBSNG_CALL | sangoma_interface_toi (char *interface_name, int *span, int *chan) |
| Convert Span & Chan to interface name. More... | |
| 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. More... | |
| int _LIBSNG_CALL | sangoma_tdm_get_power_level (sng_fd_t fd, wanpipe_api_t *tdm_api) |
| Get Configured Power Level. More... | |
| 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 configuration paramters, if any, must be specified at the time of chip initialization. Note that Analog card is considered a "single-port" card by HWEC API. That means for Analog cards and for single-port digital cards only a single sangoma_hwec_config_init() call is required, all subsequent calls will have no effect. For multi-port cards, such as A102/A104/A108/A500, the sangoma_hwec_config_init() must be called for each port, at least one time. Only the first call will actually load the Firmware image onto EC chip, all subsequent calls (for other ports) will only add the Port to list of ports which use the HWEC API. Actions of sangoma_hwec_config_init() can be reversed by calling sangoma_hwec_config_release(). When Port is stopped, the HWEC API automatically releases per-port resources and removes the Port from list ports which use HWEC API. More... | |
| 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 A200 (A200 is an Analog card and considered sinle-port by HWEC API), a single call to sangoma_hwec_config_release() will free the per-chip resources. For multi-port cards, such as A102/A104/A108/A500, sangoma_hwec_config_release() can be called for each port to remove it from list Ports which are using HWEC API. When sangoma_hwec_config_release() is called for the last Port which was "configured/initialized by HWEC API", the per-chip resources will be freed. More... | |
| sangoma_status_t _LIBSNG_CALL | sangoma_hwec_config_operation_mode (char *device_name, int mode, unsigned int fe_chan_map) |
| Modify channel operation mode. More... | |
| 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 inside the chip. The action is internal to EC chip itself, not related to AFT FPGA. This call is slow and should be used only on startup. More... | |
| 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 the chip and data passes unmodified through the ec chip. The action is internal to EC chip itself, not related to AFT FPGA. This call is slow and should be used only on startup. More... | |
| 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 since data is now forced through the EC chip by the FPGA. Data will be modified by the echo canceller. This command is recommened for fast enabling of Echo Cancellation. Note 1: Chip must be configured and in POWER ON state for echo Chancellation to take place. Note 2: sangoma_tdm_enable_hwec() function can be used to achive the same funcitnality based on file descriptor versus channel map. More... | |
| 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 since data will not flowing through the ec chip. Data will not be modified by the echo canceller. This command is recommened for fast disabling of Echo Cancelation. Note: sangoma_tdm_disable_hwec() function can be use to achive the same functionality based on file descriptor versus channel map. More... | |
| 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. More... | |
| 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. More... | |
| sangoma_status_t _LIBSNG_CALL | sangoma_hwec_print_statistics (char *device_name, int full, unsigned int fe_chan_map) |
| Read and print Chip/Channel statistics from EC chip. More... | |
| 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_playout() function. More... | |
| 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) |
| sangoma_status_t _LIBSNG_CALL | sangoma_hwec_audio_buffer_unload (char *device_name, int in_buffer_id) |
| 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(). More... | |
| 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 and to wanpipelog.txt (Windows) or /var/log/messages (Linux) for diagnostic purposes. More... | |
| 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. More... | |
| sangoma_status_t _LIBSNG_CALL | sangoma_hwec_get_channel_statistics (sng_fd_t fd, unsigned int fe_chan, int *hwec_api_return_code, wanec_chan_stats_t *wanec_chan_stats, int verbose, int reset) |
| 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. More... | |
| 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. More... | |
| 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. More... | |
| 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. More... | |
Wanpipe API Library header for Sangoma AFT T1/E1/Analog/BRI/Serial Hardware -.
Provides User a Unified/OS Agnostic API to Wanpipe/Sangoma Drivers and Hardware
Author(s): Nenad Corbic ncorbic@sangoma.com David Rokhvarg davidr@sangoma.com Michael Jerris mike@jerris.com Anthony Minessale II anthmct@yahoo.com
Copyright: (c) 2005-2008 Nenad Corbic ncorbic@sangoma.com
THIS SOFTWARE IS PROVIDED BY Sangoma Technologies ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL Sangoma Technologies BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
v.2.0.0 Nenad Corbic Jan 30 2009 Added sangoma_get_driver_version, sangoma_get_firmware_version, sangoma_get_cpld_version functions,sangoma_get_stats,sangoma_flush_stats
Definition in file libsangoma.h.
| #define SANGOMA_INIT_TDM_API_CMD | ( | _name_ | ) |
Initialize the tdm api cmd structure. Set to 0.
Definition at line 101 of file libsangoma.h.
| #define sangoma_ctime | ( | time | ) | ctime((time_t*)time) |
Convert a time value to a string.
| time_val | pointer to time value |
Definition at line 291 of file libsangoma.h.
| #define DECODE_SANGOMA_WAIT_OBJECT_TYPE | ( | type | ) |
Definition at line 376 of file libsangoma.h.
| #define sangoma_open_tdmapi_span_chan sangoma_open_api_span_chan |
Backward compabile defines
Definition at line 2350 of file libsangoma.h.
| typedef int32_t sangoma_status_t |
return status from sangoma APIs
LIBSANGOMA_LIGHT can be used to enable only IO and EVENT libsangoma functions. The DRIVER configuration/start/stop functions are not compiled.
LIBSANGOMA_LIGHT depends only on 3 header files. Instead of all wanpipe header files needed for DRIVER management
LIBSANGMOA_LIGHT is NOT enabled by default.
As of now this typedef maps exactly to SANG_STATUS_T, however that is a kernel type, ugly, ugly, uglyyyyy, we should have strictly minimum set of shared data structures between kernel and user many return codes specified in SANG_STATUS_T are kernel specific like FAILED_TO_LOCK_USER_MEMORY or INVALID_IRQL, the libsangoma user does not need that much information, and even if ever needs it we should provide simpler defaults
Definition at line 338 of file libsangoma.h.
Definition at line 364 of file libsangoma.h.
| sng_fd_t _LIBSNG_CALL sangoma_open_api_span_chan | ( | int | span, |
| int | chan | ||
| ) |
Open a Device based on Span/Chan values.
Device OPEN / CLOSE Functions
| span | span number starting from 1 to 255 |
| chan | chan number starting from 1 to 32 |
Restriced open, device will allowed to be open only once.
Definition at line 1682 of file libsangoma.c.
References __sangoma_open_api_span_chan(), wanpipe_api_cmd::cmd, INVALID_HANDLE_VALUE, wanpipe_api_cmd::open_cnt, sangoma_close(), sangoma_cmd_exec(), WP_API_CMD_OPEN_CNT, and wanpipe_api::wp_cmd.
Referenced by open_sangoma_device(), and sangoma_create_socket_by_name().


| sng_fd_t _LIBSNG_CALL __sangoma_open_api_span_chan | ( | int | span, |
| int | chan | ||
| ) |
Open a Device based on Span/Chan values.
| span | span number starting from 1 to 255 |
| chan | chan number starting from 1 to 32 |
Unrestriced open, allows mutiple open calls on a single device
Definition at line 1740 of file libsangoma.c.
References _snprintf, FNAME_LEN, sangoma_open_dev_by_name(), and WP_INTERFACE_NAME_FORM.
Referenced by open_sangoma_device(), and sangoma_open_api_span_chan().


| 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.
| dev_name | API device name |
Definition at line 1717 of file libsangoma.c.
References _snprintf, and FNAME_LEN.
Referenced by __sangoma_open_api_span_chan(), sangoma_logger_open(), sangoma_open_api_ctrl(), and sangoma_open_driver_ctrl().

| sng_fd_t _LIBSNG_CALL sangoma_open_api_ctrl | ( | void | ) |
Open a Global Control Device.
The global control device receives events for all devices configured.
Definition at line 1750 of file libsangoma.c.
References sangoma_open_dev_by_name().

| sng_fd_t _LIBSNG_CALL sangoma_logger_open | ( | void | ) |
Open a Global Logger Device.
The global Logger device receives Logger Events for all devices configured.
Definition at line 1756 of file libsangoma.c.
References sangoma_open_dev_by_name().

| sng_fd_t _LIBSNG_CALL sangoma_open_driver_ctrl | ( | int | port_no | ) |
Open a Global Driver Control Device.
The global control device receives events for all devices configured.
Definition at line 107 of file libsangoma_config.c.
References _snprintf, FNAME_LEN, sangoma_open_dev_by_name(), and WP_PORT_NAME_FORM.

| void _LIBSNG_CALL sangoma_close | ( | sng_fd_t * | fd | ) |
Close device file descriptor.
| fd | device file descriptor |
Definition at line 1818 of file libsangoma.c.
References INVALID_HANDLE_VALUE.
Referenced by cleanup(), sangoma_open_api_span_chan(), and sangoma_wait_obj_delete().

| int _LIBSNG_CALL sangoma_get_open_cnt | ( | sng_fd_t | fd, |
| wanpipe_api_t * | tdm_api | ||
| ) |
Get device open count.
| fd | device file descriptor |
| tdm_api | tdm api command structure |
Definition at line 1762 of file libsangoma.c.
References wanpipe_api_cmd::cmd, wanpipe_api_cmd::open_cnt, sangoma_cmd_exec(), SANGOMA_INIT_TDM_API_CMD_RESULT, WP_API_CMD_OPEN_CNT, and wanpipe_api::wp_cmd.

| int _LIBSNG_CALL sangoma_writemsg | ( | sng_fd_t | fd, |
| void * | hdrbuf, | ||
| int | hdrlen, | ||
| void * | databuf, | ||
| unsigned short | datalen, | ||
| int | flag | ||
| ) |
Write Data to device.
Device READ / WRITE Functions
| fd | device file descriptor |
| hdrbuf | pointer to header structure wp_api_hdr_t |
| hdrlen | size of wp_api_hdr_t |
| databuf | pointer to data buffer to be transmitted |
| datalen | length of data buffer |
| flag | currently not used, set to 0 |
In case of error return code, one must check the header operation_status variable to identify the reason of an error. Please refer to the error codes.
Definition at line 1913 of file libsangoma.c.
References wp_api_hdr::data_length, wan_iovec_list::iovec_list, wan_msghdr::msg_iov, wan_msghdr::msg_iovlen, wp_api_hdr::operation_status, SANG_STATUS_DEVICE_BUSY, SANG_STATUS_IO_ERROR, SANG_STATUS_SUCCESS, and SDLA_DECODE_SANG_STATUS.
Referenced by write_data().

| int _LIBSNG_CALL sangoma_readmsg | ( | sng_fd_t | fd, |
| void * | hdrbuf, | ||
| int | hdrlen, | ||
| void * | databuf, | ||
| int | datalen, | ||
| int | flag | ||
| ) |
Read Data from device.
Device READ / WRITE Functions
| fd | device file descriptor |
| hdrbuf | pointer to header structure wp_api_hdr_t |
| hdrlen | size of wp_api_hdr_t |
| databuf | pointer to data buffer to be received |
| datalen | length of data buffer |
| flag | currently not used, set to 0 |
In case of error return code, one must check the header operation_status variable to identify the reason of error. Please refer to the error codes.
Definition at line 1842 of file libsangoma.c.
References wp_api_hdr::data_length, wan_iovec_list::iovec_list, wan_msghdr::msg_iov, wan_msghdr::msg_iovlen, wp_api_hdr::operation_status, SANG_STATUS_NO_DATA_AVAILABLE, SANG_STATUS_RX_DATA_AVAILABLE, and SDLA_DECODE_SANG_STATUS.
| 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.
Device POLL Functions
| sangoma_wait_object | pointer a single device object |
| fd | device file descriptor |
| object_type | type of the wait object. see sangoma_wait_obj_type_t for types |
| sangoma_wait_object | pointer a single device object |
| fd | device file descriptor |
| object_type | type of the wait object. see sangoma_wait_obj_type_t for types |
Definition at line 1239 of file libsangoma.c.
References FALSE, INVALID_HANDLE_VALUE, SANG_STATUS_FAILED_ALLOCATE_MEMORY, SANG_STATUS_GENERAL_ERROR, SANG_STATUS_INVALID_PARAMETER, SANG_STATUS_SUCCESS, and sangoma_wait_obj_delete().
Referenced by open_sangoma_device().


| sangoma_status_t _LIBSNG_CALL sangoma_wait_obj_delete | ( | sangoma_wait_obj_t ** | sangoma_wait_object | ) |
De-allocate all resources in a wait object.
De-allocate all resources inside a wait object which were allocated by sangoma_wait_obj_init().
| sangoma_wait_object | pointer to a pointer to a single device object |
Definition at line 1320 of file libsangoma.c.
References INVALID_HANDLE_VALUE, SANG_STATUS_INVALID_DEVICE, SANG_STATUS_SUCCESS, sangoma_close(), and UNKNOWN_WAIT_OBJ.
Referenced by cleanup(), and sangoma_wait_obj_create().


| sangoma_status_t _LIBSNG_CALL sangoma_wait_obj_signal | ( | sangoma_wait_obj_t * | sng_wait_obj | ) |
Set wait object to a signaled state.
| sangoma_wait_object | pointer a single device object that can be signaled |
Definition at line 1353 of file libsangoma.c.
References SANG_STATUS_GENERAL_ERROR, SANG_STATUS_INVALID_DEVICE, and SANG_STATUS_SUCCESS.
| 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.
| sangoma_wait_object | pointer a single device object |
Definition at line 1382 of file libsangoma.c.
Referenced by cleanup(), handle_span_chan(), handle_tdm_event(), and write_data().

| 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.
| sangoma_wait_object | pointer a single device object |
Windows note: must use return type PVOID instead of void* to satisfy WDK compiler.
| sangoma_wait_object | pointer a single device object |
Definition at line 1406 of file libsangoma.c.
Referenced by cleanup(), and write_data().

| int _LIBSNG_CALL sangoma_cmd_exec | ( | sng_fd_t | fd, |
| wanpipe_api_t * | tdm_api | ||
| ) |
Execute Sangoma API Command.
Device API COMMAND Functions
Device API COMMAND Functions
| fd | device file descriptor |
| tdm_api | tdm api command structure |
Definition at line 2004 of file libsangoma.c.
References wanpipe_api_cmd::cmd, WANPIPE_IOCTL_API_CMD, and wanpipe_api::wp_cmd.
Referenced by sangoma_disable_bri_bchan_loopback(), sangoma_enable_bri_bchan_loopback(), sangoma_flush_bufs(), sangoma_flush_event_bufs(), sangoma_flush_rx_bufs(), sangoma_flush_stats(), sangoma_flush_tx_bufs(), sangoma_get_cpld_version(), sangoma_get_driver_version(), sangoma_get_fe_status(), sangoma_get_firmware_version(), sangoma_get_full_cfg(), sangoma_get_hw_coding(), sangoma_get_link_status(), sangoma_get_open_cnt(), sangoma_get_rx_queue_sz(), sangoma_get_stats(), sangoma_get_tx_queue_sz(), sangoma_open_api_span_chan(), sangoma_read_event(), sangoma_set_fe_status(), sangoma_set_rm_rx_gain(), sangoma_set_rm_rxflashtime(), sangoma_set_rm_tx_gain(), sangoma_set_rx_queue_sz(), sangoma_set_tx_queue_sz(), sangoma_ss7_force_rx(), sangoma_ss7_get_cfg_status(), sangoma_tdm_disable_dtmf_events(), sangoma_tdm_disable_fax_events(), sangoma_tdm_disable_hwec(), sangoma_tdm_disable_loop(), sangoma_tdm_disable_rbs_events(), sangoma_tdm_disable_ring_detect_events(), sangoma_tdm_disable_ring_events(), sangoma_tdm_disable_ring_trip_detect_events(), sangoma_tdm_disable_rm_dtmf_events(), sangoma_tdm_disable_rxhook_events(), sangoma_tdm_disable_tone_events(), sangoma_tdm_enable_dtmf_events(), sangoma_tdm_enable_fax_events(), sangoma_tdm_enable_hwec(), sangoma_tdm_enable_loop(), sangoma_tdm_enable_rbs_events(), sangoma_tdm_enable_ring_detect_events(), sangoma_tdm_enable_ring_events(), sangoma_tdm_enable_ring_trip_detect_events(), sangoma_tdm_enable_rm_dtmf_events(), sangoma_tdm_enable_rxhook_events(), sangoma_tdm_enable_tone_events(), sangoma_tdm_get_codec(), sangoma_tdm_get_fe_alarms(), sangoma_tdm_get_hw_dtmf(), sangoma_tdm_get_hw_ec(), sangoma_tdm_get_hw_fax(), sangoma_tdm_get_hwec_chan_status(), sangoma_tdm_get_hwec_persist_status(), sangoma_tdm_get_power_level(), sangoma_tdm_get_usr_mtu_mru(), sangoma_tdm_get_usr_period(), sangoma_tdm_read_rbs(), sangoma_tdm_set_buffer_multiplier(), sangoma_tdm_set_codec(), sangoma_tdm_set_power_level(), sangoma_tdm_set_usr_period(), sangoma_tdm_txsig_kewl(), sangoma_tdm_txsig_offhook(), sangoma_tdm_txsig_onhook(), sangoma_tdm_txsig_start(), and sangoma_tdm_write_rbs().
| int _LIBSNG_CALL sangoma_get_full_cfg | ( | sng_fd_t | fd, |
| wanpipe_api_t * | tdm_api | ||
| ) |
Read tdm api device configuration.
| fd | device file descriptor |
| tdm_api | tdm api command structure |
Definition at line 2026 of file libsangoma.c.
References wanpipe_api_cmd::cmd, wanpipe_api_cmd::fe_alarms, wanpipe_api_cmd::hw_mtu_mru, wanpipe_api_cmd::hw_tdm_coding, wanpipe_api_cmd::idle_flag, wanpipe_api_cmd::power_level, wanpipe_api_cmd::rx_disable, sangoma_cmd_exec(), SANGOMA_INIT_TDM_API_CMD_RESULT, wanpipe_api_cmd::stats, wanpipe_api_cmd::tdm_codec, wanpipe_api_cmd::tx_disable, wanpipe_api_cmd::usr_mtu_mru, wanpipe_api_cmd::usr_period, WP_API_CMD_GET_FULL_CFG, and wanpipe_api::wp_cmd.
Referenced by open_sangoma_device(), sangoma_fe_reg_read(), and sangoma_fe_reg_write().


| 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.
| fd | device file descriptor |
| tdm_api | tdm api command structure |
| period | value in miliseconds (1,2,5,10) |
Only valid in CHAN Operation Mode
Definition at line 2126 of file libsangoma.c.
References wanpipe_api_cmd::cmd, sangoma_cmd_exec(), SANGOMA_INIT_TDM_API_CMD_RESULT, wanpipe_api_cmd::usr_period, WP_API_CMD_SET_USR_PERIOD, and wanpipe_api::wp_cmd.
Referenced by open_sangoma_device().


| int _LIBSNG_CALL sangoma_tdm_get_usr_period | ( | sng_fd_t | fd, |
| wanpipe_api_t * | tdm_api | ||
| ) |
Get Tx/Rx Period in Milliseconds.
| fd | device file descriptor |
| tdm_api | tdm api command structure |
Definition at line 2142 of file libsangoma.c.
References wanpipe_api_cmd::cmd, sangoma_cmd_exec(), SANGOMA_INIT_TDM_API_CMD_RESULT, wanpipe_api_cmd::usr_period, WP_API_CMD_GET_USR_PERIOD, and wanpipe_api::wp_cmd.

| 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.
| fd | device file descriptor |
| tdm_api | tdm api command structure |
Definition at line 2276 of file libsangoma.c.
References wanpipe_api_cmd::cmd, sangoma_cmd_exec(), SANGOMA_INIT_TDM_API_CMD_RESULT, wanpipe_api_cmd::usr_mtu_mru, WP_API_CMD_GET_USR_MTU_MRU, and wanpipe_api::wp_cmd.

| int _LIBSNG_CALL sangoma_flush_bufs | ( | sng_fd_t | fd, |
| wanpipe_api_t * | tdm_api | ||
| ) |
Flush all (tx/rx/event) buffers from current channel.
| fd | device file descriptor |
| tdm_api | tdm api command structure |
Definition at line 2329 of file libsangoma.c.
References wanpipe_api_cmd::cmd, sangoma_cmd_exec(), SANGOMA_INIT_TDM_API_CMD_RESULT, WP_API_CMD_FLUSH_BUFFERS, and wanpipe_api::wp_cmd.
Referenced by open_sangoma_device().


| int _LIBSNG_CALL sangoma_flush_rx_bufs | ( | sng_fd_t | fd, |
| wanpipe_api_t * | tdm_api | ||
| ) |
Flush only rx buffers from current channel.
| fd | device file descriptor |
| tdm_api | tdm api command structure |
Definition at line 2337 of file libsangoma.c.
References wanpipe_api_cmd::cmd, sangoma_cmd_exec(), SANGOMA_INIT_TDM_API_CMD_RESULT, WP_API_CMD_FLUSH_RX_BUFFERS, and wanpipe_api::wp_cmd.

| int _LIBSNG_CALL sangoma_flush_tx_bufs | ( | sng_fd_t | fd, |
| wanpipe_api_t * | tdm_api | ||
| ) |
Flush only tx buffers from current channel.
| fd | device file descriptor |
| tdm_api | tdm api command structure |
Definition at line 2345 of file libsangoma.c.
References wanpipe_api_cmd::cmd, sangoma_cmd_exec(), SANGOMA_INIT_TDM_API_CMD_RESULT, WP_API_CMD_FLUSH_TX_BUFFERS, and wanpipe_api::wp_cmd.

| int _LIBSNG_CALL sangoma_flush_event_bufs | ( | sng_fd_t | fd, |
| wanpipe_api_t * | tdm_api | ||
| ) |
Flush only event buffers from current channel.
| fd | device file descriptor |
| tdm_api | tdm api command structure |
Definition at line 2353 of file libsangoma.c.
References wanpipe_api_cmd::cmd, sangoma_cmd_exec(), SANGOMA_INIT_TDM_API_CMD_RESULT, WP_API_CMD_FLUSH_EVENT_BUFFERS, and wanpipe_api::wp_cmd.

| 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.
| fd | device file descriptor |
| tdm_api | tdm api command structure |
| poll_in_sec | driver poll period for rbs events |
Definition at line 2361 of file libsangoma.c.
References wanpipe_api_cmd::cmd, wanpipe_api_cmd::rbs_poll, sangoma_cmd_exec(), SANGOMA_INIT_TDM_API_CMD_RESULT, WP_API_CMD_ENABLE_RBS_EVENTS, and wanpipe_api::wp_cmd.
Referenced by open_sangoma_device().


| int _LIBSNG_CALL sangoma_tdm_disable_rbs_events | ( | sng_fd_t | fd, |
| wanpipe_api_t * | tdm_api | ||
| ) |
Disable RBS Events for a device.
| fd | device file descriptor |
| tdm_api | tdm api command structure |
Definition at line 2370 of file libsangoma.c.
References wanpipe_api_cmd::cmd, sangoma_cmd_exec(), SANGOMA_INIT_TDM_API_CMD_RESULT, WP_API_CMD_DISABLE_RBS_EVENTS, and wanpipe_api::wp_cmd.
Referenced by cleanup().


| 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.
| fd | device file descriptor |
| tdm_api | tdm api command structure |
| channel | t1/e1 timeslot |
| rbs | rbs bits (ABCD) |
Definition at line 2378 of file libsangoma.c.
References wanpipe_api_cmd::cmd, wanpipe_api_cmd::rbs_tx_bits, sangoma_cmd_exec(), SANGOMA_INIT_TDM_API_CMD_RESULT, WP_API_CMD_WRITE_RBS_BITS, and wanpipe_api::wp_cmd.

| 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.
| fd | device file descriptor |
| tdm_api | tdm api command structure |
| channel | t1/e1 timeslot |
| rbs | pointer to rbs bits (ABCD) |
Definition at line 2387 of file libsangoma.c.
References wanpipe_api_cmd::cmd, wanpipe_api_cmd::rbs_rx_bits, wanpipe_api_cmd::rbs_tx_bits, sangoma_cmd_exec(), SANGOMA_INIT_TDM_API_CMD_RESULT, WP_API_CMD_READ_RBS_BITS, and wanpipe_api::wp_cmd.

| 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)
| fd | device file descriptor |
| tdm_api | tdm api command structure |
Supported only on cards that have HWEC
Definition at line 2636 of file libsangoma.c.
References wanpipe_api_cmd::cmd, wanpipe_api_cmd::event, sangoma_cmd_exec(), SANGOMA_INIT_TDM_API_CMD_RESULT, WP_API_EVENT_DTMF, WP_API_EVENT_ENABLE, and wanpipe_api::wp_cmd.
Referenced by open_sangoma_device().


| 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)
| fd | device file descriptor |
| tdm_api | tdm api command structure |
Supported only on cards that have HWEC
Definition at line 2646 of file libsangoma.c.
References wanpipe_api_cmd::cmd, wanpipe_api_cmd::event, sangoma_cmd_exec(), SANGOMA_INIT_TDM_API_CMD_RESULT, WP_API_EVENT_DISABLE, WP_API_EVENT_DTMF, and wanpipe_api::wp_cmd.
Referenced by cleanup().


| 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)
| fd | device file descriptor |
| tdm_api | tdm api command structure |
Supported only on cards that have HWEC
Definition at line 2601 of file libsangoma.c.
References wanpipe_api_cmd::cmd, wanpipe_api_cmd::event, sangoma_cmd_exec(), SANGOMA_INIT_TDM_API_CMD_RESULT, WP_API_EVENT_ENABLE, WP_API_EVENT_FAX_DETECT, and wanpipe_api::wp_cmd.

| 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)
| fd | device file descriptor |
| tdm_api | tdm api command structure |
Supported only on cards that have HWEC
Definition at line 2611 of file libsangoma.c.
References wanpipe_api_cmd::cmd, wanpipe_api_cmd::event, sangoma_cmd_exec(), SANGOMA_INIT_TDM_API_CMD_RESULT, WP_API_EVENT_DISABLE, WP_API_EVENT_FAX_DETECT, and wanpipe_api::wp_cmd.

| 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)
| fd | device file descriptor |
| tdm_api | tdm api command structure |
Supported only on cards that have HWEC
Definition at line 2621 of file libsangoma.c.
References wanpipe_api_cmd::cmd, sangoma_cmd_exec(), SANGOMA_INIT_TDM_API_CMD_RESULT, WP_API_CMD_GET_HW_FAX_DETECT, and wanpipe_api::wp_cmd.

| 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.
| fd | device file descriptor |
| tdm_api | tdm api command structure |
Supported only on Analog Cards
Definition at line 2656 of file libsangoma.c.
References wanpipe_api_cmd::cmd, wanpipe_api_cmd::event, sangoma_cmd_exec(), SANGOMA_INIT_TDM_API_CMD_RESULT, WP_API_EVENT_ENABLE, and wanpipe_api::wp_cmd.
Referenced by open_sangoma_device().


| 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.
| fd | device file descriptor |
| tdm_api | tdm api command structure |
Supported only on Analog Cards
Definition at line 2666 of file libsangoma.c.
References wanpipe_api_cmd::cmd, wanpipe_api_cmd::event, sangoma_cmd_exec(), SANGOMA_INIT_TDM_API_CMD_RESULT, WP_API_EVENT_DISABLE, and wanpipe_api::wp_cmd.
Referenced by cleanup().


| int _LIBSNG_CALL sangoma_tdm_enable_rxhook_events | ( | sng_fd_t | fd, |
| wanpipe_api_t * | tdm_api | ||
| ) |
Enable RX HOOK Events (Analog Only)
| fd | device file descriptor |
| tdm_api | tdm api command structure |
Supported only on Analog Cards
Definition at line 2676 of file libsangoma.c.
References wanpipe_api_cmd::cmd, wanpipe_api_cmd::event, sangoma_cmd_exec(), SANGOMA_INIT_TDM_API_CMD_RESULT, WP_API_EVENT_ENABLE, and wanpipe_api::wp_cmd.
Referenced by open_sangoma_device().


| int _LIBSNG_CALL sangoma_tdm_disable_rxhook_events | ( | sng_fd_t | fd, |
| wanpipe_api_t * | tdm_api | ||
| ) |
Disable RX HOOK Events (Analog Only)
| fd | device file descriptor |
| tdm_api | tdm api command structure |
Supported only on Analog Cards
Definition at line 2686 of file libsangoma.c.
References wanpipe_api_cmd::cmd, wanpipe_api_cmd::event, sangoma_cmd_exec(), SANGOMA_INIT_TDM_API_CMD_RESULT, WP_API_EVENT_DISABLE, and wanpipe_api::wp_cmd.
Referenced by cleanup().


| int _LIBSNG_CALL sangoma_tdm_enable_ring_events | ( | sng_fd_t | fd, |
| wanpipe_api_t * | tdm_api | ||
| ) |
Enable RING Events (Analog Only)
| fd | device file descriptor |
| tdm_api | tdm api command structure |
Supported only on Analog Cards
Definition at line 2696 of file libsangoma.c.
References wanpipe_api_cmd::cmd, wanpipe_api_cmd::event, sangoma_cmd_exec(), SANGOMA_INIT_TDM_API_CMD_RESULT, WP_API_EVENT_ENABLE, and wanpipe_api::wp_cmd.

| int _LIBSNG_CALL sangoma_tdm_disable_ring_events | ( | sng_fd_t | fd, |
| wanpipe_api_t * | tdm_api | ||
| ) |
Disable RING Events (Analog Only)
| fd | device file descriptor |
| tdm_api | tdm api command structure |
Supported only on Analog Cards
Definition at line 2706 of file libsangoma.c.
References wanpipe_api_cmd::cmd, wanpipe_api_cmd::event, sangoma_cmd_exec(), SANGOMA_INIT_TDM_API_CMD_RESULT, WP_API_EVENT_DISABLE, and wanpipe_api::wp_cmd.

| int _LIBSNG_CALL sangoma_tdm_enable_ring_detect_events | ( | sng_fd_t | fd, |
| wanpipe_api_t * | tdm_api | ||
| ) |
Enable RING DETECT Events (Analog Only)
| fd | device file descriptor |
| tdm_api | tdm api command structure |
Supported only on Analog Cards
Definition at line 2716 of file libsangoma.c.
References wanpipe_api_cmd::cmd, wanpipe_api_cmd::event, sangoma_cmd_exec(), SANGOMA_INIT_TDM_API_CMD_RESULT, WP_API_EVENT_ENABLE, and wanpipe_api::wp_cmd.

| int _LIBSNG_CALL sangoma_tdm_disable_ring_detect_events | ( | sng_fd_t | fd, |
| wanpipe_api_t * | tdm_api | ||
| ) |
Disable RING DETECT Events (Analog Only)
| fd | device file descriptor |
| tdm_api | tdm api command structure |
Supported only on Analog Cards
Definition at line 2726 of file libsangoma.c.
References wanpipe_api_cmd::cmd, wanpipe_api_cmd::event, sangoma_cmd_exec(), SANGOMA_INIT_TDM_API_CMD_RESULT, WP_API_EVENT_DISABLE, and wanpipe_api::wp_cmd.

| 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)
| fd | device file descriptor |
| tdm_api | tdm api command structure |
Supported only on Analog Cards
Definition at line 2736 of file libsangoma.c.
References wanpipe_api_cmd::cmd, wanpipe_api_cmd::event, sangoma_cmd_exec(), SANGOMA_INIT_TDM_API_CMD_RESULT, WP_API_EVENT_ENABLE, and wanpipe_api::wp_cmd.

| 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)
| fd | device file descriptor |
| tdm_api | tdm api command structure |
Supported only on Analog Cards
Definition at line 2746 of file libsangoma.c.
References wanpipe_api_cmd::cmd, wanpipe_api_cmd::event, sangoma_cmd_exec(), SANGOMA_INIT_TDM_API_CMD_RESULT, WP_API_EVENT_DISABLE, and wanpipe_api::wp_cmd.

| 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)
| fd | device file descriptor |
| tdm_api | tdm api command structure |
| tone_id | tone type to transmit |
Supported only on Analog Cards
Definition at line 2796 of file libsangoma.c.
References wanpipe_api_cmd::cmd, wanpipe_api_cmd::event, sangoma_cmd_exec(), SANGOMA_INIT_TDM_API_CMD_RESULT, WP_API_EVENT_ENABLE, and wanpipe_api::wp_cmd.

| int _LIBSNG_CALL sangoma_tdm_disable_tone_events | ( | sng_fd_t | fd, |
| wanpipe_api_t * | tdm_api | ||
| ) |
Enable TONE Events (Analog Only)
| fd | device file descriptor |
| tdm_api | tdm api command structure |
Supported only on Analog Cards
Definition at line 2807 of file libsangoma.c.
References wanpipe_api_cmd::cmd, wanpipe_api_cmd::event, sangoma_cmd_exec(), SANGOMA_INIT_TDM_API_CMD_RESULT, WP_API_EVENT_DISABLE, and wanpipe_api::wp_cmd.

| int _LIBSNG_CALL sangoma_tdm_txsig_onhook | ( | sng_fd_t | fd, |
| wanpipe_api_t * | tdm_api | ||
| ) |
Tranmsmit TX SIG ON HOOK (Analog Only)
| fd | device file descriptor |
| tdm_api | tdm api command structure |
Supported only on Analog Cards
Definition at line 2776 of file libsangoma.c.
References wanpipe_api_cmd::cmd, wanpipe_api_cmd::event, sangoma_cmd_exec(), SANGOMA_INIT_TDM_API_CMD_RESULT, WP_API_EVENT_ENABLE, and wanpipe_api::wp_cmd.

| int _LIBSNG_CALL sangoma_tdm_txsig_offhook | ( | sng_fd_t | fd, |
| wanpipe_api_t * | tdm_api | ||
| ) |
Tranmsmit TX SIG OFF HOOK (Analog Only)
| fd | device file descriptor |
| tdm_api | tdm api command structure |
Supported only on Analog Cards
Definition at line 2786 of file libsangoma.c.
References wanpipe_api_cmd::cmd, wanpipe_api_cmd::event, sangoma_cmd_exec(), SANGOMA_INIT_TDM_API_CMD_RESULT, WP_API_EVENT_ENABLE, and wanpipe_api::wp_cmd.

| int _LIBSNG_CALL sangoma_tdm_txsig_start | ( | sng_fd_t | fd, |
| wanpipe_api_t * | tdm_api | ||
| ) |
Tranmsmit TX SIG START (Analog Only)
| fd | device file descriptor |
| tdm_api | tdm api command structure |
Supported only on Analog Cards
Definition at line 2766 of file libsangoma.c.
References wanpipe_api_cmd::cmd, wanpipe_api_cmd::event, sangoma_cmd_exec(), SANGOMA_INIT_TDM_API_CMD_RESULT, WP_API_EVENT_ENABLE, and wanpipe_api::wp_cmd.

| int _LIBSNG_CALL sangoma_tdm_txsig_kewl | ( | sng_fd_t | fd, |
| wanpipe_api_t * | tdm_api | ||
| ) |
Tranmsmit TX SIG KEWL START (Analog Only)
| fd | device file descriptor |
| tdm_api | tdm api command structure |
Supported only on Analog Cards
Definition at line 2756 of file libsangoma.c.
References wanpipe_api_cmd::cmd, wanpipe_api_cmd::event, sangoma_cmd_exec(), SANGOMA_INIT_TDM_API_CMD_RESULT, WP_API_EVENT_ENABLE, and wanpipe_api::wp_cmd.

| int _LIBSNG_CALL sangoma_tdm_enable_hwec | ( | sng_fd_t | fd, |
| wanpipe_api_t * | tdm_api | ||
| ) |
Enable HWEC on this channel.
| fd | device file descriptor |
| tdm_api | tdm api command structure |
Supported only on cards that have HWEC
Definition at line 2819 of file libsangoma.c.
References wanpipe_api_cmd::cmd, sangoma_cmd_exec(), SANGOMA_INIT_TDM_API_CMD_RESULT, and wanpipe_api::wp_cmd.

| int _LIBSNG_CALL sangoma_tdm_disable_hwec | ( | sng_fd_t | fd, |
| wanpipe_api_t * | tdm_api | ||
| ) |
Disable HWEC on this channel.
| fd | device file descriptor |
| tdm_api | tdm api command structure |
Supported only on cards that have HWEC
Definition at line 2827 of file libsangoma.c.
References wanpipe_api_cmd::cmd, sangoma_cmd_exec(), SANGOMA_INIT_TDM_API_CMD_RESULT, and wanpipe_api::wp_cmd.

| 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)
| fd | device file descriptor |
| tdm_api | tdm api command structure |
| alarms | bit map status of T1/E1 alarms |
Supported only on T1/E1 Cards
Definition at line 2841 of file libsangoma.c.
References wanpipe_api_cmd::cmd, wanpipe_api_cmd::fe_alarms, sangoma_cmd_exec(), SANGOMA_INIT_TDM_API_CMD_RESULT, and wanpipe_api::wp_cmd.

| 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)
| fd | device file descriptor |
| tdm_api | tdm api command structure |
| current_status | pointer where result will be filled: 0=Link UP 1=Link Down |
Definition at line 2876 of file libsangoma.c.
References wanpipe_api_cmd::cmd, wanpipe_api_cmd::fe_status, sangoma_cmd_exec(), SANGOMA_INIT_TDM_API_CMD_RESULT, and wanpipe_api::wp_cmd.

| 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)
| fd | device file descriptor |
| tdm_api | tdm api command structure |
| new_status | new status 0=Link UP 1=Link Down |
Definition at line 2890 of file libsangoma.c.
References wanpipe_api_cmd::cmd, wanpipe_api_cmd::fe_status, sangoma_cmd_exec(), SANGOMA_INIT_TDM_API_CMD_RESULT, and wanpipe_api::wp_cmd.

| 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.
| fd | device file descriptor |
| tdm_api | tdm api command structure |
| multiplier | buffer multiplier value 0-disable or 1 to TDMAPI_MAX_BUFFER_MULTIPLIER |
Definition at line 2406 of file libsangoma.c.
References wanpipe_api_cmd::cmd, sangoma_cmd_exec(), SANGOMA_INIT_TDM_API_CMD_RESULT, WP_API_CMD_BUFFER_MULTIPLIER, and wanpipe_api::wp_cmd.
Referenced by open_sangoma_device().


| 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.
| fd | device file descriptor |
| tdm_api | tdm api command structure |
| channel | bri bchannel 1 or 2 |
Definition at line 2911 of file libsangoma.c.
References wp_api_event::channel, wanpipe_api_cmd::cmd, wanpipe_api_cmd::event, sangoma_cmd_exec(), SANGOMA_INIT_TDM_API_CMD_RESULT, WP_API_EVENT_ENABLE, and wanpipe_api::wp_cmd.

| 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.
| fd | device file descriptor |
| tdm_api | tdm api command structure |
| channel | bri bchannel 1 or 2 |
Definition at line 2900 of file libsangoma.c.
References wp_api_event::channel, wanpipe_api_cmd::cmd, wanpipe_api_cmd::event, sangoma_cmd_exec(), SANGOMA_INIT_TDM_API_CMD_RESULT, WP_API_EVENT_DISABLE, and wanpipe_api::wp_cmd.

| int _LIBSNG_CALL sangoma_get_tx_queue_sz | ( | sng_fd_t | fd, |
| wanpipe_api_t * | tdm_api | ||
| ) |
Get Tx Queue Size for this channel.
| fd | device file descriptor |
| tdm_api | tdm api command structure |
Definition at line 2922 of file libsangoma.c.
References wanpipe_api_cmd::cmd, sangoma_cmd_exec(), SANGOMA_INIT_TDM_API_CMD_RESULT, wanpipe_api_cmd::tx_queue_sz, WP_API_CMD_GET_TX_Q_SIZE, and wanpipe_api::wp_cmd.
Referenced by open_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.
| fd | device file descriptor |
| tdm_api | tdm api command structure |
| size | tx queue size (minimum value of 1) |
Definition at line 2939 of file libsangoma.c.
References wanpipe_api_cmd::cmd, sangoma_cmd_exec(), SANGOMA_INIT_TDM_API_CMD_RESULT, wanpipe_api_cmd::tx_queue_sz, WP_API_CMD_SET_TX_Q_SIZE, and wanpipe_api::wp_cmd.
Referenced by open_sangoma_device().


| int _LIBSNG_CALL sangoma_get_rx_queue_sz | ( | sng_fd_t | fd, |
| wanpipe_api_t * | tdm_api | ||
| ) |
Get Rx Queue Size for this channel.
| fd | device file descriptor |
| tdm_api | tdm api command structure |
Definition at line 2951 of file libsangoma.c.
References wanpipe_api_cmd::cmd, wanpipe_api_cmd::rx_queue_sz, sangoma_cmd_exec(), SANGOMA_INIT_TDM_API_CMD_RESULT, WP_API_CMD_GET_RX_Q_SIZE, and wanpipe_api::wp_cmd.
Referenced by open_sangoma_device().


| 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.
| fd | device file descriptor |
| tdm_api | tdm api command structure |
| size | rx queue size (minimum value of 1) |
Definition at line 2969 of file libsangoma.c.
References wanpipe_api_cmd::cmd, wanpipe_api_cmd::rx_queue_sz, sangoma_cmd_exec(), SANGOMA_INIT_TDM_API_CMD_RESULT, WP_API_CMD_SET_RX_Q_SIZE, and wanpipe_api::wp_cmd.
Referenced by open_sangoma_device().


| int _LIBSNG_CALL sangoma_get_hw_coding | ( | sng_fd_t | fd, |
| wanpipe_api_t * | tdm_api | ||
| ) |
Get HW Voice Coding (ulaw/alaw)
| fd | device file descriptor |
| tdm_api | tdm api command structure |
Definition at line 2164 of file libsangoma.c.
References wanpipe_api_cmd::cmd, wanpipe_api_cmd::hw_tdm_coding, sangoma_cmd_exec(), SANGOMA_INIT_TDM_API_CMD_RESULT, WP_API_CMD_GET_HW_CODING, and wanpipe_api::wp_cmd.

| int _LIBSNG_CALL sangoma_tdm_get_hw_dtmf | ( | sng_fd_t | fd, |
| wanpipe_api_t * | tdm_api | ||
| ) |
Check if hwdtmf support is available.
| fd | device file descriptor |
| tdm_api | tdm api command structure |
This function will check if hw supports HW DTMF.
Definition at line 2185 of file libsangoma.c.
References wanpipe_api_cmd::cmd, wanpipe_api_cmd::hw_dtmf, sangoma_cmd_exec(), SANGOMA_INIT_TDM_API_CMD_RESULT, WP_API_CMD_GET_HW_DTMF, and wanpipe_api::wp_cmd.

| 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.
| fd | device file descriptor |
| tdm_api | tdm api command structure |
This function will check if hw supports HW EC.
Definition at line 2205 of file libsangoma.c.
References wanpipe_api_cmd::cmd, sangoma_cmd_exec(), SANGOMA_INIT_TDM_API_CMD_RESULT, WP_API_CMD_GET_HW_EC, and wanpipe_api::wp_cmd.

| 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.
| fd | device file descriptor |
| tdm_api | tdm api command structure |
This function will check if hw echo cancelation is enable on current timeslot.
Definition at line 2228 of file libsangoma.c.
References wanpipe_api_cmd::cmd, sangoma_cmd_exec(), SANGOMA_INIT_TDM_API_CMD_RESULT, WP_API_CMD_GET_HW_EC_CHAN, and wanpipe_api::wp_cmd.

| 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.
| fd | device file descriptor |
| tdm_api | tdm api command structure |
This function will check if hw persist mode is enabled.
Definition at line 2254 of file libsangoma.c.
References wanpipe_api_cmd::cmd, sangoma_cmd_exec(), SANGOMA_INIT_TDM_API_CMD_RESULT, WP_API_CMD_GET_HW_EC_PERSIST, and wanpipe_api::wp_cmd.

| int _LIBSNG_CALL sangoma_span_chan_toif | ( | int | span, |
| int | chan, | ||
| char * | interface_name | ||
| ) |
Convert Span & Chan to interface name.
Device OPEN / CLOSE Functions
| span | span number starting from 1 to 255 |
| chan | chan number starting from 1 to 32 |
| interface_name | pointer to string where interface name will be written |
Definition at line 1566 of file libsangoma.c.
References WP_INTERFACE_NAME_FORM.
| int _LIBSNG_CALL sangoma_span_chan_fromif | ( | char * | interface_name, |
| int * | span, | ||
| int * | chan | ||
| ) |
Convert Interace Name to Span & Chan.
| interface_name | pointer to string containing interface name |
| span | integer pointer where to write span value |
| chan | integer pointer where to write chan value |
Definition at line 1640 of file libsangoma.c.
References FNAME_LEN.
| 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)
| span | span number of the device to wait |
| chan | chan number of the device to wait |
| sectimeout | how many seconds to wait for the device to come up, -1 to wait forever |
Definition at line 1608 of file libsangoma.c.
References FNAME_LEN, and WP_INTERFACE_NAME_FORM.
| 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.
| fd | device file descriptor |
| tdm_api | tdm api command structure |
| drv_ver | driver version structure that will contain the driver version |
Definition at line 2982 of file libsangoma.c.
References wanpipe_api_cmd::cmd, sangoma_cmd_exec(), SANGOMA_INIT_TDM_API_CMD_RESULT, WP_API_CMD_DRIVER_VERSION, and wanpipe_api::wp_cmd.

| int _LIBSNG_CALL sangoma_get_firmware_version | ( | sng_fd_t | fd, |
| wanpipe_api_t * | tdm_api, | ||
| unsigned char * | ver | ||
| ) |
Get Hardware/Firmware Version.
| fd | device file descriptor |
| tdm_api | tdm api command structure |
| ver | hardware/firmware version number |
Definition at line 3004 of file libsangoma.c.
References wanpipe_api_cmd::cmd, sangoma_cmd_exec(), SANGOMA_INIT_TDM_API_CMD_RESULT, WP_API_CMD_FIRMWARE_VERSION, and wanpipe_api::wp_cmd.

| int _LIBSNG_CALL sangoma_get_cpld_version | ( | sng_fd_t | fd, |
| wanpipe_api_t * | tdm_api, | ||
| unsigned char * | ver | ||
| ) |
Get AFT CPLD Version.
| fd | device file descriptor |
| tdm_api | tdm api command structure |
| ver | AFT CPLD version number |
Definition at line 3024 of file libsangoma.c.
References wanpipe_api_cmd::cmd, sangoma_cmd_exec(), SANGOMA_INIT_TDM_API_CMD_RESULT, WP_API_CMD_CPLD_VERSION, and wanpipe_api::wp_cmd.

| 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 arrangement with Sangoma Technologies.
| fd | device file descriptor |
| out_customer_id | AFT Customer ID |
Definition at line 3044 of file libsangoma.c.
References SANG_STATUS_IO_ERROR, SANG_STATUS_UNSUPPORTED_FUNCTION, sangoma_mgmt_cmd(), and WANPIPEMON_AFT_CUSTOMER_ID.

| 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). Used to visually identify a phisical port from software.
| fd | device file descriptor |
| led_state | 0=off 1=on |
Definition at line 3068 of file libsangoma.c.
References SANG_STATUS_IO_ERROR, SANG_STATUS_UNSUPPORTED_FUNCTION, sangoma_mgmt_cmd(), and WANPIPEMON_LED_CTRL.

| int _LIBSNG_CALL sangoma_fe_reg_write | ( | sng_fd_t | fd, |
| uint32_t | offset, | ||
| uint8_t | data | ||
| ) |
Write to a front end register.
| fd | device file descriptor |
| offset | offset of front end register |
| data | value to write |
Definition at line 3092 of file libsangoma.c.
References wanpipe_api_cmd::chan, SANG_STATUS_IO_ERROR, SANG_STATUS_UNSUPPORTED_FUNCTION, sangoma_get_full_cfg(), sangoma_mgmt_cmd(), and wanpipe_api::wp_cmd.

| int _LIBSNG_CALL sangoma_fe_reg_read | ( | sng_fd_t | fd, |
| uint32_t | offset, | ||
| uint8_t * | data | ||
| ) |
Read front end register.
| fd | device file descriptor |
| offset | offset of front end register |
| data | value of the read register |
Definition at line 3134 of file libsangoma.c.
References wanpipe_api_cmd::chan, SANG_STATUS_IO_ERROR, SANG_STATUS_UNSUPPORTED_FUNCTION, sangoma_get_full_cfg(), sangoma_mgmt_cmd(), and wanpipe_api::wp_cmd.
Referenced by open_sangoma_device().


| 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.
| fd | device file descriptor |
| tdm_api | tdm api command structure |
| stats | stats structure will be filled with device stats. (Optional, can be left NULL) |
Definition at line 3281 of file libsangoma.c.
References wanpipe_api_cmd::cmd, sangoma_cmd_exec(), SANGOMA_INIT_TDM_API_CMD_RESULT, wanpipe_api_cmd::stats, WP_API_CMD_GET_STATS, and wanpipe_api::wp_cmd.

| int _LIBSNG_CALL sangoma_flush_stats | ( | sng_fd_t | fd, |
| wanpipe_api_t * | tdm_api | ||
| ) |
Flush/Reset device statistics.
| fd | device file descriptor |
| tdm_api | tdm api command structure |
Definition at line 3299 of file libsangoma.c.
References wanpipe_api_cmd::cmd, sangoma_cmd_exec(), SANGOMA_INIT_TDM_API_CMD_RESULT, WP_API_CMD_RESET_STATS, and wanpipe_api::wp_cmd.
Referenced by open_sangoma_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.
| fd | device file descriptor |
| tdm_api | tdm api command structure |
| rxflashtime | time value |
Definition at line 3307 of file libsangoma.c.
References wanpipe_api_cmd::cmd, wanpipe_api_cmd::rxflashtime, sangoma_cmd_exec(), SANGOMA_INIT_TDM_API_CMD_RESULT, WP_API_CMD_SET_RM_RXFLASHTIME, and wanpipe_api::wp_cmd.

| 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
| fd | device file descriptor |
| tdm_api | tdm api command structure |
| value | txgain (FXO - txgain value ranges from -150 to 120 , FXS - txgain value 35,-35) |
Definition at line 3317 of file libsangoma.c.
References wanpipe_api_cmd::cmd, wanpipe_api_cmd::event, sangoma_cmd_exec(), SANGOMA_INIT_TDM_API_CMD_RESULT, WP_API_EVENT_ENABLE, WP_API_EVENT_SET_RM_TX_GAIN, and wanpipe_api::wp_cmd.

| 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
| fd | device file descriptor |
| tdm_api | tdm api command structure |
| value | rxgain (FXO - rxgain value ranges from -150 to 120 , FXS -rxgain value 35,-35) |
Definition at line 3328 of file libsangoma.c.
References wanpipe_api_cmd::cmd, wanpipe_api_cmd::event, sangoma_cmd_exec(), SANGOMA_INIT_TDM_API_CMD_RESULT, WP_API_EVENT_ENABLE, WP_API_EVENT_SET_RM_RX_GAIN, and wanpipe_api::wp_cmd.

| 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.
| fd | device file descriptor |
| tdm_api | tdm api command structure |
Definition at line 3367 of file libsangoma.c.
References wanpipe_api_cmd::cmd, sangoma_cmd_exec(), SANGOMA_INIT_TDM_API_CMD_RESULT, WP_API_CMD_ENABLE_LOOP, and wanpipe_api::wp_cmd.

| int _LIBSNG_CALL sangoma_tdm_disable_loop | ( | sng_fd_t | fd, |
| wanpipe_api_t * | tdm_api | ||
| ) |
Disable channel loop.
| fd | device file descriptor |
| tdm_api | tdm api command structure |
Definition at line 3378 of file libsangoma.c.
References wanpipe_api_cmd::cmd, sangoma_cmd_exec(), SANGOMA_INIT_TDM_API_CMD_RESULT, WP_API_CMD_DISABLE_LOOP, and wanpipe_api::wp_cmd.

| int _LIBSNG_CALL sangoma_read_event | ( | sng_fd_t | fd, |
| wanpipe_api_t * | tdm_api | ||
| ) |
Read API Events.
Device EVENT Function
| fd | device file descriptor |
| tdm_api | tdm api command structure |
The TDM API structure will be populated with a TDM API or WAN Event. This function usually used after wait() function indicated that event has occured.
Definition at line 2426 of file libsangoma.c.
References wanpipe_api_cmd::cmd, wanpipe_api_cmd::event, sangoma_cmd_exec(), SANGOMA_INIT_TDM_API_CMD_RESULT, WP_API_EVENT_DTMF, WP_API_EVENT_RBS, wanpipe_api::wp_callback, and wanpipe_api::wp_cmd.
Referenced by handle_tdm_event().


| sangoma_status_t _LIBSNG_CALL sangoma_logger_read_event | ( | sng_fd_t | fd, |
| wp_logger_cmd_t * | logger_cmd | ||
| ) |
Read Wanpipe Logger Events.
| fd | device file descriptor |
| logger_cmd | Logger API command structure |
The Logger API structure will be populated with a Logger Event. This function usually used after wait() function indicated that an event has occured.
Definition at line 2556 of file libsangoma.c.
| sangoma_status_t _LIBSNG_CALL sangoma_logger_flush_buffers | ( | sng_fd_t | fd, |
| wp_logger_cmd_t * | logger_cmd | ||
| ) |
Flush Wanpipe Logger internal buffers.
| fd | device file descriptor |
| logger_cmd | Logger API command structure |
Definition at line 2562 of file libsangoma.c.
| sangoma_status_t _LIBSNG_CALL sangoma_logger_get_statistics | ( | sng_fd_t | fd, |
| wp_logger_cmd_t * | logger_cmd | ||
| ) |
Get Wanpipe Logger statistics.
| fd | device file descriptor |
| logger_cmd | Logger API command structure |
Definition at line 2568 of file libsangoma.c.
| sangoma_status_t _LIBSNG_CALL sangoma_logger_reset_statistics | ( | sng_fd_t | fd, |
| wp_logger_cmd_t * | logger_cmd | ||
| ) |
Reset Wanpipe Logger statistics.
| fd | device file descriptor |
| logger_cmd | Logger API command structure |
Definition at line 2574 of file libsangoma.c.
| 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.
| fd | device file descriptor |
| logger_cmd | Logger API command structure |
Definition at line 2580 of file libsangoma.c.
| 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.
| fd | device file descriptor |
| logger_cmd | Logger API command structure |
Definition at line 2586 of file libsangoma.c.
| 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.
| fd | device file descriptor |
| logger_cmd | Logger API command structure |
Definition at line 2592 of file libsangoma.c.
| int sangoma_clear_tx_gain | ( | sng_fd_t | fd, |
| wanpipe_api_t * | tdm_api | ||
| ) |
Clear tx gain from device, set it to 0.0.
| fd | device file descriptor |
| tdm_api | tdm api command structure |
| int sangoma_clear_rx_gain | ( | sng_fd_t | fd, |
| wanpipe_api_t * | tdm_api | ||
| ) |
Clear rx gain from device, set it to 0.0.
| fd | device file descriptor |
| tdm_api | tdm api command structure |
| 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.
Device PORT Control Functions
| [in] | fd | Port Device file descriptor |
| [out] | port_mgmnt | pointer to a port_management_struct_t structure. On return, sangoma_driver_port_start() updates operation_status field of this structure. |
| [in] | port_no | 1-based Port Number. Port numbers correspond to Port Names. For example, a 2-Port card will have ports named WANPIPE1 and WANPIPE2. |
Definition at line 151 of file libsangoma_config.c.
References SANG_STATUS_GENERAL_ERROR, and sangoma_port_mgmnt_ioctl().

| 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.
| [in] | fd | Port Device file descriptor |
| [out] | port_mgmnt | pointer to a port_management_struct_t structure. On return, sangoma_driver_port_stop() updates operation_status field of this structure. |
| [in] | port_no | 1-based Port Number. Port numbers correspond to Port Names. For example, a 2-Port card will have ports named WANPIPE1 and WANPIPE2. |
Definition at line 167 of file libsangoma_config.c.
References SANG_STATUS_CAN_NOT_STOP_DEVICE_WHEN_ALREADY_STOPPED, SANG_STATUS_GENERAL_ERROR, SANG_STATUS_SUCCESS, and sangoma_port_mgmnt_ioctl().

| 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. Before calling this function please stop the port by calling sangoma_driver_port_stop(). After calling this function please start the port by calling sangoma_driver_port_start().
| [in] | fd | Port Device file descriptor |
| [in,out] | port_cfg | pointer to port_cfg_t structure that specifies complete Port configuration. On return, sangoma_driver_port_set_config() updates operation_status field of this structure. |
| [in] | port_no | 1-based Port Number. Port numbers correspond to Port Names. For example, a 2-Port card will have ports named WANPIPE1 and WANPIPE2. |
Definition at line 244 of file libsangoma_config.c.
References SANG_STATUS_GENERAL_ERROR.
| 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.
| [in] | fd | Port Device file descriptor |
| [out] | port_cfg | pointer to port_cfg_t structure. On return, sangoma_driver_port_get_config() will copy current Port configuration into this structure. |
| [in] | port_no | please see comment of sangoma_driver_port_set_config() |
Definition at line 253 of file libsangoma_config.c.
References SANG_STATUS_GENERAL_ERROR.
| 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.
| [in] | fd | Port Device file descriptor |
| [out] | port_mgmnt | pointer to port_management_struct_t structure which will contain hardware_info_t at it's "data" field, when this function returns. |
| [in] | port_no | please see comment of sangoma_driver_port_set_config() |
Definition at line 196 of file libsangoma_config.c.
References SANG_STATUS_GENERAL_ERROR, and sangoma_port_mgmnt_ioctl().

| 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_version() can not be called.
| [in] | fd | Port Device file descriptor |
| [out] | port_mgmnt | pointer to port_management_struct_t structure which will contain wan_driver_version_t at it's "data" field, when this function returns. |
| [in] | port_no | please see comment of sangoma_driver_port_set_config() |
Definition at line 211 of file libsangoma_config.c.
References sangoma_port_mgmnt_ioctl().

| 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.
| [in] | fd | Port Device file descriptor |
| [out] | port_mgmnt | pointer to port_management_struct_t structure which will contain wan_driver_version_t at it's "data" field, when this function returns. |
| [out] | detected_port_cnt | newly detected ports. |
Definition at line 226 of file libsangoma_config.c.
References sangoma_port_mgmnt_ioctl().

| int _LIBSNG_CALL sangoma_mgmt_cmd | ( | sng_fd_t | fd, |
| wan_udp_hdr_t * | wan_udp | ||
| ) |
Execute Sangoma Management Command.
Device MANAGEMENT Functions
| fd | device file descriptor |
| wan_udp | management command structure |
Definition at line 122 of file libsangoma_config.c.
References WANPIPE_IOCTL_PIPEMON.
Referenced by sangoma_fe_reg_read(), sangoma_fe_reg_write(), sangoma_get_aft_customer_id(), and sangoma_port_led_ctrl().

| 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)
| fd | device file descriptor |
| tdm_api | tdm api command structure |
| current_status | pointer where result will be filled: 0=Link UP 1=Link Down |
Deprecated - replaced by sangoma_tdm_get_link_status function
Definition at line 2860 of file libsangoma.c.
References wanpipe_api_cmd::cmd, wanpipe_api_cmd::fe_status, sangoma_cmd_exec(), SANGOMA_INIT_TDM_API_CMD_RESULT, and wanpipe_api::wp_cmd.

| int _LIBSNG_CALL sangoma_tdm_set_codec | ( | sng_fd_t | fd, |
| wanpipe_api_t * | tdm_api, | ||
| int | codec | ||
| ) |
Set TDM Codec per chan.
| fd | device file descriptor |
| tdm_api | tdm api command structure |
| codec | codec to set (ulaw/alaw/slinear) |
Deprecated Function - Here for backward compatibility Only valid in CHAN Operation Mode
Definition at line 2082 of file libsangoma.c.
References wanpipe_api_cmd::cmd, sangoma_cmd_exec(), SANGOMA_INIT_TDM_API_CMD_RESULT, wanpipe_api_cmd::tdm_codec, WP_API_CMD_SET_CODEC, and wanpipe_api::wp_cmd.
Referenced by open_sangoma_device().


| int _LIBSNG_CALL sangoma_tdm_get_codec | ( | sng_fd_t | fd, |
| wanpipe_api_t * | tdm_api | ||
| ) |
Get Configured TDM Codec per chan.
| fd | device file descriptor |
| tdm_api | tdm api command structure |
Deprecated Function - Here for backward compatibility Only valid in CHAN Operation Mode
Definition at line 2103 of file libsangoma.c.
References wanpipe_api_cmd::cmd, sangoma_cmd_exec(), SANGOMA_INIT_TDM_API_CMD_RESULT, wanpipe_api_cmd::tdm_codec, WP_API_CMD_GET_CODEC, and wanpipe_api::wp_cmd.

| sng_fd_t _LIBSNG_CALL sangoma_create_socket_by_name | ( | char * | device, |
| char * | card | ||
| ) |
Open a device based on a interface and card name.
| device | interface name |
| card | card name |
Deprecated - here for backward compatibility
Definition at line 1778 of file libsangoma.c.
References sangoma_interface_toi(), and sangoma_open_api_span_chan().

| int _LIBSNG_CALL sangoma_interface_toi | ( | char * | interface_name, |
| int * | span, | ||
| int * | chan | ||
| ) |
Convert Span & Chan to interface name.
| interface_name | pointer to string where interface name will be written |
| span | span number starting from 1 to 255 |
| chan | chan number starting from 1 to 32 |
Definition at line 1577 of file libsangoma.c.
References FNAME_LEN.
Referenced by sangoma_create_socket_by_name().

| 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.
| fd | device file descriptor |
| tdm_api | tdm api command structure |
| power | value of power |
Deprecated - not used/implemented
Definition at line 2298 of file libsangoma.c.
References wanpipe_api_cmd::cmd, wanpipe_api_cmd::power_level, sangoma_cmd_exec(), SANGOMA_INIT_TDM_API_CMD_RESULT, WP_API_CMD_SET_POWER_LEVEL, and wanpipe_api::wp_cmd.

| int _LIBSNG_CALL sangoma_tdm_get_power_level | ( | sng_fd_t | fd, |
| wanpipe_api_t * | tdm_api | ||
| ) |
Get Configured Power Level.
| fd | device file descriptor |
| tdm_api | tdm api command structure |
Deprecated - not used/implemented
Definition at line 2313 of file libsangoma.c.
References wanpipe_api_cmd::cmd, wanpipe_api_cmd::power_level, sangoma_cmd_exec(), SANGOMA_INIT_TDM_API_CMD_RESULT, WP_API_CMD_GET_POWER_LEVEL, and wanpipe_api::wp_cmd.

| 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 configuration paramters, if any, must be specified at the time of chip initialization. Note that Analog card is considered a "single-port" card by HWEC API. That means for Analog cards and for single-port digital cards only a single sangoma_hwec_config_init() call is required, all subsequent calls will have no effect. For multi-port cards, such as A102/A104/A108/A500, the sangoma_hwec_config_init() must be called for each port, at least one time. Only the first call will actually load the Firmware image onto EC chip, all subsequent calls (for other ports) will only add the Port to list of ports which use the HWEC API. Actions of sangoma_hwec_config_init() can be reversed by calling sangoma_hwec_config_release(). When Port is stopped, the HWEC API automatically releases per-port resources and removes the Port from list ports which use HWEC API.
| device_name | Sangoma API device name. Windows: wanpipe1_if1, wanpipe2_if1... Note that wanpipe1_if1 and wanpipe1_if2 will access the same Port - wanpipe1. Linux: wanpipe1, wanpipe2... |
| custom_params[] | - (optional) array of custom paramter structures. This is list of Echo Cancellation chip parameters: Chip parameter Chip parameter value ================= ======================= WANEC_TailDisplacement 0-896 WANEC_MaxPlayoutBuffers 0-4678 WANEC_EnableExtToneDetection TRUE | FALSE WANEC_EnableAcousticEcho TRUE | FALSE |
| number_of_custom_params | - (optional) number of structures in custom_params[]. Minimum value is 1, maximum is 4, if any other value the custom_params[] will be ignored. |
Definition at line 215 of file libsangoma_hwec.c.
References SANG_STATUS_FAILED_ALLOCATE_MEMORY, and SANG_STATUS_SUCCESS.
| 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 A200 (A200 is an Analog card and considered sinle-port by HWEC API), a single call to sangoma_hwec_config_release() will free the per-chip resources. For multi-port cards, such as A102/A104/A108/A500, sangoma_hwec_config_release() can be called for each port to remove it from list Ports which are using HWEC API. When sangoma_hwec_config_release() is called for the last Port which was "configured/initialized by HWEC API", the per-chip resources will be freed.
| device_name | Sangoma API device name. Windows: wanpipe1_if1, wanpipe2_if1... Note that wanpipe1_if1 and wanpipe1_if2 will access the same Port - wanpipe1. Linux: wanpipe1, wanpipe2... |
Definition at line 283 of file libsangoma_hwec.c.
| sangoma_status_t _LIBSNG_CALL sangoma_hwec_config_operation_mode | ( | char * | device_name, |
| int | mode, | ||
| unsigned int | fe_chan_map | ||
| ) |
Modify channel operation mode.
Modify channel operation mode.
| mode | One of WANEC_API_OPMODE_? values defined in wanpipe_api_iface.h: WANEC_API_OPMODE_NORMAL, WANEC_API_OPMODE_HT_FREEZE, WANEC_API_OPMODE_HT_RESET, WANEC_API_OPMODE_POWER_DOWN, WANEC_API_OPMODE_NO_ECHO, WANEC_API_OPMODE_SPEECH_RECOGNITION. |
| fe_chan_map | Bitmap of channels (timeslots for Digital, lines for Analog) where the call will take effect. |
Definition at line 298 of file libsangoma_hwec.c.
Referenced by sangoma_hwec_config_power_off(), and sangoma_hwec_config_power_on().

| 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 inside the chip. The action is internal to EC chip itself, not related to AFT FPGA. This call is slow and should be used only on startup.
| device_name | Sangoma API device name. Windows: wanpipe1_if1, wanpipe2_if1... Linux: wanpipe1, wanpipe2... |
| fe_chan_map | Bitmap of channels (timeslots for Digital, lines for Analog) where the call will take effect. |
Definition at line 338 of file libsangoma_hwec.c.
References sangoma_hwec_config_operation_mode().

| 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 the chip and data passes unmodified through the ec chip. The action is internal to EC chip itself, not related to AFT FPGA. This call is slow and should be used only on startup.
| device_name | Sangoma API device name. Windows: wanpipe1_if1, wanpipe2_if1... Linux: wanpipe1, wanpipe2... |
| fe_chan_map | Bitmap of channels (timeslots for Digital, lines for Analog) where the call will take effect. |
Definition at line 361 of file libsangoma_hwec.c.
References sangoma_hwec_config_operation_mode().

| 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 since data is now forced through the EC chip by the FPGA. Data will be modified by the echo canceller. This command is recommened for fast enabling of Echo Cancellation. Note 1: Chip must be configured and in POWER ON state for echo Chancellation to take place. Note 2: sangoma_tdm_enable_hwec() function can be used to achive the same funcitnality based on file descriptor versus channel map.
Redirect audio stream from AFT FPGA to EC chip. This command effectively enables echo cancellation since data is now forced through the EC chip by the FPGA. Data will be modified by the echo canceller. This command is recommened for fast enabling of Echo Cancellation. Note 1: Chip must be configured and in POWER ON state for echo Chancellation to take place. Note 2: sangoma_tdm_enable_hwec() function can be use to achive the same funcitnality based on file descriptor versus channel map.
| device_name | Sangoma API device name. Windows: wanpipe1_if1, wanpipe2_if1... Linux: wanpipe1, wanpipe2... |
| fe_chan_map | Bitmap of channels (timeslots for Digital, lines for Analog) where the call will take effect. |
Definition at line 389 of file libsangoma_hwec.c.
| 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 since data will not flowing through the ec chip. Data will not be modified by the echo canceller. This command is recommened for fast disabling of Echo Cancelation. Note: sangoma_tdm_disable_hwec() function can be use to achive the same functionality based on file descriptor versus channel map.
Force AFT FPGA to bypass the echo canceller. This command effectively disables echo cancellation since data will not be flowing through the ec chip. Data will not be modified by the echo canceller. This command is recommened for fast disabling of Echo Cancelation. Note: sangoma_tdm_disable_hwec() function can be used to achive the same functionality based on file descriptor versus channel map.
| device_name | Sangoma API device name. Windows: wanpipe1_if1, wanpipe2_if1... Linux: wanpipe1, wanpipe2... |
| fe_chan_map | Bitmap of channels (timeslots for Digital, lines for Analog) where the call will take effect. |
Definition at line 416 of file libsangoma_hwec.c.
| 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.
| device_name | Sangoma API device name. Windows: wanpipe1_if1, wanpipe2_if1... Linux: wanpipe1, wanpipe2... |
| parameter | Echo Cancellation channel parameter |
This channel parameters are listed under "Channel parameter":
Channel parameter Channel parameter value ================= ======================= WANEC_EnableNlp TRUE | FALSE WANEC_EnableTailDisplacement TRUE | FALSE WANEC_TailDisplacement 0-896 WANEC_SoutLevelControl TRUE | FALSE WANEC_RinAutomaticLevelControl TRUE | FALSE WANEC_SoutAutomaticLevelControl TRUE | FALSE WANEC_SoutAdaptiveNoiseReduction TRUE | FALSE WANEC_RoutNoiseReduction TRUE | FALSE WANEC_ComfortNoiseMode COMFORT_NOISE_NORMAL COMFORT_NOISE_FAST_LATCH COMFORT_NOISE_EXTENDED COMFORT_NOISE_OFF WANEC_DtmfToneRemoval TRUE | FALSE WANEC_AcousticEcho TRUE | FALSE WANEC_NonLinearityBehaviorA 0-13 WANEC_NonLinearityBehaviorB 0-8 WANEC_DoubleTalkBehavior DT_BEH_NORMAL DT_BEH_LESS_AGGRESSIVE WANEC_AecTailLength 128 (default), 256, 512 or 1024 WANEC_EnableToneDisabler TRUE | FALSE
| parameter_value | channel parameter value, listed under "Channel parameter value" |
| fe_chan_map | Bitmap of channels (timeslots for Digital, lines for Analog) where the call will take effect. |
| device_name | Sangoma API device name. Windows: wanpipe1_if1, wanpipe2_if1... Linux: wanpipe1, wanpipe2... |
| parameter | Echo Cancellation channel parameter |
This is list of Echo Cancellation channel parameters:
Channel parameter Channel parameter value ================= ======================= WANEC_EnableNlp TRUE | FALSE WANEC_EnableTailDisplacement TRUE | FALSE WANEC_TailDisplacement 0-896 WANEC_SoutLevelControl TRUE | FALSE WANEC_RinAutomaticLevelControl TRUE | FALSE WANEC_SoutAutomaticLevelControl TRUE | FALSE WANEC_SoutAdaptiveNoiseReduction TRUE | FALSE WANEC_RoutNoiseReduction TRUE | FALSE WANEC_ComfortNoiseMode COMFORT_NOISE_NORMAL COMFORT_NOISE_FAST_LATCH COMFORT_NOISE_EXTENDED COMFORT_NOISE_OFF WANEC_DtmfToneRemoval TRUE | FALSE WANEC_AcousticEcho TRUE | FALSE WANEC_NonLinearityBehaviorA 0-13 WANEC_NonLinearityBehaviorB 0-8 WANEC_DoubleTalkBehavior DT_BEH_NORMAL DT_BEH_LESS_AGGRESSIVE WANEC_AecTailLength 128 (default), 256, 512 or 1024 WANEC_EnableToneDisabler TRUE | FALSE
| fe_chan_map | Bitmap of channels (timeslots for Digital, lines for Analog) where the call will take effect. |
Definition at line 464 of file libsangoma_hwec.c.
References sangoma_hwec_initialize_custom_parameter_structure().

| 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.
| device_name | Sangoma API device name. Windows: wanpipe1_if1, wanpipe2_if1... Linux: wanpipe1, wanpipe2... |
| tone_id | See wanpipe_api_iface.h for list of valid tones |
| enable | A flag, if 1 - the specified tone will be detected, if 0 - specified tone will not be detected. |
| fe_chan_map | Bitmap of channels (timeslots for Digital, lines for Analog) where the call will take effect. |
| port_map | Port of tone detection - Rx, Tx. See wanpipe_events.h for list of valid ports (WAN_EC_CHANNEL_PORT_SOUT...). |
Definition at line 505 of file libsangoma_hwec.c.
| 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.
| device_name | Sangoma API device name. Windows: wanpipe1_if1, wanpipe2_if1... Linux: wanpipe1, wanpipe2... |
| full | Flag to read full statistics, if set to 1. |
| fe_chan | Channel number (a timeslot for Digital, a line for Analog) where the call will read statistics. Values from 1 to 31 will indicate the channel nuber. A value of zero will indicate request to print global chip statistics, not per-channel statistics. |
| device_name | Sangoma API device name. Windows: wanpipe1_if1, wanpipe2_if1... Linux: wanpipe1, wanpipe2... |
| full | Flag to read full statistics, if set to 1. |
| fe_chan_map | Bitmap of channels (timeslots for Digital, lines for Analog) where the call will read statistics. |
Definition at line 541 of file libsangoma_hwec.c.
| 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_playout() function.
| filename | name of the audio file (without the extension). Actual file must have .pcm extension. Location: Windows: SystemRoot% (ex: c:) Linux: /etc/wanpipe/buffers |
| out_buffer_id | when the buffer is loaded on the chip, it is assigned an ID. This ID should be used when requesting to play out the buffer. |
| buffer | Pointer to in memory buffer to be loaded on the chip. |
| size | Size of buffer. |
| out_buffer_id | when the buffer is loaded on the chip, it is assigned an ID. This ID should be used when requesting to play out the buffer. |
Definition at line 574 of file libsangoma_hwec.c.
References SANG_STATUS_SUCCESS.
| 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().
| fe_chan_map | Bitmap of channels (timeslots for Digital, lines for Analog) where the call will take effect. |
| port_map | Port where the buffer will be played out. This is the channel port on which the buffer will be played (WAN_EC_CHANNEL_PORT_SOUT or WAN_EC_CHANNEL_PORT_ROUT) |
| in_buffer_id | ID of the buffer which will be unloaded. The ID must be initialized by sangoma_hwec_audio_bufferload(). |
| start | If 1 - start the play out, 0 - stop the play out |
| repeat_cnt | Number of times to play out the same buffer |
| duration | Maximum duration of the playout, in milliseconds. If it takes less then 'duration' to play out the whole buffer, it will be repeated to fill 'duration' amount of time. If 'duration' is set to non-zero, this parameter overrides the repeat_cnt flag. |
Definition at line 677 of file libsangoma_hwec.c.
References start().

| 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 and to wanpipelog.txt (Windows) or /var/log/messages (Linux) for diagnostic purposes.
Set Verbosity level of EC API. The level controls amount of data printed to stdout and wanpipelog.txt for diagnostic purposes.
| verbosity_level | Valid values are from 0 to 3. |
| verbosity_level | Valid values are from 0 to 3. |
Definition at line 712 of file libsangoma_hwec.c.
References SANG_STATUS_INVALID_PARAMETER, and SANG_STATUS_SUCCESS.
| 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.
| parameter_name | Parameter Name |
| parameter_value | Parameter Value |
Definition at line 166 of file libsangoma_hwec.c.
Referenced by sangoma_hwec_config_channel_parameter().

| 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.
| fd | device file descriptor |
| hwec_api_return_code | will contain one of WAN_EC_API_RC_x codes which are defined in wanec_iface_api.h |
| wanec_chip_stats | structure will be filled with HWEC channel statistics. |
| verbose | Flag indicating to the Driver to print additional information about the command into Wanpipe Log file. |
| reset | Flag to reset (flush) global statistics to zero, if set to 1. |
Definition at line 793 of file libsangoma_hwec.c.
References SANG_STATUS_SUCCESS.
| 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.
| fd | device file descriptor |
| hwec_api_return_code | will contain one of WAN_EC_API_RC_x codes which are defined in wanec_iface_api.h |
| wanec_chip_image_t | structure will be filled with HWEC channel statistics. |
| verbose | Flag indicating to the Driver to print additional information about the command into Wanpipe Log file. |
Definition at line 843 of file libsangoma_hwec.c.
References SANG_STATUS_SUCCESS.
| 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.
| fd | device file descriptor |
| tdm_api | tdm api command structure |
Definition at line 3400 of file libsangoma.c.
References wanpipe_api_cmd::cmd, sangoma_cmd_exec(), SANGOMA_INIT_TDM_API_CMD_RESULT, WP_API_CMD_SS7_FORCE_RX, and wanpipe_api::wp_cmd.

| 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.
| fd | device file descriptor |
| tdm_api | tdm api command structure |
| ss7_cfg_status | ss7 configuration status structure |
Definition at line 3410 of file libsangoma.c.
References wanpipe_api_cmd::cmd, sangoma_cmd_exec(), SANGOMA_INIT_TDM_API_CMD_RESULT, WP_API_CMD_SS7_GET_CFG_STATUS, and wanpipe_api::wp_cmd.
Referenced by open_sangoma_device().


1.8.5