wanpipe-3.5.11.tgz

This commit is contained in:
Harald Welte 2021-12-29 18:41:53 +01:00
parent 8304a58108
commit fbb8feccef
558 changed files with 95617 additions and 32152 deletions

1
.router_version Normal file
View File

@ -0,0 +1 @@
wanpipe-3.5.11

View File

@ -8,12 +8,89 @@ Copyright (c) 1995-2009 Sangoma Technologies Inc.
For more info visit: http://wiki.sangoma.com
------------------------------------------------------------------------------
* Thu Apr 08 2010 Nenad Corbic <ncorbic@sangoma.com> - 3.5.11
===================================================================
- Fix for 2.6.31 and higher kernels
- TDM API Analog rx gain feature
- Disabled default NOISE REDUCTION feature in hwec
that was enabled in 3.5.9 release.
- Updates to T1/E1 Loopback and BERT Test
* Wed Jan 11 2010 Nenad Corbic <ncorbic@sangoma.com> - 3.5.10
===================================================================
- Release cleanup script earsed libsangoma.c during release packaging.
I have update release procedure so this does not happen again.
This release has no functionl differences aside from the missing
file from 3.5.9 release.
* Wed Dec 30 2009 Nenad Corbic <ncorbic@sangoma.com> - 3.5.9
===================================================================
- New logger dev feature
- Bug fix in tx fifo handler
- Dahdi 2.2 broke wanpipe rbs support.
- Fixed free run interrupt supported on V38 (A108)
- Fixed RBS signalling for E1 channel 31
- Added Front end Reset Detection
-> Support for new A108 Firmware V40
- Fixed RTP TAP bug: Caused high system load on RTP TAP usage.
- Added excessive fifo error sanity check. Fixes random pci dma errors.
- HWEC: Increased EC VQE Delay: Fixes random fax failure due to hwec.
- HWEC: Check state before bypass enable.
- HWEC: Disable bypass on release
- HWEC: Enabled Noise Reduction by default
- HWEC: Enabled Auto Gain Control by default
- HWEC: To disable Noise Reduction and Gain control set
-> HWEC_NOISE_REDUCTION_DISABLE=NO in [wanpipe] section of wanpipe1.conf
To check if Noise Reduction or Gain control are set
-> wan_ec_client wanpipe1 stats 1
* Thu Oct 02 2009 Nenad Corbic <ncorbic@sangoma.com> - 3.5.8
===================================================================
- Bug fix in sangoma_prid PRI stack for FreeSwitch & Asterisk.
There was a slow memory leak.
* Thu Sep 04 2009 Nenad Corbic <ncorbic@sangoma.com> - 3.5.7
===================================================================
- New Telesoft PRI Stack Support for FreeSwitch & Asterisk
For Asterisk: The new stack uses the existing Sangoma Media Gateway
architecture currently used by SS7 and BRI.
-> run: wancfg_dahdi or wancfg_zaptel to configure
for sangoma prid stack.
For FreeSwitch: The new stack binds to openzap directly just like
current SS7 and BRI.
-> run: wancfg_fs to configure freeswitch for
sangoma prid, brid, ss7.
- Fixed Tx Tristate
- Updated yellow alarm handling for Dallas maxim cards
(A101/2/4/8)
- Autodetect USB support so that driver will compile
correctly on kernel without USB support
- Added DAHDI Red alarm for Analog
* Thu Aug 20 2009 Nenad Corbic <ncorbic@sangoma.com> - 3.5.6
===================================================================
- Update to T1 Yellow Alarm handling.
In some cases Yellow alarm did not turn off poperly causing
line to stay down an card startup.
- Update configuration utility
wancfg_fs updated for sangoma_prid configuration. Added wancfg_openzap
for OpenZap Configuration
* Mon Aug 17 2009 Nenad Corbic <ncorbic@sangoma.com> - 3.5.5

View File

@ -71,6 +71,12 @@ else
EXTRA_CFLAGS+= -DWANPIPE_64BIT_4G_DMA
endif
ifndef 64BIT_2G
64BIT_2G="Disabled"
else
EXTRA_CFLAGS+= -DWANPIPE_64BIT_2G_DMA
endif
#Local wanpipe includes
WINCLUDE=patches/kdrivers/include
@ -152,6 +158,8 @@ all: cleanup_local _checkzap _checksrc all_bin_kmod all_util
all_src: cleanup_local _checkzap _checksrc all_kmod all_util
all_src_ss7: cleanup_local _checkzap _checksrc all_kmod_ss7 all_util
dahdi: all_src
zaptel: all_src
@ -159,6 +167,12 @@ zaptel: all_src
openzap: all_src all_lib
@touch .all_lib .openzap
freetdm: all_src all_lib
@touch .all_lib .openzap
openzap_ss7: all_src_ss7 all_lib
@touch .all_lib
tdmapi: all_src all_lib
@touch .all_lib
@ -171,6 +185,14 @@ cleanup_local:
all_kmod: _checkzap _checksrc _cleanoldwanpipe _check_kver
$(MAKE) KBUILD_VERBOSE=$(KBUILD_VERBOSE) -C $(KDIR) SUBDIRS=$(WAN_DIR) EXTRA_FLAGS="$(EXTRA_CFLAGS) $(shell cat ./patches/kfeatures)" ZAPDIR=$(ZAPDIR_PRIV) ZAPHDLC=$(ZAPHDLC_PRIV) HOMEDIR=$(PWD) modules
all_kmod_ss7: _checkzap _checksrc _cleanoldwanpipe _check_kver
@if [ -e $(PWD)/ss7_build_dir ]; then \
rm -rf $(PWD)/ss7_build_dir; \
fi
@mkdir -p $(PWD)/ss7_build_dir
./Setup drivers --builddir=$(PWD)/ss7_build_dir --with-linux=$(KDIR) $(ZAP_OPTS) --usr-cc=$(CC) --protocol=AFT_TE1-XMTP2 --no-zaptel-compile --noautostart --arch=$(ARCH) --silent
@eval "./patches/copy_modules.sh $(PWD)/ss7_build_dir $(WAN_DIR)"
all_bin_kmod: _checkzap _checksrc _cleanoldwanpipe _check_kver
@if [ -e $(PWD)/ast_build_dir ]; then \
rm -rf $(PWD)/ast_build_dir; \
@ -186,8 +208,8 @@ clean: cleanup_local clean_util _cleanoldwanpipe
$(MAKE) -C api SUBDIRS=$(WAN_DIR) clean
@find patches/kdrivers -name '.*.cmd' | xargs rm -f
@find . -name 'Module.symver*' | xargs rm -f
@if [ -e .openzap ]; then
rm -f .openzap
@if [ -e .openzap ]; then \
rm -f .openzap; \
fi
@ -294,6 +316,11 @@ install_kmod:
echo "install -m 644 -D $(WAN_DIR)/wanpipe_lip.${MODTYPE} $(INSTALLPREFIX)/$(KINSTDIR)/net/wanrouter/wanpipe_lip.${MODTYPE}"; \
install -m 644 -D $(WAN_DIR)/wanpipe_lip.${MODTYPE} $(INSTALLPREFIX)/$(KINSTDIR)/net/wanrouter/wanpipe_lip.${MODTYPE}; \
fi
@rm -f $(INSTALLPREFIX)/$(KINSTDIR)/drivers/net/wan/xmtp2km.${MODTYPE}
@if [ -f $(WAN_DIR)/xmtp2km.${MODTYPE} ]; then \
echo "install -m 644 -D $(WAN_DIR)/xmtp2km.${MODTYPE} $(INSTALLPREFIX)/$(KINSTDIR)/drivers/net/wan/xmtp2km.${MODTYPE}"; \
install -m 644 -D $(WAN_DIR)/xmtp2km.${MODTYPE} $(INSTALLPREFIX)/$(KINSTDIR)/drivers/net/wan/xmtp2km.${MODTYPE}; \
fi
@eval "./patches/rundepmod.sh"
endif
@ -326,17 +353,25 @@ install_util:
$(MAKE) -C util install SYSINC=$(PWD)/$(WINCLUDE) CC=$(CC) PREFIX=$(INSTALLPREFIX)
install_smgbri:
$(MAKE) -C ssmg/sangoma_mgd.trunk/ install SYSINC=$(PWD)/$(WINCLUDE) CC=$(CC) PREFIX=$(INSTALLPREFIX)
install -D -m 755 ssmg/sangoma_bri/smg_ctrl $(INSTALLPREFIX)/usr/sbin/smg_ctrl
install -D -m 755 ssmg/sangoma_bri/sangoma_brid.$(ARCH) $(INSTALLPREFIX)/usr/sbin/sangoma_brid
$(MAKE) -C ssmg/sangoma_mgd.trunk/ install SYSINC=$(PWD)/$(WINCLUDE) CC=$(CC) BRI=YES PREFIX=$(INSTALLPREFIX)
$(MAKE) -C ssmg/libsangoma.trunk/ install DESTDIR=$(INSTALLPREFIX)
$(MAKE) -C ssmg/sangoma_mgd.trunk/lib/libteletone install DESTDIR=$(INSTALLPREFIX)
install_pri:
install_bri:
$(MAKE) -C ssmg/sangoma_bri/ install SYSINC=$(PWD)/$(WINCLUDE) CC=$(CC) DESTDIR=$(INSTALLPREFIX)
install_smgpri:
$(MAKE) -C ssmg/sangoma_pri/ install SYSINC=$(PWD)/$(WINCLUDE) CC=$(CC) DESTDIR=$(INSTALLPREFIX)
@if [ ! -e .openzap ]; then \
@echo "Installing Sangoma MGD"; \
$(MAKE) -C ssmg/sangoma_mgd.trunk/ install SYSINC=$(PWD)/$(WINCLUDE) CC=$(CC) PRI=YES DESTDIR=$(INSTALLPREFIX) ; \
fi
install_pri:
@eval "cd ssmg; ./get_sangoma_prid.sh; cd .."
$(MAKE) -C ssmg/sangoma_pri/ install SYSINC=$(PWD)/$(WINCLUDE) CC=$(CC) DESTDIR=$(INSTALLPREFIX)
install_pri_update:
@eval "cd ssmg; ./get_sangoma_prid.sh --update; cd .."
$(MAKE) -C ssmg/sangoma_pri/ install SYSINC=$(PWD)/$(WINCLUDE) CC=$(CC) DESTDIR=$(INSTALLPREFIX)
#Install etc files

353
Setup
View File

@ -9,6 +9,7 @@
# as published by the Free Software Foundation; either version
# 2 of the License, or (at your option) any later version.
# ----------------------------------------------------------------------------
# Oct 29, 2009 Yannick Lam Added --no_woomera option (will not install woomera)
# Jul 29, 2009 Konrad Hammel Added --with-asterisk option
# Jul 27, 2009 Konrad Hammel Update to not compile unneeded utilities in
# TDM_VOICE mode.
@ -2552,6 +2553,9 @@ function build_kernel_module()
rm -f $modname.ko
rm -f $modname.mod.o
echo " make MODULE_NAME=$modname OBJS=\"$ofiles\" CC=$CC SUBDIRS=$PWD KBUILD_VERBOSE=$KBUILD_VERBOSE KDIR=$SOURCEDIR \
EXTRA_CFLAGS=\"-D__LINUX__ $PROTOCOL_DEFINES $extra_flags \"" >> $CMP_BUILD
make MODULE_NAME=$modname OBJS="$ofiles" CC=$CC SUBDIRS=$PWD KBUILD_VERBOSE=$KBUILD_VERBOSE KDIR=$SOURCEDIR \
EXTRA_CFLAGS="-D__LINUX__ $PROTOCOL_DEFINES $extra_flags " >> $CMP_LOG 2>> $CMP_LOG
# echo "ld $LD_ELF -r -o $modname.ko $modname.o $modname.mod.o" >> $CMP_BUILD
@ -3378,7 +3382,7 @@ ENDOFTEXT
rm -rf $DRIVER_TMP_DIR
fi
eval "find $PROD_HOME -name \"Module.symvers*\" | xargs \rm -f"
eval "find $PROD_HOME/ -name \"Module.symvers*\" | xargs \rm -f"
\mkdir "$DRIVER_TMP_DIR"
\mkdir "$DRIVER_TMP_DIR/mod"
@ -3934,7 +3938,7 @@ WANPIPE_OBJS=
rm -f sdladrv_src.c
ln -s sdladrv.c sdladrv_src.c
SDLADRV_OBJS="sdladrv_src sdladrv_fe sdladrv_utils "
SDLADRV_OBJS="sdladrv_src sdladrv_fe sdladrv_utils wanpipe_cdev_linux wanpipe_logger "
if [ "$AFT_USB_PROT" = "YES" ]; then
SDLADRV_OBJS=$SDLADRV_OBJS"sdladrv_usb "
@ -3947,7 +3951,7 @@ WANPIPE_OBJS=
WANROUTER_OBJS="wanmain wanproc waniface "
if [ $REL != "3.4" ]; then
WANROUTER_OBJS=$WANROUTER_OBJS" wandev wanpipe_cdev_linux"
WANROUTER_OBJS=$WANROUTER_OBJS" wandev "
fi
build_kernel_module wanrouter "$WANROUTER_OBJS"
@ -4786,92 +4790,6 @@ ENDOFTEXT
return 0
}
function install_chan_woomera()
{
AST_MODULES=chan_woomera.c
if [ "$AST_DFLT_INSTALL_DIR" = "" ]; then
ast_src_dir=/usr/src/asterisk
else
ast_src_dir=$AST_DFLT_INSTALL_DIR
fi
cd $PROD_HOME/$SSMG_DIR
cd sangoma_mgd.trunk
CUR_PWD=`pwd`
if [ "$ast_src_dir" = "" ]; then
echo
echo "Please Specify Asterisk Source Directory"
echo "Default [/usr/src/asterisk] just press <enter>"
echo
echo -n "Asterisk Source: "
read ast_src_dir
if [ "$ast_src_dir" = "" ]; then
ast_src_dir="/usr/src/asterisk"
fi
fi
echo
echo
echo "Installing chan_woomera in: $ast_src_dir"
echo
if [ ! -d $ast_src_dir ]; then
echo
echo "Directory $ast_src_dir not found!"
echo
return 1
fi
if [ ! -e $ast_src_dir/contrib/scripts/astxs ]; then
echo
echo "Invalid asterisk source in $ast_src_dir"
echo
return 1
fi
eval "cp -f g711.h $ast_src_dir/"
eval "cp -f $AST_MODULES $ast_src_dir/"
cd $ast_src_dir
for mod in $AST_MODULES
do
echo "Installing: $mod"
eval "perl ./contrib/scripts/astxs -install $mod > /dev/null"
if [ $? -ne 0 ]; then
echo
echo "Error: Failed to install $mod module!"
install_failures=$install_failures"$mod "
else
echo "Done"
fi
done
cd $CUR_PWD
if [ "$install_failures" = "" ]; then
echo
echo "Installation Complete"
echo
else
echo
echo "-------------------------------------"
echo
echo "There was an ERROR in asterisk modules installation"
echo "Following modules failed to install:"
echo -e "\t$install_failures"
echo
echo
return 1
fi
return 0
}
function install_ssmg_ss7()
{
@ -4918,26 +4836,38 @@ function install_ssmg_ss7()
pause
}
function install_ssmg_pri()
{
if [ $SSMG_PRI != "YES" ]; then
return 0
fi
if [ !-e $PROD_HOME/$SSMG_DIR/sangoma_pri ]; then
echo "-------------------------------------"
echo "SMG PRID is not part of this release"
echo "Please contact Sangoma Support!"
echo "-------------------------------------"
exit 1;
fi
banner
check_sctp_utility
find_ast_dirs
cd $PROD_HOME/$SSMG_DIR
eval "./get_sangoma_prid.sh"
if [ $? -ne 0 ]; then
echo "Failed to obtain SMG PRI package"
exit 1
fi
cd sangoma_pri
echo
echo "Installing SMG PRI Daemon..."
eval "make INSTALLPREFIX=$ROOT install > /dev/null "
echo
echo "----------------------------------------"
echo "Sangoma PRI Installation Complete"
echo
echo " -> To configure for PRI run:"
echo " -> /usr/bin/wancfg_smg"
echo
echo "----------------------------------------"
echo
pause
eval "install_sangoma_mgd"
if [ $? -ne 0 ]; then
echo "-------------------------------------"
@ -4967,21 +4897,7 @@ function install_ssmg_pri()
fi
echo
cd $PROD_HOME/$SSMG_DIR
cd sangoma_pri
echo
echo "Installing SMG PRI Daemon..."
eval "make INSTALLPREFIX=$ROOT install > /dev/null "
echo
echo "----------------------------------------"
echo "Sangoma PRI Installation Complete"
echo
echo " -> To configure for PRI run:"
echo " -> /usr/bin/wancfg_smg"
echo
echo "----------------------------------------"
echo
install_smg_samples_bri
pause
}
@ -4998,37 +4914,6 @@ function install_ssmg_bri()
check_sctp_utility
find_ast_dirs
eval "install_sangoma_mgd"
if [ $? -ne 0 ]; then
echo "-------------------------------------"
echo "Error: SMG Libraries Failed to install"
echo "Please Contact Sangoma Support!"
echo "-------------------------------------"
exit 1;
fi
echo
cd $PROD_HOME/$SSMG_DIR
cd sangoma_mgd.trunk
echo "Installing SMG Daemon..."
echo
if [ -z $ROOT ]; then
eval "./install -bri -pbxdir $AST_SOURCE_DIR"
else
eval "./install -bri -rootdir $ROOT -pbxdir $AST_SOURCE_DIR"
fi
if [ $? -ne 0 ]; then
echo "-------------------------------------"
echo "Error: SMG Failed to install"
echo "Please Contact Sangoma Support!"
echo "-------------------------------------"
exit 1;
fi
echo
cd $PROD_HOME/$SSMG_DIR
cd sangoma_bri
@ -5044,7 +4929,47 @@ function install_ssmg_bri()
echo " -> /usr/bin/wancfg_smg"
echo
echo "----------------------------------------"
echo
echo
pause
eval "install_sangoma_mgd"
if [ $? -ne 0 ]; then
echo "-------------------------------------"
echo "Error: SMG Libraries Failed to install"
echo "Please Contact Sangoma Support!"
echo "-------------------------------------"
exit 1;
fi
echo
cd $PROD_HOME/$SSMG_DIR
cd sangoma_mgd.trunk
echo "Installing SMG Daemon..."
echo
if [ "$no_woomera_option" == "TRUE" ];then
smg_installation_type="no_woomera"
else
smg_installation_type="bri"
fi
if [ -z $ROOT ]; then
eval "./install -$smg_installation_type -pbxdir $AST_SOURCE_DIR"
else
eval "./install -$smg_installation_type -rootdir $ROOT -pbxdir $AST_SOURCE_DIR"
fi
if [ $? -ne 0 ]; then
echo "-------------------------------------"
echo "Error: SMG Failed to install"
echo "Please Contact Sangoma Support!"
echo "-------------------------------------"
exit 1;
fi
echo
install_smg_samples_bri
pause
}
@ -6383,13 +6308,18 @@ function find_ast_dirs ()
if [ "$astdirs" = "" ]; then
astdirs=`find /usr/src -maxdepth 2 -name 'asterisk*' | xargs `
if [ -d "/usr/src/asterisk" ]; then
astdirs="/usr/src/asterisk "$astdirs
fi
astdirs_tmp="/usr/src/asterisk "$astdirs
astdirs=$astdirs_tmp
fi
if [ -d "$AST_DFLT_INCLUDE_DIR" ]; then
astdirs_tmp="$AST_DFLT_INCLUDE_DIR "$astdirs
astdirs=$astdirs_tmp
fi
astdirs1=`find /usr/src -maxdepth 2 -name 'callweaver*' | xargs `
if [ -d "/usr/src/callweaver" ]; then
astdirs1="/usr/src/callweaver "$astdirs1
fi
astdirs1="/usr/src/callweaver "$astdirs1
fi
astdirs="$astdirs $astdirs1"
fi
@ -6407,18 +6337,19 @@ function find_ast_dirs ()
continue
fi
if [ ! -f $dir/include/asterisk.h ] && [ ! -f $dir/include/callweaver.h ]; then
continue;
fi
if [ $dir != "$AST_DFLT_INCLUDE_DIR" ]; then
if [ ! -f $dir/include/asterisk.h ] && [ ! -f $dir/include/callweaver.h ]; then
continue;
fi
if [ "$dir" = "/usr/src/asterisk" ] && [ $cnt -ne 1 ]; then
continue;
fi
if [ "$dir" = "/usr/src/callweaver" ] && [ $cnt -ne 1 ]; then
continue;
fi
if [ "$dir" = "/usr/src/asterisk" ] && [ $cnt -gt 2 ]; then
continue;
fi
if [ "$dir" = "/usr/src/callweaver" ] && [ $cnt -ne 1 ]; then
continue;
fi
fi
astdir_array[$cnt]=$dir;
echo "$cnt : $dir "
@ -6492,16 +6423,18 @@ function find_ast_dirs ()
fi
AST_SOURCE_DIR=$AST_INSTALL_DIR
if [ ! -f $AST_SOURCE_DIR/include/asterisk.h ] && [ ! -f $AST_SOURCE_DIR/include/callweaver.h ]; then
echo
echo "Error: asterisk.h/callweaver.h not found in $AST_SOURCE_DIR"
echo
echo
astdir_manual=0
pause 1
clear
find_ast_dirs "$astdirs"
if [ $AST_SOURCE_DIR != "$AST_DFLT_INCLUDE_DIR" ]; then
if [ ! -f $AST_SOURCE_DIR/include/asterisk.h ] && [ ! -f $AST_SOURCE_DIR/include/callweaver.h ]; then
echo
echo "Error: asterisk.h/callweaver.h not found in $AST_SOURCE_DIR"
echo
echo
astdir_manual=0
pause 1
clear
find_ast_dirs "$astdirs"
fi
fi
if [ $find_ast_dir_quit -eq 1 ] ; then
@ -6575,6 +6508,13 @@ function enable_protocols ()
PROT_MATCH=YES
fi
echo "$PROTOCOL" | grep "PRI" > /dev/null
if [ $? -eq 0 ]; then
echo "Enabling the AFT PRI SMG Support"
SSMG_PRI="YES"
PROT_MATCH=YES
fi
echo "$PROTOCOL" | grep "SS7" > /dev/null
if [ $? -eq 0 ]; then
echo "Enabling the AFT SS7 SMG Support"
@ -6821,16 +6761,21 @@ ENDOFTEXT
if [ $? -eq 0 ]; then
if [ $AFT_TE1_PROT != YES ]; then
echo "Enabling the AFT TE1 Support"
PROTOCOL_DEFINES="$PROTOCOL_DEFINES -DCONFIG_PRODUCT_WANPIPE_AFT -DCONFIG_PRODUCT_WANPIPE_AFT_CORE -DCONFIG_PRODUCT_WANPIPE_AFT_TE1 -DCONFIG_PRODUCT_WANPIPE_AFT_56K -DCONFIG_PRODUCT_WANPIPE_AFT_RM -DCONFIG_PRODUCT_WANPIPE_CODEC_SLINEAR_LAW -DCONFIG_PRODUCT_WANPIPE_AFT_BRI -DCONFIG_PRODUCT_WANPIPE_AFT_SERIAL -DCONFIG_PRODUCT_WANPIPE_AFT_A600 "
PROTOCOL_DEFINES="$PROTOCOL_DEFINES -DCONFIG_PRODUCT_WANPIPE_AFT -DCONFIG_PRODUCT_WANPIPE_AFT_CORE -DCONFIG_PRODUCT_WANPIPE_AFT_TE1 -DCONFIG_PRODUCT_WANPIPE_AFT_56K -DCONFIG_PRODUCT_WANPIPE_AFT_RM -DCONFIG_PRODUCT_WANPIPE_CODEC_SLINEAR_LAW -DCONFIG_PRODUCT_WANPIPE_AFT_BRI -DCONFIG_PRODUCT_WANPIPE_AFT_SERIAL -DCONFIG_PRODUCT_WANPIPE_AFT_A600 -DCONFIG_PRODUCT_WANPIPE_AFT_B601 "
if [ $REL != "3.4" ]; then
PROTOCOL_DEFINES="$PROTOCOL_DEFINES -DCONFIG_PRODUCT_WANPIPE_USB -DCONFIG_PRODUCT_WANPIPE_AFT_A700 "
PROTOCOL_DEFINES="$PROTOCOL_DEFINES -DCONFIG_PRODUCT_WANPIPE_AFT_A700 "
fi
fi
AFT_TE1_PROT=YES
AFT_BRI_PROT=YES
AFT_SERIAL_PROT=YES
if [ $REL != "3.4" ]; then
AFT_USB_PROT=YES
if [ $AFT_USB_PROT = "NO" ]; then
PROTOCOL_DEFINES="$PROTOCOL_DEFINES -DCONFIG_PRODUCT_WANPIPE_USB "
AFT_USB_PROT=YES
else
echo "USB Support Disabled by user!"
fi
fi
PROT_MATCH=YES
fi
@ -7174,6 +7119,8 @@ AFT_TE3_PROT=NO
SSMG_SS7=NO
SSMG_PRI=NO
SSMG_BRI=NO
no_woomera_option="FALSE"
smg_installation_type="bri"
WAN_FRM_UPDATE_DRIVER=YES
@ -7375,6 +7322,8 @@ or
Drastically improves performance in TDM Voice
See the wiki for more information
--no_woomera : Option to compile the driver without installing
chan_woomera.
--protocol : Option to compile in extra protocols
that are not installed by default.
@ -7439,7 +7388,7 @@ KERNEL_UNAME=`uname -r`
PKG_NAME=wanpipe
DISTR_NAME="WANPIPE"
PROD=wanrouter
PROD_VER=3.5.6
PROD_VER=3.5.11
PROD_HOME=`pwd`
META_CONF=$PROD_HOME/$PROD.rc
WAN_INTR_DIR=$PROD_HOME/interfaces
@ -7534,7 +7483,8 @@ ANNEXG_LOAD=NO
SCTP_LOAD=NO
ZAPTEL_DFLT_INSTALL_DIR="/usr/src/zaptel"
AST_DFLT_INSTALL_DIR="/usr/src/asterisk"
AST_DFLT_INCLUDE_DIR="/usr/include/asterisk"
AST_DFLT_INSTALL_DIR=$AST_DFLT_INCLUDE_DIR
AST_SOURCE_DIR=$AST_DFLT_INSTALL_DIR
AST_PATH_OP="NO"
ZAPTEL_SOURCE_DIR=$ZAPTEL_DFLT_INSTALL_DIR
@ -7815,6 +7765,10 @@ if [ "$PKG_NAME" != "wanpipe-lite" ]; then
PROTOCOL_DEFINES="$PROTOCOL_DEFINES -DWANPIPE_64BIT_4G_DMA "
;;
--64bit_2G*)
PROTOCOL_DEFINES="$PROTOCOL_DEFINES -DWANPIPE_64BIT_2G_DMA "
;;
--hwec_noise_reduction*)
PROTOCOL_DEFINES="$PROTOCOL_DEFINES -DWANEC_ENABLE_NOISE_REDUCTION "
;;
@ -7883,29 +7837,36 @@ if [ "$PKG_NAME" != "wanpipe-lite" ]; then
;;
--with-asterisk*)
AST_DFLT_INSTALL_DIR=`echo $arg | cut -d'=' -f2`;
if [ "$AST_DFLT_INSTALL_DIR" = "" ]; then
echo "Error invalid --with-asterisk option";
exit 1;
fi
if [ ! -d "$AST_DFLT_INSTALL_DIR" ]; then
echo "Error: Asterisk source directory not found: $AST_DFLT_INSTALL_DIR";
exit 1;
fi
if [ ! -f "$AST_DFLT_INSTALL_DIR/Makefile" ]; then
echo "Error: Invalid Asterisk source found in $AST_DFLT_INSTALL_DIR";
exit 1;
fi
AST_PATH_OP="YES";
echo "Asterisk path defined as: $AST_DFLT_INSTALL_DIR"
;;
--with-asterisk*)
AST_DFLT_INSTALL_DIR=`echo $arg | cut -d'=' -f2`;
if [ "$AST_DFLT_INSTALL_DIR" = "" ]; then
echo "Error invalid --with-asterisk option";
exit 1;
fi
if [ ! -d "$AST_DFLT_INSTALL_DIR" ]; then
echo "Error: Asterisk source directory not found: $AST_DFLT_INSTALL_DIR";
exit 1;
fi
if [ $AST_DFLT_INSTALL_DIR != "$AST_DFLT_INCLUDE_DIR" ]; then
if [ ! -f "$AST_DFLT_INSTALL_DIR/Makefile" ]; then
echo "Error: Invalid Asterisk source found in $AST_DFLT_INSTALL_DIR";
exit 1;
fi
fi
AST_PATH_OP="YES";
echo "Asterisk path defined as: $AST_DFLT_INSTALL_DIR"
AST_SOURCE_DIR=$AST_DFLT_INSTALL_DIR
;;
--no-zaptel-compile*)
ZAPTEL_COMPILE_DISABLE="YES";
;;
--no-usb*)
echo "USB Support Disabled"
AFT_USB_PROT="DISABLE"
;;
--builddir*)
ROOT=`echo $arg | cut -d'=' -f2`;
if [ "$ROOT" = "" ]; then
@ -7979,7 +7940,11 @@ if [ "$PKG_NAME" != "wanpipe-lite" ]; then
--gz-modules)
GZ_MODULES="YES";
;;
--no_woomera)
no_woomera_option="TRUE";
;;
--zap-chunk* | --dahdi-chunk*)
ZAP_CHUNK=`echo $arg | cut -d'=' -f2`;

Binary file not shown.

View File

