feat(freeswitch): publica SIP/RTP no host pra registro de ramal de verdade
Usuário tentou registrar um ramal e não conseguiu — nenhuma porta SIP/RTP estava publicada no host, só o Event Socket (interno). O teste ponta a ponta da fase anterior só funcionava porque os softphones de teste rodavam dentro da mesma rede Docker. RTP restrito a um range fixo de 200 portas (16384-16584, via sed em switch.conf.xml) — o default vanilla (~16k portas) é inviável de publicar uma a uma. docker-compose.yml publica 5060/udp+tcp (SIP) e 16384-16584/udp (RTP); Event Socket continua nunca publicado. Verificado: iptables -t nat -L DOCKER confirma DNAT correto pras 201 portas; sofia status confirma que o STUN já configurado (external_rtp_ip/ external_sip_ip) resolve pro IP público real da VM, então o SDP vai anunciar o IP certo — não só o registro, o áudio também deve funcionar. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01BFaBaBSQGhyXGEgtTYZGV8
This commit is contained in:
@@ -78,10 +78,25 @@ RUN sed -i \
|
||||
/etc/freeswitch/sip_profiles/internal.xml \
|
||||
&& ! grep -q "force-register-domain\|force-subscription-domain\|force-register-db-domain" /etc/freeswitch/sip_profiles/internal.xml
|
||||
|
||||
# RTP num range fixo e pequeno (PHASE 54, docs/EXTENSIONS.md) — o range
|
||||
# vanilla default (16384-32768, ~16k portas) é inviável de publicar uma a
|
||||
# uma no host; achado ao tentar registrar um softphone de fora da rede
|
||||
# Docker pela primeira vez (nenhuma porta SIP/RTP estava publicada até
|
||||
# aqui — só o Event Socket interno). Restrito a 200 portas, suficiente
|
||||
# pra alguns testes/chamadas simultâneas em laboratório.
|
||||
RUN sed -i \
|
||||
-e 's#<!-- <param name="rtp-start-port" value="16384"/> -->#<param name="rtp-start-port" value="16384"/>#' \
|
||||
-e 's#<!-- <param name="rtp-end-port" value="32768"/> -->#<param name="rtp-end-port" value="16584"/>#' \
|
||||
/etc/freeswitch/autoload_configs/switch.conf.xml \
|
||||
&& grep -q '<param name="rtp-start-port" value="16384"/>' /etc/freeswitch/autoload_configs/switch.conf.xml \
|
||||
&& grep -q '<param name="rtp-end-port" value="16584"/>' /etc/freeswitch/autoload_configs/switch.conf.xml
|
||||
|
||||
COPY entrypoint.sh /usr/local/bin/entrypoint.sh
|
||||
RUN chmod +x /usr/local/bin/entrypoint.sh
|
||||
|
||||
EXPOSE 8021
|
||||
EXPOSE 5060/udp 5060/tcp
|
||||
EXPOSE 16384-16584/udp
|
||||
|
||||
ENTRYPOINT ["/usr/local/bin/entrypoint.sh"]
|
||||
CMD ["/usr/bin/freeswitch", "-nonat"]
|
||||
|
||||
Reference in New Issue
Block a user