diff options
author | tzafrir <tzafrir@5390a7c7-147a-4af0-8ec9-7488f05a26cb> | 2006-07-06 13:47:05 +0000 |
---|---|---|
committer | tzafrir <tzafrir@5390a7c7-147a-4af0-8ec9-7488f05a26cb> | 2006-07-06 13:47:05 +0000 |
commit | 39a1812c1ef76b6a792f00087f1e507616bbbb25 (patch) | |
tree | e50633c999779c514ef16f4a2ce7a70fc7511c9e /xpp/utils/genzaptelconf | |
parent | 70ef1183eba2d2fe4f00668fd3438b7f1c842c94 (diff) |
Tons of updates to the Astribank (xpp) driver:
* xpd_fxo.ko (FXO span) is now operational
* Remove obsolete .inc initialization files (we use user-space init)
* Added an install target to the utils dir.
* Updated README.Astribank accordingly.
* Using RBS signalling, as caller ID did not work well otherwise.
* Better handling of USB protocol errors.
* Fixed some procfs-related races.
* per-card-module ioctls.
* fxotune support.
* opermode support (set through /etc/default/zaptel for now)
* Userspace initialization script can also read registers.
* Power calibration works (and implemented in perl)
* some fine-tuning to the regster initialization parameters.
* Leds turn on before registration and turn off after it.
git-svn-id: http://svn.digium.com/svn/zaptel/trunk@1204 5390a7c7-147a-4af0-8ec9-7488f05a26cb
Diffstat (limited to 'xpp/utils/genzaptelconf')
-rwxr-xr-x | xpp/utils/genzaptelconf | 49 |
1 files changed, 30 insertions, 19 deletions
diff --git a/xpp/utils/genzaptelconf b/xpp/utils/genzaptelconf index fe5c9e4..1763427 100755 --- a/xpp/utils/genzaptelconf +++ b/xpp/utils/genzaptelconf @@ -32,8 +32,11 @@ # Don't override variables here. Override them in /etc/default/zaptel # # 0.5.3: -# * Experimental support for Sangoman analog cards (A20x) -# * fixed timeout for Astribank load +# * Experimental support for Sangoma analog cards (A20x) +# * Support OpenVox A1200P (A TDM400P clone refactored) +# * Fixed timeout for Astribank load +# * Delete unsuccessfully-probe modules +# * Pass callerid from trunks # 0.5.2: # * Now it should detect most PRI cards and even wcusb # 0.5.1: @@ -342,7 +345,7 @@ print_pattern() { fi else # this is an FXO (trunk/phone: FXO signalling) # we have may have set it. So reset it: - echo "callerid=\"\" <0>" + echo "callerid=asrecieved" echo "mailbox=" if [ "$group_manual" != "yes" ] then @@ -410,22 +413,29 @@ count_proc_zap_lines() { load_modules() { say "Test Loading modules:" - for i in zaptel $ALL_MODULES + for i in $ALL_MODULES do - if [ "$i" = ztdummy ]; then - continue # No hardware to detect - fi lines_before=`count_proc_zap_lines` args="${i}_args" eval "args=\$$args" # a module is worth listing if it: # a. loaded successfully, and # b. added channels lines under /proc/zaptel/* - if /sbin/modprobe $i $args 2> /dev/null && \ - [ $lines_before -lt `count_proc_zap_lines` ] + if /sbin/modprobe $i $args 2> /dev/null then - probed_modules="$probed_modules $i" - say " ok $i $args" + check=0 + case "$i" in + xpp_usb) check=`grep 'STATUS=connected' 2>/dev/null /proc/xpp/xbuses | wc -l` ;; + *) if [ $lines_before -lt `count_proc_zap_lines` ]; then check=1; fi ;; + esac + if [ "$check" != 0 ] + then + probed_modules="$probed_modules $i" + say " ok $i $args" + else + say " - $i $args" + rmmod $i + fi else say " - $i $args" fi @@ -474,20 +484,21 @@ wait_for_xpp() { if [ -d /proc/xpp ] && \ [ "`cat /sys/module/xpp/parameters/zap_autoreg`" = 'Y' ] then - out_on_timeout=0 # wait for the XPDs to register: + # TODO: replace this loop with 'cat /proc/xpp/XBUS-*/waitfor_xpds + success=0 for i in `seq 30`; do - sleep 1 if ! grep -q 0 /proc/xpp/*/*/zt_registration 2>/dev/null then # There are either no XPDs or all of them are # registered. Nothing to do - out_on_timeout=1 + success=1 break fi + sleep 1 done - if [ "$out_on_timeout" != 0 ] - then echo >&2 "Warning: time out waiting for xpp init." + if [ "$success" = 0 ]; then + echo 1>&2 "$0: WARNING: some XPD's are not registered yet (timeout)" fi fi } @@ -643,7 +654,7 @@ EOF # in case this is a real channel. chan_num=`echo $line |awk '{print $1}'` case "$line" in - *WCTDM/*|*/WRTDM/*) + *WCTDM/*|*/WRTDM/*|*OPVXA1200/*) # this can be either FXS or FXO maybe_fxs=0 maybe_fxo=0 @@ -772,7 +783,7 @@ EOF # NT is the same as FXS for us and TE is the same as FXO if [ "$span_termtype" = 'nt' ] then - #echo "callerid=\"Channel $chan\" <$exten>" + echo "callerid=\"Channels $span_begin - $span_end\" <$span_begin>" #echo "mailbox=$exten" if [ "$group_manual" != "yes" ] then @@ -783,7 +794,7 @@ EOF echo "context=$context_phones" fi else # we have may have set it. So reset it: - #echo "callerid=\"\" <0>" + echo "callerid=asrecieved" #echo "mailbox=" if [ "$group_manual" != "yes" ] then |