Skip to content
Snippets Groups Projects
Commit 69d2a491 authored by Mark Spencer's avatar Mark Spencer
Browse files

Merge james' fixes

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@1491 65c4cc65-6c06-0410-ace0-fbb531ad65f3
parent 76b99bb0
No related branches found
No related tags found
No related merge requests found
...@@ -150,7 +150,7 @@ void astman_send_error(struct mansession *s, struct message *m, char *error) ...@@ -150,7 +150,7 @@ void astman_send_error(struct mansession *s, struct message *m, char *error)
char *id = astman_get_header(m,"ActionID"); char *id = astman_get_header(m,"ActionID");
ast_mutex_lock(&s->lock); ast_mutex_lock(&s->lock);
ast_cli(s->fd, "Response: Error\r\n"); ast_cli(s->fd, "Response: Error\r\n");
if (id && &id) if (id && strlen(id))
ast_cli(s->fd, "ActionID: %s\r\n",id); ast_cli(s->fd, "ActionID: %s\r\n",id);
ast_cli(s->fd, "Message: %s\r\n\r\n", error); ast_cli(s->fd, "Message: %s\r\n\r\n", error);
ast_mutex_unlock(&s->lock); ast_mutex_unlock(&s->lock);
...@@ -161,7 +161,7 @@ void astman_send_response(struct mansession *s, struct message *m, char *resp, c ...@@ -161,7 +161,7 @@ void astman_send_response(struct mansession *s, struct message *m, char *resp, c
char *id = astman_get_header(m,"ActionID"); char *id = astman_get_header(m,"ActionID");
ast_mutex_lock(&s->lock); ast_mutex_lock(&s->lock);
ast_cli(s->fd, "Response: %s\r\n", resp); ast_cli(s->fd, "Response: %s\r\n", resp);
if (id && &id) if (id && strlen(id))
ast_cli(s->fd, "ActionID: %s\r\n",id); ast_cli(s->fd, "ActionID: %s\r\n",id);
if (msg) if (msg)
ast_cli(s->fd, "Message: %s\r\n\r\n", msg); ast_cli(s->fd, "Message: %s\r\n\r\n", msg);
...@@ -321,7 +321,7 @@ static int action_status(struct mansession *s, struct message *m) ...@@ -321,7 +321,7 @@ static int action_status(struct mansession *s, struct message *m)
char bridge[256]; char bridge[256];
astman_send_ack(s, m, "Channel status will follow"); astman_send_ack(s, m, "Channel status will follow");
c = ast_channel_walk(NULL); c = ast_channel_walk(NULL);
if (id && &id) if (id && strlen(id))
snprintf(idText,256,"ActionID: %s\r\n",id); snprintf(idText,256,"ActionID: %s\r\n",id);
while(c) { while(c) {
if (c->bridge) if (c->bridge)
...@@ -468,7 +468,7 @@ static int action_mailboxstatus(struct mansession *s, struct message *m) ...@@ -468,7 +468,7 @@ static int action_mailboxstatus(struct mansession *s, struct message *m)
astman_send_error(s, m, "Mailbox not specified"); astman_send_error(s, m, "Mailbox not specified");
return 0; return 0;
} }
if (id && &id) if (id && strlen(id))
snprintf(idText,256,"ActionID: %s\r\n",id); snprintf(idText,256,"ActionID: %s\r\n",id);
ast_cli(s->fd, "Response: Success\r\n" ast_cli(s->fd, "Response: Success\r\n"
"%s" "%s"
...@@ -489,7 +489,7 @@ static int action_mailboxcount(struct mansession *s, struct message *m) ...@@ -489,7 +489,7 @@ static int action_mailboxcount(struct mansession *s, struct message *m)
return 0; return 0;
} }
ast_app_messagecount(mailbox, &newmsgs, &oldmsgs); ast_app_messagecount(mailbox, &newmsgs, &oldmsgs);
if (id && &id) { if (id && strlen(id)) {
snprintf(idText,256,"ActionID: %s\r\n",id); snprintf(idText,256,"ActionID: %s\r\n",id);
} }
ast_cli(s->fd, "Response: Success\r\n" ast_cli(s->fd, "Response: Success\r\n"
...@@ -519,7 +519,7 @@ static int action_extensionstate(struct mansession *s, struct message *m) ...@@ -519,7 +519,7 @@ static int action_extensionstate(struct mansession *s, struct message *m)
context = "default"; context = "default";
status = ast_extension_state(NULL, context, exten); status = ast_extension_state(NULL, context, exten);
ast_get_hint(hint, sizeof(hint) - 1, NULL, context, exten); ast_get_hint(hint, sizeof(hint) - 1, NULL, context, exten);
if (id && &id) { if (id && strlen(id)) {
snprintf(idText,256,"ActionID: %s\r\n",id); snprintf(idText,256,"ActionID: %s\r\n",id);
} }
ast_cli(s->fd, "Response: Success\r\n" ast_cli(s->fd, "Response: Success\r\n"
...@@ -576,7 +576,7 @@ static int process_message(struct mansession *s, struct message *m) ...@@ -576,7 +576,7 @@ static int process_message(struct mansession *s, struct message *m)
astman_send_error(s, m, "Missing action in request"); astman_send_error(s, m, "Missing action in request");
return 0; return 0;
} }
if (id && *id) { if (id && strlen(id)) {
snprintf(idText,256,"ActionID: %s\r\n",id); snprintf(idText,256,"ActionID: %s\r\n",id);
} }
if (!s->authenticated) { if (!s->authenticated) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment