From 7e3ff8074fb8abd77252fe2a556256820b0e17d3 Mon Sep 17 00:00:00 2001 From: Jack Hadrill Date: Fri, 14 Feb 2020 19:03:20 +0000 Subject: [PATCH] Initial demo attempt at improved configuration. No SIP trunk currently. --- extensions.conf | 40 ++++++++++++++++++++++++++++++++-------- modules.conf | 2 +- sip.conf | 35 ++++++++++++++++++++++++----------- voicemail.conf | 12 ++++++++++++ 4 files changed, 69 insertions(+), 20 deletions(-) create mode 100644 voicemail.conf diff --git a/extensions.conf b/extensions.conf index 36f6fd5..a2fdfc4 100644 --- a/extensions.conf +++ b/extensions.conf @@ -1,12 +1,36 @@ -[general] -autofallthrough=yes +[incoming] + ; Redirect incoming calls to extension 441452221649 to internal extension 0. + exten => 441234567890,1,Goto(internal,0,1) -[globals] -[nexmo-trunk] -exten => _X.,1,Dial(SIP/${EXTEN},30) +[outgoing] + ; Redirect outgoing calls via SIP provider. + exten => _X.,1,Dial(SIP/441234567890) + [internal] -exten => 666,1,Dial(SIP/666) -exten => 777,1,Dial(SIP/777) -exten => _X.,1,Dial(SIP/${EXTEN}@nexmo-) \ No newline at end of file + ; Dialplan for extension 1000. + ; Dial SIP user 1000. Timeout after 10 seconds. + exten => 1000,1,Dial(SIP/1000,10) + same => n,VoiceMail(${EXTEN}) + same => n,Hangup + + ; Dialplan for extension 1001. + exten => 1001,1,Dial(SIP/1001,10) + same => n,VoiceMail(${EXTEN}) + same => n,Hangup + + + ; Dialgroup "everyone" at extension 0 to ring mulitple extensions. + exten => 0,1,Set(DIALGROUP(everyone,add)=SIP/1000) + same => n,Set(DIALGROUP(everyone,add)=SIP/1001) + same => n,Dial(${DIALGROUP(everyone)},10) + same => n,VoiceMail(${EXTEN}) + same => n,Hangup + + + ; Dialplans for redirecting calls to outgoing context. + ; Redirect outgoing national calls in format 01234567890. + exten => _0ZX.,1,Goto(outgoing,0044${EXTEN:1},1) + ; Redirect international calls in format 00441234567890. + exten => _00X.,1,Goto(outgoing,${EXTEN},1) \ No newline at end of file diff --git a/modules.conf b/modules.conf index c02e8ff..c008fd9 100644 --- a/modules.conf +++ b/modules.conf @@ -1,2 +1,2 @@ [modules] -autoload=yes \ No newline at end of file + autoload=yes \ No newline at end of file diff --git a/sip.conf b/sip.conf index 59958ba..2622be2 100644 --- a/sip.conf +++ b/sip.conf @@ -1,13 +1,26 @@ -#include nexmo.conf +[general] + ; Default context for incoming calls. + context=public + ; Determines whether a phone is available before accepting call. + qualify=yes -[666] -type=friend -host=dynamic -secret=123 -context=internal -[777] -type=friend -host=dynamic -secret=456 -context=internal \ No newline at end of file +; Settings common to all internal extensions. +[internal-extension](!) + context=internal + type=friend + host=dynamic + allow=ulaw,alaw + +[1000](internal-extension) + secret=supersecurepassword + +[1001](internal-extension) + secret=supersecurepassword + +[441234567890] + context=incoming + secret=supersecurepassword + type=friend + host=dynamic + allow=ulaw,alaw \ No newline at end of file diff --git a/voicemail.conf b/voicemail.conf new file mode 100644 index 0000000..96affc6 --- /dev/null +++ b/voicemail.conf @@ -0,0 +1,12 @@ +[general] + format=wav + maxsilence=10 + maxmessage=180 + +[default] + ; Voicemail inbox for missed dialgroup calls. + 0 => 0000,0,test@example.com + + ; Voicemail inboxes for individual extensions. + 1000 => 0000,1000,test@example.com + 1001 => 0000,1001,test@example.com \ No newline at end of file