If there is no disk space left, and res_phreaknet attempts to update IAX config files, it will be unable to successfully write any data and as a result, all the IAX config files are truncated to 0 bytes when they are updated.
A simple fix would be to detect the low disk space condition (< 1MB) and not attempt to do any file I/O in this situation. However, this could be subject to race conditions and doesn't feel like a completely proper fix for this.
Because we're using ast_config_text_file_save2, we can't directly handle this scenario in this module, such as by writing to a temp file first, ensuring we wrote everything we meant to write, and then renaming the file, at least without working around it in some other way.
If there is no disk space left, and
res_phreaknetattempts to update IAX config files, it will be unable to successfully write any data and as a result, all the IAX config files are truncated to 0 bytes when they are updated.A simple fix would be to detect the low disk space condition (< 1MB) and not attempt to do any file I/O in this situation. However, this could be subject to race conditions and doesn't feel like a completely proper fix for this.
Because we're using
ast_config_text_file_save2, we can't directly handle this scenario in this module, such as by writing to a temp file first, ensuring we wrote everything we meant to write, and then renaming the file, at least without working around it in some other way.