2 * Asterisk -- A telephony toolkit for Linux.
6 * Copyright (C) 1999, Mark Spencer
8 * Mark Spencer <markster@linux-support.net>
10 * This program is free software, distributed under the terms of
11 * the GNU General Public License
14 #include <asterisk/file.h>
15 #include <asterisk/logger.h>
16 #include <asterisk/channel.h>
17 #include <asterisk/pbx.h>
25 static pthread_mutex_t skellock = PTHREAD_MUTEX_INITIALIZER;
29 static char *tdesc = "Trivial skeleton Application";
31 static char *app = "skel";
34 struct ast_channel *chan;
35 struct skeluser *next;
38 static int skel_exec(struct ast_channel *chan, void *data)
41 struct skeluser *u, *ul=NULL;
43 ast_log(LOG_WARNING, "skel requires an argument (filename)\n");
46 if (!(u=malloc(sizeof(struct skeluser)))) {
47 ast_log(LOG_WARNING, "Out of memory\n");
50 pthread_mutex_lock(&skellock);
55 pthread_mutex_unlock(&skellock);
56 /* Do our thing here */
57 pthread_mutex_lock(&skellock);
67 pthread_mutex_unlock(&skellock);
71 int unload_module(void)
74 pthread_mutex_lock(&skellock);
77 /* Hang up anybody who is using us */
78 ast_softhangup(u->chan);
81 pthread_mutex_unlock(&skellock);
82 return ast_unregister_application(app);
87 return ast_register_application(app, skel_exec);
90 char *description(void)
98 pthread_mutex_lock(&skellock);
100 pthread_mutex_unlock(&skellock);