diff --git a/install/10.asterisk.md b/install/10.asterisk.md index bd60b31ff..bd2a178c9 100644 --- a/install/10.asterisk.md +++ b/install/10.asterisk.md @@ -65,3 +65,41 @@ ln -sf /opt/rbt/install/logrotate/asterisk /etc/logrotate.d/asterisk ```bash systemctl enable asterisk --now ``` + +## Custom scripts + +You can use custom Lua scripts, which should be placed in `/etc/asterisk/custom`. This can be useful if you want to +extend the standard behavior or replace parts of the dialplan. Custom script names should be listed in the `custom` +variable inside the `/etc/asterisk/config.lua` configuration file (see `config.sample.lua`). + +> [!WARNING] +> Don't use "extensions.lua" as the name of the custom script to avoid an error. + +Don't forget to reload the pbx_lua module after modifying the scripts: + +```bash +sudo asterisk -x "module reload pbx_lua" +``` + +### Sokol 112 trouble + +If you use Sokol intercoms, you will have a problem when calling apartment 112, as this device does not allow you to +specify the SIP number of the apartment. In this case, a call to apartment 112 will result in a call to the SOS +extension. To fix this, you need to add a custom script that overrides the standard behavior: + +```lua +-- /etc/asterisk/custom/sokol_sos.lua +extensions["default"]["112"] = function(context, extension) + handleOtherCases(context, extension) +end +``` + +```lua +-- /etc/asterisk/config.lua +-- ... +-- ... +-- ... +custom = { + "sokol_sos" +} +```