diff options
Diffstat (limited to 'applications/luci-pbx/root/etc/pbx-asterisk')
17 files changed, 67 insertions, 8 deletions
diff --git a/applications/luci-pbx/root/etc/pbx-asterisk/delayedcallback b/applications/luci-pbx/root/etc/pbx-asterisk/delayedcallback new file mode 100755 index 0000000000..903efe9ad9 --- /dev/null +++ b/applications/luci-pbx/root/etc/pbx-asterisk/delayedcallback @@ -0,0 +1,18 @@ +#!/bin/sh + +# Check if there are more than one instance of this command +# with the same command line running at the same time for some +# reason, then quit. We are checking for the same +# commandline in order to permit two different callback +# attempts simultaneously. + +if ! grep -q "$@" /dev/shm/delayedcallback.[0-9]* 2>/dev/null +then + echo "$@" > /dev/shm/delayedcallback.$$ + sleep 25 + asterisk -r -x "$1 $2 \"$3\" $4 $5 $6" + rm /dev/shm/delayedcallback.$$ +# echo "`date` $@": >> /dev/shm/delayedcallback.log +#else +# echo "`date` ERROR: There appears to be a callback attempt in progress to: $@" >> /dev/shm/delayedcallback.err +fi diff --git a/applications/luci-pbx/root/etc/pbx-asterisk/extensions.conf.TEMPLATE b/applications/luci-pbx/root/etc/pbx-asterisk/extensions.conf.TEMPLATE index 534945cc11..c8966edd87 100644 --- a/applications/luci-pbx/root/etc/pbx-asterisk/extensions.conf.TEMPLATE +++ b/applications/luci-pbx/root/etc/pbx-asterisk/extensions.conf.TEMPLATE @@ -21,4 +21,5 @@ exten => _[!-~].,1,Dial(SIP/${EXTEN},60,r) #include extensions_incoming_gtalk.conf #include extensions_blacklist.conf #include extensions_callthrough.conf +#include extensions_callback.conf #include extensions_user.conf diff --git a/applications/luci-pbx/root/etc/pbx-asterisk/extensions_callback-check.conf.TEMPLATE b/applications/luci-pbx/root/etc/pbx-asterisk/extensions_callback-check.conf.TEMPLATE new file mode 100644 index 0000000000..06b1a4b6b9 --- /dev/null +++ b/applications/luci-pbx/root/etc/pbx-asterisk/extensions_callback-check.conf.TEMPLATE @@ -0,0 +1 @@ +exten => s,n,Gotoif($[ "${CALLERID(NUM)}" =~ ".*|NUMBER|" ]?context-user-callback,|NUMBER|,1) diff --git a/applications/luci-pbx/root/etc/pbx-asterisk/extensions_callback-check_footer.conf.TEMPLATE b/applications/luci-pbx/root/etc/pbx-asterisk/extensions_callback-check_footer.conf.TEMPLATE new file mode 100644 index 0000000000..282fe9e8ff --- /dev/null +++ b/applications/luci-pbx/root/etc/pbx-asterisk/extensions_callback-check_footer.conf.TEMPLATE @@ -0,0 +1,2 @@ +exten => s,n,Goto(${SOURCECONTEXT},${SOURCEEXTEN},donecallback) + diff --git a/applications/luci-pbx/root/etc/pbx-asterisk/extensions_callback-check_header.conf.TEMPLATE b/applications/luci-pbx/root/etc/pbx-asterisk/extensions_callback-check_header.conf.TEMPLATE new file mode 100644 index 0000000000..be289c4d33 --- /dev/null +++ b/applications/luci-pbx/root/etc/pbx-asterisk/extensions_callback-check_header.conf.TEMPLATE @@ -0,0 +1,3 @@ + +[callback-check-call-context] +exten => s,1,Noop() diff --git a/applications/luci-pbx/root/etc/pbx-asterisk/extensions_callback_gtalk.conf.TEMPLATE b/applications/luci-pbx/root/etc/pbx-asterisk/extensions_callback_gtalk.conf.TEMPLATE new file mode 100644 index 0000000000..43eec788f3 --- /dev/null +++ b/applications/luci-pbx/root/etc/pbx-asterisk/extensions_callback_gtalk.conf.TEMPLATE @@ -0,0 +1,4 @@ +exten => |NUMBER|,1,System(/etc/pbx-asterisk/delayedcallback "channel originate Gtalk/gtalk-|CALLBACKPROVIDER|/|NUMBER|@voice.google.com extension |NUMBER|@disa-call-context" &) +exten => |NUMBER|,n,Wait(|CALLBACKHUPDELAY|) +exten => |NUMBER|,n,Hangup() + diff --git a/applications/luci-pbx/root/etc/pbx-asterisk/extensions_callback_header.conf.TEMPLATE b/applications/luci-pbx/root/etc/pbx-asterisk/extensions_callback_header.conf.TEMPLATE new file mode 100644 index 0000000000..0b8fb4c23f --- /dev/null +++ b/applications/luci-pbx/root/etc/pbx-asterisk/extensions_callback_header.conf.TEMPLATE @@ -0,0 +1 @@ +[context-user-callback] diff --git a/applications/luci-pbx/root/etc/pbx-asterisk/extensions_callback_sip.conf.TEMPLATE b/applications/luci-pbx/root/etc/pbx-asterisk/extensions_callback_sip.conf.TEMPLATE new file mode 100644 index 0000000000..300e9fa0e8 --- /dev/null +++ b/applications/luci-pbx/root/etc/pbx-asterisk/extensions_callback_sip.conf.TEMPLATE @@ -0,0 +1,4 @@ +exten => |NUMBER|,1,System(/etc/pbx-asterisk/delayedcallback "channel originate SIP/|NUMBER|@peer-|CALLBACKPROVIDER| extension |NUMBER|@disa-call-context" &) +exten => |NUMBER|,n,Wait(|CALLBACKHUPDELAY|) +exten => |NUMBER|,n,Hangup() + diff --git a/applications/luci-pbx/root/etc/pbx-asterisk/extensions_default.conf.TEMPLATE b/applications/luci-pbx/root/etc/pbx-asterisk/extensions_default.conf.TEMPLATE index 8d37ddccb2..35836e290a 100644 --- a/applications/luci-pbx/root/etc/pbx-asterisk/extensions_default.conf.TEMPLATE +++ b/applications/luci-pbx/root/etc/pbx-asterisk/extensions_default.conf.TEMPLATE @@ -4,6 +4,8 @@ exten => s,n,Set(SOURCECONTEXT=default-incoming-call-context) exten => s,n,Set(SOURCEEXTEN=s) exten => s,n,Goto(blacklist-call-context,s,1) exten => s,n(doneblacklist),NoOp() +exten => s,n,Goto(callback-check-call-context,s,1) +exten => s,n(donecallback),NoOp() exten => s,n,Goto(disa-check-call-context,s,1) exten => s,n(donedisacheck),Dial(|LOCALUSERS|,${RINGTIME},r) exten => s,n,Goto(context-voicemail,s,1) diff --git a/applications/luci-pbx/root/etc/pbx-asterisk/extensions_disa-nopin.conf.TEMPLATE b/applications/luci-pbx/root/etc/pbx-asterisk/extensions_disa-nopin.conf.TEMPLATE new file mode 100644 index 0000000000..74e48de8c1 --- /dev/null +++ b/applications/luci-pbx/root/etc/pbx-asterisk/extensions_disa-nopin.conf.TEMPLATE @@ -0,0 +1,5 @@ +exten => |NUMBER|,1,Noop() +exten => |NUMBER|,n,Set(TIMEOUT(digit)=15) +exten => |NUMBER|,n,Set(TIMEOUT(response)=40) +exten => |NUMBER|,n,DISA(no-password,context-user-|DEFAULTUSER|) + diff --git a/applications/luci-pbx/root/etc/pbx-asterisk/extensions_incoming_context_gtalk.conf.TEMPLATE b/applications/luci-pbx/root/etc/pbx-asterisk/extensions_incoming_context_gtalk.conf.TEMPLATE index f0ca37209e..3f9cf4c7d9 100644 --- a/applications/luci-pbx/root/etc/pbx-asterisk/extensions_incoming_context_gtalk.conf.TEMPLATE +++ b/applications/luci-pbx/root/etc/pbx-asterisk/extensions_incoming_context_gtalk.conf.TEMPLATE @@ -7,6 +7,8 @@ same => n,Set(SOURCECONTEXT=context-incoming-gtalk) same => n,Set(SOURCEEXTEN=|USERNAME|) same => n,Goto(blacklist-call-context,s,1) same => n(doneblacklist),NoOp() +same => n,Goto(callback-check-call-context,s,1) +same => n(donecallback),NoOp() same => n,Goto(disa-check-call-context,s,1) same => n(donedisacheck),Dial(|LOCALUSERS|,${RINGTIME},D(:w11111111)) same => n,Goto(context-voicemail,s,1) diff --git a/applications/luci-pbx/root/etc/pbx-asterisk/extensions_incoming_context_sip.conf.TEMPLATE b/applications/luci-pbx/root/etc/pbx-asterisk/extensions_incoming_context_sip.conf.TEMPLATE index 1956007542..b2c3716bf4 100644 --- a/applications/luci-pbx/root/etc/pbx-asterisk/extensions_incoming_context_sip.conf.TEMPLATE +++ b/applications/luci-pbx/root/etc/pbx-asterisk/extensions_incoming_context_sip.conf.TEMPLATE @@ -5,6 +5,8 @@ exten => s,n,Set(SOURCECONTEXT=context-incoming-|NAME|) exten => s,n,Set(SOURCEEXTEN=s) exten => s,n,Goto(blacklist-call-context,s,1) exten => s,n(doneblacklist),NoOp() +exten => s,n,Goto(callback-check-call-context,s,1) +exten => s,n(donecallback),NoOp() exten => s,n,Goto(disa-check-call-context,s,1) exten => s,n(donedisacheck),Dial(|LOCALUSERS|,${RINGTIME},r) exten => s,n,Goto(context-voicemail,s,1) diff --git a/applications/luci-pbx/root/etc/pbx-asterisk/extensions_voicemail_enabled.conf.TEMPLATE b/applications/luci-pbx/root/etc/pbx-asterisk/extensions_voicemail_enabled.conf.TEMPLATE index e4b34b5b0d..4edd9cb426 100644 --- a/applications/luci-pbx/root/etc/pbx-asterisk/extensions_voicemail_enabled.conf.TEMPLATE +++ b/applications/luci-pbx/root/etc/pbx-asterisk/extensions_voicemail_enabled.conf.TEMPLATE @@ -1,15 +1,27 @@ [context-voicemail-record-greeting] -exten => *789,1,Wait(2) -exten => *789,n,Playback(/etc/pbx-voicemail/greeting) -exten => *789,n,Wait(5) -exten => *789,n,Record(/etc/pbx-voicemail/greeting:WAV,20,90,k) -exten => *789,n,Wait(2) -exten => *789,n,Playback(/etc/pbx-voicemail/greeting) +exten => *789,1,Wait(1) +exten => *789,n,Playback(/etc/pbx-voicemail/recordings/greeting) +exten => *789,n,Wait(1) +exten => *789,n,Playback(beep) +exten => *789,n,Playback(beep) +exten => *789,n,WaitExten(30) + +exten => t,1,Playback(vm-goodbye) +exten => t,n,Wait(2) +exten => t,n,Hangup() + +exten => *,1,Playback(beep) +exten => *,n,Playback(beep) +exten => *,n,Record(/tmp/voicemail/greeting:gsm,20,120,k) +exten => *,n,Wait(1) +exten => *,n,Playback(/tmp/voicemail/greeting) + +exten => h,1,System(/etc/pbx-voicemail/pbx-move-greeting &) [context-voicemail] exten => s,1,Wait(2) -exten => s,2,Playback(/etc/pbx-voicemail/greeting) +exten => s,2,Playback(/etc/pbx-voicemail/recordings/greeting) exten => s,3,Wait(2) -exten => s,n,Record(/tmp/voicemail%d:WAV,20,180,k) +exten => s,n,Record(/tmp/voicemail/voicemail%d:WAV,20,180,k) exten => h,1,System(/etc/pbx-voicemail/pbx-send-voicemail '${RECORDED_FILE}.WAV' '${CALLERID(all)}' &) diff --git a/applications/luci-pbx/root/etc/pbx-asterisk/sip.conf.TEMPLATE b/applications/luci-pbx/root/etc/pbx-asterisk/sip.conf.TEMPLATE index 6069554e05..8f3b112ff6 100644 --- a/applications/luci-pbx/root/etc/pbx-asterisk/sip.conf.TEMPLATE +++ b/applications/luci-pbx/root/etc/pbx-asterisk/sip.conf.TEMPLATE @@ -1,4 +1,5 @@ [general] +transport=udp context=default-incoming-call-context allowoverlap=yes allowtransfer=yes @@ -28,6 +29,7 @@ directmedia=no sipdebug=no bindport=|BINDPORT| externhost=|EXTERNHOST| +externrefresh=60 #include sip_registrations.conf diff --git a/applications/luci-pbx/root/etc/pbx-asterisk/sounds/auth-incorrect.gsm b/applications/luci-pbx/root/etc/pbx-asterisk/sounds/auth-incorrect.gsm Binary files differnew file mode 100644 index 0000000000..12fec25d56 --- /dev/null +++ b/applications/luci-pbx/root/etc/pbx-asterisk/sounds/auth-incorrect.gsm diff --git a/applications/luci-pbx/root/etc/pbx-asterisk/sounds/beep.gsm b/applications/luci-pbx/root/etc/pbx-asterisk/sounds/beep.gsm Binary files differnew file mode 100644 index 0000000000..d38eda9cc5 --- /dev/null +++ b/applications/luci-pbx/root/etc/pbx-asterisk/sounds/beep.gsm diff --git a/applications/luci-pbx/root/etc/pbx-asterisk/sounds/vm-goodbye.gsm b/applications/luci-pbx/root/etc/pbx-asterisk/sounds/vm-goodbye.gsm Binary files differnew file mode 100644 index 0000000000..735b281c8e --- /dev/null +++ b/applications/luci-pbx/root/etc/pbx-asterisk/sounds/vm-goodbye.gsm |