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 )
{
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 */