Select Git revision
astman.c 18.60 KiB
/*
* Asterisk -- An open source telephony toolkit.
*
* Copyright (C) 1999 - 2005, Digium, Inc.
*
* Mark Spencer <markster@digium.com>
*
* See http://www.asterisk.org for more information about
* the Asterisk project. Please do not directly contact
* any of the maintainers of this project for assistance;
* the project provides a web site, mailing lists and IRC
* channels for your use.
*
* This program is free software, distributed under the terms of
* the GNU General Public License Version 2. See the LICENSE file
* at the top of the source tree.
*/
/*
*
* ASTerisk MANager
*
*/
#include "asterisk/autoconfig.h"
#include <newt.h>
#include <stdio.h>
#include <sys/time.h>
#include <netdb.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <sys/socket.h>
#include <sys/select.h>
#include <fcntl.h>
#include <string.h>
#include <stdio.h>
#include <errno.h>
#include <unistd.h>
#include <stdlib.h>
#include "asterisk/md5.h"
#include "asterisk/manager.h"
#include "asterisk/linkedlists.h"
#undef gethostbyname
#define MAX_HEADERS 80
#define MAX_LEN 256
/*
* 2005.05.27 - different versions of newt define the type of the buffer
* for the 5th argument to newtEntry() as char ** or const char ** . To
* let the code compile cleanly with -Werror, we cast it to void * through
* _NEWT_CAST.
*/
#define _NEWT_CAST (void *)
static struct ast_mansession {
struct sockaddr_in sin;
int fd;
char inbuf[MAX_LEN];
int inlen;
} session;
struct ast_chan {
char name[80];
char exten[20];
char context[20];
char priority[20];