wanpipe-2.3.4-11.tgz

This commit is contained in:
Harald Welte 2021-12-29 17:59:42 +01:00
parent e2881e7e26
commit a1385b407b
211 changed files with 26168 additions and 4557 deletions

View File

@ -7,6 +7,28 @@ Author: Nenad Corbic <ncorbic@sangoma.com>
Copyright (c) 1995-2007 Sangoma Technologies Inc.
------------------------------------------------------------------------------
* Thu Jun 14 2007 Nenad Corbic <ncorbic@sangoma.com> - 2.3.4-11
===============================================================
- A101/2/4/8 (MAXIM) AFT Update IMPORTANT
A major bug fix for AFT Maxim E1 cards for E1 CRC4 Mode.
On some lines the E1/CRC4 mode causes line errors on
the telco side which results in PRI not coming up.
Symptiom: E1 is up (no alarms) on local side but pri is
not coming up! (Only in E1 CRC4 Mode)
- A101/2/4/8 (MAXIM) Mandatory Firmware Update
An echo canceler bug has been fixed for all AFT
MAXIM Cards A101/2/4/8dm. New firmware version is V31.
If you are running MAXIM cards with hwec wiht older
firmware version you must upgrade.
- Updated SMG
Fixed DTMF synchronization
* Thu Jun 13 2007 Nenad Corbic <ncorbic@sangoma.com> - 2.3.4-10
===============================================================

77
Setup
View File

@ -1593,6 +1593,7 @@ ENDOFTEXT
echo "WAN_LIB_DIR=/etc/wanpipe/lib" >> $META_CONF
echo "WAN_ADSL_LIST=/etc/wanpipe/wan_adsl.list" >> $META_CONF
echo "WAN_ANNEXG_LOAD=$ANNEXG_LOAD" >> $META_CONF
echo "WAN_SCTP_LOAD=$SCTP_LOAD" >> $META_CONF
echo "WAN_LIP_LOAD=$LIP_LOAD" >> $META_CONF
echo "WAN_DYN_WANCONFIG=NO" >> $META_CONF
echo "WAN_SCRIPTS_DIR=/etc/wanpipe/scripts" >> $META_CONF
@ -1814,14 +1815,14 @@ WANPIPE utilities are used to:
1) create WANPIPE configuration files.
(/usr/sbin/wancfg)
2) create configuration files for Zaptel and Asterisk
(/usr/sbin/wancfg-zaptel)
2) start,stop,restart individual/all devices and interfaces.
(/usr/sbin/wancfg_zaptel)
3) start,stop,restart individual/all devices and interfaces.
(/usr/sbin/wanrouter)
3) debug line, protocol and driver problems.
4) debug line, protocol and driver problems.
(/usr/sbin/wanpipemon)
4) configure the optional onboard FT1 CSU/DSU (S508/S5143).
5) configure the optional onboard FT1 CSU/DSU (S508/S5143).
(/usr/sbin/cfgft1)
5) aid in WANPIPE API development
6) aid in WANPIPE API development
(/etc/wanpipe/api)
Refer to the WanpipeInstallation.(pdf/txt) for more information.
@ -3756,6 +3757,11 @@ WANPIPE_OBJS=
\cp -f $DRIVER_UPDATE_DIR/src/lip/*.c .
\cp -f $DRIVER_UPDATE_DIR/src/lip/bin/*.o .
if [ -e $DRIVER_UPDATE_DIR/src/lip/lip_katm ]; then
\cp -f $DRIVER_UPDATE_DIR/src/lip/lip_katm/*.c .
\cp -f $DRIVER_UPDATE_DIR/src/lip/lip_katm/*.h .
fi
LIP_LINKED_PROTOCOLS=
TMP_CFLAGS="-I/$WANPIPE_INCLUDE_DIR -I/ -I$SOURCEDIR/include -I$SOURCEDIR/include/linux -I../include/common -I../include "
@ -3862,6 +3868,9 @@ WANPIPE_OBJS=
fi
if [ $XMTP2_PROT = "YES" ]; then
SCTP_LOAD=YES
xmtp2_file=wanpipe_xmtp2.gcc$GCC_VER.$ARCH$REGPARM_OPT.o
if [ ! -e $xmtp2_file ]; then
echo "Warning: FR Binary $xmtp2_file not found!"
@ -4380,34 +4389,39 @@ function install_ssmg ()
eval "ldconfig"
cd $PROD_HOME/$SSMG_DIR
cd sangoma_mgd.trunk
eval "make clean > /dev/null; make > /dev/null "
if [ $? -ne 0 ]; then
echo "FAILED"
return 1
fi
eval "make install > /dev/null "
# Let smg install script install SMG components
#=======================================================
# cd sangoma_mgd.trunk
#
# eval "make clean > /dev/null; make > /dev/null "
# if [ $? -ne 0 ]; then
# echo "FAILED"
# return 1
# fi
# eval "make install > /dev/null "
#
# echo "Installing Sangoma Media Gateway Daemon...DONE"
echo "Installing Sangoma Media Gateway Daemon...DONE"
eval "type asterisk > /dev/null 2> /dev/null"
if [ $? -ne 0 ]; then
echo "Error: Asterisk not installed!"
echo "Please install Asterisk first then retry SSMG installation!"
return 1
fi
# eval "type asterisk > /dev/null 2> /dev/null"
# if [ $? -ne 0 ]; then
# echo "Error: Asterisk not installed!"
# echo "Please install Asterisk first then retry SSMG installation!"
# return 1
# fi
echo
echo "Installing Chan Woomera into Asterisk..."
echo
install_chan_woomera
if [ $? -ne 0 ]; then
echo "Error: Failed to install chan_woomera into Asterisk!"
echo "Check that Asterisk is installed or Call Sangoma Tech Support"
echo
return 1
fi
# echo
# echo "Installing Chan Woomera into Asterisk..."
# echo
# install_chan_woomera
# if [ $? -ne 0 ]; then
# echo "Error: Failed to install chan_woomera into Asterisk!"
# echo "Check that Asterisk is installed or Call Sangoma Tech Support"
# echo
# return 1
# fi
#=========================================================
cd $PROD_HOME/$SSMG_DIR
cd sangoma_mgd.trunk
@ -6099,7 +6113,7 @@ KERNEL_UNAME=`uname -r`
PKG_NAME=wanpipe
DISTR_NAME="WANPIPE"
PROD=wanrouter
PROD_VER=2.3.4-10
PROD_VER=2.3.4-11
PROD_HOME=`pwd`
META_CONF=$PROD_HOME/$PROD.rc
WAN_INTR_DIR=$PROD_HOME/interfaces
@ -6178,6 +6192,7 @@ PROTOCOL_DEFINES="-DCONFIG_PRODUCT_WANPIPE_BASE "
SS7_USER_ID="0"
ANNEXG_LOAD=NO
SCTP_LOAD=NO
ZAPTEL_INSTALL_DIR="/usr/src/zaptel"
ZAPTEL_C_FILE="zaptel.c"

View File

@ -1,5 +1,5 @@
Package: wanpipe
Version: 2.3.4-10
Version: 2.3.4-11
Section: networking
Priority: optional
Architecture: all

View File

@ -519,6 +519,7 @@
#define REG_TCR2 0x182
#define BIT_TCR2_TD4RM 0x04
#define BIT_TCR2_E1_AEBE 0x80
#define REG_TCR3 0x183
#define BIT_TCR3_ODF 0x80

View File

@ -151,6 +151,7 @@
#define GSI_PCI_MEMORY_SIZE (8 * (4 * 2 * 1024))
#define PCI_VENDOR_ID_GSI 0x14BC
#define PCI_DEVICE_ID_GSI_PULSAR 0xD002
#define PCI_DEVICE_ID_GSI_ADSL_V2 0xD001
#define PCI_DEVICE_ID_GSI_ADSL PCI_DEVICE_ID_GSI_PULSAR

View File

@ -7,7 +7,7 @@
/********** LINUX **********/
#define WANPIPE_VERSION "2.3.4"
#define WANPIPE_SUB_VERSION "10"
#define WANPIPE_SUB_VERSION "11"
#define WANPIPE_VERSION_BETA 0
#define WANPIPE_LITE_VERSION "1.1.1"

View File

