diff options
author | tzafrir <tzafrir@5390a7c7-147a-4af0-8ec9-7488f05a26cb> | 2006-11-30 21:46:11 +0000 |
---|---|---|
committer | tzafrir <tzafrir@5390a7c7-147a-4af0-8ec9-7488f05a26cb> | 2006-11-30 21:46:11 +0000 |
commit | 9e81e78446308a27fd157ca7943a25457c59075d (patch) | |
tree | 37a1e55a7b3c364b1b525ddb2fa00c247ef561c1 /xpp/utils | |
parent | 4c1daa46b5a30fec3c37558e9d02a8d616c88eda (diff) |
r2817@boole: oron | 2006-11-28 13:39:47 +0200
Maintenance branch for asterisk-1.2.x
git-svn-id: http://svn.digium.com/svn/zaptel/branches/1.2@1666 5390a7c7-147a-4af0-8ec9-7488f05a26cb
Diffstat (limited to 'xpp/utils')
-rw-r--r-- | xpp/utils/Makefile | 6 | ||||
-rwxr-xr-x | xpp/utils/genzaptelconf | 69 |
2 files changed, 64 insertions, 11 deletions
diff --git a/xpp/utils/Makefile b/xpp/utils/Makefile index f66e7ba..7824278 100644 --- a/xpp/utils/Makefile +++ b/xpp/utils/Makefile @@ -70,14 +70,14 @@ test_parse.o: test_parse.c hexfile.h test_parse: test_parse.o libhexfile.a $(CC) -L. -o $@ $@.o $(EXTRA_LIBS) -lhexfile -lusb -print_modes.o: print_modes.c wctdm_fxomodes.h - $(HOSTCC) $(CFLAGS) -c $< +print_modes: print_modes.c wctdm_fxomodes.h + $(HOSTCC) -o $@ $(CFLAGS) $< wctdm_fxomodes.h: $(WCTDM) perl -n -e 'print if (/^static struct fxo_mode {$$/ .. /};$$/)' $(WCTDM) >$@ init_fxo_modes: print_modes - ./$^ >$@ + ./$< >$@ clean: $(RM) *.o $(TARGETS) diff --git a/xpp/utils/genzaptelconf b/xpp/utils/genzaptelconf index 053bf1c..144f988 100755 --- a/xpp/utils/genzaptelconf +++ b/xpp/utils/genzaptelconf @@ -34,7 +34,7 @@ # (redhat/centos) # /etc/default/zaptel may override the following variables -VERSION=0.5.7 +VERSION=0.5.8 rcsid='$Id$' lc_country=us base_exten=6000 @@ -80,6 +80,14 @@ tmp_dir= # - The module that will be deleted from /etc/modules , if -d -M is used ALL_MODULES="zaphfc qozap ztgsm wctdm wctdm24xxp wcfxo wcfxs pciradio tor2 torisa wct1xxp wct4xxp wcte11xp wanpipe wcusb xpp_usb" +# What signalling to give to ZapBRI channels? +# bri: bri_net; bri_cpe (Bristuffed Asterisk. No multi- support) +# bri_ptmpi: bri_net_ptmp; bri_cpe_ptmp (Bristuffed Asterisk, multi- support) +# pri: pri_net; pri_cpe (Recent Asterisk. Experimental) +ZAPBRI_SIGNALLING=bri +#ZAPBRI_SIGNALLING=bri_ptmp +#ZAPBRI_SIGNALLING=pri + # read default configuration from /etc/default/zaptel if [ -r $ZAPTEL_BOOT_DEBIAN ]; then . $ZAPTEL_BOOT_DEBIAN; fi if [ -r $ZAPTEL_BOOT_FEDORA ]; then . $ZAPTEL_BOOT_FEDORA; fi @@ -111,6 +119,16 @@ fxsdisable=no span_te_timing_counter=1 +case "$ZAPBRI_SIGNALLING" in +bri) ZAPBRI_NET=bri_net; ZAPBRI_CPE=bri_cpe ;; +pri) ZAPBRI_NET=pri_net; ZAPBRI_CPE=pri_cpe ;; +bri_ptmp) ZAPBRI_NET=bri_net_ptmp; ZAPBRI_CPE=bri_cpe_ptmp ;; +*) + echo >&2 "Incorrect value for ZAPBRI_SIGNALLING ($ZAPBRI_SIGNALLING). Abortring" + exit 1 + ;; +esac + die() { echo "$@" >&2 exit 1 @@ -246,6 +264,7 @@ usage() { # $1: channel number print_pattern() { local astbank_type='' + local reset_values="" OPTIND=1 while getopts 'a:' arg do @@ -303,10 +322,13 @@ print_pattern() { vmbox=$cfg_vmbox fi echo "callerid=\"Channel $chan\" <$exten>" >> $zapata_file + reset_values="$reset_values callerid" echo "mailbox=$exten" >> $zapata_file + reset_values="$reset_values mailbox" if [ "$group_manual" != "yes" ] then echo "group=$group_phones" >> $zapata_file + reset_values="$reset_values group" fi if [ "$context_manual" != "yes" ] then @@ -317,11 +339,11 @@ print_pattern() { else echo "context=$context_phones" >> $zapata_file fi + reset_values="$reset_values context" fi else # this is an FXO (trunk/phone: FXO signalling) # we have may have set it. So reset it: echo "callerid=asreceived" >> $zapata_file - echo "mailbox=" >> $zapata_file if [ "$group_manual" != "yes" ] then echo "group=$group_lines" >> $zapata_file @@ -329,6 +351,7 @@ print_pattern() { if [ "$context_manual" != "yes" ] then echo "context=$context_lines" >> $zapata_file + reset_values="$reset_values context" fi if [ "$lc_country" = 'uk' ] then @@ -337,12 +360,14 @@ print_pattern() { *WCFXO*) echo "cidstart=history" >> $zapata_file;; *) echo "cidstart=polarity" >> $zapata_file;; esac + reset_values="$reset_values cidsignalling cidstart" fi echo ";;; line=\"$line\"" >> $zapata_file # if kewlstart is not used, busydetect has to be employed: if [ "$method" = 'ls' ] - then echo 'busydetect=yes' >> $zapata_file - else echo 'busydetect=no' >> $zapata_file + then + echo 'busydetect=yes' >> $zapata_file + reset_values="$reset_values busydetect" fi fi @@ -350,11 +375,13 @@ print_pattern() { then if [ "$astbank_type" = 'input' ] || \ ( [ "$fxs_immediate" = 'yes' ] && [ "$sig" = "fxo" ] ) - then echo 'immediate=yes' >> $zapata_file - else echo 'immediate=no' >> $zapata_file + then + echo 'immediate=yes' >> $zapata_file + reset_values="$reset_values immediate" fi fi echo "channel => $chan" >> $zapata_file + reset_zapata_entry $zapata_file $reset_values echo "" >> $zapata_file # Keep a note of what channels we have identified @@ -535,8 +562,28 @@ check_tdm_sigtype() { fi } +# run after the channel's entry. Used to reset all the values +reset_zapata_entry() { + conf_file="$1"; shift + + 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;; + esac + done +} + + genconf() { local mode=$1 + local reset_values="" # reset FXO list (global) #say "DEBUG: resetting channels lists" rm -f $tmp_dir/fx{s,o}_* @@ -704,9 +751,9 @@ EOF echo 'euroisdn' >$tmp_dir/span_switchtype if [ "`cat $tmp_dir/span_termtype`" = 'nt' 2>/dev/null ] then - echo 'bri_net' >$tmp_dir/span_signalling + echo $ZAPBRI_NET >$tmp_dir/span_signalling else - echo 'bri_cpe' >$tmp_dir/span_signalling + echo $ZAPBRI_CPE >$tmp_dir/span_signalling fi ;; *ztgsm*/*) @@ -816,10 +863,12 @@ EOF if [ "$span_termtype" = 'nt' ] then echo "callerid=\"Channels $span_begin - $span_end\" <$span_begin>" >> $zapata_file + reset_values="$reset_values callerid" #echo "mailbox=$exten" if [ "$group_manual" != "yes" ] then echo "group=$group_phones" >> $zapata_file + reset_values="$reset_values group" fi if [ "$context_manual" != "yes" ] then @@ -827,20 +876,24 @@ EOF fi else # we have may have set it. So reset it: echo "callerid=asreceived" + reset_values="$reset_values callerid" #echo "mailbox=" if [ "$group_manual" != "yes" ] then echo "group=$group_lines" >> $zapata_file + reset_values="$reset_values group" fi if [ "$context_manual" != "yes" ] then echo "context=$context_lines" >> $zapata_file + reset_values="$reset_values context" fi fi fi echo "switchtype = $span_switchtype" >> $zapata_file echo "signalling = $span_signalling" >> $zapata_file echo "channel => $bchans" >> $zapata_file + reset_zapata_entry $zapata_file $reset_values ;; list) echo BRI/PRI: chans: $bchans, control: $dchan |