LibSangoma FAQ

Libsangoma EC Control

 

How to turn on/off Echo Canceller by calling libsangoma API

In libsangoma, the API can be called in this way (functions defined in libsangoma.h, and can be called from customer's source code directly to libsangoma):

/*!
  \fn int sangoma_tdm_enable_hwec(sng_fd_t fd, wanpipe_api_t *tdm_api)
  \brief Enable HWEC on this channel 
  \param fd device file descriptor
  \param tdm_api tdm api command structure
  \return non-zero: error, 0: ok
  
  Supported only on cards that have HWEC
*/
int _LIBSNG_CALL sangoma_tdm_enable_hwec(sng_fd_t fd, wanpipe_api_t *tdm_api);

/*!
  \fn int sangoma_tdm_disable_hwec(sng_fd_t fd, wanpipe_api_t *tdm_api)
  \brief Disable HWEC on this channel
  \param fd device file descriptor
  \param tdm_api tdm api command structure
  \return non-zero: error, 0: ok
  
  Supported only on cards that have HWEC
*/
int _LIBSNG_CALL sangoma_tdm_disable_hwec(sng_fd_t fd, wanpipe_api_t *tdm_api);

Example

The example to use the above APIs:

 

wanpipe_tdm_api_t tdm_api;
int err = 0;
memset(&tdm_api, 0, sizeof(tdm_api));
.......
err=sangoma_tdm_enable_hwec(ftdmchan->sockfd, &tdm_api);
err=sangoma_tdm_disable_hwec(ftdmchan->sockfd, &tdm_api);

 

Return to Documentation Home I Return to Sangoma Support