@ -768,6 +768,15 @@ static int sdla_ds_te1_config(void* pfe)
return -EINVAL;
}
if (IS_E1_FEMEDIA(fe)){
switch(WAN_FE_FRAME(fe)){
case WAN_FR_CRC4:
value = READ_REG(REG_TCR2);
WRITE_REG(REG_TCR2, value | BIT_TCR2_E1_AEBE);
break;
}
}
if (IS_E1_FEMEDIA(fe)){
if (WAN_TE1_SIG_MODE(fe) == WAN_TE1_SIG_CAS){

View File

@ -1621,14 +1621,13 @@ static int sdla_pci_probe(sdlahw_t *hw)
/* Search for Pulsar PCI cards */
pci_dev = NULL;
while ((pci_dev = pci_get_device(PCI_VENDOR_ID_GSI, PCI_DEVICE_ID_GSI_ADSL, pci_dev))
!= NULL) {
tmp_hwcard->pci_dev = pci_dev;
sdla_pci_read_config_word(hw, PCI_SUBSYS_ID_WORD, &pci_subsystem_id);
#if 1
#if 0
if ((pci_subsystem_id & 0xFF) != S518_ADPTR_1_CPU_ADSL){
continue;
}
@ -1651,6 +1650,31 @@ static int sdla_pci_probe(sdlahw_t *hw)
}
/* Search for Pulsar PCI cards */
pci_dev = NULL;
while ((pci_dev = pci_get_device(PCI_VENDOR_ID_GSI, PCI_DEVICE_ID_GSI_ADSL_V2, pci_dev))
!= NULL) {
tmp_hwcard->pci_dev = pci_dev;
sdla_pci_read_config_word(hw, PCI_SUBSYS_ID_WORD, &pci_subsystem_id);
pci_subsystem_id=S518_ADPTR_1_CPU_ADSL;
hwcard = sdla_card_register(SDLA_PCI_CARD,
((pci_dev->devfn >> 3) & PCI_DEV_SLOT_MASK),
pci_dev->bus->number,
0);
if (hwcard == NULL){
continue;
}
hwcard->adptr_type = pci_subsystem_id & 0xFF;
hwcard->pci_dev = pci_dev;
number_pci_cards +=
sdla_adsl_hw_select(hwcard, SDLA_CPU_A, pci_dev->irq, NULL);
}
pci_dev=NULL;
while((pci_dev = pci_get_device(SANGOMA_PCI_VENDOR, PCI_ANY_ID, pci_dev)) != NULL){

View File

@ -1,2 +1,2 @@
/root/development/2.3.4/wanpipe-2.3.4-10/patches/kdrivers/wanec/wanec.ko
/root/development/2.3.4/wanpipe-2.3.4-10/patches/kdrivers/wanec/wanec_iface.o /root/development/2.3.4/wanpipe-2.3.4-10/patches/kdrivers/wanec/wanec_cmd.o /root/development/2.3.4/wanpipe-2.3.4-10/patches/kdrivers/wanec/wanec_utils.o /root/development/2.3.4/wanpipe-2.3.4-10/patches/kdrivers/wanec/wanec_dev.o /root/development/2.3.4/wanpipe-2.3.4-10/patches/kdrivers/wanec/oct6100_api/apilib/bt/octapi_bt0.o /root/development/2.3.4/wanpipe-2.3.4-10/patches/kdrivers/wanec/oct6100_api/apilib/largmath/octapi_largmath.o /root/development/2.3.4/wanpipe-2.3.4-10/patches/kdrivers/wanec/oct6100_api/apilib/llman/octapi_llman.o /root/development/2.3.4/wanpipe-2.3.4-10/patches/kdrivers/wanec/oct6100_api/octdeviceapi/oct6100api/oct6100_apimi/oct6100_mask_interrupts.o /root/development/2.3.4/wanpipe-2.3.4-10/patches/kdrivers/wanec/oct6100_api/octdeviceapi/oct6100api/oct6100_api/oct6100_adpcm_chan.o /root/development/2.3.4/wanpipe-2.3.4-10/patches/kdrivers/wanec/oct6100_api/octdeviceapi/oct6100api/oct6100_api/oct6100_channel.o /root/development/2.3.4/wanpipe-2.3.4-10/patches/kdrivers/wanec/oct6100_api/octdeviceapi/oct6100api/oct6100_api/oct6100_chip_open.o /root/development/2.3.4/wanpipe-2.3.4-10/patches/kdrivers/wanec/oct6100_api/octdeviceapi/oct6100api/oct6100_api/oct6100_chip_stats.o /root/development/2.3.4/wanpipe-2.3.4-10/patches/kdrivers/wanec/oct6100_api/octdeviceapi/oct6100api/oct6100_api/oct6100_conf_bridge.o /root/development/2.3.4/wanpipe-2.3.4-10/patches/kdrivers/wanec/oct6100_api/octdeviceapi/oct6100api/oct6100_api/oct6100_debug.o /root/development/2.3.4/wanpipe-2.3.4-10/patches/kdrivers/wanec/oct6100_api/octdeviceapi/oct6100api/oct6100_api/oct6100_events.o /root/development/2.3.4/wanpipe-2.3.4-10/patches/kdrivers/wanec/oct6100_api/octdeviceapi/oct6100api/oct6100_api/oct6100_interrupts.o /root/development/2.3.4/wanpipe-2.3.4-10/patches/kdrivers/wanec/oct6100_api/octdeviceapi/oct6100api/oct6100_api/oct6100_memory.o /root/development/2.3.4/wanpipe-2.3.4-10/patches/kdrivers/wanec/oct6100_api/octdeviceapi/oct6100api/oct6100_api/oct6100_miscellaneous.o /root/development/2.3.4/wanpipe-2.3.4-10/patches/kdrivers/wanec/oct6100_api/octdeviceapi/oct6100api/oct6100_api/oct6100_mixer.o /root/development/2.3.4/wanpipe-2.3.4-10/patches/kdrivers/wanec/oct6100_api/octdeviceapi/oct6100api/oct6100_api/oct6100_phasing_tsst.o /root/development/2.3.4/wanpipe-2.3.4-10/patches/kdrivers/wanec/oct6100_api/octdeviceapi/oct6100api/oct6100_api/oct6100_playout_buf.o /root/development/2.3.4/wanpipe-2.3.4-10/patches/kdrivers/wanec/oct6100_api/octdeviceapi/oct6100api/oct6100_api/oct6100_remote_debug.o /root/development/2.3.4/wanpipe-2.3.4-10/patches/kdrivers/wanec/oct6100_api/octdeviceapi/oct6100api/oct6100_api/oct6100_tlv.o /root/development/2.3.4/wanpipe-2.3.4-10/patches/kdrivers/wanec/oct6100_api/octdeviceapi/oct6100api/oct6100_api/oct6100_tone_detection.o /root/development/2.3.4/wanpipe-2.3.4-10/patches/kdrivers/wanec/oct6100_api/octdeviceapi/oct6100api/oct6100_api/oct6100_tsi_cnct.o /root/development/2.3.4/wanpipe-2.3.4-10/patches/kdrivers/wanec/oct6100_api/octdeviceapi/oct6100api/oct6100_api/oct6100_tsst.o /root/development/2.3.4/wanpipe-2.3.4-10/patches/kdrivers/wanec/oct6100_api/octdeviceapi/oct6100api/oct6100_api/oct6100_user.o
/root/development/2.3.4/wanpipe-2.3.4-11/patches/kdrivers/wanec/wanec.ko
/root/development/2.3.4/wanpipe-2.3.4-11/patches/kdrivers/wanec/wanec_iface.o /root/development/2.3.4/wanpipe-2.3.4-11/patches/kdrivers/wanec/wanec_cmd.o /root/development/2.3.4/wanpipe-2.3.4-11/patches/kdrivers/wanec/wanec_utils.o /root/development/2.3.4/wanpipe-2.3.4-11/patches/kdrivers/wanec/wanec_dev.o /root/development/2.3.4/wanpipe-2.3.4-11/patches/kdrivers/wanec/oct6100_api/apilib/bt/octapi_bt0.o /root/development/2.3.4/wanpipe-2.3.4-11/patches/kdrivers/wanec/oct6100_api/apilib/largmath/octapi_largmath.o /root/development/2.3.4/wanpipe-2.3.4-11/patches/kdrivers/wanec/oct6100_api/apilib/llman/octapi_llman.o /root/development/2.3.4/wanpipe-2.3.4-11/patches/kdrivers/wanec/oct6100_api/octdeviceapi/oct6100api/oct6100_apimi/oct6100_mask_interrupts.o /root/development/2.3.4/wanpipe-2.3.4-11/patches/kdrivers/wanec/oct6100_api/octdeviceapi/oct6100api/oct6100_api/oct6100_adpcm_chan.o /root/development/2.3.4/wanpipe-2.3.4-11/patches/kdrivers/wanec/oct6100_api/octdeviceapi/oct6100api/oct6100_api/oct6100_channel.o /root/development/2.3.4/wanpipe-2.3.4-11/patches/kdrivers/wanec/oct6100_api/octdeviceapi/oct6100api/oct6100_api/oct6100_chip_open.o /root/development/2.3.4/wanpipe-2.3.4-11/patches/kdrivers/wanec/oct6100_api/octdeviceapi/oct6100api/oct6100_api/oct6100_chip_stats.o /root/development/2.3.4/wanpipe-2.3.4-11/patches/kdrivers/wanec/oct6100_api/octdeviceapi/oct6100api/oct6100_api/oct6100_conf_bridge.o /root/development/2.3.4/wanpipe-2.3.4-11/patches/kdrivers/wanec/oct6100_api/octdeviceapi/oct6100api/oct6100_api/oct6100_debug.o /root/development/2.3.4/wanpipe-2.3.4-11/patches/kdrivers/wanec/oct6100_api/octdeviceapi/oct6100api/oct6100_api/oct6100_events.o /root/development/2.3.4/wanpipe-2.3.4-11/patches/kdrivers/wanec/oct6100_api/octdeviceapi/oct6100api/oct6100_api/oct6100_interrupts.o /root/development/2.3.4/wanpipe-2.3.4-11/patches/kdrivers/wanec/oct6100_api/octdeviceapi/oct6100api/oct6100_api/oct6100_memory.o /root/development/2.3.4/wanpipe-2.3.4-11/patches/kdrivers/wanec/oct6100_api/octdeviceapi/oct6100api/oct6100_api/oct6100_miscellaneous.o /root/development/2.3.4/wanpipe-2.3.4-11/patches/kdrivers/wanec/oct6100_api/octdeviceapi/oct6100api/oct6100_api/oct6100_mixer.o /root/development/2.3.4/wanpipe-2.3.4-11/patches/kdrivers/wanec/oct6100_api/octdeviceapi/oct6100api/oct6100_api/oct6100_phasing_tsst.o /root/development/2.3.4/wanpipe-2.3.4-11/patches/kdrivers/wanec/oct6100_api/octdeviceapi/oct6100api/oct6100_api/oct6100_playout_buf.o /root/development/2.3.4/wanpipe-2.3.4-11/patches/kdrivers/wanec/oct6100_api/octdeviceapi/oct6100api/oct6100_api/oct6100_remote_debug.o /root/development/2.3.4/wanpipe-2.3.4-11/patches/kdrivers/wanec/oct6100_api/octdeviceapi/oct6100api/oct6100_api/oct6100_tlv.o /root/development/2.3.4/wanpipe-2.3.4-11/patches/kdrivers/wanec/oct6100_api/octdeviceapi/oct6100api/oct6100_api/oct6100_tone_detection.o /root/development/2.3.4/wanpipe-2.3.4-11/patches/kdrivers/wanec/oct6100_api/octdeviceapi/oct6100api/oct6100_api/oct6100_tsi_cnct.o /root/development/2.3.4/wanpipe-2.3.4-11/patches/kdrivers/wanec/oct6100_api/octdeviceapi/oct6100api/oct6100_api/oct6100_tsst.o /root/development/2.3.4/wanpipe-2.3.4-11/patches/kdrivers/wanec/oct6100_api/octdeviceapi/oct6100api/oct6100_api/oct6100_user.o

View File

@ -1,7 +1,7 @@
%define WANPIPE_VER wanpipe-modules
%define name %{WANPIPE_VER}
%define version 2.3.4
%define release 10
%define release 11
%define serial 1
%define MODULES_DIR /lib/modules
%define USR_INCLUDE_DIR /usr/include
@ -50,6 +50,28 @@ echo "Wanpipe Modules located in %{MODULES_DIR}/%{KVERSION}"
%changelog
* Thu Jun 14 2007 Nenad Corbic <ncorbic@sangoma.com> - 2.3.4-11
===============================================================
- A101/2/4/8 (MAXIM) AFT Update IMPORTANT
A major bug fix for AFT Maxim E1 cards for E1 CRC4 Mode.
On some lines the E1/CRC4 mode causes line errors on
the telco side which results in PRI not coming up.
Symptiom: E1 is up (no alarms) on local side but pri is
not coming up! (Only in E1 CRC4 Mode)
- A101/2/4/8 (MAXIM) Mandatory Firmware Update
An echo canceler bug has been fixed for all AFT
MAXIM Cards A101/2/4/8dm. New firmware version is V31.
If you are running MAXIM cards with hwec wiht older
firmware version you must upgrade.
- Updated SMG
Fixed DTMF synchronization
* Thu Jun 13 2007 Nenad Corbic <ncorbic@sangoma.com> - 2.3.4-10
===============================================================

View File

@ -2,7 +2,7 @@
%define WANPIPE_VER wanpipe-util
%define name %{WANPIPE_VER}
%define version 2.3.4
%define release 10
%define release 11
%define serial 1
%define UTILS_DIR /usr/sbin
%define UTILS_LOCAL_DIR /usr/local/sbin
@ -244,6 +244,28 @@ install_init;
%changelog
* Thu Jun 14 2007 Nenad Corbic <ncorbic@sangoma.com> - 2.3.4-11
===============================================================
- A101/2/4/8 (MAXIM) AFT Update IMPORTANT
A major bug fix for AFT Maxim E1 cards for E1 CRC4 Mode.
On some lines the E1/CRC4 mode causes line errors on
the telco side which results in PRI not coming up.
Symptiom: E1 is up (no alarms) on local side but pri is
not coming up! (Only in E1 CRC4 Mode)
- A101/2/4/8 (MAXIM) Mandatory Firmware Update
An echo canceler bug has been fixed for all AFT
MAXIM Cards A101/2/4/8dm. New firmware version is V31.
If you are running MAXIM cards with hwec wiht older
firmware version you must upgrade.
- Updated SMG
Fixed DTMF synchronization
* Thu Jun 13 2007 Nenad Corbic <ncorbic@sangoma.com> - 2.3.4-10
===============================================================

View File

@ -2,7 +2,7 @@
%define WANPIPE_VER wanpipe
%define name %{WANPIPE_VER}
%define version 2.3.4
%define release 10
%define release 11
%define serial 1
%define UTILS_DIR /usr/sbin
%define UTILS_LOCAL_DIR /usr/local/sbin
@ -252,6 +252,28 @@ install_init;
%changelog
* Thu Jun 14 2007 Nenad Corbic <ncorbic@sangoma.com> - 2.3.4-11
===============================================================
- A101/2/4/8 (MAXIM) AFT Update IMPORTANT
A major bug fix for AFT Maxim E1 cards for E1 CRC4 Mode.
On some lines the E1/CRC4 mode causes line errors on
the telco side which results in PRI not coming up.
Symptiom: E1 is up (no alarms) on local side but pri is
not coming up! (Only in E1 CRC4 Mode)
- A101/2/4/8 (MAXIM) Mandatory Firmware Update
An echo canceler bug has been fixed for all AFT
MAXIM Cards A101/2/4/8dm. New firmware version is V31.
If you are running MAXIM cards with hwec wiht older
firmware version you must upgrade.
- Updated SMG
Fixed DTMF synchronization
* Thu Jun 13 2007 Nenad Corbic <ncorbic@sangoma.com> - 2.3.4-10
===============================================================

View File

@ -446,6 +446,7 @@ echo "Error: Your securelevel does not allow to load kernel modules!"
if [ $OSYSTEM = "Linux" ]; then
wansock_config LOAD
annexg_config LOAD
sctp_config LOAD
fi
if ! lip_config LOAD
@ -1286,6 +1287,30 @@ wansock_config ()
return 0
}
sctp_config ()
{
local opt=$1
if [ $OSYSTEM != "Linux" ]; then
return 0
fi
if [ "$WAN_SCTP_LOAD" != "YES" ]; then
return 0
fi
if [ $DEPMOD != YES ]; then
return 0
fi
if [ $opt = LOAD ]; then
eval "modprobe sctp" 2> /dev/null >/dev/null
fi
return 0
}
annexg_config ()
{
local opt=$1
@ -1904,7 +1929,7 @@ WANPIPE_IS_RUNNING=/var/run/wanpipe_is_running
RUGGEDCOM=No
if [ $OSYSTEM = "Linux" ]; then
ROUTER_VERSION=2.3.4-10
ROUTER_VERSION=2.3.4-11
IFCONFIG_LIST=ifconfig
MODULE_STAT=lsmod
WAN_DRIVERS="wanpipe"

View File

@ -1,14 +1,14 @@
8
dir
206
223
svn://sangoma.freeswitch.org/sangoma_mgd/trunk
svn://sangoma.freeswitch.org
2007-05-23T22:40:18.406377Z
203
2007-07-10T21:28:58.437367Z
223
ncorbic
@ -26,53 +26,29 @@ svn:special svn:externals svn:needs-lock
2028fedf-720c-0410-83b8-d54a3e729fb0
sigboost.h
file
2007-05-02T23:53:06.000000Z
3d2e4c760ba5aa8c6c65a44f1791f302
2007-05-02T22:55:06.099862Z
193
ncorbic
install.sh
file
2007-05-17T21:56:02.000000Z
19d46c159dbe864a780804789297db25
2007-05-18T15:18:52.166170Z
202
2007-06-14T04:18:01.000000Z
eebdfdf347cb99e7d38591488df900d7
2007-06-14T04:19:34.594824Z
212
ncorbic
has-props
switch_buffer.h
sigboost.h
file
2007-06-06T20:39:58.000000Z
33317d4c301ec4e698bf651bae64bae7
2007-05-23T22:40:18.406377Z
203
ncorbic
sangoma_mgd.conf.sample
file
2007-04-13T19:46:26.000000Z
3332791842dafbc726d1b03b9f769db4
2007-04-13T18:50:03.087811Z
178
2007-06-14T04:10:02.000000Z
f60c7e21ea28daf62933e5fa55fac387
2007-06-14T04:08:55.484670Z
208
ncorbic
sound.raw
@ -88,16 +64,40 @@ da36acc78b83d5047481df0cca63d969
ncorbic
has-props
sangoma_mgd.conf.sample
file
2007-04-13T19:46:26.000000Z
3332791842dafbc726d1b03b9f769db4
2007-04-13T18:50:03.087811Z
178
ncorbic
switch_buffer.h
file
2007-06-21T22:16:27.000000Z
f4832443a621cbb88e92535898d11b83
2007-06-21T22:11:59.891196Z
216
ncorbic
chan_woomera.c
file
2007-05-10T17:14:45.000000Z
6c8f7ef7a7ea4c9d89a18eb47804d4cb
2007-05-10T16:17:18.259953Z
198
2007-07-10T21:29:42.000000Z
3693a07162575b55f4c9fcd4126b21d8
2007-07-10T21:28:58.437367Z
223
ncorbic
callgettest.sh
@ -116,18 +116,8 @@ has-props
conf
dir
switch_buffer.o
file
2007-06-06T20:39:58.000000Z
8dcd404011d16c393c380d6f0de727ed
2007-05-23T22:40:18.406377Z
203
ncorbic
has-props
scripts
dir
Changelog
file
@ -135,38 +125,47 @@ file
2007-05-02T23:58:55.000000Z
3d40e2f19bf73c2c65238374f026bd16
2007-05-02T23:01:52.479742Z
194
2007-06-14T04:10:02.000000Z
e882d77b92b36e5878240af27f94d36f
2007-06-14T04:08:55.484670Z
208
ncorbic
scripts
dir
re-sync.sh
file
2007-05-10T17:14:45.000000Z
add21bcb8c87b3136a0e31ab2b6d1af0
2007-05-09T13:29:00.345429Z
197
ncorbic
has-props
call_signal.c
file
2007-05-02T23:53:06.000000Z
4904b13c46e305a2d305dcf99978f490
2007-05-02T22:55:06.099862Z
193
2007-06-21T22:16:27.000000Z
ce7833d67e4f74118a8fb4c7beecddf2
2007-06-21T22:12:30.552870Z
218
ncorbic
re-sync.sh
file
2007-06-14T04:10:02.000000Z
9aa3a4dddd5f60be4c78e08d3e37c87c
2007-06-14T04:08:55.484670Z
208
ncorbic
has-props
sangoma_mgd.c
file
2007-07-10T21:29:46.000000Z
c940a7db93c8066de876e98328747594
2007-07-10T21:28:10.949071Z
222
ncorbic
woomera.conf
@ -181,18 +180,6 @@ aa9bfdfa7b10bb26911cf3b6ae9f604d
152
ncorbic
sangoma_mgd.c
file
207
2007-06-06T21:05:48.000000Z
b45fbe0a16ca2eef8c312d15ae4ad499
2007-06-06T21:06:29.258451Z
207
ncorbic
clog.sh
file
@ -212,10 +199,22 @@ file
2007-05-02T23:53:06.000000Z
a641f97b4002c1ef4874aacbeed98861
2007-05-02T22:55:06.099862Z
193
2007-06-14T04:10:02.000000Z
1a8b734edbabbe1e04c0086460cf1565
2007-06-14T04:08:55.484670Z
208
ncorbic
sangoma_mgd.h
file
2007-06-21T22:16:27.000000Z
ee7ac4b94dcda9781e242afcf8119488
2007-06-21T22:12:18.622974Z
217
ncorbic
g711.h
@ -252,10 +251,10 @@ file
2007-06-06T20:39:58.000000Z
b5a7c694b86448f3553a7d744885b50a
2007-05-23T22:40:18.406377Z
203
2007-06-21T22:16:27.000000Z
628f33fbdf3fb2d3c2861684146bbf5c
2007-06-21T22:11:50.257308Z
215
ncorbic
Makefile
@ -264,9 +263,9 @@ file
2007-02-01T01:39:42.000000Z
a060a5b05ca179bd79d41bac1efa5b7c
2007-03-23T21:32:51.180292Z
171
2007-06-14T04:12:18.000000Z
afc38981b543b562f5262e9b1b16836a
2007-06-14T04:19:34.594824Z
212
ncorbic

View File

@ -1,3 +1,41 @@
sangoma_mgd.c
======================================
Jun 13 2007
v1.13 Nenad Corbic <ncorbic@sangoma.com>
Woomera OPAL Dialect
Added Congestion control
Added SCTP
Added priority ISUP queue
Fixed presentation
v1.12 Nenad Corbic <ncorbic@sangoma.com>
Fixed CCR
Removed socket shutdown on end call.
Let Media thread shutodwn sockets.
v1.11 Nenad Corbic <ncorbic@sangoma.com>
Fixed Remote asterisk/woomera connection
Increased socket timeouts
chan_woomera.c
======================================
Jun 13 2007
v1.11 Nenad Corbic <ncorbic@sangoma.com>
Updated multiple profiles
Updated Dialect for OPAL Woomera
Added call logging/debugging
Fixed presentation
v1.10 Nenad Corbic <ncorbic@sangoma.com>
Bug fix in incoming hangup
v1.9 Nenad Corbic <ncorbic@sangoma.com>
Fixed remote asterisk/woomera
setup.
sangoma_mgd.c
======================================

View File

@ -15,7 +15,7 @@
SMG_DTMF=YES
CC = gcc
INCLUDES = -I/lib/modules/$(shell uname -r)/build/include -I. -I/usr/local/include
INCLUDES = -I/lib/modules/$(shell uname -r)/build/include -I. -I/usr/local/include -I../../patches/kdrivers/include
CFLAGS = -D__LINUX__ -D_REENTRANT -D_GNU_SOURCE -O6 -march=i686
CCFLAGS = -Wall -Wstrict-prototypes -Wmissing-prototypes -g
LDFLAGS=-L. -L/usr/local/lib -lpthread -lsangoma -lm
@ -39,7 +39,7 @@ sangoma_mgd: sangoma_mgd.o call_signal.o switch_buffer.o sigboost.h
rm -fr core*
$(CC) $(CCFLAGS) $(INCLUDES) $(CFLAGS) -o sangoma_mgd sangoma_mgd.o switch_buffer.o call_signal.o $(LDFLAGS)
sangoma_mgd.o: sangoma_mgd.c sigboost.h
sangoma_mgd.o: sangoma_mgd.c sangoma_mgd.h sigboost.h
$(CC) $(CCFLAGS) $(INCLUDES) $(CFLAGS) -c -o sangoma_mgd.o sangoma_mgd.c
clean:

View File

@ -4,7 +4,8 @@
* Author(s): Anthony Minessale II <anthmct@yahoo.com>
* Nenad Corbic <ncorbic@sangoma.com>
*
* Copyright: (c) 2005 Anthony Minessale II
* Copyright: (c) 2005 Nenad Corbic
* Anthony Minessale II
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
@ -19,10 +20,6 @@ extern void __log_printf(int level, FILE *fp, char *file, const char *func, int
#define clog_printf(level, fp, fmt, ...) __log_printf(level, fp, __FILE__, __FUNCTION__, __LINE__, fmt, ##__VA_ARGS__)
extern unsigned int txseq;
extern unsigned int rxseq_reset;
extern unsigned int rxseq;
struct call_signal_map {
uint32_t event_id;
char *name;
@ -43,7 +40,7 @@ static struct call_signal_map call_signal_table[] = {
{SIGBOOST_EVENT_REMOVE_CHECK_LOOP, "LOOP STOP"}
};
#define USE_SCTP 1
static int create_udp_socket(call_signal_connection_t *mcon, char *local_ip, int local_port, char *ip, int port)
{
@ -54,7 +51,17 @@ static int create_udp_socket(call_signal_connection_t *mcon, char *local_ip, int
memset(&mcon->remote_hp, 0, sizeof(mcon->remote_hp));
memset(&mcon->local_hp, 0, sizeof(mcon->local_hp));
if ((mcon->socket = socket(AF_INET, SOCK_DGRAM, 0))) {
#ifdef USE_SCTP
mcon->socket = socket(AF_INET, SOCK_SEQPACKET, IPPROTO_SCTP);
#else
mcon->socket = socket(AF_INET, SOCK_DGRAM, 0);
#endif
clog_printf(3,mcon->log,"Creating L=%s:%d R=%s:%d\n",
local_ip,local_port,ip,port);
if (mcon->socket >= 0) {
int flag=1;
gethostbyname_r(ip, &mcon->remote_hp, buf, sizeof(buf), &result, &err);
gethostbyname_r(local_ip, &mcon->local_hp, local_buf, sizeof(local_buf), &local_result, &err);
if (result && local_result) {
@ -66,9 +73,24 @@ static int create_udp_socket(call_signal_connection_t *mcon, char *local_ip, int
memcpy((char *) &mcon->local_addr.sin_addr.s_addr, mcon->local_hp.h_addr_list[0], mcon->local_hp.h_length);
mcon->local_addr.sin_port = htons(local_port);
if ((rc = bind(mcon->socket, (struct sockaddr *) &mcon->local_addr, sizeof(mcon->local_addr))) < 0) {
#ifdef USE_SCTP
setsockopt(mcon->socket, IPPROTO_SCTP, SCTP_NODELAY,
(char *)&flag, sizeof(int));
#endif
if ((rc = bind(mcon->socket,
(struct sockaddr *) &mcon->local_addr,
sizeof(mcon->local_addr))) < 0) {
close(mcon->socket);
mcon->socket = -1;
} else {
#ifdef USE_SCTP
rc=listen(mcon->socket,100);
if (rc) {
close(mcon->socket);
mcon->socket = -1;
}
#endif
}
}
}
@ -87,8 +109,6 @@ int call_signal_connection_close(call_signal_connection_t *mcon)
int call_signal_connection_open(call_signal_connection_t *mcon, char *local_ip, int local_port, char *ip, int port)
{
memset(mcon, 0, sizeof(*mcon));
create_udp_socket(mcon, local_ip, local_port, ip, port);
return mcon->socket;
}
@ -104,27 +124,30 @@ call_signal_event_t *call_signal_connection_read(call_signal_connection_t *mcon,
if (bytes == sizeof(mcon->event) ||
bytes == (sizeof(mcon->event)-sizeof(uint32_t))) {
if (rxseq_reset) {
if (mcon->rxseq_reset) {
if (mcon->event.event_id == SIGBOOST_EVENT_SYSTEM_RESTART_ACK) {
rxseq++;
clog_printf(0,mcon->log,"Rx sync ok\n");
mcon->rxseq=mcon->event.fseqno;
return &mcon->event;
}
errno=EAGAIN;
clog_printf(0,mcon->log,"Waiting for rx sync...\n");
return NULL;
}
mcon->rxseq++;
if (rxseq != mcon->event.seqno) {
if (mcon->rxseq != mcon->event.fseqno) {
clog_printf(0, mcon->log,
"------------------------------------------\n");
clog_printf(0, mcon->log,
"Critical Error: Invalid Sequence Number Expect=%i Rx=%i\n",
rxseq,mcon->event.seqno);
mcon->rxseq,mcon->event.fseqno);
clog_printf(0, mcon->log,
"------------------------------------------\n");
}
rxseq++;
mcon->txwindow = mcon->txseq - mcon->event.bseqno;
return &mcon->event;
@ -143,6 +166,33 @@ call_signal_event_t *call_signal_connection_read(call_signal_connection_t *mcon,
return NULL;
}
call_signal_event_t *call_signal_connection_readp(call_signal_connection_t *mcon, int iteration)
{
unsigned int fromlen = sizeof(struct sockaddr_in);
int bytes = 0;
bytes = recvfrom(mcon->socket, &mcon->event, sizeof(mcon->event), MSG_DONTWAIT,
(struct sockaddr *) &mcon->local_addr, &fromlen);
if (bytes == sizeof(mcon->event) ||
bytes == (sizeof(mcon->event)-sizeof(uint32_t))) {
return &mcon->event;
} else {
if (iteration == 0) {
clog_printf(0, mcon->log,
"------------------------------------------\n");
clog_printf(0, mcon->log,
"Critical Error: PQ Invalid Event lenght from boost rxlen=%i evsz=%i\n",
bytes, sizeof(mcon->event));
clog_printf(0, mcon->log,
"------------------------------------------\n");
}
}
return NULL;
}
int call_signal_connection_write(call_signal_connection_t *mcon, call_signal_event_t *event)
{
int err;
@ -151,7 +201,7 @@ int call_signal_connection_write(call_signal_connection_t *mcon, call_signal_eve
return -EINVAL;
}
if (event->span < 0 || event->chan < 0 || event->span > 16 || event->chan > 30) {
if (event->span < 0 || event->chan < 0 || event->span > 16 || event->chan > 31) {
clog_printf(0, mcon->log,
"------------------------------------------\n");
clog_printf(0, mcon->log,
@ -164,7 +214,8 @@ int call_signal_connection_write(call_signal_connection_t *mcon, call_signal_eve
gettimeofday(&event->tv,NULL);
pthread_mutex_lock(&mcon->lock);
event->seqno=txseq++;
event->fseqno=mcon->txseq++;
event->bseqno=mcon->rxseq;
err=sendto(mcon->socket, event, sizeof(call_signal_event_t), 0,
(struct sockaddr *) &mcon->remote_addr, sizeof(mcon->remote_addr));
pthread_mutex_unlock(&mcon->lock);
@ -172,7 +223,6 @@ int call_signal_connection_write(call_signal_connection_t *mcon, call_signal_eve
if (err != sizeof(call_signal_event_t)) {
err = -1;
}
#if 0
clog_printf(2, mcon->log, "TX EVENT\n");
@ -189,7 +239,7 @@ int call_signal_connection_write(call_signal_connection_t *mcon, call_signal_eve
clog_printf(2, mcon->log, " tInterface: [w%dg%d]\n",event->span+1,event->chan+1);
clog_printf(2, mcon->log, " tEvent ID: [%d]\n",event->event_id);
clog_printf(2, mcon->log, " tSetup ID: [%d]\n",event->call_setup_id);
clog_printf(2, mcon->log, " tSeq: [%d]\n",event->seqno);
clog_printf(2, mcon->log, " tSeq: [%d]\n",event->fseqno);
clog_printf(2, mcon->log, "===================================\n");
#endif
@ -202,7 +252,7 @@ int call_signal_connection_write(call_signal_connection_t *mcon, call_signal_eve
event->chan+1,
event->release_cause,
event->call_setup_id,
event->seqno,
event->fseqno,
(event->called_number_digits_count ? (char *) event->called_number_digits : "N/A"),
(event->calling_number_digits_count ? (char *) event->calling_number_digits : "N/A")
);
@ -237,7 +287,7 @@ int call_signal_connection_write(call_signal_connection_t *mcon, call_signal_eve
event->chan+1,
event->event_id,
event->call_setup_id,
event->seqno
event->fseqno
);
#endif

View File

@ -4,7 +4,8 @@
* Author(s): Anthony Minessale II <anthmct@yahoo.com>
* Nenad Corbic <ncorbic@sangoma.com>
*
* Copyright: (c) 2005 Anthony Minessale II
* Copyright: (c) 05-07 Nenad Corbic
* Anthony Minessale II
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
@ -26,6 +27,7 @@
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <netinet/sctp.h>
#include <arpa/inet.h>
#include <stdarg.h>
#include <netdb.h>
@ -56,6 +58,14 @@
typedef t_sigboost call_signal_event_t;
typedef uint32_t call_signal_event_id_t;
typedef struct smg_ip_cfg
{
char local_ip[25];
int local_port;
char remote_ip[25];
int remote_port;
}smg_ip_cfg_t;
struct call_signal_connection {
int socket;
struct sockaddr_in local_addr;
@ -66,6 +76,11 @@ struct call_signal_connection {
unsigned int flags;
pthread_mutex_t lock;
FILE *log;
unsigned int txseq;
unsigned int rxseq;
unsigned int txwindow;
unsigned int rxseq_reset;
smg_ip_cfg_t cfg;
};
typedef enum {
@ -74,9 +89,17 @@ typedef enum {
typedef struct call_signal_connection call_signal_connection_t;
/* disable nagle's algorythm */
static inline void sctp_no_nagle(int socket)
{
int flag = 1;
setsockopt(socket, IPPROTO_SCTP, SCTP_NODELAY, (char *) &flag, sizeof(int));
}
int call_signal_connection_close(call_signal_connection_t *mcon);
int call_signal_connection_open(call_signal_connection_t *mcon, char *local_ip, int local_port, char *ip, int port);
call_signal_event_t *call_signal_connection_read(call_signal_connection_t *mcon, int iteration);
call_signal_event_t *call_signal_connection_readp(call_signal_connection_t *mcon, int iteration);
int call_signal_connection_write(call_signal_connection_t *mcon, call_signal_event_t *event);
void call_signal_event_init(call_signal_event_t *event, call_signal_event_id_t event_id, int chan, int span);
void call_signal_call_init(call_signal_event_t *event, char *calling, char *called, int setup_id);

View File

@ -12,6 +12,14 @@
* This program is free software, distributed under the terms of
* the GNU General Public License
* =============================================
* v1.12 Nenad Corbic <ncorbic@sangoma.com>
* Updated DTMF locking
*
* v1.11 Nenad Corbic <ncorbic@sangoma.com>
* Updated multiple profiles
* Updated Dialect for OPAL Woomera
* Added call logging/debugging
*
* v1.10 Nenad Corbic <ncorbic@sangoma.com>
* Bug fix in incoming hangup
*
@ -81,9 +89,9 @@
#include "asterisk.h"
extern int option_verbose;
#define WOOMERA_VERSION "v1.10"
#define WOOMERA_VERSION "v1.12"
ASTERISK_FILE_VERSION(__FILE__, "$Revision: 1.10 $")
ASTERISK_FILE_VERSION(__FILE__, "$Revision: 1.12 $")
static int tech_count = 0;
static const char desc[] = "Woomera Channel Driver";
@ -119,7 +127,7 @@ static struct ast_jb_conf global_jbconf;
#define WOOMERA_RECORD_SEPARATOR "\r\n\r\n"
#define WOOMERA_DEBUG_PREFIX "**[WOOMERA]** "
#define WOOMERA_DEBUG_LINE "--------------------------------------------------------------------------------"
#define WOOMERA_HARD_TIMEOUT -10000
#define WOOMERA_HARD_TIMEOUT -1000
#define WOOMERA_QLEN 10
/* this macro is not in all versions of asterisk */
@ -365,10 +373,9 @@ static int config_woomera(void);
static int create_udp_socket(char *ip, int port, struct sockaddr_in *sockaddr, int client);
static int connect_woomera(int *new_socket, woomera_profile *profile, int flags);
static int init_woomera(void);
static struct ast_channel *woomera_new(const char *type, int format, void *data, int *cause);
static int woomera_cli(int fd, int argc, char *argv[]);
static void tech_destroy(private_object *tech_pvt, struct ast_channel *owner);
static struct ast_channel *woomera_new(const char *type, int format, void *data, int *cause);
static struct ast_channel *woomera_new(const char *type, int format, void *data, int *cause, woomera_profile *profile);
static int launch_tech_thread(private_object *tech_pvt);
static int tech_create_read_socket(private_object *tech_pvt);
static int tech_activate(private_object *tech_pvt);
@ -810,6 +817,12 @@ static int woomera_message_parse(int fd, woomera_message *wmsg, int timeout,
bytes = atoi(val);
}
if (name && val && !strcasecmp(name, "content-length")) {
ast_set_flag(wmsg, WFLAG_CONTENT);
bytes = atoi(val);
}
}
wmsg->last++;
}
@ -947,6 +960,7 @@ static int tech_activate(private_object *tech_pvt)
int retry_activate_call=0;
woomera_message wmsg;
char *callid;
int err=0;
memset(&wmsg,0,sizeof(wmsg));
retry_activate_again:
@ -992,10 +1006,11 @@ retry_activate_again:
woomera_printf(tech_pvt->profile,
tech_pvt->command_channel,
"CALL %s:%s%s"
"Raw-Audio: %s/%d%s"
"Raw-Audio: %s:%d%s"
"Local-Name: %s!%s%s"
"Local-Number:%s%s"
"Presentation:%d%s"
"Screening:%d%s"
"RDNIS:%s%s",
tech_pvt->proto,
tech_pvt->dest,
@ -1008,7 +1023,9 @@ retry_activate_again:
WOOMERA_LINE_SEPARATOR,
tech_pvt->cid_num,
WOOMERA_LINE_SEPARATOR,
tech_pvt->cid_pres,
(tech_pvt->cid_pres>>5)&0x7,
WOOMERA_LINE_SEPARATOR,
tech_pvt->cid_pres&0xF,
WOOMERA_LINE_SEPARATOR,
tech_pvt->cid_rdnis?tech_pvt->cid_rdnis:"",
WOOMERA_RECORD_SEPARATOR
@ -1018,10 +1035,11 @@ retry_activate_again:
woomera_printf(tech_pvt->profile,
tech_pvt->command_channel,
"CALL %s%s"
"Raw-Audio: %s/%d%s"
"Raw-Audio: %s:%d%s"
"Local-Name: %s!%s%s"
"Local-Number:%s%s"
"Presentation:%d%s"
"Screening:%d%s"
"RDNIS:%s%s",
tech_pvt->dest,
WOOMERA_LINE_SEPARATOR,
@ -1033,16 +1051,17 @@ retry_activate_again:
WOOMERA_LINE_SEPARATOR,
tech_pvt->cid_num,
WOOMERA_LINE_SEPARATOR,
tech_pvt->cid_pres,
(tech_pvt->cid_pres>>5)&0x7,
WOOMERA_LINE_SEPARATOR,
tech_pvt->cid_pres&0xF,
WOOMERA_LINE_SEPARATOR,
tech_pvt->cid_rdnis?tech_pvt->cid_rdnis:"",
WOOMERA_RECORD_SEPARATOR
);
}
woomera_message_parse_wait(tech_pvt,&wmsg);
if (woomera_message_reply_ok(&wmsg) != 0) {
err=woomera_message_parse_wait(tech_pvt,&wmsg);
if (err < 0 || woomera_message_reply_ok(&wmsg) != 0) {
ast_set_flag(tech_pvt, TFLAG_ABORT);
}
@ -1058,6 +1077,23 @@ retry_activate_again:
__FUNCTION__,__LINE__,
tech_pvt->callid,tech_pvt);
}
woomera_printf(tech_pvt->profile,
tech_pvt->command_channel,
"PROCEED %s%s"
"Unique-Call-Id %s%s",
tech_pvt->callid,
WOOMERA_LINE_SEPARATOR,
tech_pvt->callid,
WOOMERA_RECORD_SEPARATOR);
err=woomera_message_parse_wait(tech_pvt,&wmsg);
if (err < 0 || woomera_message_reply_ok(&wmsg) != 0) {
ast_set_flag(tech_pvt, TFLAG_ABORT);
/* Do not hangup on main because
* socket connection has been
* established */
}
}
@ -1080,8 +1116,9 @@ tech_activate_failed:
* We must send a message to SMG to hangup the call */
if (globals.debug > 2) {
ast_log(LOG_NOTICE, "Error: %s Call %s tpvt=%p Failed: CRITICAL\n",
ast_log(LOG_NOTICE, "Error: %s Call %s tpvt=%p Failed!\n",
ast_test_flag(tech_pvt, TFLAG_OUTBOUND) ? "OUT":"IN",
tech_pvt->callid,tech_pvt);
}
@ -1136,6 +1173,54 @@ static int tech_init(private_object *tech_pvt, woomera_profile *profile, int fla
ast_set_flag(tech_pvt, flags);
if (profile->dtmf_enable) {
tech_pvt->dsp_features=0;
tech_pvt->dsp = ast_dsp_new();
if (tech_pvt->dsp) {
#if 0
i->dsp_features = features & ~DSP_PROGRESS_TALK;
/* We cannot do progress detection until receives PROGRESS message */
if (i->outgoing && (i->sig == SIG_PRI)) {
/* Remember requested DSP features, don't treat
talking as ANSWER */
features = 0;
}
#endif
tech_pvt->dsp_features |= DSP_FEATURE_DTMF_DETECT;
//tech_pvt->dsp_features |= DSP_FEATURE_BUSY_DETECT;
//tech_pvt->dsp_features |= DSP_FEATURE_CALL_PROGRESS;
//tech_pvt->dsp_features |= DSP_FEATURE_FAX_DETECT;
ast_dsp_set_features(tech_pvt->dsp, tech_pvt->dsp_features);
ast_dsp_digitmode(tech_pvt->dsp, DSP_DIGITMODE_DTMF | DSP_DIGITMODE_RELAXDTMF);
tech_pvt->ast_dsp=1;
#if 0
if (!ast_strlen_zero(progzone))
ast_dsp_set_call_progress_zone(tech_pvt->dsp, progzone);
if (i->busydetect && CANBUSYDETECT(i)) {
ast_dsp_set_busy_count(tech_pvt->dsp, i->busycount);
ast_dsp_set_busy_pattern(tech_pvt->dsp, i->busy_tonelength, ->busy_quietlength);
}
#endif
}
}
if (profile && profile->faxdetect) {
tech_pvt->faxdetect=1;
}
if (profile->jb_enable) {
#ifdef AST_JB
/* Assign default jb conf to the new zt_pvt */
memcpy(&tech_pvt->jbconf, &global_jbconf, sizeof(struct ast_jb_conf));
ast_jb_configure(chan, &tech_pvt->jbconf);
#else
ast_log(LOG_ERROR, "Asterisk Jitter Buffer Not Compiled!\n");
#endif
}
/* Asterisk being asterisk and all allows approx 1 nanosecond
* to try and establish a connetion here before it starts crying.
@ -1163,13 +1248,13 @@ static int tech_init(private_object *tech_pvt, woomera_profile *profile, int fla
ast_set_flag(tech_pvt, TFLAG_ABORT);
return -1;
}
ast_mutex_lock(&default_profile.call_count_lock);
ast_mutex_lock(&tech_pvt->profile->call_count_lock);
if (ast_test_flag(tech_pvt, TFLAG_OUTBOUND)) {
default_profile.call_out++;
tech_pvt->profile->call_out++;
} else {
default_profile.call_in++;
tech_pvt->profile->call_in++;
}
ast_mutex_unlock(&default_profile.call_count_lock);
ast_mutex_unlock(&tech_pvt->profile->call_count_lock);
} else {
if (ast_test_flag(tech_pvt, TFLAG_OUTBOUND)) {
@ -1179,12 +1264,13 @@ static int tech_init(private_object *tech_pvt, woomera_profile *profile, int fla
}
}
if (profile) {
ast_mutex_lock(&profile->call_count_lock);
profile->call_count++;
tech_pvt->call_count = profile->call_count;
ast_mutex_unlock(&profile->call_count_lock);
}
ast_mutex_lock(&profile->call_count_lock);
profile->call_count++;
tech_pvt->call_count = profile->call_count;
ast_mutex_unlock(&profile->call_count_lock);
if (globals.debug > 2) {
ast_log(LOG_NOTICE, "TECH INIT tech_pvt=%p c=%p (use=%i)\n",
tech_pvt,tech_pvt->owner,usecount());
@ -1391,8 +1477,8 @@ static void *tech_monitor_thread(void *obj)
if (globals.debug > 2) {
ast_log(LOG_NOTICE, "IN THREAD %s rxgain=%f txtain=%f\n",
tech_pvt->callid,
default_profile.rxgain_val,
default_profile.txgain_val);
tech_pvt->profile->rxgain_val,
tech_pvt->profile->txgain_val);
}
@ -1501,13 +1587,13 @@ static void *tech_monitor_thread(void *obj)
usleep(5000);
sched_yield();
}
ast_mutex_lock(&default_profile.call_count_lock);
default_profile.call_end++;
ast_mutex_unlock(&default_profile.call_count_lock);
ast_mutex_lock(&tech_pvt->profile->call_count_lock);
tech_pvt->profile->call_end++;
ast_mutex_unlock(&tech_pvt->profile->call_count_lock);
} else {
ast_mutex_lock(&default_profile.call_count_lock);
default_profile.call_abort++;
ast_mutex_unlock(&default_profile.call_count_lock);
ast_mutex_lock(&tech_pvt->profile->call_count_lock);
tech_pvt->profile->call_abort++;
ast_mutex_unlock(&tech_pvt->profile->call_count_lock);
if (globals.debug > 2) {
ast_log(LOG_NOTICE, "NOTE: Skipping Wait on destroy timedout! %s tech_pvt=%p\n",
@ -1595,7 +1681,7 @@ static void *tech_monitor_thread(void *obj)
woomera_printf(tech_pvt->profile, tech_pvt->command_channel,
"%s %s%s"
"Raw-Audio: %s/%d%s"
"Raw-Audio: %s:%d%s"
"Request-Audio: Raw%s"
"Unique-Call-Id: %s%s",
MEDIA_ANSWER,
@ -1663,22 +1749,23 @@ static void *tech_monitor_thread(void *obj)
goto tech_thread_continue;
continue;
}
ast_mutex_lock(&default_profile.call_count_lock);
default_profile.call_ok++;
ast_mutex_unlock(&default_profile.call_count_lock);
ast_mutex_lock(&tech_pvt->profile->call_count_lock);
tech_pvt->profile->call_ok++;
ast_mutex_unlock(&tech_pvt->profile->call_count_lock);
#endif
}
}
if (ast_test_flag(tech_pvt, TFLAG_DTMF)) {
if (globals.debug > 2) {
ast_log(LOG_NOTICE, "DTMF %s tpvt=%p\n",
tech_pvt->callid,tech_pvt);
ast_log(LOG_NOTICE, "DTMF %s tpvt=%p %s\n",
tech_pvt->callid,tech_pvt,tech_pvt->dtmfbuf);
}
//DIALECT
#if 1
ast_mutex_lock(&tech_pvt->iolock);
#if 0
woomera_printf(tech_pvt->profile, tech_pvt->command_channel,
"DTMF %s %s%s",
tech_pvt->callid,
@ -1697,6 +1784,10 @@ static void *tech_monitor_thread(void *obj)
WOOMERA_RECORD_SEPARATOR);
#endif
ast_clear_flag(tech_pvt, TFLAG_DTMF);
memset(tech_pvt->dtmfbuf, 0, sizeof(tech_pvt->dtmfbuf));
ast_mutex_unlock(&tech_pvt->iolock);
if (woomera_message_parse_wait(tech_pvt,&wmsg) < 0) {
ast_set_flag(tech_pvt, TFLAG_ABORT);
ast_log(LOG_NOTICE, "DTMF ABORT Ch=%d\n",
@ -1704,10 +1795,6 @@ static void *tech_monitor_thread(void *obj)
goto tech_thread_continue;
continue;
}
ast_mutex_lock(&tech_pvt->iolock);
ast_clear_flag(tech_pvt, TFLAG_DTMF);
memset(tech_pvt->dtmfbuf, 0, sizeof(tech_pvt->dtmfbuf));
ast_mutex_unlock(&tech_pvt->iolock);
}
if(tech_pvt->timeout) {
@ -1852,9 +1939,9 @@ static void *tech_monitor_thread(void *obj)
ast_queue_frame(owner, &answer_frame);
ast_set_flag(tech_pvt, TFLAG_UP);
ast_mutex_lock(&default_profile.call_count_lock);
default_profile.call_ok++;
ast_mutex_unlock(&default_profile.call_count_lock);
ast_mutex_lock(&tech_pvt->profile->call_count_lock);
tech_pvt->profile->call_ok++;
ast_mutex_unlock(&tech_pvt->profile->call_count_lock);
}else{
ast_set_flag(tech_pvt, TFLAG_ABORT);
@ -1952,7 +2039,6 @@ static int woomera_locate_socket(woomera_profile *profile, int *woomera_socket)
) < 0) {
ast_log(LOG_ERROR, "{%s} %s:%d HELP! Woomera is broken!\n",
profile->name,__FUNCTION__,__LINE__);
globals.panic = 1;
if (*woomera_socket > -1) {
woomera_close_socket(woomera_socket);
}
@ -2055,7 +2141,6 @@ static void *woomera_thread_run(void *obj)
break;
}
globals.panic = 1;
continue;
if (woomera_socket > -1) {
@ -2071,7 +2156,6 @@ static void *woomera_thread_run(void *obj)
&profile->event_queue
) < 0) {
ast_log(LOG_ERROR, "{%s} %s:%d HELP! Woomera is broken!\n", profile->name,__FUNCTION__,__LINE__);
globals.panic = 1;
woomera_close_socket(&woomera_socket);
}
}
@ -2105,7 +2189,7 @@ static void *woomera_thread_run(void *obj)
ast_log(LOG_NOTICE, "NEW INBOUND CALL %s!\n",wmsg.callid);
}
if ((inchan = woomera_new(type, WFORMAT, name, &cause))) {
if ((inchan = woomera_new(type, profile->coding, name, &cause, profile))) {
private_object *tech_pvt;
char *callid;
tech_pvt = inchan->tech_pvt;
@ -2350,6 +2434,8 @@ static int config_woomera(void)
}
}
strncpy(profile->name, entry, sizeof(profile->name) - 1);
profile->coding=AST_FORMAT_SLINEAR;
/*default is inbound and outbound enabled */
ast_set_flag(profile, PFLAG_INBOUND | PFLAG_OUTBOUND);
for (v = ast_variable_browse(cfg, entry); v ; v = v->next) {
@ -2586,27 +2672,30 @@ static int connect_woomera(int *new_socket, woomera_profile *profile, int flags)
woomera_message_header(&wmsg, "Version"),
sizeof(smgversion)-1);
}
audio_format = woomera_message_header(&wmsg, "Raw-Format");
if (!audio_format) {
audio_format = woomera_message_header(&wmsg, "Raw-Audio-Format");
}
if (audio_format) {
profile->coding=AST_FORMAT_SLINEAR;
if (strncmp(audio_format,"PMC-16",20) == 0){
if (strncasecmp(audio_format,"PCM-16",20) == 0){
profile->coding=AST_FORMAT_SLINEAR;
} else if (strncmp(audio_format,"ULAW",15) == 0) {
} else if (strncasecmp(audio_format,"ULAW",15) == 0) {
profile->coding=AST_FORMAT_ULAW;
} else if (strncmp(audio_format,"ALAW",15) == 0) {
} else if (strncasecmp(audio_format,"ALAW",15) == 0) {
profile->coding=AST_FORMAT_ALAW;
} else {
ast_log(LOG_ERROR, "Error: Invalid Raw-Format %s\n",
audio_format);
}
default_profile.coding=profile->coding;
if (globals.debug > 2) {
ast_log(LOG_NOTICE, "Setting RAW Format to %s %i\n",
audio_format, default_profile.coding);
ast_log(LOG_NOTICE, "Setting RAW Format to %s %i (p%i:u%i:a%i)\n",
audio_format, profile->coding,
AST_FORMAT_SLINEAR,AST_FORMAT_ULAW,AST_FORMAT_ALAW);
}
}
}
@ -2648,11 +2737,10 @@ static int init_woomera(void)
return 1;
}
static struct ast_channel *woomera_new(const char *type, int format, void *data, int *cause)
static struct ast_channel *woomera_new(const char *type, int format, void *data, int *cause, woomera_profile *parent_profile)
{
private_object *tech_pvt;
struct ast_channel *chan = NULL;
woomera_profile *profile=NULL;;
if ((chan = ast_channel_alloc(1))) {
chan->nativeformats = WFORMAT;
@ -2685,63 +2773,11 @@ static struct ast_channel *woomera_new(const char *type, int format, void *data,
tech_pvt->owner = chan;
profile = ASTOBJ_CONTAINER_FIND(&woomera_profile_list, "default");
if (profile) {
tech_pvt->coding = profile->coding;
chan->nativeformats = profile->coding;
chan->writeformat = chan->rawwriteformat = chan->readformat = profile->coding;
tech_pvt->frame.subclass = profile->coding;
}
if (profile && profile->dtmf_enable) {
tech_pvt->dsp_features=0;
tech_pvt->dsp = ast_dsp_new();
if (tech_pvt->dsp) {
#if 0
i->dsp_features = features & ~DSP_PROGRESS_TALK;
/* We cannot do progress detection until receives PROGRESS message */
if (i->outgoing && (i->sig == SIG_PRI)) {
/* Remember requested DSP features, don't treat
talking as ANSWER */
features = 0;
}
#endif
tech_pvt->dsp_features |= DSP_FEATURE_DTMF_DETECT;
//tech_pvt->dsp_features |= DSP_FEATURE_BUSY_DETECT;
//tech_pvt->dsp_features |= DSP_FEATURE_CALL_PROGRESS;
//tech_pvt->dsp_features |= DSP_FEATURE_FAX_DETECT;
ast_dsp_set_features(tech_pvt->dsp, tech_pvt->dsp_features);
ast_dsp_digitmode(tech_pvt->dsp, DSP_DIGITMODE_DTMF | DSP_DIGITMODE_RELAXDTMF);
tech_pvt->ast_dsp=1;
#if 0
if (!ast_strlen_zero(progzone))
ast_dsp_set_call_progress_zone(tech_pvt->dsp, progzone);
if (i->busydetect && CANBUSYDETECT(i)) {
ast_dsp_set_busy_count(tech_pvt->dsp, i->busycount);
ast_dsp_set_busy_pattern(tech_pvt->dsp, i->busy_tonelength, i->busy_quietlength);
}
#endif
}
}
if (profile && profile->faxdetect) {
tech_pvt->faxdetect=1;
}
if (profile && profile->jb_enable) {
#ifdef AST_JB
/* Assign default jb conf to the new zt_pvt */
memcpy(&tech_pvt->jbconf, &global_jbconf, sizeof(struct ast_jb_conf));
ast_jb_configure(chan, &tech_pvt->jbconf);
#else
ast_log(LOG_ERROR, "Asterisk Jitter Buffer Not Compiled!\n");
#endif
}
chan->nativeformats = tech_pvt->coding;
chan->writeformat = chan->rawwriteformat = chan->readformat = tech_pvt->coding;
tech_pvt->frame.subclass = tech_pvt->coding;
ASTOBJ_CONTAINER_LINK(&private_object_list, tech_pvt);
ast_mutex_lock(&usecnt_lock);
@ -2779,7 +2815,7 @@ static struct ast_channel *tech_requester(const char *type, int format, void *da
return NULL;
}
if ((chan = woomera_new(type, format, data, cause))) {
if ((chan = woomera_new(type, format, data, cause, NULL))) {
private_object *tech_pvt;
tech_pvt = chan->tech_pvt;
@ -2850,10 +2886,11 @@ static int tech_call(struct ast_channel *self, char *dest, int timeout)
goto tech_call_failed;
}
if (globals.debug > 2) {
ast_log(LOG_NOTICE, "TECH CALL %s (%s <%s>) (%p)\n",
ast_log(LOG_NOTICE, "TECH CALL %s (%s <%s>) pres=0x%02X dest=%s\n",
self->name, self->cid.cid_name,
self->cid.cid_num,
tech_pvt);
self->cid.cid_pres,
dest);
}
if (self->cid.cid_name) {
strncpy(tech_pvt->cid_name, self->cid.cid_name, sizeof(tech_pvt->cid_name)-1);
@ -2871,7 +2908,11 @@ static int tech_call(struct ast_channel *self, char *dest, int timeout)
if ((workspace = ast_strdupa(dest))) {
char *addr, *profile_name, *proto=NULL;
woomera_profile *profile;
int isprofile = 0, err;
int err;
#if 0
int isprofile = 0;
if ((addr = strchr(workspace, ':'))) {
char *tst;
@ -2885,14 +2926,30 @@ static int tech_call(struct ast_channel *self, char *dest, int timeout)
proto = NULL;
addr = workspace;
}
if ((profile_name = strchr(addr, '*'))) {
if ((profile_name = strchr(addr, ':'))) {
*profile_name = '\0';
profile_name++;
isprofile = 1;
} else {
profile_name = "default";
}
#else
profile_name = "default";
proto = NULL;
if ((addr = strchr(workspace, ':'))) {
profile_name = workspace;
proto=profile_name;
*addr = '\0';
addr++;
} else {
addr = workspace;
}
#endif
if (! (profile = ASTOBJ_CONTAINER_FIND(&woomera_profile_list, profile_name))) {
profile = ASTOBJ_CONTAINER_FIND(&woomera_profile_list, "default");
@ -2902,7 +2959,7 @@ static int tech_call(struct ast_channel *self, char *dest, int timeout)
ast_log(LOG_ERROR, "Unable to find profile! Call Aborted!\n");
goto tech_call_failed;
}
if (!ast_test_flag(profile, PFLAG_OUTBOUND)) {
ast_log(LOG_ERROR, "This profile is not allowed to make outbound calls! Call Aborted!\n");
goto tech_call_failed;
@ -2924,6 +2981,16 @@ static int tech_call(struct ast_channel *self, char *dest, int timeout)
snprintf(tech_pvt->dest, sizeof(tech_pvt->dest), "%s", addr ? addr : "");
snprintf(tech_pvt->proto, sizeof(tech_pvt->proto), "%s", proto ? proto : "");
if (globals.debug > 2) {
ast_log(LOG_NOTICE, "TECH CALL: proto=%s addr=%s profile=%s Coding=%i\n",
proto,addr,profile_name,profile->coding);
}
tech_pvt->coding = profile->coding;
self->nativeformats = tech_pvt->coding;
self->writeformat = self->rawwriteformat = self->readformat = tech_pvt->coding;
tech_pvt->frame.subclass = tech_pvt->coding;
tech_pvt->timeout = timeout;
err=tech_init(tech_pvt, profile, TFLAG_OUTBOUND);
if (err) {
@ -3149,6 +3216,7 @@ static struct ast_frame *tech_read(struct ast_channel *self)
{
private_object *tech_pvt = self->tech_pvt;
int res = 0;
struct ast_frame *f;
if (!tech_pvt || globals.panic || ast_test_flag(tech_pvt, TFLAG_ABORT)) {
@ -3172,34 +3240,46 @@ tech_read_again:
return NULL;
}
tech_pvt->frame.datalen = res;
if (tech_pvt->coding == AST_FORMAT_SLINEAR) {
tech_pvt->frame.samples = res / 2;
} else {
tech_pvt->frame.samples = res;
}
tech_pvt->frame.data = tech_pvt->fdata + AST_FRIENDLY_OFFSET;
tech_pvt->frame.frametype = AST_FRAME_VOICE;
tech_pvt->frame.subclass = tech_pvt->coding;
tech_pvt->frame.offset = AST_FRIENDLY_OFFSET;
tech_pvt->frame.datalen = res;
tech_pvt->frame.samples = res;
tech_pvt->frame.data = tech_pvt->fdata + AST_FRIENDLY_OFFSET;
if (default_profile.rxgain_val) {
f=&tech_pvt->frame;
if (tech_pvt->profile->rxgain_val) {
int i;
unsigned char *data=tech_pvt->frame.data;
for (i=0;i<tech_pvt->frame.datalen;i++) {
data[i]=default_profile.rxgain[data[i]];
data[i]=tech_pvt->profile->rxgain[data[i]];
}
}
if (tech_pvt->faxdetect || tech_pvt->ast_dsp ) {
woomera_tx2ast_frm(tech_pvt, tech_pvt->frame.data, tech_pvt->frame.datalen);
if (tech_pvt->owner && (tech_pvt->faxdetect || tech_pvt->ast_dsp)) {
f = ast_dsp_process(tech_pvt->owner, tech_pvt->dsp, &tech_pvt->frame);
if (f && f->frametype == AST_FRAME_DTMF){
if (globals.debug > 2) {
ast_log(LOG_NOTICE, "%s: Detected inband DTMF digit: %c\n",
self->name,
f->subclass);
}
}
//woomera_tx2ast_frm(tech_pvt, tech_pvt->frame.data, tech_pvt->frame.datalen);
}
if (globals.debug > 4) {
if (option_verbose > 2) {
ast_verbose(WOOMERA_DEBUG_PREFIX "+++READ %s %d\n",self->name, res);
ast_verbose(WOOMERA_DEBUG_PREFIX "+++READ %s %d coding %d\n",self->name, res,
tech_pvt->coding);
}
}
return &tech_pvt->frame;
return f;
}
/*--- tech_write: Write an audio frame to my channel
@ -3220,10 +3300,10 @@ static int tech_write(struct ast_channel *self, struct ast_frame *frame)
if(ast_test_flag(tech_pvt, TFLAG_MEDIA) && frame->datalen) {
if (frame->frametype == AST_FRAME_VOICE) {
if (default_profile.txgain_val) {
if (tech_pvt->profile->txgain_val) {
unsigned char *data=frame->data;
for (i=0;i<frame->datalen;i++) {
data[i]=default_profile.txgain[data[i]];
data[i]=tech_pvt->profile->txgain[data[i]];
}
}
@ -3237,6 +3317,8 @@ static int tech_write(struct ast_channel *self, struct ast_frame *frame)
ast_verbose(WOOMERA_DEBUG_PREFIX "+++WRITE %s %d\n",self->name, i);
}
}
} else {
ast_log(LOG_WARNING, "Invalid frame type %d sent\n", frame->frametype);
}
@ -3405,79 +3487,111 @@ static enum ast_bridge_result tech_bridge(struct ast_channel *c0, struct ast_cha
static int woomera_cli(int fd, int argc, char *argv[])
{
if (argc > 1) {
struct woomera_profile *profile;
char *profile_name="default";
if (argc > 2) {
profile_name=argv[1];
profile = ASTOBJ_CONTAINER_FIND(&woomera_profile_list, profile_name);
if (!profile) {
ast_cli(fd, "Woomera: Invalid profile name %s\n", profile_name);
return 0;
}
if (!strcmp(argv[1], "debug")) {
if (argc > 2) {
globals.debug = atoi(argv[2]);
if (!strcmp(argv[2], "debug")) {
if (argc > 3) {
globals.debug = atoi(argv[3]);
}
ast_cli(fd, "Woomera debug=%d\n", globals.debug);
} else if (!strcmp(argv[1], "call_status")) {
ast_cli(fd, "Woomera calls=%d tcalls=%d (out=%d in=%d ok=%d end=%d abort=%d)\n",
default_profile.call_count,
default_profile.call_out+default_profile.call_in,
default_profile.call_out,
default_profile.call_in,
default_profile.call_ok,
default_profile.call_end,
default_profile.call_abort);
} else if (!strcmp(argv[1], "version")) {
} else if (!strcmp(argv[2], "coding")) {
switch (profile->coding) {
case AST_FORMAT_ALAW:
ast_cli(fd, " Woomera {%s} coding=ALAW\n",profile_name);
break;
case AST_FORMAT_ULAW:
ast_cli(fd, " Woomera {%s} coding=ULAW\n",profile_name);
break;
case AST_FORMAT_SLINEAR:
ast_cli(fd, " Woomera {%s} coding=PMC-16\n",profile_name);
break;
default:
ast_cli(fd, " Woomera {%s} invalid coding=%d {internal error}",
profile_name,profile->coding);
break;
}
} else if (!strcmp(argv[2], "call_status")) {
ast_cli(fd, "Woomera {%s} calls=%d tcalls=%d (out=%d in=%d ok=%d end=%d abort=%d)\n",
profile->name,
profile->call_count,
profile->call_out+profile->call_in,
profile->call_out,
profile->call_in,
profile->call_ok,
profile->call_end,
profile->call_abort);
} else if (!strcmp(argv[2], "version")) {
ast_cli(fd, "Woomera version %s : SMG Version %s \n",
WOOMERA_VERSION,smgversion);
} else if (!strcmp(argv[1], "panic")) {
if (argc > 2) {
globals.panic = atoi(argv[2]);
} else if (!strcmp(argv[2], "panic")) {
if (argc > 3) {
globals.panic = atoi(argv[3]);
}
ast_cli(fd, "Woomera panic=%d \n", globals.panic);
} else if (!strcmp(argv[1], "rxgain")) {
} else if (!strcmp(argv[2], "rxgain")) {
float gain;
if (argc > 2) {
if (sscanf(argv[2], "%f", &gain) != 1) {
ast_cli(fd, "Woomera Invalid rxgain: %s\n",argv[2]);
if (argc > 3) {
if (sscanf(argv[3], "%f", &gain) != 1) {
ast_cli(fd, "Woomera Invalid rxgain: %s\n",argv[3]);
} else {
woomera_config_gain(&default_profile,gain,1);
woomera_config_gain(profile,gain,1);
}
}
ast_cli(fd, "Woomera rxgain: %f\n",default_profile.rxgain_val);
ast_cli(fd, "Woomera {%s} rxgain: %f\n",profile_name,profile->rxgain_val);
} else if (!strcmp(argv[1], "txgain")) {
} else if (!strcmp(argv[2], "txgain")) {
float gain;
if (argc > 2) {
if (sscanf(argv[2], "%f", &gain) != 1) {
ast_cli(fd, "Woomera Invalid txgain: %s\n",argv[2]);
if (argc > 3) {
if (sscanf(argv[3], "%f", &gain) != 1) {
ast_cli(fd, "Woomera Invalid txgain: %s\n",argv[3]);
} else {
woomera_config_gain(&default_profile,gain,0);
woomera_config_gain(profile,gain,0);
}
}
ast_cli(fd, "Woomera txgain: %f\n",default_profile.txgain_val);
ast_cli(fd, "Woomera {%s} txgain: %f\n",profile_name,profile->txgain_val);
} else if (!strcmp(argv[1], "threads")) {
ast_cli(fd, "chan_woomera is using %s threads!\n", globals.more_threads ? "more" : "less");
} else if (!strcmp(argv[2], "threads")) {
ast_cli(fd, "chan_woomera is using %s threads!\n",
globals.more_threads ? "more" : "less");
} else if (!strcmp(argv[1], "smgdebug")) {
} else if (!strcmp(argv[2], "smgdebug")) {
if (argc > 2) {
int smgdebug;
if (sscanf(argv[2], "%d", &smgdebug) != 1) {
ast_cli(fd, "Woomera Invalid smgdebug level: %s\n",argv[2]);
if (sscanf(argv[3], "%d", &smgdebug) != 1) {
ast_cli(fd, "Woomera Invalid smgdebug level: %s\n",argv[3]);
} else {
woomera_printf(NULL, default_profile.woomera_socket , "debug %d%s",
woomera_printf(NULL, profile->woomera_socket , "debug %d%s",
smgdebug,
WOOMERA_RECORD_SEPARATOR);
}
}
} else if (!strcmp(argv[1], "abort")) {
} else if (!strcmp(argv[2], "abort")) {
global_set_flag(TFLAG_ABORT);
}
} else {
ast_cli(fd, "Usage: woomera <debug> <level>\n");
ast_cli(fd, "Usage: woomera <profile> <cmd> <option>\n");
}
return 0;
}
@ -3633,6 +3747,7 @@ static int woomera_event_media (private_object *tech_pvt, woomera_message *wmsg)
{
char *raw_audio_header;
char *audio_codec;
char ip[25];
char *ptr;
int port = 0;
@ -3655,14 +3770,33 @@ static int woomera_event_media (private_object *tech_pvt, woomera_message *wmsg)
*ptr = '\0';
ptr++;
port = atoi(ptr);
} else if ((ptr=strchr(ip, ':'))) {
*ptr = '\0';
ptr++;
port = atoi(ptr);
}
#if 0
audio_codec = woomera_message_header(wmsg, "Receive-Audio-Codec");
if (audio_codec) {
if (!strcasecmp(audio_codec,"G.711-uLaw-64k")) {
tech_pvt->coding=AST_FORMAT_ULAW;
ast_log(LOG_NOTICE, "MEDIA GOT ULAW\n");
} else if (!strcasecmp(audio_codec,"G.711-aLaw-64k")) {
tech_pvt->coding=AST_FORMAT_ALAW;
ast_log(LOG_NOTICE, "MEDIA GOT ALAW\n");
}
}
#endif
/* Sanity Check */
owner = tech_get_owner(tech_pvt);
if (!owner) {
return -1;
}
/* If we are already in MEDIA mode then
* ignore this message */
if (ast_test_flag(tech_pvt, TFLAG_MEDIA)) {
@ -3734,6 +3868,7 @@ static int woomera_event_incoming (private_object *tech_pvt)
char *cid_rdnis;
char *tg_string="1";
char *pres_string;
char *screen_string;
int validext;
int presentation=0;
woomera_message wmsg;
@ -3768,10 +3903,13 @@ static int woomera_event_incoming (private_object *tech_pvt)
}
pres_string = woomera_message_header(&wmsg, "Presentation");
if (!pres_string || ast_strlen_zero(pres_string)) {
presentation=0;
} else {
presentation = atoi(pres_string);
if (pres_string && !ast_strlen_zero(pres_string)) {
presentation |= ( atoi(pres_string) << 5) & 0xF0;
}
screen_string = woomera_message_header(&wmsg, "Screening");
if (screen_string && !ast_strlen_zero(screen_string)) {
presentation |= atoi(screen_string) & 0x0F;
}
cid_name = ast_strdupa(woomera_message_header(&wmsg, "Remote-Name"));
@ -3807,12 +3945,12 @@ static int woomera_event_incoming (private_object *tech_pvt)
1,
owner->cid.cid_num);
if (globals.debug > 3){
ast_log(LOG_NOTICE, "Incoming Call exten %s@%s called %s pres = %d!\n",
if (globals.debug > 2){
ast_log(LOG_NOTICE, "Incoming Call exten %s@%s called %s astpres = 0x%0X!\n",
exten,
owner->context,
tech_pvt->callid,
presentation);
owner->cid.cid_pres);
}
} else {

View File

@ -65,7 +65,6 @@ echo "Checking logrotate ..."
eval "type logrotate" > /dev/null 2> /dev/null
if [ $? -ne 0 ]; then
echo "Error: Logrotate not found !"
exit 1;
fi
if [ -e /etc/logrotate.d ] && [ -e /etc/logrotate.d/syslog ]; then
@ -86,12 +85,20 @@ if [ -e /etc/logrotate.d ] && [ -e /etc/logrotate.d/syslog ]; then
else
echo "Error: Logrotate dir: /etc/logrotate.d not found !"
exit 1;
fi
echo "OK."
echo
echo "Checking for SCTP...."
if [ ! -e /usr/include/netinet/sctp.h ]; then
echo "Please install SCTP devel package: yum install lksctp-tools-devel"
echo
exit 1
fi
echo "OK."
echo
echo "Compiling Sangoma MGD ..."
make clean
make
@ -103,7 +110,18 @@ echo "Ok."
echo "Compiling Woomera Channel ..."
cp -f g711.h /usr/src/asterisk
if [ ! -e /usr/src/asterisk ]; then
echo
echo "Error: /usr/src/asterisk directory does not exist!"
echo " Please create symlink /usr/src/asterisk and"
echo " point to existing asterisk source!"
echo " Then re run ./install.sh "
echo
exit 1
fi
cp -f g711.h /usr/src/asterisk/
perl /usr/src/asterisk/contrib/scripts/astxs -install chan_woomera.c
if [ $? -ne 0 ]; then
exit 1;

View File

@ -31,6 +31,7 @@ fi
cd /usr/local/ss7box
./$ss7boost --term
sleep 1
#eval "$NICE ./$ss7boost --hb"
eval "$NICE ./$ss7boost"
sleep 5
@ -55,6 +56,7 @@ fi
cd $home
#exit 0;
if [ 1 -eq 0 ]; then
ulimit -n 65536

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,576 @@
/*********************************************************************************
* sangoma_mgd.h -- Sangoma Media Gateway Daemon for Sangoma/Wanpipe Cards
*
* Copyright 05-07, Nenad Corbic <ncorbic@sangoma.com>
* Anthony Minessale II <anthmct@yahoo.com>
*
* This program is free software, distributed under the terms of
* the GNU General Public License
*
* =============================================*/
#ifndef __SANGOMA_MGD_H_
#define __SANGOMA_MGD_H_
#include <string.h>
#include <stdarg.h>
#include <stdlib.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <netdb.h>
#include <stdio.h>
#include <unistd.h>
#include <fcntl.h>
#include <sys/time.h>
#include <poll.h>
#include <signal.h>
#include <pthread.h>
#include <netinet/tcp.h>
#include <libsangoma.h>
#include <assert.h>
#include <call_signal.h>
#include <sys/mman.h>
#include <syslog.h>
#include <g711.h>
#ifdef __LINUX__
#include <sys/prctl.h>
#endif
/* Enable DTMF encoding by default */
#ifndef SMG_DTMF_ENABLE
#define SMG_DTMF_ENABLE 1
#endif
#ifdef SMG_DTMF_ENABLE
#include <libteletone.h>
#include <switch_buffer.h>
#endif
#define WOOMERA_MAX_SPAN 16
#define WOOMERA_MAX_CHAN 31
#define PIDFILE "/var/run/sangoma_mgd.pid"
#define CORE_EVENT_LEN 512
#define WOOMERA_STRLEN 256
#define WOOMERA_ARRAY_LEN 50
#define WOOMERA_BODYLEN 2048
#define WOOMERA_MIN_MEDIA_PORT 9000
#define WOOMERA_MAX_MEDIA_PORT 9899
#define WOOMERA_HARD_TIMEOUT 0
#define WOOMERA_LINE_SEPERATOR "\r\n"
#define WOOMERA_RECORD_SEPERATOR "\r\n\r\n"
#define WOOMERA_DEBUG_PREFIX "[DEBUG] "
#define WOOMERA_DEBUG_LINE "------------------------------------------------------------------------------------------------"
#define STDERR fileno(stderr)
#define MAXPENDING 500
#define MGD_STACK_SIZE 1024 * 240
typedef enum {
WFLAG_RUNNING = (1 << 0),
WFLAG_LISTENING = (1 << 1),
WFLAG_MASTER_DEV = (1 << 2),
WFLAG_EVENT = (1 << 3),
WFLAG_MALLOC = (1 << 4),
WFLAG_MEDIA_RUNNING = (1 << 5),
WFLAG_MEDIA_END = (1 << 6),
WFLAG_MONITOR_RUNNING = (1 << 7),
WFLAG_HANGUP = (1 << 8),
WFLAG_ANSWER = (1 << 9),
WFLAG_MEDIA_TDM_RUNNING = (1 << 10),
WFLAG_HANGUP_ACK = (1 << 11),
WFLAG_HANGUP_NACK_ACK = (1 << 12),
WFLAG_WAIT_FOR_NACK_ACK = (1 << 13),
WFLAG_WAIT_FOR_STOPPED_ACK = (1 << 14),
WFLAG_RAW_MEDIA_STARTED = (1 << 15),
} WFLAGS;
typedef enum {
MFLAG_EXISTS = (1 << 0),
MFLAG_CONTENT = (1 << 1),
} MFLAGS;
typedef enum {
EVENT_FREE_DATA = 1,
EVENT_KEEP_DATA = 0
} event_args;
void __log_printf(int level, FILE *fp, char *file, const char *func, int line, char *fmt, ...);
#define ysleep(usec) sched_yield() ; usleep(usec);
#define log_printf(level, fp, fmt, ...) __log_printf(level, fp, __FILE__, __FUNCTION__, __LINE__, fmt, ##__VA_ARGS__)
#define woomera_test_flag(p,flag) ({ \
((p)->flags & (flag)); \
})
#define _woomera_set_flag(p,flag) do { \
((p)->flags |= (flag)); \
} while (0)
#define _woomera_clear_flag(p,flag) do { \
((p)->flags &= ~(flag)); \
} while (0)
#define woomera_set_flag(p,flag) do { \
pthread_mutex_lock(&(p)->flags_lock); \
((p)->flags |= (flag)); \
pthread_mutex_unlock(&(p)->flags_lock); \
} while (0)
#define woomera_clear_flag(p,flag) do { \
pthread_mutex_lock(&(p)->flags_lock); \
((p)->flags &= ~(flag)); \
pthread_mutex_unlock(&(p)->flags_lock); \
} while (0)
#define woomera_copy_flags(dest,src,flagz) do { \
pthread_mutex_lock(&(p)->flags_lock); \
(dest)->flags &= ~(flagz); \
(dest)->flags |= ((src)->flags & (flagz)); \
pthread_mutex_unlock(&(p)->flags_lock); \
} while (0)
struct media_session {
int span;
int chan;
int udp_sock;
int sangoma_sock;
char *ip;
int port;
time_t started;
time_t answered;
pthread_t thread;
int socket;
struct woomera_interface *woomera;
struct sockaddr_in local_addr;
struct sockaddr_in remote_addr;
struct hostent remote_hp;
struct hostent local_hp;
int skip_read_frames;
int skip_write_frames;
int hw_coding;
int udp_sync_cnt;
#ifdef WP_HPTDM_API
hp_tdm_api_chan_t *tdmchan;
#endif
#ifdef SMG_DTMF_ENABLE
teletone_dtmf_detect_state_t dtmf_detect;
teletone_generation_session_t tone_session;
switch_buffer_t *dtmf_buffer;
#endif
};
struct woomera_message {
char callid[WOOMERA_STRLEN];
char command[WOOMERA_STRLEN];
char command_args[WOOMERA_STRLEN];
char names[WOOMERA_STRLEN][WOOMERA_ARRAY_LEN];
char values[WOOMERA_STRLEN][WOOMERA_ARRAY_LEN];
char body[WOOMERA_BODYLEN];
uint32_t flags;
pthread_mutex_t flags_lock;
int last;
struct woomera_message *next;
};
struct woomera_event {
char *data;
uint32_t flags;
struct woomera_event *next;
};
struct woomera_listener {
struct woomera_interface *woomera;
struct woomera_listener *next;
};
struct woomera_interface {
int socket;
char *raw;
char *interface;
time_t timeout;
struct sockaddr_in addr;
struct media_session *ms;
pthread_mutex_t queue_lock;
pthread_mutex_t ms_lock;
pthread_mutex_t dtmf_lock;
struct woomera_event *event_queue;
struct woomera_event *incoming_event_queue;
pthread_t thread;
uint32_t flags;
pthread_mutex_t flags_lock;
int debug;
int call_id;
char *cause;
FILE *log;
pthread_mutex_t vlock;
int index;
int index_hold;
int span;
int chan;
int call_count;
char *sig_cause;
int loop_tdm;
struct woomera_interface *next;
};
#define CORE_TANK_LEN CORE_MAX_CHAN_PER_SPAN*CORE_MAX_SPANS
struct woomera_server {
struct woomera_interface *process_table[CORE_MAX_CHAN_PER_SPAN][CORE_MAX_SPANS];
struct woomera_interface *holding_tank[CORE_TANK_LEN];
int holding_tank_index;
struct woomera_interface master_connection;
pthread_mutex_t listen_lock;
pthread_mutex_t ht_lock;
pthread_mutex_t process_lock;
pthread_mutex_t media_udp_port_lock;
pthread_mutex_t thread_count_lock;
call_signal_connection_t mcon;
call_signal_connection_t mconp;
struct woomera_listener *listeners;
char media_ip[WOOMERA_STRLEN];
int port;
int next_media_port;
int debug;
int panic;
int thread_count;
char *logfile_path;
FILE *log;
char boost_local_ip[25];
int boost_local_port;
char boost_remote_ip[25];
int boost_remote_port;
pthread_t monitor_thread;
char *config_file;
int max_calls;
int call_count;
uint32_t out_tx_test;
uint32_t rxgain;
uint32_t txgain;
uint32_t hw_coding;
uint32_t loop_trace;
uint32_t hungup_waiting;
int all_ckt_gap;
int all_ckt_busy;
struct timeval all_ckt_busy_time;
} server;
struct woomera_config {
FILE *file;
char *path;
char category[256];
char buf[1024];
int lineno;
};
static inline void smg_get_current_priority(int *policy, int *priority)
{
struct sched_param param;
pthread_getschedparam(pthread_self(), policy, &param);
*priority = param.sched_priority;
return;
}
static inline int smg_calc_elapsed(struct timeval *started, struct timeval *ended)
{
return (((ended->tv_sec * 1000) + ended->tv_usec / 1000) -
((started->tv_sec * 1000) + started->tv_usec / 1000));
}
static inline int smg_check_all_busy(void)
{
struct timeval ended;
int elapsed;
if (server.all_ckt_gap) {
return server.all_ckt_gap;
}
if (server.all_ckt_busy==0) {
return 0;
}
gettimeofday(&ended,NULL);
elapsed = smg_calc_elapsed(&server.all_ckt_busy_time,&ended);
/* seconds elapsed */
if (elapsed > server.all_ckt_busy) {
server.all_ckt_busy=0;
return 0;
} else {
return 1;
}
#if 0
if (server.all_ckt_busy > 50) {
/* When in GAP mode wait 10s */
return server.all_ckt_busy;
}
--server.all_ckt_busy;
if (server.all_ckt_busy < 0) {
server.all_ckt_busy=0;
}
return server.all_ckt_busy;
#endif
}
static inline void smg_all_ckt_busy(void)
{
server.all_ckt_busy+=1000;
#if 0
if (server.all_ckt_busy >= 5) {
server.all_ckt_busy=10;
} else if (server.all_ckt_busy >= 10) {
server.all_ckt_busy=15;
} else if (server.all_ckt_busy == 0) {
server.all_ckt_busy=5;
}
#endif
gettimeofday(&server.all_ckt_busy_time,NULL);
}
static inline void smg_all_ckt_gap(void)
{
server.all_ckt_gap=1;
}
static inline void smg_clear_ckt_gap(void)
{
server.all_ckt_gap=0;
gettimeofday(&server.all_ckt_busy_time,NULL);
}
static inline int smg_validate_span_chan(int span, int chan)
{
if (span < 0 || span > WOOMERA_MAX_SPAN) {
return -1;
}
if (chan < 0 || chan > WOOMERA_MAX_CHAN) {
return -1;
}
return 0;
}
static inline void close_socket(int *sp)
{
if (*sp > -1) {
close(*sp);
*sp = -1;
}
}
static inline FILE *safe_fopen(char *path, char *flags)
{
char buf[512] = "";
if (readlink(path, buf, sizeof(buf)) > 0) {
fprintf(stderr, "Symlinks not allowed! [%s] != [%s]\n", buf, path);
return NULL;
}
return fopen(path, flags);
}
static inline int get_pid_from_file(char *path)
{
FILE *tmp;
int pid;
if (!(tmp = safe_fopen(path, "r"))) {
return 0;
} else {
fscanf(tmp, "%d", &pid);
fclose(tmp);
tmp = NULL;
}
return pid;
}
static inline int woomera_open_file(struct woomera_config *cfg, char *path)
{
FILE *f;
if (!(f = fopen(path, "r"))) {
log_printf(0, stderr, "Cannot open file %s\n", path);
return 0;
}
memset(cfg, 0, sizeof(*cfg));
cfg->file = f;
cfg->path = path;
return 1;
}
static inline void woomera_close_file(struct woomera_config *cfg)
{
if (cfg->file) {
fclose(cfg->file);
}
memset(cfg, 0, sizeof(*cfg));
}
static inline void woomera_message_init (struct woomera_message *wmsg)
{
memset (wmsg,0,sizeof(struct woomera_message));
pthread_mutex_init(&wmsg->flags_lock, NULL);
}
static inline void woomera_message_clear (struct woomera_message *wmsg)
{
pthread_mutex_destroy(&wmsg->flags_lock);
}
static inline void woomera_set_raw(struct woomera_interface *woomera, char *raw)
{
if (woomera->raw) {
free(woomera->raw);
woomera->raw = NULL;
}
if (raw) {
woomera->raw = strdup(raw);
}
}
static inline struct media_session * woomera_get_ms(struct woomera_interface *woomera)
{
struct media_session *ms;
pthread_mutex_lock(&woomera->ms_lock);
ms=woomera->ms;
pthread_mutex_unlock(&woomera->ms_lock);
return ms;
}
static inline void woomera_set_ms(struct woomera_interface *woomera,struct media_session *ms)
{
pthread_mutex_lock(&woomera->ms_lock);
woomera->ms=ms;
pthread_mutex_unlock(&woomera->ms_lock);
return;
}
static inline void woomera_set_interface(struct woomera_interface *woomera, char *interface)
{
if (woomera->interface) {
free(woomera->interface);
woomera->interface = NULL;
}
if (interface) {
woomera->interface = strdup(interface);
}
}
static inline void woomera_set_cause(struct woomera_interface *woomera, char *cause)
{
if (woomera->cause) {
free(woomera->cause);
woomera->cause = NULL;
}
if (cause) {
woomera->cause = strdup(cause);
}
}
static inline void woomera_set_sig_cause(struct woomera_interface *woomera, char *cause)
{
if (woomera->sig_cause) {
free(woomera->sig_cause);
woomera->sig_cause = NULL;
}
if (cause) {
woomera->sig_cause = strdup(cause);
}
}
static inline struct woomera_event *new_woomera_event(void)
{
struct woomera_event *event = NULL;
if ((event = malloc(sizeof(*event)))) {
memset(event, 0, sizeof(*event));
_woomera_set_flag(event, WFLAG_MALLOC);
}
return event;
}
static inline void destroy_woomera_event_data(struct woomera_event *event)
{
if (event->data) {
free (event->data);
event->data=NULL;
}
}
static inline void destroy_woomera_event(struct woomera_event **event, event_args free_data)
{
if (free_data) {
free ((*event)->data);
}
if (woomera_test_flag((*event), WFLAG_MALLOC)) {
free (*event);
*event = NULL;
}
}
/* disable nagle's algorythm */
static inline void no_nagle(int socket)
{
int flag = 1;
setsockopt(socket, IPPROTO_TCP, TCP_NODELAY, (char *) &flag, sizeof(int));
}
#endif

View File

@ -15,7 +15,7 @@
#define _SIGBOOST_H_
#include <stdint.h>
enum e_sigboost_event_id_values
{
SIGBOOST_EVENT_CALL_START = 0x80, /*128*/
@ -26,10 +26,11 @@ enum e_sigboost_event_id_values
SIGBOOST_EVENT_CALL_STOPPED = 0x85, /*133*/
SIGBOOST_EVENT_CALL_STOPPED_ACK = 0x86, /*134*/
SIGBOOST_EVENT_SYSTEM_RESTART = 0x87, /*135*/
SIGBOOST_EVENT_SYSTEM_RESTART_ACK = 0x88, /*139*/
SIGBOOST_EVENT_SYSTEM_RESTART_ACK = 0x88, /*139*/
SIGBOOST_EVENT_HEARTBEAT = 0x89, /*136*/
SIGBOOST_EVENT_INSERT_CHECK_LOOP = 0x8a, /*137*/
SIGBOOST_EVENT_REMOVE_CHECK_LOOP = 0x8b, /*138*/
SIGBOOST_EVENT_REMOVE_CHECK_LOOP = 0x8b, /*138*/
SIGBOOST_EVENT_AUTO_CALL_GAP_ABATE = 0x8c, /*140*/
};
enum e_sigboost_release_cause_values
@ -44,6 +45,7 @@ enum e_sigboost_release_cause_values
enum e_sigboost_call_setup_ack_nack_cause_values
{
SIGBOOST_CALL_SETUP_RESERVED = 0x00,
SIGBOOST_CALL_SETUP_CIRCUIT_RESET = 0x10,
SIGBOOST_CALL_SETUP_NACK_CKT_START_TIMEOUT = 0x11,
SIGBOOST_CALL_SETUP_NACK_ALL_CKTS_BUSY = 0x12,
@ -51,6 +53,7 @@ enum e_sigboost_call_setup_ack_nack_cause_values
SIGBOOST_CALL_SETUP_NACK_CALLING_NUM_TOO_BIG = 0x14,
SIGBOOST_CALL_SETUP_NACK_CALLED_NUM_TOO_SMALL = 0x15,
SIGBOOST_CALL_SETUP_NACK_CALLING_NUM_TOO_SMALL = 0x16,
SIGBOOST_CALL_SETUP_NACK_AUTO_CALL_GAP = 0x17,
};
#define MAX_DIALED_DIGITS 31
@ -67,20 +70,24 @@ enum e_sigboost_call_setup_ack_nack_cause_values
typedef struct
{
uint32_t event_id;
uint32_t seqno;
uint32_t call_setup_id;
uint32_t trunk_group;
uint32_t fseqno;
uint32_t bseqno;
uint16_t call_setup_id;
uint8_t trunk_group;
uint32_t span;
uint32_t chan;
uint32_t called_number_digits_count;
uint8_t called_number_digits_count;
int8_t called_number_digits [MAX_DIALED_DIGITS + 1]; /* it's a null terminated string */
uint32_t calling_number_digits_count; /* it's an array */
uint8_t calling_number_digits_count; /* it's an array */
int8_t calling_number_digits [MAX_DIALED_DIGITS + 1]; /* it's a null terminated string */
uint32_t release_cause;
uint8_t release_cause;
struct timeval tv;
/* ref. Q.931 Table 4-11 and Q.951 Section 3 */
uint32_t calling_number_presentation;
uint8_t calling_number_screening_ind;
uint8_t calling_number_presentation;
int8_t redirection_string [80]; /* it's a null terminated string */
/* redir string format:
* http://www.ss7box.com/wiki/tiki-index.php?page=Call+Redirection */
} t_sigboost;
#pragma pack()

View File

@ -24,126 +24,153 @@
* Contributor(s):
*
* Anthony Minessale II <anthmct@yahoo.com>
* Nenad Corbic <ncorbic@sangoma.com>
*
*
* switch_buffer.c -- Data Buffering Code
*
*/
#include <string.h>
#include <stdarg.h>
#include <stdlib.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <netdb.h>
#include <stdio.h>
#include <unistd.h>
#include <switch_buffer.h>
#include <pthread.h>
#include "sangoma_mgd.h"
#include "switch_buffer.h"
#ifndef assert
#define assert(_val_) if (!(_val_)) { return -1; }
#endif
static uint32_t buffer_id = 0;
static unsigned int buffer_id = 0;
typedef enum {
SWITCH_BUFFER_FLAG_DYNAMIC = (1 << 0)
} switch_buffer_flag_t;
int switch_buffer_free(switch_buffer_t *buffer)
SWITCH_DECLARE(switch_status_t) switch_buffer_create(switch_buffer_t **buffer, switch_size_t max_len)
{
if (buffer) {
if (buffer->data) {
free(buffer->data);
}
buffer->data=NULL;
pthread_mutex_destroy(&buffer->lock);
free(buffer);
buffer=NULL;
}
return 0;
}
int switch_buffer_create(switch_buffer_t **buffer, switch_size_t max_len)
{
switch_buffer_t *new_buffer=NULL;;
switch_buffer_t *new_buffer;
if ((new_buffer = malloc(sizeof(switch_buffer_t))) != 0
&& (new_buffer->data = malloc(max_len)) != 0) {
new_buffer->datalen = max_len;
new_buffer->id = buffer_id++;
new_buffer->head = new_buffer->data;
*buffer = new_buffer;
pthread_mutex_init(&new_buffer->lock, NULL);
switch_buffer_zero(new_buffer);
return 0;
return SWITCH_STATUS_SUCCESS;
}
switch_buffer_free(new_buffer);
return -1;
return SWITCH_STATUS_MEMERR;
}
int switch_buffer_len(switch_buffer_t *buffer)
SWITCH_DECLARE(switch_status_t)
switch_buffer_create_dynamic(switch_buffer_t **buffer, switch_size_t blocksize,
switch_size_t start_len, switch_size_t max_len)
{
switch_buffer_t *new_buffer;
if ((new_buffer = malloc(sizeof(*new_buffer)))) {
memset(new_buffer, 0, sizeof(*new_buffer));
if (start_len) {
if (!(new_buffer->data = malloc(start_len))) {
free(new_buffer);
return SWITCH_STATUS_MEMERR;
}
memset(new_buffer->data, 0, start_len);
}
new_buffer->max_len = max_len;
new_buffer->datalen = start_len;
new_buffer->id = buffer_id++;
new_buffer->blocksize = blocksize;
new_buffer->head = new_buffer->data;
switch_set_flag(new_buffer, SWITCH_BUFFER_FLAG_DYNAMIC);
*buffer = new_buffer;
return SWITCH_STATUS_SUCCESS;
}
return SWITCH_STATUS_MEMERR;
}
SWITCH_DECLARE(switch_size_t) switch_buffer_len(switch_buffer_t *buffer)
{
assert(buffer != NULL);
return buffer->datalen;
}
int switch_buffer_freespace(switch_buffer_t *buffer)
SWITCH_DECLARE(switch_size_t) switch_buffer_freespace(switch_buffer_t *buffer)
{
assert(buffer != NULL);
return (buffer->datalen - buffer->used);
if (switch_test_flag(buffer, SWITCH_BUFFER_FLAG_DYNAMIC)) {
if (buffer->max_len) {
return (switch_size_t) (buffer->max_len - buffer->used);
}
return 1000000;
}
return (switch_size_t) (buffer->datalen - buffer->used);
}
int switch_buffer_inuse(switch_buffer_t *buffer)
SWITCH_DECLARE(switch_size_t) switch_buffer_inuse(switch_buffer_t *buffer)
{
assert(buffer != NULL);
return buffer->used;
}
int switch_buffer_toss(switch_buffer_t *buffer, switch_size_t datalen)
SWITCH_DECLARE(switch_size_t) switch_buffer_toss(switch_buffer_t *buffer, switch_size_t datalen)
{
switch_size_t reading = 0;
assert(buffer != NULL);
pthread_mutex_lock(&buffer->lock);
if (buffer->used < 1) {
buffer->used = 0;
pthread_mutex_unlock(&buffer->lock);
return 0;
} else if (buffer->used >= datalen) {
reading = datalen;
} else {
reading = buffer->used;
}
memmove(buffer->data, buffer->data + reading, buffer->datalen - reading);
buffer->used -= datalen;
pthread_mutex_unlock(&buffer->lock);
return buffer->datalen;
buffer->used -= reading;
buffer->head += reading;
return buffer->used;
}
int switch_buffer_read(switch_buffer_t *buffer, void *data, switch_size_t datalen)
SWITCH_DECLARE(void) switch_buffer_set_loops(switch_buffer_t *buffer, int32_t loops)
{
buffer->loops = loops;
}
SWITCH_DECLARE(switch_size_t) switch_buffer_read_loop(switch_buffer_t *buffer, void *data, switch_size_t datalen)
{
switch_size_t len;
if ((len = switch_buffer_read(buffer, data, datalen)) == 0) {
if (buffer->loops == 0) {
return 0;
}
buffer->head = buffer->data;
buffer->used = buffer->actually_used;
len = switch_buffer_read(buffer, data, datalen);
buffer->loops--;
}
return len;
}
SWITCH_DECLARE(switch_size_t) switch_buffer_read(switch_buffer_t *buffer, void *data, switch_size_t datalen)
{
switch_size_t reading = 0;
assert(buffer != NULL);
assert(data != NULL);
pthread_mutex_lock(&buffer->lock);
if (buffer->used < 1) {
buffer->used = 0;
pthread_mutex_unlock(&buffer->lock);
return 0;
} else if (buffer->used >= datalen) {
reading = datalen;
@ -151,53 +178,102 @@ int switch_buffer_read(switch_buffer_t *buffer, void *data, switch_size_t datale
reading = buffer->used;
}
memcpy(data, buffer->data, reading);
memmove(buffer->data, buffer->data + reading, buffer->datalen - reading);
memcpy(data, buffer->head, reading);
buffer->used -= reading;
pthread_mutex_unlock(&buffer->lock);
#if 0
printf("BUFFER READ: USED %i Reading=%i\n",
buffer->used,reading);
#endif
buffer->head += reading;
/* if (buffer->id == 4) printf("%u o %d = %d\n", buffer->id, (uint32_t)reading, (uint32_t)buffer->used); */
return reading;
}
int switch_buffer_write(switch_buffer_t *buffer, void *data, switch_size_t datalen)
SWITCH_DECLARE(switch_size_t) switch_buffer_write(switch_buffer_t *buffer, const void *data, switch_size_t datalen)
{
switch_size_t freespace;
switch_size_t freespace, actual_freespace;
assert(buffer != NULL);
assert(data != NULL);
assert(buffer->data != NULL);
pthread_mutex_lock(&buffer->lock);
freespace = buffer->datalen - buffer->used;
if (freespace < datalen) {
pthread_mutex_unlock(&buffer->lock);
return 0;
} else {
memcpy(buffer->data + buffer->used, data, datalen);
buffer->used += datalen;
if (!datalen) {
return buffer->used;
}
pthread_mutex_unlock(&buffer->lock);
#if 0
printf("BUFFER WRITE: USED %i\n",buffer->used);
#endif
actual_freespace = buffer->datalen - buffer->actually_used;
if (actual_freespace < datalen) {
memmove(buffer->data, buffer->head, buffer->used);
buffer->head = buffer->data;
buffer->actually_used = buffer->used;
}
freespace = buffer->datalen - buffer->used;
/*
if (buffer->data != buffer->head) {
memmove(buffer->data, buffer->head, buffer->used);
buffer->head = buffer->data;
}
*/
if (switch_test_flag(buffer, SWITCH_BUFFER_FLAG_DYNAMIC)) {
if (freespace < datalen) {
switch_size_t new_size, new_block_size;
new_size = buffer->datalen + datalen;
new_block_size = buffer->datalen + buffer->blocksize;
if (new_block_size > new_size) {
new_size = new_block_size;
}
buffer->head = buffer->data;
if (!(buffer->data = realloc(buffer->data, new_size))) {
return 0;
}
buffer->head = buffer->data;
buffer->datalen = new_size;
}
}
freespace = buffer->datalen - buffer->used;
if (freespace < datalen) {
return 0;
} else {
memcpy(buffer->head + buffer->used, data, datalen);
buffer->used += datalen;
buffer->actually_used += datalen;
}
/* if (buffer->id == 4) printf("%u i %d = %d\n", buffer->id, (uint32_t)datalen, (uint32_t)buffer->used); */
return buffer->used;
}
int switch_buffer_zero(switch_buffer_t *buffer)
SWITCH_DECLARE(void) switch_buffer_zero(switch_buffer_t *buffer)
{
assert(buffer != NULL);
assert(buffer->data != NULL);
assert(buffer->data != NULL);
pthread_mutex_lock(&buffer->lock);
buffer->used = 0;
pthread_mutex_unlock(&buffer->lock);
return 0;
buffer->actually_used = 0;
buffer->head = buffer->data;
}
SWITCH_DECLARE(void) switch_buffer_destroy(switch_buffer_t **buffer)
{
if (*buffer) {
free((*buffer)->data);
free(*buffer);
}
*buffer = NULL;
}
/* For Emacs:
* Local Variables:
* mode:c
* indent-tabs-mode:t
* tab-width:4
* c-basic-offset:4
* End:
* For VIM:
* vim:set softtabstop=4 shiftwidth=4 tabstop=4 expandtab:
*/

View File

@ -38,6 +38,21 @@
#ifndef SMG_SWITCH_BUFFER_H
#define SMG_SWITCH_BUFFER_H
/*!
\brief Test for the existance of a flag on an arbitary object
\param obj the object to test
\param flag the or'd list of flags to test
\return true value if the object has the flags defined
*/
#define switch_test_flag(obj, flag) ((obj)->flags & flag)
/*!
\brief Set a flag on an arbitrary object
\param obj the object to set the flags on
\param flag the or'd list of flags to set
*/
#define switch_set_flag(obj, flag) (obj)->flags |= (flag)
/**
@ -49,17 +64,29 @@
* @{
*/
typedef struct switch_buffer {
unsigned char *data;
int used;
int datalen;
unsigned int id;
pthread_mutex_t lock;
}switch_buffer_t;
#define switch_size_t int
#define SWITCH_DECLARE(_var_) static _var_
#define switch_status_t int
#define SWITCH_DECLARE(_var_) _var_
#define SWITCH_STATUS_SUCCESS 0
#define SWITCH_STATUS_MEMERR -1
#define switch_byte_t unsigned char
#define switch_size_t int
#define switch_buffer_free switch_buffer_destroy
typedef struct switch_buffer {
switch_byte_t *data;
switch_byte_t *head;
switch_size_t used;
switch_size_t actually_used;
switch_size_t datalen;
switch_size_t max_len;
switch_size_t blocksize;
uint32_t flags;
uint32_t id;
int32_t loops;
}switch_buffer_t;
//#define assert(_cond_) if ((_cond_)) { printf("%s:%s: Assertion!\n"); return -EINVAL; }
@ -69,31 +96,34 @@ typedef struct switch_buffer {
* \param max_len length required by the buffer
* \return status
*/
int switch_buffer_create(switch_buffer_t **buffer, switch_size_t max_len);
SWITCH_DECLARE(switch_status_t) switch_buffer_create(switch_buffer_t **buffer, switch_size_t max_len);
/*! \brief Deallocate a switch_buffer
* \param buffer buffer pointer to be deallocated
/*! \brief Allocate a new dynamic switch_buffer
* \param buffer returned pointer to the new buffer
* \param blocksize length to realloc by as data is added
* \param start_len ammount of memory to reserve initially
* \param max_len length the buffer is allowed to grow to
* \return status
*/
int switch_buffer_free(switch_buffer_t *buffer);
SWITCH_DECLARE(switch_status_t) switch_buffer_create_dynamic(switch_buffer_t **buffer, switch_size_t blocksize, switch_size_t start_len, switch_size_t max_len);
/*! \brief Get the length of a switch_buffer_t
* \param buffer any buffer of type switch_buffer_t
* \return int size of the buffer.
*/
int switch_buffer_len(switch_buffer_t *buffer);
SWITCH_DECLARE(switch_size_t) switch_buffer_len(switch_buffer_t *buffer);
/*! \brief Get the freespace of a switch_buffer_t
* \param buffer any buffer of type switch_buffer_t
* \return int freespace in the buffer.
*/
int switch_buffer_freespace(switch_buffer_t *buffer);
SWITCH_DECLARE(switch_size_t) switch_buffer_freespace(switch_buffer_t *buffer);
/*! \brief Get the in use amount of a switch_buffer_t
* \param buffer any buffer of type switch_buffer_t
* \return int ammount of buffer curently in use
*/
int switch_buffer_inuse(switch_buffer_t *buffer);
SWITCH_DECLARE(switch_size_t) switch_buffer_inuse(switch_buffer_t *buffer);
/*! \brief Read data from a switch_buffer_t up to the ammount of datalen if it is available. Remove read data from buffer.
* \param buffer any buffer of type switch_buffer_t
@ -101,7 +131,22 @@ int switch_buffer_inuse(switch_buffer_t *buffer);
* \param datalen amount of data to be returned
* \return int ammount of data actually read
*/
int switch_buffer_read(switch_buffer_t *buffer, void *data, switch_size_t datalen);
SWITCH_DECLARE(switch_size_t) switch_buffer_read(switch_buffer_t *buffer, void *data, switch_size_t datalen);
/*! \brief Read data endlessly from a switch_buffer_t
* \param buffer any buffer of type switch_buffer_t
* \param data pointer to the read data to be returned
* \param datalen amount of data to be returned
* \return int ammount of data actually read
* \note Once you have read all the data from the buffer it will loop around.
*/
SWITCH_DECLARE(switch_size_t) switch_buffer_read_loop(switch_buffer_t *buffer, void *data, switch_size_t datalen);
/*! \brief Assign a number of loops to read
* \param buffer any buffer of type switch_buffer_t
* \param loops the number of loops (-1 for infinite)
*/
SWITCH_DECLARE(void) switch_buffer_set_loops(switch_buffer_t *buffer, int32_t loops);
/*! \brief Write data into a switch_buffer_t up to the length of datalen
* \param buffer any buffer of type switch_buffer_t
@ -109,20 +154,38 @@ int switch_buffer_read(switch_buffer_t *buffer, void *data, switch_size_t datale
* \param datalen amount of data to be written
* \return int amount of buffer used after the write, or 0 if no space available
*/
int switch_buffer_write(switch_buffer_t *buffer, void *data, switch_size_t datalen);
SWITCH_DECLARE(switch_size_t) switch_buffer_write(switch_buffer_t *buffer, const void *data, switch_size_t datalen);
/*! \brief Remove data from the buffer
* \param buffer any buffer of type switch_buffer_t
* \param datalen amount of data to be removed
* \return int size of buffer, or 0 if unable to toss that much data
*/
int switch_buffer_toss(switch_buffer_t *buffer, switch_size_t datalen);
SWITCH_DECLARE(switch_size_t) switch_buffer_toss(switch_buffer_t *buffer, switch_size_t datalen);
/*! \brief Remove all data from the buffer
* \param buffer any buffer of type switch_buffer_t
*/
int switch_buffer_zero(switch_buffer_t *buffer);
SWITCH_DECLARE(void) switch_buffer_zero(switch_buffer_t *buffer);
/*! \brief Destroy the buffer
* \param buffer buffer to destroy
* \note only neccessary on dynamic buffers (noop on pooled ones)
*/
SWITCH_DECLARE(void) switch_buffer_destroy(switch_buffer_t **buffer);
/** @} */
#endif
/* For Emacs:
* Local Variables:
* mode:c
* indent-tabs-mode:t
* tab-width:4
* c-basic-offset:4
* End:
* For VIM:
* vim:set softtabstop=4 shiftwidth=4 tabstop=4 expandtab:
*/

View File

@ -1,3 +1,41 @@
sangoma_mgd.c
======================================
Jun 13 2007
v1.13 Nenad Corbic <ncorbic@sangoma.com>
Woomera OPAL Dialect
Added Congestion control
Added SCTP
Added priority ISUP queue
Fixed presentation
v1.12 Nenad Corbic <ncorbic@sangoma.com>
Fixed CCR
Removed socket shutdown on end call.
Let Media thread shutodwn sockets.
v1.11 Nenad Corbic <ncorbic@sangoma.com>
Fixed Remote asterisk/woomera connection
Increased socket timeouts
chan_woomera.c
======================================
Jun 13 2007
v1.11 Nenad Corbic <ncorbic@sangoma.com>
Updated multiple profiles
Updated Dialect for OPAL Woomera
Added call logging/debugging
Fixed presentation
v1.10 Nenad Corbic <ncorbic@sangoma.com>
Bug fix in incoming hangup
v1.9 Nenad Corbic <ncorbic@sangoma.com>
Fixed remote asterisk/woomera
setup.
sangoma_mgd.c
======================================

View File

@ -15,7 +15,7 @@
SMG_DTMF=YES
CC = gcc
INCLUDES = -I/lib/modules/$(shell uname -r)/build/include -I. -I/usr/local/include
INCLUDES = -I/lib/modules/$(shell uname -r)/build/include -I. -I/usr/local/include -I../../patches/kdrivers/include
CFLAGS = -D__LINUX__ -D_REENTRANT -D_GNU_SOURCE -O6 -march=i686
CCFLAGS = -Wall -Wstrict-prototypes -Wmissing-prototypes -g
LDFLAGS=-L. -L/usr/local/lib -lpthread -lsangoma -lm
@ -39,7 +39,7 @@ sangoma_mgd: sangoma_mgd.o call_signal.o switch_buffer.o sigboost.h
rm -fr core*
$(CC) $(CCFLAGS) $(INCLUDES) $(CFLAGS) -o sangoma_mgd sangoma_mgd.o switch_buffer.o call_signal.o $(LDFLAGS)
sangoma_mgd.o: sangoma_mgd.c sigboost.h
sangoma_mgd.o: sangoma_mgd.c sangoma_mgd.h sigboost.h
$(CC) $(CCFLAGS) $(INCLUDES) $(CFLAGS) -c -o sangoma_mgd.o sangoma_mgd.c
clean:

View File

@ -4,7 +4,8 @@
* Author(s): Anthony Minessale II <anthmct@yahoo.com>
* Nenad Corbic <ncorbic@sangoma.com>
*
* Copyright: (c) 2005 Anthony Minessale II
* Copyright: (c) 2005 Nenad Corbic
* Anthony Minessale II
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
@ -19,10 +20,6 @@ extern void __log_printf(int level, FILE *fp, char *file, const char *func, int
#define clog_printf(level, fp, fmt, ...) __log_printf(level, fp, __FILE__, __FUNCTION__, __LINE__, fmt, ##__VA_ARGS__)
extern unsigned int txseq;
extern unsigned int rxseq_reset;
extern unsigned int rxseq;
struct call_signal_map {
uint32_t event_id;
char *name;
@ -43,7 +40,7 @@ static struct call_signal_map call_signal_table[] = {
{SIGBOOST_EVENT_REMOVE_CHECK_LOOP, "LOOP STOP"}
};
#define USE_SCTP 1
static int create_udp_socket(call_signal_connection_t *mcon, char *local_ip, int local_port, char *ip, int port)
{
@ -54,7 +51,17 @@ static int create_udp_socket(call_signal_connection_t *mcon, char *local_ip, int
memset(&mcon->remote_hp, 0, sizeof(mcon->remote_hp));
memset(&mcon->local_hp, 0, sizeof(mcon->local_hp));
if ((mcon->socket = socket(AF_INET, SOCK_DGRAM, 0))) {
#ifdef USE_SCTP
mcon->socket = socket(AF_INET, SOCK_SEQPACKET, IPPROTO_SCTP);
#else
mcon->socket = socket(AF_INET, SOCK_DGRAM, 0);
#endif
clog_printf(3,mcon->log,"Creating L=%s:%d R=%s:%d\n",
local_ip,local_port,ip,port);
if (mcon->socket >= 0) {
int flag=1;
gethostbyname_r(ip, &mcon->remote_hp, buf, sizeof(buf), &result, &err);
gethostbyname_r(local_ip, &mcon->local_hp, local_buf, sizeof(local_buf), &local_result, &err);
if (result && local_result) {
@ -66,9 +73,24 @@ static int create_udp_socket(call_signal_connection_t *mcon, char *local_ip, int
memcpy((char *) &mcon->local_addr.sin_addr.s_addr, mcon->local_hp.h_addr_list[0], mcon->local_hp.h_length);
mcon->local_addr.sin_port = htons(local_port);
if ((rc = bind(mcon->socket, (struct sockaddr *) &mcon->local_addr, sizeof(mcon->local_addr))) < 0) {
#ifdef USE_SCTP
setsockopt(mcon->socket, IPPROTO_SCTP, SCTP_NODELAY,
(char *)&flag, sizeof(int));
#endif
if ((rc = bind(mcon->socket,
(struct sockaddr *) &mcon->local_addr,
sizeof(mcon->local_addr))) < 0) {
close(mcon->socket);
mcon->socket = -1;
} else {
#ifdef USE_SCTP
rc=listen(mcon->socket,100);
if (rc) {
close(mcon->socket);
mcon->socket = -1;
}
#endif
}
}
}
@ -87,8 +109,6 @@ int call_signal_connection_close(call_signal_connection_t *mcon)
int call_signal_connection_open(call_signal_connection_t *mcon, char *local_ip, int local_port, char *ip, int port)
{
memset(mcon, 0, sizeof(*mcon));
create_udp_socket(mcon, local_ip, local_port, ip, port);
return mcon->socket;
}
@ -104,27 +124,30 @@ call_signal_event_t *call_signal_connection_read(call_signal_connection_t *mcon,
if (bytes == sizeof(mcon->event) ||
bytes == (sizeof(mcon->event)-sizeof(uint32_t))) {
if (rxseq_reset) {
if (mcon->rxseq_reset) {
if (mcon->event.event_id == SIGBOOST_EVENT_SYSTEM_RESTART_ACK) {
rxseq++;
clog_printf(0,mcon->log,"Rx sync ok\n");
mcon->rxseq=mcon->event.fseqno;
return &mcon->event;
}
errno=EAGAIN;
clog_printf(0,mcon->log,"Waiting for rx sync...\n");
return NULL;
}
mcon->rxseq++;
if (rxseq != mcon->event.seqno) {
if (mcon->rxseq != mcon->event.fseqno) {
clog_printf(0, mcon->log,
"------------------------------------------\n");
clog_printf(0, mcon->log,
"Critical Error: Invalid Sequence Number Expect=%i Rx=%i\n",
rxseq,mcon->event.seqno);
mcon->rxseq,mcon->event.fseqno);
clog_printf(0, mcon->log,
"------------------------------------------\n");
}
rxseq++;
mcon->txwindow = mcon->txseq - mcon->event.bseqno;
return &mcon->event;
@ -143,6 +166,33 @@ call_signal_event_t *call_signal_connection_read(call_signal_connection_t *mcon,
return NULL;
}
call_signal_event_t *call_signal_connection_readp(call_signal_connection_t *mcon, int iteration)
{
unsigned int fromlen = sizeof(struct sockaddr_in);
int bytes = 0;
bytes = recvfrom(mcon->socket, &mcon->event, sizeof(mcon->event), MSG_DONTWAIT,
(struct sockaddr *) &mcon->local_addr, &fromlen);
if (bytes == sizeof(mcon->event) ||
bytes == (sizeof(mcon->event)-sizeof(uint32_t))) {
return &mcon->event;
} else {
if (iteration == 0) {
clog_printf(0, mcon->log,
"------------------------------------------\n");
clog_printf(0, mcon->log,
"Critical Error: PQ Invalid Event lenght from boost rxlen=%i evsz=%i\n",
bytes, sizeof(mcon->event));
clog_printf(0, mcon->log,
"------------------------------------------\n");
}
}
return NULL;
}
int call_signal_connection_write(call_signal_connection_t *mcon, call_signal_event_t *event)
{
int err;
@ -151,7 +201,7 @@ int call_signal_connection_write(call_signal_connection_t *mcon, call_signal_eve
return -EINVAL;
}
if (event->span < 0 || event->chan < 0 || event->span > 16 || event->chan > 30) {
if (event->span < 0 || event->chan < 0 || event->span > 16 || event->chan > 31) {
clog_printf(0, mcon->log,
"------------------------------------------\n");
clog_printf(0, mcon->log,
@ -164,7 +214,8 @@ int call_signal_connection_write(call_signal_connection_t *mcon, call_signal_eve
gettimeofday(&event->tv,NULL);
pthread_mutex_lock(&mcon->lock);
event->seqno=txseq++;
event->fseqno=mcon->txseq++;
event->bseqno=mcon->rxseq;
err=sendto(mcon->socket, event, sizeof(call_signal_event_t), 0,
(struct sockaddr *) &mcon->remote_addr, sizeof(mcon->remote_addr));
pthread_mutex_unlock(&mcon->lock);
@ -172,7 +223,6 @@ int call_signal_connection_write(call_signal_connection_t *mcon, call_signal_eve
if (err != sizeof(call_signal_event_t)) {
err = -1;
}
#if 0
clog_printf(2, mcon->log, "TX EVENT\n");
@ -189,7 +239,7 @@ int call_signal_connection_write(call_signal_connection_t *mcon, call_signal_eve
clog_printf(2, mcon->log, " tInterface: [w%dg%d]\n",event->span+1,event->chan+1);
clog_printf(2, mcon->log, " tEvent ID: [%d]\n",event->event_id);
clog_printf(2, mcon->log, " tSetup ID: [%d]\n",event->call_setup_id);
clog_printf(2, mcon->log, " tSeq: [%d]\n",event->seqno);
clog_printf(2, mcon->log, " tSeq: [%d]\n",event->fseqno);
clog_printf(2, mcon->log, "===================================\n");
#endif
@ -202,7 +252,7 @@ int call_signal_connection_write(call_signal_connection_t *mcon, call_signal_eve
event->chan+1,
event->release_cause,
event->call_setup_id,
event->seqno,
event->fseqno,
(event->called_number_digits_count ? (char *) event->called_number_digits : "N/A"),
(event->calling_number_digits_count ? (char *) event->calling_number_digits : "N/A")
);
@ -237,7 +287,7 @@ int call_signal_connection_write(call_signal_connection_t *mcon, call_signal_eve
event->chan+1,
event->event_id,
event->call_setup_id,
event->seqno
event->fseqno
);
#endif

View File

@ -4,7 +4,8 @@
* Author(s): Anthony Minessale II <anthmct@yahoo.com>
* Nenad Corbic <ncorbic@sangoma.com>
*
* Copyright: (c) 2005 Anthony Minessale II
* Copyright: (c) 05-07 Nenad Corbic
* Anthony Minessale II
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
@ -26,6 +27,7 @@
#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <netinet/sctp.h>
#include <arpa/inet.h>
#include <stdarg.h>
#include <netdb.h>
@ -56,6 +58,14 @@
typedef t_sigboost call_signal_event_t;
typedef uint32_t call_signal_event_id_t;
typedef struct smg_ip_cfg
{
char local_ip[25];
int local_port;
char remote_ip[25];
int remote_port;
}smg_ip_cfg_t;
struct call_signal_connection {
int socket;
struct sockaddr_in local_addr;
@ -66,6 +76,11 @@ struct call_signal_connection {
unsigned int flags;
pthread_mutex_t lock;
FILE *log;
unsigned int txseq;
unsigned int rxseq;
unsigned int txwindow;
unsigned int rxseq_reset;
smg_ip_cfg_t cfg;
};
typedef enum {
@ -74,9 +89,17 @@ typedef enum {
typedef struct call_signal_connection call_signal_connection_t;
/* disable nagle's algorythm */
static inline void sctp_no_nagle(int socket)
{
int flag = 1;
setsockopt(socket, IPPROTO_SCTP, SCTP_NODELAY, (char *) &flag, sizeof(int));
}
int call_signal_connection_close(call_signal_connection_t *mcon);
int call_signal_connection_open(call_signal_connection_t *mcon, char *local_ip, int local_port, char *ip, int port);
call_signal_event_t *call_signal_connection_read(call_signal_connection_t *mcon, int iteration);
call_signal_event_t *call_signal_connection_readp(call_signal_connection_t *mcon, int iteration);
int call_signal_connection_write(call_signal_connection_t *mcon, call_signal_event_t *event);
void call_signal_event_init(call_signal_event_t *event, call_signal_event_id_t event_id, int chan, int span);
void call_signal_call_init(call_signal_event_t *event, char *calling, char *called, int setup_id);

View File

@ -12,6 +12,14 @@
* This program is free software, distributed under the terms of
* the GNU General Public License
* =============================================
* v1.12 Nenad Corbic <ncorbic@sangoma.com>
* Updated DTMF locking
*
* v1.11 Nenad Corbic <ncorbic@sangoma.com>
* Updated multiple profiles
* Updated Dialect for OPAL Woomera
* Added call logging/debugging
*
* v1.10 Nenad Corbic <ncorbic@sangoma.com>
* Bug fix in incoming hangup
*
@ -81,9 +89,9 @@
#include "asterisk.h"
extern int option_verbose;
#define WOOMERA_VERSION "v1.10"
#define WOOMERA_VERSION "v1.12"
ASTERISK_FILE_VERSION(__FILE__, "$Revision: 1.10 $")
ASTERISK_FILE_VERSION(__FILE__, "$Revision: 1.12 $")
static int tech_count = 0;
static const char desc[] = "Woomera Channel Driver";
@ -119,7 +127,7 @@ static struct ast_jb_conf global_jbconf;
#define WOOMERA_RECORD_SEPARATOR "\r\n\r\n"
#define WOOMERA_DEBUG_PREFIX "**[WOOMERA]** "
#define WOOMERA_DEBUG_LINE "--------------------------------------------------------------------------------"
#define WOOMERA_HARD_TIMEOUT -10000
#define WOOMERA_HARD_TIMEOUT -1000
#define WOOMERA_QLEN 10
/* this macro is not in all versions of asterisk */
@ -365,10 +373,9 @@ static int config_woomera(void);
static int create_udp_socket(char *ip, int port, struct sockaddr_in *sockaddr, int client);
static int connect_woomera(int *new_socket, woomera_profile *profile, int flags);
static int init_woomera(void);
static struct ast_channel *woomera_new(const char *type, int format, void *data, int *cause);
static int woomera_cli(int fd, int argc, char *argv[]);
static void tech_destroy(private_object *tech_pvt, struct ast_channel *owner);
static struct ast_channel *woomera_new(const char *type, int format, void *data, int *cause);
static struct ast_channel *woomera_new(const char *type, int format, void *data, int *cause, woomera_profile *profile);
static int launch_tech_thread(private_object *tech_pvt);
static int tech_create_read_socket(private_object *tech_pvt);
static int tech_activate(private_object *tech_pvt);
@ -810,6 +817,12 @@ static int woomera_message_parse(int fd, woomera_message *wmsg, int timeout,
bytes = atoi(val);
}
if (name && val && !strcasecmp(name, "content-length")) {
ast_set_flag(wmsg, WFLAG_CONTENT);
bytes = atoi(val);
}
}
wmsg->last++;
}
@ -947,6 +960,7 @@ static int tech_activate(private_object *tech_pvt)
int retry_activate_call=0;
woomera_message wmsg;
char *callid;
int err=0;
memset(&wmsg,0,sizeof(wmsg));
retry_activate_again:
@ -992,10 +1006,11 @@ retry_activate_again:
woomera_printf(tech_pvt->profile,
tech_pvt->command_channel,
"CALL %s:%s%s"
"Raw-Audio: %s/%d%s"
"Raw-Audio: %s:%d%s"
"Local-Name: %s!%s%s"
"Local-Number:%s%s"
"Presentation:%d%s"
"Screening:%d%s"
"RDNIS:%s%s",
tech_pvt->proto,
tech_pvt->dest,
@ -1008,7 +1023,9 @@ retry_activate_again:
WOOMERA_LINE_SEPARATOR,
tech_pvt->cid_num,
WOOMERA_LINE_SEPARATOR,
tech_pvt->cid_pres,
(tech_pvt->cid_pres>>5)&0x7,
WOOMERA_LINE_SEPARATOR,
tech_pvt->cid_pres&0xF,
WOOMERA_LINE_SEPARATOR,
tech_pvt->cid_rdnis?tech_pvt->cid_rdnis:"",
WOOMERA_RECORD_SEPARATOR
@ -1018,10 +1035,11 @@ retry_activate_again:
woomera_printf(tech_pvt->profile,
tech_pvt->command_channel,
"CALL %s%s"
"Raw-Audio: %s/%d%s"
"Raw-Audio: %s:%d%s"
"Local-Name: %s!%s%s"
"Local-Number:%s%s"
"Presentation:%d%s"
"Screening:%d%s"
"RDNIS:%s%s",
tech_pvt->dest,
WOOMERA_LINE_SEPARATOR,
@ -1033,16 +1051,17 @@ retry_activate_again:
WOOMERA_LINE_SEPARATOR,
tech_pvt->cid_num,
WOOMERA_LINE_SEPARATOR,
tech_pvt->cid_pres,
(tech_pvt->cid_pres>>5)&0x7,
WOOMERA_LINE_SEPARATOR,
tech_pvt->cid_pres&0xF,
WOOMERA_LINE_SEPARATOR,
tech_pvt->cid_rdnis?tech_pvt->cid_rdnis:"",
WOOMERA_RECORD_SEPARATOR
);
}
woomera_message_parse_wait(tech_pvt,&wmsg);
if (woomera_message_reply_ok(&wmsg) != 0) {
err=woomera_message_parse_wait(tech_pvt,&wmsg);
if (err < 0 || woomera_message_reply_ok(&wmsg) != 0) {
ast_set_flag(tech_pvt, TFLAG_ABORT);
}
@ -1058,6 +1077,23 @@ retry_activate_again:
__FUNCTION__,__LINE__,
tech_pvt->callid,tech_pvt);
}
woomera_printf(tech_pvt->profile,
tech_pvt->command_channel,
"PROCEED %s%s"
"Unique-Call-Id %s%s",
tech_pvt->callid,
WOOMERA_LINE_SEPARATOR,
tech_pvt->callid,
WOOMERA_RECORD_SEPARATOR);
err=woomera_message_parse_wait(tech_pvt,&wmsg);
if (err < 0 || woomera_message_reply_ok(&wmsg) != 0) {
ast_set_flag(tech_pvt, TFLAG_ABORT);
/* Do not hangup on main because
* socket connection has been
* established */
}
}
@ -1080,8 +1116,9 @@ tech_activate_failed:
* We must send a message to SMG to hangup the call */
if (globals.debug > 2) {
ast_log(LOG_NOTICE, "Error: %s Call %s tpvt=%p Failed: CRITICAL\n",
ast_log(LOG_NOTICE, "Error: %s Call %s tpvt=%p Failed!\n",
ast_test_flag(tech_pvt, TFLAG_OUTBOUND) ? "OUT":"IN",
tech_pvt->callid,tech_pvt);
}
@ -1136,6 +1173,54 @@ static int tech_init(private_object *tech_pvt, woomera_profile *profile, int fla
ast_set_flag(tech_pvt, flags);
if (profile->dtmf_enable) {
tech_pvt->dsp_features=0;
tech_pvt->dsp = ast_dsp_new();
if (tech_pvt->dsp) {
#if 0
i->dsp_features = features & ~DSP_PROGRESS_TALK;
/* We cannot do progress detection until receives PROGRESS message */
if (i->outgoing && (i->sig == SIG_PRI)) {
/* Remember requested DSP features, don't treat
talking as ANSWER */
features = 0;
}
#endif
tech_pvt->dsp_features |= DSP_FEATURE_DTMF_DETECT;
//tech_pvt->dsp_features |= DSP_FEATURE_BUSY_DETECT;
//tech_pvt->dsp_features |= DSP_FEATURE_CALL_PROGRESS;
//tech_pvt->dsp_features |= DSP_FEATURE_FAX_DETECT;
ast_dsp_set_features(tech_pvt->dsp, tech_pvt->dsp_features);
ast_dsp_digitmode(tech_pvt->dsp, DSP_DIGITMODE_DTMF | DSP_DIGITMODE_RELAXDTMF);
tech_pvt->ast_dsp=1;
#if 0
if (!ast_strlen_zero(progzone))
ast_dsp_set_call_progress_zone(tech_pvt->dsp, progzone);
if (i->busydetect && CANBUSYDETECT(i)) {
ast_dsp_set_busy_count(tech_pvt->dsp, i->busycount);
ast_dsp_set_busy_pattern(tech_pvt->dsp, i->busy_tonelength, ->busy_quietlength);
}
#endif
}
}
if (profile && profile->faxdetect) {
tech_pvt->faxdetect=1;
}
if (profile->jb_enable) {
#ifdef AST_JB
/* Assign default jb conf to the new zt_pvt */
memcpy(&tech_pvt->jbconf, &global_jbconf, sizeof(struct ast_jb_conf));
ast_jb_configure(chan, &tech_pvt->jbconf);
#else
ast_log(LOG_ERROR, "Asterisk Jitter Buffer Not Compiled!\n");
#endif
}
/* Asterisk being asterisk and all allows approx 1 nanosecond
* to try and establish a connetion here before it starts crying.
@ -1163,13 +1248,13 @@ static int tech_init(private_object *tech_pvt, woomera_profile *profile, int fla
ast_set_flag(tech_pvt, TFLAG_ABORT);
return -1;
}
ast_mutex_lock(&default_profile.call_count_lock);
ast_mutex_lock(&tech_pvt->profile->call_count_lock);
if (ast_test_flag(tech_pvt, TFLAG_OUTBOUND)) {
default_profile.call_out++;
tech_pvt->profile->call_out++;
} else {
default_profile.call_in++;
tech_pvt->profile->call_in++;
}
ast_mutex_unlock(&default_profile.call_count_lock);
ast_mutex_unlock(&tech_pvt->profile->call_count_lock);
} else {
if (ast_test_flag(tech_pvt, TFLAG_OUTBOUND)) {
@ -1179,12 +1264,13 @@ static int tech_init(private_object *tech_pvt, woomera_profile *profile, int fla
}
}
if (profile) {
ast_mutex_lock(&profile->call_count_lock);
profile->call_count++;
tech_pvt->call_count = profile->call_count;
ast_mutex_unlock(&profile->call_count_lock);
}
ast_mutex_lock(&profile->call_count_lock);
profile->call_count++;
tech_pvt->call_count = profile->call_count;
ast_mutex_unlock(&profile->call_count_lock);
if (globals.debug > 2) {
ast_log(LOG_NOTICE, "TECH INIT tech_pvt=%p c=%p (use=%i)\n",
tech_pvt,tech_pvt->owner,usecount());
@ -1391,8 +1477,8 @@ static void *tech_monitor_thread(void *obj)
if (globals.debug > 2) {
ast_log(LOG_NOTICE, "IN THREAD %s rxgain=%f txtain=%f\n",
tech_pvt->callid,
default_profile.rxgain_val,
default_profile.txgain_val);
tech_pvt->profile->rxgain_val,
tech_pvt->profile->txgain_val);
}
@ -1501,13 +1587,13 @@ static void *tech_monitor_thread(void *obj)
usleep(5000);
sched_yield();
}
ast_mutex_lock(&default_profile.call_count_lock);
default_profile.call_end++;
ast_mutex_unlock(&default_profile.call_count_lock);
ast_mutex_lock(&tech_pvt->profile->call_count_lock);
tech_pvt->profile->call_end++;
ast_mutex_unlock(&tech_pvt->profile->call_count_lock);
} else {
ast_mutex_lock(&default_profile.call_count_lock);
default_profile.call_abort++;
ast_mutex_unlock(&default_profile.call_count_lock);
ast_mutex_lock(&tech_pvt->profile->call_count_lock);
tech_pvt->profile->call_abort++;
ast_mutex_unlock(&tech_pvt->profile->call_count_lock);
if (globals.debug > 2) {
ast_log(LOG_NOTICE, "NOTE: Skipping Wait on destroy timedout! %s tech_pvt=%p\n",
@ -1595,7 +1681,7 @@ static void *tech_monitor_thread(void *obj)
woomera_printf(tech_pvt->profile, tech_pvt->command_channel,
"%s %s%s"
"Raw-Audio: %s/%d%s"
"Raw-Audio: %s:%d%s"
"Request-Audio: Raw%s"
"Unique-Call-Id: %s%s",
MEDIA_ANSWER,
@ -1663,22 +1749,23 @@ static void *tech_monitor_thread(void *obj)
goto tech_thread_continue;
continue;
}
ast_mutex_lock(&default_profile.call_count_lock);
default_profile.call_ok++;
ast_mutex_unlock(&default_profile.call_count_lock);
ast_mutex_lock(&tech_pvt->profile->call_count_lock);
tech_pvt->profile->call_ok++;
ast_mutex_unlock(&tech_pvt->profile->call_count_lock);
#endif
}
}
if (ast_test_flag(tech_pvt, TFLAG_DTMF)) {
if (globals.debug > 2) {
ast_log(LOG_NOTICE, "DTMF %s tpvt=%p\n",
tech_pvt->callid,tech_pvt);
ast_log(LOG_NOTICE, "DTMF %s tpvt=%p %s\n",
tech_pvt->callid,tech_pvt,tech_pvt->dtmfbuf);
}
//DIALECT
#if 1
ast_mutex_lock(&tech_pvt->iolock);
#if 0
woomera_printf(tech_pvt->profile, tech_pvt->command_channel,
"DTMF %s %s%s",
tech_pvt->callid,
@ -1697,6 +1784,10 @@ static void *tech_monitor_thread(void *obj)
WOOMERA_RECORD_SEPARATOR);
#endif
ast_clear_flag(tech_pvt, TFLAG_DTMF);
memset(tech_pvt->dtmfbuf, 0, sizeof(tech_pvt->dtmfbuf));
ast_mutex_unlock(&tech_pvt->iolock);
if (woomera_message_parse_wait(tech_pvt,&wmsg) < 0) {
ast_set_flag(tech_pvt, TFLAG_ABORT);
ast_log(LOG_NOTICE, "DTMF ABORT Ch=%d\n",
@ -1704,10 +1795,6 @@ static void *tech_monitor_thread(void *obj)
goto tech_thread_continue;
continue;
}
ast_mutex_lock(&tech_pvt->iolock);
ast_clear_flag(tech_pvt, TFLAG_DTMF);
memset(tech_pvt->dtmfbuf, 0, sizeof(tech_pvt->dtmfbuf));
ast_mutex_unlock(&tech_pvt->iolock);
}
if(tech_pvt->timeout) {
@ -1852,9 +1939,9 @@ static void *tech_monitor_thread(void *obj)
ast_queue_frame(owner, &answer_frame);
ast_set_flag(tech_pvt, TFLAG_UP);
ast_mutex_lock(&default_profile.call_count_lock);
default_profile.call_ok++;
ast_mutex_unlock(&default_profile.call_count_lock);
ast_mutex_lock(&tech_pvt->profile->call_count_lock);
tech_pvt->profile->call_ok++;
ast_mutex_unlock(&tech_pvt->profile->call_count_lock);
}else{
ast_set_flag(tech_pvt, TFLAG_ABORT);
@ -1952,7 +2039,6 @@ static int woomera_locate_socket(woomera_profile *profile, int *woomera_socket)
) < 0) {
ast_log(LOG_ERROR, "{%s} %s:%d HELP! Woomera is broken!\n",
profile->name,__FUNCTION__,__LINE__);
globals.panic = 1;
if (*woomera_socket > -1) {
woomera_close_socket(woomera_socket);
}
@ -2055,7 +2141,6 @@ static void *woomera_thread_run(void *obj)
break;
}
globals.panic = 1;
continue;
if (woomera_socket > -1) {
@ -2071,7 +2156,6 @@ static void *woomera_thread_run(void *obj)
&profile->event_queue
) < 0) {
ast_log(LOG_ERROR, "{%s} %s:%d HELP! Woomera is broken!\n", profile->name,__FUNCTION__,__LINE__);
globals.panic = 1;
woomera_close_socket(&woomera_socket);
}
}
@ -2105,7 +2189,7 @@ static void *woomera_thread_run(void *obj)
ast_log(LOG_NOTICE, "NEW INBOUND CALL %s!\n",wmsg.callid);
}
if ((inchan = woomera_new(type, WFORMAT, name, &cause))) {
if ((inchan = woomera_new(type, profile->coding, name, &cause, profile))) {
private_object *tech_pvt;
char *callid;
tech_pvt = inchan->tech_pvt;
@ -2350,6 +2434,8 @@ static int config_woomera(void)
}
}
strncpy(profile->name, entry, sizeof(profile->name) - 1);
profile->coding=AST_FORMAT_SLINEAR;
/*default is inbound and outbound enabled */
ast_set_flag(profile, PFLAG_INBOUND | PFLAG_OUTBOUND);
for (v = ast_variable_browse(cfg, entry); v ; v = v->next) {
@ -2586,27 +2672,30 @@ static int connect_woomera(int *new_socket, woomera_profile *profile, int flags)
woomera_message_header(&wmsg, "Version"),
sizeof(smgversion)-1);
}
audio_format = woomera_message_header(&wmsg, "Raw-Format");
if (!audio_format) {
audio_format = woomera_message_header(&wmsg, "Raw-Audio-Format");
}
if (audio_format) {
profile->coding=AST_FORMAT_SLINEAR;
if (strncmp(audio_format,"PMC-16",20) == 0){
if (strncasecmp(audio_format,"PCM-16",20) == 0){
profile->coding=AST_FORMAT_SLINEAR;
} else if (strncmp(audio_format,"ULAW",15) == 0) {
} else if (strncasecmp(audio_format,"ULAW",15) == 0) {
profile->coding=AST_FORMAT_ULAW;
} else if (strncmp(audio_format,"ALAW",15) == 0) {
} else if (strncasecmp(audio_format,"ALAW",15) == 0) {
profile->coding=AST_FORMAT_ALAW;
} else {
ast_log(LOG_ERROR, "Error: Invalid Raw-Format %s\n",
audio_format);
}
default_profile.coding=profile->coding;
if (globals.debug > 2) {
ast_log(LOG_NOTICE, "Setting RAW Format to %s %i\n",
audio_format, default_profile.coding);
ast_log(LOG_NOTICE, "Setting RAW Format to %s %i (p%i:u%i:a%i)\n",
audio_format, profile->coding,
AST_FORMAT_SLINEAR,AST_FORMAT_ULAW,AST_FORMAT_ALAW);
}
}
}
@ -2648,11 +2737,10 @@ static int init_woomera(void)
return 1;
}
static struct ast_channel *woomera_new(const char *type, int format, void *data, int *cause)
static struct ast_channel *woomera_new(const char *type, int format, void *data, int *cause, woomera_profile *parent_profile)
{
private_object *tech_pvt;
struct ast_channel *chan = NULL;
woomera_profile *profile=NULL;;
if ((chan = ast_channel_alloc(1))) {
chan->nativeformats = WFORMAT;
@ -2685,63 +2773,11 @@ static struct ast_channel *woomera_new(const char *type, int format, void *data,
tech_pvt->owner = chan;
profile = ASTOBJ_CONTAINER_FIND(&woomera_profile_list, "default");
if (profile) {
tech_pvt->coding = profile->coding;
chan->nativeformats = profile->coding;
chan->writeformat = chan->rawwriteformat = chan->readformat = profile->coding;
tech_pvt->frame.subclass = profile->coding;
}
if (profile && profile->dtmf_enable) {
tech_pvt->dsp_features=0;
tech_pvt->dsp = ast_dsp_new();
if (tech_pvt->dsp) {
#if 0
i->dsp_features = features & ~DSP_PROGRESS_TALK;
/* We cannot do progress detection until receives PROGRESS message */
if (i->outgoing && (i->sig == SIG_PRI)) {
/* Remember requested DSP features, don't treat
talking as ANSWER */
features = 0;
}
#endif
tech_pvt->dsp_features |= DSP_FEATURE_DTMF_DETECT;
//tech_pvt->dsp_features |= DSP_FEATURE_BUSY_DETECT;
//tech_pvt->dsp_features |= DSP_FEATURE_CALL_PROGRESS;
//tech_pvt->dsp_features |= DSP_FEATURE_FAX_DETECT;
ast_dsp_set_features(tech_pvt->dsp, tech_pvt->dsp_features);
ast_dsp_digitmode(tech_pvt->dsp, DSP_DIGITMODE_DTMF | DSP_DIGITMODE_RELAXDTMF);
tech_pvt->ast_dsp=1;
#if 0
if (!ast_strlen_zero(progzone))
ast_dsp_set_call_progress_zone(tech_pvt->dsp, progzone);
if (i->busydetect && CANBUSYDETECT(i)) {
ast_dsp_set_busy_count(tech_pvt->dsp, i->busycount);
ast_dsp_set_busy_pattern(tech_pvt->dsp, i->busy_tonelength, i->busy_quietlength);
}
#endif
}
}
if (profile && profile->faxdetect) {
tech_pvt->faxdetect=1;
}
if (profile && profile->jb_enable) {
#ifdef AST_JB
/* Assign default jb conf to the new zt_pvt */
memcpy(&tech_pvt->jbconf, &global_jbconf, sizeof(struct ast_jb_conf));
ast_jb_configure(chan, &tech_pvt->jbconf);
#else
ast_log(LOG_ERROR, "Asterisk Jitter Buffer Not Compiled!\n");
#endif
}
chan->nativeformats = tech_pvt->coding;
chan->writeformat = chan->rawwriteformat = chan->readformat = tech_pvt->coding;
tech_pvt->frame.subclass = tech_pvt->coding;
ASTOBJ_CONTAINER_LINK(&private_object_list, tech_pvt);
ast_mutex_lock(&usecnt_lock);
@ -2779,7 +2815,7 @@ static struct ast_channel *tech_requester(const char *type, int format, void *da
return NULL;
}
if ((chan = woomera_new(type, format, data, cause))) {
if ((chan = woomera_new(type, format, data, cause, NULL))) {
private_object *tech_pvt;
tech_pvt = chan->tech_pvt;
@ -2850,10 +2886,11 @@ static int tech_call(struct ast_channel *self, char *dest, int timeout)
goto tech_call_failed;
}
if (globals.debug > 2) {
ast_log(LOG_NOTICE, "TECH CALL %s (%s <%s>) (%p)\n",
ast_log(LOG_NOTICE, "TECH CALL %s (%s <%s>) pres=0x%02X dest=%s\n",
self->name, self->cid.cid_name,
self->cid.cid_num,
tech_pvt);
self->cid.cid_pres,
dest);
}
if (self->cid.cid_name) {
strncpy(tech_pvt->cid_name, self->cid.cid_name, sizeof(tech_pvt->cid_name)-1);
@ -2871,7 +2908,11 @@ static int tech_call(struct ast_channel *self, char *dest, int timeout)
if ((workspace = ast_strdupa(dest))) {
char *addr, *profile_name, *proto=NULL;
woomera_profile *profile;
int isprofile = 0, err;
int err;
#if 0
int isprofile = 0;
if ((addr = strchr(workspace, ':'))) {
char *tst;
@ -2885,14 +2926,30 @@ static int tech_call(struct ast_channel *self, char *dest, int timeout)
proto = NULL;
addr = workspace;
}
if ((profile_name = strchr(addr, '*'))) {
if ((profile_name = strchr(addr, ':'))) {
*profile_name = '\0';
profile_name++;
isprofile = 1;
} else {
profile_name = "default";
}
#else
profile_name = "default";
proto = NULL;
if ((addr = strchr(workspace, ':'))) {
profile_name = workspace;
proto=profile_name;
*addr = '\0';
addr++;
} else {
addr = workspace;
}
#endif
if (! (profile = ASTOBJ_CONTAINER_FIND(&woomera_profile_list, profile_name))) {
profile = ASTOBJ_CONTAINER_FIND(&woomera_profile_list, "default");
@ -2902,7 +2959,7 @@ static int tech_call(struct ast_channel *self, char *dest, int timeout)
ast_log(LOG_ERROR, "Unable to find profile! Call Aborted!\n");
goto tech_call_failed;
}
if (!ast_test_flag(profile, PFLAG_OUTBOUND)) {
ast_log(LOG_ERROR, "This profile is not allowed to make outbound calls! Call Aborted!\n");
goto tech_call_failed;
@ -2924,6 +2981,16 @@ static int tech_call(struct ast_channel *self, char *dest, int timeout)
snprintf(tech_pvt->dest, sizeof(tech_pvt->dest), "%s", addr ? addr : "");
snprintf(tech_pvt->proto, sizeof(tech_pvt->proto), "%s", proto ? proto : "");
if (globals.debug > 2) {
ast_log(LOG_NOTICE, "TECH CALL: proto=%s addr=%s profile=%s Coding=%i\n",
proto,addr,profile_name,profile->coding);
}
tech_pvt->coding = profile->coding;
self->nativeformats = tech_pvt->coding;
self->writeformat = self->rawwriteformat = self->readformat = tech_pvt->coding;
tech_pvt->frame.subclass = tech_pvt->coding;
tech_pvt->timeout = timeout;
err=tech_init(tech_pvt, profile, TFLAG_OUTBOUND);
if (err) {
@ -3149,6 +3216,7 @@ static struct ast_frame *tech_read(struct ast_channel *self)
{
private_object *tech_pvt = self->tech_pvt;
int res = 0;
struct ast_frame *f;
if (!tech_pvt || globals.panic || ast_test_flag(tech_pvt, TFLAG_ABORT)) {
@ -3172,34 +3240,46 @@ tech_read_again:
return NULL;
}
tech_pvt->frame.datalen = res;
if (tech_pvt->coding == AST_FORMAT_SLINEAR) {
tech_pvt->frame.samples = res / 2;
} else {
tech_pvt->frame.samples = res;
}
tech_pvt->frame.data = tech_pvt->fdata + AST_FRIENDLY_OFFSET;
tech_pvt->frame.frametype = AST_FRAME_VOICE;
tech_pvt->frame.subclass = tech_pvt->coding;
tech_pvt->frame.offset = AST_FRIENDLY_OFFSET;
tech_pvt->frame.datalen = res;
tech_pvt->frame.samples = res;
tech_pvt->frame.data = tech_pvt->fdata + AST_FRIENDLY_OFFSET;
if (default_profile.rxgain_val) {
f=&tech_pvt->frame;
if (tech_pvt->profile->rxgain_val) {
int i;
unsigned char *data=tech_pvt->frame.data;
for (i=0;i<tech_pvt->frame.datalen;i++) {
data[i]=default_profile.rxgain[data[i]];
data[i]=tech_pvt->profile->rxgain[data[i]];
}
}
if (tech_pvt->faxdetect || tech_pvt->ast_dsp ) {
woomera_tx2ast_frm(tech_pvt, tech_pvt->frame.data, tech_pvt->frame.datalen);
if (tech_pvt->owner && (tech_pvt->faxdetect || tech_pvt->ast_dsp)) {
f = ast_dsp_process(tech_pvt->owner, tech_pvt->dsp, &tech_pvt->frame);
if (f && f->frametype == AST_FRAME_DTMF){
if (globals.debug > 2) {
ast_log(LOG_NOTICE, "%s: Detected inband DTMF digit: %c\n",
self->name,
f->subclass);
}
}
//woomera_tx2ast_frm(tech_pvt, tech_pvt->frame.data, tech_pvt->frame.datalen);
}
if (globals.debug > 4) {
if (option_verbose > 2) {
ast_verbose(WOOMERA_DEBUG_PREFIX "+++READ %s %d\n",self->name, res);
ast_verbose(WOOMERA_DEBUG_PREFIX "+++READ %s %d coding %d\n",self->name, res,
tech_pvt->coding);
}
}
return &tech_pvt->frame;
return f;
}
/*--- tech_write: Write an audio frame to my channel
@ -3220,10 +3300,10 @@ static int tech_write(struct ast_channel *self, struct ast_frame *frame)
if(ast_test_flag(tech_pvt, TFLAG_MEDIA) && frame->datalen) {
if (frame->frametype == AST_FRAME_VOICE) {
if (default_profile.txgain_val) {
if (tech_pvt->profile->txgain_val) {
unsigned char *data=frame->data;
for (i=0;i<frame->datalen;i++) {
data[i]=default_profile.txgain[data[i]];
data[i]=tech_pvt->profile->txgain[data[i]];
}
}
@ -3237,6 +3317,8 @@ static int tech_write(struct ast_channel *self, struct ast_frame *frame)
ast_verbose(WOOMERA_DEBUG_PREFIX "+++WRITE %s %d\n",self->name, i);
}
}
} else {
ast_log(LOG_WARNING, "Invalid frame type %d sent\n", frame->frametype);
}
@ -3405,79 +3487,111 @@ static enum ast_bridge_result tech_bridge(struct ast_channel *c0, struct ast_cha
static int woomera_cli(int fd, int argc, char *argv[])
{
if (argc > 1) {
struct woomera_profile *profile;
char *profile_name="default";
if (argc > 2) {
profile_name=argv[1];
profile = ASTOBJ_CONTAINER_FIND(&woomera_profile_list, profile_name);
if (!profile) {
ast_cli(fd, "Woomera: Invalid profile name %s\n", profile_name);
return 0;
}
if (!strcmp(argv[1], "debug")) {
if (argc > 2) {
globals.debug = atoi(argv[2]);
if (!strcmp(argv[2], "debug")) {
if (argc > 3) {
globals.debug = atoi(argv[3]);
}
ast_cli(fd, "Woomera debug=%d\n", globals.debug);
} else if (!strcmp(argv[1], "call_status")) {
ast_cli(fd, "Woomera calls=%d tcalls=%d (out=%d in=%d ok=%d end=%d abort=%d)\n",
default_profile.call_count,
default_profile.call_out+default_profile.call_in,
default_profile.call_out,
default_profile.call_in,
default_profile.call_ok,
default_profile.call_end,
default_profile.call_abort);
} else if (!strcmp(argv[1], "version")) {
} else if (!strcmp(argv[2], "coding")) {
switch (profile->coding) {
case AST_FORMAT_ALAW:
ast_cli(fd, " Woomera {%s} coding=ALAW\n",profile_name);
break;
case AST_FORMAT_ULAW:
ast_cli(fd, " Woomera {%s} coding=ULAW\n",profile_name);
break;
case AST_FORMAT_SLINEAR:
ast_cli(fd, " Woomera {%s} coding=PMC-16\n",profile_name);
break;
default:
ast_cli(fd, " Woomera {%s} invalid coding=%d {internal error}",
profile_name,profile->coding);
break;
}
} else if (!strcmp(argv[2], "call_status")) {
ast_cli(fd, "Woomera {%s} calls=%d tcalls=%d (out=%d in=%d ok=%d end=%d abort=%d)\n",
profile->name,
profile->call_count,
profile->call_out+profile->call_in,
profile->call_out,
profile->call_in,
profile->call_ok,
profile->call_end,
profile->call_abort);
} else if (!strcmp(argv[2], "version")) {
ast_cli(fd, "Woomera version %s : SMG Version %s \n",
WOOMERA_VERSION,smgversion);
} else if (!strcmp(argv[1], "panic")) {
if (argc > 2) {
globals.panic = atoi(argv[2]);
} else if (!strcmp(argv[2], "panic")) {
if (argc > 3) {
globals.panic = atoi(argv[3]);
}
ast_cli(fd, "Woomera panic=%d \n", globals.panic);
} else if (!strcmp(argv[1], "rxgain")) {
} else if (!strcmp(argv[2], "rxgain")) {
float gain;
if (argc > 2) {
if (sscanf(argv[2], "%f", &gain) != 1) {
ast_cli(fd, "Woomera Invalid rxgain: %s\n",argv[2]);
if (argc > 3) {
if (sscanf(argv[3], "%f", &gain) != 1) {
ast_cli(fd, "Woomera Invalid rxgain: %s\n",argv[3]);
} else {
woomera_config_gain(&default_profile,gain,1);
woomera_config_gain(profile,gain,1);
}
}
ast_cli(fd, "Woomera rxgain: %f\n",default_profile.rxgain_val);
ast_cli(fd, "Woomera {%s} rxgain: %f\n",profile_name,profile->rxgain_val);
} else if (!strcmp(argv[1], "txgain")) {
} else if (!strcmp(argv[2], "txgain")) {
float gain;
if (argc > 2) {
if (sscanf(argv[2], "%f", &gain) != 1) {
ast_cli(fd, "Woomera Invalid txgain: %s\n",argv[2]);
if (argc > 3) {
if (sscanf(argv[3], "%f", &gain) != 1) {
ast_cli(fd, "Woomera Invalid txgain: %s\n",argv[3]);
} else {
woomera_config_gain(&default_profile,gain,0);
woomera_config_gain(profile,gain,0);
}
}
ast_cli(fd, "Woomera txgain: %f\n",default_profile.txgain_val);
ast_cli(fd, "Woomera {%s} txgain: %f\n",profile_name,profile->txgain_val);
} else if (!strcmp(argv[1], "threads")) {
ast_cli(fd, "chan_woomera is using %s threads!\n", globals.more_threads ? "more" : "less");
} else if (!strcmp(argv[2], "threads")) {
ast_cli(fd, "chan_woomera is using %s threads!\n",
globals.more_threads ? "more" : "less");
} else if (!strcmp(argv[1], "smgdebug")) {
} else if (!strcmp(argv[2], "smgdebug")) {
if (argc > 2) {
int smgdebug;
if (sscanf(argv[2], "%d", &smgdebug) != 1) {
ast_cli(fd, "Woomera Invalid smgdebug level: %s\n",argv[2]);
if (sscanf(argv[3], "%d", &smgdebug) != 1) {
ast_cli(fd, "Woomera Invalid smgdebug level: %s\n",argv[3]);
} else {
woomera_printf(NULL, default_profile.woomera_socket , "debug %d%s",
woomera_printf(NULL, profile->woomera_socket , "debug %d%s",
smgdebug,
WOOMERA_RECORD_SEPARATOR);
}
}
} else if (!strcmp(argv[1], "abort")) {
} else if (!strcmp(argv[2], "abort")) {
global_set_flag(TFLAG_ABORT);
}
} else {
ast_cli(fd, "Usage: woomera <debug> <level>\n");
ast_cli(fd, "Usage: woomera <profile> <cmd> <option>\n");
}
return 0;
}
@ -3633,6 +3747,7 @@ static int woomera_event_media (private_object *tech_pvt, woomera_message *wmsg)
{
char *raw_audio_header;
char *audio_codec;
char ip[25];
char *ptr;
int port = 0;
@ -3655,14 +3770,33 @@ static int woomera_event_media (private_object *tech_pvt, woomera_message *wmsg)
*ptr = '\0';
ptr++;
port = atoi(ptr);
} else if ((ptr=strchr(ip, ':'))) {
*ptr = '\0';
ptr++;
port = atoi(ptr);
}
#if 0
audio_codec = woomera_message_header(wmsg, "Receive-Audio-Codec");
if (audio_codec) {
if (!strcasecmp(audio_codec,"G.711-uLaw-64k")) {
tech_pvt->coding=AST_FORMAT_ULAW;
ast_log(LOG_NOTICE, "MEDIA GOT ULAW\n");
} else if (!strcasecmp(audio_codec,"G.711-aLaw-64k")) {
tech_pvt->coding=AST_FORMAT_ALAW;
ast_log(LOG_NOTICE, "MEDIA GOT ALAW\n");
}
}
#endif
/* Sanity Check */
owner = tech_get_owner(tech_pvt);
if (!owner) {
return -1;
}
/* If we are already in MEDIA mode then
* ignore this message */
if (ast_test_flag(tech_pvt, TFLAG_MEDIA)) {
@ -3734,6 +3868,7 @@ static int woomera_event_incoming (private_object *tech_pvt)
char *cid_rdnis;
char *tg_string="1";
char *pres_string;
char *screen_string;
int validext;
int presentation=0;
woomera_message wmsg;
@ -3768,10 +3903,13 @@ static int woomera_event_incoming (private_object *tech_pvt)
}
pres_string = woomera_message_header(&wmsg, "Presentation");
if (!pres_string || ast_strlen_zero(pres_string)) {
presentation=0;
} else {
presentation = atoi(pres_string);
if (pres_string && !ast_strlen_zero(pres_string)) {
presentation |= ( atoi(pres_string) << 5) & 0xF0;
}
screen_string = woomera_message_header(&wmsg, "Screening");
if (screen_string && !ast_strlen_zero(screen_string)) {
presentation |= atoi(screen_string) & 0x0F;
}
cid_name = ast_strdupa(woomera_message_header(&wmsg, "Remote-Name"));
@ -3807,12 +3945,12 @@ static int woomera_event_incoming (private_object *tech_pvt)
1,
owner->cid.cid_num);
if (globals.debug > 3){
ast_log(LOG_NOTICE, "Incoming Call exten %s@%s called %s pres = %d!\n",
if (globals.debug > 2){
ast_log(LOG_NOTICE, "Incoming Call exten %s@%s called %s astpres = 0x%0X!\n",
exten,
owner->context,
tech_pvt->callid,
presentation);
owner->cid.cid_pres);
}
} else {

View File

@ -1,7 +1,7 @@
8
dir
206
223
svn://sangoma.freeswitch.org/sangoma_mgd/trunk/conf
svn://sangoma.freeswitch.org

View File

@ -1,332 +0,0 @@
Index: sangoma_mgd.c
===================================================================
--- sangoma_mgd.c (revision 206)
+++ sangoma_mgd.c (working copy)
@@ -8,6 +8,11 @@
* the GNU General Public License
*
* =============================================
+ * v1.12 Nenad Corbic <ncorbic@sangoma.com>
+ * Fixed CCR
+ * Removed socket shutdown on end call.
+ * Let Media thread shutodwn sockets.
+ *
* v1.11 Nenad Corbic <ncorbic@sangoma.com>
* Fixed Remote asterisk/woomera connection
* Increased socket timeouts
@@ -100,13 +105,19 @@
#define SMG_DTMF_OFF 50
#define SMG_DTMF_RATE 8000
-#define SMG_VERSION "v1.11"
+#define SMG_VERSION "v1.12"
/* enable early media */
#if 1
#define WOOMERA_EARLY_MEDIA 1
#endif
+#if 0
+#warning "NENAD: MEDIA SHUTDOWN"
+#define MEDIA_SOCK_SHUTDOWN 1
+#endif
+
+
#ifdef DOTRACE
static int tc = 0;
#endif
@@ -133,7 +144,7 @@
const char WELCOME_TEXT[] =
"================================================================================\n"
-"Sangoma Media Gateway Daemon v1.11 \n"
+"Sangoma Media Gateway Daemon v1.12 \n"
"TDM Signal Media Gateway for Sangoma/Wanpipe Cards\n"
"Copyright 2005, 2006, 2007 \n"
"Anthony Minessale II <anthmct@yahoo.com>, Nenad Corbic <ncorbic@sangoma.com>\n"
@@ -1116,10 +1127,16 @@
res = 1;
} else if ((pfds[0].revents & POLLERR)) {
res = -1;
+ } else if ((pfds[0].revents & POLLNVAL)) {
+ res = -2;
+#if 0
+ log_printf(0, server.log,"System Warning: Poll Event NVAL (0x%X) (fd=%i)!\n",
+ pfds[0].revents, fd);
+#endif
} else {
#if 0
- log_printf(0, server.log,"System Error: Poll Event Error no event (0x%X)!\n",
- pfds[0].revents);
+ log_printf(0, server.log,"System Error: Poll Event Error no event (0x%X) (fd=%i)!\n",
+ pfds[0].revents,fd);
#endif
res = -1;
}
@@ -1431,15 +1448,19 @@
unsigned char circuit_frame[1024];
char filename[100];
FILE *filed=NULL;
+ int loops=0;
sangoma_api_hdr_t hdrframe;
memset(&hdrframe,0,sizeof(hdrframe));
memset(circuit_frame,0,sizeof(circuit_frame));
+
+ ms->sangoma_sock = sangoma_open_tdmapi_span_chan(woomera->span+1, woomera->chan+1);
- log_printf(1, server.log, "Media Loop Started %s\n", woomera->interface);
-
- if ((ms->sangoma_sock = sangoma_create_socket_by_name(woomera->interface, NULL)) < 0) {
- log_printf(0, server.log, "WANPIPE Socket Error (%s) if=[%s] [w%ig%i]\n",
+ log_printf(1, server.log, "Media Loop Started %s fd=%i\n",
+ woomera->interface,ms->sangoma_sock);
+
+ if (ms->sangoma_sock < 0) {
+ log_printf(0, server.log, "WANPIPE MEDIA Socket Error (%s) if=[%s] [w%ig%i]\n",
strerror(errno), woomera->interface, woomera->span+1, woomera->chan+1);
errs++;
} else {
@@ -1475,22 +1496,36 @@
while ( woomera_test_flag(&server.master_connection, WFLAG_RUNNING) &&
!woomera_test_flag(woomera, WFLAG_MEDIA_END) &&
- (res = waitfor_socket(ms->sangoma_sock, 10000, POLLERR | POLLIN)) > -1) {
+ ((res = waitfor_socket(ms->sangoma_sock, 10000, POLLERR | POLLIN)) >= -2)) {
if (res == 0) {
//log_printf(4, server.log, "%s: TDM UDP Timeout !!!\n",
// woomera->interface);
/* NENAD Timeout thus just continue */
+ continue;
+ }
+
+ if (res == -2) {
+ close_socket(&ms->sangoma_sock);
+ ms->sangoma_sock = sangoma_open_tdmapi_span_chan(woomera->span+1, woomera->chan+1);
+ log_printf(0, server.log, "Media Loop Restart %s\n",
+ woomera->interface);
continue;
}
-
+
+ if (res < 0 ){
+ log_printf(0, server.log, "Media Loop Socket error %s\n",
+ woomera->interface);
+ break;
+ }
+
res = sangoma_readmsg_socket(ms->sangoma_sock,
&hdrframe,
sizeof(hdrframe),
circuit_frame,
sizeof(circuit_frame), 0);
if (res < 0) {
- log_printf(0, server.log, "TDM Loop ReadMsg Error: %s\n", strerror(errno));
+ log_printf(0, server.log, "TDM Loop ReadMsg Error: %s\n", strerror(errno), woomera->interface);
break;
}
@@ -1505,17 +1540,21 @@
fprintf(filed,"\n");
}
- res = sangoma_sendmsg_socket(ms->sangoma_sock,
+ sangoma_sendmsg_socket(ms->sangoma_sock,
&hdrframe,
sizeof(hdrframe),
circuit_frame,
res, 0);
-
+
+ res=0;
+
+ loops++;
}
if (res < 0) {
- log_printf(2, server.log, "Media Loop: socket error !\n");
+ log_printf(2, server.log, "Media Loop: socket error %s (fd=%i)!\n",
+ woomera->interface, ms->sangoma_sock);
}
@@ -1523,7 +1562,15 @@
fclose(filed);
}
- log_printf(0, server.log, "Media Loop Finished %s\n", woomera->interface);
+ sleep(1);
+
+ close_socket(&ms->sangoma_sock);
+
+ log_printf(1, server.log, "Media Loop Finished %s Master=%i MediaEnd=%i Loops=%i\n",
+ woomera->interface,
+ woomera_test_flag(&server.master_connection, WFLAG_RUNNING),
+ woomera_test_flag(woomera, WFLAG_MEDIA_END),loops);
+
return;
}
@@ -1562,6 +1609,8 @@
if (woomera->loop_tdm) {
media_loop_run(ms);
ms->udp_sock=-1;
+ woomera_set_flag(woomera, WFLAG_HANGUP);
+ woomera_clear_flag(woomera, WFLAG_MEDIA_TDM_RUNNING);
goto media_thread_exit;
}
@@ -1879,7 +1928,6 @@
media_session_free(ms);
-
log_printf(2, server.log, "MEDIA session for [%s] ended (ptr=%p)\n",
woomera->interface,woomera);
@@ -1921,13 +1969,28 @@
while ( woomera_test_flag(&server.master_connection, WFLAG_RUNNING) &&
!woomera_test_flag(woomera, WFLAG_MEDIA_END) &&
- (res = waitfor_socket(ms->sangoma_sock, 10000, POLLERR | POLLIN)) > -1) {
+ (res = waitfor_socket(ms->sangoma_sock, 10000, POLLERR | POLLIN)) >= -2) {
if (res == 0) {
//log_printf(4, server.log, "%s: TDM UDP Timeout !!!\n",
// woomera->interface);
/* NENAD Timeout thus just continue */
continue;
+ } else if (res == -2) {
+ close_socket(&ms->sangoma_sock);
+ ms->sangoma_sock = sangoma_open_tdmapi_span_chan(woomera->span+1, woomera->chan+1);
+ if (ms->sangoma_sock < 0) {
+ log_printf(0, server.log, "Media TDM Restart Failed%s\n",
+ woomera->interface);
+ break;
+ }
+ log_printf(0, server.log, "Media TDM Restart %s\n",
+ woomera->interface);
+ continue;
+ } else if (res < 0) {
+ log_printf(0, server.log, "Media TDM Sangoma Socket Error %s\n",
+ woomera->interface);
+ break;
}
res = sangoma_readmsg_socket(ms->sangoma_sock,
@@ -1960,6 +2023,7 @@
}
#endif
}
+
if (res < 0) {
log_printf(2, server.log, "Media TDM Thread: socket error !\n");
}
@@ -2615,16 +2679,18 @@
char *cause = woomera_message_header(wmsg, "cause");
woomera_set_cause(woomera, cause);
-
+
pthread_mutex_lock(&woomera->ms_lock);
if (woomera->ms) {
chan = woomera->ms->chan;
span = woomera->ms->span;
+#ifdef MEDIA_SOCK_SHUTDOWN
shutdown(woomera->ms->sangoma_sock, SHUT_RDWR);
shutdown(woomera->ms->udp_sock, SHUT_RDWR);
+#endif
}
pthread_mutex_unlock(&woomera->ms_lock);
-
+
log_printf(3, woomera->log, "WOOMERA CMD: Hangup Received: [%s] MEDIA EXIST\n",
woomera->interface);
@@ -3285,12 +3351,14 @@
} else {
+#ifdef MEDIA_SOCK_SHUTDOWN
pthread_mutex_lock(&woomera->ms_lock);
if (woomera->ms) {
shutdown(woomera->ms->sangoma_sock, SHUT_RDWR);
shutdown(woomera->ms->udp_sock, SHUT_RDWR);
}
pthread_mutex_unlock(&woomera->ms_lock);
+#endif
log_printf(0, server.log, "Event CALL START NACK on w%dg%d ptr=%p ms=%p\n",
woomera->span+1,woomera->chan+1,woomera,woomera->ms);
@@ -3504,12 +3572,14 @@
return;
}
+#ifdef MEDIA_SOCK_SHUTDOWN
pthread_mutex_lock(&woomera->ms_lock);
if (woomera->ms) {
shutdown(woomera->ms->sangoma_sock, SHUT_RDWR);
shutdown(woomera->ms->udp_sock, SHUT_RDWR);
}
pthread_mutex_unlock(&woomera->ms_lock);
+#endif
woomera_set_sig_cause(woomera,release_to_string(event->release_cause));
@@ -3827,15 +3897,19 @@
}
while (woomera_test_flag(&server.master_connection, WFLAG_RUNNING) &&
- woomera_test_flag(&server.master_connection, WFLAG_MONITOR_RUNNING) &&
- woomera_test_flag(woomera, WFLAG_RUNNING) &&
- !woomera_test_flag(woomera, WFLAG_HANGUP) &&
- !master_reset) {
+ woomera_test_flag(&server.master_connection, WFLAG_MONITOR_RUNNING) &&
+ !woomera_test_flag(woomera, WFLAG_MEDIA_END) &&
+ !woomera_test_flag(woomera, WFLAG_HANGUP)) {
sleep(1);
continue;
}
+
+ log_printf(2, server.log, "Woomera Session: For Loop Test exiting %s\n",woomera->interface);
+
+
+
return;
}
@@ -4183,7 +4257,7 @@
woomera->index_hold=0;
}
- log_printf(2, woomera->log, "Thread Finished %u\n", (unsigned long) woomera->thread);
+ log_printf(2, woomera->log, "Woomera Thread Finished %u\n", (unsigned long) woomera->thread);
close_socket(&woomera->socket);
woomera->socket=-1;
@@ -4390,6 +4464,13 @@
if (1) {
int span,chan;
call_signal_event_t event;
+#if 0
+ span=1;
+ chan=30;
+ event.span=span;
+ event.chan=chan;
+ launch_woomera_loop_thread(&event);
+#else
for (span=0;span<8;span++) {
for (chan=0;chan<31;chan++) {
event.span=span;
@@ -4397,6 +4478,7 @@
launch_woomera_loop_thread(&event);
}
}
+#endif
}
#endif

View File

@ -65,7 +65,6 @@ echo "Checking logrotate ..."
eval "type logrotate" > /dev/null 2> /dev/null
if [ $? -ne 0 ]; then
echo "Error: Logrotate not found !"
exit 1;
fi
if [ -e /etc/logrotate.d ] && [ -e /etc/logrotate.d/syslog ]; then
@ -86,12 +85,20 @@ if [ -e /etc/logrotate.d ] && [ -e /etc/logrotate.d/syslog ]; then
else
echo "Error: Logrotate dir: /etc/logrotate.d not found !"
exit 1;
fi
echo "OK."
echo
echo "Checking for SCTP...."
if [ ! -e /usr/include/netinet/sctp.h ]; then
echo "Please install SCTP devel package: yum install lksctp-tools-devel"
echo
exit 1
fi
echo "OK."
echo
echo "Compiling Sangoma MGD ..."
make clean
make
@ -103,7 +110,18 @@ echo "Ok."
echo "Compiling Woomera Channel ..."
cp -f g711.h /usr/src/asterisk
if [ ! -e /usr/src/asterisk ]; then
echo
echo "Error: /usr/src/asterisk directory does not exist!"
echo " Please create symlink /usr/src/asterisk and"
echo " point to existing asterisk source!"
echo " Then re run ./install.sh "
echo
exit 1
fi
cp -f g711.h /usr/src/asterisk/
perl /usr/src/asterisk/contrib/scripts/astxs -install chan_woomera.c
if [ $? -ne 0 ]; then
exit 1;

View File

@ -1,16 +1,31 @@
8
dir
206
223
svn://sangoma.freeswitch.org/sangoma_mgd/trunk/lib
svn://sangoma.freeswitch.org
2006-11-06T21:37:44.054312Z
118
2007-06-21T22:15:47.596766Z
219
ncorbic
svn:special svn:externals svn:needs-lock
2028fedf-720c-0410-83b8-d54a3e729fb0
libteletone
dir

View File

@ -0,0 +1,52 @@
8
dir
223
svn://sangoma.freeswitch.org/sangoma_mgd/trunk/lib/libteletone/.deps
svn://sangoma.freeswitch.org
2007-06-21T22:15:47.596766Z
219
ncorbic
svn:special svn:externals svn:needs-lock
2028fedf-720c-0410-83b8-d54a3e729fb0
libteletone_la-libteletone_detect.Plo
file
2007-07-10T21:30:07.000000Z
fc88672102538198c5fcc7b0a0cfc4b9
2007-06-21T22:15:47.596766Z
219
ncorbic
libteletone_la-libteletone_generate.Plo
file
2007-07-10T21:30:07.000000Z
c763fc59d24f080c3a707e2f0454808c
2007-06-21T22:15:47.596766Z
219
ncorbic

View File

@ -0,0 +1 @@
8

View File

@ -0,0 +1,164 @@
libteletone_la-libteletone_detect.lo libteletone_la-libteletone_detect.o: \
src/libteletone_detect.c src/libteletone_detect.h src/libteletone.h \
src/libteletone_generate.h /usr/include/stdio.h /usr/include/features.h \
/usr/include/sys/cdefs.h /usr/include/bits/wordsize.h \
/usr/include/gnu/stubs.h /usr/include/gnu/stubs-32.h \
/usr/lib/gcc/i386-redhat-linux/4.1.1/include/stddef.h \
/usr/include/bits/types.h /usr/include/bits/typesizes.h \
/usr/include/libio.h /usr/include/_G_config.h /usr/include/wchar.h \
/usr/include/bits/wchar.h /usr/include/gconv.h \
/usr/lib/gcc/i386-redhat-linux/4.1.1/include/stdarg.h \
/usr/include/bits/stdio_lim.h /usr/include/bits/sys_errlist.h \
/usr/include/bits/stdio.h /usr/include/stdlib.h \
/usr/include/bits/waitflags.h /usr/include/bits/waitstatus.h \
/usr/include/endian.h /usr/include/bits/endian.h /usr/include/xlocale.h \
/usr/include/sys/types.h /usr/include/time.h /usr/include/sys/select.h \
/usr/include/bits/select.h /usr/include/bits/sigset.h \
/usr/include/bits/time.h /usr/include/sys/sysmacros.h \
/usr/include/bits/pthreadtypes.h /usr/include/alloca.h \
/usr/include/stdint.h /usr/include/sys/stat.h /usr/include/bits/stat.h \
/usr/include/fcntl.h /usr/include/bits/fcntl.h /usr/include/bits/uio.h \
/usr/include/math.h /usr/include/bits/huge_val.h \
/usr/include/bits/huge_valf.h /usr/include/bits/huge_vall.h \
/usr/include/bits/inf.h /usr/include/bits/nan.h \
/usr/include/bits/mathdef.h /usr/include/bits/mathcalls.h \
/usr/include/bits/mathinline.h /usr/include/string.h \
/usr/include/bits/string.h /usr/include/bits/string2.h \
/usr/include/errno.h /usr/include/bits/errno.h \
/usr/include/linux/errno.h /usr/include/asm/errno.h \
/usr/include/asm-generic/errno.h /usr/include/asm-generic/errno-base.h \
/usr/include/unistd.h /usr/include/bits/posix_opt.h \
/usr/include/bits/environments.h /usr/include/bits/confname.h \
/usr/include/getopt.h /usr/include/assert.h
src/libteletone_detect.h:
src/libteletone.h:
src/libteletone_generate.h:
/usr/include/stdio.h:
/usr/include/features.h:
/usr/include/sys/cdefs.h:
/usr/include/bits/wordsize.h:
/usr/include/gnu/stubs.h:
/usr/include/gnu/stubs-32.h:
/usr/lib/gcc/i386-redhat-linux/4.1.1/include/stddef.h:
/usr/include/bits/types.h:
/usr/include/bits/typesizes.h:
/usr/include/libio.h:
/usr/include/_G_config.h:
/usr/include/wchar.h:
/usr/include/bits/wchar.h:
/usr/include/gconv.h:
/usr/lib/gcc/i386-redhat-linux/4.1.1/include/stdarg.h:
/usr/include/bits/stdio_lim.h:
/usr/include/bits/sys_errlist.h:
/usr/include/bits/stdio.h:
/usr/include/stdlib.h:
/usr/include/bits/waitflags.h:
/usr/include/bits/waitstatus.h:
/usr/include/endian.h:
/usr/include/bits/endian.h:
/usr/include/xlocale.h:
/usr/include/sys/types.h:
/usr/include/time.h:
/usr/include/sys/select.h:
/usr/include/bits/select.h:
/usr/include/bits/sigset.h:
/usr/include/bits/time.h:
/usr/include/sys/sysmacros.h:
/usr/include/bits/pthreadtypes.h:
/usr/include/alloca.h:
/usr/include/stdint.h:
/usr/include/sys/stat.h:
/usr/include/bits/stat.h:
/usr/include/fcntl.h:
/usr/include/bits/fcntl.h:
/usr/include/bits/uio.h:
/usr/include/math.h:
/usr/include/bits/huge_val.h:
/usr/include/bits/huge_valf.h:
/usr/include/bits/huge_vall.h:
/usr/include/bits/inf.h:
/usr/include/bits/nan.h:
/usr/include/bits/mathdef.h:
/usr/include/bits/mathcalls.h:
/usr/include/bits/mathinline.h:
/usr/include/string.h:
/usr/include/bits/string.h:
/usr/include/bits/string2.h:
/usr/include/errno.h:
/usr/include/bits/errno.h:
/usr/include/linux/errno.h:
/usr/include/asm/errno.h:
/usr/include/asm-generic/errno.h:
/usr/include/asm-generic/errno-base.h:
/usr/include/unistd.h:
/usr/include/bits/posix_opt.h:
/usr/include/bits/environments.h:
/usr/include/bits/confname.h:
/usr/include/getopt.h:
/usr/include/assert.h:

View File

@ -0,0 +1,165 @@
libteletone_la-libteletone_generate.lo \
libteletone_la-libteletone_generate.o: src/libteletone_generate.c \
src/libteletone.h src/libteletone_generate.h /usr/include/stdio.h \
/usr/include/features.h /usr/include/sys/cdefs.h \
/usr/include/bits/wordsize.h /usr/include/gnu/stubs.h \
/usr/include/gnu/stubs-32.h \
/usr/lib/gcc/i386-redhat-linux/4.1.1/include/stddef.h \
/usr/include/bits/types.h /usr/include/bits/typesizes.h \
/usr/include/libio.h /usr/include/_G_config.h /usr/include/wchar.h \
/usr/include/bits/wchar.h /usr/include/gconv.h \
/usr/lib/gcc/i386-redhat-linux/4.1.1/include/stdarg.h \
/usr/include/bits/stdio_lim.h /usr/include/bits/sys_errlist.h \
/usr/include/bits/stdio.h /usr/include/stdlib.h \
/usr/include/bits/waitflags.h /usr/include/bits/waitstatus.h \
/usr/include/endian.h /usr/include/bits/endian.h /usr/include/xlocale.h \
/usr/include/sys/types.h /usr/include/time.h /usr/include/sys/select.h \
/usr/include/bits/select.h /usr/include/bits/sigset.h \
/usr/include/bits/time.h /usr/include/sys/sysmacros.h \
/usr/include/bits/pthreadtypes.h /usr/include/alloca.h \
/usr/include/stdint.h /usr/include/sys/stat.h /usr/include/bits/stat.h \
/usr/include/fcntl.h /usr/include/bits/fcntl.h /usr/include/bits/uio.h \
/usr/include/math.h /usr/include/bits/huge_val.h \
/usr/include/bits/huge_valf.h /usr/include/bits/huge_vall.h \
/usr/include/bits/inf.h /usr/include/bits/nan.h \
/usr/include/bits/mathdef.h /usr/include/bits/mathcalls.h \
/usr/include/bits/mathinline.h /usr/include/string.h \
/usr/include/bits/string.h /usr/include/bits/string2.h \
/usr/include/errno.h /usr/include/bits/errno.h \
/usr/include/linux/errno.h /usr/include/asm/errno.h \
/usr/include/asm-generic/errno.h /usr/include/asm-generic/errno-base.h \
/usr/include/unistd.h /usr/include/bits/posix_opt.h \
/usr/include/bits/environments.h /usr/include/bits/confname.h \
/usr/include/getopt.h /usr/include/assert.h src/libteletone_detect.h
src/libteletone.h:
src/libteletone_generate.h:
/usr/include/stdio.h:
/usr/include/features.h:
/usr/include/sys/cdefs.h:
/usr/include/bits/wordsize.h:
/usr/include/gnu/stubs.h:
/usr/include/gnu/stubs-32.h:
/usr/lib/gcc/i386-redhat-linux/4.1.1/include/stddef.h:
/usr/include/bits/types.h:
/usr/include/bits/typesizes.h:
/usr/include/libio.h:
/usr/include/_G_config.h:
/usr/include/wchar.h:
/usr/include/bits/wchar.h:
/usr/include/gconv.h:
/usr/lib/gcc/i386-redhat-linux/4.1.1/include/stdarg.h:
/usr/include/bits/stdio_lim.h:
/usr/include/bits/sys_errlist.h:
/usr/include/bits/stdio.h:
/usr/include/stdlib.h:
/usr/include/bits/waitflags.h:
/usr/include/bits/waitstatus.h:
/usr/include/endian.h:
/usr/include/bits/endian.h:
/usr/include/xlocale.h:
/usr/include/sys/types.h:
/usr/include/time.h:
/usr/include/sys/select.h:
/usr/include/bits/select.h:
/usr/include/bits/sigset.h:
/usr/include/bits/time.h:
/usr/include/sys/sysmacros.h:
/usr/include/bits/pthreadtypes.h:
/usr/include/alloca.h:
/usr/include/stdint.h:
/usr/include/sys/stat.h:
/usr/include/bits/stat.h:
/usr/include/fcntl.h:
/usr/include/bits/fcntl.h:
/usr/include/bits/uio.h:
/usr/include/math.h:
/usr/include/bits/huge_val.h:
/usr/include/bits/huge_valf.h:
/usr/include/bits/huge_vall.h:
/usr/include/bits/inf.h:
/usr/include/bits/nan.h:
/usr/include/bits/mathdef.h:
/usr/include/bits/mathcalls.h:
/usr/include/bits/mathinline.h:
/usr/include/string.h:
/usr/include/bits/string.h:
/usr/include/bits/string2.h:
/usr/include/errno.h:
/usr/include/bits/errno.h:
/usr/include/linux/errno.h:
/usr/include/asm/errno.h:
/usr/include/asm-generic/errno.h:
/usr/include/asm-generic/errno-base.h:
/usr/include/unistd.h:
/usr/include/bits/posix_opt.h:
/usr/include/bits/environments.h:
/usr/include/bits/confname.h:
/usr/include/getopt.h:
/usr/include/assert.h:
src/libteletone_detect.h:

View File

@ -1,37 +1,43 @@
libteletone_la-libteletone_detect.lo libteletone_la-libteletone_detect.o: \
src/libteletone_detect.c /usr/include/math.h /usr/include/features.h \
src/libteletone_detect.c src/libteletone_detect.h src/libteletone.h \
src/libteletone_generate.h /usr/include/stdio.h /usr/include/features.h \
/usr/include/sys/cdefs.h /usr/include/bits/wordsize.h \
/usr/include/gnu/stubs.h /usr/include/gnu/stubs-32.h \
/usr/include/bits/huge_val.h /usr/include/bits/huge_valf.h \
/usr/include/bits/huge_vall.h /usr/include/bits/inf.h \
/usr/include/bits/nan.h /usr/include/bits/mathdef.h \
/usr/include/bits/mathcalls.h /usr/include/bits/mathinline.h \
/usr/include/stdint.h /usr/include/bits/wchar.h /usr/include/string.h \
/usr/lib/gcc/i386-redhat-linux/4.1.1/include/stddef.h \
/usr/include/xlocale.h /usr/include/bits/string.h \
/usr/include/bits/string2.h /usr/include/endian.h \
/usr/include/bits/endian.h /usr/include/bits/types.h \
/usr/include/bits/typesizes.h /usr/include/stdlib.h \
/usr/include/stdio.h /usr/include/libio.h /usr/include/_G_config.h \
/usr/include/wchar.h /usr/include/gconv.h \
/usr/include/bits/types.h /usr/include/bits/typesizes.h \
/usr/include/libio.h /usr/include/_G_config.h /usr/include/wchar.h \
/usr/include/bits/wchar.h /usr/include/gconv.h \
/usr/lib/gcc/i386-redhat-linux/4.1.1/include/stdarg.h \
/usr/include/bits/stdio_lim.h /usr/include/bits/sys_errlist.h \
/usr/include/bits/stdio.h /usr/include/time.h /usr/include/bits/time.h \
/usr/include/fcntl.h /usr/include/bits/fcntl.h /usr/include/sys/types.h \
/usr/include/sys/select.h /usr/include/bits/select.h \
/usr/include/bits/sigset.h /usr/include/sys/sysmacros.h \
/usr/include/bits/pthreadtypes.h /usr/include/bits/uio.h \
/usr/include/sys/stat.h /usr/include/bits/stat.h \
src/libteletone_detect.h src/libteletone.h src/libteletone_generate.h \
/usr/include/bits/stdio.h /usr/include/stdlib.h \
/usr/include/bits/waitflags.h /usr/include/bits/waitstatus.h \
/usr/include/alloca.h /usr/include/unistd.h \
/usr/include/bits/posix_opt.h /usr/include/bits/environments.h \
/usr/include/bits/confname.h /usr/include/getopt.h /usr/include/errno.h \
/usr/include/bits/errno.h /usr/include/linux/errno.h \
/usr/include/asm/errno.h /usr/include/asm-generic/errno.h \
/usr/include/asm-generic/errno-base.h /usr/include/assert.h
/usr/include/endian.h /usr/include/bits/endian.h /usr/include/xlocale.h \
/usr/include/sys/types.h /usr/include/time.h /usr/include/sys/select.h \
/usr/include/bits/select.h /usr/include/bits/sigset.h \
/usr/include/bits/time.h /usr/include/sys/sysmacros.h \
/usr/include/bits/pthreadtypes.h /usr/include/alloca.h \
/usr/include/stdint.h /usr/include/sys/stat.h /usr/include/bits/stat.h \
/usr/include/fcntl.h /usr/include/bits/fcntl.h /usr/include/bits/uio.h \
/usr/include/math.h /usr/include/bits/huge_val.h \
/usr/include/bits/huge_valf.h /usr/include/bits/huge_vall.h \
/usr/include/bits/inf.h /usr/include/bits/nan.h \
/usr/include/bits/mathdef.h /usr/include/bits/mathcalls.h \
/usr/include/bits/mathinline.h /usr/include/string.h \
/usr/include/bits/string.h /usr/include/bits/string2.h \
/usr/include/errno.h /usr/include/bits/errno.h \
/usr/include/linux/errno.h /usr/include/asm/errno.h \
/usr/include/asm-generic/errno.h /usr/include/asm-generic/errno-base.h \
/usr/include/unistd.h /usr/include/bits/posix_opt.h \
/usr/include/bits/environments.h /usr/include/bits/confname.h \
/usr/include/getopt.h /usr/include/assert.h
/usr/include/math.h:
src/libteletone_detect.h:
src/libteletone.h:
src/libteletone_generate.h:
/usr/include/stdio.h:
/usr/include/features.h:
@ -43,6 +49,74 @@ libteletone_la-libteletone_detect.lo libteletone_la-libteletone_detect.o: \
/usr/include/gnu/stubs-32.h:
/usr/lib/gcc/i386-redhat-linux/4.1.1/include/stddef.h:
/usr/include/bits/types.h:
/usr/include/bits/typesizes.h:
/usr/include/libio.h:
/usr/include/_G_config.h:
/usr/include/wchar.h:
/usr/include/bits/wchar.h:
/usr/include/gconv.h:
/usr/lib/gcc/i386-redhat-linux/4.1.1/include/stdarg.h:
/usr/include/bits/stdio_lim.h:
/usr/include/bits/sys_errlist.h:
/usr/include/bits/stdio.h:
/usr/include/stdlib.h:
/usr/include/bits/waitflags.h:
/usr/include/bits/waitstatus.h:
/usr/include/endian.h:
/usr/include/bits/endian.h:
/usr/include/xlocale.h:
/usr/include/sys/types.h:
/usr/include/time.h:
/usr/include/sys/select.h:
/usr/include/bits/select.h:
/usr/include/bits/sigset.h:
/usr/include/bits/time.h:
/usr/include/sys/sysmacros.h:
/usr/include/bits/pthreadtypes.h:
/usr/include/alloca.h:
/usr/include/stdint.h:
/usr/include/sys/stat.h:
/usr/include/bits/stat.h:
/usr/include/fcntl.h:
/usr/include/bits/fcntl.h:
/usr/include/bits/uio.h:
/usr/include/math.h:
/usr/include/bits/huge_val.h:
/usr/include/bits/huge_valf.h:
@ -59,96 +133,12 @@ libteletone_la-libteletone_detect.lo libteletone_la-libteletone_detect.o: \
/usr/include/bits/mathinline.h:
/usr/include/stdint.h:
/usr/include/bits/wchar.h:
/usr/include/string.h:
/usr/lib/gcc/i386-redhat-linux/4.1.1/include/stddef.h:
/usr/include/xlocale.h:
/usr/include/bits/string.h:
/usr/include/bits/string2.h:
/usr/include/endian.h:
/usr/include/bits/endian.h:
/usr/include/bits/types.h:
/usr/include/bits/typesizes.h:
/usr/include/stdlib.h:
/usr/include/stdio.h:
/usr/include/libio.h:
/usr/include/_G_config.h:
/usr/include/wchar.h:
/usr/include/gconv.h:
/usr/lib/gcc/i386-redhat-linux/4.1.1/include/stdarg.h:
/usr/include/bits/stdio_lim.h:
/usr/include/bits/sys_errlist.h:
/usr/include/bits/stdio.h:
/usr/include/time.h:
/usr/include/bits/time.h:
/usr/include/fcntl.h:
/usr/include/bits/fcntl.h:
/usr/include/sys/types.h:
/usr/include/sys/select.h:
/usr/include/bits/select.h:
/usr/include/bits/sigset.h:
/usr/include/sys/sysmacros.h:
/usr/include/bits/pthreadtypes.h:
/usr/include/bits/uio.h:
/usr/include/sys/stat.h:
/usr/include/bits/stat.h:
src/libteletone_detect.h:
src/libteletone.h:
src/libteletone_generate.h:
/usr/include/bits/waitflags.h:
/usr/include/bits/waitstatus.h:
/usr/include/alloca.h:
/usr/include/unistd.h:
/usr/include/bits/posix_opt.h:
/usr/include/bits/environments.h:
/usr/include/bits/confname.h:
/usr/include/getopt.h:
/usr/include/errno.h:
/usr/include/bits/errno.h:
@ -161,4 +151,14 @@ src/libteletone_generate.h:
/usr/include/asm-generic/errno-base.h:
/usr/include/unistd.h:
/usr/include/bits/posix_opt.h:
/usr/include/bits/environments.h:
/usr/include/bits/confname.h:
/usr/include/getopt.h:
/usr/include/assert.h:

View File

@ -1,43 +1,42 @@
libteletone_la-libteletone_generate.lo \
libteletone_la-libteletone_generate.o: src/libteletone_generate.c \
src/libteletone.h src/libteletone_generate.h /usr/include/stdlib.h \
src/libteletone.h src/libteletone_generate.h /usr/include/stdio.h \
/usr/include/features.h /usr/include/sys/cdefs.h \
/usr/include/bits/wordsize.h /usr/include/gnu/stubs.h \
/usr/include/gnu/stubs-32.h \
/usr/lib/gcc/i386-redhat-linux/4.1.1/include/stddef.h \
/usr/include/bits/waitflags.h /usr/include/bits/waitstatus.h \
/usr/include/endian.h /usr/include/bits/endian.h /usr/include/xlocale.h \
/usr/include/sys/types.h /usr/include/bits/types.h \
/usr/include/bits/typesizes.h /usr/include/time.h \
/usr/include/sys/select.h /usr/include/bits/select.h \
/usr/include/bits/sigset.h /usr/include/bits/time.h \
/usr/include/sys/sysmacros.h /usr/include/bits/pthreadtypes.h \
/usr/include/alloca.h /usr/include/stdio.h /usr/include/libio.h \
/usr/include/_G_config.h /usr/include/wchar.h /usr/include/bits/wchar.h \
/usr/include/gconv.h \
/usr/include/bits/types.h /usr/include/bits/typesizes.h \
/usr/include/libio.h /usr/include/_G_config.h /usr/include/wchar.h \
/usr/include/bits/wchar.h /usr/include/gconv.h \
/usr/lib/gcc/i386-redhat-linux/4.1.1/include/stdarg.h \
/usr/include/bits/stdio_lim.h /usr/include/bits/sys_errlist.h \
/usr/include/bits/stdio.h /usr/include/string.h \
/usr/include/bits/string.h /usr/include/bits/string2.h \
/usr/include/bits/stdio.h /usr/include/stdlib.h \
/usr/include/bits/waitflags.h /usr/include/bits/waitstatus.h \
/usr/include/endian.h /usr/include/bits/endian.h /usr/include/xlocale.h \
/usr/include/sys/types.h /usr/include/time.h /usr/include/sys/select.h \
/usr/include/bits/select.h /usr/include/bits/sigset.h \
/usr/include/bits/time.h /usr/include/sys/sysmacros.h \
/usr/include/bits/pthreadtypes.h /usr/include/alloca.h \
/usr/include/stdint.h /usr/include/sys/stat.h /usr/include/bits/stat.h \
/usr/include/fcntl.h /usr/include/bits/fcntl.h /usr/include/bits/uio.h \
/usr/include/math.h /usr/include/bits/huge_val.h \
/usr/include/bits/huge_valf.h /usr/include/bits/huge_vall.h \
/usr/include/bits/inf.h /usr/include/bits/nan.h \
/usr/include/bits/mathdef.h /usr/include/bits/mathcalls.h \
/usr/include/bits/mathinline.h /usr/include/unistd.h \
/usr/include/bits/posix_opt.h /usr/include/bits/environments.h \
/usr/include/bits/confname.h /usr/include/getopt.h /usr/include/fcntl.h \
/usr/include/bits/fcntl.h /usr/include/bits/uio.h \
/usr/include/sys/stat.h /usr/include/bits/stat.h /usr/include/errno.h \
/usr/include/bits/errno.h /usr/include/linux/errno.h \
/usr/include/asm/errno.h /usr/include/asm-generic/errno.h \
/usr/include/asm-generic/errno-base.h /usr/include/assert.h \
src/libteletone_detect.h
/usr/include/bits/mathinline.h /usr/include/string.h \
/usr/include/bits/string.h /usr/include/bits/string2.h \
/usr/include/errno.h /usr/include/bits/errno.h \
/usr/include/linux/errno.h /usr/include/asm/errno.h \
/usr/include/asm-generic/errno.h /usr/include/asm-generic/errno-base.h \
/usr/include/unistd.h /usr/include/bits/posix_opt.h \
/usr/include/bits/environments.h /usr/include/bits/confname.h \
/usr/include/getopt.h /usr/include/assert.h src/libteletone_detect.h
src/libteletone.h:
src/libteletone_generate.h:
/usr/include/stdlib.h:
/usr/include/stdio.h:
/usr/include/features.h:
@ -51,40 +50,10 @@ src/libteletone_generate.h:
/usr/lib/gcc/i386-redhat-linux/4.1.1/include/stddef.h:
/usr/include/bits/waitflags.h:
/usr/include/bits/waitstatus.h:
/usr/include/endian.h:
/usr/include/bits/endian.h:
/usr/include/xlocale.h:
/usr/include/sys/types.h:
/usr/include/bits/types.h:
/usr/include/bits/typesizes.h:
/usr/include/time.h:
/usr/include/sys/select.h:
/usr/include/bits/select.h:
/usr/include/bits/sigset.h:
/usr/include/bits/time.h:
/usr/include/sys/sysmacros.h:
/usr/include/bits/pthreadtypes.h:
/usr/include/alloca.h:
/usr/include/stdio.h:
/usr/include/libio.h:
/usr/include/_G_config.h:
@ -103,11 +72,47 @@ src/libteletone_generate.h:
/usr/include/bits/stdio.h:
/usr/include/string.h:
/usr/include/stdlib.h:
/usr/include/bits/string.h:
/usr/include/bits/waitflags.h:
/usr/include/bits/string2.h:
/usr/include/bits/waitstatus.h:
/usr/include/endian.h:
/usr/include/bits/endian.h:
/usr/include/xlocale.h:
/usr/include/sys/types.h:
/usr/include/time.h:
/usr/include/sys/select.h:
/usr/include/bits/select.h:
/usr/include/bits/sigset.h:
/usr/include/bits/time.h:
/usr/include/sys/sysmacros.h:
/usr/include/bits/pthreadtypes.h:
/usr/include/alloca.h:
/usr/include/stdint.h:
/usr/include/sys/stat.h:
/usr/include/bits/stat.h:
/usr/include/fcntl.h:
/usr/include/bits/fcntl.h:
/usr/include/bits/uio.h:
/usr/include/math.h:
@ -127,25 +132,11 @@ src/libteletone_generate.h:
/usr/include/bits/mathinline.h:
/usr/include/unistd.h:
/usr/include/string.h:
/usr/include/bits/posix_opt.h:
/usr/include/bits/string.h:
/usr/include/bits/environments.h:
/usr/include/bits/confname.h:
/usr/include/getopt.h:
/usr/include/fcntl.h:
/usr/include/bits/fcntl.h:
/usr/include/bits/uio.h:
/usr/include/sys/stat.h:
/usr/include/bits/stat.h:
/usr/include/bits/string2.h:
/usr/include/errno.h:
@ -159,6 +150,16 @@ src/libteletone_generate.h:
/usr/include/asm-generic/errno-base.h:
/usr/include/unistd.h:
/usr/include/bits/posix_opt.h:
/usr/include/bits/environments.h:
/usr/include/bits/confname.h:
/usr/include/getopt.h:
/usr/include/assert.h:
src/libteletone_detect.h:

View File

@ -0,0 +1,98 @@
8
dir
223
svn://sangoma.freeswitch.org/sangoma_mgd/trunk/lib/libteletone/.libs
svn://sangoma.freeswitch.org
2007-06-21T22:15:47.596766Z
219
ncorbic
svn:special svn:externals svn:needs-lock
2028fedf-720c-0410-83b8-d54a3e729fb0
libteletone.so.0.0.0
file
2007-07-10T21:30:07.000000Z
505f45e4811eaaa495b958ff83d2274d
2007-06-21T22:15:47.596766Z
219
ncorbic
has-props
libteletone.so.0
file
2007-07-10T21:30:07.000000Z
4ad1af4c6e6832237d1c2671566d2b82
2007-06-21T22:15:47.596766Z
219
ncorbic
has-props
svn:special
libteletone.a
file
2007-07-10T21:30:07.000000Z
c98847c9e217b025c8af9e1b8c96cd29
2007-06-21T22:15:47.596766Z
219
ncorbic
has-props
libteletone.so
file
2007-07-10T21:30:07.000000Z
4ad1af4c6e6832237d1c2671566d2b82
2007-06-21T22:15:47.596766Z
219
ncorbic
has-props
svn:special
libteletone.lai
file
2007-07-10T21:30:07.000000Z
1637f9859c7bf61a6dc08ea2afa9a00a
2007-06-21T22:15:47.596766Z
219
ncorbic

View File

@ -0,0 +1 @@
8

View File

@ -0,0 +1,9 @@
K 14
svn:executable
V 1
*
K 13
svn:mime-type
V 24
application/octet-stream
END

View File

@ -0,0 +1,5 @@
K 11
svn:special
V 1
*
END

View File

@ -0,0 +1,5 @@
K 11
svn:special
V 1
*
END

View File

@ -0,0 +1,35 @@
# libteletone.la - a libtool library file
# Generated by ltmain.sh - GNU libtool 1.5.8 (1.1220.2.117 2004/08/04 14:12:05)
#
# Please DO NOT delete this file!
# It is necessary for linking the library.
# The name that we can dlopen(3).
dlname='libteletone.so.0'
# Names of this library.
library_names='libteletone.so.0.0.0 libteletone.so.0 libteletone.so'
# The name of the static archive.
old_library='libteletone.a'
# Libraries that this one depends upon.
dependency_libs=' -lm'
# Version information for libteletone.
current=0
age=0
revision=0
# Is this an already installed library?
installed=yes
# Should we warn about portability when linking against -modules?
shouldnotlink=no
# Files to dlopen/dlpreopen
dlopen=''
dlpreopen=''
# Directory that this library needs to be installed in:
libdir='/usr/local/lib'

View File

@ -0,0 +1 @@
link libteletone.so.0.0.0

View File

@ -0,0 +1 @@
link libteletone.so.0.0.0

View File

@ -0,0 +1,35 @@
# libteletone.la - a libtool library file
# Generated by ltmain.sh - GNU libtool 1.5.8 (1.1220.2.117 2004/08/04 14:12:05)
#
# Please DO NOT delete this file!
# It is necessary for linking the library.
# The name that we can dlopen(3).
dlname='libteletone.so.0'
# Names of this library.
library_names='libteletone.so.0.0.0 libteletone.so.0 libteletone.so'
# The name of the static archive.
old_library='libteletone.a'
# Libraries that this one depends upon.
dependency_libs=' -lm'
# Version information for libteletone.
current=0
age=0
revision=0
# Is this an already installed library?
installed=yes
# Should we warn about portability when linking against -modules?
shouldnotlink=no
# Files to dlopen/dlpreopen
dlopen=''
dlpreopen=''
# Directory that this library needs to be installed in:
libdir='/usr/local/lib'

View File

@ -0,0 +1 @@
libteletone.so.0.0.0

View File

@ -0,0 +1 @@
libteletone.so.0.0.0

View File

@ -1,2 +0,0 @@
This is a Subversion working copy administrative directory.
Visit http://subversion.tigris.org/ for more information.

View File

@ -1,6 +0,0 @@
K 10
svn:ignore
V 2
*
END

View File

@ -1,6 +0,0 @@
K 10
svn:ignore
V 2
*
END

View File

@ -1,5 +0,0 @@
K 25
svn:wc:ra_dav:version-url
V 52
/svn/!svn/ver/1562/freeswitch/trunk/libs/libteletone
END

View File

@ -1,206 +1,354 @@
<?xml version="1.0" encoding="utf-8"?>
<wc-entries
xmlns="svn:">
<entry
committed-rev="1562"
name=""
committed-date="2006-06-07T22:26:12.605661Z"
url="http://svn.freeswitch.org/svn/freeswitch/trunk/libs/libteletone"
last-author="mikej"
kind="dir"
uuid="d0543943-73ff-0310-b7d9-9358b9ac24b2"
prop-time="2006-06-27T15:15:56.000000Z"
revision="1687"/>
<entry
committed-rev="629"
name="mkinstalldirs"
text-time="2006-06-27T15:15:56.000000Z"
committed-date="2006-02-19T20:28:24.791837Z"
checksum="792922784eade1d03ecb1b33ba8bb7c3"
last-author="anthm"
kind="file"
prop-time="2006-06-27T15:15:29.000000Z"/>
<entry
committed-rev="630"
name="configure"
text-time="2006-06-27T15:15:56.000000Z"
committed-date="2006-02-19T20:30:51.882096Z"
checksum="28023e66f3a078df20ba80031d144952"
last-author="anthm"
kind="file"
prop-time="2006-06-27T15:15:37.000000Z"/>
<entry
committed-rev="887"
name="Makefile.in"
text-time="2006-06-27T15:15:56.000000Z"
committed-date="2006-03-21T16:26:49.657459Z"
checksum="1b6345d4e9fd16e1096238cad862b547"
last-author="anthm"
kind="file"
prop-time="2006-06-27T15:15:38.000000Z"/>
<entry
committed-rev="629"
name="AUTHORS"
text-time="2006-06-27T15:15:56.000000Z"
committed-date="2006-02-19T20:28:24.791837Z"
checksum="2a307cc617b923385f157cc693f908e9"
last-author="anthm"
kind="file"
prop-time="2006-06-27T15:15:38.000000Z"/>
<entry
committed-rev="630"
name="configure.in"
text-time="2006-06-27T15:15:56.000000Z"
committed-date="2006-02-19T20:30:51.882096Z"
checksum="4b0bfa262e16e1c9538664e5b42a0134"
last-author="anthm"
kind="file"
prop-time="2006-06-27T15:15:38.000000Z"/>
<entry
committed-rev="629"
name="ChangeLog"
text-time="2006-06-27T15:15:56.000000Z"
committed-date="2006-02-19T20:28:24.791837Z"
checksum="d41d8cd98f00b204e9800998ecf8427e"
last-author="anthm"
kind="file"
prop-time="2006-06-27T15:15:39.000000Z"/>
<entry
committed-rev="629"
name="depcomp"
text-time="2006-06-27T15:15:56.000000Z"
committed-date="2006-02-19T20:28:24.791837Z"
checksum="7e26ecc61d5c27c50d334ebe19d5ef06"
last-author="anthm"
kind="file"
prop-time="2006-06-27T15:15:39.000000Z"/>
<entry
name="src"
kind="dir"/>
<entry
committed-rev="629"
name="compile"
text-time="2006-06-27T15:15:56.000000Z"
committed-date="2006-02-19T20:28:24.791837Z"
checksum="b2a35e98453194ca837c363ee9c0d379"
last-author="anthm"
kind="file"
prop-time="2006-06-27T15:15:40.000000Z"/>
<entry
committed-rev="629"
name="config.guess"
text-time="2006-06-27T15:15:56.000000Z"
committed-date="2006-02-19T20:28:24.791837Z"
checksum="e8f87acaddff75a691755466f0918100"
last-author="anthm"
kind="file"
prop-time="2006-06-27T15:15:40.000000Z"/>
<entry
committed-rev="629"
name="ltmain.sh"
text-time="2006-06-27T15:15:56.000000Z"
committed-date="2006-02-19T20:28:24.791837Z"
checksum="0f44520873ce706852086fc2ad45106f"
last-author="anthm"
kind="file"
prop-time="2006-06-27T15:15:47.000000Z"/>
<entry
committed-rev="629"
name="README"
text-time="2006-06-27T15:15:56.000000Z"
committed-date="2006-02-19T20:28:24.791837Z"
checksum="234c8df99750448a5b1c4709304a38e5"
last-author="anthm"
kind="file"
prop-time="2006-06-27T15:15:42.000000Z"/>
<entry
committed-rev="629"
name="config.sub"
text-time="2006-06-27T15:15:56.000000Z"
committed-date="2006-02-19T20:28:24.791837Z"
checksum="74587542264e2bb761ee931ddb7d69f1"
last-author="anthm"
kind="file"
prop-time="2006-06-27T15:15:42.000000Z"/>
<entry
committed-rev="629"
name="INSTALL"
text-time="2006-06-27T15:15:56.000000Z"
committed-date="2006-02-19T20:28:24.791837Z"
checksum="9f3e20fdff9c78aa8e3f9b42be166769"
last-author="anthm"
kind="file"
prop-time="2006-06-27T15:15:47.000000Z"/>
<entry
committed-rev="629"
name="COPYING"
text-time="2006-06-27T15:15:56.000000Z"
committed-date="2006-02-19T20:28:24.791837Z"
checksum="c878b7dac31225fc5b03ff92d985f147"
last-author="anthm"
kind="file"
prop-time="2006-06-27T15:15:47.000000Z"/>
<entry
committed-rev="797"
name="libteletone.vcproj"
text-time="2006-06-27T15:15:56.000000Z"
committed-date="2006-03-08T03:29:56.831339Z"
checksum="7652cc60b4a56426a8c94b20217b7f86"
last-author="mikej"
kind="file"
prop-time="2006-06-27T15:15:47.000000Z"/>
<entry
committed-rev="880"
name="Makefile.am"
text-time="2006-06-27T15:15:56.000000Z"
committed-date="2006-03-20T23:41:21.688332Z"
checksum="cdd15e1ba31199e3299b958981cde8d9"
last-author="anthm"
kind="file"
prop-time="2006-06-27T15:15:47.000000Z"/>
<entry
committed-rev="629"
name="missing"
text-time="2006-06-27T15:15:56.000000Z"
committed-date="2006-02-19T20:28:24.791837Z"
checksum="0a5e8ed778878a2656e3ea2313dac833"
last-author="anthm"
kind="file"
prop-time="2006-06-27T15:15:47.000000Z"/>
<entry
committed-rev="629"
name="NEWS"
text-time="2006-06-27T15:15:56.000000Z"
committed-date="2006-02-19T20:28:24.791837Z"
checksum="53eff28ecd16c5529e73546a297e9f53"
last-author="anthm"
kind="file"
prop-time="2006-06-27T15:15:47.000000Z"/>
<entry
committed-rev="797"
name="teletone.def"
text-time="2006-06-27T15:15:56.000000Z"
committed-date="2006-03-08T03:29:56.831339Z"
checksum="e4a88cfdc6991c1740b000753b905eec"
last-author="mikej"
kind="file"
prop-time="2006-06-27T15:15:47.000000Z"/>
<entry
committed-rev="629"
name="aclocal.m4"
text-time="2006-06-27T15:15:56.000000Z"
committed-date="2006-02-19T20:28:24.791837Z"
checksum="e41e60b06c482e1de80a44404e3c4c30"
last-author="anthm"
kind="file"
prop-time="2006-06-27T15:15:56.000000Z"/>
<entry
committed-rev="629"
name="install-sh"
text-time="2006-06-27T15:15:56.000000Z"
committed-date="2006-02-19T20:28:24.791837Z"
checksum="d4c3da374db4aa2301a21ab3e51ddb21"
last-author="anthm"
kind="file"
prop-time="2006-06-27T15:15:56.000000Z"/>
</wc-entries>
8
dir
223
svn://sangoma.freeswitch.org/sangoma_mgd/trunk/lib/libteletone
svn://sangoma.freeswitch.org
2007-06-21T22:15:47.596766Z
219
ncorbic
svn:special svn:externals svn:needs-lock
2028fedf-720c-0410-83b8-d54a3e729fb0
mkinstalldirs
file
2007-07-10T21:30:07.000000Z
792922784eade1d03ecb1b33ba8bb7c3
2007-06-21T22:15:47.596766Z
219
ncorbic
configure
file
2007-07-10T21:30:07.000000Z
28023e66f3a078df20ba80031d144952
2007-06-21T22:15:47.596766Z
219
ncorbic
has-props
Makefile.in
file
2007-07-10T21:30:07.000000Z
1b6345d4e9fd16e1096238cad862b547
2007-06-21T22:15:47.596766Z
219
ncorbic
AUTHORS
file
2007-07-10T21:30:07.000000Z
2a307cc617b923385f157cc693f908e9
2007-06-21T22:15:47.596766Z
219
ncorbic
config.log
file
2007-07-10T21:30:07.000000Z
daf6b3e00b6a4ed504d5703b68055399
2007-06-21T22:15:47.596766Z
219
ncorbic
configure.in
file
2007-07-10T21:30:07.000000Z
4b0bfa262e16e1c9538664e5b42a0134
2007-06-21T22:15:47.596766Z
219
ncorbic
has-props
depcomp
file
2007-07-10T21:30:07.000000Z
7e26ecc61d5c27c50d334ebe19d5ef06
2007-06-21T22:15:47.596766Z
219
ncorbic
ChangeLog
file
2007-07-10T21:30:07.000000Z
d41d8cd98f00b204e9800998ecf8427e
2007-06-21T22:15:47.596766Z
219
ncorbic
config.status
file
2007-07-10T21:30:07.000000Z
a4881f4f4629566acce1f250ae4c18f8
2007-06-21T22:15:47.596766Z
219
ncorbic
has-props
src
dir
compile
file
2007-07-10T21:30:07.000000Z
b2a35e98453194ca837c363ee9c0d379
2007-06-21T22:15:47.596766Z
219
ncorbic
has-props
config.guess
file
2007-07-10T21:30:07.000000Z
e8f87acaddff75a691755466f0918100
2007-06-21T22:15:47.596766Z
219
ncorbic
svn-commit.tmp
file
2007-07-10T21:30:07.000000Z
c2defdef8cd93c3d9e29628267699702
2007-06-21T22:15:47.596766Z
219
ncorbic
README
file
2007-07-10T21:30:07.000000Z
234c8df99750448a5b1c4709304a38e5
2007-06-21T22:15:47.596766Z
219
ncorbic
config.sub
file
2007-07-10T21:30:07.000000Z
74587542264e2bb761ee931ddb7d69f1
2007-06-21T22:15:47.596766Z
219
ncorbic
ltmain.sh
file
2007-07-10T21:30:07.000000Z
0f44520873ce706852086fc2ad45106f
2007-06-21T22:15:47.596766Z
219
ncorbic
libtool
file
2007-07-10T21:30:07.000000Z
6663bdfd0c8727be1ce523e66d6a8646
2007-06-21T22:15:47.596766Z
219
ncorbic
has-props
INSTALL
file
2007-07-10T21:30:07.000000Z
9f3e20fdff9c78aa8e3f9b42be166769
2007-06-21T22:15:47.596766Z
219
ncorbic
.libs
dir
COPYING
file
2007-07-10T21:30:07.000000Z
c878b7dac31225fc5b03ff92d985f147
2007-06-21T22:15:47.596766Z
219
ncorbic
libteletone.vcproj
file
2007-07-10T21:30:07.000000Z
7652cc60b4a56426a8c94b20217b7f86
2007-06-21T22:15:47.596766Z
219
ncorbic
.deps
dir
Makefile.am
file
2007-07-10T21:30:07.000000Z
cdd15e1ba31199e3299b958981cde8d9
2007-06-21T22:15:47.596766Z
219
ncorbic
missing
file
2007-07-10T21:30:07.000000Z
0a5e8ed778878a2656e3ea2313dac833
2007-06-21T22:15:47.596766Z
219
ncorbic
NEWS
file
2007-07-10T21:30:07.000000Z
53eff28ecd16c5529e73546a297e9f53
2007-06-21T22:15:47.596766Z
219
ncorbic
teletone.def
file
2007-07-10T21:30:07.000000Z
e4a88cfdc6991c1740b000753b905eec
2007-06-21T22:15:47.596766Z
219
ncorbic
aclocal.m4
file
2007-07-10T21:30:07.000000Z
e41e60b06c482e1de80a44404e3c4c30
2007-06-21T22:15:47.596766Z
219
ncorbic
Makefile
file
2007-07-10T21:30:07.000000Z
b3287c42dacc58a8b34adebefa80b398
2007-06-21T22:15:47.596766Z
219
ncorbic
install-sh
file
2007-07-10T21:30:07.000000Z
d4c3da374db4aa2301a21ab3e51ddb21
2007-06-21T22:15:47.596766Z
219
ncorbic

View File

@ -1,5 +0,0 @@
K 14
svn:executable
V 1
*
END

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