mirror of
https://github.com/signalwire/freeswitch.git
synced 2025-04-15 16:39:14 +00:00
fix build
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@10948 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
parent
afcc875edd
commit
18e527f2a1
@ -41,15 +41,15 @@ static void handle_SIGINT(int sig)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#ifdef WIN32
|
#ifdef WIN32
|
||||||
static HANDLE hStdout;
|
static HANDLE hStdout;
|
||||||
static WORD wOldColorAttrs;
|
static WORD wOldColorAttrs;
|
||||||
static CONSOLE_SCREEN_BUFFER_INFO csbiInfo;
|
static CONSOLE_SCREEN_BUFFER_INFO csbiInfo;
|
||||||
|
|
||||||
static WORD
|
static WORD
|
||||||
#else
|
#else
|
||||||
static const char*
|
static const char*
|
||||||
#endif
|
#endif
|
||||||
COLORS[] = { ESL_SEQ_DEFAULT_COLOR, ESL_SEQ_FRED, ESL_SEQ_FRED,
|
COLORS[] = { ESL_SEQ_DEFAULT_COLOR, ESL_SEQ_FRED, ESL_SEQ_FRED,
|
||||||
ESL_SEQ_FRED, ESL_SEQ_FMAGEN, ESL_SEQ_FCYAN, ESL_SEQ_FGREEN, ESL_SEQ_FYELLOW };
|
ESL_SEQ_FRED, ESL_SEQ_FMAGEN, ESL_SEQ_FCYAN, ESL_SEQ_FGREEN, ESL_SEQ_FYELLOW };
|
||||||
|
|
||||||
@ -88,11 +88,11 @@ static void *msg_thread_run(esl_thread_t *me, void *obj)
|
|||||||
|
|
||||||
if (tchannel == 0 || (file && !strcmp(file, "switch_console.c"))) {
|
if (tchannel == 0 || (file && !strcmp(file, "switch_console.c"))) {
|
||||||
#ifdef WIN32
|
#ifdef WIN32
|
||||||
DWORD len = (DWORD) strlen(handle->last_event->body);
|
DWORD len = (DWORD) strlen(handle->last_event->body);
|
||||||
DWORD outbytes = 0;
|
DWORD outbytes = 0;
|
||||||
SetConsoleTextAttribute(hStdout, COLORS[level]);
|
SetConsoleTextAttribute(hStdout, COLORS[level]);
|
||||||
WriteFile(hStdout, handle->last_event->body, len, &outbytes, NULL);
|
WriteFile(hStdout, handle->last_event->body, len, &outbytes, NULL);
|
||||||
SetConsoleTextAttribute(hStdout, wOldColorAttrs);
|
SetConsoleTextAttribute(hStdout, wOldColorAttrs);
|
||||||
#else
|
#else
|
||||||
printf("%s%s%s", COLORS[level], handle->last_event->body, ESL_SEQ_DEFAULT_COLOR);
|
printf("%s%s%s", COLORS[level], handle->last_event->body, ESL_SEQ_DEFAULT_COLOR);
|
||||||
#endif
|
#endif
|
||||||
@ -228,13 +228,6 @@ int main(int argc, char *argv[])
|
|||||||
char cfile[512] = ".\\fs_cli_config";
|
char cfile[512] = ".\\fs_cli_config";
|
||||||
char *home = ""; //getenv("HOME");
|
char *home = ""; //getenv("HOME");
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
strncpy(profiles[0].host, "127.0.0.1", sizeof(profiles[0].host));
|
|
||||||
strncpy(profiles[0].pass, "ClueCon", sizeof(profiles[0].pass));
|
|
||||||
strncpy(profiles[0].name, "default", sizeof(profiles[0].name));
|
|
||||||
profiles[0].port = 8021;
|
|
||||||
pcount++;
|
|
||||||
|
|
||||||
/* Vars for optargs */
|
/* Vars for optargs */
|
||||||
int opt;
|
int opt;
|
||||||
static struct option options[] = {
|
static struct option options[] = {
|
||||||
@ -244,7 +237,12 @@ int main(int argc, char *argv[])
|
|||||||
{"password", 1, 0, 'p'},
|
{"password", 1, 0, 'p'},
|
||||||
{0, 0, 0, 0}
|
{0, 0, 0, 0}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
strncpy(profiles[0].host, "127.0.0.1", sizeof(profiles[0].host));
|
||||||
|
strncpy(profiles[0].pass, "ClueCon", sizeof(profiles[0].pass));
|
||||||
|
strncpy(profiles[0].name, "default", sizeof(profiles[0].name));
|
||||||
|
profiles[0].port = 8021;
|
||||||
|
pcount++;
|
||||||
|
|
||||||
if (home) {
|
if (home) {
|
||||||
snprintf(hfile, sizeof(hfile), "%s/.fs_cli_history", home);
|
snprintf(hfile, sizeof(hfile), "%s/.fs_cli_history", home);
|
||||||
@ -287,7 +285,7 @@ int main(int argc, char *argv[])
|
|||||||
esl_config_close_file(&cfg);
|
esl_config_close_file(&cfg);
|
||||||
}
|
}
|
||||||
|
|
||||||
while (1){
|
for(;;) {
|
||||||
int option_index = 0;
|
int option_index = 0;
|
||||||
opt = getopt_long(argc, argv, "H:U:P:S:p:h?", options, &option_index);
|
opt = getopt_long(argc, argv, "H:U:P:S:p:h?", options, &option_index);
|
||||||
if (opt == -1) break;
|
if (opt == -1) break;
|
||||||
@ -357,10 +355,10 @@ int main(int argc, char *argv[])
|
|||||||
history(myhistory, &ev, H_LOAD, hfile);
|
history(myhistory, &ev, H_LOAD, hfile);
|
||||||
#endif
|
#endif
|
||||||
#ifdef WIN32
|
#ifdef WIN32
|
||||||
hStdout = GetStdHandle(STD_OUTPUT_HANDLE);
|
hStdout = GetStdHandle(STD_OUTPUT_HANDLE);
|
||||||
if (hStdout != INVALID_HANDLE_VALUE && GetConsoleScreenBufferInfo(hStdout, &csbiInfo)) {
|
if (hStdout != INVALID_HANDLE_VALUE && GetConsoleScreenBufferInfo(hStdout, &csbiInfo)) {
|
||||||
wOldColorAttrs = csbiInfo.wAttributes;
|
wOldColorAttrs = csbiInfo.wAttributes;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
snprintf(cmd_str, sizeof(cmd_str), "log info\n\n");
|
snprintf(cmd_str, sizeof(cmd_str), "log info\n\n");
|
||||||
|
@ -861,7 +861,7 @@ ESL_DECLARE(esl_status_t) esl_send(esl_handle_t *handle, const char *cmd)
|
|||||||
esl_log(ESL_LOG_DEBUG, "SEND\n%s\n", cmd);
|
esl_log(ESL_LOG_DEBUG, "SEND\n%s\n", cmd);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (send(handle->sock, cmd, strlen(cmd), 0) != strlen(cmd)) {
|
if (send(handle->sock, cmd, strlen(cmd), 0) != (int)strlen(cmd)) {
|
||||||
strerror_r(handle->errnum, handle->err, sizeof(handle->err));
|
strerror_r(handle->errnum, handle->err, sizeof(handle->err));
|
||||||
return ESL_FAIL;
|
return ESL_FAIL;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user