chan_ooh323: fix h323 log file path

Change h323 log path relative to AST_LOG_DIR instead of
/var/log/asterisk hardcoded
Add return back error message from OOH323EP initialize

ASTERISK-28348 #close

Reported by: Dmitry Shubin

Change-Id: Ib102dd36bbe6c2a7a4ce6870ae9110d9000d7e98
This commit is contained in:
Alexander Anikin
2019-04-11 02:07:18 +03:00
parent dd32c0239f
commit a8f1e26d34
4 changed files with 17 additions and 11 deletions

View File

@@ -34,7 +34,7 @@ ast_mutex_t bindPortLock;
extern DList g_TimerList;
int ooH323EpInitialize
(enum OOCallMode callMode, const char* tracefile)
(enum OOCallMode callMode, const char* tracefile, char* errstr, int errstr_max)
{
memset(&gH323ep, 0, sizeof(ooEndPoint));
@@ -46,7 +46,7 @@ int ooH323EpInitialize
{
if(strlen(tracefile)>= MAXFILENAME)
{
printf("Error:File name longer than allowed maximum %d\n",
snprintf(errstr, errstr_max, "Error:File name longer than allowed maximum %d\n",
MAXFILENAME-1);
return OO_FAILED;
}
@@ -59,7 +59,7 @@ int ooH323EpInitialize
gH323ep.fptraceFile = fopen(gH323ep.traceFile, "a");
if(gH323ep.fptraceFile == NULL)
{
printf("Error:Failed to open trace file %s for write.\n",
snprintf(errstr, errstr_max, "Error:Failed to open trace file %s for write.\n",
gH323ep.traceFile);
return OO_FAILED;
}

View File

@@ -163,7 +163,7 @@ typedef struct OOH323EndPoint {
* @return OO_OK, on success. OO_FAILED, on failure
*/
EXTERN int ooH323EpInitialize
(enum OOCallMode callMode, const char* tracefile);
(enum OOCallMode callMode, const char* tracefile, char* errstr, int errstr_max);
/**
* This function is used to represent the H.323 application endpoint as