@ -2,13 +2,25 @@
wanpipe_hdlc.h: WANPIPE HDLC Library
*/
#ifndef _WANPIPE_HDLC_H
#define _WANPIPE_HDLC_H
#include <stdlib.h>
#include <stdio.h>
#include <ctype.h>
#include <unistd.h>
#include <string.h>
#if defined(__WINDOWS__)
# define wan_inline __inline
# ifdef __cplusplus
extern "C" { /* for C++ users */
# endif
#else
# include <ctype.h>
# include <unistd.h>
# include <errno.h>
# define wan_inline inline
#endif
#include <errno.h>
/*===================================================================
*
@ -126,6 +138,9 @@ typedef struct wanpipe_hdlc_engine
int (*hdlc_data) (struct wanpipe_hdlc_engine *hdlc_eng, void *data, int len);
void *context; /* user can store a pointer here, so it can be used when
* hdlc_data() callback runs */
}wanpipe_hdlc_engine_t;
typedef struct hdlc_list
@ -147,7 +162,7 @@ typedef struct hdlc_list
#define DEBUG_TX
#endif
static inline
static wan_inline
void init_hdlc_decoder(wanpipe_hdlc_decoder_t *hdlc_decoder)
{
hdlc_decoder->hdlc_flag=0;
@ -164,7 +179,7 @@ void init_hdlc_decoder(wanpipe_hdlc_decoder_t *hdlc_decoder)
hdlc_decoder->crc_prv=0;
}
static inline
static wan_inline
void init_hdlc_encoder(wanpipe_hdlc_encoder_t *chan)
{
chan->tx_crc=-1;
@ -188,3 +203,11 @@ extern int wanpipe_get_tx_hdlc_errors (wanpipe_hdlc_engine_t *hdlc_eng);
extern int wanpipe_get_rx_hdlc_packets (wanpipe_hdlc_engine_t *hdlc_eng);
extern int wanpipe_get_tx_hdlc_packets (wanpipe_hdlc_engine_t *hdlc_eng);
extern int wanpipe_hdlc_dump_ring(wanpipe_hdlc_engine_t *hdlc_eng);
#if defined(__WINDOWS__)
#ifdef __cplusplus
} /* for C++ users */
#endif /* __cplusplus */
#endif
#endif /* _WANPIPE_HDLC_H */

View File

@ -1,7 +1,7 @@
K 25
svn:wc:ra_dav:version-url
V 34
/svn/libsangoma/!svn/ver/222/trunk
/svn/libsangoma/!svn/ver/273/trunk
END
init-automake.sh
K 25
@ -13,7 +13,7 @@ configure
K 25
svn:wc:ra_dav:version-url
V 44
/svn/libsangoma/!svn/ver/222/trunk/configure
/svn/libsangoma/!svn/ver/224/trunk/configure
END
Makefile.in
K 25
@ -25,7 +25,7 @@ sources
K 25
svn:wc:ra_dav:version-url
V 42
/svn/libsangoma/!svn/ver/221/trunk/sources
/svn/libsangoma/!svn/ver/269/trunk/sources
END
AUTHORS
K 25
@ -57,18 +57,6 @@ svn:wc:ra_dav:version-url
V 54
/svn/libsangoma/!svn/ver/222/trunk/libhpsangoma_priv.h
END
libsangoma.vcproj.DAVIDRNEW.User.user
K 25
svn:wc:ra_dav:version-url
V 72
/svn/libsangoma/!svn/ver/136/trunk/libsangoma.vcproj.DAVIDRNEW.User.user
END
config.guess
K 25
svn:wc:ra_dav:version-url
V 47
/svn/libsangoma/!svn/ver/202/trunk/config.guess
END
libsangoma-doxygen.config
K 25
svn:wc:ra_dav:version-url
@ -79,7 +67,7 @@ libsangoma.c
K 25
svn:wc:ra_dav:version-url
V 47
/svn/libsangoma/!svn/ver/222/trunk/libsangoma.c
/svn/libsangoma/!svn/ver/272/trunk/libsangoma.c
END
compile.bat
K 25
@ -87,29 +75,23 @@ svn:wc:ra_dav:version-url
V 45
/svn/libsangoma/!svn/ver/32/trunk/compile.bat
END
ltmain.sh
K 25
svn:wc:ra_dav:version-url
V 44
/svn/libsangoma/!svn/ver/222/trunk/ltmain.sh
END
config.sub
K 25
svn:wc:ra_dav:version-url
V 45
/svn/libsangoma/!svn/ver/202/trunk/config.sub
END
cleanup.sh
K 25
svn:wc:ra_dav:version-url
V 45
/svn/libsangoma/!svn/ver/222/trunk/cleanup.sh
/svn/libsangoma/!svn/ver/244/trunk/cleanup.sh
END
libsangoma.h
K 25
svn:wc:ra_dav:version-url
V 47
/svn/libsangoma/!svn/ver/222/trunk/libsangoma.h
/svn/libsangoma/!svn/ver/273/trunk/libsangoma.h
END
libsangoma_hwec.c
K 25
svn:wc:ra_dav:version-url
V 52
/svn/libsangoma/!svn/ver/271/trunk/libsangoma_hwec.c
END
g711.h
K 25
@ -123,18 +105,18 @@ svn:wc:ra_dav:version-url
V 40
/svn/libsangoma/!svn/ver/1/trunk/INSTALL
END
COPYING
K 25
svn:wc:ra_dav:version-url
V 40
/svn/libsangoma/!svn/ver/1/trunk/COPYING
END
build.sh
K 25
svn:wc:ra_dav:version-url
V 43
/svn/libsangoma/!svn/ver/222/trunk/build.sh
END
COPYING
K 25
svn:wc:ra_dav:version-url
V 40
/svn/libsangoma/!svn/ver/1/trunk/COPYING
END
NEWS
K 25
svn:wc:ra_dav:version-url
@ -153,29 +135,29 @@ svn:wc:ra_dav:version-url
V 48
/svn/libsangoma/!svn/ver/146/trunk/libsangoma.rc
END
libsangoma.so.conf
K 25
svn:wc:ra_dav:version-url
V 51
/svn/libsangoma/!svn/ver/1/trunk/libsangoma.so.conf
END
sangoma_pri.c
K 25
svn:wc:ra_dav:version-url
V 48
/svn/libsangoma/!svn/ver/222/trunk/sangoma_pri.c
END
libsangoma.so.conf
K 25
svn:wc:ra_dav:version-url
V 51
/svn/libsangoma/!svn/ver/1/trunk/libsangoma.so.conf
END
libhpsangoma-doxygen.config
K 25
svn:wc:ra_dav:version-url
V 61
/svn/libsangoma/!svn/ver/50/trunk/libhpsangoma-doxygen.config
END
libhpsangoma.c
sangoma_pri.h
K 25
svn:wc:ra_dav:version-url
V 49
/svn/libsangoma/!svn/ver/222/trunk/libhpsangoma.c
V 48
/svn/libsangoma/!svn/ver/222/trunk/sangoma_pri.h
END
version
K 25
@ -183,17 +165,17 @@ svn:wc:ra_dav:version-url
V 40
/svn/libsangoma/!svn/ver/1/trunk/version
END
sangoma_pri.h
libhpsangoma.c
K 25
svn:wc:ra_dav:version-url
V 48
/svn/libsangoma/!svn/ver/222/trunk/sangoma_pri.h
V 49
/svn/libsangoma/!svn/ver/222/trunk/libhpsangoma.c
END
configure.in
K 25
svn:wc:ra_dav:version-url
V 47
/svn/libsangoma/!svn/ver/216/trunk/configure.in
/svn/libsangoma/!svn/ver/224/trunk/configure.in
END
ChangeLog
K 25
@ -219,17 +201,11 @@ svn:wc:ra_dav:version-url
V 46
/svn/libsangoma/!svn/ver/222/trunk/config.h.in
END
Makefile.Windows
K 25
svn:wc:ra_dav:version-url
V 50
/svn/libsangoma/!svn/ver/27/trunk/Makefile.Windows
END
libsangoma.sln
K 25
svn:wc:ra_dav:version-url
V 49
/svn/libsangoma/!svn/ver/136/trunk/libsangoma.sln
/svn/libsangoma/!svn/ver/235/trunk/libsangoma.sln
END
Makefile.am
K 25
@ -247,7 +223,7 @@ libsangoma.def
K 25
svn:wc:ra_dav:version-url
V 49
/svn/libsangoma/!svn/ver/221/trunk/libsangoma.def
/svn/libsangoma/!svn/ver/269/trunk/libsangoma.def
END
libsangoma-pvt.h
K 25
@ -265,5 +241,5 @@ libsangoma.vcproj
K 25
svn:wc:ra_dav:version-url
V 52
/svn/libsangoma/!svn/ver/219/trunk/libsangoma.vcproj
/svn/libsangoma/!svn/ver/269/trunk/libsangoma.vcproj
END

View File

@ -1,6 +1,7 @@
K 10
svn:ignore
V 15
V 32
Makefile.Windows
libsangoma.suo
END

View File

@ -1,14 +1,14 @@
8
dir
222
273
https://www.sangomapbx.com/svn/libsangoma/trunk
https://www.sangomapbx.com/svn/libsangoma
2009-08-12T18:36:20.606028Z
222
2010-04-09T17:11:09.447360Z
273
ncorbic
has-props
@ -32,7 +32,7 @@ file
2009-08-12T17:56:21.000000Z
2009-08-25T20:44:41.000000Z
3accc8de43673675a4464508f1b14a6a
2009-08-12T18:36:20.606028Z
222
@ -45,10 +45,10 @@ file
2009-08-12T17:49:44.000000Z
60fce03cb57361b8798108c17785bfa5
2009-08-12T18:36:20.606028Z
222
2010-04-09T15:03:43.000000Z
ca4757d166b30d6f13233e912bce42d3
2009-10-13T17:16:38.441677Z
224
ncorbic
has-props
@ -58,7 +58,7 @@ file
2009-08-12T17:49:43.000000Z
2010-04-09T15:03:42.000000Z
782866a28766db490d5e05eb04cb657f
2009-08-12T18:36:20.606028Z
222
@ -73,10 +73,10 @@ file
2009-08-12T17:51:19.000000Z
e7f606a94d75804b47ee5a35165c6f90
2009-07-31T21:19:58.950307Z
221
2010-03-23T16:14:34.000000Z
261dbd98b6a866003ce00fddeb1867cf
2010-03-15T20:12:36.300714Z
269
davidr
AUTHORS
@ -85,7 +85,7 @@ file
2009-06-26T20:41:46.000000Z
2009-08-25T20:44:41.000000Z
d41d8cd98f00b204e9800998ecf8427e
2008-02-28T18:51:53.196120Z
1
@ -97,7 +97,7 @@ file
2009-08-12T17:56:21.000000Z
2009-08-25T20:44:41.000000Z
6311c0e89812fa88c9a1f2ef7784a3f3
2009-08-12T18:36:20.606028Z
222
@ -110,7 +110,7 @@ file
2009-06-26T20:41:46.000000Z
2009-08-25T20:44:41.000000Z
e181e2c8720c60522c4c4c981108e367
2008-02-28T18:51:53.196120Z
1
@ -123,7 +123,7 @@ file
2009-06-26T20:41:46.000000Z
2009-08-25T20:44:41.000000Z
a7ecc032b527a0d578545f19d3418073
2008-02-28T18:51:53.196120Z
1
@ -139,109 +139,60 @@ file
2009-08-12T17:56:21.000000Z
2009-08-25T20:44:41.000000Z
53f977038b3fb8b3a679e9fbd43e620e
2009-08-12T18:36:20.606028Z
222
ncorbic
has-props
libsangoma.vcproj.DAVIDRNEW.User.user
file
2009-06-26T20:41:46.000000Z
0ae611e17b3f6524851c84ea66d4a7f3
2009-04-02T17:14:58.164005Z
136
davidr
config.guess
file
2009-08-17T21:21:49.000000Z
7fc030a85a8f3d4864a65db5fb70c794
2009-06-26T20:12:34.655724Z
202
moises
libsangoma-doxygen.config
file
2009-06-26T20:41:46.000000Z
2009-08-25T20:44:41.000000Z
fd2f056fa00d98b918d141f218a000f8
2009-04-01T21:38:17.305658Z
135
ncorbic
libsangoma.c
file
2009-08-12T17:56:21.000000Z
68d0365da6648ad9460c89f5845269c3
2009-08-12T18:36:20.606028Z
222
ncorbic
has-props
compile.bat
file
2009-06-26T20:41:46.000000Z
2009-08-25T20:44:41.000000Z
5b82f62f87e4700af9b7e48c658b2cfc
2008-11-28T23:21:04.815499Z
32
davidr
ltmain.sh
libsangoma.c
file
2009-08-17T21:21:49.000000Z
ce785af2c9c33dad261e255cd91a9a89
2009-08-12T18:36:20.606028Z
222
ncorbic
2010-04-09T15:03:14.000000Z
a0ef759d6887cf41a79e164cde54b98c
2010-04-01T17:47:10.550488Z
272
davidr
has-props
config.sub
file
2009-08-17T21:21:49.000000Z
a1ad4822ccc53519fe519a9d353407d0
2009-06-26T20:12:34.655724Z
202
moises
cleanup.sh
file
2009-08-12T17:56:21.000000Z
54016e14ca0954d3a7a04f3301381467
2009-08-12T18:36:20.606028Z
222
2010-01-11T23:26:54.000000Z
692904ce7758fc035273cbe52fb10127
2010-01-12T01:27:55.842408Z
244
ncorbic
has-props
@ -251,20 +202,32 @@ file
2009-08-12T17:56:21.000000Z
e988bd9c20a491c7ca1c643c9ff5906a
2009-08-12T18:36:20.606028Z
222
2010-04-09T15:03:14.000000Z
d3f29adcf654b49568d4759e8dcb4c22
2010-04-09T17:11:09.447360Z
273
ncorbic
has-props
libsangoma_hwec.c
file
2010-03-23T16:14:34.000000Z
912e0fe804db3423d7b7ddc34fedd8e4
2010-03-17T22:36:18.066541Z
271
davidr
g711.h
file
2009-08-12T17:56:21.000000Z
2009-08-25T20:44:41.000000Z
0f725f95ced42af15dcaef21f3a1722b
2009-08-12T18:36:20.606028Z
222
@ -277,44 +240,44 @@ file
2009-06-26T20:41:46.000000Z
2009-08-25T20:44:41.000000Z
40539bd3eff06e4b82f380103145415b
2008-02-28T18:51:53.196120Z
1
root
COPYING
file
2009-08-25T20:44:41.000000Z
d41d8cd98f00b204e9800998ecf8427e
2008-02-28T18:51:53.196120Z
1
root
build.sh
file
2009-08-12T17:56:21.000000Z
2009-08-25T20:44:41.000000Z
f9109b55d1a9940209c4430121564f71
2009-08-12T18:36:20.606028Z
222
ncorbic
has-props
COPYING
file
2009-06-26T20:41:46.000000Z
d41d8cd98f00b204e9800998ecf8427e
2008-02-28T18:51:53.196120Z
1
root
NEWS
file
2009-06-26T20:41:46.000000Z
2009-08-25T20:44:41.000000Z
d41d8cd98f00b204e9800998ecf8427e
2008-02-28T18:51:53.196120Z
1
@ -326,7 +289,7 @@ file
2009-06-26T20:41:46.000000Z
2009-08-25T20:44:41.000000Z
9fb7603b06c96163344636bf36410d64
2009-06-26T19:39:04.828119Z
199
@ -338,59 +301,59 @@ file
2009-06-26T20:41:46.000000Z
2009-08-25T20:44:41.000000Z
5f46b82087b742e186dea4a23a18fc88
2009-04-22T20:41:57.677943Z
146
davidr
sangoma_pri.c
file
2009-08-12T17:56:21.000000Z
59210eaa3523ca8fdc605f5651fe2533
2009-08-12T18:36:20.606028Z
222
ncorbic
has-props
libsangoma.so.conf
file
2009-06-26T20:41:46.000000Z
2009-08-25T20:44:41.000000Z
bcdcb23c5d5fb460cee2ce315ef7bd32
2008-02-28T18:51:53.196120Z
1
root
sangoma_pri.c
file
2009-08-25T20:44:41.000000Z
59210eaa3523ca8fdc605f5651fe2533
2009-08-12T18:36:20.606028Z
222
ncorbic
has-props
sample_c
dir
libhpsangoma-doxygen.config
file
2009-06-26T20:41:46.000000Z
2009-08-25T20:44:41.000000Z
85429a0c83986ff69262848d5a5d453f
2008-12-10T01:33:45.806759Z
50
ncorbic
sample_c
dir
version
file
2009-06-26T20:41:46.000000Z
2009-08-25T20:44:41.000000Z
35f672d1fb01b542f667952c9dbb26fe
2008-02-28T18:51:53.196120Z
1
@ -402,7 +365,7 @@ file
2009-08-12T17:56:21.000000Z
2009-08-25T20:44:41.000000Z
7e23f30d22f5d2542866f5b9a81bcc80
2009-08-12T18:36:20.606028Z
222
@ -415,7 +378,7 @@ file
2009-08-12T17:56:21.000000Z
2009-08-25T20:44:41.000000Z
f487a2c347c2ff3e6633ea7022b649e3
2009-08-12T18:36:20.606028Z
222
@ -428,10 +391,10 @@ file
2009-07-09T21:18:35.000000Z
ab95388591bf0b4bd335350fcfa875d5
2009-07-09T21:42:07.606652Z
216
2009-10-13T16:07:54.000000Z
a731eb1641e7b86d5c8e2ab15cb5e49c
2009-10-13T17:16:38.441677Z
224
ncorbic
ChangeLog
@ -440,7 +403,7 @@ file
2009-06-26T20:41:46.000000Z
2009-08-25T20:44:41.000000Z
d41d8cd98f00b204e9800998ecf8427e
2008-02-28T18:51:53.196120Z
1
@ -452,7 +415,7 @@ file
2009-08-12T17:56:21.000000Z
2009-08-25T20:44:41.000000Z
9e95e25bbf705718d18c5c00cc7c8efe
2009-08-12T18:36:20.606028Z
222
@ -465,7 +428,7 @@ file
2009-06-26T20:41:46.000000Z
2009-08-25T20:44:41.000000Z
e8a0abce86211364eb60bbe6e07d4b05
2008-02-28T18:51:53.196120Z
1
@ -477,34 +440,22 @@ file
2009-08-12T17:49:49.000000Z
2010-04-09T15:03:48.000000Z
1a4d975497bfcde75e3cbf4a54f1d72e
2009-08-12T18:36:20.606028Z
222
ncorbic
Makefile.Windows
file
2009-06-26T20:41:46.000000Z
cebc214b51868b9cdca9356c0d87d074
2008-11-27T23:16:36.297108Z
27
ncorbic
libsangoma.sln
file
2009-06-26T20:41:46.000000Z
66e0fdbc15bba74dca556e72235e09a9
2009-04-02T17:14:58.164005Z
136
2009-12-04T21:21:35.000000Z
fe647b1212e15d68672bbc21737980b8
2009-12-01T20:38:57.462038Z
235
davidr
missing
@ -513,7 +464,7 @@ file
2009-06-26T20:41:46.000000Z
2009-08-25T20:44:41.000000Z
fd5dd60aa8cefab9462677280ea74a61
2008-02-28T18:51:53.196120Z
1
@ -526,7 +477,7 @@ file
2009-07-02T19:33:08.000000Z
2009-08-25T20:44:41.000000Z
e91d44c5f7c7b260b98044016baacad9
2009-06-26T19:19:31.981035Z
197
@ -538,10 +489,10 @@ file
2009-08-12T17:51:19.000000Z
924e6bfc7feda57ecd2128c06fa93381
2009-07-31T21:19:58.950307Z
221
2010-03-23T16:14:34.000000Z
39d2237e03532fcd8cdd7d7e1006fc07
2010-03-15T20:12:36.300714Z
269
davidr
libsangoma-pvt.h
@ -550,7 +501,7 @@ file
2009-08-12T17:56:21.000000Z
2009-08-25T20:44:41.000000Z
f804894d319dde10f91daf4542b9003b
2009-08-12T18:36:20.606028Z
222
@ -566,7 +517,7 @@ file
2009-06-26T20:41:46.000000Z
2009-08-25T20:44:41.000000Z
92067666ddce97609bd0ec67d36460cd
2008-02-28T18:51:53.196120Z
1
@ -579,9 +530,9 @@ file
2009-08-12T17:51:19.000000Z
bdd1f5992f4ca0ea38ee8211a9da93d3
2009-07-23T18:21:50.864680Z
219
2010-03-23T16:14:34.000000Z
1758fcb8a7c95432556823b5cb0355f1
2010-03-15T20:12:36.300714Z
269
davidr

View File

@ -1,5 +0,0 @@
K 13
svn:eol-style
V 2
LF
END

View File

@ -1,8 +0,0 @@
#
# DO NOT EDIT THIS FILE!!! Edit .\sources. if you want to add a new source
# file to this component. This file merely indirects to the real make file
# that is shared by all the driver components of the Windows NT DDK
#
!INCLUDE $(NTMAKEENV)\makefile.def

View File

@ -1,4 +1,4 @@
#!/bin/sh
svn status | xargs rm -rf
svn status | grep -v "libsangoma.*" | xargs rm -rf
rm -rf sample_c/regression

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -15,12 +15,12 @@
# for example, if we ever fix a bug in priserver.c and we want to make a release we can do so
# without incrementing libsangoma LT version
AC_INIT([libsangoma],[3.2.0],[ncorbic@sangoma.com])
AC_INIT([libsangoma],[3.3.0],[ncorbic@sangoma.com])
AC_CONFIG_HEADERS(config.h)
AM_INIT_AUTOMAKE
LIBSANGOMA_LT_CURRENT=3 # interface 3
LIBSANGOMA_LT_REVISION=2 # first revision of this interface
LIBSANGOMA_LT_REVISION=3 # first revision of this interface
LIBSANGOMA_LT_AGE=0 #not backwards compatible (0 previous interfaces are compatible)
#AC_CONFIG_MACRO_DIR([m4])

View File

