mirror of
https://github.com/asterisk/asterisk.git
synced 2025-10-12 15:45:18 +00:00
app_voicemail: Refactor email generation functions
Refactors generic functions used for email generation into utils.c so that they can be used by multiple modules, including app_voicemail and app_minivm, to avoid code duplication. ASTERISK-29715 #close Change-Id: I1de0ed3483623e9599711129edc817c45ad237ee
This commit is contained in:
committed by
George Joseph
parent
b290bb1251
commit
70cdb0f9a8
15
main/file.c
15
main/file.c
@@ -184,6 +184,21 @@ int ast_format_def_unregister(const char *name)
|
||||
return res;
|
||||
}
|
||||
|
||||
FILE *ast_file_mkftemp(char *template, mode_t mode)
|
||||
{
|
||||
FILE *p = NULL;
|
||||
int pfd = mkstemp(template);
|
||||
chmod(template, mode);
|
||||
if (pfd > -1) {
|
||||
p = fdopen(pfd, "w+");
|
||||
if (!p) {
|
||||
close(pfd);
|
||||
pfd = -1;
|
||||
}
|
||||
}
|
||||
return p;
|
||||
}
|
||||
|
||||
int ast_stopstream(struct ast_channel *tmp)
|
||||
{
|
||||
ast_channel_lock(tmp);
|
||||
|
Reference in New Issue
Block a user