libsangoma  1
Public Member Functions | Public Attributes | Protected Member Functions | Protected Attributes | List of all members
sangoma_interface Class Reference

Sangoma Interface Class that deals with span/chan IO (read/write/events) More...

#include <sangoma_interface.h>

Inheritance diagram for sangoma_interface:
Inheritance graph
[legend]
Collaboration diagram for sangoma_interface:
Collaboration graph
[legend]

Public Member Functions

 sangoma_interface (int wanpipe_number, int interface_number)
 
int DoManagementCommand (sng_fd_t drv, wan_udp_hdr_t *packet)
 
virtual int init (callback_functions_t *callback_functions_ptr)
 
int run ()
 
int stop ()
 
int transmit (wp_api_hdr_t *hdr, void *data)
 
int receive (wp_api_hdr_t *hdr, void *data)
 
void bit_swap_a_buffer (unsigned char *data, int len)
 
void get_te1_56k_stat (void)
 
void set_lb_modes (unsigned char type, unsigned char mode)
 
int loopback_command (u_int8_t type, u_int8_t mode, u_int32_t chan_map)
 
int get_operational_stats (wanpipe_chan_stats_t *stats)
 
virtual int flush_operational_stats (void)
 
int CreateSwDtmfTxThread (void *buffer)
 
int CreateFskCidTxThread (void *buffer)
 
int enable_rbs_monitoring ()
 
char get_rbs (rbs_management_t *rbs_management_ptr)
 
char set_rbs (rbs_management_t *rbs_management_ptr)
 
int tdm_enable_rbs_events (int polls_per_second)
 
int tdm_disable_rbs_events ()
 
int set_tx_idle_flag (unsigned char new_idle_flag)
 
int get_open_handles_counter ()
 
int flush_tx_buffers (void)
 
unsigned char get_adapter_type ()
 
unsigned int get_sub_media ()
 
void set_fe_debug_mode (sdla_fe_debug_t *fe_debug)
 
void get_api_driver_version (PDRIVER_VERSION version)
 
void get_card_customer_id (u_int8_t *customer_id)
 
int resetFSKCID (void)
 
int sendCallerID (char *name, char *number)
 
int sendSwDTMF (char dtmf_char)
 
int tdm_enable_rxhook_events ()
 
int tdm_disable_rxhook_events ()
 
int tdm_enable_rm_dtmf_events ()
 
int tdm_disable_rm_dtmf_events ()
 
int tdm_enable_dtmf_events (uint8_t channel)
 
int tdm_disable_dtmf_events (uint8_t channel)
 
int tdm_enable_ring_detect_events ()
 
int tdm_disable_ring_detect_events ()
 
int tdm_enable_ring_trip_detect_events ()
 
int tdm_disable_ring_trip_detect_events ()
 
int tdm_enable_ring_events ()
 
int tdm_disable_ring_events ()
 
int tdm_txsig_onhook ()
 
int tdm_txsig_offhook ()
 
int tdm_txsig_kewl ()
 
int tdm_txsig_onhooktransfer ()
 
int tdm_enable_tone_events (uint16_t tone_id)
 
int tdm_disable_tone_events ()
 
int tdm_front_end_activate ()
 
int tdm_front_end_deactivate ()
 
int tdm_control_flash_events (int rxflashtime)
 
int tdm_control_rm_txgain (int txgain)
 
int tdm_control_rm_rxgain (int rxgain)
 
int tdm_set_rm_polarity (int polarity)
 
int tdm_get_front_end_status (unsigned char *status)
 
int tdm_set_user_period (unsigned int usr_period)
 
int tdmv_api_ioctl (wanpipe_api_cmd_t *api_cmd)
 
int reset_interface_state ()
 
int start_ring_tone ()
 
int stop_ring_tone ()
 
int start_congestion_tone ()
 
int stop_congestion_tone ()
 
int start_busy_tone ()
 
int stop_busy_tone ()
 
int stop_all_tones ()
 
int start_dial_tone ()
 
int stop_dial_tone ()
 
int start_ringing_phone ()
 
int stop_ringing_phone ()
 
int fxo_go_off_hook ()
 
int fxo_go_on_hook ()
 
int fxs_txsig_offhook ()
 
int tdm_enable_bri_bchan_loopback (u_int8_t channel)
 
int tdm_disable_bri_bchan_loopback (u_int8_t channel)
 

Public Attributes

