update smpp and smeg

This commit is contained in:
2024-10-18 16:54:41 +08:00
parent eaaf4831c4
commit f6d74c5b9b
4 changed files with 61 additions and 33 deletions

View File

@@ -469,3 +469,34 @@ void smpp_send_error(char *sdBuf)
smpp_send_ascout("\x1b[0m");
}
}
void smeg_debug_log(const char *fmt, ...)
{
// #if SMEG_DEBUG == 1
#if 1
char logFile[64];
FILE *fp;
time_t l_time;
va_list ap;
char buf[8192];
struct tm *t;
char timestr[64];
l_time = time(NULL);
t = localtime(&l_time);
sprintf(logFile, "../log/smeg_%04d%02d%02d.log", t->tm_year + 1900, t->tm_mon + 1, t->tm_mday);
fp = fopen(logFile, "a");
if (fp != NULL)
{
va_start(ap, fmt);
vsprintf(buf, fmt, ap);
sprintf(timestr, "%02d:%02d:%02d: ", t->tm_hour, t->tm_min, t->tm_sec);
fputs(timestr, fp);
fputs(buf, fp);
fputs("\n", fp);
fflush(fp);
va_end(ap);
fclose(fp);
}
#endif
}

View File

@@ -12,9 +12,6 @@
extern int register_ssn(BYTE ssn, BYTE usertype);
// by simon at 24/10/18 begin--
extern void smeg_debug_log(const char *fmt,...);
// --end
/* by simon at 23/9/26 */
SocketsMsg SockMsg;

View File

@@ -45,7 +45,7 @@ void smeg_debugTimer();
void smeg_debugInit();
void smeg_mib_init();
void retset_call_statistics();
void smeg_debug_log(const char *fmt,...);
extern void smeg_debug_log(const char *fmt,...);
int uIntToByte(BYTE * buf, int bufLen, unsigned long uIntValue);
int get_license();

View File

@@ -540,33 +540,33 @@ int getOmcSysNo(int* sysNo)
return 1;
}
void smeg_debug_log(const char *fmt,...)
{
// #if SMEG_DEBUG == 1
#if 1
char logFile[64];
FILE *fp;
time_t l_time;
va_list ap;
char buf[8192];
struct tm *t;
char timestr[64];
// void smeg_debug_log(const char *fmt,...)
// {
// // #if SMEG_DEBUG == 1
// #if 1
// char logFile[64];
// FILE *fp;
// time_t l_time;
// va_list ap;
// char buf[8192];
// struct tm *t;
// char timestr[64];
l_time=time(NULL);
t=localtime(&l_time);
sprintf(logFile,"../log/smeg_%04d%02d%02d.log",t->tm_year+1900,t->tm_mon+1,t->tm_mday);
fp=fopen(logFile,"a");
if(fp!=NULL)
{
va_start(ap,fmt);
vsprintf(buf,fmt,ap);
sprintf(timestr,"%02d:%02d:%02d: ",t->tm_hour,t->tm_min,t->tm_sec);
fputs(timestr,fp);
fputs(buf,fp);
fputs("\n",fp);
fflush(fp);
va_end(ap);
fclose(fp);
}
#endif
}
// l_time=time(NULL);
// t=localtime(&l_time);
// sprintf(logFile,"../log/smeg_%04d%02d%02d.log",t->tm_year+1900,t->tm_mon+1,t->tm_mday);
// fp=fopen(logFile,"a");
// if(fp!=NULL)
// {
// va_start(ap,fmt);
// vsprintf(buf,fmt,ap);
// sprintf(timestr,"%02d:%02d:%02d: ",t->tm_hour,t->tm_min,t->tm_sec);
// fputs(timestr,fp);
// fputs(buf,fp);
// fputs("\n",fp);
// fflush(fp);
// va_end(ap);
// fclose(fp);
// }
// #endif
// }