diff options
Diffstat (limited to 'xpp')
-rw-r--r-- | xpp/README.Astribank | 6 | ||||
-rw-r--r-- | xpp/card_fxo.c | 2 | ||||
-rwxr-xr-x | xpp/utils/genzaptelconf | 24 | ||||
-rw-r--r-- | xpp/utils/xpp_fxloader | 14 | ||||
-rw-r--r-- | xpp/xpp_zap.c | 2 |
5 files changed, 37 insertions, 11 deletions
diff --git a/xpp/README.Astribank b/xpp/README.Astribank index f0f93b5..221ef3a 100644 --- a/xpp/README.Astribank +++ b/xpp/README.Astribank @@ -21,6 +21,10 @@ Next you will need to build the user-space tools needed for loading the firmware and initialization files for the Astribank: make -C xpp/utils + +In order to build the user space utilities, you will need the libusb-dev +package on Debian (and derivatives like ubuntu) or libusb-devel on RedHat +(and derivatives like Centox/Trixbox). INSTALLATION: """""""""""" @@ -222,7 +226,7 @@ SAMPLE CONFIGURATIONS: Astribank 16: 8FXS/8FXO fxoks=1-14 - fksks=15-22 + fxsks=15-22 /etc/asterisk/zapata.conf diff --git a/xpp/card_fxo.c b/xpp/card_fxo.c index d3e7637..3ab09a2 100644 --- a/xpp/card_fxo.c +++ b/xpp/card_fxo.c @@ -209,7 +209,7 @@ static int do_sethook(xpd_t *xpd, int pos, bool to_offhook) priv = xpd->priv; BUG_ON(!priv); if(!IS_SET(priv->battery, pos)) { - NOTICE("%s/%s/%d: WARNING: called while battery is off\n", xbus->busname, xpd->xpdname, pos); + DBG("%s/%s/%d: WARNING: called while battery is off\n", xbus->busname, xpd->xpdname, pos); } spin_lock_irqsave(&xpd->lock, flags); mark_ring(xpd, pos, 0, 0); // No more rings diff --git a/xpp/utils/genzaptelconf b/xpp/utils/genzaptelconf index a000ec0..3e89915 100755 --- a/xpp/utils/genzaptelconf +++ b/xpp/utils/genzaptelconf @@ -295,6 +295,9 @@ print_pattern() { # sadly, both input ports and output ports go into the same span as # the FXS ports. Thus we need to separate between them. See also # the zapata.conf section: + + echo ";;; line=\"$line\"" >> $zapata_file + if [ "$astbank_type" != '' ]; then echo "# astbanktype: $astbank_type" >>$zaptel_file; fi @@ -369,7 +372,14 @@ print_pattern() { esac reset_values="$reset_values cidsignalling cidstart" fi - echo ";;; line=\"$line\"" >> $zapata_file + case "$line" in + *XPP_FXO*) + if [ "$xpp_fxo_rxgain" != '' ]; then + echo "rxgain=$xpp_fxo_rxgain" >> $zapata_file + reset_values="$reset_values rxgain" + fi + ;; + esac # if kewlstart is not used, busydetect has to be employed: if [ "$method" = 'ls' ] then @@ -576,13 +586,11 @@ reset_zapata_entry() { for arg in "$@"; do case "$arg" in busydetect) echo "busydetect=no" >>$conf_file;; - callerid) echo "callerid=" >>$conf_file;; - cidstart) echo "cidstart=" >>$conf_file;; - cidsignalling) echo "cidsignalling=" >>$conf_file;; context) echo "context=default" >>$conf_file;; - group) echo "group=" >>$conf_file;; immediate) echo "immediate=no" >>$conf_file;; - mailbox) echo "mailbox=" >>$conf_file;; + rxgain) echo "rxgain=0" >>$conf_file;; + txgain) echo "txgain=0" >>$conf_file;; + *) echo "$arg=" >>$conf_file;; esac done } @@ -692,7 +700,7 @@ EOF # in case this is a real channel. chan_num=`echo $line |awk '{print $1}'` case "$line" in - *WCTDM/*|*/WRTDM/*|*OPVXA1200/*) + *WCTDM/*|*\ WRTDM/*|*OPVXA1200/*) # TDM400P/2400P and similar cards (Sangoma A200, OpenVox A1200) # this can be either FXS or FXO maybe_fxs=0 @@ -812,7 +820,7 @@ EOF list) echo "# ??: $line";; files) echo "# ??: $line" >>$zaptel_file - echo "; ??: $line" >>$zaptel_file + echo "; ??: $line" >>$zapata_file esac ;; esac diff --git a/xpp/utils/xpp_fxloader b/xpp/utils/xpp_fxloader index 8c54370..b14f746 100644 --- a/xpp/utils/xpp_fxloader +++ b/xpp/utils/xpp_fxloader @@ -75,6 +75,17 @@ REENUM_SLEEP_TIME=3 # only used on manual runs FPGA_LOAD="/usr/sbin/fpga_load" +# With Kernels older that 2.6.10 it seems to be possible +# to trigger a race condition by running fxload or fpga_load +# immediately after the detection of the device. +KERNEL_HAS_USB_RACE=0 +case "`uname -r`" in 2.6.[89]*) KERNEL_HAS_USB_RACE=1;; esac +sleep_if_race() { + if [ "$KERNEL_HAS_USB_RACE" = '1' ]; then + sleep 2 + fi +} + find_dev() { v_id=$1 p_id=$2 @@ -83,6 +94,7 @@ find_dev() { } do_fxload() { + sleep_if_race ( fxload -t fx2 $* 2>&1 1>/dev/null || exit 1 ) | $LOGGER } @@ -120,6 +132,7 @@ load_fpga() { firm_ver=`hexfile_version $FIRMWARE_DIR/$fw` $LOGGER "FPGA Firmware $FIRMWARE_DIR/$fw into $dev" + sleep_if_race $FPGA_LOAD -D "$dev" -I "$FIRMWARE_DIR/$fw" 2>&1 >/dev/null | $LOGGER status=$PIPESTATUS if [ $status != 0 ]; then @@ -193,6 +206,7 @@ then else FIRM_FPGA="$FIRMWARE_DIR/FPGA_$prod_id.hex" fi + sleep_if_race $FPGA_LOAD -D "$DEVICE" -I "$FIRM_FPGA" 2>&1 >/dev/null | $LOGGER ;; esac diff --git a/xpp/xpp_zap.c b/xpp/xpp_zap.c index 533a93f..f8f50f9 100644 --- a/xpp/xpp_zap.c +++ b/xpp/xpp_zap.c @@ -67,7 +67,7 @@ DEF_PARM(int, print_dbg, 0, "Print DBG statements"); DEF_PARM(bool, zap_autoreg, 1, "Register spans automatically (1) or not (0)"); DEF_PARM(bool, prefmaster, 1, "Do we want to be zaptel preferred sync master"); #ifdef XPP_EC_CHUNK -DEF_PARM_RO(bool, xpp_ec, 1, "Do we use our own (1) or Zaptel's (0) echo canceller"); +DEF_PARM_RO(bool, xpp_ec, 0, "Do we use our own (1) or Zaptel's (0) echo canceller"); #else static int xpp_ec = 0; #endif |