Merged revisions 130959 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r130959 | tilghman | 2008-07-15 12:19:13 -0500 (Tue, 15 Jul 2008) | 8 lines astman_send_error does not need a newline appended -- the API takes care of that for us. (closes issue #13068) Reported by: gknispel_proformatique Patches: asterisk_1_4_astman_send.patch uploaded by gknispel (license 261) asterisk_trunk_astman_send.patch uploaded by gknispel (license 261) ........ git-svn-id: http://svn.digium.com/svn/asterisk/trunk@131044 f38db490-d61c-443f-a65b-d21fe96a405b
This commit is contained in:
parent
92d86d3780
commit
cdc7f99d9a
|
@ -9338,7 +9338,7 @@ static int manager_list_voicemail_users(struct mansession *s, const struct messa
|
||||||
return RESULT_SUCCESS;
|
return RESULT_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
||||||
astman_send_ack(s, m, "Voicemail user list will follow\r\n");
|
astman_send_ack(s, m, "Voicemail user list will follow");
|
||||||
|
|
||||||
AST_LIST_TRAVERSE(&users, vmu, list) {
|
AST_LIST_TRAVERSE(&users, vmu, list) {
|
||||||
char dirname[256];
|
char dirname[256];
|
||||||
|
|
|
@ -12905,7 +12905,7 @@ static int manager_sip_show_peer(struct mansession *s, const struct message *m)
|
||||||
|
|
||||||
peer = astman_get_header(m, "Peer");
|
peer = astman_get_header(m, "Peer");
|
||||||
if (ast_strlen_zero(peer)) {
|
if (ast_strlen_zero(peer)) {
|
||||||
astman_send_error(s, m, "Peer: <name> missing.\n");
|
astman_send_error(s, m, "Peer: <name> missing.");
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
a[0] = "sip";
|
a[0] = "sip";
|
||||||
|
@ -12951,7 +12951,7 @@ static char *_sip_qualify_peer(int type, int fd, struct mansession *s, const str
|
||||||
} else if (type == 0) {
|
} else if (type == 0) {
|
||||||
ast_cli(fd, "Peer '%s' not found\n", argv[3]);
|
ast_cli(fd, "Peer '%s' not found\n", argv[3]);
|
||||||
} else {
|
} else {
|
||||||
astman_send_error(s, m, "Peer not found\n");
|
astman_send_error(s, m, "Peer not found");
|
||||||
}
|
}
|
||||||
return CLI_SUCCESS;
|
return CLI_SUCCESS;
|
||||||
}
|
}
|
||||||
|
@ -12964,7 +12964,7 @@ static int manager_sip_qualify_peer(struct mansession *s, const struct message *
|
||||||
|
|
||||||
peer = astman_get_header(m, "Peer");
|
peer = astman_get_header(m, "Peer");
|
||||||
if (ast_strlen_zero(peer)) {
|
if (ast_strlen_zero(peer)) {
|
||||||
astman_send_error(s, m, "Peer: <name> missing.\n");
|
astman_send_error(s, m, "Peer: <name> missing.");
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
a[0] = "sip";
|
a[0] = "sip";
|
||||||
|
@ -13036,7 +13036,7 @@ static char *_sip_show_peer(int type, int fd, struct mansession *s, const struct
|
||||||
if (!ast_strlen_zero(id))
|
if (!ast_strlen_zero(id))
|
||||||
astman_append(s, "ActionID: %s\r\n", id);
|
astman_append(s, "ActionID: %s\r\n", id);
|
||||||
} else {
|
} else {
|
||||||
snprintf (cbuf, sizeof(cbuf), "Peer %s not found.\n", argv[3]);
|
snprintf (cbuf, sizeof(cbuf), "Peer %s not found.", argv[3]);
|
||||||
astman_send_error(s, m, cbuf);
|
astman_send_error(s, m, cbuf);
|
||||||
return CLI_SUCCESS;
|
return CLI_SUCCESS;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1971,7 +1971,7 @@ static int action_redirect(struct mansession *s, const struct message *m)
|
||||||
}
|
}
|
||||||
if (!ast_strlen_zero(priority) && (sscanf(priority, "%d", &pi) != 1)) {
|
if (!ast_strlen_zero(priority) && (sscanf(priority, "%d", &pi) != 1)) {
|
||||||
if ((pi = ast_findlabel_extension(NULL, context, exten, priority, NULL)) < 1) {
|
if ((pi = ast_findlabel_extension(NULL, context, exten, priority, NULL)) < 1) {
|
||||||
astman_send_error(s, m, "Invalid priority\n");
|
astman_send_error(s, m, "Invalid priority");
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1984,14 +1984,14 @@ static int action_redirect(struct mansession *s, const struct message *m)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
if (ast_check_hangup(chan)) {
|
if (ast_check_hangup(chan)) {
|
||||||
astman_send_error(s, m, "Redirect failed, channel not up.\n");
|
astman_send_error(s, m, "Redirect failed, channel not up.");
|
||||||
ast_channel_unlock(chan);
|
ast_channel_unlock(chan);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
if (!ast_strlen_zero(name2))
|
if (!ast_strlen_zero(name2))
|
||||||
chan2 = ast_get_channel_by_name_locked(name2);
|
chan2 = ast_get_channel_by_name_locked(name2);
|
||||||
if (chan2 && ast_check_hangup(chan2)) {
|
if (chan2 && ast_check_hangup(chan2)) {
|
||||||
astman_send_error(s, m, "Redirect failed, extra channel not up.\n");
|
astman_send_error(s, m, "Redirect failed, extra channel not up.");
|
||||||
ast_channel_unlock(chan);
|
ast_channel_unlock(chan);
|
||||||
ast_channel_unlock(chan2);
|
ast_channel_unlock(chan2);
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -2039,34 +2039,34 @@ static int action_atxfer(struct mansession *s, const struct message *m)
|
||||||
int priority_int = 0;
|
int priority_int = 0;
|
||||||
|
|
||||||
if (ast_strlen_zero(name)) {
|
if (ast_strlen_zero(name)) {
|
||||||
astman_send_error(s, m, "No channel specified\n");
|
astman_send_error(s, m, "No channel specified");
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
if (ast_strlen_zero(exten)) {
|
if (ast_strlen_zero(exten)) {
|
||||||
astman_send_error(s, m, "No extension specified\n");
|
astman_send_error(s, m, "No extension specified");
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
if (ast_strlen_zero(context)) {
|
if (ast_strlen_zero(context)) {
|
||||||
astman_send_error(s, m, "No context specified\n");
|
astman_send_error(s, m, "No context specified");
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
if (ast_strlen_zero(priority)) {
|
if (ast_strlen_zero(priority)) {
|
||||||
astman_send_error(s, m, "No priority specified\n");
|
astman_send_error(s, m, "No priority specified");
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (sscanf(priority, "%d", &priority_int) != 1 && (priority_int = ast_findlabel_extension(NULL, context, exten, priority, NULL)) < 1) {
|
if (sscanf(priority, "%d", &priority_int) != 1 && (priority_int = ast_findlabel_extension(NULL, context, exten, priority, NULL)) < 1) {
|
||||||
astman_send_error(s, m, "Invalid Priority\n");
|
astman_send_error(s, m, "Invalid Priority");
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!(atxfer_feature = ast_find_call_feature("atxfer"))) {
|
if (!(atxfer_feature = ast_find_call_feature("atxfer"))) {
|
||||||
astman_send_error(s, m, "No attended transfer feature found\n");
|
astman_send_error(s, m, "No attended transfer feature found");
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!(chan = ast_get_channel_by_name_locked(name))) {
|
if (!(chan = ast_get_channel_by_name_locked(name))) {
|
||||||
astman_send_error(s, m, "Channel specified does not exist\n");
|
astman_send_error(s, m, "Channel specified does not exist");
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2080,7 +2080,7 @@ static int action_atxfer(struct mansession *s, const struct message *m)
|
||||||
ast_queue_frame(chan, &f);
|
ast_queue_frame(chan, &f);
|
||||||
}
|
}
|
||||||
|
|
||||||
astman_send_ack(s, m, "Atxfer successfully queued\n");
|
astman_send_ack(s, m, "Atxfer successfully queued");
|
||||||
ast_channel_unlock(chan);
|
ast_channel_unlock(chan);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -2288,19 +2288,19 @@ static int action_originate(struct mansession *s, const struct message *m)
|
||||||
}
|
}
|
||||||
if (!ast_strlen_zero(priority) && (sscanf(priority, "%d", &pi) != 1)) {
|
if (!ast_strlen_zero(priority) && (sscanf(priority, "%d", &pi) != 1)) {
|
||||||
if ((pi = ast_findlabel_extension(NULL, context, exten, priority, NULL)) < 1) {
|
if ((pi = ast_findlabel_extension(NULL, context, exten, priority, NULL)) < 1) {
|
||||||
astman_send_error(s, m, "Invalid priority\n");
|
astman_send_error(s, m, "Invalid priority");
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!ast_strlen_zero(timeout) && (sscanf(timeout, "%d", &to) != 1)) {
|
if (!ast_strlen_zero(timeout) && (sscanf(timeout, "%d", &to) != 1)) {
|
||||||
astman_send_error(s, m, "Invalid timeout\n");
|
astman_send_error(s, m, "Invalid timeout");
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
ast_copy_string(tmp, name, sizeof(tmp));
|
ast_copy_string(tmp, name, sizeof(tmp));
|
||||||
tech = tmp;
|
tech = tmp;
|
||||||
data = strchr(tmp, '/');
|
data = strchr(tmp, '/');
|
||||||
if (!data) {
|
if (!data) {
|
||||||
astman_send_error(s, m, "Invalid channel\n");
|
astman_send_error(s, m, "Invalid channel");
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
*data++ = '\0';
|
*data++ = '\0';
|
||||||
|
|
|
@ -5192,7 +5192,7 @@ static int manager_show_dialplan_helper(struct mansession *s, const struct messa
|
||||||
|
|
||||||
/* try to lock contexts */
|
/* try to lock contexts */
|
||||||
if (ast_rdlock_contexts()) {
|
if (ast_rdlock_contexts()) {
|
||||||
astman_send_error(s, m, "Failed to lock contexts\r\n");
|
astman_send_error(s, m, "Failed to lock contexts");
|
||||||
ast_log(LOG_WARNING, "Failed to lock contexts list for manager: listdialplan\n");
|
ast_log(LOG_WARNING, "Failed to lock contexts list for manager: listdialplan\n");
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
@ -5337,7 +5337,7 @@ static int manager_show_dialplan(struct mansession *s, const struct message *m)
|
||||||
if (context && !counters.context_existence) {
|
if (context && !counters.context_existence) {
|
||||||
char errorbuf[BUFSIZ];
|
char errorbuf[BUFSIZ];
|
||||||
|
|
||||||
snprintf(errorbuf, sizeof(errorbuf), "Did not find context %s\r\n", context);
|
snprintf(errorbuf, sizeof(errorbuf), "Did not find context %s", context);
|
||||||
astman_send_error(s, m, errorbuf);
|
astman_send_error(s, m, errorbuf);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -5345,9 +5345,9 @@ static int manager_show_dialplan(struct mansession *s, const struct message *m)
|
||||||
char errorbuf[BUFSIZ];
|
char errorbuf[BUFSIZ];
|
||||||
|
|
||||||
if (context)
|
if (context)
|
||||||
snprintf(errorbuf, sizeof(errorbuf), "Did not find extension %s@%s\r\n", exten, context);
|
snprintf(errorbuf, sizeof(errorbuf), "Did not find extension %s@%s", exten, context);
|
||||||
else
|
else
|
||||||
snprintf(errorbuf, sizeof(errorbuf), "Did not find extension %s in any context\r\n", exten);
|
snprintf(errorbuf, sizeof(errorbuf), "Did not find extension %s in any context", exten);
|
||||||
astman_send_error(s, m, errorbuf);
|
astman_send_error(s, m, errorbuf);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
Reference in New Issue