]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
automerge commit
authorAutomerge Script <automerge@asterisk.org>
Mon, 9 Apr 2007 19:52:12 +0000 (19:52 +0000)
committerAutomerge Script <automerge@asterisk.org>
Mon, 9 Apr 2007 19:52:12 +0000 (19:52 +0000)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.2-netsec@61069 65c4cc65-6c06-0410-ace0-fbb531ad65f3

channels/chan_sip.c

index 2d8f85815e16690283074ad1fd36f9db51635eab..eca592bd415dde5e4683e70a421b73ffeff224d5 100644 (file)
@@ -8194,7 +8194,6 @@ static int _sip_show_peer(int type, int fd, struct mansession *s, struct message
 /*! \brief  manager_sip_show_peer: Show SIP peers in the manager API  ---*/
 static int manager_sip_show_peer( struct mansession *s, struct message *m )
 {
-       char *id = astman_get_header(m,"ActionID");
        char *a[4];
        char *peer;
        int ret;
@@ -8209,8 +8208,6 @@ static int manager_sip_show_peer( struct mansession *s, struct message *m )
        a[2] = "peer";
        a[3] = peer;
 
-       if (!ast_strlen_zero(id))
-               ast_cli(s->fd, "ActionID: %s\r\n",id);
        ret = _sip_show_peer(1, s->fd, s, m, 4, a );
        ast_cli( s->fd, "\r\n\r\n" );
        return ret;
@@ -8242,9 +8239,13 @@ static int _sip_show_peer(int type, int fd, struct mansession *s, struct message
        load_realtime = (argc == 5 && !strcmp(argv[4], "load")) ? 1 : 0;
        peer = find_peer(argv[3], NULL, load_realtime);
        if (s) {        /* Manager */
-               if (peer)
+               if (peer) {
+                       char *id = astman_get_header(m,"ActionID");
+
                        ast_cli(s->fd, "Response: Success\r\n");
-               else {
+                       if (!ast_strlen_zero(id))
+                               ast_cli(s->fd, "ActionID: %s\r\n",id);
+               } else {
                        snprintf (cbuf, sizeof(cbuf), "Peer %s not found.\n", argv[3]);
                        astman_send_error(s, m, cbuf);
                        return 0;
@@ -8351,7 +8352,7 @@ static int _sip_show_peer(int type, int fd, struct mansession *s, struct message
                print_group(fd, peer->pickupgroup, 1);
                ast_cli(fd, "VoiceMailbox: %s\r\n", peer->mailbox);
                ast_cli(fd, "LastMsgsSent: %d\r\n", peer->lastmsgssent);
-               ast_cli(fd, "Call limit: %d\r\n", peer->call_limit);
+               ast_cli(fd, "Call-limit: %d\r\n", peer->call_limit);
                ast_cli(fd, "Dynamic: %s\r\n", (ast_test_flag(&peer->flags_page2, SIP_PAGE2_DYNAMIC)?"Y":"N"));
                ast_cli(fd, "Callerid: %s\r\n", ast_callerid_merge(cbuf, sizeof(cbuf), peer->cid_name, peer->cid_num, ""));
                ast_cli(fd, "RegExpire: %ld seconds\r\n", ast_sched_when(sched,peer->expire));