### Description
Could you extend `import_file` directive to support wildcards like ``` import_file "/run/kamailio/cfg/*" ``` This will allow place runtime config files with public IP of VM. Useful for cloud installation. ``` listen=udp:eth0 advertise 52.24.72.57:5060 listen=tcp:eth0 advertise 52.24.72.57:5060 ```
### Expected behavior All files matched to wildcard included into config
#### Actual observed behavior wildcard ignored
I think an approach which would be similar to existing packages would be to use instead something like a ".d" directory. Like this:
- /etc/kamailio/kamailio.cfg: main configuration - /etc/kamailio/kamailio.cfg.d: include files for main configuration
Then you could simply drop include cfg files into this directory and they would be added to the main cfg. But we would need to use also some ordering, as the order in which the cfgs are loaded is important. Existing packages uses something like a number as a prefix. Example:
- /etc/kamailio/kamailio.cfg - /etc/kamailio/kamailio.cfg.d/01-interfaces - /etc/kamailio/kamailio.cfg.d/10-modules - /etc/kamailio/kamailio.cfg.d/50-custom-route
etc..
Yes, order important. Sure, need use alphabetical ordering.
If we talk about drop-in functionality. Then need separate `drop-in` types 1. created by admins - permanent drop-in, example enabled/disabled `modules`; 1. runtime drop-in - temporal drop-in, example `listeners` configured using cloud providers tools.
Say may be defined configuration key `include_dropin {wildcard}` Then kamailio looks dropins in folders `/etc/kamailio/kamailio.cfg.d` and `/run/kamailio/kamailio.cfg.d`. List of dropin folders maybe configurable on predefined. **Example** ``` ### Loading modules drop-in ### include_dropin *-modules.cfg
### Loading interface listeners ### include_dropin *-listeners.cfg ``` In example above on file system may exist files ``` /etc/kamailio/kamailio.cfg.d/10-jasson-modules.cfg /etc/kamailio/kamailio.cfg.d/20-db_postgres-modules.cfg /run/kamailio/kamailio.cfg.d/10-amazon-listeners.cfg ```
This is pretty old, if no dev plans to work on it, then it will be closed soon.
Closing as no devs to implement.
Closed #2125.