ensure CLI commands produce proper terminating output when used with manager interfac...
authorKevin P. Fleming <kpfleming@digium.com>
Thu, 9 Jun 2005 19:34:12 +0000 (19:34 +0000)
committerKevin P. Fleming <kpfleming@digium.com>
Thu, 9 Jun 2005 19:34:12 +0000 (19:34 +0000)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@5884 65c4cc65-6c06-0410-ace0-fbb531ad65f3

apps/app_queue.c
channels/chan_iax2.c

index c4f2de1..49662f3 100755 (executable)
@@ -3152,9 +3152,13 @@ static char *complete_queue(char *line, char *word, int pos, int state)
 static int manager_queues_show( struct mansession *s, struct message *m )
 {
        char *a[] = { "show", "queues" };
-       return queues_show(s->fd, 2, a);
-} 
+       ast_mutex_lock(&s->lock);
+       queues_show(s->fd, 2, a);
+       ast_cli(s->fd, "\r\n\r\n");     /* Properly terminate Manager output */
+       ast_mutex_unlock(&s->lock);
 
+       return RESULT_SUCCESS;
+} 
 
 /* Dump queue status */
 static int manager_queues_status( struct mansession *s, struct message *m )
index 8c1b9c8..d8e3df5 100755 (executable)
@@ -4222,8 +4222,10 @@ static int manager_iax2_show_peers( struct mansession *s, struct message *m )
 {
        char *a[] = { "iax2", "show", "users" };
        int ret;
+       ast_mutex_lock(&s->lock);
        ret = iax2_show_peers( s->fd, 3, a );
-       ast_cli( s->fd, "\r\n" );
+       ast_cli( s->fd, "\r\n\r\n" );
+       ast_mutex_unlock(&s->lock);
        return ret;
 } /* /JDG */