diff --git a/apps/asterisk/configmap.yaml b/apps/asterisk/configmap.yaml index 02d570a..3d2c55f 100644 --- a/apps/asterisk/configmap.yaml +++ b/apps/asterisk/configmap.yaml @@ -1,213 +1,220 @@ -apiVersion: v1 -kind: ConfigMap -metadata: - name: asterisk-config - namespace: telephony -data: - modules.conf: | - [modules] - autoload=yes - noload=chan_sip.so - noload=res_hep.so - noload=res_hep_pjsip.so - noload=res_hep_rtcp.so - - http.conf: | - [general] - enabled=yes - bindaddr=0.0.0.0 - bindport=8088 - - ari.conf: | - [general] - enabled=yes - pretty=yes - allowed_origins=* - - [flowercore] - type=user - read_only=no - password=bluejay-asterisk-ari - password_format=plain - - manager.conf: | - [general] - enabled=no - - pjsip.conf: | - ; ===== Transports ===== - [transport-udp] - type=transport - protocol=udp - bind=0.0.0.0:5060 - - ; ===== Twilio SIP Trunk ===== - [twilio-trunk] - type=endpoint - context=from-twilio - transport=transport-udp - disallow=all - allow=ulaw - allow=alaw - allow=g722 - aors=twilio-trunk - from_domain=sip.twilio.com - direct_media=no - ice_support=no - rtp_symmetric=yes - force_rport=yes - rewrite_contact=yes - trust_id_inbound=yes - - [twilio-trunk] - type=aor - contact=sip:bluejay.pstn.twilio.com - - [twilio-trunk] - type=identify - endpoint=twilio-trunk - ; Twilio North America signaling IPs - match=54.172.60.0/30 - match=54.172.60.4/30 - match=54.244.51.0/30 - match=54.244.51.4/30 - match=34.203.250.0/23 - match=54.171.127.192/26 - match=35.156.191.128/25 - match=54.65.63.192/26 - match=54.169.127.128/26 - match=54.252.254.64/26 - match=177.71.206.192/26 - - ; ===== Yealink Phone Template ===== - [phone-template](!) - type=endpoint - context=from-internal - transport=transport-udp - disallow=all - allow=opus - allow=g722 - allow=ulaw - allow=alaw - direct_media=no - dtmf_mode=rfc4733 - rtp_symmetric=yes - force_rport=yes - rewrite_contact=yes - - ; Extension 100 - Reception - [100](phone-template) - auth=auth100 - aors=100 - callerid="Reception" <100> - - [auth100] - type=auth - auth_type=userpass - username=100 - password=bluejay-ext-100 - - [100] - type=aor - max_contacts=1 - remove_existing=yes - qualify_frequency=60 - - ; Extension 101 - Office 1 - [101](phone-template) - auth=auth101 - aors=101 - callerid="Office 1" <101> - - [auth101] - type=auth - auth_type=userpass - username=101 - password=bluejay-ext-101 - - [101] - type=aor - max_contacts=1 - remove_existing=yes - qualify_frequency=60 - - ; Extension 102 - Office 2 - [102](phone-template) - auth=auth102 - aors=102 - callerid="Office 2" <102> - - [auth102] - type=auth - auth_type=userpass - username=102 - password=bluejay-ext-102 - - [102] - type=aor - max_contacts=1 - remove_existing=yes - qualify_frequency=60 - - ; Extension 103 - Office 3 - [103](phone-template) - auth=auth103 - aors=103 - callerid="Office 3" <103> - - [auth103] - type=auth - auth_type=userpass - username=103 - password=bluejay-ext-103 - - [103] - type=aor - max_contacts=1 - remove_existing=yes - qualify_frequency=60 - - extensions.conf: | - [general] - static=yes - writeprotect=no - - [from-twilio] - ; Inbound calls from Twilio SIP trunk → ARI Stasis app - exten => _+X.,1,Answer() - same => n,Stasis(flowercore-pbx,twilio,${EXTEN}) - same => n,Hangup() - - exten => _X.,1,Answer() - same => n,Stasis(flowercore-pbx,twilio,${EXTEN}) - same => n,Hangup() - - [from-internal] - ; Internal extension-to-extension dialing - exten => _1XX,1,Dial(PJSIP/${EXTEN},30) - same => n,Hangup() - - ; Outbound via Twilio SIP trunk (11-digit US) - exten => _1NXXNXXXXXX,1,Set(CALLERID(num)=+13202332529) - same => n,Dial(PJSIP/+${EXTEN}@twilio-trunk,60) - same => n,Hangup() - - ; Outbound via Twilio SIP trunk (+1 format) - exten => _+1NXXNXXXXXX,1,Set(CALLERID(num)=+13202332529) - same => n,Dial(PJSIP/${EXTEN}@twilio-trunk,60) - same => n,Hangup() - - ; IVR access from internal phones - exten => *100,1,Stasis(flowercore-pbx,internal,ivr) - same => n,Hangup() - - [default] - exten => _X.,1,NoOp(Unhandled call to ${EXTEN}) - same => n,Hangup() - - rtp.conf: | - [general] - rtpstart=10000 - rtpend=20000 - strictrtp=yes - icesupport=no +apiVersion: v1 +kind: ConfigMap +metadata: + name: asterisk-config + namespace: telephony +data: + modules.conf: | + [modules] + autoload=yes + noload=chan_sip.so + noload=res_hep.so + noload=res_hep_pjsip.so + noload=res_hep_rtcp.so + + http.conf: | + [general] + enabled=yes + bindaddr=0.0.0.0 + bindport=8088 + + ari.conf: | + [general] + enabled=yes + pretty=yes + allowed_origins=* + + [flowercore] + type=user + read_only=no + password=bluejay-asterisk-ari + password_format=plain + + manager.conf: | + [general] + enabled=no + + pjsip.conf: | + ; ===== Transports ===== + [transport-udp] + type=transport + protocol=udp + bind=0.0.0.0:5060 + + ; ===== Twilio SIP Trunk ===== + [twilio-trunk] + type=endpoint + context=from-twilio + transport=transport-udp + disallow=all + allow=ulaw + allow=alaw + allow=g722 + aors=twilio-trunk + from_domain=sip.twilio.com + direct_media=no + ice_support=no + rtp_symmetric=yes + force_rport=yes + rewrite_contact=yes + trust_id_inbound=yes + + [twilio-trunk] + type=aor + contact=sip:bluejay.pstn.twilio.com + + [twilio-trunk] + type=identify + endpoint=twilio-trunk + ; Twilio North America signaling IPs + match=54.172.60.0/30 + match=54.172.60.4/30 + match=54.244.51.0/30 + match=54.244.51.4/30 + match=34.203.250.0/23 + match=54.171.127.192/26 + match=35.156.191.128/25 + match=54.65.63.192/26 + match=54.169.127.128/26 + match=54.252.254.64/26 + match=177.71.206.192/26 + + ; ===== Yealink Phone Template ===== + [phone-template](!) + type=endpoint + context=from-internal + transport=transport-udp + disallow=all + allow=opus + allow=g722 + allow=ulaw + allow=alaw + direct_media=no + dtmf_mode=rfc4733 + rtp_symmetric=yes + force_rport=yes + rewrite_contact=yes + + ; Extension 100 - Reception + [100](phone-template) + auth=auth100 + aors=100 + callerid="Reception" <100> + + [auth100] + type=auth + auth_type=userpass + username=100 + password=bluejay-ext-100 + + [100] + type=aor + max_contacts=1 + remove_existing=yes + qualify_frequency=60 + + ; Extension 101 - Office 1 + [101](phone-template) + auth=auth101 + aors=101 + callerid="Office 1" <101> + + [auth101] + type=auth + auth_type=userpass + username=101 + password=bluejay-ext-101 + + [101] + type=aor + max_contacts=1 + remove_existing=yes + qualify_frequency=60 + + ; Extension 102 - Office 2 + [102](phone-template) + auth=auth102 + aors=102 + callerid="Office 2" <102> + + [auth102] + type=auth + auth_type=userpass + username=102 + password=bluejay-ext-102 + + [102] + type=aor + max_contacts=1 + remove_existing=yes + qualify_frequency=60 + + ; Extension 103 - Office 3 + [103](phone-template) + auth=auth103 + aors=103 + callerid="Office 3" <103> + + [auth103] + type=auth + auth_type=userpass + username=103 + password=bluejay-ext-103 + + [103] + type=aor + max_contacts=1 + remove_existing=yes + qualify_frequency=60 + + extensions.conf: | + [general] + static=yes + writeprotect=no + + [from-twilio] + ; Inbound calls from Twilio SIP trunk + ; Ring reception (100) for 30s, then try all extensions in ring group + exten => _+X.,1,Answer() + same => n,Playback(silence/1) + same => n,Dial(PJSIP/100,30,t) + same => n,Dial(PJSIP/101&PJSIP/102&PJSIP/103,30,t) + same => n,Playback(vm-goodbye) + same => n,Hangup() + + exten => _X.,1,Answer() + same => n,Playback(silence/1) + same => n,Dial(PJSIP/100,30,t) + same => n,Dial(PJSIP/101&PJSIP/102&PJSIP/103,30,t) + same => n,Playback(vm-goodbye) + same => n,Hangup() + + [from-internal] + ; Internal extension-to-extension dialing + exten => _1XX,1,Dial(PJSIP/${EXTEN},30) + same => n,Hangup() + + ; Outbound via Twilio SIP trunk (11-digit US) + exten => _1NXXNXXXXXX,1,Set(CALLERID(num)=+13202332529) + same => n,Dial(PJSIP/+${EXTEN}@twilio-trunk,60) + same => n,Hangup() + + ; Outbound via Twilio SIP trunk (+1 format) + exten => _+1NXXNXXXXXX,1,Set(CALLERID(num)=+13202332529) + same => n,Dial(PJSIP/${EXTEN}@twilio-trunk,60) + same => n,Hangup() + + ; IVR access from internal phones (when ARI is connected) + exten => *100,1,Stasis(flowercore-pbx,internal,ivr) + same => n,Hangup() + + [default] + exten => _X.,1,NoOp(Unhandled call to ${EXTEN}) + same => n,Hangup() + + rtp.conf: | + [general] + rtpstart=10000 + rtpend=20000 + strictrtp=yes + icesupport=no