doc/
subfolder, the README file is autogenerated)This pull request is intended to introduce a new, straightforward module that can efficiently stream output to files while also handling changes based on a specific interval. The module contains only one function that streams a chunk of text to the current output file handle associated with the given file index.
It's not 100% completed but the basic features are there. Any reviews and of course naming of the module, much appreciated.
How the module works:
base_folder
to define where you want your logs to be saved.base_filename
(up to 10) to define the names of your files. Each is associated with an index according to the order you defined it. First base_filename
's index is 0, second's index is 1 and so on. This is appended with a new timestamp when interval_seconds
are passed.interval_seconds
to define how much time before the file is closed and a new one is opened. Right now shared for all files.extension
to define what should be the extension of files. Right now shared for all files.Use the provided function file_out
to write any text (including pvs) to a specific file you want.
Example:
Define parameters such as:
# kamailio.cfg
...
loadmodule "file_out.so"
modparam("file_out", "base_folder", "/tmp/kamailio/file_out/")
modparam("file_out", "base_filename", "accounting")
modparam("file_out", "base_filename", "missed_calls")
modparam("file_out","interval_seconds", 600)
modparam("file_out","extension", ".txt")
...
request_route {
...
file_out("0", "Writing to accounting.txt file $rm from $fu (IP:$si:$sp)");
file_out("1", "Writing to missed_calls.txt file $rm from $fu (IP:$si:$sp)");
...
}
https://github.com/kamailio/kamailio/pull/3741
(7 files)
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you are subscribed to this thread.