2 * Asterisk -- A telephony toolkit for Linux.
4 * Top level source file for asterisk
6 * Copyright (C) 1999, Adtran Inc. and Linux Support Services, LLC
8 * Mark Spencer <markster@linux-support.net>
10 * This program is free software, distributed under the terms of
11 * the GNU General Public License
16 #include <asterisk/logger.h>
17 #include <asterisk/options.h>
27 static void urg_handler(int num)
29 /* Called by soft_hangup to interrupt the select, read, or other
30 system call. We don't actually need to do anything though. */
32 ast_log(LOG_DEBUG, "Urgent handler\n");
36 static void quit_handler(int num)
40 ast_verbose("Asterisk ending (%d).\n", num);
41 else if (option_debug)
42 ast_log(LOG_DEBUG, "Asterisk ending (%d).\n", num);
46 int main(int argc, char *argv[])
49 /* Check if we're root */
51 ast_log(LOG_ERROR, "Must be run as root\n");
54 /* Check for options */
55 while((c=getopt(argc, argv, "dvq")) != EOF) {
72 /* Print a welcome message if desired */
74 ast_verbose( "Asterisk, Copyright (C) 1999 Adtran, Inc. and Linux Support Services, LLC\n");
75 ast_verbose( "Written by Mark Spencer <markster@linux-support.net>\n");
76 ast_verbose( "=========================================================================\n");
78 signal(SIGURG, urg_handler);
79 signal(SIGINT, quit_handler);
80 signal(SIGTERM, quit_handler);
81 signal(SIGHUP, quit_handler);
88 /* We might have the option of showing a console, but for now just
91 ast_verbose( "Asterisk Ready.\n");
92 select(0,NULL,NULL,NULL,NULL);