char device_name [DEV_NAME_LEN]
 
char is_logger_dev
 

Protected Member Functions

unsigned char get_wan_udphdr_data_byte (unsigned char off)
 
unsigned char * get_wan_udphdr_data_ptr (unsigned char off)
 
unsigned char set_wan_udphdr_data_byte (unsigned char off, unsigned char data)
 
void RxThreadFunc ()
 
void TxThreadFunc ()
 
int read_data ()
 
virtual int read_event ()
 
int write_data (wp_api_hdr_t *hdr, void *tx_buffer)
 
void cleanup ()
 
int get_wan_config ()
 
int get_interface_configuration (if_cfg_t *wanif_conf_ptr)
 
int get_fe_type (unsigned char *adapter_type)
 
int wanpipe_api_ioctl (wan_cmd_api_t *api_cmd)
 
void generate_bit_rev_table ()
 
void TxStelEncoderBuffer (void *pStelEncoderBuffer)
 
virtual unsigned long threadFunction (struct ThreadParam &thParam)
 

Protected Attributes

sng_fd_t sangoma_dev
 
sangoma_wait_obj_t * sng_wait_obj [SANGOMA_INTERFACE_NUMBER_OF_WAIT_OBJECTS]
 
ULONG rx_frames_count
 
ULONG rx_bytes_count
 
ULONG bad_rx_frames_count
 
DWORD dwRxThreadId
 
ULONG tx_bytes_count
 
ULONG tx_frames_count
 
UCHAR tx_test_byte
 
wan_udp_hdr_t wan_udp
 
int protocol_cb_size
 
int wan_protocol
 
unsigned char adapter_type
 
wanpipe_api_cmd_t tdm_api_cmd
 
wanpipe_api_t wp_api
 
unsigned char wp_brt [256]
 
char is_rbs_monitoring_enabled
 
stelephony_callback_functions_t scf
 
void * stelObj
 
void * DtmfBuffer
 
void * FskCidBuffer
 
CRITICAL_SECTION StelTxCriticalSection
 
char terminate_tx_rx_threads
 
wp_api_hdr_t rxhdr
 
unsigned char rx_data [SAMPLE_CPP_MAX_DATA_LEN]
 
wp_api_hdr_t txhdr
 
unsigned char tx_data [SAMPLE_CPP_MAX_DATA_LEN]
 
if_cfg_t wanif_conf_struct
 
int WanpipeNumber
 
int InterfaceNumber
 
callback_functions_t callback_functions
 

Detailed Description

Sangoma Interface Class that deals with span/chan IO (read/write/events)

Definition at line 104 of file sangoma_interface.h.

Member Function Documentation

unsigned char sangoma_interface::get_wan_udphdr_data_byte ( unsigned char  off)
protected

deprecated: Helper function to get data byte out of wan_udp structure

unsigned char* sangoma_interface::get_wan_udphdr_data_ptr ( unsigned char  off)
protected

deprecated: Helper function to get data pointer out of wan_udp structure

unsigned char sangoma_interface::set_wan_udphdr_data_byte ( unsigned char  off,
unsigned char  data 
)
protected

deprecated: Helper function to set data pointer out of wan_udp structure

void sangoma_interface::RxThreadFunc ( )
protected

Rx Thread function

void sangoma_interface::TxThreadFunc ( )
protected

Tx Thread function

int sangoma_interface::read_data ( )
protected

Rx Data handler function

virtual int sangoma_interface::read_event ( )
protectedvirtual

Rx Event handler function

Reimplemented in sangoma_api_logger_dev.

void sangoma_interface::cleanup ( )
protected

Shutdown function to cleanup the class

int sangoma_interface::get_wan_config ( )
protected

Get device span configuration

int sangoma_interface::get_interface_configuration ( if_cfg_t *  wanif_conf_ptr)
protected

Get interface chan configuration

int sangoma_interface::get_fe_type ( unsigned char *  adapter_type)
protected

Get front end type (T1/E1...)

int sangoma_interface::wanpipe_api_ioctl ( wan_cmd_api_t api_cmd)
protected

deprecated: Execute API command IOCTL - one should use libsangoma directly

void sangoma_interface::generate_bit_rev_table ( )
protected

deprecated: Generate bit reversal table - not used with new sangoma cards

int sangoma_interface::transmit ( wp_api_hdr_t hdr,
void *  data 
)

Write data to device

Referenced by tx_file().

