1
0

Refactored to include Twilio-based SIP trunk.

This commit is contained in:
Jack Hadrill 2020-02-15 03:33:41 +00:00
parent 7e3ff8074f
commit 3568b66aba
4 changed files with 87 additions and 0 deletions

38
asterisk/extensions.conf Normal file
View File

@ -0,0 +1,38 @@
[+441234567890]
; Redirect incoming calls from trunk with context +441234567890 to internal extension 0.
exten => _+X.,1,Goto(internal,0,1)
[outgoing]
; Redirect all calls entering this context via SIP trunk "twilio".
exten => _X.,1,Dial(SIP/twilio/+${EXTEN})
same => n,Hangup
[internal]
; 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 international calls in format 00441234567890.
exten => _00X.,1,Goto(outgoing,${EXTEN:2},1)
; Redirect international calls in format +441234567890.
exten => _+X.,1,Goto(outgoing,${EXTEN:1},1)
; Redirect outgoing national calls in format 01234567890.
exten => _0ZX.,1,Goto(outgoing,44${EXTEN:1},1)

2
asterisk/modules.conf Normal file
View File

@ -0,0 +1,2 @@
[modules]
autoload=yes

35
asterisk/sip.conf Normal file
View File

@ -0,0 +1,35 @@
[general]
; Default context for incoming calls.
context=public
; Determines whether a phone is available before accepting call.
qualify=yes
; Settings common to all trunks.
[trunk](!)
type=peer
nat=no
qualify=yes
insecure=port,invite
dtmfmode=rfc2833
allow=ulaw,alaw,G729
; Settings common to all internal extensions.
[internal](!)
context=internal
type=friend
host=dynamic
allow=ulaw,alaw,G729
; Twilio trunk.
[twilio](trunk)
context=+441234567890
fromuser=+441234567890
host=jacknet-gloucester.pstn.ie1.twilio.com
; Internal extensions.
[1000](internal)
secret=supersecurepassword
[1001](internal)
secret=supersecurepassword

12
asterisk/voicemail.conf Normal file
View File

@ -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