[mod_sofia] Add enable-chat-api-proto to gate the api chat proto (#3135)

The chat layer lets an inbound SIP MESSAGE select which chat proto handles it,
and the `api` proto runs the address as a FreeSWITCH API command. The new
per-profile `enable-chat-api-proto` param controls that route and is off unless
set. A MESSAGE selecting the proto on a profile without it is answered 403 and
logged with the source and the requested command.

The proto compare is case-insensitive, matching the chat interface registry,
which is created with `switch_core_hash_init_nocase()`.

The param ships commented out in the four vanilla profiles and the mod_sofia
sofia.conf.xml sample.
This commit is contained in:
Dmitry Verenitsin authored and GitHub committed 2026-08-26 16:46:56 +03:00
1 parent 098018df3d
commit 7015f6a73a
8 files changed
+38

No files matched your search

+3
View File
@@ -107,6 +107,9 @@
<!-- extended info parsing -->
<!-- <param name="extended-info-parsing" value="true"/> -->
<!-- lets an inbound MESSAGE to api+<command> run FreeSWITCH API commands, so enable only for trusted peers -->
<!-- <param name="enable-chat-api-proto" value="true"/> -->
<!--<param name="aggressive-nat-detection" value="true"/>-->
<!--
There are known issues (asserts and segfaults) when 100rel is enabled.