Here is the caller graph for this function:

int sangoma_interface::receive ( wp_api_hdr_t hdr,
void *  data 
)

Read data from device

Member Data Documentation

sng_fd_t sangoma_interface::sangoma_dev
protected

Sangoma IO device descriptor

Definition at line 108 of file sangoma_interface.h.

sangoma_wait_obj_t* sangoma_interface::sng_wait_obj[SANGOMA_INTERFACE_NUMBER_OF_WAIT_OBJECTS]
protected

wait object for an IO device

Definition at line 111 of file sangoma_interface.h.

ULONG sangoma_interface::rx_frames_count
protected

< rx count statistic

Definition at line 116 of file sangoma_interface.h.

ULONG sangoma_interface::rx_bytes_count
protected

rx byte statistic

Definition at line 118 of file sangoma_interface.h.

ULONG sangoma_interface::bad_rx_frames_count
protected

corrupted frame count statistic

Definition at line 121 of file sangoma_interface.h.

DWORD sangoma_interface::dwRxThreadId
protected

Rx thread id used for launching threads that handle rx path

Definition at line 123 of file sangoma_interface.h.

ULONG sangoma_interface::tx_bytes_count
protected

tx byte statistic

Definition at line 128 of file sangoma_interface.h.

ULONG sangoma_interface::tx_frames_count
protected

tx frame statistic

Definition at line 130 of file sangoma_interface.h.

UCHAR sangoma_interface::tx_test_byte
protected

tx test byte sent statistic

Definition at line 132 of file sangoma_interface.h.

wan_udp_hdr_t sangoma_interface::wan_udp
protected

deprecated: ioctl management structure, used to execute management commands - one should use libsangoma directly

Definition at line 137 of file sangoma_interface.h.

int sangoma_interface::protocol_cb_size
protected

deprecated: protocol command structure size

Definition at line 149 of file sangoma_interface.h.

int sangoma_interface::wan_protocol
protected

device low level protocol (T1/E1...) currently running

Definition at line 151 of file sangoma_interface.h.

unsigned char sangoma_interface::adapter_type
protected

device adapter type

Definition at line 153 of file sangoma_interface.h.

wanpipe_api_cmd_t sangoma_interface::tdm_api_cmd
protected

deprecated: API command structure used to execute API commands

Definition at line 156 of file sangoma_interface.h.

wanpipe_api_t sangoma_interface::wp_api
protected

API command structure used to execute API commands. This command structure is used with libsangoma library

Definition at line 159 of file sangoma_interface.h.

unsigned char sangoma_interface::wp_brt[256]
protected

Bert test pattern

Definition at line 189 of file sangoma_interface.h.

char sangoma_interface::is_rbs_monitoring_enabled
protected

Flag indicating that rbs is enabled

Definition at line 195 of file sangoma_interface.h.

stelephony_callback_functions_t sangoma_interface::scf
protected

Stelephony provides Analog CallierID and DTMF encoding/decoding

Definition at line 199 of file sangoma_interface.h.

wp_api_hdr_t sangoma_interface::rxhdr
protected

API header for rx data

Definition at line 212 of file sangoma_interface.h.

unsigned char sangoma_interface::rx_data[SAMPLE_CPP_MAX_DATA_LEN]
protected

Data buffer to copy rx data into

Definition at line 214 of file sangoma_interface.h.

wp_api_hdr_t sangoma_interface::txhdr
protected

API header for tx data

Definition at line 217 of file sangoma_interface.h.

unsigned char sangoma_interface::tx_data[SAMPLE_CPP_MAX_DATA_LEN]
protected

Data buffer to copy tx data into

Definition at line 219 of file sangoma_interface.h.

if_cfg_t sangoma_interface::wanif_conf_struct
protected

Wanpipe Interface configuration structure to be populated on read configuration

Definition at line 222 of file sangoma_interface.h.

int sangoma_interface::WanpipeNumber
protected

Wanpipe Device number based on hardware probe device enumeration (SPAN)

Definition at line 225 of file sangoma_interface.h.

int sangoma_interface::InterfaceNumber
protected

Wanpipe Interface number based on a channel in a SPAN

Definition at line 228 of file sangoma_interface.h.

callback_functions_t sangoma_interface::callback_functions
protected

Callback functions used to call the application on IO events

Definition at line 235 of file sangoma_interface.h.


The documentation for this class was generated from the following file: