projects
/
asterisk/asterisk.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fix minor makefile issues (bug #3036)
[asterisk/asterisk.git]
/
utils
/
astman.c
diff --git
a/utils/astman.c
b/utils/astman.c
index
6fa6b81
..
ebeeb67
100755
(executable)
--- a/
utils/astman.c
+++ b/
utils/astman.c
@@
-7,11
+7,11
@@
#include <newt.h>
#include <stdio.h>
#include <newt.h>
#include <stdio.h>
-#include <sys/socket.h>
#include <sys/time.h>
#include <netdb.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <sys/time.h>
#include <netdb.h>
#include <netinet/in.h>
#include <arpa/inet.h>
+#include <sys/socket.h>
#include <sys/select.h>
#include <fcntl.h>
#include <string.h>
#include <sys/select.h>
#include <fcntl.h>
#include <string.h>
@@
-23,6
+23,8
@@
#include <asterisk/md5.h>
#include <asterisk/manager.h>
#include <asterisk/md5.h>
#include <asterisk/manager.h>
+#undef gethostbyname
+
#define MAX_HEADERS 80
#define MAX_LEN 256
#define MAX_HEADERS 80
#define MAX_LEN 256
@@
-170,13
+172,14
@@
static struct event {
{ "Status", event_status },
{ "Link", event_ignore },
{ "Unlink", event_ignore },
{ "Status", event_status },
{ "Link", event_ignore },
{ "Unlink", event_ignore },
+ { "StatusComplete", event_ignore }
};
static int process_message(struct ast_mansession *s, struct message *m)
{
int x;
};
static int process_message(struct ast_mansession *s, struct message *m)
{
int x;
- char event[80];
- strncpy(event, get_header(m, "Event"), sizeof(event));
+ char event[80] = "";
+ strncpy(event, get_header(m, "Event"), sizeof(event) - 1);
if (!strlen(event)) {
fprintf(stderr, "Missing event in request");
return 0;
if (!strlen(event)) {
fprintf(stderr, "Missing event in request");
return 0;
@@
-383,14
+386,14
@@
static int show_doing(char *title, char *tmp)
return 0;
}
return 0;
}
-static int hide_doing()
+static int hide_doing(void)
{
newtPopWindow();
newtFormDestroy(showform);
return 0;
}
{
newtPopWindow();
newtFormDestroy(showform);
return 0;
}
-static void try_status()
+static void try_status(void)
{
struct message *m;
manager_action("Status", "");
{
struct message *m;
manager_action("Status", "");
@@
-427,7
+430,7
@@
static int get_user_input(char *msg, char *buf, int buflen)
newtComponent ok;
newtComponent cancel;
newtComponent inpfield;
newtComponent ok;
newtComponent cancel;
newtComponent inpfield;
- char *input;
+ const char *input;
int res = -1;
struct newtExitStruct es;
int res = -1;
struct newtExitStruct es;
@@
-550,8
+553,8
@@
static int login(char *hostname)
newtComponent label;
newtComponent ulabel;
newtComponent plabel;
newtComponent label;
newtComponent ulabel;
newtComponent plabel;
- char *user;
- char *pass;
+ const char *user;
+ const char *pass;
struct message *m;
struct newtExitStruct es;
char tmp[55];
struct message *m;
struct newtExitStruct es;
char tmp[55];
@@
-583,7
+586,7
@@
static int login(char *hostname)
session.sin.sin_port = htons(DEFAULT_MANAGER_PORT);
memcpy(&session.sin.sin_addr, hp->h_addr, sizeof(session.sin.sin_addr));
session.sin.sin_port = htons(DEFAULT_MANAGER_PORT);
memcpy(&session.sin.sin_addr, hp->h_addr, sizeof(session.sin.sin_addr));
- if (connect(session.fd, &session.sin, sizeof(session.sin))) {
+ if (connect(session.fd,(struct sockaddr*)&session.sin, sizeof(session.sin))) {
snprintf(tmp, sizeof(tmp), "%s failed: %s\n", hostname, strerror(errno));
show_message("Connect Failed", tmp);
return -1;
snprintf(tmp, sizeof(tmp), "%s failed: %s\n", hostname, strerror(errno));
show_message("Connect Failed", tmp);
return -1;