feat: add asterisk pjsip integration
- infrastructure/docker/asterisk.Dockerfile: Asterisk 22.10.1 LTS compilado do fonte oficial (Debian trixie nao distribui mais o pacote asterisk), com PJSIP, AMI, ARI, res_odbc/res_config_odbc, cdr_adaptive_odbc, cel_odbc, app_queue - infrastructure/asterisk/config: templates renderizados no entrypoint (secrets via envsubst, nunca versionados) + sorcery.conf/extconfig.conf para PJSIP realtime, dialplan de teste (extensao 600) - infrastructure/postgres/init/002-asterisk-realtime.sql: tabelas ps_endpoints/ps_auths/ps_aors/ps_contacts/ps_endpoint_id_ips/ ps_registrations/cdr/cel no schema 'asterisk' - infrastructure/nftables: protege AMI/ARI/SIP contra acesso pela LAN (interface ens18), trazido da Fase 9 do TODO para ja, sem afetar SSH nem a rede interna do Docker - docker-compose.yml: servico asterisk em network_mode: host (RTP); Postgres publicado em 127.0.0.1:5432 (nao 0.0.0.0) para o Asterisk alcanca-lo, ja que host network nao enxerga a rede Docker interna Testado: AMI login, ARI com auth (401 sem auth), pjsip realtime consultando Postgres sem erro, dialplan originate -> CDR e CEL gravados corretamente, healthcheck do compose passando.
This commit is contained in:
19
infrastructure/asterisk/config/manager.conf.tpl
Normal file
19
infrastructure/asterisk/config/manager.conf.tpl
Normal file
@@ -0,0 +1,19 @@
|
||||
; AMI (Asterisk Manager Interface).
|
||||
; NUNCA exposto à LAN/Internet: bind em 0.0.0.0 apenas porque o container usa
|
||||
; network_mode: host, mas o acesso externo é bloqueado pelo nftables
|
||||
; (infrastructure/nftables/b2bcall.nft) — só loopback e a rede interna dos
|
||||
; containers Docker (172.16.0.0/12) alcançam a porta 5038.
|
||||
[general]
|
||||
enabled = yes
|
||||
port = 5038
|
||||
bindaddr = 0.0.0.0
|
||||
displayconnects = no
|
||||
webenabled = no
|
||||
|
||||
[${AMI_USERNAME}]
|
||||
secret = ${AMI_SECRET}
|
||||
deny = 0.0.0.0/0.0.0.0
|
||||
permit = 127.0.0.1/255.255.255.255
|
||||
permit = 172.16.0.0/255.240.0.0
|
||||
read = system,call,agent,user,config,command,dtmf,reporting,cdr,dialplan,originate
|
||||
write = system,call,agent,user,config,command,dtmf,reporting,originate
|
||||
Reference in New Issue
Block a user