summaryrefslogtreecommitdiffhomepage
path: root/contrib/package/asterisk-xip/files
diff options
context:
space:
mode:
authorJo-Philipp Wich <jow@openwrt.org>2010-11-16 15:10:23 +0000
committerJo-Philipp Wich <jow@openwrt.org>2010-11-16 15:10:23 +0000
commit39a48ea2699eeb51eefa8ed92de91258a04bc8a1 (patch)
treeeb1bfcf2b2fd648c4f4ea20b3056ecb9682b9d0e /contrib/package/asterisk-xip/files
parentce8855055915b91d6a388f9967c0244f8be8921b (diff)
contrib: remove asterisk-xip
Diffstat (limited to 'contrib/package/asterisk-xip/files')
-rw-r--r--contrib/package/asterisk-xip/files/asterisk.default4
-rwxr-xr-xcontrib/package/asterisk-xip/files/asterisk.init127
-rw-r--r--contrib/package/asterisk-xip/files/macros/clock.conf23
-rw-r--r--contrib/package/asterisk-xip/files/macros/lastcall.conf88
-rw-r--r--contrib/package/asterisk-xip/files/macros/tagnumber.conf58
-rw-r--r--contrib/package/asterisk-xip/files/modules.conf137
-rwxr-xr-xcontrib/package/asterisk-xip/files/uci/asteriskconf144
-rw-r--r--contrib/package/asterisk-xip/files/uci/asteriskconf.txt41
-rwxr-xr-xcontrib/package/asterisk-xip/files/uci/asteriskuci377
-rwxr-xr-xcontrib/package/asterisk-xip/files/uci/dialplanconf855
-rw-r--r--contrib/package/asterisk-xip/files/uci/dialplanconf.txt90
-rw-r--r--contrib/package/asterisk-xip/files/uci/disaconf113
-rw-r--r--contrib/package/asterisk-xip/files/uci/disaconf.txt29
-rwxr-xr-xcontrib/package/asterisk-xip/files/uci/featureconf99
-rw-r--r--contrib/package/asterisk-xip/files/uci/featureconf.txt25
-rwxr-xr-xcontrib/package/asterisk-xip/files/uci/lastcall124
-rw-r--r--contrib/package/asterisk-xip/files/uci/lastcall.txt15
-rwxr-xr-xcontrib/package/asterisk-xip/files/uci/meetmeconf107
-rw-r--r--contrib/package/asterisk-xip/files/uci/meetmeconf.txt13
-rwxr-xr-xcontrib/package/asterisk-xip/files/uci/moduleconf151
-rw-r--r--contrib/package/asterisk-xip/files/uci/moduleconf.txt151
-rwxr-xr-xcontrib/package/asterisk-xip/files/uci/mohconf74
-rw-r--r--contrib/package/asterisk-xip/files/uci/mohconf.txt8
-rw-r--r--contrib/package/asterisk-xip/files/uci/queueconf133
-rw-r--r--contrib/package/asterisk-xip/files/uci/queueconf.txt30
-rwxr-xr-xcontrib/package/asterisk-xip/files/uci/sipiaxconf525
-rw-r--r--contrib/package/asterisk-xip/files/uci/sipiaxconf.txt117
-rwxr-xr-xcontrib/package/asterisk-xip/files/uci/talkclock48
-rw-r--r--contrib/package/asterisk-xip/files/uci/talkclock.txt7
-rwxr-xr-xcontrib/package/asterisk-xip/files/uci/voicemailconf243
-rw-r--r--contrib/package/asterisk-xip/files/uci/voicemailconf.txt35
-rw-r--r--contrib/package/asterisk-xip/files/uci/voicemenu145
-rw-r--r--contrib/package/asterisk-xip/files/uci/voicemenu.txt37
-rw-r--r--contrib/package/asterisk-xip/files/voiceprompts.txt24
34 files changed, 0 insertions, 4197 deletions
diff --git a/contrib/package/asterisk-xip/files/asterisk.default b/contrib/package/asterisk-xip/files/asterisk.default
deleted file mode 100644
index 5468d324d..000000000
--- a/contrib/package/asterisk-xip/files/asterisk.default
+++ /dev/null
@@ -1,4 +0,0 @@
-## startup options for /etc/init.d/asterisk
-
-ENABLE_ASTERISK="uci"
-OPTIONS=""
diff --git a/contrib/package/asterisk-xip/files/asterisk.init b/contrib/package/asterisk-xip/files/asterisk.init
deleted file mode 100755
index b2acd2aa8..000000000
--- a/contrib/package/asterisk-xip/files/asterisk.init
+++ /dev/null
@@ -1,127 +0,0 @@
-#!/bin/sh /etc/rc.common
-# Copyright (C) 2006 OpenWrt.org
-START=50
-STOP=50
-
-DEST=
-OPTIONS=""
-DEFAULT=$DEST/etc/default/asterisk
-UCILIB=$DEST/usr/lib/asterisk/uci
-EXTRAPARAM=$1
-
-export EXTRA_COMMANDS="console check down"
-export EXTRA_HELP="\
- console Start asterisk console
- check Test asterisk uci config
- down Force asterisk to stop"
-
-reboot_ata() {
- cd /tmp
- wget -q http://ata.lan/admin/reboot -O - >&- 2>&-
-}
-
-load_ucilib() . ${UCILIB}/asteriskuci
-
-start_uci() {
- load_ucilib
-
- start_uci_asterisk $DEST
-}
-restart_uci() {
- load_ucilib
-
- restart_uci_asterisk $DEST
-}
-
-stop_uci() {
- load_ucilib
-
- stop_uci_asterisk $DEST
-}
-reload_uci() {
- load_ucilib
-
- reload_uci_asterisk "$DEST"
-}
-
-start() {
- [ -f $DEFAULT ] && . $DEFAULT
- case ${ENABLE_ASTERISK-no} in
- uci) start_uci ;;
- yes)
- # Handle zappseudo in the wrong place.
- [ -e /dev/zappseudo ] && [ ! -d /dev/zap -o ! -e /dev/zap/pseudo ] && mkdir -p /dev/zap && ln -s /dev/zappseudo /dev/zap/pseudo
- [ -d /var/run ] || mkdir -p /var/run
- [ -d $DEST/var/log/asterisk ] || mkdir -p $DEST/var/log/asterisk
- [ -d $DEST/var/spool/asterisk ] || mkdir -p $DEST/var/spool/asterisk
- [ -d /var/spool/asterisk ] || mkdir -p /var/spool/asterisk
- [ -h $DEST/usr/lib/asterisk/astdb ] || ln -sf /var/spool/asterisk/astdb $DEST/usr/lib/asterisk/astdb
- $DEST/usr/sbin/asterisk $OPTIONS -f 2>&1 > $DEST/var/log/asterisk/asterisk_proc &
- ( sleep 5; reboot_ata ) &
- ;;
- *) return 1 ;;
- esac
-}
-
-stop() {
- [ -f $DEFAULT ] && . $DEFAULT
- case ${ENABLE_ASTERISK} in
- uci) stop_uci ;;
- *) [ -f /var/run/asterisk.pid ] && kill $(cat /var/run/asterisk.pid) 2>&- >&-
- esac
-}
-
-console() {
- [ -f $DEFAULT ] && . $DEFAULT
- case ${ENABLE_ASTERISK} in
- uci) $DEST/usr/sbin/asterisk $UCIOPTIONS -C /tmp/asterisk/asterisk.conf -r ;;
- yes) $DEST/usr/sbin/asterisk $OPTIONS -r ;;
- esac
-
-}
-check() {
- load_ucilib
-
- setup_asterisk "$DEST" test "$EXTRAPARAM"
-}
-
-reload() {
- [ -f $DEFAULT ] && . $DEFAULT
- case ${ENABLE_ASTERISK-no} in
- uci) reload_uci ;;
- yes) restart ;;
- esac
-
-}
-
-restart() {
- [ -f $DEFAULT ] && . $DEFAULT
- case ${ENABLE_ASTERISK-no} in
- uci) restart_uci ;;
- yes)
- if [ -r /var/run/asterisk.ctl ] ; then
- if $DEST/usr/sbin/asterisk -r -x "restart gracefully" 2>&- >&- ; then
- echo "Restarting when convenient"
- return 0
- fi
- fi
- stop
- start
- esac
-}
-
-down() {
- if [ -r /var/run/asterisk.ctl ] ; then
- [ -f $DEFAULT ] && . $DEFAULT
- case ${ENABLE_ASTERISK} in
- uci) $DEST/usr/sbin/asterisk -C /tmp/asterisk/asterisk.conf -r -x "stop now" 2>&- >&- ;;
- *) $DEST/usr/sbin/asterisk $OPTIONS -r -x "stop now" 2>&- >&-
- esac
- [ -f /var/run/asterisk.pid ] && sleep 1
- fi
- [ -f /var/run/asterisk.pid ] && kill $(cat /var/run/asterisk.pid) 2>&- >&-
- [ -f /var/run/asterisk.pid ] && sleep 2
- [ -f /var/run/asterisk.pid ] && kill -9 $(cat /var/run/asterisk.pid) 2>&- >&-
-}
-
-# vim:ts=2 sw=2
diff --git a/contrib/package/asterisk-xip/files/macros/clock.conf b/contrib/package/asterisk-xip/files/macros/clock.conf
deleted file mode 100644
index 3250b396a..000000000
--- a/contrib/package/asterisk-xip/files/macros/clock.conf
+++ /dev/null
@@ -1,23 +0,0 @@
-; Talking clock by Michael Geddes
-; Borrowed from bits here and there.
-[macro-talkingclock] ; (TimeFormat, DateFormat, Zone)
-exten => s,1,Answer
-exten => s,n,set(tcTimeFormat=${ARG1})
-exten => s,n,GotoIf($["${tcTimeFormat}" = ""]?:tfOK)
-exten => s,n,set(tcTimeFormat=HM\'vm-and\'S\'seconds\')
-exten => s,n(tfOK),set(tcDateFormat=${ARG2})
-exten => s,n,GotoIf($["${tcDateFormat}" = ""]?:dfOK)
-exten => s,n,set(tcDateFormat=AdBY)
-exten => s,n(dfOK),set(tcZone=${ARG3})
-exten => s,n,GotoIf($["${tcZone}" = ""]?:znOK)
-exten => s,n,set(tcZone=${TalkingClockZone})
-exten => s,n(znOK),SayUnixTime(,${tcZone},${tcDateFormat})
-exten => s,n(again),Wait(2)
-exten => s,n,Set(FutureTime=$[${EPOCH} + 6])
-exten => s,n,Playback(misc/at-tone-time-exactly)
-exten => s,n,SayUnixTime(${FutureTime},${tcZone},${tcTimeFormat})
-; Wait to say the beep.
-exten => s,n(waitforit),noop
-exten => s,n,GotoIf($[ ${EPOCH} < ${FutureTime} ]?waitforit:)
-exten => s,n,playback(beep)
-exten => s,n,goto(again)
diff --git a/contrib/package/asterisk-xip/files/macros/lastcall.conf b/contrib/package/asterisk-xip/files/macros/lastcall.conf
deleted file mode 100644
index 172fd5e77..000000000
--- a/contrib/package/asterisk-xip/files/macros/lastcall.conf
+++ /dev/null
@@ -1,88 +0,0 @@
-; Last-Called number storage and calling.
-; Author: Michael Geddes aka FrogOnWheels
-
-; depends: app_macro app_system app_record func_callerid
-; app_sayunixtime app_playback func_db
-; format_gsm codec_gsm
-;[globals]
-;LASTCALL_DIR=/etc/asterisk/directory
-
-[macro-lastcallstore] ; (Number , EntryType, BufferSize)
-exten => s,1,set(lcsName=lastcall)
-exten => s,n,set(lcsCount=10)
-exten => s,n,GotoIf($["${ARG2}" = ""]?blankarg)
-exten => s,n,GotoIf($["${ARG2}" = "lastcall"]?blankarg)
-exten => s,n,Set(lcsName=lastcall_${ARG2})
-exten => s,n(blankarg),GotoIf($["${ARG3}" = ""]?nocount)
-exten => s,n,Set(lcsCount=${ARG3})
-exten => s,n(nocount),Noop(${lcsName}:${DB(${lcsName}/number1)}:${ARG1})
-exten => s,n,GotoIf($["${DB(${lcsName}/number1)}" = "${ARG1}"]?setdate)
-exten => s,n,set(CallerPointer=1)
-
-exten => s,n(again),GotoIf($["${DB(${lcsName}/ddate${CallerPointer})}" = ""]?copynext)
-exten => s,n,GotoIf($["${DB(${lcsName}/number${CallerPointer})}" = "${ARG1}"]?copynext)
-exten => s,n,Set(CallerPointer=$[${CallerPointer}+1])
-exten => s,n,GotoIf($[${CallerPointer} <= ${lcsCount}]?again)
-
-exten => s,n(copynext),set(DB(${lcsName}/ddate$[${CallerPointer}])=${DB(${lcsName}/ddate$[${CallerPointer}-1])})
-exten => s,n,set(DB(${lcsName}/number$[${CallerPointer}])=${DB(${lcsName}/number$[${CallerPointer}-1])})
-exten => s,n,set(CallerPointer=$[${CallerPointer}-1])
-exten => s,n,GotoIf($[${CallerPointer} > 0]?copynext)
-exten => s,n,set(DB(${lcsName}/number1)=${ARG1})
-exten => s,n(setdate),set(DB(${lcsName}/ddate1)=${EPOCH})
-
-[macro-lastcallapp] ; (Entrytype, Count, RingContext, Tag)
-exten => s,1,set(lcsName=lastcall)
-exten => s,n,set(lcsCount=10)
-exten => s,n,GotoIf($["${ARG1}" = ""]?blankName)
-exten => s,n,Set(lcsName=lastcall_${ARG1})
-exten => s,n(blankName),GotoIf($["${ARG2}" = ""]?nocount)
-exten => s,n,Set(lcsCount=${ARG2})
-exten => s,n(nocount),set(lcsCallContext=internal)
-exten => s,n,GotoIf($["${ARG3}" = ""]?blankContext)
-exten => s,n,Set(lcsCallContext=${ARG3})
-exten => s,n(blankContext),set(lcsTag=${ARG4})
-exten => s,n,GotoIf($["${lcsTag}" != ""]?hasTag)
-exten => s,n,Set(lcsTag=lastcall/previous-numbers)
-exten => s,n(hasTag),Set(lcsPointer=1)
-exten => s,n,GotoIf($["${DB(${lcsName}/ddate1)}" != ""]?macrobody_lastcallapp|s|1)
-exten => s,n,playback(${lcsTag}&lastcall/none-available)
-[macrobody_lastcallapp]
-exten => s,1(repeat),Background(${lcsTag})
-exten => s,n(again),wait(1)
-exten => s,n,Set(lcsLastnum=${DB(${lcsName}/number${lcsPointer})})
-exten => s,n,Set(ddate=${DB(${lcsName}/ddate${lcsPointer})})
-exten => s,n,Set(lcsLastDate=${DB(${lcsName}/ddate$[ ${lcsPointer} + 1])})
-exten => s,n,GotoIf($["${lcsLastnum}" != "anonymous"]?checkblank)
-exten => s,n,Set(lcsLastnum="")
-exten => s,n(checkblank),GotoIf($["${lcsLastnum}" = ""]?noinfo)
-exten => s,n,Macro(backgroundtagnumber,${lcsLastnum},${LASTCALL_DIR})
-exten => s,n,wait(.5)
-exten => s,n,sayunixtime(${ddate},${LASTCALLZONE},QIMp)
-exten => s,n(saymenu),background(silence/1)
-exten => s,n,GotoIf($[$[${lcsPointer} = ${lcsCount}] | $["${lcsLastDate}" = ""]]?noprev)
-exten => s,n,background(lastcall/next)
-exten => s,n(noprev),GotoIf($["${lcsLastnum}" = ""]?nocall)
-exten => s,n,background(lastcall/call-number)
-exten => s,n,background(lastcall/tag-number)
-exten => s,n(nocall),GotoIf($[${lcsPointer} = 1]?nonext)
-exten => s,n,background(lastcall/previous)
-exten => s,n(nonext),background(silence/10)
-exten => s,n,Goto(repeat)
-exten => s,n(noinfo),background(lastcall/no-number-info)
-exten => s,n,goto(saycalltime)
-exten => 5,1,GotoIf($["${lcsLastnum}" = ""]?noinfo])
-exten => 5,n,Ringing()
-exten => 5,n,Goto(${lcsCallContext},${lcsLastnum},1)
-exten => 6,1,GotoIf($[$[${lcsPointer} = ${lcsCount}] | $["${lcsLastDate}" = ""]]?sayn)
-exten => 6,n,Set(lcsPointer=$[${lcsPointer} + 1])
-exten => 4,1,GotoIf($[${lcsPointer}=1]?sayn)
-exten => 4,n,Set(lcsPointer=$[${lcsPointer} - 1])
-exten => _[46],n(sayn),Background(h-${lcsPointer})
-exten => _[46],n,goto(s|again)
-exten => 7,1,GotoIf($["${lcsLastNum}" = ""]?noinfo])
-exten => 7,2,macro(tagnumber,${lcsLastNum},${LASTCALL_DIR})
-exten => 7,3,goto(s|again)
-exten => i,1,Goto(s|again)
-exten => t,1,playback(goodbye)
-exten => t,n,Hangup
diff --git a/contrib/package/asterisk-xip/files/macros/tagnumber.conf b/contrib/package/asterisk-xip/files/macros/tagnumber.conf
deleted file mode 100644
index 6fc455788..000000000
--- a/contrib/package/asterisk-xip/files/macros/tagnumber.conf
+++ /dev/null
@@ -1,58 +0,0 @@
-; Number tagging
-; Author: Michael Geddes aka FrogOnWheels
-
-; Depends: app_stack app_macro app_system
-
-[macro-tagnumber] ; Number / Tag Directory / Return
-exten => s,1,Set(tagNumber=${ARG1})
-exten => s,n,Set(tagDirectory=${ARG2})
-exten => s,n,Set(tagRetContext=${MACRO_CONTEXT})
-exten => s,n,Set(tagRetExtn=${MACRO_EXTEN})
-exten => s,n,Set(tagRetPriority=$[${MACRO_PRIORITY} + 1])
-;exten => s,n,Set(tagReturn=${ARG3})
-;exten => s,n,Gosub(macrobody_tagnumber,s,1)
-exten => s,n,Goto(macrobody_tagnumber,s,1)
-exten => s,n(return),Noop(Returned)
-[macrobody_tagnumber]
-exten => s,1(again),Background(voicetag/recordname)
-exten => s,n,Record(/tmp/tmprectag:gsm|2|5)
-exten => s,n(askagain),Background(voicetag/tagfor)
-exten => s,n,Macro(backgroundphone,${tagNumber})
-exten => s,n,Background(/tmp/tmprectag)
-exten => s,n,Background(voicetag/confirmnumber)
-exten => s,n,Background(voicetag/tryagain)
-exten => s,n,Background(voicetag/cancelrecord)
-exten => s,n,WaitExten(5)
-exten => s,n,Goto(s|askagain)
-exten => 1,1,System(mkdir -p ${tagDirectory})
-exten => 1,2,System(mv /tmp/tmprectag.gsm ${tagDirectory}/${tagNumber}.gsm)
-exten => 1,3,Goto(${tagRetContext}|${tagRetExtn}|${tagRetPriority})
-exten => 2,1,Goto(s|again)
-exten => 3,1,system(rm -f /tmp/tmprectag.gsm)
-exten => 3,2,Goto(${tagRetContext}|${tagRetExtn}|${tagRetPriority})
-exten => h,1,system(rm -f /tmp/tmrectag.gsm)
-
-[macro-backgroundtagnumber] ; Number, directory
-exten => s,1,TrySystem(test -f ${ARG2}/${ARG1}.gsm)
-exten => s,n,GotoIf($[${SYSTEMSTATUS} != SUCCESS]?s-saynum|1)
-exten => s,n,Background(${ARG2}/${ARG1})
-exten => s-saynum,1,Macro(backgroundphone,${ARG1})
-
-; Say Phone number in the background
-[macro-backgroundphone]
-exten => s,1,Set(bgDigits=${ARG1})
-exten => s,n(loop),Set(bgDigit=${bgDigits:0:1})
-exten => s,n,GotoIf($["${bgDigits:0:3}" = "000"]?saythousand)
-exten => s,n,GotoIf($["${bgDigits:0:2}" = "00"]?sayhundred)
-exten => s,n,GotoIf($["${bgDigits}" = ""]?exitloop)
-exten => s,n,Set(bgDigits=${bgDigits:1})
-exten => s,n,Background(digits/${bgDigit})
-exten => s,n,Goto(loop)
-exten => s,n(saythousand),Background(digits/thousand)
-exten => s,n,Set(bgDigits=${bgDigits:3})
-exten => s,n,Goto(loop)
-exten => s,n(sayhundred),Background(digits/hundred)
-exten => s,n,Set(bgDigits=${bgDigits:2})
-exten => s,n,Goto(loop)
-exten => s,n(exitloop),NOOP
-
diff --git a/contrib/package/asterisk-xip/files/modules.conf b/contrib/package/asterisk-xip/files/modules.conf
deleted file mode 100644
index ce12c82dc..000000000
--- a/contrib/package/asterisk-xip/files/modules.conf
+++ /dev/null
@@ -1,137 +0,0 @@
-;
-; Asterisk configuration file
-;
-; Module Loader configuration file
-;
-
-[modules]
-autoload=yes
-;
-; Any modules that need to be loaded before the Asterisk core has been
-; initialized (just after the logger has been initialized) can be loaded
-; using 'preload'. This will frequently be needed if you wish to map all
-; module configuration files into Realtime storage, since the Realtime
-; driver will need to be loaded before the modules using those configuration
-; files are initialized.
-;
-; An example of loading ODBC support would be:
-;preload => res_odbc.so
-;preload => res_config_odbc.so
-;
-noload => res_config_mysql.so ;
-noload => res_crypto.so ; Cryptographic Digital Signatures
-; load => res_features.so ; Call Parking Resource
-noload => res_indications.so ; Indications Configuration
-noload => res_monitor.so ; Call Monitoring Resource
-; load => res_musiconhold.so ; Music On Hold Resource
-noload => cdr_csv.so ; Comma Separated Values CDR Backend
-noload => cdr_custom.so ; Customizable Comma Separated Values CDR Backend
-noload => cdr_manager.so ; Asterisk Call Manager CDR Backend
-noload => cdr_mysql.so ; MySQL CDR Backend
-noload => cdr_pgsql.so ; PostgreSQL CDR Backend
-noload => cdr_sqlite.so ; SQLite CDR Backend
-noload => chan_alsa.so ; Channel driver for GTalk
-noload => chan_agent.so ; Agent Proxy Channel
-noload => chan_gtalk.so ; Channel driver for GTalk
-; load => chan_iax2.so ; Inter Asterisk eXchange (Ver 2)
-; load => chan_local.so ; Local Proxy Channel
-; load => chan_sip.so ; Session Initiation Protocol (SIP)
-noload => codec_a_mu.so ; A-law and Mulaw direct Coder/Decoder
-noload => codec_adpcm.so ; Adaptive Differential PCM Coder/Decoder
-noload => codec_alaw.so ; A-law Coder/Decoder
-noload => codec_g726.so ; ITU G.726-32kbps G726 Transcoder
-; load => codec_gsm.so ; GSM/PCM16 (signed linear) Codec Translation
-; load => codec_ulaw.so ; Mu-law Coder/Decoder
-noload => codec_speex.so ; Speex/PCM16 (signed linear) Codec Translator
-noload => format_au.so ; Sun Microsystems AU format (signed linear)
-noload => format_g723.so ; G.723.1 Simple Timestamp File Format
-noload => format_g726.so ; Raw G.726 (16/24/32/40kbps) data
-noload => format_g729.so ; Raw G729 data
-; load => format_gsm.so ; Raw GSM data
-noload => format_h263.so ; Raw h263 data
-noload => format_jpeg.so ; JPEG (Joint Picture Experts Group) Image
-; load => format_pcm.so ; Raw uLaw 8khz Audio support (PCM)
-noload => format_pcm_alaw.so ; Raw aLaw 8khz PCM Audio support
-noload => format_sln.so ; Raw Signed Linear Audio support (SLN)
-noload => format_vox.so ; Dialogic VOX (ADPCM) File Format
-; load => format_wav.so ; Microsoft WAV format (8000hz Signed Line
-; load => format_wav_gsm.so ; Microsoft WAV format (Proprietary GSM)
-noload => app_alarmreceiver.so ; Alarm Receiver Application
-noload => app_authenticate.so ; Authentication Application
-noload => app_cdr.so ; Make sure asterisk doesn't save CDR
-noload => app_chanisavail.so ; Check if channel is available
-noload => app_chanspy.so ; Listen in on any channel
-noload => app_controlplayback.so ; Control Playback Application
-noload => app_cut.so ; Cuts up variables
-noload => app_db.so ; Database access functions
-; load => app_dial.so ; Dialing Application
-noload => app_dictate.so ; Virtual Dictation Machine Application
-noload => app_directory.so ; Extension Directory
-noload => app_directed_pickup.so ; Directed Call Pickup Support
-noload => app_disa.so ; DISA (Direct Inward System Access) Application
-noload => app_dumpchan.so ; Dump channel variables Application
-; load => app_echo.so ; Simple Echo Application
-noload => app_enumlookup.so ; ENUM Lookup
-noload => app_eval.so ; Reevaluates strings
-noload => app_exec.so ; Executes applications
-noload => app_externalivr.so ; External IVR application interface
-noload => app_forkcdr.so ; Fork The CDR into 2 seperate entities
-noload => app_getcpeid.so ; Get ADSI CPE ID
-noload => app_groupcount.so ; Group Management Routines
-noload => app_ices.so ; Encode and Stream via icecast and ices
-noload => app_image.so ; Image Transmission Application
-noload => app_lookupblacklist.so ; Look up Caller*ID name/number from black
-noload => app_lookupcidname.so ; Look up CallerID Name from local databas
-; load => app_macro.so ; Extension Macros
-noload => app_math.so ; A simple math Application
-noload => app_md5.so ; MD5 checksum Application
-; load => app_milliwatt.so ; Digital Milliwatt (mu-law) Test Application
-noload => app_mixmonitor.so ; Record a call and mix the audio during the recording
-noload => app_parkandannounce.so ; Call Parking and Announce Application
-; load => app_playback.so ; Trivial Playback Application
-noload => app_privacy.so ; Require phone number to be entered
-noload => app_queue.so ; True Call Queueing
-noload => app_random.so ; Random goto
-noload => app_read.so ; Read Variable Application
-noload => app_readfile.so ; Read in a file
-noload => app_realtime.so ; Realtime Data Lookup/Rewrite
-noload => app_record.so ; Trivial Record Application
-; load => app_sayunixtime.so ; Say time
-noload => app_senddtmf.so ; Send DTMF digits Application
-noload => app_sendtext.so ; Send Text Applications
-noload => app_setcallerid.so ; Set CallerID Application
-noload => app_setcdruserfield.so ; CDR user field apps
-noload => app_setcidname.so ; Set CallerID Name
-noload => app_setcidnum.so ; Set CallerID Number
-noload => app_setrdnis.so ; Set RDNIS Number
-noload => app_settransfercapability.so ; Set ISDN Transfer Capability
-noload => app_sms.so ; SMS/PSTN handler
-noload => app_softhangup.so ; Hangs up the requested channel
-noload => app_stack.so ; Stack Routines
-noload => app_system.so ; Generic System() application
-noload => app_talkdetect.so ; Playback with Talk Detection
-noload => app_test.so ; Interface Test Application
-noload => app_transfer.so ; Transfer
-noload => app_txtcidname.so ; TXTCIDName
-noload => app_url.so ; Send URL Applications
-noload => app_userevent.so ; Custom User Event Application
-; load => app_verbose.so ; Send verbose output
-noload => app_waitforring.so ; Waits until first ring after time
-noload => app_waitforsilence.so ; Wait For Silence Application
-noload => app_while.so ; While Loops and Conditional Execution
-noload => func_callerid.so ; Caller ID related dialplan functions
-noload => func_enum.so ; ENUM Functions
-noload => func_uri.so ; URI encoding / decoding functions
-noload => pbx_ael.so ; Asterisk Extension Language Compiler
-; load => pbx_config.so ; Text Extension Configuration
-noload => pbx_functions.so ; Builtin dialplan functions
-noload => pbx_loopback.so ; Loopback Switch
-noload => pbx_realtime.so ; Realtime Switch
-noload => pbx_spool.so ; Outgoing Spool Support
-noload => pbx_wilcalu.so ; Wil Cal U (Auto Dialer)
-;
-; Module names listed in "global" section will have symbols globally
-; exported to modules loaded after them.
-;
-[global]
-chan_modem.so=no
diff --git a/contrib/package/asterisk-xip/files/uci/asteriskconf b/contrib/package/asterisk-xip/files/uci/asteriskconf
deleted file mode 100755
index d90f9d9cd..000000000
--- a/contrib/package/asterisk-xip/files/uci/asteriskconf
+++ /dev/null
@@ -1,144 +0,0 @@
-#!/bin/sh
-
-# Asterisk.conf
-
-init_asteriskconf() {
-
- ast_add_reload dialplan
- ast_enable_type asterisk
- ast_enable_type setglobal
- ast_enable_type include
- # ast_enable_type hardware
- ast_enable_type hardwarereboot
-
-
- asterisk_zone="Australia/Perth"
- asterisk_spooldir="${DEST}/var/spool/asterisk"
- asterisk_logdir="${DEST}/var/log/asterisk"
- asterisk_agidir="${DEST}/usr/lib/asterisk/agi-bin"
- return 0
-}
-
-asterisk_option_list="verbose debug quiet dontwarn timestamp execincludes \
-highpriority initcrypto nocolor dumpcore languageprefix internal_timing \
-systemname maxcalls maxload cache_record_files record_cache_dir \
-transmit_silence_during_record transcode_via_sln runuser rungroup"
-asterisk_path_list="spooldir logdir agidir"
-
-valid_asterisk_option() {
- is_in_list $1 ${asterisk_option_list} ${asterisk_path_list} zone
- return $?
-}
-
-create_asteriskconf() {
- # echo ${DEST_DIR}
- file=${DEST_DIR}/asterisk.conf
- get_checksum asterisk_conf $file
-
- echo "${asteriskuci_gen}${N}[directories]
-astetcdir => ${DEST_DIR}
-astmoddir => ${DEST}/usr/lib/asterisk/modules
-astvarlibdir => ${DEST}/usr/lib/asterisk
-astdatadir => ${DEST}/usr/lib/asterisk
-astrundir => /var/run" > $file
- for i in ${asterisk_path_list} ; do
- eval "value=\"\${asterisk_$i}\""
- if [ ! -z $value ] ; then
- echo "ast$i => $value" >> $file
- fi
- done
- echo "${N}[options]" >> $file
-
- for i in ${asterisk_option_list} ; do
- eval "value=\"\${asterisk_$i}\""
- if [ ! -z $value ] ; then
- echo "$i => $value" >> $file
- fi
- done
-
- echo "${N}; Changing the following lines may compromise your security.
-[files]
-astctlpermissions = 0660
-astctlowner = root
-astctlgroup = nogroup
-astctl = asterisk.ctl " >> $file
- check_checksum "$asterisk_conf" "$file" || ast_restart=1
-
-}
-
-handle_asterisk() {
- option_cb() {
- case $1 in
- zone)
- asterisk_zone="$2";;
- *)
- if valid_asterisk_option $1 $2 ; then
- eval "asterisk_${1}=\"$2\""
- else
- logerror "Invalid Asterisk option: $1"
- fi
- esac
- }
-}
-
-handle_include(){
- option_cb() {
- case $1 in
- dialplan|dialplan_ITEM*)
- append dialplan_includes "#include <$2>" "${N}"
- ;;
- dialplan_COUNT) ;;
- *) logerror "Invalid option \"$1\" for include" ;;
- esac
- }
-}
-
-handle_setglobal() {
- option_cb() {
- case $1 in
- set_COUNT) ;;
- set|set_ITEM*)
- if [ "${2%=*}" == "${2}" ] ; then
- logerror "SetGlobal option \"$2\" not of the form VARIABLE=Value"
- else
- append dialplan_globals "" "${N}"
- fi ;;
- *) logerror "Invalid option \"$1\" for setglobal" ;;
- esac
- }
-}
-
-handle_hardwarereboot() handle_hardware reboot
-
-# Handle hardware options (reboot) for Softphones
-handle_hardware() {
- case $1 in
- reboot)
- hardware_method=
- hardware_param=
- option_cb() {
- case $1 in
- method)
- hardware_method="$2";;
- param)
- case ${hardware_method} in
- web) append hardware_reboots "wget -q $2 -O - >&- 2>&-" "${N}" ;;
- system) append hardware_reboots "$2 >&- 2>&-" "${N}" ;;
- *) logerror "Invalid Hardware reboot method: ${hardware_method}"
- esac
- esac
-
- }
- ;;
- *) logerror "Invalid Hardware option: $1"
- esac
-}
-
-reboot_hardware() {
- cd /tmp
- eval ${hardware_reboots}
-}
-
-
-
-# vim: ts=2 sw=2 noet foldmethod=indent
diff --git a/contrib/package/asterisk-xip/files/uci/asteriskconf.txt b/contrib/package/asterisk-xip/files/uci/asteriskconf.txt
deleted file mode 100644
index 8966cb844..000000000
--- a/contrib/package/asterisk-xip/files/uci/asteriskconf.txt
+++ /dev/null
@@ -1,41 +0,0 @@
-
-asterisk
- zone - Default TimeZone
-
- Various asterisk.conf options
- verbose
- debug
- quiet
- dontwarn
- timestamp
- execincludes
- highpriority
- initcrypto
- nocolor
- dumpcore
- languageprefix
- internal_timing
- systemname
- maxcalls
- maxload
- cache_record_files
- record_cache_dir
- transmit_silence_during_record
- transcode_via_sln
- runuser
- rungroup
-
- spooldir
- logdir
- agidir
-
-setglobal
- set (list) - VARIABLE=Value Global Variables
-
-include
- dialplan (list) - Files to #include
-
-hardwarereboot - Reboot phone hardware
- method - web (wget), system
- param - url/program for reboot
-
diff --git a/contrib/package/asterisk-xip/files/uci/asteriskuci b/contrib/package/asterisk-xip/files/uci/asteriskuci
deleted file mode 100755
index 4de95a7fc..000000000
--- a/contrib/package/asterisk-xip/files/uci/asteriskuci
+++ /dev/null
@@ -1,377 +0,0 @@
-#!/bin/sh
-
-# Author: Michael Geddes <michael at frog dot wheelycreek dot net>
-# Copyright 2008 Michael Geddes
-# Licensed under GPL
-Version=0.8
-
-
-# Todo
-# Calling of Macros in dialplan
-# Create a Menu
-# Incoming Zones
-
-debuglevel=0
-
-. /etc/functions.sh
-
-asteriskuci_gen="; Generated by Openwrt AstriskUCI script version ${Version}$N"
-
-# Utils
-
-logerror() {
- echo "Error: $1"
-}
-
-logdebug() {
- if [ $(expr $1 "<=" ${debuglevel-0}) == 1 ] ; then
- echo "Log: $2"
- fi
-}
-
-is_in_list(){
- val=$1
- shift
- for i in $* ; do
- [ $i == $val ] && return 0
- done
- return 1
-}
-
-split_append() { # {list} {prefix} {item} {func call}
- local lhs="$2"
- local rhs="$3"
-
- while [ ! -z "$rhs" ] ; do
- cur=${rhs%%,*}
- nvar=${rhs#*,}
- [ -z "$5" ] || eval "$5 ${cur}"
- append $1 "${lhs}${cur}" "$4"
- [ "$nvar" == "$rhs" ] && break
- rhs=${nvar}
- done
-}
-
-get_checksum() {
- if [ -r "$2" ] ; then
- local sum=`md5sum $2 | cut -d " " -f 1`
- eval "$1=\"$sum\""
- else
- eval "$1=NONE"
- fi
- #eval "logdebug 1 \"Checksum $2 : \${$1}\""
-}
-
-check_checksum() {
- if [ -r "$2" ] ; then
- local sum=`md5sum $2 | cut -d " " -f 1`
- else
- eval sum=NONE
- fi
- #logdebug 1 "Compare $1 checksum $2 with new checksum $sum "
- [ "$sum" == "$1" ]
- return $?
-}
-
-# Add config module to initialise list
-ast_add_conf() append asterisk_conf_list $1 " "
-# Add module to initialise list
-ast_add_module() {
- append asterisk_module_list $1 " "
- eval "createdialplan_$1() return 0"
-}
-# Add to 'reload' list.
-ast_add_reload() append asterisk_load_list $1 " "
-
-# Enable a top-level type
-ast_enable_type() eval "enabled_section_${1}=1"
-
-# Is a top-level type enabled?
-ast_type_enabled() {
- eval "local res=\${enabled_section_${1}}"
- if [ "$res" != 1 ] ; then
- return 1 #Fail
- fi
- return 0
-}
-
-# For use in sections - make sure that the last section is processed
-check_add() {
- logdebug 1 "Check add $1"
- if [ ! -z "${last_added_checked}" ] ; then
- logdebug 1 "Eval check-add ${last_added_checked}"
- eval "check_add_${last_added_checked}"
- fi
- last_added_checked=$1
-}
-
-# Process the section yet to be checked.
-check_all_added() check_add ""
-
-# Create static links for stuff we dont want to configure yet.
-create_staticlinks() {
- logdebug 1 "Link in a few mostly static configurations"
- linkconfigs="codecs.conf say.conf sip_notify.conf udptl.conf logger.conf"
- module_enabled res_indications && append linkconfigs indications.conf " "
- for i in ${linkconfigs} ; do
- [ -e $DEST_DIR/$i ] || ln -s $DEST/etc/asterisk/$i $DEST_DIR
- done
-
- logdebug 1 "Link in #include directories"
- for i in include inc libs lib library macro macros ; do
- if [ -e $DEST/etc/asterisk/$i -a ! -d "$DEST_DIR/$i" -a ! -e "$DEST_DIR/$i" ] ; then
- ln -s $DEST/etc/asterisk/$i $DEST_DIR
- fi
- done
-}
-
-# default reboot
-reboot_hardware() {}
-
-
-# Top level handler
-setup_asterisk() {
- DEST=${1%/}
- DEST_DIR=/tmp/asterisk
-
- testing_mode=0
- if [ "$2" == "testonly" ] ; then
- testing_mode=1
- elif [ "$2" == "test" ] ; then
- DEST_DIR=/tmp/asterisk.tmp
- echo Using Test dir: $DEST_DIR
- testing_mode=2
- fi
-
- [ -z "$3" ] || debuglevel=$3
-
- logdebug 1 "Loading Asterisk Config"
- . ${UCILIB}/asteriskconf
- logdebug 2 "Loading Module Config"
- . ${UCILIB}/moduleconf
- logdebug 2 "Loading Dialplan Config"
- . ${UCILIB}/dialplanconf
-
- for f in ${DEST}/etc/asterisk/conf.d/* ; do
- logdebug 1 "Loading Module $f"
- [ -f $f ] && . $f
- done
-
- include /lib/network
- scan_interfaces
-
- init_asteriskconf
- init_moduleconf
- init_dialplanconf
-
- for i in ${asterisk_module_list} ; do
- logdebug 1 "Init $i module"
- eval "init_${i}"
- done
-
- for i in ${asterisk_conf_list} ; do
- logdebug 1 "Init $i config"
- eval "init_${i}conf"
- done
-
- config_cb() {
- cur_section=$1/$2
- logdebug 2 "Load $1/$2"
- eval "local val=\"\${dups_$2}\""
- if [ "${val}" == "" ] ; then
- eval "dups_$2=1"
- else
- logerror "Duplicate Section Name: $2 (type $1)"
- fi
-
- if ast_type_enabled $1 ; then
- eval "handle_$1 \$2"
- elif [ ! -z "$1" ] ; then
-
- logerror "Unknown section: $1/$2"
- option_cb() {
- logerror "Invalid option '$1' for invalid section"
- }
- fi
- }
- config_load asterisk
- check_all_added
-
- if [ "$testing_mode" != "1" ] ; then
- mkdir -p ${DEST_DIR}
-
- create_asteriskconf
- for i in ${asterisk_conf_list} ; do
- logdebug 1 "Create $i config"
- eval "create_${i}conf"
- done
-
- for i in ${asterisk_module_list} ; do
- logdebug 1 "Create Dialplan for module $i"
- eval "createdialplan_${i}"
- done
- create_dialplanconf
- create_moduleconf
-
- # Link in a few mostly static configurations
- create_staticlinks
- fi
- [ "$testing_mode" == "2" ] && reload_check_asterisk
- return 0
-}
-
-astcmd() {
- ASTCMD="${DEST%/}/usr/sbin/asterisk -C /tmp/asterisk/asterisk.conf "
- logdebug 1 "Command: $1"
- if [ -z "${2-}" ] ; then
- ${ASTCMD} -r -x "$1" 2>&- 1>&-
- else
- eval "$2=`${ASTCMD} -r -x \"$1\"`"
- fi
- return $?
-}
-
-# waitfor() {
-# while [ -d /proc/$1 ] ; do
-# sleep 1
-# done
-# }
-
-restart_gracefully() {
- stop_uci_asterisk "$DEST"
- startup_asterisk "$DEST"
- #ret=0
- #echo "Check for pid"
- #if [ -r /var/run/asterisk.ctl ] ; then
- # astcmd "stop gracefully"
- # local ret=$?
- # [ ${ret} = 0 ] || return $ret
- # waitfor `cat /var/run/asterisk.pid`
- #fi
- #startup_asterisk ${DEST}
- return 0
-}
-astcmds() {
- while [ ! -z "$1" ] ; do
- astcmd "$1"
- shift
- done
-}
-
-reload_check_asterisk() {
- logdebug 1 "Check Reloading"
- local reboot=0
- if [ "${ast_restart-}" == 1 ] ; then
- logdebug 1 "Restarting Gracefully"
- reboot=0
- else
- for i in ${asterisk_load_list} ; do
- logdebug 1 "Checking ${i} reload"
- eval "local doload=\${ast_${i}_restart}"
- case $doload in
- 1) logdebug 1 "Reloading ${i}" ;;
- 2) logdebug 1 "Unloading ${i}" ;;
- esac
- done
- fi
- [ ${reboot} = 1 ] && logdebug 1 "reboot hardware"
-}
-
-reload_asterisk() {
- logdebug 1 "Reloading"
- local reboot=0
- if [ "${ast_restart-}" == 1 ] ; then
- logdebug 2 "Restarting Gracefully"
- restart_gracefully
- reboot=0
- else
- for i in ${asterisk_load_list} ; do
- logdebug 3 "Checking ${i} reload"
- eval "local doload=\${ast_${i}_restart}"
- case $doload in
- 1) logdebug 1 "Reloading ${i}"
- eval "reload_${i}" || reboot=1 ;;
- 2) logdebug 1 "Unloading ${i}"
- eval "unload_${i}" || reboot=1 ;;
- esac
- done
- fi
-
- if [ ${reboot} = 1 ] ; then
- ( sleep 5; reboot_hardware ) &
- fi
-}
-
-startup_asterisk() {
- DEST="${1%/}"
- DEFAULT=$DEST/etc/default/asterisk
- [ -f $DEFAULT ] && . $DEFAULT
- [ -d /var/run ] || mkdir -p /var/run
- [ -d ${asterisk_logdir} ] || mkdir -p ${asterisk_logdir}
- [ -d ${asterisk_spooldir} ] || mkdir -p ${asterisk_spooldir}
- [ -d /var/spool/asterisk ] || mkdir -p /var/spool/asterisk
- [ -h $DEST/usr/lib/asterisk/astdb ] || ln -sf /var/spool/asterisk/astdb $DEST/usr/lib/asterisk/astdb
- [ -e /dev/zappseudo ] && [ ! -d /dev/zap -o ! -e /dev/zap/pseudo ] && mkdir -p /dev/zap && ln -s /dev/zappseudo /dev/zap/pseudo
-
- $DEST/usr/sbin/asterisk -C /tmp/asterisk/asterisk.conf $UCIOPTIONS -f 2>&1 > ${asterisk_logdir}/asterisk_proc &
- # Wait a bit then reboot the hardware
- ( sleep 5; reboot_hardware ) &
-}
-
-# Init.d start() handler
-start_uci_asterisk() {
- DEST="${1%/}"
-
- if setup_asterisk $DEST ; then
- startup_asterisk "$DEST"
- fi
-}
-
-restart_uci_asterisk() {
- DEST="${1%/}"
- if setup_asterisk $DEST ; then
- echo "Trying to Restart gracefully"
- if [ -r /var/run/asterisk.ctl ] ; then
-# if astcmd "restart gracefully" ; then
- echo "Sending restart"
- if restart_gracefully ; then
- echo "Restarting gracefully"
- return 0
- fi
- fi
- stop_uci_asterisk "$DEST"
- startup_asterisk "$DEST"
- else
- stop_uci_asterisk $1
- echo "Setup Failed"
- return 1
- fi
-}
-
-# init.d stop() handler
-stop_uci_asterisk() {
- DEST=${1%/}
- if [ -r /var/run/asterisk.ctl ] ; then
- astcmd "stop now"
- sleep 1
- fi
- [ -f /var/run/asterisk.pid ] && kill $(cat /var/run/asterisk.pid) >/dev/null 2>&1
-}
-
-reload_uci_asterisk() {
- DEST=${1%/}
- DEFAULT=$DEST/etc/default/asterisk
-
- if [ -r /var/run/asterisk.ctl ] ; then
-
- [ -e /dev/zappseudo ] && [ ! -d /dev/zap -o ! -e /dev/zap/pseudo ] && mkdir -p /dev/zap && ln -s /dev/zappseudo /dev/zap/pseudo
- if setup_asterisk "$DEST" ; then
- # Selective reload modules.
- reload_asterisk
- fi
- else
- start_uci_asterisk "$1"
- fi
-}
-
-# vim: ts=2 sw=2 noet foldmethod=indent
diff --git a/contrib/package/asterisk-xip/files/uci/dialplanconf b/contrib/package/asterisk-xip/files/uci/dialplanconf
deleted file mode 100755
index a8d5522e6..000000000
--- a/contrib/package/asterisk-xip/files/uci/dialplanconf
+++ /dev/null
@@ -1,855 +0,0 @@
-#!/bin/sh
-
-# Dialplans (extensions.conf)
-
-# Implicit: ast_add_conf dialplan
-init_dialplanconf() {
- ast_enable_type dialplangeneral
- ast_enable_type dialplan
- ast_enable_type dialplanexten
- ast_enable_type dialplangoto
- ast_enable_type dialplansaytime
- ast_enable_type dialzone
- ast_enable_type inzone
- ast_enable_type incominggeneral
- ast_enable_type incoming
-
- dialplan_allowtransfer=no
- dialplan_dialtimeout=30
- dialplan_answerfirst=no
- dialplan_static=yes
- dialplan_writeprotect=no
- dialplan_canreinvite=no
- dialplan_includes=
- dialplan_globals=
- return 0
-}
-
-match_all="_[0-9*+#]."
-match_all_s="_[0-9*+#s]."
-
-dialplangeneral_list="static writeprotect canreinvite clearglobalvars"
-dialplangeneral_list_ex="lastdialed lastdialedtype voiceboxext answerfirst dialtimeout allowtransfer international internationalout"
-
-valid_dialplangeneral() {
- for i in ${dialplangeneral_list} ${dialplangeneral_list_ex} ; do
- [ "$i" == "$1" ] && return 0
- done
- return 1
-}
-
-
-check_add_context() {
- local context="${1}"
- local check="${context#macro-}"
- [ "${context}" == ${check} ] || check="macro__${check}"
- eval "local isadded=\"\${dialplan_add_context_${check}-0}\""
- if [ "$isadded" != "1" ] ; then
- eval "dialplan_add_context_${check}=1"
- append dialplan_contexts "$context"
- return 0
- else
- return 1
- fi
-}
-append_dialplan_context() {
- local context="${1}"
- local check="${context#macro-}"
- [ "${context}" == ${check} ] || check="macro__${check}"
- append dialplan_context_${check} "${2}" "${N}"
-}
-
-reload_dialplan() astcmd "dialplan reload"
-
-add_dialplan_exten() {
- local context=$1
- logdebug 3 "Exten: $2"
- local ext="exten => $2,"
- local planopt=
- local timeout=${dialplan_dialtimeout}
- # Answer extensions first.
- local answerfirst=${dialplan_answerfirst}
- local mailbox=$4
- [ -z "$5" ] || timeout=$5
- [ -z "$6" ] || answerfirst=$6
-
- check_add_context "$context"
-
- if [ "$dialplan_allowtransfer" == "yes" ] ; then
- planopt=${planopt}t
- fi
- if [ ! -z "${planopt}" ] ; then
- planopt=",${timeout},${planopt}"
- elif [ ! -z "${timeout}" ] ; then
- planopt=",${timeout}"
- fi
- local dial="Dial($3$planopt)"
- local item="1,"
- if [ "$answerfirst" == "yes" ] ; then
- append_dialplan_context ${context} "${ext}1,Answer"
- item="n,"
- fi
- append_dialplan_context ${context} "${ext}${item}${dial}"
- if [ ! -z "${mailbox}" ] ; then
- enable_voicemail
- append_dialplan_context ${context} "${ext}n,VoiceMail(${mailbox})"
- fi
-
- append_dialplan_context ${context} "${ext}n,Congestion"
-}
-
-add_dialplan_include() {
- local context=$1
- logdebug 1 "Adding Dialplan Include $1 $2"
- check_add_context "$context"
-
- split_append dialplan_context_${context} "include => " "$2" "${N}"
-}
-
-add_dialplan_saytime() {
- local context=$1
- logdebug 1 "Adding Dialplan saytime $1 $2"
- check_add_context "$context"
- local ext="exten => $2,"
- if [ "$dialplan_add_context_saytime" != 1 ] ; then
- append dialplan_contexts saytime " "
- dialplan_add_context_saytime=1
- enable_format gsm
- enable_module app_sayunixtime
- local zone=${asterisk_zone}
- [ ! -z "$3" ] && zone="$3"
- local format="IMp AdbY"
- [ ! -z "$4" ] && format="$4"
- append dialplan_context_saytime "exten => s,1,SayUnixTime(,${zone},${format})" "${N}"
- fi
- append_dialplan_context ${context} "${ext}1,Goto(saytime,s,1)"
-}
-
-add_dialplan_goto() {
- local context=$1
- logdebug 1 "Adding Dialplan goto $1 $2 $3"
- check_add_context "$context"
- append dialplan_context_${context} "exten => $2,1,Goto($3,\${EXTEN},1)" "${N}"
-}
-
-dialplan_inzone_list="match caller goto"
-
-valid_dialplan_inzone() {
- is_in_list $1 ${valid_inzone_list}
- return $?
-}
-
-check_append_inzone() {
- local context="${1}"
- eval "local isadded=\"\${dialplan_add_inzone_${context}-0}\""
- if [ "$isadded" != "1" ] ; then
- eval "dialplan_add_inzone_${check}=1"
- append inzone_contexts "$context"
- return 0
- else
- return 1
- fi
-}
-
-handle_inzone() {
-
- context_name=${1}
- check_append_inzone ${context_name}
-
- option_cb(){
- case $1 in
- goto) eval "inzone_${context_name}_goto=\"\$2\"" ;;
- match_ITEM*|match) append inzone_${context_name}_match "$2" " " ;;
- caller_ITEM*|caller) append inzone_${context_name}_caller "$2" " " ;;
- include_ITEM*|include) append inzone_${context_name}_include "$2" " " ;;
- match_LENGTH|caller_LENGTH|include_LENGTH) ;;
- _*) ;;
- *) logerror "Invalid Dialplan inzone option: $1" ;;
- esac
- }
-}
-
-
-append_dialplan_inzone() {
- local file=$1
- for context in ${inzone_contexts} ; do
- for i in goto match caller include ; do
- eval "iz_$i=\"\${inzone_${context}_${i}}\""
- done
- if [ -z "${iz_goto}" ] ; then
- logerror "Missing goto for inzone: ${context}"
- elif [ -z "${iz_match}" -a -z "${iz_caller}" ] ; then
- logerror "Missing match for inzone: ${context}"
- else
- echo "${N}[${context}]" >> ${file}
- for curmatch in ${iz_include} ; do
- echo "include => ${curmatch}" >> $file
- done
-
- local gotoline="Goto(${iz_goto},\${EXTEN},1)"
- [ -z "${iz_match}" ] && iz_match=${match_all}
- for curmatch in ${iz_match} ; do
- if [ -z "${iz_caller}" ] ; then
- echo "exten => ${curmatch},1,${gotoline}" >> $file
- else
- for curcaller in ${iz_caller} ; do
- echo "exten => ${curmatch}/${curcaller},1,${gotoline}" >> $file
- done
- fi
- done
- fi
- done
-}
-
-append_dialplan_dialzone() {
- local file=$1
-
- # Add the dialzone contexts
- logdebug 1 "Dialplan: Add the dialzone contexts"
- for zonename in ${dzones_match} ; do
- eval "local diallist=\${dzone_${zonename}_match-}"
- echo "${N}[${zonename}]" >> $file
- eval "dialz=\${dzone_match_use_${zonename}-}"
-
- logdebug 3 "Find international options for zone ${zonename} from ${dialz}"
- for v in prefix internationalprefix alwaysinternational countrycode ; do
- eval "local $v=\${target_${v}_${dialz}:-}"
- eval logdebug 3 "\"${v} = '\${$v}'\""
- done
-
- for v in localzone addprefix localprefix; do
- eval "local $v=\${dzone_${zonename}_${v}:-}"
- done
- while [ ! -z "$diallist" ] ; do
- cur=${diallist%%,*}
- nvar=${diallist#*,}
- if [ "${alwaysinternational}" = "yes" ] ; then
- # Always dial international number with this target
- # remove 'localprefix' (usually 0) from 'addprefix'
- logdebug 3 "Removing ${localprefix} from ${addprefix}"
- addprefix=${addprefix#$localprefix}
- local curlen=`expr length "${localprefix}"`
- if [ $curlen != 0 ] ; then
- # remove 0 (or local prefix)
- echo "exten => _${localprefix}${cur},1,Goto(${dialz}_dial,${countrycode}${addprefix}\${EXTEN:$curlen},1)" >> $file
- fi
- echo "exten => _${cur},1,Goto(${dialz}_dial,${countrycode}${addprefix}\${EXTEN},1)" >> $file
- else
- echo "exten => _${cur},1,Goto(${dialz}_dial,${addprefix}\${EXTEN},1)" >> $file
- fi
- [ "$nvar" == "$diallist" ] && break
- diallist=${nvar}
- done
- eval "local diallist=\${dzone_${zonename}_international-}"
- if [ ! -z "${diallist}" ] ; then
- logdebug 2 "International: ${diallist}"
- while [ ! -z "$diallist" ] ; do
- cur="${diallist%%,*}"
- nvar="${diallist#*,}"
- logdebug 4 "Adding international ${cur}"
-
- local curlen=`expr length "${cur}"`
- if [ "$alwaysinternational" = "yes" ] ; then
- echo "exten => _${cur},1,Goto(${dialz}_dial,${addprefix}\${EXTEN:${curlen}},1)" >> $file
- else
- echo "exten => _${cur}.,1,Goto(${zonename}_check,${addprefix}\${EXTEN:${curlen}},1)" >> $file
- fi
- [ "$nvar" == "$diallist" ] && break
- diallist="${nvar}"
- done
-
- if [ "$alwaysinternational" != "yes" ] ; then
- logdebug 2 "Not Always International:"
- # Check for local country code
- echo "[${zonename}_check]" >> $file
-
- local locallen=`expr length "${countrycode}"`
- echo "exten => _${countrycode}X.,1,Goto(${localzone-default},${localprefix-0}\${EXTEN:${locallen}},1)" >> $file
- echo "exten => _X.,1,Goto(${dialz}_dial,${internationalprefix}\${EXTEN},1)" >> $file
- fi
- fi
- done
- logdebug 1 "Dialplan: Finish the dialzone contexts"
-
-}
-
-append_dialplan_dialzone_out(){
- local file=$1
-
- # Add the dialzone target contexts (dialing out)
- logdebug 1 "Dialplan: Add the dialzone target contexts"
- for contype in SIP IAX ; do
- eval local conlist=\${dzones_${contype}-}
- logdebug 1 "Adding ${contype} targets: ${conlist}"
- for conname in $conlist ; do
- echo "${N}[${contype}_${conname}_dial]" >> $file
- for v in prefix internationalprefix alwaysinternational countrycode timeout lastdialed lastdialedtype ; do
- eval "local $v=\${target_${v}_${contype}_${conname}:-}"
- done
-
- if [ -z "${lastdialed}" ] ; then
- lastdialed=${dialplan_lastdialed}
- lastdialedtype=${dialplan_lastdialedtype}
- fi
-
- # [ -z "${lastcallout}" ] && lastcallout=${feature_lastcall_outqueue}
- # if [ ! -z "${lastcalloutexten}" ] ; then
- # eval "local added=\${lastcallout_outqueue_extension_${lastcalloutexten}}"
- # if [ ! "${added}" == 1 ] ; then
- # add_dialplan_lastcall extensions "${lastcalloutexten}" "${lastcallout}" "${feature_lastcall_outcount}"
- # eval "local lastcallout_outqueue_extension_${lastcalloutexten}=1"
- # fi
- # fi
- local ext="exten => _X.,"
- local en="1,"
- # Do not use prefix unles 'alwaysinternational' is yes
- [ "$alwaysinternational" != "yes" ] && internationalprefix=
-
- # if [ ! -z "${lastcallout}" ] ; then # Add lastcall out
- # enable_lastcall
- # echo "${ext}${en}Macro(lastcallstore,${internationalprefix}\${EXTEN},${lastcallout},${feature_lastcall_outcount})" >> $file
- # en="n,"
- # fi
-
- if [ ! -z "${lastdialed}" ] ; then
- enable_module func_callerid
- local lastparam="\${EXTEN}"
- local lastmacro=${lastdialed}
- local lastmacrotype=${lastdialedtype}
- [ -z ${lastdialedtype} ] && lastdialedtype=macro
-
- local jumpmacroline=
- gen_jumpmacro jumpmacroline "${ext}${en}" "" "${lastmacrotype}" "${lastmacro}" "${lastparam}"
- echo ${jumpmacroline} >> $file
- en="n,"
- fi
- echo "${ext}${en}Dial(${contype}/${prefix}${internationalprefix}\${EXTEN}@${conname},$timeout)" >> $file
- echo "exten => _X.,n,Congestion" >> $file
- done
- done
-}
-
-
-gen_jumpmacro() {
- logdebug 3 "Gen JumpMacro /$1/=/$2/$3/$4/$5/$6/"
- local leader=$2
- local condition=$3
- local macrotype=$4
- local name=$5
- local param=$6
-
- if [ -z "${condition}" ] ; then
- local cond="("
- else
- local cond="If(${condition}?"
- fi
- case ${macrotype} in
- gosub)
- enable_module app_stack # for gosub
- logdebug 1 "${1}=\"\${leader}Gosub\${cond}\${name},\${param},1)\""
- eval "${1}=\"\${leader}Gosub\${cond}\${name},\${param},1)\"" ;;
- gosub_s)
- enable_module app_stack # for gosub
- logdebug 1 "${1}=\"\${leader}Gosub\${cond}\${name},s,1(\${param}))\""
- eval "${1}=\"\${leader}Gosub\${cond}\${name},s,1(\${param}))\"" ;;
- macro)
- enable_module app_macro
- logdebug 1 "${1}=\"\${leader}Macro\${cond}\${name},\${param})\""
- eval "${1}=\"\${leader}Macro\${cond}\${name},\${param})\"" ;;
-
- s|start)
- enable_module app_goto
- logdebug 1 "${1}=\"\${leader}Goto(\${iz_target},s,1)\""
- eval "${1}=\"\${leader}Goto(\${iz_target},s,1)\"" ;;
- *)
- enable_module app_goto
- logdebug 1 "${1}=\"\${leader}Goto\${cond}\${name},\${param},1)\""
- eval "${1}=\"\${leader}Goto\${cond}\${name},\${param},1)\"" ;;
- esac
-}
-
-append_jumpmacro(){
- local context=$1
- local jumpmacroline=""
- gen_jumpmacro "jumpmacroline" "$2" "$3" "$4" "$5" "$6"
- append_dialplan_context ${context} "${jumpmacroline}"
-}
-
-append_dialplan_incoming(){
- local file=$1
- # Evaluate the incoming ringing dialplans
- logdebug 1 "Add the 'incoming' dialplans: ${dialplan_extensions_incoming}"
- for context in ${dialplan_extensions_incoming} ; do
- eval "local curext=\"\${dialplan_incoming_$context}\""
- logdebug 2 "Adding incoming ${curext}"
-
- check_add_context "$context"
- # lastcall lastcallexten lastmissed lastmissedexten
- for i in answerfirst beforeanswer timeout menucontext \
- lastcall lastcalltype missed missedtype allowtransfer mailbox match matchcaller aftertimeout aftertimeouttype; do
- eval "local iz_$i=\"\${incoming_${context}_$i}\""
- eval "logdebug 1 \"Incoming \$context: iz_\$i=\${iz_$i}\""
- done
- [ ! -z ${iz_menucontext} ] && iz_answerfirst=yes
-
- if [ ! -z ${curext} ] ; then
- [ -z ${iz_answerfirst} ] && iz_answerfirst=${incoming_answerfirst}
-# [ -z ${iz_lastcall} ] && iz_lastcall=${feature_lastcall_inqueue}
- if [ -z ${iz_lastcall} ] ; then
- iz_lastcall=${incoming_lastcall}
- iz_lastcalltype=${incoming_lastcalltype}
- fi
- if [ -z ${iz_missed} ] ; then
- iz_missed=${incoming_missed}
- iz_missedtype=${incoming_missedtype}
- fi
- [ -z ${iz_mailbox} ] && iz_mailbox=${incoming_mailbox}
- [ -z ${iz_timeout} ] && iz_timeout=${incoming_timeout}
- [ -z ${iz_allowtransfer} ] && iz_allowtransfer=${incoming_allowtransfer}
- fi
-
- [ -z ${iz_match} ] && iz_match=_X.
- [ ! -z ${iz_matchcaller} ] && iz_match=${iz_match}/${iz_matchcaller}
-
- local ext="exten => ${iz_match},"
- local planopt=
- [ "${iz_allowtransfer}" == "yes" ] && planopt=${planopt}t
- local item="1,"
-
- #append_dialplan_context ${context} "${ext}${item}Ringing()"
- if [ ! -z "${iz_lastcall}" ] ; then
-
- enable_module func_callerid
- local lastparam="\${CALLERID(num)}"
- local lastmacrotype="${iz_lastcalltype}"
- [ -z "${iz_lastcalltype}" ] && lastmacrotype=macro
- local lastmacro=${iz_lastcall}
- append_jumpmacro "${context}" "${ext}${item}" "" "${lastmacrotype}" "${lastmacro}" "${lastparam}"
- item="n,"
- fi
- if [ ! -z "${iz_missed}" ] ; then
- enable_module func_callerid
- local missedparam="\${CALLERID(num)}"
- [ -z "${iz_missedtype}" ] && iz_missedtype=macro
-
- append_dialplan_context ${context} "${ext}${item}Set(lcsMissed=\${CALLERID(num)})"
- item="n,"
- fi
- # Ring before answering
- if [ ! -z "${iz_beforeanswer}" -a ! -z "${curext}" ] ; then
- append_dialplan_context ${context} "${ext}${item}Dial(${curext},${iz_beforeanswer},${planopt})"
- iz_answerfirst=yes
- item="n,"
- fi
- # Now answer
- if [ "$iz_answerfirst" == "yes" ] ; then
- append_dialplan_context ${context} "${ext}${item}Answer"
- item="n,"
- fi
- # if [ ! -z ${iz_lastcallexten} ] ; then
- # enable_lastcall
- # add_dialplan_lastcall extensions "${iz_lastcallexten}" "${iz_lastcall}" "${feature_lastcall_incount}"
- # fi
-
- if [ ! -z ${curext} ] ; then
- if [ ! -z ${iz_menucontext} ] ; then
- planopt=${planopt}rd
- enable_module res_indications
- # wait so the next ring connects.
- append_dialplan_context ${context} "${ext}${item}Wait(1)"
- append_dialplan_context ${context} "${ext}n,Set(EXITCONTEXT=${iz_menucontext})"
- fi
-
- if [ ! -z ${planopt} ] ; then
- planopt=",${iz_timeout-},${planopt}"
- elif [ ! -z ${iz_timeout-} ] ; then
- planopt=",${iz_timeout-}"
- fi
- local dial="Dial(${curext}${planopt})"
-
- append_dialplan_context ${context} "${ext}n,${dial})"
-
- if [ ! -z ${iz_missed} ] ; then
- # It went to voicemail or was hung up - consider missed
- append_jumpmacro ${context} "${ext}${item}" "" "${iz_missedtype}" "${iz_missed}" "\${lcsMissed}"
- fi
- fi
-
- local need_hangup=1
- # Add a goto or macro at the end
- if [ ! -z ${iz_target} ] ; then
- case ${iz_aftertimeouttype} in
- macro) append_dialplan_context ${context} "${ext}${item}Macro(${iz_target})";;
- s|start) append_dialplan_context ${context} "${ext}${item}Goto(${iz_target},s,1)"
- need_hangup=0;;
- *) append_dialplan_context ${context} "${ext}${item}Goto(${iz_target},\${EXTEN},1)"
- need_hangup=0;;
- esac
- fi
-
- if [ ! -z ${iz_mailbox} ] ; then
- enable_voicemail
- append_dialplan_context ${context} "${ext}n,VoiceMail(${iz_mailbox})"
- fi
-
- [ "${need_hangup}" = "1" ] && append_dialplan_context ${context} "${ext}n,Hangup"
-
- if [ ! -z ${iz_missed} ] ; then
- # Check for missed call
-
- append_jumpmacro ${context} "exten => h,1," "\$[\"\${DIALSTATUS}\" = \"CANCEL\"]" "${iz_missedtype}" "${iz_missed}" "\${lcsMissed}"
- #append dialplan_context_${context} \
- # "exten => h,1,MacroIf(\$[\"\${DIALSTATUS}\" = \"CANCEL\"]?lastcallstore,\${lcsMissed},${iz_lastmissed},${feature_lastcall_incount})" "${N}"
- # [ ! -z ${iz_lastmissedexten} ] && \
- # add_dialplan_lastcall extensions "${iz_lastmissedexten}" "${iz_lastmissed}" "${feature_lastcall_incount}"
- fi
- done
-}
-
-append_dialplan_extensions(){
- local file=$1
- # Evaluate the 'extension' dialplans
- logdebug 1 "Add the 'extension' dialplans: ${dialplan_exts}"
- for i in ${dialplan_exts} ; do
- eval "local curext=\"\${dialplan_ext_$i}\""
- add_dialplan_exten extensions $i $curext
- done
-}
-
-append_include() {
- append dialplan_includes "#include <$1>" "$N"
-}
-
-
-create_dialplanconf() {
- # Add general section
- logdebug 1 "Dialplan: Add general section"
- local file=${DEST_DIR}/extensions.conf
- get_checksum dialplan_conf $file
-
- echo "${asteriskuci_gen}" > $file
-
- [ -z "${dialplan_includes}" ] || (echo "${dialplan_includes}${N}" >> $file)
-
- if [ ! -z "${dialplan_globals}" ] ; then
- echo "[globals]${N}${dialplan_globals}${N}" >> $file
- fi
-
- echo "[general]" >> $file
- for i in ${dialplangeneral_list} ; do
- eval "local val=\"\$dialplan_$i\""
- if [ ! -z "$val" ] ; then
- echo "$i=$val" >> $file
- fi
- done
-
- append_dialplan_dialzone "$file"
-
- append_dialplan_dialzone_out "$file"
-
- append_dialplan_park "$file"
-
- append_dialplan_extensions "$file"
-
- append_dialplan_inzone "$file"
-
- append_dialplan_incoming "$file"
-
-
- # append_dialplan_lastcall "$file"
-
- # Add all the contexts
- logdebug 1 "Dialplan: Add all the contexts"
- for i in ${dialplan_contexts} ; do
- echo "${N}[$i]" >> $file
- [ "${i#macro-}" == "${i}" ] || i=macro__${i#macro-}
- eval "local curcontext=\"\${dialplan_context_$i-}\""
- echo "$curcontext">> $file
- eval unset dialplan_context_$i
- done
-
- check_checksum "$dialplan_conf" "$file" || ast_dialplan_restart=1
-
- return 0
-}
-
-handle_dialplangeneral() {
- option_cb(){
- if valid_dialplangeneral $1 $2 ; then
- eval "dialplan_$1=\"$2\""
- else
- logerror "Invalid Dialplan General option: $1"
- fi
- }
-}
-
-
-handle_dialplan(){
- context_name=$1
- if [ -z ${context_name} ] ; then
- logerror "Context name required for dialplan"
- context_name=default
- fi
- option_cb() {
- logdebug 4 "dialplan ${context_name}: '$1' '$2'"
- case $1 in
- include_LENGTH) ;;
- include|include_ITEM*) add_dialplan_include ${context_name} $2 ;;
- _*) ;;
- *)
- lhs=$1
- logdebug 4 "Add extension $lhs"
- if [ "$(expr $lhs : [0-9][0-9]\*)" != 0 ] ; then
- addtype=${2%%:*}
- if [ "${addtype}" == "$2" ]; then
- addparam=
- else
- addparam=${2#*:}
- fi
- case ${addtype} in
- mailbox|voice)
- add_dialplan_voice ${context_name} $1 $addparam ;;
- meetme|conf|conference) add_dialplan_meetme ${context_name} $1 $addparam ;;
- saytime|time) add_dialplan_saytime ${context_name} $1 $addparam ;;
- clock) add_dialplan_talkclock ${context_name} $1 $addparam ;;
- *) logerror "Unknown type '${addtype}' in dialplan ${context_name}, extension ${1}"
- esac
- else
- logerror "Invalid option: $1 for dialplan ${context_name}"
- fi
- esac
- }
-}
-
-handle_dialplanexten() {
- check_add dialplanexten
- option_cb() {
- case $1 in
- dialplan|extension|type|target|dialextension|voicebox|timeout|answerfirst)
- eval "dial_exten_$1=\"$2\""
- esac
- }
-}
-
-check_add_dialplanexten() {
- if [ ! -z "${dial_exten_dialplan}" -a ! -z "${dial_exten_extension}" ] ; then
-
- local dialext_type=
- local dialext_ext=
- if ! split_targettype dialext_type dialext_ext "${dial_exten_target}" ; then
- if [ -z "${dial_exten_type}" ] ; then
- logerror "No extension type specified for ${dial_exten_dialplan} ${dial_exten_extension}"
- return 1
- fi
- dialext_type="${dial_exten_type}"
- dialext_ext="${dial_exten_target}"
- fi
-
-
- local dialtarget="${dialext_type}/${dialexten_ext}${dial_exten_dialextension+/}${dial_exten_dialextension}"
-
- check_add_context ${dial_exten_dialplan}
- add_dialplan_exten "${dial_exten_dialplan}" "${dial_exten_extension}" \
- "${dialtarget}" "${dial_exten_voicebox}" "${dial_exten_timeout}" \
- "${dial_exten_answerfirst}"
- fi
- for i in dialplan extension voicebox type target dialextension timeout answerfirst ; do
- eval "unset dial_voice_$i"
- done
-}
-
-handle_dialplansaytime() {
- check_add dialplansaytime
- option_cb() {
- case $1 in
- dialplan|extension|zone|format)
- eval "dial_saytime_$1=\"$2\""
- esac
- }
-}
-
-check_add_dialplansaytime() {
- logdebug 1 "Add Saytime to $1 / $2"
- if [ ! -z "${dial_saytime_dialplan}" -a ! -z "${dial_saytime_extension}" ] ; then
- # local ext="exten => ${dial_saytime_extension},"
- [ -z "${dial_saytime_dialplan}" ] && dial_saytime_dialplan=default
-
- add_dialplan_saytime "${dial_saytime_dialplan}" "${dial_saytime_extension}" \
- "${dial_saytime_zone}" "${dial_saytime_format}"
- fi
- for i in dialplan extension zone format; do
- eval "unset dial_saytime_$i"
- done
-
-}
-
-handle_dialzone_match() {
- eval "local isadded=\"\${dzone_${zone_name}-0}\""
- if [ "${isadded}" != "1" ] ; then
- eval "dzone_${zone_name}=1"
- append dzones_match ${zone_name} " "
- fi
- append dzone_${zone_name}_match $1 ","
-}
-
-# Set up outgoing zones (match patterns)
-handle_dialzone() {
- zone_name=$1
- logdebug 2 "Loading dialzone: $zone_name"
- option_cb(){
- logdebug 2 "Dialzone $1/$2"
- case $1 in
- uses)
- local areatype=
- local areaname=
- split_targettype areatype areaname "$2"
- logdebug 3 "Added: $areatype $areaname"
- eval "local isadded=\"\${dzone_${areatype}_${areaname}-0}\""
- if [ "${isadded}" != "1" ] ; then
- eval dzone_${areatype}_${areaname}=1
- append dzones_${areatype} "${areaname}" " "
- fi
- eval "dzone_match_use_${zone_name}=${areatype}_${areaname}"
- logdebug 3 "Finished uses"
- ;;
- match_LENGTH) ;;
- match|match_ITEM*)
- handle_dialzone_match "$2"
- ;;
- international_LENGTH) ;;
- international|international_ITEM*)
- eval "local isadded=\"$dzone_${zone_name}\""
- if [ "${isadded}" != "1" ] ; then
- eval "dzone_${zone_name}=1"
- append dzones_match ${zone_name} " "
- fi
- append dzone_${zone_name}_international $2 ","
- ;;
- countrycode|localzone|addprefix|localprefix)
- eval "dzone_${zone_name}_${1}=\"$2\""
- eval "y=\${dzone_${zone_name}_${1}}"
- ;;
- *)
- logerror "Invalid Dialzone option: $1 in zone '${zone_name}'" ;;
- esac
- }
-}
-
-check_add_dialplangoto() {
- logdebug 1 "Add Goto to $1 / $2"
- if [ ! -z "${dial_goto_dialplan}" -a ! -z "${dial_goto_extension}" ] ; then
- local ext="exten => ${dial_goto_extension},"
- check_add_context ${dial_goto_dialplan}
- append_dialplan_context ${dial_goto_dialplan} "${ext}1,Goto(${dial_goto_target})"
- fi
- for i in dialplan extension room ; do
- eval "unset dial_goto_$i"
- done
-}
-
-handle_dialplangoto(){
- check_add dialplangoto
- option_cb() {
- case $1 in
- dialplan|extension|target)
- eval "dial_goto_$1=\"$2\"" ;;
- *) logerror "Invalid dialplangoto option: $1"
- esac
- }
-}
-
-# Options for incoming calls.
-
-valid_incoming_list="allowtransfer timeout answerfirst mailbox lastcall lastcalltype missed missedtype"
-
-valid_incoming_option() {
- is_in_list $1 ${valid_incoming_list}
- return $?
-}
-
-handle_incominggeneral() {
- option_cb() {
- if valid_incoming_option $1 ; then
- logdebug 3 "Add Incoming General option $1=$2"
- eval "incoming_${1}=\"$2\""
- else
- logerror "Invalid incominggeneral option $1"
- fi
- }
-}
-
-add_incoming_context() {
- local context=$1
- eval "local added=\${dialplan_incoming_${context}_added}"
- if [ "${added}" != "1" ] ; then
- append dialplan_extensions_incoming "${context}" " "
- eval "dialplan_incoming_${context}_added=1"
- fi
-
-}
-
-# Add to incoming ringing
-add_incoming() {
- local rhs="$3"
-
- while [ ! -z "$rhs" ] ; do
- cur=${rhs%%,*}
- nvar=${rhs#*,}
- add_incoming_context ${cur}
- append dialplan_incoming_${cur} "$1/$2" "&"
- [ "$nvar" == "$rhs" ] && break
- rhs=${nvar}
- done
-}
-
-to_upper() {
- eval "$1=`echo \"$2\"|tr [a-z] [A-Z]`"
-}
-to_lower() {
- eval "$1=`echo \"$2\"|tr [A-Z] [a-z]`"
-}
-
-split_targettype() { # TYPE target inputEntry
- local l_targettype="${3%[-_/]*}"
- if [ "${l_targettype}" == "$3" ] ; then
- return 1
- fi
- local l_targetname="${3#*[-_/]}"
- to_upper "$1" "${l_targettype}"
- eval "$2=\"${l_targetname}\""
- return 0
-}
-
-
-handle_incoming() {
- incoming_context=$1
- incoming_list=
- add_incoming_context "${incoming_context}"
-
- option_cb() {
- logdebug 1 "Incoming ${incoming_context} $1=$2"
- case $1 in
- lastcall|lastcalltype|missed|missedtype) eval "incoming_${incoming_context}_${1}=\"$2\"" ;;
-# lastcall|lastcallexten|lastmissed|lastmissedexten)
-# enable_lastcall
-# eval "incoming_${incoming_context}_${1}=\"$2\""
-# ;;
- mailbox|allowtransfer|answerfirst|beforeanswer|timeout|menucontext|match|matchcaller|aftertimeout|aftertimeouttype)
- eval "incoming_${incoming_context}_${1}=\"$2\""
- ;;
- target|target_ITEM*)
- local targettype=
- local targetname=
- if split_targettype targettype targetname "${2}" ; then
- append dialplan_incoming_${incoming_context} "${targettype}/${targetname}" "&"
- else
- logerror "No target type specified for target=$2 in ${incoming_context}"
- fi
- ;;
- target_LENGTH|member_LENGTH) ;;
- *) logerror "Invalid option $1 in incoming" ;;
- esac
- }
-}
-
-# vim: ts=2 sw=2 noet foldmethod=indent
diff --git a/contrib/package/asterisk-xip/files/uci/dialplanconf.txt b/contrib/package/asterisk-xip/files/uci/dialplanconf.txt
deleted file mode 100644
index 37b5a95dd..000000000
--- a/contrib/package/asterisk-xip/files/uci/dialplanconf.txt
+++ /dev/null
@@ -1,90 +0,0 @@
-
-dialplangeneral
- asterisk options:
- static
- writeprotect
- canreinvite
- clearglobalvars
-
- global settings for dialzone out:
- lastdialed
- lastdialedtype
-
- Global option for dialplanexten:
- answerfirst
- dialtimeout
- allowtransfer - allow transfers in dialing
-
- voiceboxext Extension to use for voicebox set on local client
-
- international
- internationalout
-
-dialplan {name} - Define a dialplan context
- include (list)
- #=mailbox|voice|meetme|saytime|clock
-
-dialplanexten - Add number to Dialplan for ringing an extension
- dialplan - Dialplan to add to
- extension - Number to dial
- type - Channel type sip/iax/local
- target - Target [type/]target
- dialextension - Extension to dial
- voicebox - Voicebox to fall back to
- timeout - Timeout for dial
- answerfirst - Answer before dialing
-
-dialplangoto
- dialplan - Dialplan to add to
- extension - Number to dial
- target - Goto Target
-
-dialplansaytime
- dialplan - Dialplan to add to
- extension - Number to dial
- zone - Time Zone to use
- format - Format to use.
-
-dialzone {name} - Outgoing zone.
- uses - Outgoing line to use: TYPE/Name
- match (list) - Number to match
- countrycode - The effective country code of this dialzone
- international (list) - International prefix to match
- localzone - dialzone for local numbers
- addprefix - Prexix required to dial out.
- localprefix - Prefix for a local call
-
-inzone {name}
- include (list) - Other zones to include
- match (list) - Number to match
- caller (list) - Caller number to match
- goto - Forward to zone.
-
-incominggeneral
- allowtransfer - Default Allow transfers for Dial()
- timeout - Default timeout for incoming calls
- answerfirst - Default value for incoming calls
- mailbox - Default global mailbox for incoming calls
- lastcall - Subroutine Context to store Last incoming call
- lastcalltype - Method for calling lastcall (default macro) goto|gosub|macro|start
- missed - Subroutine context to store last missed call dialplan context
- missedtype - Method for calling 'missed' context macro|gosub|macro|start
-
-incoming {name} - Incoming zone
- allowtransfer - Allow transfers for Dialed extension
- timeout - Timeout for call
- answerfirst - Answer the incoming call before Ringing
- mailbox - Voicemail mailbox to use when
-
- beforeanswer - Time to ring before asterisk 'answers' and takes control of the call
- menucontext - EXITCONTEXT for the ring once asterisk is handling the call
- match - Dialed number to match
- matchcaller - Caller to match
- aftertimeout - Target macro/goto once the timeout has past, before voicemail
- aftertimeouttype - Type of the target (macro|start|goto)
- lastcall - Subroutine Context to store Last incoming call
- lastcalltype - Method for calling lastcall (default macro) goto|gosub|macro|start
- missed - Subroutine context to store last missed call dialplan context
- missedtype - Method for calling 'missed' context goto|gosub|macro|start
- target (list) - Add local extension type/Name
-
diff --git a/contrib/package/asterisk-xip/files/uci/disaconf b/contrib/package/asterisk-xip/files/uci/disaconf
deleted file mode 100644
index 119ad61bb..000000000
--- a/contrib/package/asterisk-xip/files/uci/disaconf
+++ /dev/null
@@ -1,113 +0,0 @@
-#!/bin/sh
-
-# DISA - Directed Inwards System Application
-
-ast_add_module disaconf
-
-init_disaconf() {
- ast_enable_type disa
- ast_enable_type disaentry
-}
-
-check_append_disa() {
- local context="${1}"
- eval "local isadded=\"\${dialplan_add_disa_${context}-0}\""
- if [ "$isadded" != "1" ] ; then
- eval "dialplan_add_disa_${context}=1"
- append disa_contexts "$context"
- return 0
- else
- return 1
- fi
-}
-
-handle_disa(){
- opt_disa_context="$1"
-
- check_append_disa "$1"
-
- option_cb() {
- case "$1" in
- context|mailbox|passcode|timeout)
- eval "opt_disa_${opt_disa_context}_$1=\"\$2\"" ;;
- _*) ;;
- *) logerror "Invalid DISA option in ${opt_disa_context}: $1" ;;
- esac
- }
-}
-
-disaoption_list="disa context mailbox passcode callerid"
-
-check_add_disaentry() {
- if [ ! -z "${last_disa_disa}" ] ; then
- if [ -z "${last_disa_passcode}" ] ; then
- logerror "Passcode required in DisaEntry for ${last_disa_disa}"
- else
- logdebug 3 "Adding DisaEntry to ${last_disa_disa}"
- [ -z "${last_disa_context}" ] && eval "last_disa_context=\"\${opt_disa_${last_disa_disa}_context}\""
- [ -z "${last_disa_mailbox}" ] && eval "last_disa_mailbox=\"\${opt_disa_${last_disa_disa}_mailbox}\""
- local line=
- [ -z "${last_disa_mailbox}" ] || line="|${last_disa_mailbox}"
- [ -z "${line}" -a -z "${last_disa_callerid}" ] || line="|${last_disa_callerid}${line}"
- [ -z "${line}" -a -z "${last_disa_context}" ] || line="|${last_disa_context}${line}"
- line="${last_disa_passcode}${line}"
- append opt_disa_${last_disa_disa}_list "${line}" "${N}"
- fi
- fi
- for i in ${disaoption_list} ; do
- eval "unset last_disa_$i"
- done
-}
-
-handle_disaentry() {
- check_add disaentry
- option_cb() {
- case "$1" in
- disa|context|mailbox|passcode|callerid)
- eval "last_disa_$1=\"\$2\"" ;;
- _*) ;;
- *) logerror "Invalid DISAEntry option in ${last_disa_context-<unknown>}: $1" ;;
- esac
- }
-}
-
-createdialplan_disaconf() {
- if [ ! -z "${disa_contexts}" ] ; then
- enable_module app_disa
- for disactx in ${disa_contexts} ; do
- logdebug 3 "Adding DISA context ${disactx}"
- if check_add_context ${disactx} ; then
- eval "local disa_list=\"\${opt_disa_${disactx}_list}\""
- eval "local disa_timeout=\"\${opt_disa_${disactx}_timeout}\""
- local nn=1
- if [ ! -z "${disa_timeout}" ] ; then
- logdebug 3 "Adding timeout to ${disactx}"
- enable_module func_timeout
- append_dialplan_context ${disactx} "exten => s,1,SET(TIMEOUT(response)=${disa_timeout})"
- nn=n
- fi
- if [ -z "${disa_list}" ] ; then
- logdebug 3 "No list in ${disactx}"
- eval "local disa_mailbox=\"\${opt_disa_${disactx}_mailbox}\""
- eval "local disa_context=\"\${opt_disa_${disactx}_context}\""
- eval "local disa_passcode=\"\${opt_disa_${disactx}_passcode}\""
- if [ ! -z ${disa_mailbox} ] ; then
- disa_list="${disa_passcode}|${disa_context}||${disa_mailbox}"
- else
- append_dialplan_context ${disactx} "exten => s,${nn},DISA(${disa_passcode},${disa_context})"
- fi
- fi
- if [ ! -z "${disa_list}" ] ; then
- logdebug 3 "Output list to file in ${disactx}"
- logdebug 4 "list: ${disa_list}"
- local file="${DEST_DIR}/disa_${disactx}.txt"
- echo "${asteriskuci_gen}${disa_list}" > "$file"
-
- append_dialplan_context ${disactx} "exten => s,${nn},DISA(${file})"
- fi
- append_dialplan_context ${disactx} "exten => t,1,Hangup"
- fi
- done
- fi
-}
-
diff --git a/contrib/package/asterisk-xip/files/uci/disaconf.txt b/contrib/package/asterisk-xip/files/uci/disaconf.txt
deleted file mode 100644
index c7c02dc9c..000000000
--- a/contrib/package/asterisk-xip/files/uci/disaconf.txt
+++ /dev/null
@@ -1,29 +0,0 @@
-
-disa {name} Create a DISA menu
- context - Default context to allow access to
- mailbox - Default mailbox for stutter-tone
- timeout - Timeout in seconds
- passcode - Fallback passcode (if no entries)
-
-disaentry Add an entry for the DISA menu
- disa - parent disa to add to
- passcode - Passcode for entry
- context - context for this entry to allow access to
- mailbox - Mailbox for stutter tone
- callerid - Override Callerid
-
-example:
-config 'disa' 'disagroup'
- option 'context' 'foo'
- option 'mailbox' '1001@default'
-
-config 'disaentry'
- option 'disa' 'disagroup'
- option 'passcode' '12345678'
- option 'callerid' '"Jo Blo"'
-
-config 'disaentry'
- option 'disa' 'disagroup'
- option 'passcode' '455667'
- option 'context' 'bar'
-
diff --git a/contrib/package/asterisk-xip/files/uci/featureconf b/contrib/package/asterisk-xip/files/uci/featureconf
deleted file mode 100755
index e336570ef..000000000
--- a/contrib/package/asterisk-xip/files/uci/featureconf
+++ /dev/null
@@ -1,99 +0,0 @@
-#!/bin/sh
-
-# Feature.conf
-ast_add_conf feature
-init_featureconf(){
- ast_add_reload feature
- ast_enable_type feature
- ast_enable_type featurepark
- ast_enable_type featuremap
-
- feature_park_parkenabled=no
- feature_park_parkext=700
- feature_park_parkpos="701-720"
- feature_park_context=parkedcalls
- feature_park_parkingtime=45
- feature_park_courtesytone=beep
- feature_park_parkedplay=caller
- feature_park_adsipark=yes
- feature_park_findslot=first
- feature_park_parkedmusicclass=default
- feature_park_transferdigittimeout=3
- feature_park_xfersound=beep
- feature_park_xferfailsound=beeperr
- feature_park_pickupexten="*8"
- feature_park_featuredigittimeout=500
- feature_park_atxfernoanswertimeout=15
-}
-
-feature_park_list="parkext parkpos context parkingtime \
-courtesytone parkedplay adsipark findslot parkedmusicclass \
-transferdigittimeout xfersound xferfailsound pickupexten \
-featuredigittimeout atxfernoanswertimeout"
-feature_map_list="blindxfer disconnect automon atxfer parkcall"
-
-valid_features(){
- case $1 in
- park) is_in_list $2 ${feature_park_list} parkenabled ; return $? ;;
- map) is_in_list $2 ${feature_map_list} ; return $? ;;
- *) return 1;;
- esac
-}
-
-create_featureconf(){
- file=${DEST_DIR}/features.conf
- get_checksum feature_conf $file
-
- local isempty=1
- if [ $feature_park_parkenabled == no ] ; then
- rm -f $file
- isempty=2
- else
- enable_module res_features
- echo "${asteriskuci_gen}${N}[general]" > $file
- for i in ${feature_park_list} ; do
- eval value="\"\${feature_park_$i}\""
- [ ! -z "$value" ] && echo "$i=$value" >> $file
- done
- echo "${N}[featuremap]" >> $file
- for i in ${feature_map_list} ; do
- eval value="\"\${feature_map_$i}\""
- [ ! -z "$value" ] && echo "$i=$value" >> $file
- done
- fi
- check_checksum "$feature_conf" "$file" || ast_feature_restart=$isempty
-
-}
-handle_featurepark() {
- handle_feature park
-}
-handle_featuremap() {
- handle_feature map
-}
-
-handle_feature() {
- feature_type=$1
- option_cb() {
- if valid_features ${feature_type} $1 $2 ; then
- eval "feature_${feature_type}_$1=\"$2\""
- else
- logerror "Invalid feature: $1"
- fi
- }
-}
-
-append_dialplan_park(){
- local file=$1
- # Check for parked calls - add into available extensions
- if [ ${feature_park_parkenabled} == yes ] && [ ! -z ${feature_park_context} ] ; then
- add_dialplan_include extensions ${feature_park_context}
- enable_module app_parkandannounce
- enable_format gsm
- fi
-}
-
-
-reload_feature() astcmd "module reload res_features.so"
-unload_feature() astcmd "module unload res_features.so"
-
-# vim: ts=2 sw=2 noet foldmethod=indent
diff --git a/contrib/package/asterisk-xip/files/uci/featureconf.txt b/contrib/package/asterisk-xip/files/uci/featureconf.txt
deleted file mode 100644
index a47b223da..000000000
--- a/contrib/package/asterisk-xip/files/uci/featureconf.txt
+++ /dev/null
@@ -1,25 +0,0 @@
-See asterisk doco
-featurepark
- parkext
- parkpos
- context
- parkingtime
- courtesytone
- parkedplay
- adsipark
- findslot
- parkedmusicclass
- transferdigittimeout
- xfersound
- xferfailsound
- pickupexten
- featuredigittimeout
- atxfernoanswertimeout
-
-featuremap
- blindxfer
- disconnect
- automon
- atxfer
- parkcall
-
diff --git a/contrib/package/asterisk-xip/files/uci/lastcall b/contrib/package/asterisk-xip/files/uci/lastcall
deleted file mode 100755
index d0314fd81..000000000
--- a/contrib/package/asterisk-xip/files/uci/lastcall
+++ /dev/null
@@ -1,124 +0,0 @@
-#!/bin/sh
-#
-# Author: Michael Geddes <michael at frog dot wheelycreek dot net>
-# Copyright 2008 Michael Geddes
-# Licensed under GPL
-
-ast_add_module lastcall
-
-init_lastcall() {
- #
- ast_enable_type calllist
- ast_enable_type calllistdefault
-}
-
-check_add_calllist() {
- local context=${opt_calllist_zonename}
- if [ ! -z "$context" ] ; then
- logdebug 1 "Adding calllist context ${context}"
- [ -z $opt_calllist_dialplan ] && opt_calllist_dialplan=${opt_calllist_general_dialplan}
- [ -z $opt_calllist_dialplan ] && opt_calllist_dialplan=extensions
- [ -z $opt_calllist_listname ] && opt_calllist_listname=lastcall
- [ -z $opt_calllist_length ] && opt_calllist_length=${opt_calllist_general_length}
- [ -z $opt_calllist_length ] && opt_calllist_length=10
- [ -z $opt_calllist_dialcontext ] && opt_calllist_dialcontext=${opt_calllist_general_dialcontext}
- [ -z $opt_calllist_dialcontext ] && opt_calllist_dialcontext=default
- [ -z $opt_calllist_calltype ] && opt_calllist_calltype=macro
-
- [ -z ${opt_calllist_extension} ] \
- || add_dialplan_lastcall ${opt_calllist_dialplan} "${opt_calllist_extension}" "${opt_calllist_listname}" "${opt_calllist_length}" "${opt_calllist_tagname}" "${opt_calllist_dialcontext}"
- enable_lastcall
- add_section_lastcall ${context} "${opt_calllist_listname}" "${opt_calllist_length}" "${opt_calllist_calltype}"
- fi
- for i in zonename extension dialplan length listname ; do
- eval "unset opt_calllist_${i}"
- done
-}
-
-add_section_lastcall() {
- local context=$1
- local name=$2
- local queuelen=$3
- local calltype=$4
-
- [ "${calltype}" = "macro" ] && context=macro-${1}
-
- if check_add_context ${context} ; then
- local ext="exten => s,"
- case "${calltype}" in
- gosub)
- enable_module app_stack
- append_dialplan_context ${context} "${ext}1,Macro(lastcallstore,\${EXTEN},${name},${queuelen})"
- append_dialplan_context ${context} "${ext}n,Return" ;;
- gosub_s)
- enable_module app_stack
- append_dialplan_context ${context} "${ext}1,Macro(lastcallstore,\${ARG1},${name},${queuelen})"
- append_dialplan_context ${context} "${ext}n,Return" ;;
- macro)
- enable_module app_macro
- append_dialplan_context ${context} "${ext}1,Macro(lastcallstore,\${ARG1},${name},${queuelen})" ;;
- esac
- else
- logerror "Lastcall section ${context} already added"
- fi
-}
-
-handle_calllist() {
- check_add calllist
- logdebug 2 "Loading Call List: ${opt_calllist_zonename}"
- opt_calllist_zonename=$1
- option_cb() {
- case "$1" in
- extension|dialplan|length|listname|calllist|tagname|dialcontext|calltype)
- logdebug 1 "Setting opt_calllist_$1=\"${2}\""
- eval "opt_calllist_${1}=\"${2}\"" ;;
- *)
- logerror "Unknown option $1 in calllist ${opt_calllist_zonename}" ;;
- esac
- }
-}
-
-handle_calllistdefault() {
- logdebug 2 "Loading Call List General options"
- option_cb() {
- case $1 in
- dialplan|length|dialcontext)
- eval "opt_calllist_general_${1}=\"${2}\"" ;;
- *) logerror "Unknown option $1 in calllistdefault" ;;
- esac
- }
-}
-
-add_dialplan_lastcall(){
- local context=$1
- logdebug 1 "Adding Dialplan lastcall $1 $2"
- check_add_context "$context"
- enable_lastcall
- local queue=$3
- local len=$4
- local tag=$5
- local dialcontext=$6
- [ "${queue}" == lastcall ] && queue=
- append dialplan_context_${context} "exten => $2,1,Macro(lastcallapp,${queue},${len},${dialcontext},${tag})" "${N}"
-}
-
-enable_lastcall() {
- if [ "${dialplan_do_add_lastcall}" != "1" ] ; then
- logdebug 2 "Enabling lastcall"
-
- append dialplan_globals "LASTCALLZONE=\"${asterisk_zone}\"" "$N"
- [ -z "${DEST}" ] || append dialplan_globals "LASTCALL_DIR=${DEST}/etc/asterisk/directory" "$N"
- append_include "macros/tagnumber.conf"
- append_include "macros/lastcall.conf"
- dialplan_do_add_lastcall=1
- enable_module app_macro
- enable_module func_callerid
- enable_module app_sayunixtime
- enable_module app_playback
- enable_module func_db
- enable_module app_record
- enable_module app_system
- enable_format gsm
- fi
-}
-# vim: ts=2 sw=2 noet foldmethod=indent
diff --git a/contrib/package/asterisk-xip/files/uci/lastcall.txt b/contrib/package/asterisk-xip/files/uci/lastcall.txt
deleted file mode 100644
index cd86be3f1..000000000
--- a/contrib/package/asterisk-xip/files/uci/lastcall.txt
+++ /dev/null
@@ -1,15 +0,0 @@
-
-calllistdefault
- dialplan - Override default dialplan for calllist extensions to be added to.
- length - Default Length of list
- dialcontext - Default Context for dialing
-
-calllist {name} - Define a call list context
- extension - Extension to review list
- dialplan - Dialplan for extension to be added to (default to extensions)
- length - Length of list
- listname - Name of list to use
- tagname - Sound file to use for name
- dialcontext - Context to use when dialing
- calltype - Type of context for the wrapper (required when calling it) macro|gosub
-
diff --git a/contrib/package/asterisk-xip/files/uci/meetmeconf b/contrib/package/asterisk-xip/files/uci/meetmeconf
deleted file mode 100755
index d70016148..000000000
--- a/contrib/package/asterisk-xip/files/uci/meetmeconf
+++ /dev/null
@@ -1,107 +0,0 @@
-#!/bin/sh
-# Meetme.conf (conference)
-
-ast_add_conf meetme
-init_meetmeconf() {
- ast_add_reload meetme
- ast_enable_type meetmegeneral
- ast_enable_type meetme
- ast_enable_type dialplanmeetme
-}
-create_meetmeconf() {
- file=${DEST_DIR}/meetme.conf
- get_checksum meetme_conf $file
- logdebug 1 "Creating meetme rooms: ${meetme_rooms}"
- local isempty=1
- if [ -z ${meetme_rooms} ] ; then
- rm -f $file
- isempty=2
- else
- echo "${asteriskuci_gen}${N}[general]" > $file
- if [ ! -z ${meetme_audiobuffers} ] ; then
- echo "audiobuffers=${meetme_audiobuffers}" >> $file
- fi
- echo "${N}[rooms]" >> $file
- for i in ${meetme_rooms} ; do
- for j in pin adminpin room ; do
- eval meetme_$j=\${meetme_room_${i}_${j}}
- done
- if [ -z "${meetme_room}" ] ; then
- meetme_room=$i
- fi
- local line="conf => ${meetme_room}"
- if [ -z ${meetme_adminpin} ] ; then
- if [ ! -z ${meetme_pin} ] ; then
- line="${line},${meetme_pin}"
- fi
- else
- line="${line},${meetme_pin},${meetme_adminpin}"
- fi
- echo "$line" >> $file
- done
- fi
- check_checksum "$meetme_conf" "$file" || ast_meetme_restart=$isempty
-}
-
-handle_meetmegeneral() {
- option_cb() {
- case $1 in
- audiobuffers)
- meetme_audiobuffers="$2" ;;
- *) logerror "Invalid meetme general option $1"
- esac
- }
-}
-
-handle_meetme() {
- logdebug 2 "Add meetme room $1"
- meetme_room="$1"
- append meetme_rooms "$1" " "
- enable_module app_meetme
- option_cb() {
- case $1 in
- pin|adminpin|room)
- logdebug 3 "Meetme option ${meetme_room}/${1}=$2"
- eval meetme_room_${meetme_room}_${1}="$2" ;;
- *) logerror "Invalid meetme option for $meetme_room : $1"
- esac
- }
-}
-
-handle_dialplanmeetme() {
- check_add dialplanmeetme
- option_cb() {
- case $1 in
- dialplan|extension|room)
- eval "dial_meetme_$1=\"$2\""
- esac
- }
-}
-
-check_add_dialplanmeetme() {
- if [ ! -z "${dial_meetme_extension}" ] ; then
- local ext="exten => ${dial_meetme_extension},"
-
- [ -z "${dial_meetme_dialplan}" ] && dial_meetme_dialplan=extensions
- check_add_context ${dial_meetme_dialplan}
- append dialplan_context_${dial_meetme_dialplan} "${ext}1,MeetMe(${dial_meetme_room})" "${N}"
- append dialplan_context_${dial_meetme_dialplan} "${ext}n,HangUp" "${N}"
- fi
- for i in dialplan extension room ; do
- eval "unset dial_meetme_$i"
- done
-}
-
-add_dialplan_meetme() {
- local context=$1
- logdebug 1 "Adding Dialplan meetme $1 $2"
- check_add_context "$context"
- local ext="exten => $2,"
- append dialplan_context_${context} "${ext}1,MeetMe($3)" "${N}"
- append dialplan_context_${context} "${ext}n,HangUp" "${N}"
-}
-
-reload_meetme() astcmd "module reload app_meetme.so"
-unload_meetme() astcmd "module unload app_meetme.so"
-
-# vim: ts=2 sw=2 noet foldmethod=indent
diff --git a/contrib/package/asterisk-xip/files/uci/meetmeconf.txt b/contrib/package/asterisk-xip/files/uci/meetmeconf.txt
deleted file mode 100644
index fc24e389c..000000000
--- a/contrib/package/asterisk-xip/files/uci/meetmeconf.txt
+++ /dev/null
@@ -1,13 +0,0 @@
-
-meetmegeneral
- audiobuffers
-
-meetme - add a meetme room
- room - Number of room
- pin - PIN for room
- adminpin - PIN for room admin
-
-dialplanmeetme - add calling of meetme to a dialplan
- dialplan - Dialplan to add to (default 'extensions')
- extension - Extension to dial
- room - Optional room to enter
diff --git a/contrib/package/asterisk-xip/files/uci/moduleconf b/contrib/package/asterisk-xip/files/uci/moduleconf
deleted file mode 100755
index d8ea6114a..000000000
--- a/contrib/package/asterisk-xip/files/uci/moduleconf
+++ /dev/null
@@ -1,151 +0,0 @@
-#!/bin/sh
-
-# Module.conf
-
-init_moduleconf() {
- ast_add_reload module
- ast_enable_type module
-
- for i in ${module_list} ; do
- eval module_${i}=no
- done
-
- enable_module app_dial
- enable_module app_read
-
- enable_module app_verbose
- enable_module pbx_config
- enable_module pbx_functions
-
- enable_module app_transfer
- module_chan_local=auto
- # Sound files are all gsm
- enable_format gsm
-
- enable_module app_func_strings
-}
-
-# List of modules in sensible load order.
-module_list="res_agi res_adsi res_config_mysql res_crypto res_smdi res_features \
- res_indications res_convert res_jabber res_monitor res_musiconhold res_speech \
- res_clioriginate pbx_ael pbx_config pbx_functions pbx_loopback pbx_realtime \
- pbx_spool pbx_wilcalu func_base64 func_callerid func_cdr func_channel func_cut \
- func_db func_enum func_env func_global func_groupcount func_language func_logic \
- func_moh func_rand func_realtime func_sha1 func_strings func_timeout func_uri \
- cdr_csv cdr_custom cdr_manager cdr_mysql cdr_pgsql cdr_sqlite chan_agent \
- chan_alsa chan_gtalk chan_h323 chan_iax2 chan_local chan_sip format_au \
- format_g723 format_g726 format_g729 format_gsm format_h263 format_h264 \
- format_ilbc format_jpeg format_mp3 format_pcm format_pcm_alaw format_sln \
- format_vox format_wav format_wav_gsm app_alarmreceiver app_amd app_authenticate \
- app_cdr app_chanisavail app_channelredirect app_chanspy app_controlplayback \
- app_cut app_db app_dial app_dictate app_directed_pickup app_directory app_disa \
- app_dumpchan app_echo app_enumlookup app_eval app_exec app_externalivr \
- app_followme app_forkcdr app_getcpeid app_groupcount app_hasnewvoicemail \
- app_ices app_image app_lookupblacklist app_lookupcidname app_macro app_math \
- app_md5 app_meetme app_milliwatt app_mixmonitor app_morsecode \
- app_parkandannounce app_playback app_privacy app_queue app_random app_read \
- app_readfile app_realtime app_record app_sayunixtime app_senddtmf app_sendtext \
- app_setcallerid app_setcdruserfield app_setcidname app_setcidnum app_setrdnis \
- app_settransfercapability app_sms app_softhangup app_speech_utils app_stack \
- app_system app_talkdetect app_test app_transfer app_txtcidname app_url \
- app_userevent app_verbose app_voicemail app_waitforring app_waitforsilence \
- app_while codec_a_mu codec_adpcm codec_alaw codec_g726 codec_gsm codec_ilbc \
- codec_lpc10 codec_speex codec_ulaw"
-
-# Enable a module - for use by other scripts
-enable_module() {
- logdebug 3 "Enable ${1}"
- eval module_${1}=yes
-}
-
-module_enabled() {
- eval local is_enabled="\${module_${1}}"
- if [ ${is_enabled} == "no" ] ; then
- return 1
- else
- return 0
- fi
-}
-
-# Enable a sound format - for use by other scripts
-enable_format() {
- while [ ! -z $1 ] ; do
- case $1 in
- gsm)
- enable_module format_gsm
- enable_module codec_gsm
- [ "${module_format_wav}" = "yes" ] && enable_module format_wav_gsm ;;
- wav)
- enable_module format_wav
- [ "${module_format_gsm}" = "yes" ] && enable_module format_wav_gsm ;;
- alaw)
- enable_module codec_adpcm
- enable_module codec_alaw
- [ "${module_format_pcm}" = "yes" ] && enable_module format_pcm_alaw ;;
- pcm)
- enable_module format_pcm_alaw
- [ "${module_format_alaw}" = "yes" ] && enable_module format_pcm_alaw ;;
- ulaw)
- enable_module codec_ulaw ;;
- g729|g726|g723)
- enable_module format_g726
- enable_module codec_g726 ;;
- ilbc)
- enable_module format_ilbc
- enable_module codec_ilbc ;;
- sln) enable_module format_sln ;;
- mp3) enable_module format_mp3 ;;
- vox) enable_module format_vox ;;
- speex) enable_module codec_speex ;;
- esac
- shift
- done
-}
-
-create_moduleconf() {
- local file=${DEST_DIR}/modules.conf
-
- get_checksum module_conf $file
-
- rm -f ${file}.orig
- [ -f "${file}" ] && mv ${file} ${file}.orig
-
- echo "${asteriskuci_gen}[modules]${N}autoload=yes" > $file
- for i in ${module_list} ; do
- eval res=\${module_${i}}
- case $res in
- yes) echo "load => $i.so" >> $file ;;
- no) echo "noload => $i.so" >> $file ;;
- esac
- done
- echo "${N}[global]${N}chan_modem.so=no" >> $file
-
- check_checksum "$module_conf" "$file" || ast_module_restart=1
-}
-
-reload_module() {
- local file=${DEST_DIR}/modules.conf
- local cmd=`diff ${file}.orig ${file} -u -U0 | grep '^+\(no\)\?load' | sed 's/+load[[:space:]]*=>[[:space:]]*\(.*\)$/\"module load \1\"/' | sed 's/+noload[[:space:]]*=>[[:space:]]*\(.*\)$/\"module unload \1\"/'| tr '\n' ' '`
- [ "${testing_mode}" != "1" ] && rm -f ${file}.orig
- logdebug 3 "Module reload: ${N}$cmd"
- eval "astcmds $cmd"
-}
-
-
-valid_module() {
- is_in_list $1 ${module_list}
- return $?
-}
-
-handle_module() {
- option_cb() {
- if valid_module $1 ; then
- eval module_$1="$2"
- else
- logerror "Invalid module: $1"
- fi
- }
-}
-
-
-# vim: ts=2 sw=2 noet foldmethod=indent
diff --git a/contrib/package/asterisk-xip/files/uci/moduleconf.txt b/contrib/package/asterisk-xip/files/uci/moduleconf.txt
deleted file mode 100644
index 7b083b6db..000000000
--- a/contrib/package/asterisk-xip/files/uci/moduleconf.txt
+++ /dev/null
@@ -1,151 +0,0 @@
-
-module - Enable modules (yes/no/auto)
- res_agi
- res_adsi
- res_config_mysql
- res_crypto
- res_smdi
- res_features
- res_indications
- res_convert
- res_jabber
- res_monitor
- res_musiconhold
- res_speech
- res_clioriginate
- pbx_ael
- pbx_config
- pbx_functions
- pbx_loopback
- pbx_realtime
- pbx_spool
- pbx_wilcalu
- func_base64
- func_callerid
- func_cdr
- func_channel
- func_cut
- func_db
- func_enum
- func_env
- func_global
- func_groupcount
- func_language
- func_logic
- func_moh
- func_rand
- func_realtime
- func_sha1
- func_strings
- func_timeout
- func_uri
- cdr_csv
- cdr_custom
- cdr_manager
- cdr_mysql
- cdr_pgsql
- cdr_sqlite
- chan_agent
- chan_alsa
- chan_gtalk
- chan_h323
- chan_iax2
- chan_local
- chan_sip
- format_au
- format_g723
- format_g726
- format_g729
- format_gsm
- format_h263
- format_h264
- format_ilbc
- format_jpeg
- format_mp3
- format_pcm
- format_pcm_alaw
- format_sln
- format_vox
- format_wav
- format_wav_gsm
- app_alarmreceiver
- app_amd
- app_authenticate
- app_cdr
- app_chanisavail
- app_channelredirect
- app_chanspy
- app_controlplayback
- app_cut
- app_db
- app_dial
- app_dictate
- app_directed_pickup
- app_directory
- app_disa
- app_dumpchan
- app_echo
- app_enumlookup
- app_eval
- app_exec
- app_externalivr
- app_followme
- app_forkcdr
- app_getcpeid
- app_groupcount
- app_hasnewvoicemail
- app_ices
- app_image
- app_lookupblacklist
- app_lookupcidname
- app_macro
- app_math
- app_md5
- app_meetme
- app_milliwatt
- app_mixmonitor
- app_morsecode
- app_parkandannounce
- app_playback
- app_privacy
- app_queue
- app_random
- app_read
- app_readfile
- app_realtime
- app_record
- app_sayunixtime
- app_senddtmf
- app_sendtext
- app_setcallerid
- app_setcdruserfield
- app_setcidname
- app_setcidnum
- app_setrdnis
- app_settransfercapability
- app_sms
- app_softhangup
- app_speech_utils
- app_stack
- app_system
- app_talkdetect
- app_test
- app_transfer
- app_txtcidname
- app_url
- app_userevent
- app_verbose
- app_voicemail
- app_waitforring
- app_waitforsilence
- app_while
- codec_a_mu
- codec_adpcm
- codec_alaw
- codec_g726
- codec_gsm
- codec_ilbc
- codec_lpc10
- codec_speex
- codec_ulaw
-
diff --git a/contrib/package/asterisk-xip/files/uci/mohconf b/contrib/package/asterisk-xip/files/uci/mohconf
deleted file mode 100755
index 9963108cf..000000000
--- a/contrib/package/asterisk-xip/files/uci/mohconf
+++ /dev/null
@@ -1,74 +0,0 @@
-#!/bin/sh
-
-# Music on Hold
-
-ast_add_conf moh
-init_mohconf() {
- ast_add_reload moh
- ast_enable_type moh
- ast_enable_type musiconhold
-}
-
-
-handle_musiconhold() handle_moh "$1"
-
-moh_list="name"
-moh_optlist="mode directory random application format"
-
-valid_moh() {
- is_in_list $1 ${moh_list} ${moh_optlist}
- return $?
-}
-
-handle_moh() {
- check_add moh
- moh_context=$1
- logdebug 1 "Loading MOH context: ${moh_context}"
-
- enable_module res_musiconhold
-
- option_cb() {
- if valid_moh $1 $2 ; then
- eval "moh_var_${1}=\"$2\""
- else
- logerror "Invalid music-on-hold option for ${moh_context} : $1"
- fi
- }
-}
-
-check_add_moh() {
- if [ ! -z "${moh_var_directory}" ] ; then
- [ -z "${moh_var_name}" ] && moh_var_name=default
- [ -z "${moh_var_mode}" ] && moh_var_mode=files
- append moh_lines "[${moh_var_name}]" "${N}${N}"
-
- for i in ${moh_optlist} ; do
- eval "local curopt=\"\${moh_var_$i}\""
- [ -z "${curopt}" ] || append moh_lines "$i=${curopt}" "${N}"
- done
- fi
- for i in ${moh_list} ${moh_optlist} ; do
- eval "unset moh_var_$i"
- done
-}
-
-create_mohconf() {
- file=${DEST_DIR}/musiconhold.conf
- get_checksum moh_conf $file
- local isempty=1
- if [ -z "${moh_lines}" ] ; then
- isempty=2
- rm -f $file
- else
- echo "${asteriskuci_gen}" > $file
- echo "${moh_lines}" >> $file
- unset moh_lines
- fi
- check_checksum "$moh_conf" "$file" || ast_moh_restart=$isempty
-}
-
-reload_moh() astcmd "moh reload"
-unload_moh() astcmd "module unload res_musiconhold.so"
-
-
-# vim: ts=2 sw=2 noet foldmethod=indent
diff --git a/contrib/package/asterisk-xip/files/uci/mohconf.txt b/contrib/package/asterisk-xip/files/uci/mohconf.txt
deleted file mode 100644
index 232174062..000000000
--- a/contrib/package/asterisk-xip/files/uci/mohconf.txt
+++ /dev/null
@@ -1,8 +0,0 @@
-
-musiconhold/moh - Musicon-on-hold context
- name - MOH context name
- mode - Playback mode (files)
- directory - Directory of music
- random - Playback is random
- application - Application to use
- format - file format of files
diff --git a/contrib/package/asterisk-xip/files/uci/queueconf b/contrib/package/asterisk-xip/files/uci/queueconf
deleted file mode 100644
index 2ac8296d6..000000000
--- a/contrib/package/asterisk-xip/files/uci/queueconf
+++ /dev/null
@@ -1,133 +0,0 @@
-#!/bin/bash
-# Queues.conf
-
-ast_add_conf queue
-
-init_queueconf() {
- ast_add_reload queue
-
- ast_enable_type callqueue
- ast_enable_type callqueuegeneral
-}
-
-create_queueconf() {
- # Construct the file
- file=${DEST_DIR}/queues.conf
- get_checksum queue_conf $file
- local isempty=1
- logdebug 0 "Generating Queues.conf: ${callqueue_contexts}"
- if [ -z "${callqueue_contexts}" ] ; then
- isempty=2
- rm -f $file
- else
- logdebug 0 "General section"
- echo "${asteriskuci_gen}[general]" > "$file"
- [ -z "${callqueue_gen_autofill}" ] && callqueue_gen_autofill=yes
- for i in ${callqueuegeneral_list} ; do
- local opt=${i//-/}
- eval "local val=\"\${callqueue_gen_${opt}}\""
- [ -z "${val}" ] || echo "${i}=${val}" >> "$file"
- done
-
- logdebug 0 "Add queues"
- for i in ${callqueue_contexts} ; do
- eval "local queuename=\${callqueue_opt_${i}_name}"
- logdebug 0 "Add queue ${queuename}"
- echo "${N}[${queuename}]" >> "$file"
- local queueopts=
- local has_moh=0
- for j in ${callqueue_list} ; do
- local opt=${j//-/}
- eval "local val=\"\${callqueue_opt_${i}_${opt}}\""
- if [ ! -z "${val}" ]; then
- echo "${j}=${val}" >> "$file"
- case "${opt}" in
- musicclass) has_moh=1
- esac
- fi
- done
-
- eval "local memberlist=\"\${callqueue_opt_${i}_members}\""
- for j in ${memberlist} ; do
- echo "member => ${j}" >> "$file"
- done
-
- [ "${has_moh}" = 0 ] && queueopts=${queueopts}r
- eval "local queuetimeout=\"\${callqueue_opt_${i}_queuetimeout}\""
- if [ "${queuetimeout-0}" = 0 ] ; then
- queuetimeout=
- else
- queueopts=${queueopts}n
- fi
-
- # Now add call dialplan
- if check_add_context "${i}" ; then
- append_dialplan_context "${i}" "exten = ${match_all_s},1,Queue(${queuename}|${queueopts}|||${queuetimeout})"
- #TODO Add voicemail? fallthrough option?
- fi
-
- done
- fi
-
- check_checksum "$queue_conf" "$file" || ast_queue_restart=$isempty
-}
-
-reload_queue() astcmd "module reload app_queue.so"
-unload_queue() astcmd "module unload app_queue.so"
-
-
-callqueuegeneral_list="persistentmembers autofill monitor-type"
-valid_callqueuegeneral() {
- is_in_list $1 ${callqueuegeneral_list//-/}
- return $?
-}
-
-handle_callqueue_general() {
- option_cb() {
- if valid_callqueuegeneral "$1" ; then
- eval "callqueue_gen_$1=\"\${2}\""
- else
- [ "${1:0:1}" = "_" ] || logerror "Invalid callqueuegeneral option: $1"
- fi
- }
-}
-
-callqueue_list="musicclass announce strategy context timeout wrapuptime \
-autofill maxlen announce-holdtime announce-frequency periodic-announce-frequency ringinuse"
-
-valid_callqueue() {
- is_in_list $1 ${callqueue_list//-/} queuetimeout
- return $?
-}
-
-handle_callqueue() {
- cur_context="$1"
- callqueue_opt_name="$1" # Name in queue.conf
- [ -z "${callqueue_contexts}" ] && enable_module app_queue
- append "callqueue_contexts" "$1" " "
-
- option_cb() {
- case "$1" in
- name) eval "callqueue_opt_${cur_context}_name=\"\$2\"" ;;
- member|member_ITEM*)
- local member_type=
- local member_ext=
- if ! split_targettype member_type member_ext "${2}" ; then
- logerror "No extension type specified for queue ${cur_context} member ${2}"
- else
- append callqueue_opt_${cur_context}_members "${member_type}/${member_ext}" " "
- fi
- ;;
- member_LENGTH) ;;
- _*) ;; # ignore
- *)
- if valid_callqueue "$1" ; then
- eval "callqueue_opt_${cur_context}_$1=\"\${2}\""
- else
- logerror "Invalid callqueue option: $1"
- fi ;;
- esac
- }
-}
-
-
diff --git a/contrib/package/asterisk-xip/files/uci/queueconf.txt b/contrib/package/asterisk-xip/files/uci/queueconf.txt
deleted file mode 100644
index 18c1e8a2b..000000000
--- a/contrib/package/asterisk-xip/files/uci/queueconf.txt
+++ /dev/null
@@ -1,30 +0,0 @@
-
-callqueuegeneral General options for call queues.
- persistentmembers - Persist members of queue in astdb
- autofill - (Default yes) Dial extensions in parallel
- monitortype - (MixMonitor) Type of monitor to use
-
-callqueue {queue-context}
- name - queue name (default to same as context)
- queuetimeout - Timeout of the queue
- member (list)- list of members (SIP/103 etc).
- musicclass - Class of music-on-hold to use (or blank for ringing)
- announce - Message to announce queue to agent
- strategy - Ringing strategy
- ringall - ring all available channels until one answers (default)
- roundrobin - take turns ringing each available interface
- leastrecent - ring interface which was least recently called by this queue
- fewestcalls - ring the one with fewest completed calls from this queue
- random - ring random interface
- rrmemory - round robin with memory, remember where we left off last ring pass
-
- context - Context in which to find single digit numbers dialed
- timeout - Ringing timeout (for individual extension)
- wrapuptime - time allowed before considered free after hangup of call
- autofill - Dial extensions in parallel
- maxlen - Maximum queue length (0 for unlimited)
- announceholdtime - Should we include estimated hold time in position announcements? (yes|no|once)
- announcefrequency - How often to announce queue position and/or estimated
- periodicannounce-frequency - How often to announce 'period-announce'
- ringinuse - ring even if known to be in use
-
diff --git a/contrib/package/asterisk-xip/files/uci/sipiaxconf b/contrib/package/asterisk-xip/files/uci/sipiaxconf
deleted file mode 100755
index eb88b7597..000000000
--- a/contrib/package/asterisk-xip/files/uci/sipiaxconf
+++ /dev/null
@@ -1,525 +0,0 @@
-#!/bin/sh
-# Sip / IAX extensions
-
-# Add to internal extensions
-add_extension() {
- logdebug 1 "Adding $1/$2 extension to $3"
- eval "local ext=\"\${dialplan_ext_$3}\""
- [ -z "${ext}" ] && append dialplan_exts "$3" " "
- local lower=`echo $1|tr [A-Z] [a-z]`
- eval "local ext=\"\${${lower}_last_extension}\""
- [ -z "${ext}" ] && eval "${lower}_last_extension=\"$3\""
- append dialplan_ext_$3 $1/${2} "&"
-}
-
-check_append_local() {
- local extension="${1}"
- logdebug 3 "added local context for ${1}"
- eval "local isadded=\"\${dialplan_add_local_${extension}-0}\""
- if [ "$isadded" != "1" ] ; then
- logdebug 3 "Not added before - adding"
- eval "dialplan_add_local_${extension}=1"
- append dialplan_locals "$extension"
- eval "dialplan_local_${1}_context=\"${2}\""
- eval "dialplan_local_${1}_selfmailbox=\"${3}\""
- eval "dialplan_local_${1}_mailbox=\"${4}\""
- eval "dialplan_local_${1}_displayname=\"${5}\""
- return 0
- else
- return 1
- fi
-}
-append_dialplan_locals(){
- for i in ${dialplan_locals} ; do
- local extension=$i
- for x in context selfmailbox mailbox displayname ; do
- eval "x_${x}=\${dialplan_local_${i}_${x}}"
- done
- local newcontext=local_${extension}
-
- if check_add_context ${newcontext} ; then
- # add_dialplan_voice ${newcontext} ${x_last_extension} ${x_last_mailbox}
- # Make sure as much is matched as possible
- #add_dialplan_goto ${newcontext} _[0-9#*+]. ${x_last_context}
- # add_dialplan_include ${newcontext} ${x_last_context}
-
- append_dialplan_context ${newcontext} "exten => ${match_all},1,Set(CALLERID(num)=${extension})"
- local next=2
- if [ ! -z "${x_displayname}" ] ; then
- append_dialplan_context ${newcontext} "exten => ${match_all},2,Set(CALLERID(name)=${x_displayname})"
- local next=3
- fi
- if [ ! -z "${x_mailbox}" ] ; then
- [ "${x_selfmailbox}" = "yes" ] && append_dialplan_context ${newcontext} "exten => ${extension},${next},VoiceMailMain(${x_mailbox})"
- [ ! -z "${dialplan_voiceboxext}" ] && append_dialplan_context ${newcontext} "exten => ${dialplan_voiceboxext},${next},VoiceMailMain(${x_mailbox})"
- fi
- append_dialplan_context ${newcontext} "exten => ${match_all},${next},Goto(${x_context},\${EXTEN},1)"
- fi
- done
-}
-
-# Sip
-
-check_add_sipitems() {
- if [ "${sip_doregister}" == "1" ] ; then
- local line="register => ${sip_last_username}@${sip_last_fromdomain}:${sip_last_secret}:${sip_last_username}@${sip_sectionname}"
- case ${sip_last_registerextension} in
- -) line="$line/${sip_last_username}" ;;
- .*) line="$line/${sip_last_registerextension}" ;;
- esac
- append sip_register "$line" "$N"
- sip_doregister=0
- fi
- do_check_add_items sip
-}
-check_add_iaxitems() {
- do_check_add_items iax
-}
-
-do_check_add_items(){
-
- for i in type last_host last_context selfmailbox last_extension last_mailbox last_displayname ; do
- eval "x_${i}=\"\${${1}_${i}-}\""
- done
-
- if [ ! -z "${x_last_context}" ] ; then
- if [ ! -z "${x_last_extension}" ] ; then
- [ "${x_last_context}" = "-" ] && eval "x_last_context=\"\${${1}_opt_context}\""
- check_append_local "${x_last_extension}" "${x_last_context}" "${x_selfmailbox}" "${x_last_mailbox}" "${x_last_displayname}"
- x_last_context=local_${x_last_extension}
- fi
- if [ "${x_last_context}" != "-" ] ; then
- append ${1}_sections "context=${x_last_context}" "$N"
- fi
- if [ "${x_type}" != "user" -a -z "${x_last_host}" ] ; then
- append ${1}_sections "host=dynamic" "$N"
- fi
- fi
-
- for i in last_username last_fromdomain last_secret last_username \
- sectionname last_fromuser last_context last_extension last_mailbox \
- last_type last_host last_displayname ; do
- eval unset $1_$i
- done
-
- eval ${1}_selfmailbox=no
- eval ${1}_last_registerextension=-
-}
-
-reload_sip() {
- astcmd "sip reload"
- return 1 # reboot
-}
-unload_sip() astcmd "unload chan_sip.so"
-
-rtp_option_list="rtpstart rtpend rtpdtmftimeout rtcpinterval rtpchecksums"
-# Validate RTP options
-valid_rtp_option() {
- is_in_list $1 ${rtp_option_list}
-}
-
-# Validate sip options, depending on context.
-valid_sipiax_option() {
- local use_glob=1
- local use_glob_iax=1
- local use_glob_sip=1
- local use_user=1
- local use_peer=1
- local use_user_sip=1
- local use_user_iax=1
- local use_peer_sip=1
- local use_peer_iax=1
- case "$1" in
- globalsip)
- use_glob_sip=0
- use_glob=0 ;;
- usersip)
- use_glob_sip=0
- use_glob=0
- use_user=0 ;;
- peersip|friendsip)
- use_glob_sip=0
- use_glob=0
- use_user=0
- use_peer=0
- use_user_sip=0
- use_peer_sip=0 ;;
- globaliax)
- use_glob_iax=0
- use_glob=0 ;;
- useriax)
- use_glob_iax=0
- use_glob=0
- use_user=0 ;;
- peeriax|friendiax)
- use_glob_iax=0
- use_glob=0
- use_user=0
- use_peer=0
- use_user_iax=0
- use_peer_iax=0 ;;
- esac
-
- case "$2" in
- writeprotect|static) return ${use_glob_iax} ;;
-# Integer
- port|\
- maxexpirey|\
- rtptimeout|\
- rtpholdtimeout|\
- defaultexpirey|\
- registertimeout|\
- registerattempts|\
- call-limit) return ${use_glob_sip} ;;
-# ip addr
- bindaddr|\
- externip) return ${use_glob_sip} ;;
-# net/mask
- localnet) return ${use_glob_sip} ;;
- permit|\
- deny) return ${use_user_sip} ;;
-# Domain name
- realm|\
- domain) return ${use_glob_sip} ;;
-# valid context
- context) return ${use_glob} ;;
-# Mime type
- notifymimetype) return ${use_glob_sip} ;;
-# Yes/No
- canreinvite) return ${use_glob} ;;
- nat|allowoverlap|allowsubscribe|allowtransfer|\
- videosupport) return ${use_glob_sip} ;;
- pedantic|\
- trustrpid|\
- promiscredir|\
- useclientcode) return ${use_user_sip} ;;
-# Enums
- dtmfmode) return ${use_glob_sip} ;;
- type) return ${use_user} ;;
- insecure|callingpres|\
- progressinband) return ${use_user_sip} ;;
-# List
- allow|\
- disallow) return ${use_glob_sip} ;;
-# Register string
- register) return ${use_glob_sip} ;;
-# String
- username|secret|md5secret|host|\
- mailbox) return ${use_user} ;;
- auth) return ${use_user_iax} ;;
- callgroup|pickupgroup|language|accountcode|\
- setvar|callerid|amaflags|subscribecontext|\
- maxcallbitrate|rfc2833compensate|\
- mailbox) return ${use_user_sip};;
- template|fromdomain|regexten|fromuser|\
- qualify|defaultip|sendrpid|\
- outboundproxy) return ${use_peer_sip};;
- extension) return 0;;
- *) return 1;;
- esac
-}
-
-ast_add_conf sip
-init_sipconf() {
- ast_add_reload sip
- ast_enable_type sipgeneral
- ast_enable_type sip
- ast_enable_type target
-
- sip_opt_port=5060
- sip_opt_bindaddr=0.0.0.0
- sip_opt_context=default
- sip_opt_maxexpirey=3600
- sip_opt_defaultexpirey=3600
- sip_opt_notifymimetype=text/plain
- sip_opt_rtptimeout=60
- sip_opt_rtpholdtimeout=300
- config_get WAN_IP wan ipaddr
- # TODO check why the above does not work all the time
- if [ -z "${WAN_IP}" ] ; then
- config_get WAN_IF wan ifname
- WAN_IP=$(ifconfig ${WAN_IF} | grep "inet addr:" | sed 's/^.*inet addr:\([^ ]*\) .*$/\1/')
- fi
-
- sip_opt_externip=${WAN_IP}
-
- sip_opt_realm=asterisk
- config_get LAN_MASK lan netmask
- config_get LAN_IP lan ipaddr
- local LAN_NET=$(/bin/ipcalc.sh $LAN_IP $LAN_MASK | grep NETWORK | cut -d= -f2)
- sip_opt_localnet_def=$LAN_NET/$LAN_MASK
- sip_opt_localip=${LAN_IP}
-
- # default to ulaw only
- sip_opt_allow=
- sip_opt_registertimeout=20
- sip_opt_registerattempts=10
- sip_opt_canreinvite=no
-
- sip_sections=
-}
-
-sip_list="port bindaddr context maxexpirey defaultexpirey notifymimetype \
-rtptimeout rtpholdtimeout realm externip"
-
-create_sipconf() {
-
- append_dialplan_locals
-
- file=${DEST_DIR}/sip.conf
- get_checksum sip_conf $file
- local isempty=1
- if [ -z "${sip_sections}" ] ; then
- rm -f $file
- isempty=2
- else
- [ -z "${sip_opt_domain}" ] && sip_opt_domain="domain=${sip_opt_realm}"
-
- echo "${asteriskuci_gen}[general]" > $file
- echo "${sip_opt_domain}" >> "$file"
- echo "domain=${sip_opt_localip}" >> "$file"
- for i in ${sip_list} ; do
- eval value=\$sip_opt_$i
- [ ! -z "$value" ] && ( echo "$i=$value" >> $file )
- done
- [ -z "${sip_opt_localnet}" ] && sip_opt_localnet="localnet=${sip_opt_localnet_def}"
- echo "${sip_opt_localnet}" >> "${file}"
- echo "disallow=all" >> $file
- local rhs="${sip_opt_allow}"
- [ -z "$rhs" ] && rhs=ulaw
- while [ ! -z "$rhs" ] ; do
- cur=${rhs%%,*}
- nvar=${rhs#*,}
- enable_format ${cur}
- echo "allow=${cur}" >> $file
- [ "$nvar" == "$rhs" ] && break
- rhs=${nvar}
- done
-
- echo "${N}${sip_register}${N}${N}${sip_sections}" >> $file
- unset sip_register
- unset sip_sections
- fi
- check_checksum "$sip_conf" "$file" || ast_sip_restart=$isempty
-}
-
-
-handle_sipgeneral() {
- option_cb(){
- if [ "${1%_LENGTH}" = "${1}" ] ; then
- local opt=${1%_ITEM*}
- logdebug 4 "SipGeneral option ${opt} $2"
- if valid_sipiax_option globalsip ${opt} "$2" ; then
- case "${opt}" in
- host) sip_opt_host="$2"
- [ -z "${sip_opt_host}" ] && sip_opt_host=dynamic ;;
- allow) append sip_opt_allow "$2" "," ;;
- domain) split_append sip_opt_domain domain= "$2" "${N}" ;;
- localnet) split_append sip_opt_localnet localnet= "$2" "${N}" ;;
- *) eval "sip_opt_$1=\"\$2\"" ;;
- esac
- elif valid_rtp_option $1 "$2" ; then
- eval "rtp_opt_$1=\"\$2\""
- else
- logerror "Invalid SIP global option: $1"
- fi
- fi
- }
-}
-
-handle_sip() {
- check_add sipitems
- append sip_sections [$1] "$N$N"
- enable_module chan_sip
- sip_sectionname=${1#sip_}
- sip_type=peer
- sip_doregister=0
- sip_last_context=-
- sip_last_doregister=-
- sip_selfmailbox=no
- option_cb() {
- logdebug 3 "SIP/${sip_sectionname}: '$1' '$2'"
- case $1 in
- type) sip_type=$2
- append sip_sections "$1=$2" "$N"
- ;;
- register) [ "$2" == "yes" ] && sip_doregister=1 ;;
- registerextension|displayname) eval sip_last_$1="$2";;
- allow|allow_ITEM*) split_append sip_sections allow= "$2" "${N}" enable_format ;;
- extension|extension_ITEM*) add_extension SIP ${sip_sectionname} "$2" ;;
-
- context) sip_last_context="$2" ;;
- selfmailbox) sip_selfmailbox="$2" ;;
- incoming|incoming_ITEM*)
- add_incoming SIP ${sip_sectionname} "$2" ;;
- timeout|prefix|internationalprefix|alwaysinternational|countrycode)
- eval "target_$1_SIP_${sectionname}=\"$2\""
- ;;
- *_LENGTH) ;;
- _*) ;;
- *)
- eval sip_last_$1="$2"
- local opt=${1%_ITEM*}
- if valid_sipiax_option ${sip_type}sip ${opt} $2 ; then
- append sip_sections "${opt}=$2" "$N"
- else
- logerror "Invalid SIP option for ${sip_type}: ${opt}"
- fi
- esac
- }
-}
-
-# rtp.conf
-
-ast_add_conf rtp
-init_rtpconf() {
- ast_add_reload rtp
- rtp_opt_rtpstart=5000
- rtp_opt_rtpend=31000
- rtp_opt_rtpchecksums=
- rtp_opt_rtpdtmftimeout=
- rtp_opt_rtcpinterval=5000
-}
-
-create_rtpconf() {
- file=${DEST_DIR}/rtp.conf
- get_checksum rtp_conf $file
- local isempty=1
- if module_enabled chan_sip ; then
- echo "${asteriskuci_gen}[general]" > $file
- for i in $rtp_option_list ; do
- eval "local val=\"\$rtp_opt_$i\""
- if [ ! -z "$val" ] ; then
- lhs=$i
- case "$i" in
- rtpdtmftimeout) lhs=dtmftimeout
- esac
- echo "$lhs=$val" >> $file
- fi
- done
- else
- rm -f $file
- isempty=2
- fi
-
- check_checksum "$rtp_conf" "$file" || ast_rtp_restart=$isempty
-}
-reload_rtp() astcmd "rtp reload"
-unload_rtp() astcmd "unload rtp"
-
-
-# Iax
-
-ast_add_conf iax
-
-init_iaxconf() {
- ast_add_reload iax
- ast_enable_type iaxgeneral
- ast_enable_type iax
-
- return 0
-}
-
-create_iaxconf() {
- local file=$DEST_DIR/iax.conf
- get_checksum iax_conf $file
- local isempty=1
- if [ -z "${iax_sections}" ] ; then
- rm -f $file
- isempty=2
- else
- echo "${asteriskuci_gen}${iax_general}$N$N${iax_sections}" > $file
- fi
- check_checksum "$iax_conf" "$file" || ast_iax_restart=${isempty}
-}
-
-handle_iaxgeneral() {
- iax_general="[general]"
- option_cb() {
- case $1 in
- allow_LENGTH) ;;
- allow|allow_ITEM*) split_append iax_general allow= "$2" "${N}" enable_format ;;
- *)
- if valid_sipiax_option globaliax $1 $2 ; then
- eval "iax_opt_$1=\"$2\""
- append iax_general "$1=$2" "$N"
- else
- logerror "Invalid IAX global option: $1"
- fi ;;
- esac
- }
-}
-
-handle_iax() {
- check_add iaxitems
- iax_type=peer
- iax_sectionname="${1#iax_}"
- append iax_sections "[${iax_sectionname}]" "$N$N"
- iax_last_context=-
- iax_selfmailbox=no
- enable_module chan_iax2
- option_cb() {
- case $1 in
- type)
- iax_type=$2
- append iax_sections "type=$2" "$N" ;;
- allow_LENGTH|incoming_LENGTH) ;;
- allow|allow_ITEM*)
- split_append iax_sections allow= "$2" "${N}" enable_format ;;
- extension_LENGTH) ;;
- extension|extension_ITEM*) add_extension IAX ${iax_sectionname} "$2" ;;
- displayname) eval iax_last_$1="$2";;
- context)
- eval iax_last_context="$2" ;;
- selfmailbox)
- eval iax_selfmailbox="$2" ;;
- incoming|incoming_ITEM*)
- add_incoming IAX ${iax_sectionname} "$2" ;;
- timeout|prefix|internationalprefix|alwaysinternational|countrycode)
- eval "target_$1_IAX_${sectionname}=\"$2\"" ;;
- *)
- eval iax_last_$1="$2"
- if valid_sipiax_option ${iax_type}iax $1 $2 ; then
- append iax_sections "$1=$2" "$N"
- else
- logerror "Invalid IAX option for ${iax_type}: $1"
- fi
- esac
- }
-}
-
-reload_iax() {
- astcmd "iax2 reload"
- return 1
-}
-unload_iax() astcmd "unload chan_iax2.so"
-
-handle_target() {
- # Target name
- if split_targettype targettype targetname "${1}" ; then
- logdebug 4 "Handle target ${targettype}/${targetname} - ${1}"
- handle_dialtarget "${targettype}" "${targetname}"
- else
- logerror "No target type specified for target $1"
- fi
-}
-
-# Set up options sip/iax targets for outgoing sip/iax
-handle_dialtarget() {
- # Dialzone target option
- dt_areatype="$1"
- dt_areaname="$2"
- logdebug 1 "Dialzone Target for ${dt_areatype}/${dt_areaname}"
- option_cb(){
- logdebug 3 "Option $1='$2' for dialzone target"
- case $1 in
- timeout|prefix|internationalprefix|alwaysinternational|countrycode)
- eval "target_$1_${dt_areatype}_${dt_areaname}=\"$2\""
- ;;
- *)
- logerror "Invalid target for ${dt_areatype}/${dt_areaname}: ${1}"
- esac
- }
-}
-
-# vim: ts=2 sw=2 noet foldmethod=indent
diff --git a/contrib/package/asterisk-xip/files/uci/sipiaxconf.txt b/contrib/package/asterisk-xip/files/uci/sipiaxconf.txt
deleted file mode 100644
index 8e166595b..000000000
--- a/contrib/package/asterisk-xip/files/uci/sipiaxconf.txt
+++ /dev/null
@@ -1,117 +0,0 @@
-
-target (SIP|IAX)_{name} - Handle options for outgoing dialing
- timeout - Timeout for dialing out with this target
- prefix - Prefix required to dial out on this target
- internationalprefix- Prefix required to dial internation on this target
- alwaysinternational- True if this target always requires internation prefix
- countrycode - Default International country code for this target
- displayname - CallerID Name to set.
-
-sipgeneral
-sip [sip_]{name}
- type - Type of sip connection - very important.
- register - Set to yes to register
- registerextension - 'Extension' to use in register string in place of username
-
- extension (list) - Extension to use for this phone (doesn't have to be unique). First one is used to set the incoming callerid.
- selfmailbox - Set to yes to have dialing own extensions go to mailbox
- incoming (list) - Specify the incoming context for ringing
-
- domain (list) - List of valid doamins to match
- localnet (list) - List of nets considered local (and therefor require no NAT)
-
- timeout - Timeout for dialing out with this target
- prefix - Prefix required to dial out on this target
- internationalprefix- Prefix required to dial internation on this target
- alwaysinternational- True if this target always requires internation prefix
- countrycode - Default International country code for this target
-
- rtpstart - rtp.conf option
- rtpend - rtp.conf option
- rtpdtmftimeout - rtp.conf option dtmftimeout
- rtcpinterval - rtp.conf option
- rtpchecksums - rtp.conf option
-
-
-iaxgeneral
-iax [iax_]{name}
- extension (list) - Extension to use for this phone (doesn't have to be unique). First one is used to set the incoming callerid.
-
- selfmailbox - Set to yes to have dialing own extensions go to mailbox
- incoming (list) - Specify the incoming context for ringing
-
- timeout - Timeout for dialing out with this target
- prefix - Prefix required to dial out on this target
- internationalprefix- Prefix required to dial internation on this target
- alwaysinternational- True if this target always requires internation prefix
- countrycode - Default International country code for this target
-
-General asterisk options - see asterisk doco
-
-Options |Type |sip |sip |iax |iax
- | |general| |general|
------------------+--------+-------+-----+-------+-----
-writeprotect Integer no no yes yes
-static Integer no no yes yes
-port Integer yes yes no no
-maxexpirey Integer yes yes no no
-rtptimeout Integer yes yes no no
-rtpholdtimeout Integer yes yes no no
-defaultexpirey Integer yes yes no no
-registertimeout Integer yes yes no no
-registerattempts Integer yes yes no no
-call-limit Integer yes yes no no
-# ip addr
-bindaddr IP Addr yes yes no no
-externip IP Addr yes yes no no
-localnet Net/mask yes yes no no
-permit Net/mask no yes no no
-deny Net/mask no yes no no
-realm Domain yes yes no no
-domain Domain yes yes no no
-context context yes yes yes yes
-notifymimetype Mimetype yes yes no no
-canreinvite Yes/No yes yes yes yes
-nat Yes/No yes yes no no
-allowoverlap Yes/No yes yes no no
-allowsubscribe Yes/No yes yes no no
-allowtransfer Yes/No yes yes no no
-videosupport Yes/No yes yes no no
-pedantic Yes/No no yes no no
-trustrpid, Yes/No no yes no no
-promiscredir Yes/No no yes no no
-useclientcode Yes/No no yes no no
-dtmfmode Enum yes yes no no
-type Enum no yes no yes
-insecure Enum no yes no no
-callingpres Enum no yes no no
-progressinband Enum no yes no no
-allow List yes yes yes yes
-disallow List yes yes yes yes
-register Register yes yes no no
-username String no yes no yes
-secret String no yes no yes
-md5secret String no yes no yes
-host String no yes no yes
-mailbox String no yes no yes
-auth String no no no yes
-callgroup String no yes no no
-pickupgroup String no yes no no
-language String no yes no no
-accountcode String no yes no no
-setvar String no yes no no
-callerid String no yes no no
-amaflags String no yes no no
-subscribecontext String no yes no no
-maxcallbitrate String no yes no no
-rfc2833compensate String no yes no no
-mailbox String no yes no no
-template String no peer no no
-fromdomain String no peer no no
-regexten String no peer no no
-fromuser String no peer no no
-qualify String no peer no no
-defaultip String no peer no no
-sendrpid String no peer no no
-outboundproxy String no peer no no
-
diff --git a/contrib/package/asterisk-xip/files/uci/talkclock b/contrib/package/asterisk-xip/files/uci/talkclock
deleted file mode 100755
index 20e36065f..000000000
--- a/contrib/package/asterisk-xip/files/uci/talkclock
+++ /dev/null
@@ -1,48 +0,0 @@
-#!/bin/sh
-
-ast_add_module clock
-
-init_clock() {
- ast_enable_type dialplanclock
-}
-
-add_dialplan_talkclock() {
- local context=$1
- local zone=${asterisk_zone}
- [ ! -z "$3" ] && zone="$3"
- local date_format="$4"
- local time_format="$5"
- logdebug 1 "Adding Dialplan talking clock $1 $2"
- check_add_context "$context"
- local ext="exten => $2,"
- if [ "${dialplan_add_include_clock}" != 1 ] ; then
- dialplan_add_include_clock=1
- enable_format gsm
- enable_module app_sayunixtime
- append_include "macros/clock.conf"
- fi
- append dialplan_context_${context} "${ext}1,Macro(talkingclock,${time_format},${date_format},${zone})" "${N}"
-}
-
-handle_dialplanclock() {
- check_add dialplanclock
- option_cb() {
- case $1 in
- dialplan|extension|zone|timeformat|dateformat)
- eval "dial_clock_$1=\"$2\"" ;;
- esac
- }
-}
-
-check_add_dialplanclock() {
- if [ ! -z "${dial_clock_extension}" ] ; then
- [ -z ${dial_clock_dialplan} ] && dial_clock_dialplan=default
- add_dialplan_talkclock "${dial_clock_dialplan}" "${dial_clock_extension}" \
- "${dial_clock_zone}" "${dial_clock_dateformat}" "${dial_clock_timeformat}"
- fi
- for i in dialplan extension zone timeformat dateformat ; do
- eval "unset dial_clock_$i"
- done
-}
-
-# vim: ts=2 sw=2 noet foldmethod=indent
diff --git a/contrib/package/asterisk-xip/files/uci/talkclock.txt b/contrib/package/asterisk-xip/files/uci/talkclock.txt
deleted file mode 100644
index 9d4cdf360..000000000
--- a/contrib/package/asterisk-xip/files/uci/talkclock.txt
+++ /dev/null
@@ -1,7 +0,0 @@
-
-dialplanclock
- dialplan - dialplan to add clock to
- extension - extensions for talking clock
- zone - Timezone to use
- timeformat - Time Format to use
- dateformat - Date format to use
diff --git a/contrib/package/asterisk-xip/files/uci/voicemailconf b/contrib/package/asterisk-xip/files/uci/voicemailconf
deleted file mode 100755
index fbdfd7b87..000000000
--- a/contrib/package/asterisk-xip/files/uci/voicemailconf
+++ /dev/null
@@ -1,243 +0,0 @@
-#!/bin/sh
-
-# Voicemail.conf
-
-ast_add_conf voicemail
-
-init_voicemailconf() {
- ast_add_reload voicemail
-
- ast_enable_type voicegeneral
- ast_enable_type voicemail
- ast_enable_type voicezone
- ast_enable_type dialplanvoice
-
- voice_format=
- voice_serveremail=
- voice_attach=no
- voice_skipms=3000
- voice_maxsilence=10
- voice_silencethreshold=128
- voice_maxlogins=3
- voice_emaildateformat="%A, %B %d, %Y at %r"
- voice_sendvoicemail=no
- voice_maxmsg=100
- voice_maxmessage=180
- voice_minmessage=3
- voice_maxgreet=60
- return 0
-}
-
-voicegeneral_list="format emailformat serveremail attach skipms maxsilence silencethreshold maxlogins emaildateformat sendvoicemail maxmsg maxmessage minmessage maxgreet"
-voicegeneral_ext_list=""
-
-valid_voicemail(){
- is_in_list $1 ${voicegeneral_list} ${voicegeneral_ext_list}
- return $?
-}
-
-voicebox_list="context number password name email pager"
-
-voicebox_listopt="tz attach serveremail saycid dialout callback review operator envelope sayduration saydurationm"
-
-valid_voicebox() {
- is_in_list $1 ${voicebox_list} ${voicebox_listopt}
- return $?
-}
-
-check_add_voicebox() {
- if [ ! -z "${voicebox_number}" ] ; then
- [ -z "${voicebox_context}" ] && voicebox_context=default
- logdebug 1 "Adding Voicebox ${voicebox_number} in ${voicebox_context}"
- # Construct the voicebox line
- local line="$voicebox_number => "
- [ -z "${voicebox_tz}" ] && voicebox_tz=homeloc
- [ -z "${voicebox_name}" ] && voicebox_name=OpenWRT
-
- logdebug 1 "Adding in order options"
- for i in password name email pager ; do
- eval "local value=\"\${voicebox_$i}\""
- line="${line}${value},"
- done
-
- # Then add named options.
- logdebug 2 "Adding in named options"
- for i in ${voicebox_listopt} ; do
- eval val=\${voicebox_$i}
- [ -z "${val}" ] || append line "$i=$val" \|
- done
-
- logdebug 2 "Check for empty"
- # Check if the current voicebox context has anything
- eval local cur="\${voicebox_section_$voicebox_context}"
- # if not add it to the list of contexts used
- [ -z "$cur" ] && append voice_contextlist "${voicebox_context}" " "
-
- # Then add the voicebox line to the context
- logdebug 4 "Add Voicebox $line to ${voicebox_context}"
- append voicebox_section_${voicebox_context} "$line" "$N"
- fi
-
- # Then clear the settings for the next one.
- for i in ${voicebox_list} ${voicebox_listopt} ; do
- eval unset voicebox_$i
- done
-}
-
-create_voicemailconf() {
- # Construct the file
- file=${DEST_DIR}/voicemail.conf
- get_checksum voicemail_conf $file
-
- local isempty=1
- if [ -z "${voice_contextlist}" ] ; then
- local isempty=2
- rm -f $file
- else
-
- [ -z "${voice_format}" ] && voice_format="wav49|gsm|wav"
- # Make emailformat first in the list
- if [ ! -z "${voice_emailformat}" ] ; then
- local newfmt=${voice_emailformat}
- for i in ${voice_format//|/ } ; do
- [ "$i" == "${voice_emailformat}" ] || newfmt="${newfmt}|${i}"
- done
- voice_format="${newfmt}"
- fi
- echo "${asteriskuci_gen}[general]" > $file
- for i in ${voicegeneral_list} ; do
- eval value=\${voice_$i}
- if [ ! -z "$value" ] ; then
- echo "$i=$value" >> $file
- fi
- done
- echo "${N}[zonemessages]" >> $file
- echo "homeloc=${asterisk_zone}| Q IMp" >> $file
- echo "${voicezone_list}" >> $file
- for i in ${voice_contextlist} ; do
- echo "${N}[$i]" >> $file
- eval "local cursection=\"\${voicebox_section_${i}}\""
- echo "$cursection" >> $file
- eval unset voicebox_section_${i}
- done
- unset voice_contexts
- fi
- check_checksum "$voicemail_conf" "$file" || ast_voicemail_restart=$isempty
-}
-
-handle_voicegeneral() {
- option_cb() {
- case "$1" in
- format|format_ITEM*) append voice_format "$2" "|" ;;
- format_LENGTH) ;;
- *)
- if valid_voicemail $1 $2 ; then
- eval voice_$1="$2"
- else
- logerror "Invalid general voice option: $1"
- fi
- esac
- }
-}
-
-handle_voicemail() {
- check_add voicebox
- voicebox_context="${1%[-_]*}"
- if [ "${voicebox_context}" == "$1" ] ; then
- voicebox_context=default
- fi
- voicebox_number=${1#*[-_]}
- option_cb() {
- case $1 in
- zone) voicebox_tz="$2" ;;
- *)
- if valid_voicebox $1 $2 ; then
- eval "voicebox_$1=\"$2\""
- else
- logerror "Invalid voicebox option: $1"
- fi
- esac
- }
-}
-
-# Locality options for voicemail
-
-check_add_voicezone() {
- if [ ! -z "${voicezone_name}" ] ; then
- [ -z "${voicezone_zone}" ] && voicezone_zone=${asterisk_zone}
- if [ -z "${voicezone_message}" ] ; then
- voicezone_message="Q IMp"
- else
- voicezone_message=`echo "$voicezone_message"|tr \" \'`
- fi
- append voicezone_list "${voicezone_name}=${voicezone_zone}|${voicezone_message}" "${N}"
- fi
- unset voicezone_name
- unset voicezone_zone
- unset voicezone_message
-}
-
-handle_voicezone() {
- voicezone_name=$1
- option_cb() {
- case $1 in
- name) voicezone_name="$2" ;;
- zone) voicezone_zone="$2" ;;
- message) voicezone_message="$2" ;;
- *) logerror "Invalid voicezone option: $1"
- esac
- }
-}
-
-handle_dialplanvoice() {
- check_add dialplanvoice
- option_cb() {
- case $1 in
- dialplan|extension|voicecontext|voicebox)
- eval "dial_voice_$1=\"$2\"" ;;
- *) logerror "Invalid option: $1 for dialplanvoice"
- esac
- }
-}
-
-check_add_dialplanvoice() {
- if [ ! -z "${dial_voice_dialplan}" -a ! -z "${dial_voice_extension}" ] ; then
- local ext="exten => ${dial_voice_extension},"
- [ -z "${dial_voice_voicebox}" ] && dial_voice_voicebox=default
- if [ -z "${dial_voice_voicebox}" ] ; then
- logerror "Expecting voicebox for ${dial_voice_dialplan}/${dial_voice_extension}"
- else
- check_add_context ${dial_voice_dialplan}
- local voiceext="${dial_voice_voicebox}@${dial_voice_voicecontext}"
- enable_voicemail
- append dialplan_context_${dial_voice_dialplan} "${ext}1,VoiceMailMain(${voiceext})" "${N}"
- fi
- fi
- for i in dialplan extension voicecontext voicebox ; do
- eval "unset dial_voice_$i"
- done
-}
-
-enable_voicemail() {
- enable_module res_adsi
- enable_module app_voicemail
- enable_format gsm
-}
-
-
-add_dialplan_voice() {
- local context=$1
- logdebug 1 "Adding Dialplan voice $1 $2"
- check_add_context "$context"
- local ext="exten => $2,"
- enable_voicemail
- append dialplan_context_${context} "${ext}1,VoiceMailMain($3)" "${N}"
-}
-
-
-
-reload_voicemail() astcmd "module reload app_voicemail.so"
-unload_voicemail() astcmd "module unload app_voicemail.so"
-
-
-# vim: ts=2 sw=2 noet foldmethod=indent
diff --git a/contrib/package/asterisk-xip/files/uci/voicemailconf.txt b/contrib/package/asterisk-xip/files/uci/voicemailconf.txt
deleted file mode 100644
index 174d8a804..000000000
--- a/contrib/package/asterisk-xip/files/uci/voicemailconf.txt
+++ /dev/null
@@ -1,35 +0,0 @@
-
-voicegeneral - General options for voicemail
- format - Formats to store mail in (Default wav49|gsm|wav) - once set do NOT change this.
- emailformat - Which format to use for email
- maxlogins - Number of failed login attempts allowed
- maxmsg - Maximum numer of messages per folder
- sendvoicemail - Allow Sending of voicemail from VoiceMailMain
- serveremail - Who the notifications should be 'FROM:'
- attach - Attach voicemail to the email as an attachment
- skipms - Milliseconds to skip forward/back for rew/ff in message playback
- maxsilence - Seconds of silence before recoring ends.
- silencethreshold - What is considered silence - the lower the more sensitive
- emaildateformat - Date format on outgoing mails (see strftime).
- maxmessage - Maximum length of voicemail in seconds
- minmessage - Minimum length of voicemail in seconds
- maxgreet - Maximum length of greetings in seconds
-
-voicemail - Add a voicemail box.
- context - 'Voicemail context' for this entry (default 'default')
- number - Number of voicemail box
- name - Name of owner (default OpenWRT)
- zone - Timezone for voicebox (default homeloc)
- password - Passcode for box
- email - Email address of owner
- page - Pager number of owner.
-
-voicezone - Add a Timezone definition
- zone - Name of timezone (from tzdata) to use
- message - Date time message to use
-
-dialplanvoice - Add extension to pick up voicemail
- dialplan - Dialplan context to add the extension to
- extension - Extension to add
- voicecontext - voicebox context (default 'default')
- voicebox - Which voicebox to open
diff --git a/contrib/package/asterisk-xip/files/uci/voicemenu b/contrib/package/asterisk-xip/files/uci/voicemenu
deleted file mode 100644
index 7b046770f..000000000
--- a/contrib/package/asterisk-xip/files/uci/voicemenu
+++ /dev/null
@@ -1,145 +0,0 @@
-#!/bin/sh
-
-# IVR - Interactive Voice Response Menus.
-
-ast_add_module voicemenu
-init_voicemenu() {
- ast_enable_type voicemenu
- ast_enable_type voiceoption
-}
-check_append_voicemenu() {
- local context="${1}"
- eval "local isadded=\"\${dialplan_add_voicemenu_${context}-0}\""
- if [ "$isadded" != "1" ] ; then
- eval "dialplan_add_voicemenu_${context}=1"
- append voicemenu_contexts "$context"
- return 0
- else
- return 1
- fi
-}
-voicemenu_list="greeting timeoutlen timeoutsmax invalidmax includelocal localmenu"
-
-handle_voicemenu() {
- opt_voicemenu_context="$1"
- check_append_voicemenu "${opt_voicemenu_context}"
-
- option_cb() {
- case "$1" in
- greeting|timeoutlen|timeoutsmax|invalidmax|includelocal|localmenu)
- eval "opt_voicemenu_${opt_voicemenu_context}_$1=\"\$2\"" ;;
- _*) ;;
- *) logerror "Invalid Voicemenu option: $1" ;;
- esac
- }
-}
-
-voiceoption_list="digit menu dial goto"
-
-check_add_voiceoption() {
- [ -z "${last_vo_voicemenu}" ] && return 0
-
- if [ -z "${last_vo_dial}" ] ; then
- append opt_voicemenu_${last_vo_voicemenu}_action "exten => ${last_vo_digit},1,Goto(${last_vo_goto},s,1)" "${N}"
- else
- append opt_voicemenu_${last_vo_voicemenu}_action "exten => ${last_vo_digit},1,Dial(${last_vo_dial})" "${N}"
- fi
-
- append opt_voicemenu_${last_vo_voicemenu}_menu "${last_vo_menu}" "&"
-
- for i in ${voiceoption_list} ; do
- eval "unset last_vo_$i"
- done
-
-}
-
-handle_voiceoption() {
- opt_voicemenu_context="$1"
- check_add voiceoption
-
- option_cb() {
- case "$1" in
- voicemenu|digit|menu|dial|goto)
- eval "last_vo_$1=\"\$2\"" ;;
- _*) ;;
- *) logerror "Invalid Voiceoption option in ${opt_voicemenu_context}: $1" ;;
- esac
- }
-}
-
-createdialplan_voicemenu(){
- logdebug 0 "Creating Voicemenu dialplans"
- [ -z "${voicemenu_contexts}" ] && return 0
-
- for curvm in ${voicemenu_contexts} ; do
- check_add_context "${curvm}"
- for i in ${voicemenu_list} menu action ; do
- eval "vmc_${i}=\"\${opt_voicemenu_${curvm}_${i}}\""
- done
-
- [ -z "${vmc_timeoutlen}" ] && vmc_timeoutlen=5
- [ -z "${vmc_timeoutsmax}" ] && vmc_timeoutsmax=3
- [ -z "${vmc_invalidmax}" ] && vmc_invalidmax=0
-
- # Construct a voicemenu - with as small as possible code.
- local nn=1
- if [ ! -z "${vmc_greeting}" ] ; then
- append_dialplan_context $curvm "exten => s,${nn},Background(${vmc_greeting})"
- nn=n
- fi
-
- local againtimeout="(againtimeout)"
- if [ ${vmc_invalidmax} -gt 0 ] ; then
- append_dialplan_context $curvm "exten => s,${nn},Set(NUMINVALID=${vmc_invalidmax})"
- nn=n
- fi
-
- if [ ${vmc_timeoutsmax} -gt 0 ] ; then
- local labagaininvalid="(againinvalid)"
- if [ ${vmc_invalidmax} -le 0 ] ; then
- labagaininvalid=""
- fi
- append_dialplan_context $curvm "exten => s,${nn}${labagaininvalid},Set(NUMTIMEOUTS=${vmc_timeoutsmax})"
- nn=n
- else
- if [ ${vmc_invalidmax} -gt 0 ] ; then
- againtimeout="(againinvalid)"
- else
- againtimeout=
- fi
- fi
- if [ ! -z "${vmc_localmenu}" ] ; then
- append_dialplan_context $curvm "exten => s,${nn}${againtimeout},Background(${vmc_localmenu})"
- nn=n
- againtimeout=
- fi
- if [ ! -z "${vmc_menu}" ] ; then
- append_dialplan_context $curvm "exten => s,${nn}${againtimeout},Background(${vmc_menu})"
- againtimeout=
- nn=n
- fi
- append_dialplan_context $curvm "exten => s,${nn}${againtimeout},WaitExten(${vmc_timeoutlen})
-exten => s,n,Goto(t,1)
-exten => s,n(goodbye),Playback(vm-goodbye)
-exten => s,n,Hangup()"
- if [ ${vmc_timeoutsmax} -gt 0 ] ; then
- append_dialplan_context $curvm "exten => t,1,Set(NUMTIMEOUTS=\$[\${NUMTIMEOUTS} - 1])
-exten => t,n,Gotoif(\$[\${NUMTIMEOUTS} >= 0]?s,againtimeout:s,goodbye)"
- else
- append_dialplan_context $curvm "exten => t,1,Goto(s,goodbye)"
- fi
- append_dialplan_context ${curvm} "${vmc_action}"
- [ -z "${vmc_includelocal}" ] || append_dialplan_context ${curvm} "include => ${vmc_includelocal}"
- if [ ${vmc_invalidmax} -gt 0 ] ; then
- append_dialplan_context $curvm "exten => i,1,Set(NUMINVALID=\$[\${NUMINVALID} - 1])
-exten => i,n,Background(invalid)
-exten => i,n,Gotoif(\$[\${NUMINVALID} >= 0]?s,againinvalid:s,goodbye)"
- else
- append_dialplan_context $curvm "exten => i,1,Background(invalid)${N}exten => i,n,Goto(s,goodbye)"
- fi
- done
-
-}
-
-
-# vim: ts=2 sw=2 noet foldmethod=indent
diff --git a/contrib/package/asterisk-xip/files/uci/voicemenu.txt b/contrib/package/asterisk-xip/files/uci/voicemenu.txt
deleted file mode 100644
index ee87e2c5e..000000000
--- a/contrib/package/asterisk-xip/files/uci/voicemenu.txt
+++ /dev/null
@@ -1,37 +0,0 @@
-
-voicemenu
- greeting - Greeting (not repeated) at the start
- timeoutlen - Length of timeout between repeats of menus
- timeoutsmax - Number of timeouts
- invalidmax - Number of invalid keypresses allowed.
- includelocal - Include a context for direct dial of local numbers
- localmenu - Menu to say for direct dial of local numbers
-
-config voiceoption
- voicemenu - Name of menu the option applies to
- digit - Digit to press for option
- menu - What to include in menu for this option (use & to sep files and exclude extension)
- dial - Extension to dial
- goto - (or) Context to jump to
-
-Example
-
-config voicemenu autoattendmenu
- option greeting greet/autogreet
- option timeoutlen 5
- option timeoutsmax 3
- option invalidmax 3
- option includelocal extensions
- option 'localmenu' 'misc/dialextension'
-
-config voiceoption
- option voicemenu autoattendmenu
- option digit 1
- option menu misc/press&digits/1&misc/for&misc/operator
- option dial SIP/101
-
-config voiceoption
- option voicemenu autoattendmenu
- option digit 2
- option menu misc/press&digits/2&misc/for&misc/sales
- option goto salesmenu
diff --git a/contrib/package/asterisk-xip/files/voiceprompts.txt b/contrib/package/asterisk-xip/files/voiceprompts.txt
deleted file mode 100644
index aae23820c..000000000
--- a/contrib/package/asterisk-xip/files/voiceprompts.txt
+++ /dev/null
@@ -1,24 +0,0 @@
-lastcall/previous Press 4 for previous number
-lastcall/call-number Press 5 to dial number
-lastcall/next Press 6 for next number
-lastcall/tag-number Press 7 to tag number
-lastcall/previous-numbers Previous numbers.
-lastcall/dialed-numbers Dialed numbers
-lastcall/missed-call Missed calls
-lastcall/rec-call Received calls
-lastcall/calling Calling number
-lastcall/none-available no numbers available
-lastcall/no-number-info no number information
-voicetag/confirmnumber Press 1 to confirm tag
-voicetag/tryagain Press 2 to re-record tag
-voicetag/cancelrecord Press 3 to exit recording
-voicetag/recordname Please record name tag after tone
-voicetag/tagfor Tag recorded for
-misc/at-tone-time-exactly At the tone the time will be exactly
-misc/busy All our operators are busy at the moment
-misc/press press
-misc/for for
-misc/operator operator
-misc/reach-operator to reach operator
-misc/sales sales
-