]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
astman_send_error does not need a newline appended -- the API takes care of
authorTilghman Lesher <tilghman@meg.abyt.es>
Tue, 15 Jul 2008 17:19:13 +0000 (17:19 +0000)
committerTilghman Lesher <tilghman@meg.abyt.es>
Tue, 15 Jul 2008 17:19:13 +0000 (17:19 +0000)
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: https://origsvn.digium.com/svn/asterisk/branches/1.4@130959 65c4cc65-6c06-0410-ace0-fbb531ad65f3

channels/chan_sip.c
main/manager.c

index 48053755729f6a2fd62f61b8bd5c6aa2d3157f68..244b4f48f37fedc7a6278d731c049e795ec5f617 100644 (file)
@@ -10420,7 +10420,7 @@ static int manager_sip_show_peer(struct mansession *s, const struct message *m)
 
        peer = astman_get_header(m,"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;
        }
        a[0] = "sip";
@@ -10469,7 +10469,7 @@ static int _sip_show_peer(int type, int fd, struct mansession *s, const struct m
                        if (!ast_strlen_zero(id))
                                astman_append(s, "ActionID: %s\r\n",id);
                } 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);
                        return 0;
                }
index e5ed35f228ee38c5f34d537ccfb298c2223a6917..177e3e8f1edd24f359fca1f963196d57043d0c3e 100644 (file)
@@ -1637,7 +1637,7 @@ static int action_redirect(struct mansession *s, const struct message *m)
        }
        if (!ast_strlen_zero(priority) && (sscanf(priority, "%d", &pi) != 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;
                }
        }
@@ -1650,14 +1650,14 @@ static int action_redirect(struct mansession *s, const struct message *m)
                return 0;
        }
        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);
                return 0;
        }
        if (!ast_strlen_zero(name2))
                chan2 = ast_get_channel_by_name_locked(name2);
        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(chan2);
                return 0;
@@ -1869,19 +1869,19 @@ static int action_originate(struct mansession *s, const struct message *m)
        }
        if (!ast_strlen_zero(priority) && (sscanf(priority, "%d", &pi) != 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;
                }
        }
        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;
        }
        ast_copy_string(tmp, name, sizeof(tmp));
        tech = tmp;
        data = strchr(tmp, '/');
        if (!data) {
-               astman_send_error(s, m, "Invalid channel\n");
+               astman_send_error(s, m, "Invalid channel");
                return 0;
        }
        *data++ = '\0';