Add asterisk configuration

This commit is contained in:
Correl Roush 2024-11-24 20:06:18 -05:00
parent 5b6c0cc415
commit 056f125cc0
7 changed files with 241 additions and 0 deletions

5
asterisk.yml Normal file
View file

@ -0,0 +1,5 @@
- name: Manage asterisk server
hosts: asterisk
become: true
roles:
- asterisk

View file

@ -27,6 +27,7 @@ proxmox:
ansible_host: 192.168.1.14
asterisk:
ansible_host: 192.168.1.21
ansible_user: root
heimdall:
ansible_host: heimdall-dashboard.sailmaker.fenix.lgbt

View file

@ -0,0 +1,2 @@
- name: reload dialplan
command: asterisk -rx 'dialplan reload'

View file

@ -0,0 +1,13 @@
- name: Configure extensions
template:
src: extensions.conf.j2
dest: /etc/asterisk/extensions.conf
notify: reload dialplan
- name: Configure SIP devices
template:
src: sip.conf.j2
dest: /etc/asterisk/sip.conf
- name: Configure SIP clients
template:
src: pjsip.conf.j2
dest: /etc/asterisk/pjsip.conf

View file

@ -0,0 +1,15 @@
[from-internal]
exten => 700,1,Answer()
same = n,Wait(1)
same = n,Playback(hello-world)
same = n,Wait(1)
same = n,Playback(tt-monkeys)
same = n,Hangup()
; 3-digit extensions dial their associated devices
exten => _XXX,1,Dial(PJSIP/${EXTEN})
same = n,Hangup()
; 7+ digit calls are routed outside via the PSTN
exten => _NXXXXXX.,1,Dial(PJSIP/pstn/${EXTEN})
same = n,Hangup()

View file

@ -0,0 +1,85 @@
[transport-udp]
type=transport
protocol=udp
bind=0.0.0.0
[transport-tcp]
type=transport
protocol=tcp
bind=0.0.0.0
[100]
type=endpoint
context=from-internal
disallow=all
allow=ulaw
auth=100
aors=100
[100]
type=auth
auth_type=userpass
password=mJzTGkXdh02OVXGOaxcH8V3To
username=100
[100]
type=aor
max_contacts=1
; Remove existing registrations when registering. The cisco seems to
; reregister using different ports, which leaves it hanging without
; this set.
remove_existing=yes
[101]
type=endpoint
context=from-internal
disallow=all
allow=ulaw
auth=101
aors=101
[101]
type=auth
auth_type=userpass
password=5KVzU5Ez77lIIv4SAyzDOnMWo
username=101
[101]
type=aor
max_contacts=1
[102]
type=endpoint
context=from-internal
disallow=all
allow=ulaw
auth=102
aors=102
[102]
type=auth
auth_type=userpass
password=mpHoQ29k2AiH4EN7IXL9vnE9j
username=102
[102]
type=aor
max_contacts=1
[pstn]
type=endpoint
context=from-internal
disallow=all
allow=ulaw
auth=pstn
aors=pstn
[pstn]
type=auth
auth_type=userpass
password=wiUxqCvXIPPGexXj3y0htFRho
username=pstn
[pstn]
type=aor
max_contacts=1

View file

@ -0,0 +1,120 @@
[extension](!)
type=friend
context=extensions
host=dynamic
trustrpid=no
parkinglot=default
allowsubscribe=yes
notifyhold=no
callcounter=yes
videosupport=no
disallow=all
allow=g722,ulaw,alaw,g729
[cisco-usecallmanager](!,extension)
transport=tcp
nat=no
directmedia=no
sendrpid=rpid
rpid_update=yes
rpid_immediate=yes
send_diversion=yes
dndbusy=yes
cisco_usecallmanager=yes
cisco_pickupnotify_alert=from,to
cisco_pickupnotify_timer=5
cisco_keep_conference=no
cisco_multiadmin_conference=yes
huntgroup_default=no
[general]
; Only the following ciphers are supported, phone may fail to connect if others are specified
tlscipher=ECDHE-RSA-AES256-GCM-SHA384:ECDHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-SHA:DHE-RSA-AES128-SHA
; NULL cipher is only needed if you are using Authenticated mode, otherwise is should not be enabled
;tlscipher+=:NULL
[non-secure-mode](!)
transport=tcp
[authenticated-mode](!)
transport=tls
[encrypted-mode](!)
transport=tls
; The res_srtp module must be loaded.
encryption=yes
encryption_taglen=80
[cisco-7941](!,cisco-usecallmanager)
; These should match <busyTrigger> and <maxNumCalls> in SEPMAC.cnf.xml
busylevel=3
call-limit=4
; Force huntgroup login so that the prompt does not show the logged out message
huntgroup_default=yes
[cisco-8841](!,cisco-usecallmanager)
busylevel=4
call-limit=5
[cisco-8865](!,cisco-usecallmanager)
busylevel=4
call-limit=5
; <videoCapability> also needs to be enabled in SEPMAC.cnf.xml
videosupport=yes
; Allow the video codec
allow=h264
[cisco-9951](!,cisco-usecallmanager)
busylevel=5
call-limit=6
; <videoCapability> also needs to be enabled in SEPMAC.cnf.xml
videosupport=yes
; Allow the video codec
allow=h264
[100](cisco-8841,non-secure-mode)
secret=mJzTGkXdh02OVXGOaxcH8V3To
callerid="Correl" <100>
description=Correl
callgroup=1
pickupgroup=1
mailbox=100@default
; Extensions that the phone is watching, they need to be configured in SEPMAC.cnf.xml as well
; subscribe=301
; subscribe=303
; subscribe=381
[101](extension)
secret=5KVzU5Ez77lIIv4SAyzDOnMWo
callerid="Correl" <101>
description=Correl
callgroup=1
pickupgroup=1
mailbox=101@default
; Extensions that the phone is watching, they need to be configured in SEPMAC.cnf.xml as well
; subscribe=301
; subscribe=303
; subscribe=381
[102](extension)
secret=mpHoQ29k2AiH4EN7IXL9vnE9j
callerid="Conference" <102>
description=Conference
callgroup=1
pickupgroup=1
mailbox=102@default
; Extensions that the phone is watching, they need to be configured in SEPMAC.cnf.xml as well
; subscribe=301
; subscribe=303
; subscribe=381
[pstn]
type=friend
host=dynamic
context=incoming
secret=wiUxqCvXIPPGexXj3y0htFRho
callerid="PSTN"
description=PSTN
callgroup=1
pickupgroup=1
mailbox=pstn@default