Skip to content

Commit

Permalink
Update 10.asterisk.md
Browse files Browse the repository at this point in the history
  • Loading branch information
subs1stem committed Jan 13, 2025
1 parent 406740a commit e4df100
Showing 1 changed file with 38 additions and 0 deletions.
38 changes: 38 additions & 0 deletions install/10.asterisk.md
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
```

0 comments on commit e4df100

Please sign in to comment.