@ -1,6 +1,6 @@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
# Generated by GNU Autoconf 2.59 for libsangoma 3.2.0.
# Generated by GNU Autoconf 2.59 for libsangoma 3.3.0.
#
# Report bugs to <ncorbic@sangoma.com>.
#
@ -423,8 +423,8 @@ SHELL=${CONFIG_SHELL-/bin/sh}
# Identity of this package.
PACKAGE_NAME='libsangoma'
PACKAGE_TARNAME='libsangoma'
PACKAGE_VERSION='3.2.0'
PACKAGE_STRING='libsangoma 3.2.0'
PACKAGE_VERSION='3.3.0'
PACKAGE_STRING='libsangoma 3.3.0'
PACKAGE_BUGREPORT='ncorbic@sangoma.com'
# Factoring default headers for most tests.
@ -953,7 +953,7 @@ if test "$ac_init_help" = "long"; then
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
\`configure' configures libsangoma 3.2.0 to adapt to many kinds of systems.
\`configure' configures libsangoma 3.3.0 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
@ -1019,7 +1019,7 @@ fi
if test -n "$ac_init_help"; then
case $ac_init_help in
short | recursive ) echo "Configuration of libsangoma 3.2.0:";;
short | recursive ) echo "Configuration of libsangoma 3.3.0:";;
esac
cat <<\_ACEOF
@ -1159,7 +1159,7 @@ fi
test -n "$ac_init_help" && exit 0
if $ac_init_version; then
cat <<\_ACEOF
libsangoma configure 3.2.0
libsangoma configure 3.3.0
generated by GNU Autoconf 2.59
Copyright (C) 2003 Free Software Foundation, Inc.
@ -1173,7 +1173,7 @@ cat >&5 <<_ACEOF
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
It was created by libsangoma $as_me 3.2.0, which was
It was created by libsangoma $as_me 3.3.0, which was
generated by GNU Autoconf 2.59. Invocation command line was
$ $0 $@
@ -1818,7 +1818,7 @@ fi
# Define the identity of the package.
PACKAGE='libsangoma'
VERSION='3.2.0'
VERSION='3.3.0'
cat >>confdefs.h <<_ACEOF
@ -1950,7 +1950,7 @@ am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'
LIBSANGOMA_LT_CURRENT=3 # interface 3
LIBSANGOMA_LT_REVISION=2 # first revision of this interface
LIBSANGOMA_LT_REVISION=3 # first revision of this interface
LIBSANGOMA_LT_AGE=0 #not backwards compatible (0 previous interfaces are compatible)
#AC_CONFIG_MACRO_DIR([m4])
@ -19648,7 +19648,7 @@ _ASBOX
} >&5
cat >&5 <<_CSEOF
This file was extended by libsangoma $as_me 3.2.0, which was
This file was extended by libsangoma $as_me 3.3.0, which was
generated by GNU Autoconf 2.59. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
@ -19711,7 +19711,7 @@ _ACEOF
cat >>$CONFIG_STATUS <<_ACEOF
ac_cs_version="\\
libsangoma config.status 3.2.0
libsangoma config.status 3.3.0
configured by $0, generated by GNU Autoconf 2.59,
with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\"

File diff suppressed because it is too large Load Diff

View File

@ -1,83 +1,2 @@
LIBRARY libsangoma
EXPORTS
sangoma_open_api_span
sangoma_span_chan_toif
sangoma_span_chan_fromif
sangoma_interface_toi
sangoma_create_socket_by_name
sangoma_open_api_span_chan
sangoma_open_api_span
sangoma_writemsg
sangoma_readmsg
sangoma_close
sangoma_get_full_cfg
sangoma_tdm_set_codec
sangoma_tdm_get_codec
sangoma_tdm_set_usr_period
sangoma_tdm_get_usr_period
sangoma_tdm_get_usr_mtu_mru
sangoma_tdm_set_power_level
sangoma_tdm_get_power_level
sangoma_flush_bufs
sangoma_tdm_enable_rbs_events
sangoma_tdm_disable_rbs_events
sangoma_tdm_write_rbs
sangoma_read_event
sangoma_tdm_enable_dtmf_events
sangoma_tdm_disable_dtmf_events
sangoma_tdm_enable_rm_dtmf_events
sangoma_tdm_disable_rm_dtmf_events
sangoma_tdm_enable_rxhook_events
sangoma_tdm_disable_rxhook_events
sangoma_tdm_enable_ring_events
sangoma_tdm_disable_ring_events
sangoma_tdm_enable_ring_detect_events
sangoma_tdm_disable_ring_detect_events
sangoma_tdm_enable_ring_trip_detect_events
sangoma_tdm_disable_ring_trip_detect_events
sangoma_tdm_enable_tone_events
sangoma_tdm_disable_tone_events
sangoma_tdm_txsig_onhook
sangoma_tdm_txsig_offhook
sangoma_tdm_txsig_start
sangoma_tdm_txsig_kewl
sangoma_get_hw_coding
sangoma_waitfor
sangoma_waitfor_many
sangoma_cmd_exec
sangoma_mgmt_cmd
__sangoma_open_api_span_chan
sangoma_get_tx_queue_sz
sangoma_get_rx_queue_sz
sangoma_get_driver_version
sangoma_get_firmware_version
sangoma_get_cpld_version
sangoma_get_stats
sangoma_flush_stats
sangoma_set_tx_queue_sz
sangoma_set_rx_queue_sz
sangoma_set_rm_rxflashtime
sangoma_open_api_ctrl
sangoma_open_driver_ctrl
sangoma_driver_port_start
sangoma_driver_port_stop
sangoma_driver_port_set_config
sangoma_driver_port_get_config
sangoma_driver_get_hw_info
sangoma_tdm_read_rbs
sangoma_get_open_cnt
sangoma_enable_bri_bchan_loopback
sangoma_disable_bri_bchan_loopback
sangoma_set_fe_status
sangoma_get_fe_status
sangoma_tdm_get_hw_dtmf
sangoma_tdm_get_fe_alarms
sangoma_wait_obj_create
sangoma_wait_obj_delete
sangoma_wait_obj_signal
sangoma_wait_obj_get_fd
sangoma_wait_obj_set_context
sangoma_wait_obj_get_context
sangoma_cdev_ctrl_cmd
sangoma_write_port_config_on_persistent_storage

File diff suppressed because it is too large Load Diff

View File

@ -1,6 +1,6 @@

Microsoft Visual Studio Solution File, Format Version 9.00
# Visual Studio 2005
Microsoft Visual Studio Solution File, Format Version 10.00
# Visual Studio 2008
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libsangoma", "libsangoma.vcproj", "{7E60CC2D-E818-4712-8F16-C0E6EC64982F}"
EndProject
Global

View File

@ -1,65 +0,0 @@
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioUserFile
ProjectType="Visual C++"
Version="8.00"
ShowAllFiles="false"
>
<Configurations>
<Configuration
Name="Release|Win32"
>
<DebugSettings
Command=""
WorkingDirectory=""
CommandArguments=""
Attach="false"
DebuggerType="3"
Remote="1"
RemoteMachine="DAVIDRNEW"
RemoteCommand=""
HttpUrl=""
PDBPath=""
SQLDebugging=""
Environment=""
EnvironmentMerge="true"
DebuggerFlavor=""
MPIRunCommand=""
MPIRunArguments=""
MPIRunWorkingDirectory=""
ApplicationCommand=""
ApplicationArguments=""
ShimCommand=""
MPIAcceptMode=""
MPIAcceptFilter=""
/>
</Configuration>
<Configuration
Name="Debug|Win32"
>
<DebugSettings
Command=""
WorkingDirectory=""
CommandArguments=""
Attach="false"
DebuggerType="3"
Remote="1"
RemoteMachine="DAVIDRNEW"
RemoteCommand=""
HttpUrl=""
PDBPath=""
SQLDebugging=""
Environment=""
EnvironmentMerge="true"
DebuggerFlavor=""
MPIRunCommand=""
MPIRunArguments=""
MPIRunWorkingDirectory=""
ApplicationCommand=""
ApplicationArguments=""
ShimCommand=""
MPIAcceptMode=""
MPIAcceptFilter=""
/>
</Configuration>
</Configurations>
</VisualStudioUserFile>

View File

@ -1,10 +1,11 @@
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="8.00"
Version="9.00"
Name="libsangoma"
ProjectGUID="{7E60CC2D-E818-4712-8F16-C0E6EC64982F}"
RootNamespace="libsangoma"
TargetFrameworkVersion="131072"
>
<Platforms>
<Platform
@ -55,7 +56,7 @@
WarningLevel="4"
WarnAsError="true"
SuppressStartupBanner="true"
Detect64BitPortabilityProblems="true"
Detect64BitPortabilityProblems="false"
DisableSpecificWarnings="4100;4214;4201;4706;4311;4312"
/>
<Tool
@ -121,7 +122,7 @@
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=".;include\api;include\debug;include\octasic;include\pnp;..\libpri"
PreprocessorDefinitions="WIN32;_DEBUG;_LIB;__WINDOWS__;WANPIPE_TDM_API;_CRT_SECURE_NO_DEPRECATE;WP_API_FEATURE_DTMF_EVENTS"
PreprocessorDefinitions="WIN32;_DEBUG;_LIB;__WINDOWS__;__COMPILING_LIBSANGOMA__;WANPIPE_TDM_API;_CRT_SECURE_NO_DEPRECATE;WP_API_FEATURE_DTMF_EVENTS;WP_API_FEATURE_EVENTS;WP_API_FEATURE_RM_GAIN;WP_API_FEATURE_LINK_STATUS;WP_API_FEATURE_FE_ALARM;WP_API_FEATURE_FAX_EVENTS;WP_API_FEATURE_LOGGER;WP_API_FEATURE_LIBSNG_HWEC"
MinimalRebuild="true"
BasicRuntimeChecks="3"
RuntimeLibrary="3"
@ -130,7 +131,7 @@
ObjectFile=".\Debug/"
ProgramDataBaseFileName=".\Debug/"
WarningLevel="4"
WarnAsError="true"
WarnAsError="false"
SuppressStartupBanner="true"
Detect64BitPortabilityProblems="true"
DebugInformationFormat="3"
@ -199,7 +200,7 @@
</FileConfiguration>
</File>
<File
RelativePath=".\sangoma_pri.c"
RelativePath=".\libsangoma_hwec.c"
>
</File>
</Filter>
@ -215,10 +216,6 @@
RelativePath=".\libsangoma.h"
>
</File>
<File
RelativePath=".\sangoma_pri.h"
>
</File>
</Filter>
<Filter
Name="Other Files"

View File

@ -0,0 +1,547 @@
/*******************************************************************************//**
* \file libsangoma_hwec.c
* \brief Hardware Echo Canceller API Code Library for
* Sangoma AFT T1/E1/Analog/BRI hardware.
*
* Author(s): David Rokhvarg <davidr@sangoma.com>
*
* Copyright: (c) 2005-2010 Sangoma Technologies Corporation
*
* * Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* * Neither the name of the Sangoma Technologies nor the
* names of its contributors may be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* 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
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
*******************************************************************************
*/
#include "libsangoma.h"
#include "libsangoma-pvt.h"
#include "wanpipe_includes.h"
#ifdef WP_API_FEATURE_LIBSNG_HWEC
#include "wanpipe_events.h"
#include "wanec_api.h"
#if defined (__WINDOWS__)
# include "wanpipe_time.h" /* wp_sleep() */
# pragma comment( lib, "waneclib" ) /* import functions from waneclib.dll */
#endif/* __WINDOWS__) */
/* Fast sequence of commands to HWEC may cause the chip
* enter fatal error state, the workaround is to have
* a guaranteed delay after eache command. */
#define HWEC_CMD_DELAY() wp_usleep(20000) /* 20ms */
static int libsng_hwec_verbosity_level = 0;
/************************************************************//**
* Private Functions. (Not exported)
***************************************************************/
static sangoma_status_t sangoma_hwec_bypass(char *device_name, int enable, unsigned int fe_chan_map)
{
sangoma_status_t rc;
wanec_api_hwec_t hwec;
memset(&hwec, 0, sizeof(wanec_api_hwec_t));
hwec.enable = enable;
hwec.fe_chan_map = fe_chan_map;
/* WAN_EC_API_CMD_HWEC_ENABLE/WAN_EC_API_CMD_HWEC_DISABLE - Controls the "bypass" mode.)*/
rc = wanec_api_hwec(device_name, libsng_hwec_verbosity_level, &hwec);
if( rc ) {
return rc;
}
HWEC_CMD_DELAY();
return SANG_STATUS_SUCCESS;
}
/************************************************************//**
* Public Functions. (Exported)
***************************************************************/
/*!
\fn sangoma_status_t _LIBSNG_CALL sangoma_hwec_config_init(char *device_name)
\brief Load Firmware image onto EC chip.
\param device_name Sangoma API device name.
Windows: wanpipe1_if1, wanpipe2_if1...
Linux: wanpipe1, wanpipe2...
\return SANG_STATUS_SUCCESS: success, or error status
*/
sangoma_status_t _LIBSNG_CALL sangoma_hwec_config_init(char *device_name)
{
sangoma_status_t rc;
wan_custom_param_t custom_parms;
wanec_api_config_t config;
memset(&config, 0x00, sizeof(config));
memset(&custom_parms, 0x0, sizeof(custom_parms));
#if 1
/* enable acoustic echo cancellation by default */
strcpy( custom_parms.name, "WANEC_EnableAcousticEcho" );
strcpy( custom_parms.sValue, "TRUE" );
config.conf.param_no = 1;
config.conf.params = &custom_parms;
#endif
/* Load firmware on EC chip */
rc = wanec_api_config( device_name, libsng_hwec_verbosity_level, &config );
if( rc ) {
return rc;
}
HWEC_CMD_DELAY();
return SANG_STATUS_SUCCESS;
}
/*!
\fn sangoma_status_t _LIBSNG_CALL sangoma_hwec_config_release(char *device_name)
\brief Reset internal state of HWEC API.
\param device_name Sangoma API device name.
Windows: wanpipe1_if1, wanpipe2_if1...
Linux: wanpipe1, wanpipe2...
\return SANG_STATUS_SUCCESS: success, or error status
*/
sangoma_status_t _LIBSNG_CALL sangoma_hwec_config_release(char *device_name)
{
sangoma_status_t rc;
wanec_api_release_t release;
memset(&release, 0, sizeof(wanec_api_release_t));
rc = wanec_api_release( device_name, libsng_hwec_verbosity_level, &release );
if( rc ) {
return rc;
}
HWEC_CMD_DELAY();
return SANG_STATUS_SUCCESS;
}
/*!
Modify channel operation mode.
*/
sangoma_status_t _LIBSNG_CALL sangoma_hwec_config_operation_mode(char *device_name, int mode, unsigned int fe_chan_map)
{
sangoma_status_t rc;
wanec_api_opmode_t opmode;
memset(&opmode, 0, sizeof(wanec_api_opmode_t));
opmode.mode = mode;
opmode.fe_chan_map = fe_chan_map;
/* modes are:
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.
*/
rc = wanec_api_opmode(device_name, libsng_hwec_verbosity_level, &opmode);
if( rc ) {
return rc;
}
HWEC_CMD_DELAY();
return SANG_STATUS_SUCCESS;
}
/*!
\fn sangoma_status_t _LIBSNG_CALL sangoma_hwec_config_power_on (char *device_name, unsigned int fe_chan_map)
\brief 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.
\param device_name Sangoma API device name.
Windows: wanpipe1_if1, wanpipe2_if1...
Linux: wanpipe1, wanpipe2...
\param fe_chan_map Bitmap of channels (timeslots for Digital,
lines for Analog) where the call will take effect.
\return SANG_STATUS_SUCCESS: success, or error status
*/
sangoma_status_t _LIBSNG_CALL sangoma_hwec_config_power_on(char *device_name, unsigned int fe_chan_map)
{
return sangoma_hwec_config_operation_mode(device_name, WANEC_API_OPMODE_NORMAL, fe_chan_map);
}
/*!
\fn sangoma_status_t _LIBSNG_CALL sangoma_hwec_config_power_off (char *device_name, unsigned int fe_chan_map)
\brief 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.
\param device_name Sangoma API device name.
Windows: wanpipe1_if1, wanpipe2_if1...
Linux: wanpipe1, wanpipe2...
\param fe_chan_map Bitmap of channels (timeslots for Digital,
lines for Analog) where the call will take effect.
\return SANG_STATUS_SUCCESS: success, or error status
*/
sangoma_status_t _LIBSNG_CALL sangoma_hwec_config_power_off(char *device_name, unsigned int fe_chan_map)
{
return sangoma_hwec_config_operation_mode(device_name, WANEC_API_OPMODE_POWER_DOWN, fe_chan_map);
}
/*!
\fn sangoma_status_t _LIBSNG_CALL sangoma_hwec_enable(char *device_name, unsigned int fe_chan_map)
\brief 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.
\param device_name Sangoma API device name.
Windows: wanpipe1_if1, wanpipe2_if1...
Linux: wanpipe1, wanpipe2...
\param fe_chan_map Bitmap of channels (timeslots for Digital, lines for Analog) where
the call will take effect.
\return SANG_STATUS_SUCCESS: success, or error status
*/
sangoma_status_t _LIBSNG_CALL sangoma_hwec_enable(char *device_name, unsigned int fe_chan_map)
{
return sangoma_hwec_bypass(device_name, 1 /* enable */, fe_chan_map);
}
/*!
\fn sangoma_status_t _LIBSNG_CALL sangoma_hwec_disable(char *device_name, unsigned int fe_chan_map)
\brief 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.
\param device_name Sangoma API device name.
Windows: wanpipe1_if1, wanpipe2_if1...
Linux: wanpipe1, wanpipe2...
\param fe_chan_map Bitmap of channels (timeslots for Digital, lines for Analog) where
the call will take effect.
\return SANG_STATUS_SUCCESS: success, or error status
*/
sangoma_status_t _LIBSNG_CALL sangoma_hwec_disable(char *device_name, unsigned int fe_chan_map)
{
return sangoma_hwec_bypass(device_name, 0 /* disable */, fe_chan_map);;
}
/*!
\fn sangoma_status_t _LIBSNG_CALL sangoma_hwec_config_channel_parameters(char *device_name, char *parameter, char *parameter_value, unsigned int channel_map)
\brief Modify channel configuration parameters.
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
\param fe_chan_map Bitmap of channels (timeslots for Digital, lines for Analog) where
the call will take effect.
\return SANG_STATUS_SUCCESS: success, or error status
*/
sangoma_status_t _LIBSNG_CALL sangoma_hwec_config_channel_parameters(char *device_name, char *parameter, char *parameter_value, unsigned int channel_map)
{
sangoma_status_t rc;
wanec_api_modify_t channelModify;
wan_custom_param_t aParms;
memset(&channelModify, 0x00, sizeof(channelModify));
memset(&aParms, 0x00, sizeof(aParms));
channelModify.fe_chan_map = channel_map;
channelModify.conf.param_no = 1;
channelModify.conf.params = &aParms;
strcpy( aParms.name, parameter);
strcpy( aParms.sValue, parameter_value);
rc = wanec_api_modify( device_name, libsng_hwec_verbosity_level, &channelModify );
if( rc ){
return rc;
}
HWEC_CMD_DELAY();
return SANG_STATUS_SUCCESS;
}
/*!
\fn 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)
\brief Enable/Disable tone detection (such as DTMF) of channels from channel map.
\param device_name Sangoma API device name.
Windows: wanpipe1_if1, wanpipe2_if1...
Linux: wanpipe1, wanpipe2...
\param tone_id See wanpipe_api_iface.h for list of valid tones
\param enable A flag, if 1 - the specified tone will be detected,
if 0 - specified tone will not be detected.
\param fe_chan_map Bitmap of channels (timeslots for Digital, lines for Analog) where
the call will take effect.
\param port_map Port\Direction of tone detection - Rx, Tx. See wanpipe_events.h for
list of valid ports (WAN_EC_CHANNEL_PORT_SOUT...).
\return SANG_STATUS_SUCCESS: success, or error status
*/
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)
{
sangoma_status_t rc;
wanec_api_tone_t tone;
memset(&tone, 0, sizeof(wanec_api_tone_t));
tone.id = tone_id;
tone.enable = enable;
tone.fe_chan_map = fe_chan_map;
tone.port_map = port_map;
tone.type_map = WAN_EC_TONE_PRESENT | WAN_EC_TONE_STOP;
rc = wanec_api_tone( device_name, libsng_hwec_verbosity_level, &tone );
if( rc ) {
return rc;
}
HWEC_CMD_DELAY();
return SANG_STATUS_SUCCESS;
}
/*!
\fn sangoma_status_t _LIBSNG_CALL sangoma_hwec_print_statistics(char *device_name, int full, unsigned int fe_chan_map)
\brief Read and print Chip/Channel statistics from EC chip.
\param device_name Sangoma API device name.
Windows: wanpipe1_if1, wanpipe2_if1...
Linux: wanpipe1, wanpipe2...
\param full Flag to read full statistics, if set to 1.
\param fe_chan_map Bitmap of channels (timeslots for Digital, lines for Analog) where
the call will read statistics.
\return SANG_STATUS_SUCCESS: success, or error status
*/
sangoma_status_t _LIBSNG_CALL sangoma_hwec_print_statistics(char *device_name, int full, unsigned int fe_chan_map)
{
sangoma_status_t rc;
wanec_api_stats_t stats;
memset(&stats, 0, sizeof(wanec_api_stats_t));
stats.full = full;
stats.fe_chan = fe_chan_map;
stats.reset = 0; /* do not reset */
rc = wanec_api_stats( device_name, libsng_hwec_verbosity_level, &stats );
if( rc ) {
return rc;
}
HWEC_CMD_DELAY();
return SANG_STATUS_SUCCESS;
}
/*!
\fn sangoma_status_t _LIBSNG_CALL sangoma_hwec_audio_buffer_load(char *device_name, char *filename, char pcmlaw, int *out_buffer_id)
\brief Load audio buffer to EC chip. The buffer can be played out using the sangoma_hwec_audio_buffer_playout() function.
\param filename name of the audio file (without the extension).
Actual file must have .pcm extension.
Location:
Windows: %SystemRoot%\sang_ec_files (ex: c:\WINDOWS\sang_ec_files)
Linux: /etc/wanpipe/buffers
\param 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.
\return SANG_STATUS_SUCCESS: success, or error status
*/
sangoma_status_t _LIBSNG_CALL sangoma_hwec_audio_buffer_load(char *device_name, char *filename, char pcmlaw, int *out_buffer_id)
{
sangoma_status_t rc;
wanec_api_bufferload_t bufferload;
memset(&bufferload, 0, sizeof(wanec_api_bufferload_t));
*out_buffer_id = -1;
bufferload.buffer = filename;
bufferload.pcmlaw = pcmlaw;
rc = wanec_api_buffer_load( device_name, libsng_hwec_verbosity_level, &bufferload );
if( rc ) {
return rc;
}
*out_buffer_id = bufferload.buffer_id;
HWEC_CMD_DELAY();
return SANG_STATUS_SUCCESS;
}
/*!
\fn sangoma_status_t _LIBSNG_CALL sangoma_hwec_audio_bufferunload(char *device_name, int in_buffer_id)
\brief Unload/remove an audio buffer from the HWEC chip.
\param device_name Sangoma wanpipe device name. (ex: wanpipe1 - Linux; wanpipe1_if1 - Windows).
\param in_buffer_id ID of the buffer which will be unloaded. The ID must be initialized by sangoma_hwec_audio_bufferload().
\return SANG_STATUS_SUCCESS - buffer was successfully unloaded/removed, SANG_STATUS_GENERAL_ERROR - error occured
*/
sangoma_status_t _LIBSNG_CALL sangoma_hwec_audio_buffer_unload(char *device_name, int in_buffer_id)
{
sangoma_status_t rc;
wanec_api_bufferunload_t bufferunload;
memset(&bufferunload, 0, sizeof(wanec_api_bufferunload_t));
bufferunload.buffer_id = (unsigned int)in_buffer_id;
rc = wanec_api_buffer_unload( device_name, libsng_hwec_verbosity_level, &bufferunload);
if( rc ) {
return rc;
}
HWEC_CMD_DELAY();
return SANG_STATUS_SUCCESS;
}
/*!
\fn sangoma_status_t _LIBSNG_CALL sangoma_hwec_audio_buffer_playout(char *device_name, unsigned int fe_chan_map,
unsigned char port_map, int buffer_id, int start, int repeat_cnt, int duration)
\brief Start\Stop playing out an audio buffer previously loaded by sangoma_hwec_audio_buffer_load().
\param fe_chan_map Bitmap of channels (timeslots for Digital,
lines for Analog) where the call will take effect.
\param port_map Port\Direction 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)
\param in_buffer_id ID of the buffer which will be unloaded. The ID must be initialized by sangoma_hwec_audio_bufferload().
\param start If 1 - start the play out, 0 - stop the play out
\param repeat_cnt Number of times to play out the same buffer
\param duration Maximum duration of the playout, in milliseconds. If it takes less then 'duration' to
play out the whole buffer this paramter is ignored.
\return SANG_STATUS_SUCCESS: success, or error status
*/
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)
{
sangoma_status_t rc;
wanec_api_playout_t playout;
memset(&playout, 0, sizeof(wanec_api_playout_t));
playout.start = start;
playout.fe_chan = fe_chan_map;
playout.buffer_id = in_buffer_id;
playout.port = port;
playout.notifyonstop = 1;
playout.user_event_id = 0xA5; /* dummy value */
playout.repeat_cnt = repeat_cnt;
playout.duration = (duration) ? duration : 5000; /* default is 5s */
rc = wanec_api_playout( device_name, libsng_hwec_verbosity_level, &playout);
if( rc ) {
return rc;
}
HWEC_CMD_DELAY();
return SANG_STATUS_SUCCESS;
}
/*!
\fn void _LIBSNG_CALL sangoma_hwec_config_verbosity(int verbosity_level)
\brief Set Verbosity level of EC API. The level controls amount of data
printed to stdout and wanpipelog.txt for diagnostic purposes.
\param verbosity_level Valid values are from 0 to 3.
\return SANG_STATUS_SUCCESS: success, or error status
*/
sangoma_status_t _LIBSNG_CALL sangoma_hwec_config_verbosity(int verbosity_level)
{
if (verbosity_level >= 0 || verbosity_level <= 3) {
libsng_hwec_verbosity_level = verbosity_level;
return SANG_STATUS_SUCCESS;
}
return SANG_STATUS_INVALID_PARAMETER;
}
#endif /* WP_API_FEATURE_LIBSNG_HWEC */

File diff suppressed because it is too large Load Diff

View File

@ -18,13 +18,15 @@ INCLUDES=$(SDK_INC_PATH);\
$(SANG_WP_DEVEL)\wanpipe_common\include;\
$(SANG_WP_DEVEL)\wanpipe_common\include\aft_core;\
$(SANG_WP_DEVEL)\wanpipe_windows\include;\
$(SANG_WP_DEVEL)\libsangoma
$(SANG_WP_DEVEL)\libsangoma;\
$(SANG_WP_DEVEL)\wanpipe_common\wantools\wanec_apilib
TARGETLIBS=$(SDK_LIB_PATH)\kernel32.lib \
$(SDK_LIB_PATH)\user32.lib \
$(SDK_LIB_PATH)\SetupApi.lib \
$(SDK_LIB_PATH)\Advapi32.lib
$(SDK_LIB_PATH)\Advapi32.lib \
$(SANG_WP_DEVEL)\wanpipe_common\wantools\wanec_apilib\$(O)\waneclib.lib
SOURCES=libsangoma.c libsangoma.rc
SOURCES=libsangoma.c libsangoma.rc libsangoma_hwec.c

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -1,8 +0,0 @@
#
# DO NOT EDIT THIS FILE!!! Edit .\sources. if you want to add a new source
# file to this component. This file merely indirects to the real make file
# that is shared by all the driver components of the Windows NT DDK
#
!INCLUDE $(NTMAKEENV)\makefile.def

View File

@ -1,4 +1,4 @@
#!/bin/sh
svn status | xargs rm -rf
svn status | grep -v "libsangoma.*" | xargs rm -rf
rm -rf sample_c/regression

View File

@ -1,6 +1,6 @@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
# Generated by GNU Autoconf 2.59 for libsangoma 3.2.0.
# Generated by GNU Autoconf 2.59 for libsangoma 3.3.0.
#
# Report bugs to <ncorbic@sangoma.com>.
#
@ -423,8 +423,8 @@ SHELL=${CONFIG_SHELL-/bin/sh}
# Identity of this package.
PACKAGE_NAME='libsangoma'
PACKAGE_TARNAME='libsangoma'
PACKAGE_VERSION='3.2.0'
PACKAGE_STRING='libsangoma 3.2.0'
PACKAGE_VERSION='3.3.0'
PACKAGE_STRING='libsangoma 3.3.0'
PACKAGE_BUGREPORT='ncorbic@sangoma.com'
# Factoring default headers for most tests.
@ -953,7 +953,7 @@ if test "$ac_init_help" = "long"; then
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
\`configure' configures libsangoma 3.2.0 to adapt to many kinds of systems.
\`configure' configures libsangoma 3.3.0 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
@ -1019,7 +1019,7 @@ fi
if test -n "$ac_init_help"; then
case $ac_init_help in
short | recursive ) echo "Configuration of libsangoma 3.2.0:";;
short | recursive ) echo "Configuration of libsangoma 3.3.0:";;
esac
cat <<\_ACEOF
@ -1159,7 +1159,7 @@ fi
test -n "$ac_init_help" && exit 0
if $ac_init_version; then
cat <<\_ACEOF
libsangoma configure 3.2.0
libsangoma configure 3.3.0
generated by GNU Autoconf 2.59
Copyright (C) 2003 Free Software Foundation, Inc.
@ -1173,7 +1173,7 @@ cat >&5 <<_ACEOF
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
It was created by libsangoma $as_me 3.2.0, which was
It was created by libsangoma $as_me 3.3.0, which was
generated by GNU Autoconf 2.59. Invocation command line was
$ $0 $@
@ -1818,7 +1818,7 @@ fi
# Define the identity of the package.
PACKAGE='libsangoma'
VERSION='3.2.0'
VERSION='3.3.0'
cat >>confdefs.h <<_ACEOF
@ -1950,7 +1950,7 @@ am__tar='${AMTAR} chof - "$$tardir"'; am__untar='${AMTAR} xf -'
LIBSANGOMA_LT_CURRENT=3 # interface 3
LIBSANGOMA_LT_REVISION=2 # first revision of this interface
LIBSANGOMA_LT_REVISION=3 # first revision of this interface
LIBSANGOMA_LT_AGE=0 #not backwards compatible (0 previous interfaces are compatible)
#AC_CONFIG_MACRO_DIR([m4])
@ -19648,7 +19648,7 @@ _ASBOX
} >&5
cat >&5 <<_CSEOF
This file was extended by libsangoma $as_me 3.2.0, which was
This file was extended by libsangoma $as_me 3.3.0, which was
generated by GNU Autoconf 2.59. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
@ -19711,7 +19711,7 @@ _ACEOF
cat >>$CONFIG_STATUS <<_ACEOF
ac_cs_version="\\
libsangoma config.status 3.2.0
libsangoma config.status 3.3.0
configured by $0, generated by GNU Autoconf 2.59,
with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\"

View File

@ -15,12 +15,12 @@
# for example, if we ever fix a bug in priserver.c and we want to make a release we can do so
# without incrementing libsangoma LT version
AC_INIT([libsangoma],[3.2.0],[ncorbic@sangoma.com])
AC_INIT([libsangoma],[3.3.0],[ncorbic@sangoma.com])
AC_CONFIG_HEADERS(config.h)
AM_INIT_AUTOMAKE
LIBSANGOMA_LT_CURRENT=3 # interface 3
LIBSANGOMA_LT_REVISION=2 # first revision of this interface
LIBSANGOMA_LT_REVISION=3 # first revision of this interface
LIBSANGOMA_LT_AGE=0 #not backwards compatible (0 previous interfaces are compatible)
#AC_CONFIG_MACRO_DIR([m4])

View File

@ -1,7 +1,7 @@
8
dir
222
273
https://www.sangomapbx.com/svn/libsangoma/trunk/docs
https://www.sangomapbx.com/svn/libsangoma

View File

@ -1,7 +1,7 @@
8
dir
222
273
https://www.sangomapbx.com/svn/libsangoma/trunk/docs/doxygen
https://www.sangomapbx.com/svn/libsangoma

View File

@ -1,7 +1,7 @@
8
dir
222
273
https://www.sangomapbx.com/svn/libsangoma/trunk/examples
https://www.sangomapbx.com/svn/libsangoma

View File

@ -1,7 +1,7 @@
8
dir
222
273
https://www.sangomapbx.com/svn/libsangoma/trunk/examples/hptdm_api
https://www.sangomapbx.com/svn/libsangoma
@ -32,7 +32,7 @@ file
2009-02-04T23:12:17.000000Z
2009-08-25T20:44:41.000000Z
81a3f7cc906c1a95c63c8bbb05655f30
2008-08-18T04:26:05.260169Z
17
@ -45,7 +45,7 @@ file
2009-02-04T23:12:17.000000Z
2009-08-25T20:44:41.000000Z
f71df7ce5278594373b87a592d826719
2008-08-18T04:26:05.260169Z
17
@ -57,7 +57,7 @@ file
2009-02-04T23:12:17.000000Z
2009-08-25T20:44:41.000000Z
b8ef9830437ad25ebd95d62434ed9530
2008-09-17T21:25:40.156211Z
22
@ -72,7 +72,7 @@ file
2009-02-04T23:12:17.000000Z
2009-08-25T20:44:41.000000Z
7f0a6424997adf454bbb3c88fb608622
2008-08-18T04:26:05.260169Z
17
@ -84,7 +84,7 @@ file
2009-02-04T23:12:17.000000Z
2009-08-25T20:44:41.000000Z
1432ab687de350b6a988bdbc553bdbe7
2008-09-17T21:25:40.156211Z
22

View File

@ -1,7 +1,7 @@
8
dir
222
273
https://www.sangomapbx.com/svn/libsangoma/trunk/examples/hptdm_api/docs
https://www.sangomapbx.com/svn/libsangoma

View File

@ -1,7 +1,7 @@
8
dir
222
273
https://www.sangomapbx.com/svn/libsangoma/trunk/examples/hptdm_api/docs/doxygen
https://www.sangomapbx.com/svn/libsangoma

View File

@ -1,7 +1,7 @@
8
dir
222
273
https://www.sangomapbx.com/svn/libsangoma/trunk/examples/priserver
https://www.sangomapbx.com/svn/libsangoma
@ -32,7 +32,7 @@ file
2009-02-04T23:12:16.000000Z
2009-08-25T20:44:41.000000Z
da36acc78b83d5047481df0cca63d969
2008-08-18T04:26:05.260169Z
17
@ -45,7 +45,7 @@ file
2009-06-19T20:55:52.000000Z
2009-08-25T20:44:41.000000Z
f30671b0a55df63396f6290c31af2fcb
2009-06-17T15:37:24.869927Z
182
@ -57,7 +57,7 @@ file
2009-02-04T23:12:17.000000Z
2009-08-25T20:44:41.000000Z
5c222b74d68b1c7df3f937a9d6321d40
2008-08-18T04:26:05.260169Z
17
@ -69,7 +69,7 @@ file
2009-06-19T20:55:52.000000Z
2009-08-25T20:44:41.000000Z
5afcd0bf7821144218b895150a7951bd
2009-06-17T15:37:24.869927Z
182
@ -81,7 +81,7 @@ file
2009-02-04T23:12:17.000000Z
2009-08-25T20:44:41.000000Z
40538792592cd766e4941d9b37dbaf56
2008-08-18T04:26:05.260169Z
17

File diff suppressed because it is too large Load Diff

View File

@ -1,83 +1,2 @@
LIBRARY libsangoma
EXPORTS
sangoma_open_api_span
sangoma_span_chan_toif
sangoma_span_chan_fromif
sangoma_interface_toi
sangoma_create_socket_by_name
sangoma_open_api_span_chan
sangoma_open_api_span
sangoma_writemsg
sangoma_readmsg
sangoma_close
sangoma_get_full_cfg
sangoma_tdm_set_codec
sangoma_tdm_get_codec
sangoma_tdm_set_usr_period
sangoma_tdm_get_usr_period
sangoma_tdm_get_usr_mtu_mru
sangoma_tdm_set_power_level
sangoma_tdm_get_power_level
sangoma_flush_bufs
sangoma_tdm_enable_rbs_events
sangoma_tdm_disable_rbs_events
sangoma_tdm_write_rbs
sangoma_read_event
sangoma_tdm_enable_dtmf_events
sangoma_tdm_disable_dtmf_events
sangoma_tdm_enable_rm_dtmf_events
sangoma_tdm_disable_rm_dtmf_events
sangoma_tdm_enable_rxhook_events
sangoma_tdm_disable_rxhook_events
sangoma_tdm_enable_ring_events
sangoma_tdm_disable_ring_events
sangoma_tdm_enable_ring_detect_events
sangoma_tdm_disable_ring_detect_events
sangoma_tdm_enable_ring_trip_detect_events
sangoma_tdm_disable_ring_trip_detect_events
sangoma_tdm_enable_tone_events
sangoma_tdm_disable_tone_events
sangoma_tdm_txsig_onhook
sangoma_tdm_txsig_offhook
sangoma_tdm_txsig_start
sangoma_tdm_txsig_kewl
sangoma_get_hw_coding
sangoma_waitfor
sangoma_waitfor_many
sangoma_cmd_exec
sangoma_mgmt_cmd
__sangoma_open_api_span_chan
sangoma_get_tx_queue_sz
sangoma_get_rx_queue_sz
sangoma_get_driver_version
sangoma_get_firmware_version
sangoma_get_cpld_version
sangoma_get_stats
sangoma_flush_stats
sangoma_set_tx_queue_sz
sangoma_set_rx_queue_sz
sangoma_set_rm_rxflashtime
sangoma_open_api_ctrl
sangoma_open_driver_ctrl
sangoma_driver_port_start
sangoma_driver_port_stop
sangoma_driver_port_set_config
sangoma_driver_port_get_config
sangoma_driver_get_hw_info
sangoma_tdm_read_rbs
sangoma_get_open_cnt
sangoma_enable_bri_bchan_loopback
sangoma_disable_bri_bchan_loopback
sangoma_set_fe_status
sangoma_get_fe_status
sangoma_tdm_get_hw_dtmf
sangoma_tdm_get_fe_alarms
sangoma_wait_obj_create
sangoma_wait_obj_delete
sangoma_wait_obj_signal
sangoma_wait_obj_get_fd
sangoma_wait_obj_set_context
sangoma_wait_obj_get_context
sangoma_cdev_ctrl_cmd
sangoma_write_port_config_on_persistent_storage

File diff suppressed because it is too large Load Diff

View File

@ -1,6 +1,6 @@

Microsoft Visual Studio Solution File, Format Version 9.00
# Visual Studio 2005
Microsoft Visual Studio Solution File, Format Version 10.00
# Visual Studio 2008
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libsangoma", "libsangoma.vcproj", "{7E60CC2D-E818-4712-8F16-C0E6EC64982F}"
EndProject
Global

View File

@ -1,10 +1,11 @@
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="8.00"
Version="9.00"
Name="libsangoma"
ProjectGUID="{7E60CC2D-E818-4712-8F16-C0E6EC64982F}"
RootNamespace="libsangoma"
TargetFrameworkVersion="131072"
>
<Platforms>
<Platform
@ -55,7 +56,7 @@
WarningLevel="4"
WarnAsError="true"
SuppressStartupBanner="true"
Detect64BitPortabilityProblems="true"
Detect64BitPortabilityProblems="false"
DisableSpecificWarnings="4100;4214;4201;4706;4311;4312"
/>
<Tool
@ -121,7 +122,7 @@
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=".;include\api;include\debug;include\octasic;include\pnp;..\libpri"
PreprocessorDefinitions="WIN32;_DEBUG;_LIB;__WINDOWS__;WANPIPE_TDM_API;_CRT_SECURE_NO_DEPRECATE;WP_API_FEATURE_DTMF_EVENTS"
PreprocessorDefinitions="WIN32;_DEBUG;_LIB;__WINDOWS__;__COMPILING_LIBSANGOMA__;WANPIPE_TDM_API;_CRT_SECURE_NO_DEPRECATE;WP_API_FEATURE_DTMF_EVENTS;WP_API_FEATURE_EVENTS;WP_API_FEATURE_RM_GAIN;WP_API_FEATURE_LINK_STATUS;WP_API_FEATURE_FE_ALARM;WP_API_FEATURE_FAX_EVENTS;WP_API_FEATURE_LOGGER;WP_API_FEATURE_LIBSNG_HWEC"
MinimalRebuild="true"
BasicRuntimeChecks="3"
RuntimeLibrary="3"
@ -130,7 +131,7 @@
ObjectFile=".\Debug/"
ProgramDataBaseFileName=".\Debug/"
WarningLevel="4"
WarnAsError="true"
WarnAsError="false"
SuppressStartupBanner="true"
Detect64BitPortabilityProblems="true"
DebugInformationFormat="3"
@ -199,7 +200,7 @@
</FileConfiguration>
</File>
<File
RelativePath=".\sangoma_pri.c"
RelativePath=".\libsangoma_hwec.c"
>
</File>
</Filter>
@ -215,10 +216,6 @@
RelativePath=".\libsangoma.h"
>
</File>
<File
RelativePath=".\sangoma_pri.h"
>
</File>
</Filter>
<Filter
Name="Other Files"

View File

@ -1,65 +0,0 @@
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioUserFile
ProjectType="Visual C++"
Version="8.00"
ShowAllFiles="false"
>
<Configurations>
<Configuration
Name="Release|Win32"
>
<DebugSettings
Command=""
WorkingDirectory=""
CommandArguments=""
Attach="false"
DebuggerType="3"
Remote="1"
RemoteMachine="DAVIDRNEW"
RemoteCommand=""
HttpUrl=""
PDBPath=""
SQLDebugging=""
Environment=""
EnvironmentMerge="true"
DebuggerFlavor=""
MPIRunCommand=""
MPIRunArguments=""
MPIRunWorkingDirectory=""
ApplicationCommand=""
ApplicationArguments=""
ShimCommand=""
MPIAcceptMode=""
MPIAcceptFilter=""
/>
</Configuration>
<Configuration
Name="Debug|Win32"
>
<DebugSettings
Command=""
WorkingDirectory=""
CommandArguments=""
Attach="false"
DebuggerType="3"
Remote="1"
RemoteMachine="DAVIDRNEW"
RemoteCommand=""
HttpUrl=""
PDBPath=""
SQLDebugging=""
Environment=""
EnvironmentMerge="true"
DebuggerFlavor=""
MPIRunCommand=""
MPIRunArguments=""
MPIRunWorkingDirectory=""
ApplicationCommand=""
ApplicationArguments=""
ShimCommand=""
MPIAcceptMode=""
MPIAcceptFilter=""
/>
</Configuration>
</Configurations>
</VisualStudioUserFile>

View File

@ -0,0 +1,547 @@
/*******************************************************************************//**
* \file libsangoma_hwec.c
* \brief Hardware Echo Canceller API Code Library for
* Sangoma AFT T1/E1/Analog/BRI hardware.
*
* Author(s): David Rokhvarg <davidr@sangoma.com>
*
* Copyright: (c) 2005-2010 Sangoma Technologies Corporation
*
* * Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
* * Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* * Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* * Neither the name of the Sangoma Technologies nor the
* names of its contributors may be used to endorse or promote products
* derived from this software without specific prior written permission.
*
* 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
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
*******************************************************************************
*/
#include "libsangoma.h"
#include "libsangoma-pvt.h"
#include "wanpipe_includes.h"
#ifdef WP_API_FEATURE_LIBSNG_HWEC
#include "wanpipe_events.h"
#include "wanec_api.h"
#if defined (__WINDOWS__)
# include "wanpipe_time.h" /* wp_sleep() */
# pragma comment( lib, "waneclib" ) /* import functions from waneclib.dll */
#endif/* __WINDOWS__) */
/* Fast sequence of commands to HWEC may cause the chip
* enter fatal error state, the workaround is to have
* a guaranteed delay after eache command. */
#define HWEC_CMD_DELAY() wp_usleep(20000) /* 20ms */
static int libsng_hwec_verbosity_level = 0;
/************************************************************//**
* Private Functions. (Not exported)
***************************************************************/
static sangoma_status_t sangoma_hwec_bypass(char *device_name, int enable, unsigned int fe_chan_map)
{
sangoma_status_t rc;
wanec_api_hwec_t hwec;
memset(&hwec, 0, sizeof(wanec_api_hwec_t));
hwec.enable = enable;
hwec.fe_chan_map = fe_chan_map;
/* WAN_EC_API_CMD_HWEC_ENABLE/WAN_EC_API_CMD_HWEC_DISABLE - Controls the "bypass" mode.)*/
rc = wanec_api_hwec(device_name, libsng_hwec_verbosity_level, &hwec);
if( rc ) {
return rc;
}
HWEC_CMD_DELAY();
return SANG_STATUS_SUCCESS;
}
/************************************************************//**
* Public Functions. (Exported)
***************************************************************/
/*!
\fn sangoma_status_t _LIBSNG_CALL sangoma_hwec_config_init(char *device_name)
\brief Load Firmware image onto EC chip.
\param device_name Sangoma API device name.
Windows: wanpipe1_if1, wanpipe2_if1...
Linux: wanpipe1, wanpipe2...
\return SANG_STATUS_SUCCESS: success, or error status
*/
sangoma_status_t _LIBSNG_CALL sangoma_hwec_config_init(char *device_name)
{
sangoma_status_t rc;
wan_custom_param_t custom_parms;
wanec_api_config_t config;
memset(&config, 0x00, sizeof(config));
memset(&custom_parms, 0x0, sizeof(custom_parms));
#if 1
/* enable acoustic echo cancellation by default */
strcpy( custom_parms.name, "WANEC_EnableAcousticEcho" );
strcpy( custom_parms.sValue, "TRUE" );
config.conf.param_no = 1;
config.conf.params = &custom_parms;
#endif
/* Load firmware on EC chip */
rc = wanec_api_config( device_name, libsng_hwec_verbosity_level, &config );
if( rc ) {
return rc;
}
HWEC_CMD_DELAY();
return SANG_STATUS_SUCCESS;
}
/*!
\fn sangoma_status_t _LIBSNG_CALL sangoma_hwec_config_release(char *device_name)
\brief Reset internal state of HWEC API.
\param device_name Sangoma API device name.
Windows: wanpipe1_if1, wanpipe2_if1...
Linux: wanpipe1, wanpipe2...
\return SANG_STATUS_SUCCESS: success, or error status
*/
sangoma_status_t _LIBSNG_CALL sangoma_hwec_config_release(char *device_name)
{
sangoma_status_t rc;
wanec_api_release_t release;
memset(&release, 0, sizeof(wanec_api_release_t));
rc = wanec_api_release( device_name, libsng_hwec_verbosity_level, &release );
if( rc ) {
return rc;
}
HWEC_CMD_DELAY();
return SANG_STATUS_SUCCESS;
}
/*!
Modify channel operation mode.
*/
sangoma_status_t _LIBSNG_CALL sangoma_hwec_config_operation_mode(char *device_name, int mode, unsigned int fe_chan_map)
{
sangoma_status_t rc;
wanec_api_opmode_t opmode;
memset(&opmode, 0, sizeof(wanec_api_opmode_t));
opmode.mode = mode;
opmode.fe_chan_map = fe_chan_map;
/* modes are:
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.
*/
rc = wanec_api_opmode(device_name, libsng_hwec_verbosity_level, &opmode);
if( rc ) {
return rc;
}
HWEC_CMD_DELAY();
return SANG_STATUS_SUCCESS;
}
/*!
\fn sangoma_status_t _LIBSNG_CALL sangoma_hwec_config_power_on (char *device_name, unsigned int fe_chan_map)
\brief 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.
\param device_name Sangoma API device name.
Windows: wanpipe1_if1, wanpipe2_if1...
Linux: wanpipe1, wanpipe2...
\param fe_chan_map Bitmap of channels (timeslots for Digital,
lines for Analog) where the call will take effect.
\return SANG_STATUS_SUCCESS: success, or error status
*/
sangoma_status_t _LIBSNG_CALL sangoma_hwec_config_power_on(char *device_name, unsigned int fe_chan_map)
{
return sangoma_hwec_config_operation_mode(device_name, WANEC_API_OPMODE_NORMAL, fe_chan_map);
}
/*!
\fn sangoma_status_t _LIBSNG_CALL sangoma_hwec_config_power_off (char *device_name, unsigned int fe_chan_map)
\brief 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.
\param device_name Sangoma API device name.
Windows: wanpipe1_if1, wanpipe2_if1...
Linux: wanpipe1, wanpipe2...
\param fe_chan_map Bitmap of channels (timeslots for Digital,
lines for Analog) where the call will take effect.
\return SANG_STATUS_SUCCESS: success, or error status
*/
sangoma_status_t _LIBSNG_CALL sangoma_hwec_config_power_off(char *device_name, unsigned int fe_chan_map)
{
return sangoma_hwec_config_operation_mode(device_name, WANEC_API_OPMODE_POWER_DOWN, fe_chan_map);
}
/*!
\fn sangoma_status_t _LIBSNG_CALL sangoma_hwec_enable(char *device_name, unsigned int fe_chan_map)
\brief 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.
\param device_name Sangoma API device name.
Windows: wanpipe1_if1, wanpipe2_if1...
Linux: wanpipe1, wanpipe2...
\param fe_chan_map Bitmap of channels (timeslots for Digital, lines for Analog) where
the call will take effect.
\return SANG_STATUS_SUCCESS: success, or error status
*/
sangoma_status_t _LIBSNG_CALL sangoma_hwec_enable(char *device_name, unsigned int fe_chan_map)
{
return sangoma_hwec_bypass(device_name, 1 /* enable */, fe_chan_map);
}
/*!
\fn sangoma_status_t _LIBSNG_CALL sangoma_hwec_disable(char *device_name, unsigned int fe_chan_map)
\brief 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.
\param device_name Sangoma API device name.
Windows: wanpipe1_if1, wanpipe2_if1...
Linux: wanpipe1, wanpipe2...
\param fe_chan_map Bitmap of channels (timeslots for Digital, lines for Analog) where
the call will take effect.
\return SANG_STATUS_SUCCESS: success, or error status
*/
sangoma_status_t _LIBSNG_CALL sangoma_hwec_disable(char *device_name, unsigned int fe_chan_map)
{
return sangoma_hwec_bypass(device_name, 0 /* disable */, fe_chan_map);;
}
/*!
\fn sangoma_status_t _LIBSNG_CALL sangoma_hwec_config_channel_parameters(char *device_name, char *parameter, char *parameter_value, unsigned int channel_map)
\brief Modify channel configuration parameters.
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
\param fe_chan_map Bitmap of channels (timeslots for Digital, lines for Analog) where
the call will take effect.
\return SANG_STATUS_SUCCESS: success, or error status
*/
sangoma_status_t _LIBSNG_CALL sangoma_hwec_config_channel_parameters(char *device_name, char *parameter, char *parameter_value, unsigned int channel_map)
{
sangoma_status_t rc;
wanec_api_modify_t channelModify;
wan_custom_param_t aParms;
memset(&channelModify, 0x00, sizeof(channelModify));
memset(&aParms, 0x00, sizeof(aParms));
channelModify.fe_chan_map = channel_map;
channelModify.conf.param_no = 1;
channelModify.conf.params = &aParms;
strcpy( aParms.name, parameter);
strcpy( aParms.sValue, parameter_value);
rc = wanec_api_modify( device_name, libsng_hwec_verbosity_level, &channelModify );
if( rc ){
return rc;
}
HWEC_CMD_DELAY();
return SANG_STATUS_SUCCESS;
}
/*!
\fn 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)
\brief Enable/Disable tone detection (such as DTMF) of channels from channel map.
\param device_name Sangoma API device name.
Windows: wanpipe1_if1, wanpipe2_if1...
Linux: wanpipe1, wanpipe2...
\param tone_id See wanpipe_api_iface.h for list of valid tones
\param enable A flag, if 1 - the specified tone will be detected,
if 0 - specified tone will not be detected.
\param fe_chan_map Bitmap of channels (timeslots for Digital, lines for Analog) where
the call will take effect.
\param port_map Port\Direction of tone detection - Rx, Tx. See wanpipe_events.h for
list of valid ports (WAN_EC_CHANNEL_PORT_SOUT...).
\return SANG_STATUS_SUCCESS: success, or error status
*/
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)
{
sangoma_status_t rc;
wanec_api_tone_t tone;
memset(&tone, 0, sizeof(wanec_api_tone_t));
tone.id = tone_id;
tone.enable = enable;
tone.fe_chan_map = fe_chan_map;
tone.port_map = port_map;
tone.type_map = WAN_EC_TONE_PRESENT | WAN_EC_TONE_STOP;
rc = wanec_api_tone( device_name, libsng_hwec_verbosity_level, &tone );
if( rc ) {
return rc;
}
HWEC_CMD_DELAY();
return SANG_STATUS_SUCCESS;
}
/*!
\fn sangoma_status_t _LIBSNG_CALL sangoma_hwec_print_statistics(char *device_name, int full, unsigned int fe_chan_map)
\brief Read and print Chip/Channel statistics from EC chip.
\param device_name Sangoma API device name.
Windows: wanpipe1_if1, wanpipe2_if1...
Linux: wanpipe1, wanpipe2...
\param full Flag to read full statistics, if set to 1.
\param fe_chan_map Bitmap of channels (timeslots for Digital, lines for Analog) where
the call will read statistics.
\return SANG_STATUS_SUCCESS: success, or error status
*/
sangoma_status_t _LIBSNG_CALL sangoma_hwec_print_statistics(char *device_name, int full, unsigned int fe_chan_map)
{
sangoma_status_t rc;
wanec_api_stats_t stats;
memset(&stats, 0, sizeof(wanec_api_stats_t));
stats.full = full;
stats.fe_chan = fe_chan_map;
stats.reset = 0; /* do not reset */
rc = wanec_api_stats( device_name, libsng_hwec_verbosity_level, &stats );
if( rc ) {
return rc;
}
HWEC_CMD_DELAY();
return SANG_STATUS_SUCCESS;
}
/*!
\fn sangoma_status_t _LIBSNG_CALL sangoma_hwec_audio_buffer_load(char *device_name, char *filename, char pcmlaw, int *out_buffer_id)
\brief Load audio buffer to EC chip. The buffer can be played out using the sangoma_hwec_audio_buffer_playout() function.
\param filename name of the audio file (without the extension).
Actual file must have .pcm extension.
Location:
Windows: %SystemRoot%\sang_ec_files (ex: c:\WINDOWS\sang_ec_files)
Linux: /etc/wanpipe/buffers
\param 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.
\return SANG_STATUS_SUCCESS: success, or error status
*/
sangoma_status_t _LIBSNG_CALL sangoma_hwec_audio_buffer_load(char *device_name, char *filename, char pcmlaw, int *out_buffer_id)
{
sangoma_status_t rc;
wanec_api_bufferload_t bufferload;
memset(&bufferload, 0, sizeof(wanec_api_bufferload_t));
*out_buffer_id = -1;
bufferload.buffer = filename;
bufferload.pcmlaw = pcmlaw;
rc = wanec_api_buffer_load( device_name, libsng_hwec_verbosity_level, &bufferload );
if( rc ) {
return rc;
}
*out_buffer_id = bufferload.buffer_id;
HWEC_CMD_DELAY();
return SANG_STATUS_SUCCESS;
}
/*!
\fn sangoma_status_t _LIBSNG_CALL sangoma_hwec_audio_bufferunload(char *device_name, int in_buffer_id)
\brief Unload/remove an audio buffer from the HWEC chip.
\param device_name Sangoma wanpipe device name. (ex: wanpipe1 - Linux; wanpipe1_if1 - Windows).
\param in_buffer_id ID of the buffer which will be unloaded. The ID must be initialized by sangoma_hwec_audio_bufferload().
\return SANG_STATUS_SUCCESS - buffer was successfully unloaded/removed, SANG_STATUS_GENERAL_ERROR - error occured
*/
sangoma_status_t _LIBSNG_CALL sangoma_hwec_audio_buffer_unload(char *device_name, int in_buffer_id)
{
sangoma_status_t rc;
wanec_api_bufferunload_t bufferunload;
memset(&bufferunload, 0, sizeof(wanec_api_bufferunload_t));
bufferunload.buffer_id = (unsigned int)in_buffer_id;
rc = wanec_api_buffer_unload( device_name, libsng_hwec_verbosity_level, &bufferunload);
if( rc ) {
return rc;
}
HWEC_CMD_DELAY();
return SANG_STATUS_SUCCESS;
}
/*!
\fn sangoma_status_t _LIBSNG_CALL sangoma_hwec_audio_buffer_playout(char *device_name, unsigned int fe_chan_map,
unsigned char port_map, int buffer_id, int start, int repeat_cnt, int duration)
\brief Start\Stop playing out an audio buffer previously loaded by sangoma_hwec_audio_buffer_load().
\param fe_chan_map Bitmap of channels (timeslots for Digital,
lines for Analog) where the call will take effect.
\param port_map Port\Direction 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)
\param in_buffer_id ID of the buffer which will be unloaded. The ID must be initialized by sangoma_hwec_audio_bufferload().
\param start If 1 - start the play out, 0 - stop the play out
\param repeat_cnt Number of times to play out the same buffer
\param duration Maximum duration of the playout, in milliseconds. If it takes less then 'duration' to
play out the whole buffer this paramter is ignored.
\return SANG_STATUS_SUCCESS: success, or error status
*/
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)
{
sangoma_status_t rc;
wanec_api_playout_t playout;
memset(&playout, 0, sizeof(wanec_api_playout_t));
playout.start = start;
playout.fe_chan = fe_chan_map;
playout.buffer_id = in_buffer_id;
playout.port = port;
playout.notifyonstop = 1;
playout.user_event_id = 0xA5; /* dummy value */
playout.repeat_cnt = repeat_cnt;
playout.duration = (duration) ? duration : 5000; /* default is 5s */
rc = wanec_api_playout( device_name, libsng_hwec_verbosity_level, &playout);
if( rc ) {
return rc;
}
HWEC_CMD_DELAY();
return SANG_STATUS_SUCCESS;
}
/*!
\fn void _LIBSNG_CALL sangoma_hwec_config_verbosity(int verbosity_level)
\brief Set Verbosity level of EC API. The level controls amount of data
printed to stdout and wanpipelog.txt for diagnostic purposes.
\param verbosity_level Valid values are from 0 to 3.
\return SANG_STATUS_SUCCESS: success, or error status
*/
sangoma_status_t _LIBSNG_CALL sangoma_hwec_config_verbosity(int verbosity_level)
{
if (verbosity_level >= 0 || verbosity_level <= 3) {
libsng_hwec_verbosity_level = verbosity_level;
return SANG_STATUS_SUCCESS;
}
return SANG_STATUS_INVALID_PARAMETER;
}
#endif /* WP_API_FEATURE_LIBSNG_HWEC */

View File

@ -1,7 +1,7 @@
K 25
svn:wc:ra_dav:version-url
V 43
/svn/libsangoma/!svn/ver/194/trunk/sample_c
/svn/libsangoma/!svn/ver/248/trunk/sample_c
END
lib_api.c
K 25
@ -19,7 +19,7 @@ sample.c
K 25
svn:wc:ra_dav:version-url
V 52
/svn/libsangoma/!svn/ver/194/trunk/sample_c/sample.c
/svn/libsangoma/!svn/ver/234/trunk/sample_c/sample.c
END
sources
K 25
@ -33,12 +33,6 @@ svn:wc:ra_dav:version-url
V 53
/svn/libsangoma/!svn/ver/139/trunk/sample_c/lib_api.h
END
Makefile.Windows
K 25
svn:wc:ra_dav:version-url
V 59
/svn/libsangoma/!svn/ver/29/trunk/sample_c/Makefile.Windows
END
Makefile.Linux
K 25
svn:wc:ra_dav:version-url

View File

@ -0,0 +1,6 @@
K 10
svn:ignore
V 17
Makefile.Windows
END

View File

@ -1,16 +1,16 @@
8
dir
222
273
https://www.sangomapbx.com/svn/libsangoma/trunk/sample_c
https://www.sangomapbx.com/svn/libsangoma
2009-06-23T21:07:59.480026Z
194
2010-01-22T21:30:47.609627Z
248
davidr
has-props
svn:special svn:externals svn:needs-lock
@ -32,7 +32,7 @@ file
2009-04-07T22:02:49.000000Z
2009-08-25T20:44:41.000000Z
df0de3e86155c3e69e9d289a7d923f68
2009-04-07T01:30:57.044470Z
139
@ -44,25 +44,22 @@ file
2009-02-04T23:12:14.000000Z
2009-08-25T20:44:41.000000Z
dbd3173073165a3786ec4e0ef1234db6
2008-12-17T22:14:25.604781Z
57
ncorbic
regression
dir
sample.c
file
2009-06-23T20:48:15.000000Z
ac2fe0c0a868d754e3450cb5fb2827a7
2009-06-23T21:07:59.480026Z
194
2009-12-04T21:21:35.000000Z
17f4ef3cc598f84b869bbcc38d2e12aa
2009-11-19T22:00:29.815332Z
234
davidr
sources
@ -71,7 +68,7 @@ file
2009-05-01T15:10:42.000000Z
2009-08-25T20:44:41.000000Z
9c0fe43fbf63eb82e89e4aceb96f9bfc
2009-04-22T20:41:57.677943Z
146
@ -83,31 +80,19 @@ file
2009-04-07T22:02:49.000000Z
2009-08-25T20:44:41.000000Z
80b2a1bced5f696771e5a92163a9967e
2009-04-07T01:30:57.044470Z
139
ncorbic
Makefile.Windows
file
2009-02-04T23:12:15.000000Z
cebc214b51868b9cdca9356c0d87d074
2008-11-27T23:39:11.660385Z
29
ncorbic
Makefile.Linux
file
2009-04-09T17:49:27.000000Z
2009-08-25T20:44:41.000000Z
ba64d71a9d128b0eb31f6663ae763a68
2009-04-08T00:23:42.359135Z
141
@ -119,7 +104,7 @@ file
2009-02-04T23:12:15.000000Z
2009-08-25T20:44:41.000000Z
5b82f62f87e4700af9b7e48c658b2cfc
2008-11-28T23:21:04.815499Z
32

View File

@ -1,8 +0,0 @@
#
# DO NOT EDIT THIS FILE!!! Edit .\sources. if you want to add a new source
# file to this component. This file merely indirects to the real make file
# that is shared by all the driver components of the Windows NT DDK
#
!INCLUDE $(NTMAKEENV)\makefile.def

View File

@ -49,7 +49,7 @@ static u_int32_t poll_events_bitmap = 0;
*/
#define TEST_NUMBER_OF_OBJECTS 1
static void *sangoma_wait_objects[TEST_NUMBER_OF_OBJECTS];
static sangoma_wait_obj_t *sangoma_wait_objects[TEST_NUMBER_OF_OBJECTS];
/* This example application has only a single execution thread - it is safe
* to use a global buffer for received data and for data to be transmitted. */
@ -87,7 +87,7 @@ int write_data_to_file(unsigned char *data, unsigned int data_length);
void cleanup(void);
#ifdef __WINDOWS__
BOOL TerminateHandler(DWORD dwCtrlType);
BOOL WINAPI TerminateHandler(DWORD dwCtrlType);
#else
void TerminateHandler(int);
#endif

View File

@ -1,8 +0,0 @@
#
# DO NOT EDIT THIS FILE!!! Edit .\sources. if you want to add a new source
# file to this component. This file merely indirects to the real make file
# that is shared by all the driver components of the Windows NT DDK
#
!INCLUDE $(NTMAKEENV)\makefile.def

View File

@ -49,7 +49,7 @@ static u_int32_t poll_events_bitmap = 0;
*/
#define TEST_NUMBER_OF_OBJECTS 1
static void *sangoma_wait_objects[TEST_NUMBER_OF_OBJECTS];
static sangoma_wait_obj_t *sangoma_wait_objects[TEST_NUMBER_OF_OBJECTS];
/* This example application has only a single execution thread - it is safe
* to use a global buffer for received data and for data to be transmitted. */
@ -87,7 +87,7 @@ int write_data_to_file(unsigned char *data, unsigned int data_length);
void cleanup(void);
#ifdef __WINDOWS__
BOOL TerminateHandler(DWORD dwCtrlType);
BOOL WINAPI TerminateHandler(DWORD dwCtrlType);
#else
void TerminateHandler(int);
#endif

View File

@ -1,31 +1,31 @@
K 25
svn:wc:ra_dav:version-url
V 45
/svn/libsangoma/!svn/ver/221/trunk/sample_cpp
/svn/libsangoma/!svn/ver/270/trunk/sample_cpp
END
sangoma_port.h
K 25
svn:wc:ra_dav:version-url
V 60
/svn/libsangoma/!svn/ver/127/trunk/sample_cpp/sangoma_port.h
END
sources
K 25
svn:wc:ra_dav:version-url
V 53
/svn/libsangoma/!svn/ver/149/trunk/sample_cpp/sources
/svn/libsangoma/!svn/ver/248/trunk/sample_cpp/sangoma_port.h
END
sample.vcproj
K 25
svn:wc:ra_dav:version-url
V 59
/svn/libsangoma/!svn/ver/149/trunk/sample_cpp/sample.vcproj
/svn/libsangoma/!svn/ver/248/trunk/sample_cpp/sample.vcproj
END
sources
K 25
svn:wc:ra_dav:version-url
V 53
/svn/libsangoma/!svn/ver/248/trunk/sample_cpp/sources
END
sangoma_interface.cpp
K 25
svn:wc:ra_dav:version-url
V 67
/svn/libsangoma/!svn/ver/221/trunk/sample_cpp/sangoma_interface.cpp
/svn/libsangoma/!svn/ver/270/trunk/sample_cpp/sangoma_interface.cpp
END
sample_linux_compat.h
K 25
@ -37,13 +37,13 @@ sangoma_interface.h
K 25
svn:wc:ra_dav:version-url
V 65
/svn/libsangoma/!svn/ver/209/trunk/sample_cpp/sangoma_interface.h
/svn/libsangoma/!svn/ver/270/trunk/sample_cpp/sangoma_interface.h
END
sangoma_port_configurator.cpp
K 25
svn:wc:ra_dav:version-url
V 75
/svn/libsangoma/!svn/ver/221/trunk/sample_cpp/sangoma_port_configurator.cpp
/svn/libsangoma/!svn/ver/268/trunk/sample_cpp/sangoma_port_configurator.cpp
END
compile.bat
K 25
@ -61,13 +61,13 @@ sangoma_port_configurator.h
K 25
svn:wc:ra_dav:version-url
V 73
/svn/libsangoma/!svn/ver/221/trunk/sample_cpp/sangoma_port_configurator.h
/svn/libsangoma/!svn/ver/268/trunk/sample_cpp/sangoma_port_configurator.h
END
sample.cpp
K 25
svn:wc:ra_dav:version-url
V 56
/svn/libsangoma/!svn/ver/221/trunk/sample_cpp/sample.cpp
/svn/libsangoma/!svn/ver/270/trunk/sample_cpp/sample.cpp
END
sangoma_cthread.h
K 25
@ -75,23 +75,17 @@ svn:wc:ra_dav:version-url
V 63
/svn/libsangoma/!svn/ver/133/trunk/sample_cpp/sangoma_cthread.h
END
Makefile.Windows
K 25
svn:wc:ra_dav:version-url
V 61
/svn/libsangoma/!svn/ver/36/trunk/sample_cpp/Makefile.Windows
END
sample.h
K 25
svn:wc:ra_dav:version-url
V 54
/svn/libsangoma/!svn/ver/209/trunk/sample_cpp/sample.h
/svn/libsangoma/!svn/ver/269/trunk/sample_cpp/sample.h
END
sangoma_port.cpp
K 25
svn:wc:ra_dav:version-url
V 62
/svn/libsangoma/!svn/ver/149/trunk/sample_cpp/sangoma_port.cpp
/svn/libsangoma/!svn/ver/248/trunk/sample_cpp/sangoma_port.cpp
END
Makefile.Linux
K 25
@ -102,6 +96,6 @@ END
sample.sln
K 25
svn:wc:ra_dav:version-url
V 55
/svn/libsangoma/!svn/ver/65/trunk/sample_cpp/sample.sln
V 56
/svn/libsangoma/!svn/ver/235/trunk/sample_cpp/sample.sln
END

View File

@ -1,6 +1,7 @@
K 10
svn:ignore
V 45
V 62
Makefile.Windows
sample.suo
sample.vcproj.DAVIDRNEW.User.user

View File

@ -1,14 +1,14 @@
8
dir
222
273
https://www.sangomapbx.com/svn/libsangoma/trunk/sample_cpp
https://www.sangomapbx.com/svn/libsangoma
2009-07-31T21:19:58.950307Z
221
2010-03-17T17:19:58.104959Z
270
davidr
has-props
@ -32,22 +32,10 @@ file
2009-03-17T21:26:17.000000Z
8dd41c459e1a0cc8d8aedc7d60c4f468
2009-03-17T22:51:09.315324Z
127
ncorbic
sources
file
2009-05-01T15:10:42.000000Z
6c664b4b011761bc7e801eea4d46ce22
2009-04-29T21:06:58.775163Z
149
2010-02-10T23:05:43.000000Z
64b4431c40f821db3c3ec77054f084c0
2010-01-22T21:30:47.609627Z
248
davidr
sample.vcproj
@ -56,23 +44,35 @@ file
2009-05-01T15:10:42.000000Z
fcfbf781e9bf08474ea8ae31cc4eb5ed
2009-04-29T21:06:58.775163Z
149
2010-02-10T23:05:43.000000Z
3c2655474848e163999341285dc2412e
2010-01-22T21:30:47.609627Z
248
davidr
has-props
sources
file
2010-02-10T23:05:43.000000Z
3bfbd303967164dde107c6accf8d9f84
2010-01-22T21:30:47.609627Z
248
davidr
sangoma_interface.cpp
file
2009-08-12T17:51:19.000000Z
b7d6e8d02328af549d418df55362e9de
2009-07-31T21:19:58.950307Z
221
2010-03-23T16:14:34.000000Z
380486fdf6a516f0415b3d0dc8c58f78
2010-03-17T17:19:58.104959Z
270
davidr
sample_linux_compat.h
@ -81,7 +81,7 @@ file
2009-02-27T22:47:06.000000Z
2009-08-25T20:44:41.000000Z
46ae76a473c75513d3b253bd96524f17
2009-03-04T17:25:18.587182Z
109
@ -93,10 +93,10 @@ file
2009-07-09T16:10:23.000000Z
590894465af0fe4521a74cce3807bcfd
2009-07-09T15:05:43.234603Z
209
2010-03-23T16:14:34.000000Z
72a11cbee60d7ac08fe0e09d18d34b43
2010-03-17T17:19:58.104959Z
270
davidr
sangoma_port_configurator.cpp
@ -105,11 +105,11 @@ file
2009-08-12T17:51:19.000000Z
01af22c918c1d485ad32f37b1900c84d
2009-07-31T21:19:58.950307Z
221
davidr
2010-03-23T16:14:34.000000Z
dd259c7c57987730dc55b0c6b67e9497
2010-03-10T21:56:50.328276Z
268
jpatel
compile.bat
file
@ -117,7 +117,7 @@ file
2009-03-11T22:40:27.000000Z
2009-08-25T20:44:41.000000Z
6e4285eeda3d888a8e689516b028327a
2009-03-06T22:48:37.915855Z
120
@ -129,7 +129,7 @@ file
2009-04-01T22:43:03.000000Z
2009-08-25T20:44:41.000000Z
f6d802e64eba57d4a2eed52a86ed6749
2009-03-31T20:38:44.891800Z
133
@ -141,11 +141,11 @@ file
2009-08-12T17:51:19.000000Z
360507fc313b6e75dc1526c4e661d3e2
2009-07-31T21:19:58.950307Z
221
davidr
2010-03-23T16:14:34.000000Z
946fd40742fd52ca8775b538372956af
2010-03-10T21:56:50.328276Z
268
jpatel
sample.cpp
file
@ -153,10 +153,10 @@ file
2009-08-12T17:51:19.000000Z
e130dea0b7419e7133d5ccfee92d5f0d
2009-07-31T21:19:58.950307Z
221
2010-03-23T16:14:34.000000Z
78341087eea6b46442f6bdd047eba2a8
2010-03-17T17:19:58.104959Z
270
davidr
sangoma_cthread.h
@ -165,34 +165,22 @@ file
2009-04-01T22:43:03.000000Z
2009-08-25T20:44:41.000000Z
0f69bcec99210ad26c7391e53a88255e
2009-03-31T20:38:44.891800Z
133
davidr
Makefile.Windows
file
2009-02-04T23:12:15.000000Z
cebc214b51868b9cdca9356c0d87d074
2008-12-03T18:36:50.128544Z
36
davidr
sample.h
file
2009-07-09T16:10:23.000000Z
c1835df029ede3c0f8680ab3f157ae96
2009-07-09T15:05:43.234603Z
209
2010-03-23T16:14:34.000000Z
c7026dce798297ddf34b7d592f7c5ac1
2010-03-15T20:12:36.300714Z
269
davidr
sangoma_port.cpp
@ -201,10 +189,10 @@ file
2009-05-01T15:10:42.000000Z
bef1d645d075acfae9d9a4a436ef7bb5
2009-04-29T21:06:58.775163Z
149
2010-02-10T23:05:43.000000Z
e7715c5d2deb029f1abef3bce2b71aba
2010-01-22T21:30:47.609627Z
248
davidr
Makefile.Linux
@ -213,7 +201,7 @@ file
2009-02-27T22:09:44.000000Z
2009-08-25T20:44:41.000000Z
93f1e9c6d533615e6b2dfc7aba2fd0a2
2009-02-27T23:27:29.300080Z
105
@ -225,10 +213,10 @@ file
2009-02-04T23:12:15.000000Z
e3c5c4b8ac32567bc393629bc4c6f77f
2008-12-23T23:24:52.992798Z
65
2009-12-04T21:21:35.000000Z
2f4e833b9fd409d8f1c07dded92a32de
2009-12-01T20:38:57.462038Z
235
davidr
has-props

View File

@ -1,8 +0,0 @@
#
# DO NOT EDIT THIS FILE!!! Edit .\sources. if you want to add a new source
# file to this component. This file merely indirects to the real make file
# that is shared by all the driver components of the Windows NT DDK
#
!INCLUDE $(NTMAKEENV)\makefile.def

View File

@ -37,9 +37,9 @@
#include "sangoma_interface.h"
#if defined(__LINUX__)
#include "sample_linux_compat.h"
# include "sample_linux_compat.h"
#else
#include <conio.h>
# include <conio.h>
#endif
#ifndef MAX_PATH
@ -55,13 +55,15 @@ wp_program_settings_t program_settings;
callback_functions_t callback_functions;
/*****************************************************************
* Prototypes & Defines
*****************************************************************/
static int got_rx_data(void *sang_if_ptr, void *rx_data);
static void got_TdmApiEvent(void *sang_if_ptr, void *event_data);
static void got_tdm_api_event(void *sang_if_ptr, void *event_data);
#if USE_WP_LOGGER
static void got_logger_event(void *sang_if_ptr, wp_logger_event_t *logger_event);
#endif
typedef struct{
void *sang_if_ptr;
@ -116,16 +118,21 @@ static int set_port_configuration();
sangoma_interface* init(int wanpipe_number, int interface_number)
{
sangoma_interface *sang_if = NULL;
DBG_MAIN("init()\n");
DBG_MAIN("%s()\n", __FUNCTION__);
if(program_settings.use_ctrl_dev == 1){
sang_if = new sangoma_api_ctrl_dev();
}else if(program_settings.use_logger_dev == 1){
sang_if = new sangoma_api_logger_dev();
}else{
sang_if = new sangoma_interface(wanpipe_number, interface_number);
}
if(sang_if->init(&callback_functions)){
delete sang_if;
return NULL;
}
DBG_MAIN("init(): OK\n");
return sang_if;
}
@ -187,11 +194,15 @@ void PrintRxData(wp_api_hdr_t *hdr, void *pdata)
rx_counter++;
if(program_settings.silent){
if((rx_counter % 1000) == 0){
INFO_MAIN("Rx counter:%d, Rx datlen : %d\n", rx_counter, datlen);
INFO_MAIN("Rx counter: %d, Rx datlen: %d\n", rx_counter, datlen);
#if 0
INFO_MAIN("Timestamp: Seconds: %d, Microseconds: %d\n",
hdr->wp_api_hdr_time_stamp_sec, hdr->wp_api_hdr_time_stamp_use);
#endif
}
return;
}else{
INFO_MAIN("Rx counter:%d, Rx datlen : %d. Data :\n", rx_counter, datlen);
INFO_MAIN("Rx counter: %d, Rx datlen: %d. Data:\n", rx_counter, datlen);
}
#if 1
@ -250,7 +261,7 @@ static int got_rx_data(void *sang_if_ptr, void *rxhdr, void *rx_data)
}
/*!
\fn static void got_TdmApiEvent(void *sang_if_ptr, void *event_data)
\fn static void got_tdm_api_event(void *sang_if_ptr, void *event_data)
\brief Callback function indicating Event is pending.
\param sang_if_ptr sangoma interface pointer
\param event_data API event element strcutre containt header + data
@ -259,7 +270,7 @@ static int got_rx_data(void *sang_if_ptr, void *rxhdr, void *rx_data)
Currently Windows launches a thread to handle the event, where
Linux handles the event directly. Implementation is left to the user.
*/
static void got_TdmApiEvent(void *sang_if_ptr, void *event_data)
static void got_tdm_api_event(void *sang_if_ptr, void *event_data)
{
TDM_API_EVENT_THREAD_PARAM *param =
(TDM_API_EVENT_THREAD_PARAM*)malloc(sizeof(TDM_API_EVENT_THREAD_PARAM));
@ -369,12 +380,12 @@ void *TdmApiEventThreadFunc(void *lpdwParam)
DBG_MAIN("New Alarm State: 0x%X\n", wp_tdm_api_event->wp_api_event_alarm);
break;
case WP_API_EVENT_POLARITY_REVERSE:
/* This event may have different meaning on different Telco lines.
* For example, it indicates "Network Initiated Clearing",
* on a British Telecom line. But on some lines it means
* "Start of Caller ID transmission". Please consult with your Telco
* for exact meaning of event. */
case WP_API_EVENT_POLARITY_REVERSE:
/* This event may have different meaning on different Telco lines.
* For example, it indicates "Network Initiated Clearing",
* on a British Telecom line. But on some lines it means
* "Start of Caller ID transmission". Please consult with your Telco
* for exact meaning of event. */
DBG_MAIN("Polarity Reversal Event: %s\n",
WP_API_EVENT_POLARITY_REVERSE_DECODE(wp_tdm_api_event->wp_api_event_polarity_reverse));
break;
@ -390,6 +401,27 @@ void *TdmApiEventThreadFunc(void *lpdwParam)
return 0;
}
#if USE_WP_LOGGER
/*!
\fn static void got_logger_event(void *sang_if_ptr, wp_logger_event_t *logger_event)
\brief Callback function indicating Logger Event is pending.
\param sang_if_ptr sangoma interface pointer
\param logger_event API Logger Event structure
\return 0 - ok non-zero - Error
*/
static void got_logger_event(void *sang_if_ptr, wp_logger_event_t *logger_event)
{
char *timestamp_str = sangoma_ctime( &logger_event->time_stamp_sec );
INFO_MAIN("Logger Event Type:\t%s (Logger:%d BitMap: 0x%08X)\n",
wp_decode_logger_event_type(logger_event->logger_type, logger_event->event_type),
logger_event->logger_type, logger_event->event_type);
/* Display Logger Event Timestamp as UNIX-style Date string. */
INFO_MAIN("Time and Date:\t\t%s\n",
(timestamp_str == NULL ? "Invalid Timestamp" : timestamp_str));
INFO_MAIN("Logger Event Data: %s\n\n", logger_event->data);
}
#endif
/*!
\fn int tx_file(sangoma_interface *sang_if)
@ -492,34 +524,48 @@ static int get_user_hex_number()
\param argc number of arguments
\param argv argument list
\return 0 - ok non-zero - Error
*/
static int parse_command_line_args(int argc, char* argv[])
{
int i;
const char *USAGE_STR =
"\n"
"Usage: sample [-c] [-i] [-silent]\n"
"Usage: sample [-c] [-i] [options]\n"
"\n"
"Options:\n"
"\t-c number Wanpipe number: 1,2,3...\n"
"\t-i number Interface number 0,1,2,3,....\n"
"\t-driver_config configure start/stop driver using volatile....\n"
"\t-c number Wanpipe (Port/Span) number: 1,2,3...\n"
"\t-i number Interface number 1,2,3,....\n"
"options:\n"
"\t-silent Disable display of Rx data\n"
"\t-rx2tx All received data automatically transmitted on the SAME interface\n"
"\t-txlength\tnumber\tLength of data frames to be transmitted when 't' key is pressed\n"
"\t-txcount\tnumber Number of test data frames to be transmitted when 't' key is pressed\n"
"\t-driver_config \tStop/Set Configuration/Start a Port....\n"
"\t-rx2tx All received data automatically transmitted on\n"
"\t the SAME interface\n"
"\t-txlength\tnumber\tLength of data frames to be transmitted when 't'\n"
"\t \t \tkey is pressed\n"
"\t-txcount\tnumber Number of test data frames to be transmitted when 't'\n"
"\t \t \tkey is pressed\n"
"\t-tx_file_name\tstring\tFile to be transmitted when 't' key is pressed\n"
#if USE_STELEPHONY_API
"\t-decode_fsk_cid\t\tDecode FSK Caller ID on an Analog line. For Voice data only.\n"
"\t-encode_fsk_cid\t\tEncode FSK Caller ID on an Analog line. For Voice data only.\n"
"\t-decode_fsk_cid\t\tDecode FSK Caller ID on an Analog line.\n"
"\t \t\tFor Voice data only.\n"
"\t-encode_fsk_cid\t\tEncode FSK Caller ID on an Analog line.\n"
"\t \t\tFor Voice data only.\n"
"\t-encode_sw_dtmf\t\tEncode SW DTMF on an line. For Voice data only.\n"
"\t-sw_dtmf Enable Sangoma Software DTMF decoder. For Voice data only.\n"
"\t-decode_q931 Enable Sangoma Q931 decoder. For HDLC (Dchannel) data only.\n"
"\t-alaw\t\t Use Alaw codec instead of default MuLaw codec for Voice data.\n"
"\t-rm_txgain\t Set txgain for FXS/FXO modules.\n"
"\t \t\tFXO range from -150 to 120, FXS 35 or -35\n"
"\t-rm_rxgain\t Set txgain for FXS/FXO modules.\n"
"\t \t\tFXO range from -150 to 120, FXS 35 or -35\n"
#endif
#if 0
"\t-use_ctrl_dev Use the global 'wptdm_ctrl' device to Get events and to Control device.\n"
"\t-use_ctrl_dev \tUse the global 'wptdm_ctrl' device to Get events from\n"
"\t \tall API devices.\n"
#endif
"\t-use_logger_dev \tUse the global Logger device to Get Log Messages\n"
"\t \tfrom API driver.\n"
#ifdef WP_API_FEATURE_LIBSNG_HWEC
"\t-use_hwec \tInitialize/Configure/Use the Hardware Echo Canceller\n"
#endif
"\n"
"Example: sample -c 1 -i 1\n";
@ -527,8 +573,10 @@ static int parse_command_line_args(int argc, char* argv[])
memset(&program_settings, 0, sizeof(wp_program_settings_t));
program_settings.wanpipe_number = 1;
program_settings.interface_number = 1;
program_settings.txlength = 128;
program_settings.txlength = 80;
program_settings.txcount = 1;
program_settings.rxgain = 0xFFFF; //FXO/FXS rx gain unchanged
program_settings.txgain = 0xFFFF; //FXO/FXS tx gain unchanged
for(i = 1; i < argc;){
@ -618,6 +666,29 @@ static int parse_command_line_args(int argc, char* argv[])
}else if(_stricmp(argv[i], "-use_ctrl_dev") == 0){
INFO_MAIN("Using ctrl_dev...\n");
program_settings.use_ctrl_dev = 1;
}else if(_stricmp(argv[i], "-use_logger_dev") == 0){
INFO_MAIN("Using logger_dev...\n");
program_settings.use_logger_dev = 1;
}else if(_stricmp(argv[i], "-rm_txgain") == 0){
if (i+1 > argc-1){
INFO_MAIN("No txgain provided!\n");
return 1;
}
program_settings.txgain = atoi(argv[i+1]);
i++;
INFO_MAIN("Setting txgain to %d.\n", program_settings.txgain);
}else if(_stricmp(argv[i], "-rm_rxgain") == 0){
if (i+1 > argc-1){
INFO_MAIN("No rxgain provided!\n");
return 1;
}
program_settings.rxgain = atoi(argv[i+1]);
i++;
INFO_MAIN("Setting rxgain to %d.\n", program_settings.txgain);
}else if(_stricmp(argv[i], "-use_hwec") == 0){
INFO_MAIN("Using hardware echo canceller...\n");
program_settings.use_hardware_echo_canceller = 1;
}else{
INFO_MAIN("Error: Invalid Argument %s\n",argv[i]);
return 1;
@ -654,8 +725,10 @@ int __cdecl main(int argc, char* argv[])
////////////////////////////////////////////////////////////////////////////
memset(&callback_functions, 0x00, sizeof(callback_functions));
callback_functions.got_rx_data = got_rx_data;
callback_functions.got_TdmApiEvent = got_TdmApiEvent;
callback_functions.got_tdm_api_event = got_tdm_api_event;
#if USE_WP_LOGGER
callback_functions.got_logger_event = got_logger_event;
#endif
////////////////////////////////////////////////////////////////////////////
if(parse_command_line_args(argc, argv)){
return 1;
@ -693,65 +766,92 @@ int __cdecl main(int argc, char* argv[])
cleanup(sang_if);
return rc;
}
if(program_settings.txgain != 0xFFFF) {
INFO_MAIN("Applying txgain...\n");
if (sang_if->tdm_control_rm_txgain(program_settings.txgain)){
INFO_MAIN("Failed to apply txgain!\n");
}
}
/* FXS cannot detect if phone is connected or not when the card is started
therefore tranmit following two events for Set Polarity to work */
if(sang_if->get_adapter_type() == WAN_MEDIA_FXOFXS && sang_if->get_sub_media() == MOD_TYPE_FXS) {
INFO_MAIN("Setting Proper hookstates on FXS\n");
sang_if->tdm_txsig_offhook();
sang_if->tdm_txsig_onhook();
}
if(program_settings.rxgain != 0xFFFF) {
INFO_MAIN("Applying rxgain...\n");
if (sang_if->tdm_control_rm_rxgain(program_settings.rxgain)){
INFO_MAIN("Failed to apply rxgain!\n");
}
}
do{
EnterCriticalSection(&PrintCriticalSection);
INFO_MAIN("Press 'q' to quit the program.\n");
INFO_MAIN("Press 't' to transmit data.\n");
INFO_MAIN("Press 's' to get Operational Statistics.\n");
INFO_MAIN("Press 'f' to reset (flush) Operational Statistics.\n");
INFO_MAIN("Press 'v' to get API driver version.\n");
if(sang_if->get_adapter_type() == WAN_MEDIA_T1 || sang_if->get_adapter_type() == WAN_MEDIA_E1){
INFO_MAIN("Press 'a' to get T1/E1 alarms.\n");
//RBS (CAS) commands
INFO_MAIN("Press 'g' to get RBS bits.\n");
INFO_MAIN("Press 'r' to set RBS bits.\n");
INFO_MAIN("Press '1' to read FE register. Warning: used by Sangoma Techsupport only!\n");
INFO_MAIN("Press '2' to write FE register. Warning: used by Sangoma Techsupport only!\n");
}
INFO_MAIN("Press 'i' to set Tx idle data buffer (BitStream only).\n");
switch(sang_if->get_adapter_type())
{
case WAN_MEDIA_T1:
//those commands valid only for T1
INFO_MAIN("Press 'l' to send 'activate remote loop back' signal.\n");
INFO_MAIN("Press 'd' to send 'deactivate remote loop back' signal.\n");
break;
case WAN_MEDIA_FXOFXS:
switch(sang_if->get_sub_media())
if(program_settings.use_logger_dev != 1){
/* these options valid for non-logger api devices */
INFO_MAIN("Press 't' to transmit data.\n");
INFO_MAIN("Press 'v' to get API driver version.\n");
if(sang_if->get_adapter_type() == WAN_MEDIA_T1 || sang_if->get_adapter_type() == WAN_MEDIA_E1){
INFO_MAIN("Press 'a' to get T1/E1 alarms.\n");
//RBS (CAS) commands
INFO_MAIN("Press 'g' to get RBS bits.\n");
INFO_MAIN("Press 'r' to set RBS bits.\n");
INFO_MAIN("Press '1' to read FE register. Warning: used by Sangoma Techsupport only!\n");
INFO_MAIN("Press '2' to write FE register. Warning: used by Sangoma Techsupport only!\n");
}
INFO_MAIN("Press 'i' to set Tx idle data buffer (BitStream only).\n");
switch(sang_if->get_adapter_type())
{
case MOD_TYPE_FXS:
INFO_MAIN("Press 'e' to listen to test tones on a phone connected to the A200-FXS\n");
INFO_MAIN("Press 'c' to ring/stop ring phone connected to the A200-FXS\n");
INFO_MAIN("Press 'n' to enable/disable reception of ON/OFF Hook events on A200-FXS\n");
INFO_MAIN("Press 'm' to enable DTMF events (on SLIC chip) on A200-FXS\n");
INFO_MAIN("Press 'j' to enable/disable reception of Ring Trip events on A200-FXS\n");
case WAN_MEDIA_T1:
//those commands valid only for T1
INFO_MAIN("Press 'l' to send 'activate remote loop back' signal.\n");
INFO_MAIN("Press 'd' to send 'deactivate remote loop back' signal.\n");
break;
case WAN_MEDIA_FXOFXS:
switch(sang_if->get_sub_media())
{
case MOD_TYPE_FXS:
INFO_MAIN("Press 'e' to listen to test tones on a phone connected to the A200-FXS\n");
INFO_MAIN("Press 'c' to ring/stop ring phone connected to the A200-FXS\n");
INFO_MAIN("Press 'n' to enable/disable reception of ON/OFF Hook events on A200-FXS\n");
INFO_MAIN("Press 'm' to enable DTMF events (on SLIC chip) on A200-FXS\n");
INFO_MAIN("Press 'j 'to enable/disable reception of Ring Trip events on A200-FXS\n");
INFO_MAIN("Press 'k' to transmit kewl - drop line voltage on the line connected to the A200-FXS\n");
INFO_MAIN("Press 'h' to set polarity on the line connected to the A200-fXS\n");
INFO_MAIN("Press 'u' to transmit onhooktransfer on the line connected to the A200-FXS\n");
break;
case MOD_TYPE_FXO:
INFO_MAIN("Press 'u' to enable/disable reception of Ring Detect events on A200-FXO\n");
INFO_MAIN("Press 'h' to transmit ON/OFF hook signals on A200-FXO\n");
INFO_MAIN("Press 'a' to get Line Status (Connected/Disconnected)\n");
case MOD_TYPE_FXO:
INFO_MAIN("Press 'u' to enable/disable reception of Ring Detect events on A200-FXO\n");
INFO_MAIN("Press 'h' to transmit ON/OFF hook signals on A200-FXO\n");
INFO_MAIN("Press 'a' to get Line Status (Connected/Disconnected)\n");
break;
}
break;
case WAN_MEDIA_BRI:
INFO_MAIN("Press 'k' to Activate/Deactivate ISDN BRI line\n");
INFO_MAIN("Press 'l' to enable bri bchan loopback\n");
INFO_MAIN("Press 'd' to disable bri bchan loopback\n");
break;
}
break;
case WAN_MEDIA_BRI:
INFO_MAIN("Press 'k' to Activate/Deactivate ISDN BRI line\n");
INFO_MAIN("Press 'l' to enable bri bchan loopback\n");
INFO_MAIN("Press 'd' to disable bri bchan loopback\n");
break;
}
INFO_MAIN("Press 'o' to enable DTMF events (on Octasic chip)\n");
if (program_settings.encode_sw_dtmf) {
INFO_MAIN("Press 'x' to send software DTMF\n");
}
if (program_settings.encode_fsk_cid) {
INFO_MAIN("Press 'z' to send software FSK Caller ID\n");
}
INFO_MAIN("Press 'o' to enable DTMF events (on Octasic chip)\n");
if (program_settings.encode_sw_dtmf) {
INFO_MAIN("Press 'x' to send software DTMF\n");
}
if (program_settings.encode_fsk_cid) {
INFO_MAIN("Press 'z' to send software FSK Caller ID\n");
}
}//if(program_settings.use_logger_dev != 1)
LeaveCriticalSection(&PrintCriticalSection);
user_selection = tolower(_getch());
switch(user_selection)
{
@ -772,7 +872,12 @@ int __cdecl main(int argc, char* argv[])
}
break;
case 's':
{
if(program_settings.use_logger_dev == 1){
wp_logger_stats_t stats;
/* Warning: for demonstration purposes only, it is assumed,
* that 'sang_if' is 'sangoma_api_logger_dev'. */
((sangoma_api_logger_dev*)sang_if)->get_logger_dev_operational_stats(&stats);
}else{
wanpipe_chan_stats_t stats;
sang_if->get_operational_stats(&stats);
}
@ -1035,16 +1140,20 @@ user_retry_ring_e_d:
break;
case 'u':
//Enable/Disable Ring Detect events on FXO.
INFO_MAIN("Press 'e' to ENABLE Rx Ring Detect Events, 'd' to DISABLE Rx Ring Detect Events.\n");
INFO_MAIN("\n");
switch(tolower(_getch()))
{
case 'e':
sang_if->tdm_enable_ring_detect_events();
break;
case 'd':
default:
sang_if->tdm_disable_ring_detect_events();
if(sang_if->get_sub_media()==MOD_TYPE_FXO){
INFO_MAIN("Press 'e' to ENABLE Rx Ring Detect Events, 'd' to DISABLE Rx Ring Detect Events.\n");
INFO_MAIN("\n");
switch(tolower(_getch()))
{
case 'e':
sang_if->tdm_enable_ring_detect_events();
break;
case 'd':
default:
sang_if->tdm_disable_ring_detect_events();
}
}else if(sang_if->get_sub_media()==MOD_TYPE_FXS){
sang_if->tdm_txsig_onhooktransfer();
}
break;
case 'j':
@ -1062,29 +1171,56 @@ user_retry_ring_e_d:
}
break;
case 'h':
INFO_MAIN("Press 'e' to transmit OFF hook signal, 'd' to transmit ON hook signal.\n");
INFO_MAIN("\n");
switch(tolower(_getch()))
{
case 'e':
sang_if->fxo_go_off_hook();
break;
case 'd':
default:
sang_if->fxo_go_on_hook();
if(sang_if->get_sub_media()==MOD_TYPE_FXO) {
INFO_MAIN("Press 'e' to transmit OFF hook signal, 'd' to transmit ON hook signal.\n");
INFO_MAIN("\n");
switch(tolower(_getch()))
{
case 'e':
sang_if->fxo_go_off_hook();
break;
case 'd':
default:
sang_if->fxo_go_on_hook();
}
}else if(sang_if->get_sub_media()==MOD_TYPE_FXS ) {
INFO_MAIN("Press 'f' for forward, 'r' to for reverse.\n");
INFO_MAIN("\n");
switch(tolower(_getch()))
{
case 'f':
sang_if->tdm_set_rm_polarity(0);
break;
case 'r':
sang_if->tdm_set_rm_polarity(1);
break;
default:
//toggle it
sang_if->tdm_set_rm_polarity(1);
sang_if->tdm_set_rm_polarity(0);
}
}
break;
case 'k':
INFO_MAIN("Press 'e' to Activate, 'd' to De-Activate line.\n");
INFO_MAIN("\n");
switch(tolower(_getch()))
{
case 'e':
sang_if->tdm_front_end_activate();
break;
case 'd':
default:
sang_if->tdm_front_end_deactivate();
if( sang_if->get_adapter_type() == WAN_MEDIA_BRI ) {
INFO_MAIN("Press 'e' to Activate, 'd' to De-Activate line.\n");
INFO_MAIN("\n");
switch(tolower(_getch()))
{
case 'e':
sang_if->tdm_front_end_activate();
break;
case 'd':
default:
sang_if->tdm_front_end_deactivate();
}
}else if(sang_if->get_adapter_type()== WAN_MEDIA_FXOFXS) {
if(sang_if->get_sub_media()==MOD_TYPE_FXS) {
sang_if->tdm_txsig_kewl();
sangoma_msleep(5000);
//to restore line current after txsig kewl
sang_if->tdm_txsig_offhook();
}
}
break;
case 'p':
@ -1127,8 +1263,18 @@ user_retry_ring_e_d:
break;
case 'z':
{
INFO_MAIN("Sending CallerID.\n");
sang_if->sendCallerID("Sangoma Rocks", "9054741990");
if(WAN_MEDIA_FXOFXS == sang_if->get_adapter_type() && MOD_TYPE_FXS == sang_if->get_sub_media() ){
//Ring the line
sang_if->start_ringing_phone();
sangoma_msleep(2000);
//txsig offhook
sang_if->fxs_txsig_offhook();
INFO_MAIN("Sending CallerID.\n");
sang_if->sendCallerID("Sangoma Rocks", "9054741990");
}else{
INFO_MAIN("Sending CallerID.\n");
sang_if->sendCallerID("Sangoma Rocks", "9054741990");
}
}
break;
#endif
@ -1184,7 +1330,8 @@ user_retry_ring_e_d:
static int set_port_configuration()
{
int rc = 0, is_te1_card = 0, user_selection;
int rc = 0, user_selection;
int is_te1_card = 0, is_analog_card = 0;
hardware_info_t hardware_info;
port_cfg_t port_cfg;
@ -1214,15 +1361,6 @@ static int set_port_configuration()
return 3;
}
#if 0
defined(__WINDOWS__)
rc = sng_port_cfg_obj->open_port_registry_key(&hardware_info);
if(rc != SANG_STATUS_SUCCESS){
delete sng_port_cfg_obj;
return 3;
}
#endif
memset(&port_cfg, 0x00, sizeof(port_cfg_t));
switch(hardware_info.card_model)
@ -1233,17 +1371,21 @@ defined(__WINDOWS__)
case A108_ADPTR_8TE1:
is_te1_card = 1;
break;
case A200_ADPTR_ANALOG:
case A400_ADPTR_ANALOG:
is_analog_card = 1;
break;
case AFT_ADPTR_FLEXBRI:
//B700, a hybrid card - may have both ISDN BRI and Analog ports
break;
}
if(is_te1_card){
INFO_MAIN("\n");
INFO_MAIN("Press 't' to set T1 configration.\n");
INFO_MAIN("Press 'e' to set E1 configration.\n");
try_again:
user_selection = tolower(_getch());
switch(user_selection)
{
case 't'://T1
@ -1254,27 +1396,38 @@ try_again:
rc=sng_port_cfg_obj->initialize_e1_tdm_span_voice_api_configration_structure(&port_cfg,&hardware_info,program_settings.wanpipe_number);
break;
case 'q'://quit the application
rc = 1;
break;
default:
INFO_MAIN("Invalid command %c.\n",user_selection);
goto try_again;
break;
}//switch(user_selection)
}//if(is_te1_card)
} else { //if(is_te1_card)
#if 0
if(is_analog_card){
//read current configuration:
if(sng_port_cfg_obj->get_configration(&port_cfg)){
rc = 1;
}else{
//print the current configuration:
sng_port_cfg_obj->print_port_cfg_structure(&port_cfg);
//as an EXAMPLE, set the same configration as the current one:
//rc = sng_port_cfg_obj->set_default_configuration(&port_cfg);
}
#else
INFO_MAIN("Unsupported Card %i\n",hardware_info.card_model);
rc = 1;
#if 0
//as an EXAMPLE, enable Loop Current Monitoring for Analog FXO:
rc=sng_port_cfg_obj->control_analog_rm_lcm(&port_cfg, 1);
#endif
#if 0
//as an EXAMPLE, set Operation mode for FXO:
rc=sng_port_cfg_obj->set_analog_opermode(&port_cfg, "TBR21");
#endif
}
}//if(is_analog_card)
if(!is_te1_card && !is_analog_card){
INFO_MAIN("Unsupported Card %d\n", hardware_info.card_model);
rc = 1;
}
do{
@ -1282,7 +1435,6 @@ try_again:
ERR_MAIN("Failed to Initialize Port Configuratoin structure!\n");
break;
}
#if 1
INFO_MAIN("Stopping PORT for re-configuration!\n");
if ((rc = sng_port_cfg_obj->stop_port())) {
@ -1316,7 +1468,7 @@ try_again:
delete sng_port_cfg_obj;
}
sangoma_msleep(2000);//wait a little (2 seconds) for initialization to complete
sangoma_msleep(2000);//wait 2 seconds for initialization to complete
return rc;
}
@ -1334,7 +1486,7 @@ static void FSKCallerIDEvent(void *callback_context,
if(Name){
INFO_MAIN("Name: %s\n", Name);
#if 1
#if 0
printf("caller name in SINGLE byte hex:\n");
for(unsigned int ind = 0; ind < strlen(Name); ind++){
printf("Name[%02d]: 0x%02X\n", ind, Name[ind]);
@ -1345,9 +1497,11 @@ static void FSKCallerIDEvent(void *callback_context,
for(unsigned int ind = 0; ind < strlen(Name); ind += 2){
printf("Name[%02d]: 0x%04X\n", ind, *(unsigned short*)&Name[ind]);
}
printf("\n");
#endif
printf("\n");
}
if(CallerNumber){
INFO_MAIN("CallerNumber: %s\n", CallerNumber);
}
@ -1445,7 +1599,7 @@ static void FSKCallerIDTransmit (void *callback_context, void *FskCidBuffer)
/* FSK CID buffer can be big (~8000 bytes), we don't want to block the calling thread,
so start a new thread to transmit FSK CID. */
sang_if->CreateSwDtmfTxThread(FskCidBuffer);
sang_if->CreateFskCidTxThread(FskCidBuffer);
}
#if 0

View File

@ -9,6 +9,7 @@
#include <libstelephony.h>
#endif
#define USE_WP_LOGGER 1
#define SAMPLE_CPP_MAX_PATH 1024
typedef struct{
@ -27,6 +28,10 @@ typedef struct{
unsigned int txcount;
unsigned char driver_config;
unsigned char use_ctrl_dev;
unsigned char use_logger_dev;
int txgain;
int rxgain;
unsigned char use_hardware_echo_canceller;
}wp_program_settings_t;
#define DEV_NAME_LEN 100
@ -38,7 +43,7 @@ typedef struct{
//Recieved data
int (*got_rx_data)(void *sang_if_ptr, void *rxhdr, void *rx_data);
//TDM events
void (*got_TdmApiEvent)(void *sang_if_ptr, void *event_data);
void (*got_tdm_api_event)(void *sang_if_ptr, void *event_data);
#if USE_STELEPHONY_API
//FSK Caller ID detected
void (*FSKCallerIDEvent)(void *sang_if_ptr, char * Name, char * CallerNumber, char * CalledNumber, char * DateTime);
@ -51,6 +56,11 @@ typedef struct{
//DTMF buffer ready for transmission events
void (*SwDtmfTransmit)(void *callback_context, void* buffer);
#endif
#if USE_WP_LOGGER
void (*got_logger_event)(void *sang_if_ptr, wp_logger_event_t *logger_event);
#endif
}callback_functions_t;
static void DecodeLastError(LPSTR lpszFunction)
@ -70,7 +80,7 @@ static void DecodeLastError(LPSTR lpszFunction)
NULL
);
// Display the string.
printf("Last Error: %s (GetLastError() returned: %d)\n", lpMsgBuf, dwLastErr);
printf("Last Error: %s (GetLastError() returned: %d)\n", (char*)lpMsgBuf, dwLastErr);
// Free the buffer.
LocalFree( lpMsgBuf );
#endif

View File

@ -1,7 +1,7 @@

Microsoft Visual Studio Solution File, Format Version 9.00
# Visual Studio 2005
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "sample", "sample.vcproj", "{20071FBB-88EE-41D9-A728-68A883BFC68B}"
Microsoft Visual Studio Solution File, Format Version 10.00
# Visual Studio 2008
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "sample_cpp", "sample.vcproj", "{20071FBB-88EE-41D9-A728-68A883BFC68B}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution

View File

@ -1,10 +1,11 @@
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="8.00"
Version="9.00"
Name="sample_cpp"
ProjectGUID="{20071FBB-88EE-41D9-A728-68A883BFC68B}"
RootNamespace="sample_cpp"
TargetFrameworkVersion="131072"
>
<Platforms>
<Platform
@ -72,13 +73,15 @@
/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies=" Setupapi.lib stelephony.lib libsangoma.lib"
AdditionalDependencies="Setupapi.lib $(SANG_WP_DEVEL)\stelephony\objchk_wxp_x86\i386\stelephony.lib $(SANG_WP_DEVEL)\libsangoma\objchk_wxp_x86\i386\libsangoma.lib"
OutputFile=".\objchk_wxp_x86\i386/sample_cpp.exe"
LinkIncremental="2"
SuppressStartupBanner="true"
GenerateDebugInformation="true"
ProgramDatabaseFile=".\Debug/sample_cpp.pdb"
SubSystem="1"
RandomizedBaseAddress="1"
DataExecutionPrevention="0"
TargetMachine="1"
/>
<Tool
@ -101,9 +104,6 @@
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCWebDeploymentTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
@ -168,6 +168,8 @@
SuppressStartupBanner="true"
ProgramDatabaseFile=".\Release/sample.pdb"
SubSystem="1"
RandomizedBaseAddress="1"
DataExecutionPrevention="0"
TargetMachine="1"
/>
<Tool
@ -190,9 +192,6 @@
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCWebDeploymentTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>

View File

@ -45,7 +45,7 @@
# include <winioctl.h>
# include <conio.h>
# include "bit_win.h"
# include "wanpipe_time.h" //for usleep()
# include "wanpipe_time.h" //for wp_usleep()
#elif defined(__LINUX__)
@ -78,16 +78,16 @@
* API may provide input from a SINGLE or from MULTIPLE timeslots.
*/
#define USE_STELEPHONY_API 1 /* set to zero if don't need to compile
libstelephony.dll function calls */
function calls to libstelephony.dll */
#include "wanpipe_api.h"
#include "sangoma_cthread.h"
#include "sample.h"
#include <libsangoma.h>
#include "libsangoma.h"
#if USE_STELEPHONY_API
# include <libstelephony.h>
# include "libstelephony.h"
#endif
/*!
@ -101,7 +101,7 @@ protected:
sng_fd_t sangoma_dev;
/*! wait object device for an IO device */
void *sng_wait_obj;
sangoma_wait_obj_t *sng_wait_obj;
//////////////////////////////////////////////////////////////////
//receive stuff
@ -156,19 +156,16 @@ protected:
/*! Tx Thread function */
void TxThreadFunc();
/*! Rx data call back function handler */
/*! Rx Data handler function */
int read_data();
/*! Rx event call back function handler */
int read_event();
/*! Rx Event handler function */
virtual int read_event();
int write_data(wp_api_hdr_t *hdr, void *tx_buffer);
/*! Shutdown function to cleanup the class */
void cleanup();
/*! deprecated: Developmnet API structure used to read write low level memory */
wan_cmd_api_t wanpipe_api_cmd;
/*! Get device span configuration */
int get_wan_config();
@ -233,8 +230,9 @@ protected:
virtual unsigned long threadFunction(struct ThreadParam& thParam);
public:
char device_name[DEV_NAME_LEN];
char device_name[DEV_NAME_LEN];
char is_logger_dev;
//////////////////////////////////////////////////////////////////
//methods
sangoma_interface(int wanpipe_number, int interface_number);
@ -259,7 +257,7 @@ public:
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);
int flush_operational_stats (void);
virtual int flush_operational_stats (void);
int CreateSwDtmfTxThread(void *buffer);
int CreateFskCidTxThread(void *buffer);
@ -317,6 +315,11 @@ public:
int tdm_txsig_onhook();
int tdm_txsig_offhook();
int tdm_txsig_kewl();
/*To transmit data while FXS is on-hook */
/* Example: To transmit FSK Message Wait Indication (MWI)
to phone connected with FXS */
int tdm_txsig_onhooktransfer();
int tdm_enable_tone_events(uint16_t tone_id);
int tdm_disable_tone_events();
@ -325,6 +328,20 @@ public:
int tdm_front_end_deactivate();
int tdm_control_flash_events(int rxflashtime);
/* To set tx/rx gain for analog FXS/FXO modules
Gain in dB = gainvalue / 10
For FXS: txgain/rxgain value could be -35 or 35
FXO: txgain/rxgain value ranges from -150 to 120
FXO/FXS: Set txgain/rxgain value 0 for default setting*/
int tdm_control_rm_txgain(int txgain);
int tdm_control_rm_rxgain(int rxgain);
/* Only valid for FXS module to Set Polarity on the line
polarity 0: Forward Polarity
1: Reverse Polarity */
int tdm_set_rm_polarity(int polarity);
/* get current state of the line - is it Connected or Disconnected */
int tdm_get_front_end_status(unsigned char *status);
@ -356,6 +373,8 @@ public:
int fxo_go_off_hook();
int fxo_go_on_hook();
int fxs_txsig_offhook();
//BRI only:
int tdm_enable_bri_bchan_loopback(u_int8_t channel);
int tdm_disable_bri_bchan_loopback(u_int8_t channel);
@ -370,18 +389,19 @@ public:
virtual int init(callback_functions_t *callback_functions_ptr);
};
class sangoma_api_logger_dev : public sangoma_interface
{
wp_logger_cmd_t logger_cmd;
#if defined(__WINDOWS__)
#define HANDLE_DEVICE_IOCTL_RESULT(bResult)\
{ \
if(bResult == 0){ \
/* check message log */ \
printf("%s(): Line: %d: Error!!\n", __FUNCTION__, __LINE__); \
DecodeLastError(__FUNCTION__); \
return 1; \
} \
}
#endif /*__WINDOWS__*/
public:
sangoma_api_logger_dev(void);
~sangoma_api_logger_dev(void);
virtual int init(callback_functions_t *callback_functions_ptr);
/*! Logger Event handler function */
virtual int read_event();
virtual int flush_operational_stats (void);
int get_logger_dev_operational_stats(wp_logger_stats_t *stats);
};
#endif//SANGOMA_INTERFACE_H

View File

@ -51,7 +51,7 @@ int sangoma_port::init(uint16_t wanpipe_number)
wp_number = wanpipe_number;
wp_handle = sangoma_open_driver_ctrl(wanpipe_number);
if(wp_handle == INVALID_HANDLE_VALUE){
ERR_CFG("Error: failed to open %s!!\n", wanpipe_name_str);
ERR_CFG("Error: failed to open wanpipe%d!!\n", wp_number);
return 1;
}
return 0;
@ -63,7 +63,7 @@ int sangoma_port::get_hardware_info(hardware_info_t *hardware_info)
int err=sangoma_driver_get_hw_info(wp_handle,&port_management, wp_number);
if (err) {
ERR_CFG("%s: Error: failed to get hw info!\n",wanpipe_name_str);
ERR_CFG("Error: failed to get hw info for wanpipe%d!\n", wp_number);
err=1;
return err;
}

View File

@ -82,7 +82,6 @@ public:
protected:
uint16_t wp_number;
char wanpipe_name_str[WAN_DRVNAME_SZ*2];
HANDLE wp_handle;
int push_a_card_into_wanpipe_info_array(wanpipe_instance_info_t *wanpipe_info_array,

View File

@ -337,7 +337,7 @@ int sangoma_port_configurator::set_volatile_configration(port_cfg_t *port_cfg)
switch(port_cfg->operation_status)
{
case SANG_STATUS_DEVICE_BUSY:
INFO_CFG("Error: open handles exist for '%s_IF\?\?' interfaces!\n", wanpipe_name_str);
INFO_CFG("Error: open handles exist for 'wanpipe%d_if\?\?' interfaces!\n", wp_number);
return port_cfg->operation_status;
case SANG_STATUS_SUCCESS:
//OK
@ -360,7 +360,7 @@ int sangoma_port_configurator::initialize_t1_tdm_span_voice_api_configration_str
{
wandev_conf_t *wandev_conf = &port_cfg->wandev_conf;
sdla_fe_cfg_t *sdla_fe_cfg = &wandev_conf->fe_cfg;
sdla_te_cfg_t *te_cfg = &sdla_fe_cfg->cfg.te_cfg;
//sdla_te_cfg_t *te_cfg = &sdla_fe_cfg->cfg.te_cfg;
wan_tdmv_conf_t *tdmv_cfg = &wandev_conf->tdmv_conf;
wanif_conf_t *wanif_cfg = &port_cfg->if_cfg[0];
@ -369,15 +369,15 @@ int sangoma_port_configurator::initialize_t1_tdm_span_voice_api_configration_str
FE_LCODE(sdla_fe_cfg) = WAN_LCODE_B8ZS;
FE_FRAME(sdla_fe_cfg) = WAN_FR_ESF;
FE_LINENO(sdla_fe_cfg) = hardware_info->port_number;
FE_TDMV_LAW(sdla_fe_cfg) = WAN_TDMV_MULAW;
FE_NETWORK_SYNC(sdla_fe_cfg) = 0;
FE_TDMV_LAW(sdla_fe_cfg) = WAN_TDMV_MULAW;
FE_NETWORK_SYNC(sdla_fe_cfg) = 0;
FE_LBO(sdla_fe_cfg) = WAN_T1_0_110;
FE_REFCLK(sdla_fe_cfg) = 0;
FE_HIMPEDANCE_MODE(sdla_fe_cfg) = 0;
FE_SIG_MODE(sdla_fe_cfg) = WAN_TE1_SIG_CCS;
FE_RX_SLEVEL(sdla_fe_cfg) = WAN_TE1_RX_SLEVEL_12_DB;
FE_LBO(sdla_fe_cfg) = WAN_T1_0_110;
FE_REFCLK(sdla_fe_cfg) = 0;
FE_HIMPEDANCE_MODE(sdla_fe_cfg) = 0;
FE_SIG_MODE(sdla_fe_cfg) = WAN_TE1_SIG_CCS;
FE_RX_SLEVEL(sdla_fe_cfg) = WAN_TE1_RX_SLEVEL_12_DB;
#if 1
FE_CLK(sdla_fe_cfg) = WAN_NORMAL_CLK;
#else
@ -396,7 +396,7 @@ int sangoma_port_configurator::initialize_t1_tdm_span_voice_api_configration_str
wandev_conf->card_type = WANOPT_AFT; //m_DeviceInfoData.card_model;
wanif_cfg->magic = ROUTER_MAGIC;
wanif_cfg->active_ch = 0x01FFFFFE;// channels 1-24
wanif_cfg->active_ch = 0x00FFFFFF;//channels 1-24 (starting from bit zero)
sprintf(wanif_cfg->usedby,"TDM_SPAN_VOICE_API");
wanif_cfg->u.aft.idle_flag=0xFF;
wanif_cfg->mtu = 160;
@ -417,7 +417,7 @@ int sangoma_port_configurator::initialize_t1_tdm_span_voice_api_configration_str
switch(FE_MEDIA(sdla_fe_cfg))
{
case WAN_MEDIA_T1:
tdmv_cfg->dchan = (1<<23);/* channel 24 */
tdmv_cfg->dchan = (1<<23);/* Channel 24. This is a bitmap, not a channel number. */
break;
default:
printf("%s(): Error: invalid media type!\n", __FUNCTION__);
@ -442,14 +442,14 @@ int sangoma_port_configurator::initialize_e1_tdm_span_voice_api_configration_str
FE_LCODE(sdla_fe_cfg) = WAN_LCODE_HDB3;
FE_FRAME(sdla_fe_cfg) = WAN_FR_CRC4;
FE_LINENO(sdla_fe_cfg) = hardware_info->port_number;
FE_TDMV_LAW(sdla_fe_cfg) = WAN_TDMV_MULAW;
FE_NETWORK_SYNC(sdla_fe_cfg) = 0;
FE_TDMV_LAW(sdla_fe_cfg) = WAN_TDMV_MULAW;
FE_NETWORK_SYNC(sdla_fe_cfg) = 0;
FE_LBO(sdla_fe_cfg) = WAN_E1_120;
FE_REFCLK(sdla_fe_cfg) = 0;
FE_HIMPEDANCE_MODE(sdla_fe_cfg) = 0;
FE_SIG_MODE(sdla_fe_cfg) = WAN_TE1_SIG_CCS;
FE_RX_SLEVEL(sdla_fe_cfg) = WAN_TE1_RX_SLEVEL_12_DB;
FE_LBO(sdla_fe_cfg) = WAN_E1_120;
FE_REFCLK(sdla_fe_cfg) = 0;
FE_HIMPEDANCE_MODE(sdla_fe_cfg) = 0;
FE_SIG_MODE(sdla_fe_cfg) = WAN_TE1_SIG_CCS;
FE_RX_SLEVEL(sdla_fe_cfg) = WAN_TE1_RX_SLEVEL_12_DB;
#if 1
FE_CLK(sdla_fe_cfg) = WAN_NORMAL_CLK;
@ -469,7 +469,7 @@ int sangoma_port_configurator::initialize_e1_tdm_span_voice_api_configration_str
wandev_conf->card_type = WANOPT_AFT; //m_DeviceInfoData.card_model;
wanif_cfg->magic = ROUTER_MAGIC;
wanif_cfg->active_ch = 0xFFFFFFFE;// channels 1-31
wanif_cfg->active_ch = 0x7FFFFFFF;// channels 1-31 (starting from bit zero)
sprintf(wanif_cfg->usedby,"TDM_SPAN_VOICE_API");
wanif_cfg->u.aft.idle_flag=0xFF;
wanif_cfg->mtu = 160;
@ -490,7 +490,7 @@ int sangoma_port_configurator::initialize_e1_tdm_span_voice_api_configration_str
switch(FE_MEDIA(sdla_fe_cfg))
{
case WAN_MEDIA_E1:
tdmv_cfg->dchan = (1<<15);/* channel 16 */
tdmv_cfg->dchan = (1<<15);/* Channel 16. This is a bitmap, not a channel number. */
break;
default:
printf("%s(): Error: invalid media type!\n", __FUNCTION__);
@ -507,3 +507,34 @@ int sangoma_port_configurator::write_configration_on_persistent_storage(port_cfg
return sangoma_write_port_config_on_persistent_storage(hardware_info, port_cfg, (unsigned short)span);
}
int sangoma_port_configurator::control_analog_rm_lcm(port_cfg_t *port_cfg, int control_val)
{
wandev_conf_t *wandev_conf = &port_cfg->wandev_conf;
sdla_fe_cfg_t *sdla_fe_cfg = &wandev_conf->fe_cfg;
if(wandev_conf->card_type == WANOPT_AFT_ANALOG){ //Only valid for Analog cards
if(control_val == 1){
sdla_fe_cfg->cfg.remora.rm_lcm = 1;
}else if(control_val == 0){
sdla_fe_cfg->cfg.remora.rm_lcm = 0;
}else{
printf("%s(): Error: invalid parameter!\n", __FUNCTION__);
return -EINVAL;
}
} else{
return -EINVAL;
}
return 0;
}
int sangoma_port_configurator::set_analog_opermode(port_cfg_t *port_cfg, char *opermode)
{
wandev_conf_t *wandev_conf = &port_cfg->wandev_conf;
sdla_fe_cfg_t *sdla_fe_cfg = &wandev_conf->fe_cfg;
if(wandev_conf->card_type == WANOPT_AFT_ANALOG){ //Only valid for Analog cards
if(sizeof(sdla_fe_cfg->cfg.remora.opermode_name) < strlen(opermode))
return -EINVAL;
strcpy(sdla_fe_cfg->cfg.remora.opermode_name,opermode);
} else{
return -EINVAL;
}
return 0;
}

View File

@ -44,12 +44,18 @@ public:
sangoma_port_configurator();
virtual ~sangoma_port_configurator();
int open_port_registry_key(hardware_info_t *hardware_info);
int get_configration(port_cfg_t *port_cfg);
int set_default_configuration(port_cfg_t *port_cfg);
//Function to set Loop Current Measure (LCM) for analog FXO
//control_val 1: enable,0: disable
int control_analog_rm_lcm(port_cfg_t *port_cfg, int control_val);
//Function to set Operation mode for analog FXO
//opermode valid country name supported by Analog FXO
int set_analog_opermode(port_cfg_t *port_cfg, char *opermode);
//Function to check correctness of 'port_cfg_t' structure.
int check_port_cfg_structure(port_cfg_t *port_cfg);

View File

@ -17,6 +17,7 @@ INCLUDES=$(DDK_INC_PATH);\
$(SANG_WP_DEVEL)\wanpipe_common\include;\
$(SANG_WP_DEVEL)\wanpipe_common\include\aft_core;\
$(SANG_WP_DEVEL)\wanpipe_windows\include;\
$(SANG_WP_DEVEL)\wanpipe_common\wantools\wanec_apilib;\
$(SANG_WP_DEVEL)\libsangoma;\
$(SANG_WP_DEVEL)\stelephony;\
$(SANG_WP_DEVEL)\stelephony\stel_tone
@ -34,8 +35,9 @@ $(SDK_LIB_PATH)\oleaut32.lib \
$(SDK_LIB_PATH)\uuid.lib \
$(SDK_LIB_PATH)\comctl32.lib \
$(SDK_LIB_PATH)\Setupapi.lib \
$(SANG_WP_DEVEL)\libsangoma\$(OBJ_DIR)\libsangoma.lib \
$(SANG_WP_DEVEL)\stelephony\$(OBJ_DIR)\stelephony.lib
$(SANG_WP_DEVEL)\libsangoma\$(O)\libsangoma.lib \
$(SANG_WP_DEVEL)\stelephony\$(O)\stelephony.lib \
$(SANG_WP_DEVEL)\wanpipe_common\wantools\wanec_apilib\$(O)\waneclib.lib
SOURCES=sample.cpp \

View File

@ -1,8 +0,0 @@
#
# DO NOT EDIT THIS FILE!!! Edit .\sources. if you want to add a new source
# file to this component. This file merely indirects to the real make file
# that is shared by all the driver components of the Windows NT DDK
#
!INCLUDE $(NTMAKEENV)\makefile.def

View File

@ -37,9 +37,9 @@
#include "sangoma_interface.h"
#if defined(__LINUX__)
#include "sample_linux_compat.h"
# include "sample_linux_compat.h"
#else
#include <conio.h>
# include <conio.h>
#endif
#ifndef MAX_PATH
@ -55,13 +55,15 @@ wp_program_settings_t program_settings;
callback_functions_t callback_functions;
/*****************************************************************
* Prototypes & Defines
*****************************************************************/
static int got_rx_data(void *sang_if_ptr, void *rx_data);
static void got_TdmApiEvent(void *sang_if_ptr, void *event_data);
static void got_tdm_api_event(void *sang_if_ptr, void *event_data);
#if USE_WP_LOGGER
static void got_logger_event(void *sang_if_ptr, wp_logger_event_t *logger_event);
#endif
typedef struct{
void *sang_if_ptr;
@ -116,16 +118,21 @@ static int set_port_configuration();
sangoma_interface* init(int wanpipe_number, int interface_number)
{
sangoma_interface *sang_if = NULL;
DBG_MAIN("init()\n");
DBG_MAIN("%s()\n", __FUNCTION__);
if(program_settings.use_ctrl_dev == 1){
sang_if = new sangoma_api_ctrl_dev();
}else if(program_settings.use_logger_dev == 1){
sang_if = new sangoma_api_logger_dev();
}else{
sang_if = new sangoma_interface(wanpipe_number, interface_number);
}
if(sang_if->init(&callback_functions)){
delete sang_if;
return NULL;
}
DBG_MAIN("init(): OK\n");
return sang_if;
}
@ -187,11 +194,15 @@ void PrintRxData(wp_api_hdr_t *hdr, void *pdata)
rx_counter++;
if(program_settings.silent){
if((rx_counter % 1000) == 0){
INFO_MAIN("Rx counter:%d, Rx datlen : %d\n", rx_counter, datlen);
INFO_MAIN("Rx counter: %d, Rx datlen: %d\n", rx_counter, datlen);
#if 0
INFO_MAIN("Timestamp: Seconds: %d, Microseconds: %d\n",
hdr->wp_api_hdr_time_stamp_sec, hdr->wp_api_hdr_time_stamp_use);
#endif
}
return;
}else{
INFO_MAIN("Rx counter:%d, Rx datlen : %d. Data :\n", rx_counter, datlen);
INFO_MAIN("Rx counter: %d, Rx datlen: %d. Data:\n", rx_counter, datlen);
}
#if 1
@ -250,7 +261,7 @@ static int got_rx_data(void *sang_if_ptr, void *rxhdr, void *rx_data)
}
/*!
\fn static void got_TdmApiEvent(void *sang_if_ptr, void *event_data)
\fn static void got_tdm_api_event(void *sang_if_ptr, void *event_data)
\brief Callback function indicating Event is pending.
\param sang_if_ptr sangoma interface pointer
\param event_data API event element strcutre containt header + data
@ -259,7 +270,7 @@ static int got_rx_data(void *sang_if_ptr, void *rxhdr, void *rx_data)
Currently Windows launches a thread to handle the event, where
Linux handles the event directly. Implementation is left to the user.
*/
static void got_TdmApiEvent(void *sang_if_ptr, void *event_data)
static void got_tdm_api_event(void *sang_if_ptr, void *event_data)
{
TDM_API_EVENT_THREAD_PARAM *param =
(TDM_API_EVENT_THREAD_PARAM*)malloc(sizeof(TDM_API_EVENT_THREAD_PARAM));
@ -369,12 +380,12 @@ void *TdmApiEventThreadFunc(void *lpdwParam)
DBG_MAIN("New Alarm State: 0x%X\n", wp_tdm_api_event->wp_api_event_alarm);
break;
case WP_API_EVENT_POLARITY_REVERSE:
/* This event may have different meaning on different Telco lines.
* For example, it indicates "Network Initiated Clearing",
* on a British Telecom line. But on some lines it means
* "Start of Caller ID transmission". Please consult with your Telco
* for exact meaning of event. */
case WP_API_EVENT_POLARITY_REVERSE:
/* This event may have different meaning on different Telco lines.
* For example, it indicates "Network Initiated Clearing",
* on a British Telecom line. But on some lines it means
* "Start of Caller ID transmission". Please consult with your Telco
* for exact meaning of event. */
DBG_MAIN("Polarity Reversal Event: %s\n",
WP_API_EVENT_POLARITY_REVERSE_DECODE(wp_tdm_api_event->wp_api_event_polarity_reverse));
break;
@ -390,6 +401,27 @@ void *TdmApiEventThreadFunc(void *lpdwParam)
return 0;
}
#if USE_WP_LOGGER
/*!
\fn static void got_logger_event(void *sang_if_ptr, wp_logger_event_t *logger_event)
\brief Callback function indicating Logger Event is pending.
\param sang_if_ptr sangoma interface pointer
\param logger_event API Logger Event structure
\return 0 - ok non-zero - Error
*/
static void got_logger_event(void *sang_if_ptr, wp_logger_event_t *logger_event)
{
char *timestamp_str = sangoma_ctime( &logger_event->time_stamp_sec );
INFO_MAIN("Logger Event Type:\t%s (Logger:%d BitMap: 0x%08X)\n",
wp_decode_logger_event_type(logger_event->logger_type, logger_event->event_type),
logger_event->logger_type, logger_event->event_type);
/* Display Logger Event Timestamp as UNIX-style Date string. */
INFO_MAIN("Time and Date:\t\t%s\n",
(timestamp_str == NULL ? "Invalid Timestamp" : timestamp_str));
INFO_MAIN("Logger Event Data: %s\n\n", logger_event->data);
}
#endif
/*!
\fn int tx_file(sangoma_interface *sang_if)
@ -492,34 +524,48 @@ static int get_user_hex_number()
\param argc number of arguments
\param argv argument list
\return 0 - ok non-zero - Error
*/
static int parse_command_line_args(int argc, char* argv[])
{
int i;
const char *USAGE_STR =
"\n"
"Usage: sample [-c] [-i] [-silent]\n"
"Usage: sample [-c] [-i] [options]\n"
"\n"
"Options:\n"
"\t-c number Wanpipe number: 1,2,3...\n"
"\t-i number Interface number 0,1,2,3,....\n"
"\t-driver_config configure start/stop driver using volatile....\n"
"\t-c number Wanpipe (Port/Span) number: 1,2,3...\n"
"\t-i number Interface number 1,2,3,....\n"
"options:\n"
"\t-silent Disable display of Rx data\n"
"\t-rx2tx All received data automatically transmitted on the SAME interface\n"
"\t-txlength\tnumber\tLength of data frames to be transmitted when 't' key is pressed\n"
"\t-txcount\tnumber Number of test data frames to be transmitted when 't' key is pressed\n"
"\t-driver_config \tStop/Set Configuration/Start a Port....\n"
"\t-rx2tx All received data automatically transmitted on\n"
"\t the SAME interface\n"
"\t-txlength\tnumber\tLength of data frames to be transmitted when 't'\n"
"\t \t \tkey is pressed\n"
"\t-txcount\tnumber Number of test data frames to be transmitted when 't'\n"
"\t \t \tkey is pressed\n"
"\t-tx_file_name\tstring\tFile to be transmitted when 't' key is pressed\n"
#if USE_STELEPHONY_API
"\t-decode_fsk_cid\t\tDecode FSK Caller ID on an Analog line. For Voice data only.\n"
"\t-encode_fsk_cid\t\tEncode FSK Caller ID on an Analog line. For Voice data only.\n"
"\t-decode_fsk_cid\t\tDecode FSK Caller ID on an Analog line.\n"
"\t \t\tFor Voice data only.\n"
"\t-encode_fsk_cid\t\tEncode FSK Caller ID on an Analog line.\n"
"\t \t\tFor Voice data only.\n"
"\t-encode_sw_dtmf\t\tEncode SW DTMF on an line. For Voice data only.\n"
"\t-sw_dtmf Enable Sangoma Software DTMF decoder. For Voice data only.\n"
"\t-decode_q931 Enable Sangoma Q931 decoder. For HDLC (Dchannel) data only.\n"
"\t-alaw\t\t Use Alaw codec instead of default MuLaw codec for Voice data.\n"
"\t-rm_txgain\t Set txgain for FXS/FXO modules.\n"
"\t \t\tFXO range from -150 to 120, FXS 35 or -35\n"
"\t-rm_rxgain\t Set txgain for FXS/FXO modules.\n"
"\t \t\tFXO range from -150 to 120, FXS 35 or -35\n"
#endif
#if 0
"\t-use_ctrl_dev Use the global 'wptdm_ctrl' device to Get events and to Control device.\n"
"\t-use_ctrl_dev \tUse the global 'wptdm_ctrl' device to Get events from\n"
"\t \tall API devices.\n"
#endif
"\t-use_logger_dev \tUse the global Logger device to Get Log Messages\n"
"\t \tfrom API driver.\n"
#ifdef WP_API_FEATURE_LIBSNG_HWEC
"\t-use_hwec \tInitialize/Configure/Use the Hardware Echo Canceller\n"
#endif
"\n"
"Example: sample -c 1 -i 1\n";
@ -527,8 +573,10 @@ static int parse_command_line_args(int argc, char* argv[])
memset(&program_settings, 0, sizeof(wp_program_settings_t));
program_settings.wanpipe_number = 1;
program_settings.interface_number = 1;
program_settings.txlength = 128;
program_settings.txlength = 80;
program_settings.txcount = 1;
program_settings.rxgain = 0xFFFF; //FXO/FXS rx gain unchanged
program_settings.txgain = 0xFFFF; //FXO/FXS tx gain unchanged
for(i = 1; i < argc;){
@ -618,6 +666,29 @@ static int parse_command_line_args(int argc, char* argv[])
}else if(_stricmp(argv[i], "-use_ctrl_dev") == 0){
INFO_MAIN("Using ctrl_dev...\n");
program_settings.use_ctrl_dev = 1;
}else if(_stricmp(argv[i], "-use_logger_dev") == 0){
INFO_MAIN("Using logger_dev...\n");
program_settings.use_logger_dev = 1;
}else if(_stricmp(argv[i], "-rm_txgain") == 0){
if (i+1 > argc-1){
INFO_MAIN("No txgain provided!\n");
return 1;
}
program_settings.txgain = atoi(argv[i+1]);
i++;
INFO_MAIN("Setting txgain to %d.\n", program_settings.txgain);
}else if(_stricmp(argv[i], "-rm_rxgain") == 0){
if (i+1 > argc-1){
INFO_MAIN("No rxgain provided!\n");
return 1;
}
program_settings.rxgain = atoi(argv[i+1]);
i++;
INFO_MAIN("Setting rxgain to %d.\n", program_settings.txgain);
}else if(_stricmp(argv[i], "-use_hwec") == 0){
INFO_MAIN("Using hardware echo canceller...\n");
program_settings.use_hardware_echo_canceller = 1;
}else{
INFO_MAIN("Error: Invalid Argument %s\n",argv[i]);
return 1;
@ -654,8 +725,10 @@ int __cdecl main(int argc, char* argv[])
////////////////////////////////////////////////////////////////////////////
memset(&callback_functions, 0x00, sizeof(callback_functions));
callback_functions.got_rx_data = got_rx_data;
callback_functions.got_TdmApiEvent = got_TdmApiEvent;
callback_functions.got_tdm_api_event = got_tdm_api_event;
#if USE_WP_LOGGER
callback_functions.got_logger_event = got_logger_event;
#endif
////////////////////////////////////////////////////////////////////////////
if(parse_command_line_args(argc, argv)){
return 1;
@ -693,65 +766,92 @@ int __cdecl main(int argc, char* argv[])
cleanup(sang_if);
return rc;
}
if(program_settings.txgain != 0xFFFF) {
INFO_MAIN("Applying txgain...\n");
if (sang_if->tdm_control_rm_txgain(program_settings.txgain)){
INFO_MAIN("Failed to apply txgain!\n");
}
}
/* FXS cannot detect if phone is connected or not when the card is started
therefore tranmit following two events for Set Polarity to work */
if(sang_if->get_adapter_type() == WAN_MEDIA_FXOFXS && sang_if->get_sub_media() == MOD_TYPE_FXS) {
INFO_MAIN("Setting Proper hookstates on FXS\n");
sang_if->tdm_txsig_offhook();
sang_if->tdm_txsig_onhook();
}
if(program_settings.rxgain != 0xFFFF) {
INFO_MAIN("Applying rxgain...\n");
if (sang_if->tdm_control_rm_rxgain(program_settings.rxgain)){
INFO_MAIN("Failed to apply rxgain!\n");
}
}
do{
EnterCriticalSection(&PrintCriticalSection);
INFO_MAIN("Press 'q' to quit the program.\n");
INFO_MAIN("Press 't' to transmit data.\n");
INFO_MAIN("Press 's' to get Operational Statistics.\n");
INFO_MAIN("Press 'f' to reset (flush) Operational Statistics.\n");
INFO_MAIN("Press 'v' to get API driver version.\n");
if(sang_if->get_adapter_type() == WAN_MEDIA_T1 || sang_if->get_adapter_type() == WAN_MEDIA_E1){
INFO_MAIN("Press 'a' to get T1/E1 alarms.\n");
//RBS (CAS) commands
INFO_MAIN("Press 'g' to get RBS bits.\n");
INFO_MAIN("Press 'r' to set RBS bits.\n");
INFO_MAIN("Press '1' to read FE register. Warning: used by Sangoma Techsupport only!\n");
INFO_MAIN("Press '2' to write FE register. Warning: used by Sangoma Techsupport only!\n");
}
INFO_MAIN("Press 'i' to set Tx idle data buffer (BitStream only).\n");
switch(sang_if->get_adapter_type())
{
case WAN_MEDIA_T1:
//those commands valid only for T1
INFO_MAIN("Press 'l' to send 'activate remote loop back' signal.\n");
INFO_MAIN("Press 'd' to send 'deactivate remote loop back' signal.\n");
break;
case WAN_MEDIA_FXOFXS:
switch(sang_if->get_sub_media())
if(program_settings.use_logger_dev != 1){
/* these options valid for non-logger api devices */
INFO_MAIN("Press 't' to transmit data.\n");
INFO_MAIN("Press 'v' to get API driver version.\n");
if(sang_if->get_adapter_type() == WAN_MEDIA_T1 || sang_if->get_adapter_type() == WAN_MEDIA_E1){
INFO_MAIN("Press 'a' to get T1/E1 alarms.\n");
//RBS (CAS) commands
INFO_MAIN("Press 'g' to get RBS bits.\n");
INFO_MAIN("Press 'r' to set RBS bits.\n");
INFO_MAIN("Press '1' to read FE register. Warning: used by Sangoma Techsupport only!\n");
INFO_MAIN("Press '2' to write FE register. Warning: used by Sangoma Techsupport only!\n");
}
INFO_MAIN("Press 'i' to set Tx idle data buffer (BitStream only).\n");
switch(sang_if->get_adapter_type())
{
case MOD_TYPE_FXS:
INFO_MAIN("Press 'e' to listen to test tones on a phone connected to the A200-FXS\n");
INFO_MAIN("Press 'c' to ring/stop ring phone connected to the A200-FXS\n");
INFO_MAIN("Press 'n' to enable/disable reception of ON/OFF Hook events on A200-FXS\n");
INFO_MAIN("Press 'm' to enable DTMF events (on SLIC chip) on A200-FXS\n");
INFO_MAIN("Press 'j' to enable/disable reception of Ring Trip events on A200-FXS\n");
case WAN_MEDIA_T1:
//those commands valid only for T1
INFO_MAIN("Press 'l' to send 'activate remote loop back' signal.\n");
INFO_MAIN("Press 'd' to send 'deactivate remote loop back' signal.\n");
break;
case WAN_MEDIA_FXOFXS:
switch(sang_if->get_sub_media())
{
case MOD_TYPE_FXS:
INFO_MAIN("Press 'e' to listen to test tones on a phone connected to the A200-FXS\n");
INFO_MAIN("Press 'c' to ring/stop ring phone connected to the A200-FXS\n");
INFO_MAIN("Press 'n' to enable/disable reception of ON/OFF Hook events on A200-FXS\n");
INFO_MAIN("Press 'm' to enable DTMF events (on SLIC chip) on A200-FXS\n");
INFO_MAIN("Press 'j 'to enable/disable reception of Ring Trip events on A200-FXS\n");
INFO_MAIN("Press 'k' to transmit kewl - drop line voltage on the line connected to the A200-FXS\n");
INFO_MAIN("Press 'h' to set polarity on the line connected to the A200-fXS\n");
INFO_MAIN("Press 'u' to transmit onhooktransfer on the line connected to the A200-FXS\n");
break;
case MOD_TYPE_FXO:
INFO_MAIN("Press 'u' to enable/disable reception of Ring Detect events on A200-FXO\n");
INFO_MAIN("Press 'h' to transmit ON/OFF hook signals on A200-FXO\n");
INFO_MAIN("Press 'a' to get Line Status (Connected/Disconnected)\n");
case MOD_TYPE_FXO:
INFO_MAIN("Press 'u' to enable/disable reception of Ring Detect events on A200-FXO\n");
INFO_MAIN("Press 'h' to transmit ON/OFF hook signals on A200-FXO\n");
INFO_MAIN("Press 'a' to get Line Status (Connected/Disconnected)\n");
break;
}
break;
case WAN_MEDIA_BRI:
INFO_MAIN("Press 'k' to Activate/Deactivate ISDN BRI line\n");
INFO_MAIN("Press 'l' to enable bri bchan loopback\n");
INFO_MAIN("Press 'd' to disable bri bchan loopback\n");
break;
}
break;
case WAN_MEDIA_BRI:
INFO_MAIN("Press 'k' to Activate/Deactivate ISDN BRI line\n");
INFO_MAIN("Press 'l' to enable bri bchan loopback\n");
INFO_MAIN("Press 'd' to disable bri bchan loopback\n");
break;
}
INFO_MAIN("Press 'o' to enable DTMF events (on Octasic chip)\n");
if (program_settings.encode_sw_dtmf) {
INFO_MAIN("Press 'x' to send software DTMF\n");
}
if (program_settings.encode_fsk_cid) {
INFO_MAIN("Press 'z' to send software FSK Caller ID\n");
}
INFO_MAIN("Press 'o' to enable DTMF events (on Octasic chip)\n");
if (program_settings.encode_sw_dtmf) {
INFO_MAIN("Press 'x' to send software DTMF\n");
}
if (program_settings.encode_fsk_cid) {
INFO_MAIN("Press 'z' to send software FSK Caller ID\n");
}
}//if(program_settings.use_logger_dev != 1)
LeaveCriticalSection(&PrintCriticalSection);
user_selection = tolower(_getch());
switch(user_selection)
{
@ -772,7 +872,12 @@ int __cdecl main(int argc, char* argv[])
}
break;
case 's':
{
if(program_settings.use_logger_dev == 1){
wp_logger_stats_t stats;
/* Warning: for demonstration purposes only, it is assumed,
* that 'sang_if' is 'sangoma_api_logger_dev'. */
((sangoma_api_logger_dev*)sang_if)->get_logger_dev_operational_stats(&stats);
}else{
wanpipe_chan_stats_t stats;
sang_if->get_operational_stats(&stats);
}
@ -1035,16 +1140,20 @@ user_retry_ring_e_d:
break;
case 'u':
//Enable/Disable Ring Detect events on FXO.
INFO_MAIN("Press 'e' to ENABLE Rx Ring Detect Events, 'd' to DISABLE Rx Ring Detect Events.\n");
INFO_MAIN("\n");
switch(tolower(_getch()))
{
case 'e':
sang_if->tdm_enable_ring_detect_events();
break;
case 'd':
default:
sang_if->tdm_disable_ring_detect_events();
if(sang_if->get_sub_media()==MOD_TYPE_FXO){
INFO_MAIN("Press 'e' to ENABLE Rx Ring Detect Events, 'd' to DISABLE Rx Ring Detect Events.\n");
INFO_MAIN("\n");
switch(tolower(_getch()))
{
case 'e':
sang_if->tdm_enable_ring_detect_events();
break;
case 'd':
default:
sang_if->tdm_disable_ring_detect_events();
}
}else if(sang_if->get_sub_media()==MOD_TYPE_FXS){
sang_if->tdm_txsig_onhooktransfer();
}
break;
case 'j':
@ -1062,29 +1171,56 @@ user_retry_ring_e_d:
}
break;
case 'h':
INFO_MAIN("Press 'e' to transmit OFF hook signal, 'd' to transmit ON hook signal.\n");
INFO_MAIN("\n");
switch(tolower(_getch()))
{
case 'e':
sang_if->fxo_go_off_hook();
break;
case 'd':
default:
sang_if->fxo_go_on_hook();
if(sang_if->get_sub_media()==MOD_TYPE_FXO) {
INFO_MAIN("Press 'e' to transmit OFF hook signal, 'd' to transmit ON hook signal.\n");
INFO_MAIN("\n");
switch(tolower(_getch()))
{
case 'e':
sang_if->fxo_go_off_hook();
break;
case 'd':
default:
sang_if->fxo_go_on_hook();
}
}else if(sang_if->get_sub_media()==MOD_TYPE_FXS ) {
INFO_MAIN("Press 'f' for forward, 'r' to for reverse.\n");
INFO_MAIN("\n");
switch(tolower(_getch()))
{
case 'f':
sang_if->tdm_set_rm_polarity(0);
break;
case 'r':
sang_if->tdm_set_rm_polarity(1);
break;
default:
//toggle it
sang_if->tdm_set_rm_polarity(1);
sang_if->tdm_set_rm_polarity(0);
}
}
break;
case 'k':
INFO_MAIN("Press 'e' to Activate, 'd' to De-Activate line.\n");
INFO_MAIN("\n");
switch(tolower(_getch()))
{
case 'e':
sang_if->tdm_front_end_activate();
break;
case 'd':
default:
sang_if->tdm_front_end_deactivate();
if( sang_if->get_adapter_type() == WAN_MEDIA_BRI ) {
INFO_MAIN("Press 'e' to Activate, 'd' to De-Activate line.\n");
INFO_MAIN("\n");
switch(tolower(_getch()))
{
case 'e':
sang_if->tdm_front_end_activate();
break;
case 'd':
default:
sang_if->tdm_front_end_deactivate();
}
}else if(sang_if->get_adapter_type()== WAN_MEDIA_FXOFXS) {
if(sang_if->get_sub_media()==MOD_TYPE_FXS) {
sang_if->tdm_txsig_kewl();
sangoma_msleep(5000);
//to restore line current after txsig kewl
sang_if->tdm_txsig_offhook();
}
}
break;
case 'p':
@ -1127,8 +1263,18 @@ user_retry_ring_e_d:
break;
case 'z':
{
INFO_MAIN("Sending CallerID.\n");
sang_if->sendCallerID("Sangoma Rocks", "9054741990");
if(WAN_MEDIA_FXOFXS == sang_if->get_adapter_type() && MOD_TYPE_FXS == sang_if->get_sub_media() ){
//Ring the line
sang_if->start_ringing_phone();
sangoma_msleep(2000);
//txsig offhook
sang_if->fxs_txsig_offhook();
INFO_MAIN("Sending CallerID.\n");
sang_if->sendCallerID("Sangoma Rocks", "9054741990");
}else{
INFO_MAIN("Sending CallerID.\n");
sang_if->sendCallerID("Sangoma Rocks", "9054741990");
}
}
break;
#endif
@ -1184,7 +1330,8 @@ user_retry_ring_e_d:
static int set_port_configuration()
{
int rc = 0, is_te1_card = 0, user_selection;
int rc = 0, user_selection;
int is_te1_card = 0, is_analog_card = 0;
hardware_info_t hardware_info;
port_cfg_t port_cfg;
@ -1214,15 +1361,6 @@ static int set_port_configuration()
return 3;
}
#if 0
defined(__WINDOWS__)
rc = sng_port_cfg_obj->open_port_registry_key(&hardware_info);
if(rc != SANG_STATUS_SUCCESS){
delete sng_port_cfg_obj;
return 3;
}
#endif
memset(&port_cfg, 0x00, sizeof(port_cfg_t));
switch(hardware_info.card_model)
@ -1233,17 +1371,21 @@ defined(__WINDOWS__)
case A108_ADPTR_8TE1:
is_te1_card = 1;
break;
case A200_ADPTR_ANALOG:
case A400_ADPTR_ANALOG:
is_analog_card = 1;
break;
case AFT_ADPTR_FLEXBRI:
//B700, a hybrid card - may have both ISDN BRI and Analog ports
break;
}
if(is_te1_card){
INFO_MAIN("\n");
INFO_MAIN("Press 't' to set T1 configration.\n");
INFO_MAIN("Press 'e' to set E1 configration.\n");
try_again:
user_selection = tolower(_getch());
switch(user_selection)
{
case 't'://T1
@ -1254,27 +1396,38 @@ try_again:
rc=sng_port_cfg_obj->initialize_e1_tdm_span_voice_api_configration_structure(&port_cfg,&hardware_info,program_settings.wanpipe_number);
break;
case 'q'://quit the application
rc = 1;
break;
default:
INFO_MAIN("Invalid command %c.\n",user_selection);
goto try_again;
break;
}//switch(user_selection)
}//if(is_te1_card)
} else { //if(is_te1_card)
#if 0
if(is_analog_card){
//read current configuration:
if(sng_port_cfg_obj->get_configration(&port_cfg)){
rc = 1;
}else{
//print the current configuration:
sng_port_cfg_obj->print_port_cfg_structure(&port_cfg);
//as an EXAMPLE, set the same configration as the current one:
//rc = sng_port_cfg_obj->set_default_configuration(&port_cfg);
}
#else
INFO_MAIN("Unsupported Card %i\n",hardware_info.card_model);
rc = 1;
#if 0
//as an EXAMPLE, enable Loop Current Monitoring for Analog FXO:
rc=sng_port_cfg_obj->control_analog_rm_lcm(&port_cfg, 1);
#endif
#if 0
//as an EXAMPLE, set Operation mode for FXO:
rc=sng_port_cfg_obj->set_analog_opermode(&port_cfg, "TBR21");
#endif
}
}//if(is_analog_card)
if(!is_te1_card && !is_analog_card){
INFO_MAIN("Unsupported Card %d\n", hardware_info.card_model);
rc = 1;
}
do{
@ -1282,7 +1435,6 @@ try_again:
ERR_MAIN("Failed to Initialize Port Configuratoin structure!\n");
break;
}
#if 1
INFO_MAIN("Stopping PORT for re-configuration!\n");
if ((rc = sng_port_cfg_obj->stop_port())) {
@ -1316,7 +1468,7 @@ try_again:
delete sng_port_cfg_obj;
}
sangoma_msleep(2000);//wait a little (2 seconds) for initialization to complete
sangoma_msleep(2000);//wait 2 seconds for initialization to complete
return rc;
}
@ -1334,7 +1486,7 @@ static void FSKCallerIDEvent(void *callback_context,
if(Name){
INFO_MAIN("Name: %s\n", Name);
#if 1
#if 0
printf("caller name in SINGLE byte hex:\n");
for(unsigned int ind = 0; ind < strlen(Name); ind++){
printf("Name[%02d]: 0x%02X\n", ind, Name[ind]);
@ -1345,9 +1497,11 @@ static void FSKCallerIDEvent(void *callback_context,
for(unsigned int ind = 0; ind < strlen(Name); ind += 2){
printf("Name[%02d]: 0x%04X\n", ind, *(unsigned short*)&Name[ind]);
}
printf("\n");
#endif
printf("\n");
}
if(CallerNumber){
INFO_MAIN("CallerNumber: %s\n", CallerNumber);
}
@ -1445,7 +1599,7 @@ static void FSKCallerIDTransmit (void *callback_context, void *FskCidBuffer)
/* FSK CID buffer can be big (~8000 bytes), we don't want to block the calling thread,
so start a new thread to transmit FSK CID. */
sang_if->CreateSwDtmfTxThread(FskCidBuffer);
sang_if->CreateFskCidTxThread(FskCidBuffer);
}
#if 0

View File

@ -9,6 +9,7 @@
#include <libstelephony.h>
#endif
#define USE_WP_LOGGER 1
#define SAMPLE_CPP_MAX_PATH 1024
typedef struct{
@ -27,6 +28,10 @@ typedef struct{
unsigned int txcount;
unsigned char driver_config;
unsigned char use_ctrl_dev;
unsigned char use_logger_dev;
int txgain;
int rxgain;
unsigned char use_hardware_echo_canceller;
}wp_program_settings_t;
#define DEV_NAME_LEN 100
@ -38,7 +43,7 @@ typedef struct{
//Recieved data
int (*got_rx_data)(void *sang_if_ptr, void *rxhdr, void *rx_data);
//TDM events
void (*got_TdmApiEvent)(void *sang_if_ptr, void *event_data);
void (*got_tdm_api_event)(void *sang_if_ptr, void *event_data);
#if USE_STELEPHONY_API
//FSK Caller ID detected
void (*FSKCallerIDEvent)(void *sang_if_ptr, char * Name, char * CallerNumber, char * CalledNumber, char * DateTime);
@ -51,6 +56,11 @@ typedef struct{
//DTMF buffer ready for transmission events
void (*SwDtmfTransmit)(void *callback_context, void* buffer);
#endif
#if USE_WP_LOGGER
void (*got_logger_event)(void *sang_if_ptr, wp_logger_event_t *logger_event);
#endif
}callback_functions_t;
static void DecodeLastError(LPSTR lpszFunction)
@ -70,7 +80,7 @@ static void DecodeLastError(LPSTR lpszFunction)
NULL
);
// Display the string.
printf("Last Error: %s (GetLastError() returned: %d)\n", lpMsgBuf, dwLastErr);
printf("Last Error: %s (GetLastError() returned: %d)\n", (char*)lpMsgBuf, dwLastErr);
// Free the buffer.
LocalFree( lpMsgBuf );
#endif

View File

@ -1,7 +1,7 @@

Microsoft Visual Studio Solution File, Format Version 9.00
# Visual Studio 2005
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "sample", "sample.vcproj", "{20071FBB-88EE-41D9-A728-68A883BFC68B}"
Microsoft Visual Studio Solution File, Format Version 10.00
# Visual Studio 2008
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "sample_cpp", "sample.vcproj", "{20071FBB-88EE-41D9-A728-68A883BFC68B}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution

View File

@ -1,10 +1,11 @@
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="8.00"
Version="9.00"
Name="sample_cpp"
ProjectGUID="{20071FBB-88EE-41D9-A728-68A883BFC68B}"
RootNamespace="sample_cpp"
TargetFrameworkVersion="131072"
>
<Platforms>
<Platform
@ -72,13 +73,15 @@
/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies=" Setupapi.lib stelephony.lib libsangoma.lib"
AdditionalDependencies="Setupapi.lib $(SANG_WP_DEVEL)\stelephony\objchk_wxp_x86\i386\stelephony.lib $(SANG_WP_DEVEL)\libsangoma\objchk_wxp_x86\i386\libsangoma.lib"
OutputFile=".\objchk_wxp_x86\i386/sample_cpp.exe"
LinkIncremental="2"
SuppressStartupBanner="true"
GenerateDebugInformation="true"
ProgramDatabaseFile=".\Debug/sample_cpp.pdb"
SubSystem="1"
RandomizedBaseAddress="1"
DataExecutionPrevention="0"
TargetMachine="1"
/>
<Tool
@ -101,9 +104,6 @@
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCWebDeploymentTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
@ -168,6 +168,8 @@
SuppressStartupBanner="true"
ProgramDatabaseFile=".\Release/sample.pdb"
SubSystem="1"
RandomizedBaseAddress="1"
DataExecutionPrevention="0"
TargetMachine="1"
/>
<Tool
@ -190,9 +192,6 @@
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCWebDeploymentTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>

File diff suppressed because it is too large Load Diff

View File

@ -45,7 +45,7 @@
# include <winioctl.h>
# include <conio.h>
# include "bit_win.h"
# include "wanpipe_time.h" //for usleep()
# include "wanpipe_time.h" //for wp_usleep()
#elif defined(__LINUX__)
@ -78,16 +78,16 @@
* API may provide input from a SINGLE or from MULTIPLE timeslots.
*/
#define USE_STELEPHONY_API 1 /* set to zero if don't need to compile
libstelephony.dll function calls */
function calls to libstelephony.dll */
#include "wanpipe_api.h"
#include "sangoma_cthread.h"
#include "sample.h"
#include <libsangoma.h>
#include "libsangoma.h"
#if USE_STELEPHONY_API
# include <libstelephony.h>
# include "libstelephony.h"
#endif
/*!
@ -101,7 +101,7 @@ protected:
sng_fd_t sangoma_dev;
/*! wait object device for an IO device */
void *sng_wait_obj;
sangoma_wait_obj_t *sng_wait_obj;
//////////////////////////////////////////////////////////////////
//receive stuff
@ -156,19 +156,16 @@ protected:
/*! Tx Thread function */
void TxThreadFunc();
/*! Rx data call back function handler */
/*! Rx Data handler function */
int read_data();
/*! Rx event call back function handler */
int read_event();
/*! Rx Event handler function */
virtual int read_event();
int write_data(wp_api_hdr_t *hdr, void *tx_buffer);
/*! Shutdown function to cleanup the class */
void cleanup();
/*! deprecated: Developmnet API structure used to read write low level memory */
wan_cmd_api_t wanpipe_api_cmd;
/*! Get device span configuration */
int get_wan_config();
@ -233,8 +230,9 @@ protected:
virtual unsigned long threadFunction(struct ThreadParam& thParam);
public:
char device_name[DEV_NAME_LEN];
char device_name[DEV_NAME_LEN];
char is_logger_dev;
//////////////////////////////////////////////////////////////////
//methods
sangoma_interface(int wanpipe_number, int interface_number);
@ -259,7 +257,7 @@ public:
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);
int flush_operational_stats (void);
virtual int flush_operational_stats (void);
int CreateSwDtmfTxThread(void *buffer);
int CreateFskCidTxThread(void *buffer);
@ -317,6 +315,11 @@ public:
int tdm_txsig_onhook();
int tdm_txsig_offhook();
int tdm_txsig_kewl();
/*To transmit data while FXS is on-hook */
/* Example: To transmit FSK Message Wait Indication (MWI)
to phone connected with FXS */
int tdm_txsig_onhooktransfer();
int tdm_enable_tone_events(uint16_t tone_id);
int tdm_disable_tone_events();
@ -325,6 +328,20 @@ public:
int tdm_front_end_deactivate();
int tdm_control_flash_events(int rxflashtime);
/* To set tx/rx gain for analog FXS/FXO modules
Gain in dB = gainvalue / 10
For FXS: txgain/rxgain value could be -35 or 35
FXO: txgain/rxgain value ranges from -150 to 120
FXO/FXS: Set txgain/rxgain value 0 for default setting*/
int tdm_control_rm_txgain(int txgain);
int tdm_control_rm_rxgain(int rxgain);
/* Only valid for FXS module to Set Polarity on the line
polarity 0: Forward Polarity
1: Reverse Polarity */
int tdm_set_rm_polarity(int polarity);
/* get current state of the line - is it Connected or Disconnected */
int tdm_get_front_end_status(unsigned char *status);
@ -356,6 +373,8 @@ public:
int fxo_go_off_hook();
int fxo_go_on_hook();
int fxs_txsig_offhook();
//BRI only:
int tdm_enable_bri_bchan_loopback(u_int8_t channel);
int tdm_disable_bri_bchan_loopback(u_int8_t channel);
@ -370,18 +389,19 @@ public:
virtual int init(callback_functions_t *callback_functions_ptr);
};
class sangoma_api_logger_dev : public sangoma_interface
{
wp_logger_cmd_t logger_cmd;
#if defined(__WINDOWS__)
#define HANDLE_DEVICE_IOCTL_RESULT(bResult)\
{ \
if(bResult == 0){ \
/* check message log */ \
printf("%s(): Line: %d: Error!!\n", __FUNCTION__, __LINE__); \
DecodeLastError(__FUNCTION__); \
return 1; \
} \
}
#endif /*__WINDOWS__*/
public:
sangoma_api_logger_dev(void);
~sangoma_api_logger_dev(void);
virtual int init(callback_functions_t *callback_functions_ptr);
/*! Logger Event handler function */
virtual int read_event();
virtual int flush_operational_stats (void);
int get_logger_dev_operational_stats(wp_logger_stats_t *stats);
};
#endif//SANGOMA_INTERFACE_H

View File

@ -51,7 +51,7 @@ int sangoma_port::init(uint16_t wanpipe_number)
wp_number = wanpipe_number;
wp_handle = sangoma_open_driver_ctrl(wanpipe_number);
if(wp_handle == INVALID_HANDLE_VALUE){
ERR_CFG("Error: failed to open %s!!\n", wanpipe_name_str);
ERR_CFG("Error: failed to open wanpipe%d!!\n", wp_number);
return 1;
}
return 0;
@ -63,7 +63,7 @@ int sangoma_port::get_hardware_info(hardware_info_t *hardware_info)
int err=sangoma_driver_get_hw_info(wp_handle,&port_management, wp_number);
if (err) {
ERR_CFG("%s: Error: failed to get hw info!\n",wanpipe_name_str);
ERR_CFG("Error: failed to get hw info for wanpipe%d!\n", wp_number);
err=1;
return err;
}

View File

@ -82,7 +82,6 @@ public:
protected:
uint16_t wp_number;
char wanpipe_name_str[WAN_DRVNAME_SZ*2];
HANDLE wp_handle;
int push_a_card_into_wanpipe_info_array(wanpipe_instance_info_t *wanpipe_info_array,

View File

@ -337,7 +337,7 @@ int sangoma_port_configurator::set_volatile_configration(port_cfg_t *port_cfg)
switch(port_cfg->operation_status)
{
case SANG_STATUS_DEVICE_BUSY:
INFO_CFG("Error: open handles exist for '%s_IF\?\?' interfaces!\n", wanpipe_name_str);
INFO_CFG("Error: open handles exist for 'wanpipe%d_if\?\?' interfaces!\n", wp_number);
return port_cfg->operation_status;
case SANG_STATUS_SUCCESS:
//OK
@ -360,7 +360,7 @@ int sangoma_port_configurator::initialize_t1_tdm_span_voice_api_configration_str
{
wandev_conf_t *wandev_conf = &port_cfg->wandev_conf;
sdla_fe_cfg_t *sdla_fe_cfg = &wandev_conf->fe_cfg;
sdla_te_cfg_t *te_cfg = &sdla_fe_cfg->cfg.te_cfg;
//sdla_te_cfg_t *te_cfg = &sdla_fe_cfg->cfg.te_cfg;
wan_tdmv_conf_t *tdmv_cfg = &wandev_conf->tdmv_conf;
wanif_conf_t *wanif_cfg = &port_cfg->if_cfg[0];
@ -369,15 +369,15 @@ int sangoma_port_configurator::initialize_t1_tdm_span_voice_api_configration_str
FE_LCODE(sdla_fe_cfg) = WAN_LCODE_B8ZS;
FE_FRAME(sdla_fe_cfg) = WAN_FR_ESF;
FE_LINENO(sdla_fe_cfg) = hardware_info->port_number;
FE_TDMV_LAW(sdla_fe_cfg) = WAN_TDMV_MULAW;
FE_NETWORK_SYNC(sdla_fe_cfg) = 0;
FE_TDMV_LAW(sdla_fe_cfg) = WAN_TDMV_MULAW;
FE_NETWORK_SYNC(sdla_fe_cfg) = 0;
FE_LBO(sdla_fe_cfg) = WAN_T1_0_110;
FE_REFCLK(sdla_fe_cfg) = 0;
FE_HIMPEDANCE_MODE(sdla_fe_cfg) = 0;
FE_SIG_MODE(sdla_fe_cfg) = WAN_TE1_SIG_CCS;
FE_RX_SLEVEL(sdla_fe_cfg) = WAN_TE1_RX_SLEVEL_12_DB;
FE_LBO(sdla_fe_cfg) = WAN_T1_0_110;
FE_REFCLK(sdla_fe_cfg) = 0;
FE_HIMPEDANCE_MODE(sdla_fe_cfg) = 0;
FE_SIG_MODE(sdla_fe_cfg) = WAN_TE1_SIG_CCS;
FE_RX_SLEVEL(sdla_fe_cfg) = WAN_TE1_RX_SLEVEL_12_DB;
#if 1
FE_CLK(sdla_fe_cfg) = WAN_NORMAL_CLK;
#else
@ -396,7 +396,7 @@ int sangoma_port_configurator::initialize_t1_tdm_span_voice_api_configration_str
wandev_conf->card_type = WANOPT_AFT; //m_DeviceInfoData.card_model;
wanif_cfg->magic = ROUTER_MAGIC;
wanif_cfg->active_ch = 0x01FFFFFE;// channels 1-24
wanif_cfg->active_ch = 0x00FFFFFF;//channels 1-24 (starting from bit zero)
sprintf(wanif_cfg->usedby,"TDM_SPAN_VOICE_API");
wanif_cfg->u.aft.idle_flag=0xFF;
wanif_cfg->mtu = 160;
@ -417,7 +417,7 @@ int sangoma_port_configurator::initialize_t1_tdm_span_voice_api_configration_str
switch(FE_MEDIA(sdla_fe_cfg))
{
case WAN_MEDIA_T1:
tdmv_cfg->dchan = (1<<23);/* channel 24 */
tdmv_cfg->dchan = (1<<23);/* Channel 24. This is a bitmap, not a channel number. */
break;
default:
printf("%s(): Error: invalid media type!\n", __FUNCTION__);
@ -442,14 +442,14 @@ int sangoma_port_configurator::initialize_e1_tdm_span_voice_api_configration_str
FE_LCODE(sdla_fe_cfg) = WAN_LCODE_HDB3;
FE_FRAME(sdla_fe_cfg) = WAN_FR_CRC4;
FE_LINENO(sdla_fe_cfg) = hardware_info->port_number;
FE_TDMV_LAW(sdla_fe_cfg) = WAN_TDMV_MULAW;
FE_NETWORK_SYNC(sdla_fe_cfg) = 0;
FE_TDMV_LAW(sdla_fe_cfg) = WAN_TDMV_MULAW;
FE_NETWORK_SYNC(sdla_fe_cfg) = 0;
FE_LBO(sdla_fe_cfg) = WAN_E1_120;
FE_REFCLK(sdla_fe_cfg) = 0;
FE_HIMPEDANCE_MODE(sdla_fe_cfg) = 0;
FE_SIG_MODE(sdla_fe_cfg) = WAN_TE1_SIG_CCS;
FE_RX_SLEVEL(sdla_fe_cfg) = WAN_TE1_RX_SLEVEL_12_DB;
FE_LBO(sdla_fe_cfg) = WAN_E1_120;
FE_REFCLK(sdla_fe_cfg) = 0;
FE_HIMPEDANCE_MODE(sdla_fe_cfg) = 0;
FE_SIG_MODE(sdla_fe_cfg) = WAN_TE1_SIG_CCS;
FE_RX_SLEVEL(sdla_fe_cfg) = WAN_TE1_RX_SLEVEL_12_DB;
#if 1
FE_CLK(sdla_fe_cfg) = WAN_NORMAL_CLK;
@ -469,7 +469,7 @@ int sangoma_port_configurator::initialize_e1_tdm_span_voice_api_configration_str
wandev_conf->card_type = WANOPT_AFT; //m_DeviceInfoData.card_model;
wanif_cfg->magic = ROUTER_MAGIC;
wanif_cfg->active_ch = 0xFFFFFFFE;// channels 1-31
wanif_cfg->active_ch = 0x7FFFFFFF;// channels 1-31 (starting from bit zero)
sprintf(wanif_cfg->usedby,"TDM_SPAN_VOICE_API");
wanif_cfg->u.aft.idle_flag=0xFF;
wanif_cfg->mtu = 160;
@ -490,7 +490,7 @@ int sangoma_port_configurator::initialize_e1_tdm_span_voice_api_configration_str
switch(FE_MEDIA(sdla_fe_cfg))
{
case WAN_MEDIA_E1:
tdmv_cfg->dchan = (1<<15);/* channel 16 */
tdmv_cfg->dchan = (1<<15);/* Channel 16. This is a bitmap, not a channel number. */
break;
default:
printf("%s(): Error: invalid media type!\n", __FUNCTION__);
@ -507,3 +507,34 @@ int sangoma_port_configurator::write_configration_on_persistent_storage(port_cfg
return sangoma_write_port_config_on_persistent_storage(hardware_info, port_cfg, (unsigned short)span);
}
int sangoma_port_configurator::control_analog_rm_lcm(port_cfg_t *port_cfg, int control_val)
{
wandev_conf_t *wandev_conf = &port_cfg->wandev_conf;
sdla_fe_cfg_t *sdla_fe_cfg = &wandev_conf->fe_cfg;
if(wandev_conf->card_type == WANOPT_AFT_ANALOG){ //Only valid for Analog cards
if(control_val == 1){
sdla_fe_cfg->cfg.remora.rm_lcm = 1;
}else if(control_val == 0){
sdla_fe_cfg->cfg.remora.rm_lcm = 0;
}else{
printf("%s(): Error: invalid parameter!\n", __FUNCTION__);
return -EINVAL;
}
} else{
return -EINVAL;
}
return 0;
}
int sangoma_port_configurator::set_analog_opermode(port_cfg_t *port_cfg, char *opermode)
{
wandev_conf_t *wandev_conf = &port_cfg->wandev_conf;
sdla_fe_cfg_t *sdla_fe_cfg = &wandev_conf->fe_cfg;
if(wandev_conf->card_type == WANOPT_AFT_ANALOG){ //Only valid for Analog cards
if(sizeof(sdla_fe_cfg->cfg.remora.opermode_name) < strlen(opermode))
return -EINVAL;
strcpy(sdla_fe_cfg->cfg.remora.opermode_name,opermode);
} else{
return -EINVAL;
}
return 0;
}

View File

@ -44,12 +44,18 @@ public:
sangoma_port_configurator();
virtual ~sangoma_port_configurator();
int open_port_registry_key(hardware_info_t *hardware_info);
int get_configration(port_cfg_t *port_cfg);
int set_default_configuration(port_cfg_t *port_cfg);
//Function to set Loop Current Measure (LCM) for analog FXO
//control_val 1: enable,0: disable
int control_analog_rm_lcm(port_cfg_t *port_cfg, int control_val);
//Function to set Operation mode for analog FXO
//opermode valid country name supported by Analog FXO
int set_analog_opermode(port_cfg_t *port_cfg, char *opermode);
//Function to check correctness of 'port_cfg_t' structure.
int check_port_cfg_structure(port_cfg_t *port_cfg);

View File

@ -17,6 +17,7 @@ INCLUDES=$(DDK_INC_PATH);\
$(SANG_WP_DEVEL)\wanpipe_common\include;\
$(SANG_WP_DEVEL)\wanpipe_common\include\aft_core;\
$(SANG_WP_DEVEL)\wanpipe_windows\include;\
$(SANG_WP_DEVEL)\wanpipe_common\wantools\wanec_apilib;\
$(SANG_WP_DEVEL)\libsangoma;\
$(SANG_WP_DEVEL)\stelephony;\
$(SANG_WP_DEVEL)\stelephony\stel_tone
@ -34,8 +35,9 @@ $(SDK_LIB_PATH)\oleaut32.lib \
$(SDK_LIB_PATH)\uuid.lib \
$(SDK_LIB_PATH)\comctl32.lib \
$(SDK_LIB_PATH)\Setupapi.lib \
$(SANG_WP_DEVEL)\libsangoma\$(OBJ_DIR)\libsangoma.lib \
$(SANG_WP_DEVEL)\stelephony\$(OBJ_DIR)\stelephony.lib
$(SANG_WP_DEVEL)\libsangoma\$(O)\libsangoma.lib \
$(SANG_WP_DEVEL)\stelephony\$(O)\stelephony.lib \
$(SANG_WP_DEVEL)\wanpipe_common\wantools\wanec_apilib\$(O)\waneclib.lib
SOURCES=sample.cpp \

View File

@ -18,13 +18,15 @@ INCLUDES=$(SDK_INC_PATH);\
$(SANG_WP_DEVEL)\wanpipe_common\include;\
$(SANG_WP_DEVEL)\wanpipe_common\include\aft_core;\
$(SANG_WP_DEVEL)\wanpipe_windows\include;\
$(SANG_WP_DEVEL)\libsangoma
$(SANG_WP_DEVEL)\libsangoma;\
$(SANG_WP_DEVEL)\wanpipe_common\wantools\wanec_apilib
TARGETLIBS=$(SDK_LIB_PATH)\kernel32.lib \
$(SDK_LIB_PATH)\user32.lib \
$(SDK_LIB_PATH)\SetupApi.lib \
$(SDK_LIB_PATH)\Advapi32.lib
$(SDK_LIB_PATH)\Advapi32.lib \
$(SANG_WP_DEVEL)\wanpipe_common\wantools\wanec_apilib\$(O)\waneclib.lib
SOURCES=libsangoma.c libsangoma.rc
SOURCES=libsangoma.c libsangoma.rc libsangoma_hwec.c

View File

@ -1,13 +1,13 @@
K 25
svn:wc:ra_dav:version-url
V 33
/svn/stelephony/!svn/ver/52/trunk
/svn/stelephony/!svn/ver/59/trunk
END
stelephony.h
K 25
svn:wc:ra_dav:version-url
V 46
/svn/stelephony/!svn/ver/43/trunk/stelephony.h
/svn/stelephony/!svn/ver/59/trunk/stelephony.h
END
init-automake.sh
K 25
@ -73,7 +73,7 @@ PToneDecoder.h
K 25
svn:wc:ra_dav:version-url
V 48
/svn/stelephony/!svn/ver/51/trunk/PToneDecoder.h
/svn/stelephony/!svn/ver/56/trunk/PToneDecoder.h
END
PToneEncoder.cpp
K 25
@ -91,7 +91,7 @@ libstelephony.h
K 25
svn:wc:ra_dav:version-url
V 49
/svn/stelephony/!svn/ver/43/trunk/libstelephony.h
/svn/stelephony/!svn/ver/59/trunk/libstelephony.h
END
build.sh
K 25
@ -115,7 +115,7 @@ stelephony.cpp
K 25
svn:wc:ra_dav:version-url
V 48
/svn/stelephony/!svn/ver/51/trunk/stelephony.cpp
/svn/stelephony/!svn/ver/55/trunk/stelephony.cpp
END
stelephony.aps
K 25
@ -138,8 +138,8 @@ END
stelephony.sln
K 25
svn:wc:ra_dav:version-url
V 47
/svn/stelephony/!svn/ver/1/trunk/stelephony.sln
V 48
/svn/stelephony/!svn/ver/59/trunk/stelephony.sln
END
version
K 25
@ -163,7 +163,7 @@ stelephony.def
K 25
svn:wc:ra_dav:version-url
V 48
/svn/stelephony/!svn/ver/43/trunk/stelephony.def
/svn/stelephony/!svn/ver/59/trunk/stelephony.def
END
libstelephony_linux_compat.h
K 25
@ -175,13 +175,13 @@ PToneDecoder.cpp
K 25
svn:wc:ra_dav:version-url
V 50
/svn/stelephony/!svn/ver/51/trunk/PToneDecoder.cpp
/svn/stelephony/!svn/ver/54/trunk/PToneDecoder.cpp
END
stelephony.vcproj
K 25
svn:wc:ra_dav:version-url
V 51
/svn/stelephony/!svn/ver/43/trunk/stelephony.vcproj
/svn/stelephony/!svn/ver/59/trunk/stelephony.vcproj
END
README
K 25
@ -207,18 +207,6 @@ svn:wc:ra_dav:version-url
V 51
/svn/stelephony/!svn/ver/43/trunk/libstelephony.cpp
END
Makefile.Windows
K 25
svn:wc:ra_dav:version-url
V 49
/svn/stelephony/!svn/ver/1/trunk/Makefile.Windows
END
stelephony.vcproj.DAVIDRNEW.User.user
K 25
svn:wc:ra_dav:version-url
V 70
/svn/stelephony/!svn/ver/1/trunk/stelephony.vcproj.DAVIDRNEW.User.user
END
missing
K 25
svn:wc:ra_dav:version-url
@ -229,13 +217,13 @@ Makefile.am
K 25
svn:wc:ra_dav:version-url
V 45
/svn/stelephony/!svn/ver/47/trunk/Makefile.am
/svn/stelephony/!svn/ver/56/trunk/Makefile.am
END
PToneEncoder.h
K 25
svn:wc:ra_dav:version-url
V 48
/svn/stelephony/!svn/ver/43/trunk/PToneEncoder.h
/svn/stelephony/!svn/ver/56/trunk/PToneEncoder.h
END
ReadMe.txt
K 25

View File

@ -0,0 +1,7 @@
K 10
svn:ignore
V 55
Makefile.Windows
stelephony.vcproj.DAVIDRNEW.User.user
END

View File

@ -1,16 +1,16 @@
8
dir
52
59
http://www.sangomapbx.com/svn/stelephony/trunk
http://www.sangomapbx.com/svn/stelephony
2009-07-23T18:22:49.763903Z
52
2010-03-15T22:33:02.724320Z
59
davidr
has-props
svn:special svn:externals svn:needs-lock
@ -32,10 +32,10 @@ file
2009-06-26T20:54:03.000000Z
91d1d684d4b562f449ff6226ea1c2f95
2009-06-09T20:43:33.158857Z
43
2010-03-23T16:15:02.000000Z
c43ebb613031858fa669fc4aca84ae43
2010-03-15T22:33:02.724320Z
59
davidr
init-automake.sh
@ -171,11 +171,11 @@ file
2009-07-21T20:55:25.000000Z
d76fa5941bf65fc8d3064f8dacc548a6
2009-07-16T21:36:49.003747Z
51
davidr
2010-02-10T23:38:32.000000Z
84d583985ea686ae7a2e3992245b0d2a
2010-01-18T18:07:02.752786Z
56
davidy
PToneEncoder.cpp
file
@ -207,10 +207,10 @@ file
2009-06-26T20:54:03.000000Z
0abb089cf0abe6ac85d6dc7aa4edcb09
2009-06-09T20:43:33.158857Z
43
2010-03-23T16:15:02.000000Z
4aa0037bc2dd7fd39d7e766d9850a586
2010-03-15T22:33:02.724320Z
59
davidr
build.sh
@ -256,11 +256,11 @@ file
2009-07-21T20:55:25.000000Z
2407e5f74fcd8442360c77413f9c4969
2009-07-16T21:36:49.003747Z
51
davidr
2009-12-21T23:17:41.000000Z
d39810d5fd7763003fbd609890934180
2009-12-18T19:03:36.960538Z
55
davidy
stelephony.aps
file
@ -305,11 +305,11 @@ file
2009-06-26T20:54:03.000000Z
eb00665e7cd041b1c20722382a5c95de
2009-02-12T18:45:27.267919Z
1
root
2010-03-23T16:15:02.000000Z
8796ce903cb4dd88f075b27fede7d489
2010-03-15T22:33:02.724320Z
59
davidr
version
file
@ -353,10 +353,10 @@ file
2009-06-26T20:54:03.000000Z
67c394b6dd35b19d97b5e115f62a40f6
2009-06-09T20:43:33.158857Z
43
2010-03-23T16:15:02.000000Z
6b2ae7a559be5bf37c05bfae9988e900
2010-03-15T22:33:02.724320Z
59
davidr
libstelephony_linux_compat.h
@ -377,11 +377,11 @@ file
2009-07-21T20:55:25.000000Z
3b55910e113ddcc12d6aa00f9884d4a5
2009-07-16T21:36:49.003747Z
51
davidr
2009-12-21T23:17:41.000000Z
afc68f8adeeec8bacd42fc2c6ac7d380
2009-12-18T18:47:54.309491Z
54
davidy
stelephony.vcproj
file
@ -389,10 +389,10 @@ file
2009-06-26T20:54:03.000000Z
648392d49cf6e7a38fd782c5877cf726
2009-06-09T20:43:33.158857Z
43
2010-03-23T16:15:02.000000Z
4a6dbf857cbeaa06e00069bcc011da43
2010-03-15T22:33:02.724320Z
59
davidr
README
@ -443,30 +443,6 @@ file
43
davidr
Makefile.Windows
file
2009-06-26T20:54:03.000000Z
a17ac70bbce5e7bd36232bdaf1691fd3
2009-02-12T18:45:27.267919Z
1
root
stelephony.vcproj.DAVIDRNEW.User.user
file
2009-06-26T20:54:03.000000Z
eca17b45f5a1950d7bb704be371f2fd7
2009-02-12T18:45:27.267919Z
1
root
missing
file
@ -486,11 +462,11 @@ file
2009-06-26T20:54:03.000000Z
18ae4124b46e9c80bb1801f3654778c5
2009-06-26T21:23:15.165605Z
47
ncorbic
2010-02-10T23:38:32.000000Z
0734dc12dbb49509b2d1780fd64c054f
2010-01-18T18:07:02.752786Z
56
davidy
PToneEncoder.h
file
@ -498,11 +474,11 @@ file
2009-06-26T20:54:03.000000Z
7d527f032695c21ce1fb50c8ea09b07a
2009-06-09T20:43:33.158857Z
43
davidr
2010-02-10T23:38:32.000000Z
f79dd7f4f64571da090e33b6ef5753c7
2010-01-18T18:07:02.752786Z
56
davidy
ReadMe.txt
file

View File

@ -1,9 +0,0 @@
#
# DO NOT EDIT THIS FILE!!! Edit .\sources. if you want to add a new source
# file to this component. This file merely indirects to the real make file
# that is shared by all the driver components of the Windows NT DDK
#
!INCLUDE $(NTMAKEENV)\makefile.def

View File

@ -8,7 +8,7 @@ AM_CFLAGS = -fPIC -Wall -Wstrict-prototypes -Wmissing-prototypes -g -I$(WLINC)
AM_CXXFLAGS = -fPIC -Wall -g -I$(WLINC) -I$(WINC) -I. \
-D__LINUX__ -D_REENTRANT -D_GNU_SOURCE -O2 -D_DEBUG_=2 -D_GNUC_ -I../lib -Istel_tone
LIB_SOUCES = libstelephony.cpp PToneDecoder.cpp PToneEncoder.cpp Q931EventsDecoder.cpp stelephony.cpp stel_tone/stel_tone.c stel_tone/uart.c stel_tone/libteletone_generate.c stel_tone/libteletone_detect.c stel_tone/fsk.c
LIB_SOUCES = libstelephony.cpp PToneDecoder.cpp PToneEncoder.cpp Q931EventsDecoder.cpp stelephony.cpp stel_tone/stel_tone.c stel_tone/wp_uart.c stel_tone/wp_libteletone_generate.c stel_tone/wp_libteletone_detect.c stel_tone/wp_fsk.c
library_includedir = $(includedir)

View File

@ -86,7 +86,7 @@ int PhoneToneDecoder::Init()
int PhoneToneDecoder::WaveStreamInputExFSK(int16_t* slinData, int dataLength, int *retvalue)
{
char CallerNumber[15], CallerName[15], DateTime[15];
char CallerNumber[22], CallerName[52], DateTime[16];
memset(CallerNumber,0,sizeof(CallerNumber));
memset(CallerName,0,sizeof(CallerName));
memset(DateTime,0,sizeof(DateTime));
@ -178,7 +178,7 @@ int PhoneToneDecoder::WaveStreamInputEx(char* data, int dataLength, int *retValu
STEL_ERR("Failed to alloc mem (%s:%d)\n", __FUNCTION__,__LINE__);
return -1;
}
memset(slinData, 0, sizeof(slinData));
memset( slinData, 0, dataLength*2 );
if (variant.intVal==WFI_CCITT_uLaw_8kHzMono) {
for(i=0; i<dataLength; i++) {
/* Convert to linear data */

View File

@ -7,8 +7,8 @@
#include <libstelephony.h>
#include "Sink.h"
#include "g711.h"
#include "libteletone.h"
#include "wp_g711.h"
#include "wp_libteletone.h"
class PhoneToneDecoder
{

View File

@ -7,8 +7,8 @@
#include <libstelephony.h>
#include "Sink.h"
#include "g711.h"
#include "libteletone.h"
#include "wp_g711.h"
#include "wp_libteletone.h"
class PhoneToneEncoder
{

View File

@ -33,7 +33,12 @@
#pragma once
#if defined (__WINDOWS__)
# define STELAPI_CALL __cdecl
#ifdef STELEPHONY_EXPORTS
# define STELAPI_CALL __declspec(dllexport) __cdecl
#else
# define STELAPI_CALL __declspec(dllimport) __cdecl
#endif
# include <Windows.h>
#elif defined (__LINUX__)
@ -138,9 +143,9 @@ typedef struct {
typedef struct {
unsigned char auto_datetime; /* if set to non-zero library will adjust date to system time */
char datetime[16];
char calling_number[16];
char calling_name[16];
char datetime[16];
char calling_number[22];
char calling_name[52];
}stelephony_caller_id_t;

View File

@ -158,8 +158,8 @@ void OnCallerID(void *callback_obj, char *Name, char *CallerNumber, char *Called
CStelephony* stelObj = (CStelephony*)callback_obj;
stelephony_callback_functions_t cbf;
DBG_STEL("%s(): Name: %s, CallerNumber: %s, CalledNumber: %s, DateTime: %s\r\n",
__FUNCTION__, Name, CallerNumber, CalledNumber, DateTime);
DBG_STEL("%s(): Name: %s(%d), CallerNumber: %s(%d), CalledNumber: %s, DateTime: %s\r\n",
__FUNCTION__, Name, strlen(Name), CallerNumber, strlen(CallerNumber), CalledNumber, DateTime);
stelObj->GetCallbackFunctions(&cbf);

View File

@ -1,13 +1,3 @@
LIBRARY STELEPHONY
EXPORTS
StelSetup
StelCleanup
StelStreamInput
StelEventControl
StelGenerateSwDTMF
StelGenerateFSKCallerID
StelBufferInuse
StelBufferRead
StelBufferReadUlaw
StelBufferReadAlaw

View File

@ -4,7 +4,7 @@
#include <stdio.h>
#include <libstelephony.h>
#include "libstelephony.h"
#include "Q931EventsDecoder.h"
#include "Sink.h"

View File

@ -1,6 +1,6 @@

Microsoft Visual Studio Solution File, Format Version 9.00
# Visual Studio 2005
Microsoft Visual Studio Solution File, Format Version 10.00
# Visual Studio 2008
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "stelephony", "stelephony.vcproj", "{973E1E5F-663B-40A3-90C9-8DD0772FDB01}"
EndProject
Global

View File

@ -1,65 +0,0 @@
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioUserFile
ProjectType="Visual C++"
Version="8.00"
ShowAllFiles="false"
>
<Configurations>
<Configuration
Name="Debug|Win32"
>
<DebugSettings
Command=""
WorkingDirectory=""
CommandArguments=""
Attach="false"
DebuggerType="3"
Remote="1"
RemoteMachine="DAVIDRNEW"
RemoteCommand=""
HttpUrl=""
PDBPath=""
SQLDebugging=""
Environment=""
EnvironmentMerge="true"
DebuggerFlavor=""
MPIRunCommand=""
MPIRunArguments=""
MPIRunWorkingDirectory=""
ApplicationCommand=""
ApplicationArguments=""
ShimCommand=""
MPIAcceptMode=""
MPIAcceptFilter=""
/>
</Configuration>
<Configuration
Name="Release|Win32"
>
<DebugSettings
Command=""
WorkingDirectory=""
CommandArguments=""
Attach="false"
DebuggerType="3"
Remote="1"
RemoteMachine="DAVIDRNEW"
RemoteCommand=""
HttpUrl=""
PDBPath=""
SQLDebugging=""
Environment=""
EnvironmentMerge="true"
DebuggerFlavor=""
MPIRunCommand=""
MPIRunArguments=""
MPIRunWorkingDirectory=""
ApplicationCommand=""
ApplicationArguments=""
ShimCommand=""
MPIAcceptMode=""
MPIAcceptFilter=""
/>
</Configuration>
</Configurations>
</VisualStudioUserFile>

View File

@ -1,10 +1,11 @@
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="8.00"
Version="9.00"
Name="stelephony"
ProjectGUID="{973E1E5F-663B-40A3-90C9-8DD0772FDB01}"
RootNamespace="stelephony"
TargetFrameworkVersion="131072"
>
<Platforms>
<Platform
@ -48,7 +49,7 @@
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="D:\development\wanpipe_windows\include"
AdditionalIncludeDirectories="&quot;$(SANG_WP_DEVEL)\stelephony&quot;;&quot;$(SANG_WP_DEVEL)\stelephony\stel_tone&quot;"
PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;STELEPHONY_EXPORTS;UNICODE;_CRT_SECURE_NO_WARNINGS;__WINDOWS__"
MinimalRebuild="true"
BasicRuntimeChecks="3"
@ -75,6 +76,8 @@
<Tool
Name="VCLinkerTool"
ModuleDefinitionFile="stelephony.def"
RandomizedBaseAddress="1"
DataExecutionPrevention="0"
/>
<Tool
Name="VCALinkTool"
@ -96,9 +99,6 @@
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCWebDeploymentTool"
/>
<Tool
Name="VCPostBuildEventTool"
CommandLine=""
@ -169,6 +169,8 @@
LinkIncremental="1"
SuppressStartupBanner="true"
ProgramDatabaseFile=".\Release/stelephony.pdb"
RandomizedBaseAddress="1"
DataExecutionPrevention="0"
ImportLibrary=".\Release/stelephony.lib"
TargetMachine="1"
/>
@ -192,9 +194,6 @@
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCWebDeploymentTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
@ -223,6 +222,10 @@
RelativePath=".\Q931EventsDecoder.cpp"
>
</File>
<File
RelativePath=".\stel_tone\stel_tone.c"
>
</File>
<File
RelativePath="stelephony.cpp"
>
@ -247,6 +250,22 @@
RelativePath=".\stelephony.rc"
>
</File>
<File
RelativePath=".\stel_tone\wp_fsk.c"
>
</File>
<File
RelativePath=".\stel_tone\wp_libteletone_detect.c"
>
</File>
<File
RelativePath=".\stel_tone\wp_libteletone_generate.c"
>
</File>
<File
RelativePath=".\stel_tone\wp_uart.c"
>
</File>
</Filter>
<Filter
Name="Header Files"
@ -260,6 +279,10 @@
RelativePath=".\libstelephony_linux_compat.h"
>
</File>
<File
RelativePath=".\stel_tone\libstelephony_tone.h"
>
</File>
<File
RelativePath=".\PToneDecoder.h"
>
@ -284,6 +307,30 @@
RelativePath=".\StelephonyApi.h"
>
</File>
<File
RelativePath=".\stel_tone\wp_fsk.h"
>
</File>
<File
RelativePath=".\stel_tone\wp_g711.h"
>
</File>
<File
RelativePath=".\stel_tone\wp_libteletone.h"
>
</File>
<File
RelativePath=".\stel_tone\wp_libteletone_detect.h"
>
</File>
<File
RelativePath=".\stel_tone\wp_libteletone_generate.h"
>
</File>
<File
RelativePath=".\stel_tone\wp_uart.h"
>
</File>
</Filter>
<Filter
Name="Resource Files"

Some files were not shown because too many files have changed in this diff Show More