aboutsummaryrefslogtreecommitdiffstats
path: root/1.2-netsec/include
diff options
context:
space:
mode:
Diffstat (limited to '1.2-netsec/include')
-rw-r--r--1.2-netsec/include/asterisk.h127
-rw-r--r--1.2-netsec/include/asterisk/acl.h56
-rw-r--r--1.2-netsec/include/asterisk/adsi.h353
-rw-r--r--1.2-netsec/include/asterisk/aes.h170
-rw-r--r--1.2-netsec/include/asterisk/agi.h56
-rw-r--r--1.2-netsec/include/asterisk/alaw.h43
-rw-r--r--1.2-netsec/include/asterisk/app.h351
-rw-r--r--1.2-netsec/include/asterisk/ast_expr.h32
-rw-r--r--1.2-netsec/include/asterisk/astdb.h52
-rw-r--r--1.2-netsec/include/asterisk/astmm.h79
-rw-r--r--1.2-netsec/include/asterisk/astobj.h752
-rw-r--r--1.2-netsec/include/asterisk/astosp.h48
-rw-r--r--1.2-netsec/include/asterisk/callerid.h306
-rw-r--r--1.2-netsec/include/asterisk/causes.h82
-rw-r--r--1.2-netsec/include/asterisk/cdr.h297
-rw-r--r--1.2-netsec/include/asterisk/channel.h1207
-rw-r--r--1.2-netsec/include/asterisk/chanspy.h140
-rw-r--r--1.2-netsec/include/asterisk/chanvars.h42
-rw-r--r--1.2-netsec/include/asterisk/cli.h111
-rw-r--r--1.2-netsec/include/asterisk/compat.h97
-rw-r--r--1.2-netsec/include/asterisk/compiler.h33
-rw-r--r--1.2-netsec/include/asterisk/config.h194
-rw-r--r--1.2-netsec/include/asterisk/crypto.h112
-rw-r--r--1.2-netsec/include/asterisk/devicestate.h104
-rw-r--r--1.2-netsec/include/asterisk/dlfcn-compat.h88
-rw-r--r--1.2-netsec/include/asterisk/dns.h39
-rw-r--r--1.2-netsec/include/asterisk/dnsmgr.h44
-rw-r--r--1.2-netsec/include/asterisk/doxyref.h449
-rw-r--r--1.2-netsec/include/asterisk/dsp.h111
-rw-r--r--1.2-netsec/include/asterisk/dundi.h226
-rw-r--r--1.2-netsec/include/asterisk/endian.h65
-rw-r--r--1.2-netsec/include/asterisk/enum.h57
-rw-r--r--1.2-netsec/include/asterisk/features.h95
-rw-r--r--1.2-netsec/include/asterisk/file.h318
-rw-r--r--1.2-netsec/include/asterisk/frame.h484
-rw-r--r--1.2-netsec/include/asterisk/fskmodem.h72
-rw-r--r--1.2-netsec/include/asterisk/image.h96
-rw-r--r--1.2-netsec/include/asterisk/indications.h87
-rw-r--r--1.2-netsec/include/asterisk/inline_api.h66
-rw-r--r--1.2-netsec/include/asterisk/io.h145
-rw-r--r--1.2-netsec/include/asterisk/linkedlists.h443
-rw-r--r--1.2-netsec/include/asterisk/localtime.h34
-rw-r--r--1.2-netsec/include/asterisk/lock.h660
-rw-r--r--1.2-netsec/include/asterisk/logger.h126
-rw-r--r--1.2-netsec/include/asterisk/manager.h172
-rw-r--r--1.2-netsec/include/asterisk/md5.h40
-rw-r--r--1.2-netsec/include/asterisk/module.h419
-rw-r--r--1.2-netsec/include/asterisk/monitor.h56
-rw-r--r--1.2-netsec/include/asterisk/musiconhold.h47
-rw-r--r--1.2-netsec/include/asterisk/netsock.h68
-rw-r--r--1.2-netsec/include/asterisk/options.h66
-rw-r--r--1.2-netsec/include/asterisk/pbx.h665
-rw-r--r--1.2-netsec/include/asterisk/plc.h161
-rw-r--r--1.2-netsec/include/asterisk/poll-compat.h111
-rw-r--r--1.2-netsec/include/asterisk/privacy.h46
-rw-r--r--1.2-netsec/include/asterisk/res_odbc.h62
-rw-r--r--1.2-netsec/include/asterisk/rtp.h172
-rw-r--r--1.2-netsec/include/asterisk/say.h102
-rw-r--r--1.2-netsec/include/asterisk/sched.h160
-rw-r--r--1.2-netsec/include/asterisk/slinfactory.h56
-rw-r--r--1.2-netsec/include/asterisk/srv.h47
-rw-r--r--1.2-netsec/include/asterisk/strings.h251
-rw-r--r--1.2-netsec/include/asterisk/tdd.h82
-rw-r--r--1.2-netsec/include/asterisk/term.h74
-rw-r--r--1.2-netsec/include/asterisk/time.h143
-rw-r--r--1.2-netsec/include/asterisk/transcap.h42
-rw-r--r--1.2-netsec/include/asterisk/translate.h120
-rw-r--r--1.2-netsec/include/asterisk/ulaw.h43
-rw-r--r--1.2-netsec/include/asterisk/unaligned.h102
-rw-r--r--1.2-netsec/include/asterisk/utils.h238
-rw-r--r--1.2-netsec/include/asterisk/vmodem.h184
-rw-r--r--1.2-netsec/include/solaris-compat/compat.h46
-rw-r--r--1.2-netsec/include/solaris-compat/sys/cdefs.h10
-rw-r--r--1.2-netsec/include/solaris-compat/sys/queue.h540
74 files changed, 0 insertions, 12874 deletions
diff --git a/1.2-netsec/include/asterisk.h b/1.2-netsec/include/asterisk.h
deleted file mode 100644
index 68f17ea5f..000000000
--- a/1.2-netsec/include/asterisk.h
+++ /dev/null
@@ -1,127 +0,0 @@
-/*
- * Asterisk -- A telephony toolkit for Linux.
- *
- * General Definitions for Asterisk top level program
- *
- * Copyright (C) 1999-2005, Mark Spencer
- *
- * Mark Spencer <markster@digium.com>
- *
- * This program is free software, distributed under the terms of
- * the GNU General Public License
- */
-
-/*! \file
- * \brief Asterisk main include file. File version handling, generic pbx functions.
- */
-
-#ifndef _ASTERISK_H
-#define _ASTERISK_H
-
-#define DEFAULT_LANGUAGE "en"
-
-#define AST_CONFIG_MAX_PATH 255
-
-/* provided in asterisk.c */
-extern char ast_config_AST_CONFIG_DIR[AST_CONFIG_MAX_PATH];
-extern char ast_config_AST_CONFIG_FILE[AST_CONFIG_MAX_PATH];
-extern char ast_config_AST_MODULE_DIR[AST_CONFIG_MAX_PATH];
-extern char ast_config_AST_SPOOL_DIR[AST_CONFIG_MAX_PATH];
-extern char ast_config_AST_MONITOR_DIR[AST_CONFIG_MAX_PATH];
-extern char ast_config_AST_VAR_DIR[AST_CONFIG_MAX_PATH];
-extern char ast_config_AST_LOG_DIR[AST_CONFIG_MAX_PATH];
-extern char ast_config_AST_AGI_DIR[AST_CONFIG_MAX_PATH];
-extern char ast_config_AST_DB[AST_CONFIG_MAX_PATH];
-extern char ast_config_AST_KEY_DIR[AST_CONFIG_MAX_PATH];
-extern char ast_config_AST_PID[AST_CONFIG_MAX_PATH];
-extern char ast_config_AST_SOCKET[AST_CONFIG_MAX_PATH];
-extern char ast_config_AST_RUN_DIR[AST_CONFIG_MAX_PATH];
-extern char ast_config_AST_CTL_PERMISSIONS[AST_CONFIG_MAX_PATH];
-extern char ast_config_AST_CTL_OWNER[AST_CONFIG_MAX_PATH];
-extern char ast_config_AST_CTL_GROUP[AST_CONFIG_MAX_PATH];
-extern char ast_config_AST_CTL[AST_CONFIG_MAX_PATH];
-
-/* Provided by asterisk.c */
-int ast_set_priority(int);
-/* Provided by module.c */
-int load_modules(const int preload_only);
-/* Provided by pbx.c */
-int load_pbx(void);
-/* Provided by logger.c */
-int init_logger(void);
-void close_logger(void);
-/* Provided by frame.c */
-int init_framer(void);
-/* Provided by logger.c */
-int reload_logger(int);
-/* Provided by term.c */
-int term_init(void);
-/* Provided by db.c */
-int astdb_init(void);
-/* Provided by channel.c */
-void ast_channels_init(void);
-/* Provided by dnsmgr.c */
-int dnsmgr_init(void);
-void dnsmgr_start_refresh(void);
-void dnsmgr_reload(void);
-
-/*!
- * \brief Register the version of a source code file with the core.
- * \param file the source file name
- * \param version the version string (typically a CVS revision keyword string)
- * \return nothing
- *
- * This function should not be called directly, but instead the
- * ASTERISK_FILE_VERSION macro should be used to register a file with the core.
- */
-void ast_register_file_version(const char *file, const char *version);
-
-/*!
- * \brief Unregister a source code file from the core.
- * \param file the source file name
- * \return nothing
- *
- * This function should not be called directly, but instead the
- * ASTERISK_FILE_VERSION macro should be used to automatically unregister
- * the file when the module is unloaded.
- */
-void ast_unregister_file_version(const char *file);
-
-/*!
- * \brief Register/unregister a source code file with the core.
- * \param file the source file name
- * \param version the version string (typically a CVS revision keyword string)
- *
- * This macro will place a file-scope constructor and destructor into the
- * source of the module using it; this will cause the version of this file
- * to registered with the Asterisk core (and unregistered) at the appropriate
- * times.
- *
- * Example:
- *
- * \code
- * ASTERISK_FILE_VERSION(__FILE__, "\$Revision\$")
- * \endcode
- *
- * \note The dollar signs above have been protected with backslashes to keep
- * SVN from modifying them in this file; under normal circumstances they would
- * not be present and SVN would expand the Revision keyword into the file's
- * revision number.
- */
-#if defined(__GNUC__) && !defined(LOW_MEMORY)
-#define ASTERISK_FILE_VERSION(file, version) \
- static void __attribute__((constructor)) __register_file_version(void) \
- { \
- ast_register_file_version(file, version); \
- } \
- static void __attribute__((destructor)) __unregister_file_version(void) \
- { \
- ast_unregister_file_version(file); \
- }
-#elif !defined(LOW_MEMORY) /* ! __GNUC__ && ! LOW_MEMORY*/
-#define ASTERISK_FILE_VERSION(file, x) static const char __file_version[] = x;
-#else /* LOW_MEMORY */
-#define ASTERISK_FILE_VERSION(file, x)
-#endif /* __GNUC__ */
-
-#endif /* _ASTERISK_H */
diff --git a/1.2-netsec/include/asterisk/acl.h b/1.2-netsec/include/asterisk/acl.h
deleted file mode 100644
index ad946d57e..000000000
--- a/1.2-netsec/include/asterisk/acl.h
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- * 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.
- */
-
-/*! \file
- * \brief Access Control of various sorts
- */
-
-#ifndef _ASTERISK_ACL_H
-#define _ASTERISK_ACL_H
-
-
-#if defined(__cplusplus) || defined(c_plusplus)
-extern "C" {
-#endif
-
-#include <netinet/in.h>
-#include "asterisk/io.h"
-
-#define AST_SENSE_DENY 0
-#define AST_SENSE_ALLOW 1
-
-/* Host based access control */
-
-struct ast_ha;
-
-extern void ast_free_ha(struct ast_ha *ha);
-extern struct ast_ha *ast_append_ha(char *sense, char *stuff, struct ast_ha *path);
-extern int ast_apply_ha(struct ast_ha *ha, struct sockaddr_in *sin);
-extern int ast_get_ip(struct sockaddr_in *sin, const char *value);
-extern int ast_get_ip_or_srv(struct sockaddr_in *sin, const char *value, const char *service);
-extern int ast_ouraddrfor(struct in_addr *them, struct in_addr *us);
-extern int ast_lookup_iface(char *iface, struct in_addr *address);
-extern struct ast_ha *ast_duplicate_ha_list(struct ast_ha *original);
-extern int ast_find_ourip(struct in_addr *ourip, struct sockaddr_in bindaddr);
-extern int ast_str2tos(const char *value, int *tos);
-
-#if defined(__cplusplus) || defined(c_plusplus)
-}
-#endif
-
-#endif /* _ASTERISK_ACL_H */
diff --git a/1.2-netsec/include/asterisk/adsi.h b/1.2-netsec/include/asterisk/adsi.h
deleted file mode 100644
index c38d2b76e..000000000
--- a/1.2-netsec/include/asterisk/adsi.h
+++ /dev/null
@@ -1,353 +0,0 @@
-/*
- * 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.
- */
-
-/*! \file
- * \brief ADSI Support (built upon Caller*ID)
- */
-
-#ifndef _ASTERISK_ADSI_H
-#define _ASTERISK_ADSI_H
-
-#include "asterisk/callerid.h"
-
-/* ADSI Message types */
-#define ADSI_MSG_DISPLAY 132
-#define ADSI_MSG_DOWNLOAD 133
-
-/* ADSI Parameters (display) */
-#define ADSI_LOAD_SOFTKEY 128
-#define ADSI_INIT_SOFTKEY_LINE 129
-#define ADSI_LOAD_VIRTUAL_DISP 130
-#define ADSI_LINE_CONTROL 131
-#define ADSI_INFORMATION 132
-#define ADSI_DISC_SESSION 133
-#define ADSI_SWITCH_TO_DATA 134
-#define ADSI_SWITCH_TO_VOICE 135
-#define ADSI_CLEAR_SOFTKEY 136
-#define ADSI_INPUT_CONTROL 137
-#define ADSI_INPUT_FORMAT 138
-#define ADSI_SWITCH_TO_PERIPH 139
-#define ADSI_MOVE_DATA 140
-#define ADSI_LOAD_DEFAULT 141
-#define ADSI_CONNECT_SESSION 142
-#define ADSI_CLEAR_TYPE_AHEAD 143
-#define ADSI_DISPLAY_CALL_BUF 144
-#define ADSI_CLEAR_CALL_BUF 145
-#define ADSI_SWITCH_TO_ALT 146
-#define ADSI_SWITCH_TO_GRAPHICS 147
-#define ADSI_CLEAR_SCREEN 148
-#define ADSI_QUERY_CONFIG 149
-#define ADSI_QUERY_CPEID 150
-#define ADSI_SWITCH_TO_APP 151
-
-/* Feature download messages */
-#define ADSI_LOAD_SOFTKEY_TABLE 128 /* Conveniently identical to the soft version */
-#define ADSI_LOAD_PREDEF_DISP 129 /* Load predefined display */
-#define ADSI_LOAD_SCRIPT 130
-#define ADSI_DOWNLOAD_CONNECT 131
-#define ADSI_DOWNLOAD_DISC 132
-
-/* Special return string codes */
-#define ADSI_ENCODED_DTMF 0x80 /* Transmit following chars with encoded dtmf */
-#define ADSI_ON_HOOK 0x81 /* Open switch-hook */
-#define ADSI_OFF_HOOK 0x82 /* Close switch-hook */
-#define ADSI_FLASH 0x83 /* Flash switch-hook */
-#define ADSI_DIAL_TONE_DETECT 0x84 /* Wait for dialtone */
-#define ADSI_LINE_NUMBER 0x85 /* Send current line number using DTMF/encoded DTMF */
-#define ADSI_BLANK 0x86 /* Blank (does nothing) */
-#define ADSI_SEND_CHARS 0x87 /* Send collected digits/characters */
-#define ADSI_CLEAR_CHARS 0x88 /* Clear characters/digits collected */
-#define ADSI_BACKSPACE 0x89 /* Erase last collected digit */
-#define ADSI_TAB_COLUMN 0x8A /* Display specified display column of current line */
-#define ADSI_GOTO_LINE 0x8B /* Go to given page and line number */
-#define ADSI_GOTO_LINE_REL 0x8C /* Go to given line (relative to current) */
-#define ADSI_PAGE_UP 0x8D /* Go up one page */
-#define ADSI_PAGE_DOWN 0x8E /* Go down one page */
-#define ADSI_EXTENDED_DTMF 0x8F /* Send DTMF tones for 250ms instead of 60 ms */
-#define ADSI_DELAY 0x90 /* Delay for given # (times 10) of ms */
-#define ADSI_DIAL_PULSE_ONE 0x91 /* Send a dial pulse "1" */
-#define ADSI_SWITCH_TO_DATA2 0x92 /* Switch CPE to data mode */
-#define ADSI_SWITCH_TO_VOICE2 0x93 /* Switch CPE to voice mode */
-#define ADSI_DISP_CALL_BUF 0x94 /* Display specified call buffer */
-#define ADSI_CLEAR_CALL_B 0x95 /* Clear specified call buffer */
-
-#ifdef __ADSI_CPE
-/* These messages are reserved for the ADSI CPE only */
-#define ADSI_DISPLAY_CONTROL 0x98 /* Store predefined display identified next / Display status display page */
-#define ADSI_DISPLAY_SOFT_KEYS 0x99 /* Display the script soft keys identified next */
-#define ADSI_CHANGE_STATE 0x9A /* Change state of service script */
-#define ADSI_START_CLEAR_TIMER 0x9B /* Start / Clear timer */
-#define ADSI_SET_SCRIPT_FLAG 0x9C /* Set / clear a script flag */
-#define ADSI_JUMP_TO_SUBSCRIPT 0x9D /* Jump to specified subscript */
-#define ADSI_EVENT_22_TRIGGER 0x9E /* Trigger an occurance of event 22 */
-#define ADSI_EVENT_23_TRIGGER 0x9f /* Trigger an occurance of event 23 */
-#define ADSI_EXIT 0xA0 /* Exit the service script interpreter */
-#endif
-
-/* Display pages */
-#define ADSI_INFO_PAGE 0x0
-#define ADSI_COMM_PAGE 0x1
-
-#define ADSI_KEY_APPS 16 /* 16 to 33 reserved for applications */
-
-/* Justification */
-#define ADSI_JUST_LEFT 0x2
-#define ADSI_JUST_RIGHT 0x1
-#define ADSI_JUST_CENT 0x0 /* Center */
-#define ADSI_JUST_IND 0x3 /* Indent */
-
-#define ADSI_KEY_SKT 0x80 /* Load from SKT */
-#define ADSI_KEY_HILITE 0x40 /* Highlight key */
-
-#define ADSI_DIR_FROM_LEFT (0)
-#define ADSI_DIR_FROM_RIGHT (1)
-
-/*! Perform Asterisk ADSI initialization (for channel drivers that want */
-/* to support ADSI when the handset is first lifted) */
-/*!
- * \param chan Channel to initialize for ADSI (if supported)
- *
- * Returns 0 on success (or adsi unavailable) and -1 on hangup
- *
- */
-extern int adsi_channel_init(struct ast_channel *chan);
-
-extern int adsi_begin_download(struct ast_channel *chan, char *service, unsigned char *fdn, unsigned char *sec, int version);
-
-extern int adsi_end_download(struct ast_channel *chan);
-
-/*! Restore ADSI initialization (for applications that play with ADSI */
-/* and want to restore it to normal. If you touch "INFO" then you */
-/* have to use the adsi_channel_init again instead. */
-/*!
- * \param chan Channel to restore
- *
- * Returns 0 on success (or adsi unavailable) and -1 on hangup
- *
- */
-extern int adsi_channel_restore(struct ast_channel *chan);
-
-/*! Display some stuff on the screen */
-/*!
- * \param chan Channel to display on
- * \param lines NULL-terminated list of things to print (no more than 4 recommended)
- * \param align list of alignments to use (ADSI_JUST_LEFT, ADSI_JUST_RIGHT, ADSI_JUST_CEN, etc..)
- * \param voice whether to jump into voice mode when finished
- *
- * Return 0 on success (or adsi unavailable) and -1 on hangup
- *
- */
-extern int adsi_print(struct ast_channel *chan, char **lines, int *align, int voice);
-
-/*! Check if scripts for a given app are already loaded. Version may be -1 */
-/* if any version is okay, or 0-255 for a specific version. */
-/*!
- * \param chan Channel to test for loaded app
- * \param app Four character app name (must be unique to your application)
- * \param ver optional version number
- * \param data Non-zero if you want to be put in data mode
- *
- * Returns 0 if scripts is not loaded or not an ADSI CPE. Returns -1
- * on hangup. Returns 1 if script already loaded.
- */
-extern int adsi_load_session(struct ast_channel *chan, unsigned char *app, int ver, int data);
-extern int adsi_unload_session(struct ast_channel *chan);
-
-/* ADSI Layer 2 transmission functions */
-extern int adsi_transmit_messages(struct ast_channel *chan, unsigned char **msg, int *msglen, int *msgtype);
-extern int adsi_transmit_message(struct ast_channel *chan, unsigned char *msg, int msglen, int msgtype);
-extern int adsi_transmit_message_full(struct ast_channel *chan, unsigned char *msg, int msglen, int msgtype, int dowait);
-/*! Read some encoded DTMF data. */
-/*!
- * Returns number of bytes received
- */
-extern int adsi_read_encoded_dtmf(struct ast_channel *chan, unsigned char *buf, int maxlen);
-
-/* ADSI Layer 3 creation functions */
-
-/*! Connects an ADSI Display Session */
-/*!
- * \param buf Character buffer to create parameter in (must have at least 256 free)
- * \param fdn Optional 4 byte Feature Download Number (for loading soft keys)
- * \param ver Optional version number (0-255, or -1 to omit)
- *
- * Returns number of bytes added to buffer or -1 on error.
- *
- */
-
-extern int adsi_connect_session(unsigned char *buf, unsigned char *fdn, int ver);
-
-/*! Build Query CPE ID of equipment */
-/*!
- * Returns number of bytes added to message
- */
-extern int adsi_query_cpeid(unsigned char *buf);
-extern int adsi_query_cpeinfo(unsigned char *buf);
-
-/*! Get CPE ID from an attached ADSI compatible CPE. */
-/*!
- * Returns 1 on success, storing 4 bytes of CPE ID at buf
- * or -1 on hangup, or 0 if there was no hangup but it failed to find the
- * device ID. Returns to voice mode if "voice" is non-zero.
- */
-extern int adsi_get_cpeid(struct ast_channel *chan, unsigned char *cpeid, int voice);
-
-extern int adsi_get_cpeinfo(struct ast_channel *chan, int *width, int *height, int *buttons, int voice);
-
-/*! Begin an ADSI script download */
-/*!
- * \param buf Character buffer to create parameter in (must have at least 256 free)
- * \param service a 1-18 byte name of the feature
- * \param fdn 4 byte Feature Download Number (for loading soft keys)
- * \param sec 4 byte vendor security code
- * \param ver version number (0-255, or -1 to omit)
- *
- * Returns number of bytes added to buffer or -1 on error.
- *
- */
-
-extern int adsi_download_connect(unsigned char *buf, char *service, unsigned char *fdn, unsigned char *sec, int ver);
-
-/*! Disconnects a running session */
-/*!
- * \param buf Character buffer to create parameter in (must have at least 256 free)
- *
- * Returns number of bytes added to buffer or -1 on error.
- *
- */
-extern int adsi_disconnect_session(unsigned char *buf);
-
-/*! Disconnects (and hopefully saves) a downloaded script */
-/*!
- * \param buf Character buffer to create parameter in (must have at least 256 free)
- *
- * Returns number of bytes added to buffer or -1 on error.
- *
- */
-extern int adsi_download_disconnect(unsigned char *buf);
-
-/*! Puts CPE in data mode... */
-/*!
- * \param buf Character buffer to create parameter in (must have at least 256 free)
- *
- * Returns number of bytes added to buffer or -1 on error.
- *
- */
-extern int adsi_data_mode(unsigned char *buf);
-extern int adsi_clear_soft_keys(unsigned char *buf);
-extern int adsi_clear_screen(unsigned char *buf);
-
-/*! Puts CPE in voice mode... */
-/*!
- * \param buf Character buffer to create parameter in (must have at least 256 free)
- * \param when (a time in seconds) to make the switch
- *
- * Returns number of bytes added to buffer or -1 on error.
- *
- */
-extern int adsi_voice_mode(unsigned char *buf, int when);
-
-/*! Returns non-zero if Channel does or might support ADSI */
-/*!
- * \param chan Channel to check
- *
- */
-extern int adsi_available(struct ast_channel *chan);
-
-/*! Loads a line of info into the display */
-/*!
- * \param buf Character buffer to create parameter in (must have at least 256 free)
- * \param page Page to load (ADSI_COMM_PAGE or ADSI_INFO_PAGE)
- * \param line Line number to load (1-4 for Comm page, 1-33 for info page)
- * \param just Line justification (ADSI_JUST_LEFT, ADSI_JUST_RIGHT, ADSI_JUST_CENT, ADSI_JUST_IND)
- * \param wrap Wrap (1 = yes, 0 = no)
- * \param col1 Text to place in first column
- * \param col2 Text to place in second column
- *
- * Returns number of bytes added to buffer or -1 on error.
- *
- */
-
-extern int adsi_display(unsigned char *buf, int page, int line, int just, int wrap, char *col1, char *col2);
-
-/*! Sets the current line and page */
-/*!
- * \param buf Character buffer to create parameter in (must have at least 256 free)
- * \param page Which page (ADSI_COMM_PAGE or ADSI_INFO_PAGE)
- * \param line Line number (1-33 for info page, 1-4 for comm page)
- *
- * Returns number of bytes added to buffer or -1 on error.
- *
- */
-
-extern int adsi_set_line(unsigned char *buf, int page, int line);
-
-/*! Creates "load soft key" parameters */
-/*!
- * \param buf Character buffer to create parameter in (must have at least 256 free)
- * \param key Key code from 2 to 33, for which key we are loading
- * \param llabel Long label for key (1-18 bytes)
- * \param slabel Short label for key (1-7 bytes)
- * \param ret Optional return sequence (NULL for none)
- * \param data whether to put CPE in data mode before sending digits
- *
- * Returns number of bytes added to buffer or -1 on error.
- *
- */
-extern int adsi_load_soft_key(unsigned char *buf, int key, char *llabel, char *slabel, char *ret, int data);
-
-/*! Set which soft keys should be displayed */
-/*!
- * \param buf Character buffer to create parameter in (must have at least 256 free)
- * \param keys Array of 8 unsigned chars with the key numbers, may be OR'd with ADSI_KEY_HILITE
- * But remember, the last two keys aren't real keys, they're for scrolling
- *
- * Returns number of bytes added to buffer or -1 on error.
- *
- */
-extern int adsi_set_keys(unsigned char *buf, unsigned char *keys);
-
-/*! Set input information */
-/*!
- * \param buf Character buffer to create parameter in (must have at least 256 free)
- * \param page Which page to input on (ADSI_COMM_PAGE or ADSI_INFO_PAGE)
- * \param line Line number to input on
- * \param display Set to zero to obscure input, or 1 to leave visible
- * \param format Format number to use (0-7)
- * \param just Justification (left, right center, indent)
- *
- * Returns number of bytes added to buffer or -1 on error.
- *
- */
-extern int adsi_input_control(unsigned char *buf, int page, int line, int display, int format, int just);
-
-/*! Set input format */
-/*!
- * \param buf Character buffer to create parameter in (must have at least 256 free)
- * \param num Which format we are setting
- * \param dir Which direction (ADSI_DIR_FROM_LEFT or ADSI_DIR_FROM_RIGHT)
- * \param wrap Set to 1 to permit line wrap, or 0 if not
- * \param format1 Format for column 1
- * \param format2 Format for column 2
- *
- * Returns number of bytes added to buffer or -1 on error.
- *
- */
-extern int adsi_input_format(unsigned char *buf, int num, int dir, int wrap, char *format1, char *format2);
-
-#endif /* _ASTERISK_ADSI_H */
diff --git a/1.2-netsec/include/asterisk/aes.h b/1.2-netsec/include/asterisk/aes.h
deleted file mode 100644
index af648e8ee..000000000
--- a/1.2-netsec/include/asterisk/aes.h
+++ /dev/null
@@ -1,170 +0,0 @@
-/*
- * Asterisk -- An open source telephony toolkit.
- *
- * 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.
- */
-
-/*
- ---------------------------------------------------------------------------
- Copyright (c) 2003, Dr Brian Gladman <brg@gladman.me.uk>, Worcester, UK.
- All rights reserved.
-
- LICENSE TERMS
-
- The free distribution and use of this software in both source and binary
- form is allowed (with or without changes) provided that:
-
- 1. distributions of this source code include the above copyright
- notice, this list of conditions and the following disclaimer;
-
- 2. distributions in binary form include the above copyright
- notice, this list of conditions and the following disclaimer
- in the documentation and/or other associated materials;
-
- 3. the copyright holder's name is not used to endorse products
- built using this software without specific written permission.
-
- ALTERNATIVELY, provided that this notice is retained in full, this product
- may be distributed under the terms of the GNU General Public License (GPL),
- in which case the provisions of the GPL apply INSTEAD OF those given above.
-
- DISCLAIMER
-
- This software is provided 'as is' with no explicit or implied warranties
- in respect of its properties, including, but not limited to, correctness
- and/or fitness for purpose.
- ---------------------------------------------------------------------------
- Issue Date: 26/08/2003
-*/
-/*!\file
-
- \brief This file contains the definitions required to use AES in C. See aesopt.h
- for optimisation details.
-*/
-
-#ifndef _AES_H
-#define _AES_H
-
-/* This include is used to find 8 & 32 bit unsigned integer types */
-#include "limits.h"
-
-#if defined(__cplusplus)
-extern "C"
-{
-#endif
-
-#define AES_128 /* define if AES with 128 bit keys is needed */
-#undef AES_192 /* define if AES with 192 bit keys is needed */
-#undef AES_256 /* define if AES with 256 bit keys is needed */
-#undef AES_VAR /* define if a variable key size is needed */
-
-/* The following must also be set in assembler files if being used */
-
-#define AES_ENCRYPT /* if support for encryption is needed */
-#define AES_DECRYPT /* if support for decryption is needed */
-#define AES_ERR_CHK /* for parameter checks & error return codes */
-
-#if UCHAR_MAX == 0xff /* an unsigned 8 bit type */
- typedef unsigned char aes_08t;
-#else
-#error Please define aes_08t as an 8-bit unsigned integer type in aes.h
-#endif
-
-#if UINT_MAX == 0xffffffff /* an unsigned 32 bit type */
- typedef unsigned int aes_32t;
-#elif ULONG_MAX == 0xffffffff
- typedef unsigned long aes_32t;
-#else
-#error Please define aes_32t as a 32-bit unsigned integer type in aes.h
-#endif
-
-#define AES_BLOCK_SIZE 16 /* the AES block size in bytes */
-#define N_COLS 4 /* the number of columns in the state */
-
-/* a maximum of 60 32-bit words are needed for the key schedule but */
-/* 64 are claimed to allow space at the top for a CBC xor buffer. */
-/* If this is not needed, this value can be reduced to 60. A value */
-/* of 64 may also help in maintaining alignment in some situations */
-#define KS_LENGTH 64
-
-#ifdef AES_ERR_CHK
-#define aes_ret int
-#define aes_good 0
-#define aes_error -1
-#else
-#define aes_ret void
-#endif
-
-#ifndef AES_DLL /* implement normal/DLL functions */
-#define aes_rval aes_ret
-#else
-#define aes_rval aes_ret __declspec(dllexport) _stdcall
-#endif
-
-/* This routine must be called before first use if non-static */
-/* tables are being used */
-
-void gen_tabs(void);
-
-/* The key length (klen) is input in bytes when it is in the range */
-/* 16 <= klen <= 32 or in bits when in the range 128 <= klen <= 256 */
-
-#ifdef AES_ENCRYPT
-
-typedef struct
-{ aes_32t ks[KS_LENGTH];
-} aes_encrypt_ctx;
-
-#if defined(AES_128) || defined(AES_VAR)
-aes_rval aes_encrypt_key128(const void *in_key, aes_encrypt_ctx cx[1]);
-#endif
-
-#if defined(AES_192) || defined(AES_VAR)
-aes_rval aes_encrypt_key192(const void *in_key, aes_encrypt_ctx cx[1]);
-#endif
-
-#if defined(AES_256) || defined(AES_VAR)
-aes_rval aes_encrypt_key256(const void *in_key, aes_encrypt_ctx cx[1]);
-#endif
-
-#if defined(AES_VAR)
-aes_rval aes_encrypt_key(const void *in_key, int key_len, aes_encrypt_ctx cx[1]);
-#endif
-
-aes_rval aes_encrypt(const void *in_blk, void *out_blk, const aes_encrypt_ctx cx[1]);
-#endif
-
-#ifdef AES_DECRYPT
-
-typedef struct
-{ aes_32t ks[KS_LENGTH];
-} aes_decrypt_ctx;
-
-#if defined(AES_128) || defined(AES_VAR)
-aes_rval aes_decrypt_key128(const void *in_key, aes_decrypt_ctx cx[1]);
-#endif
-
-#if defined(AES_192) || defined(AES_VAR)
-aes_rval aes_decrypt_key192(const void *in_key, aes_decrypt_ctx cx[1]);
-#endif
-
-#if defined(AES_256) || defined(AES_VAR)
-aes_rval aes_decrypt_key256(const void *in_key, aes_decrypt_ctx cx[1]);
-#endif
-
-#if defined(AES_VAR)
-aes_rval aes_decrypt_key(const void *in_key, int key_len, aes_decrypt_ctx cx[1]);
-#endif
-
-aes_rval aes_decrypt(const void *in_blk, void *out_blk, const aes_decrypt_ctx cx[1]);
-#endif
-
-#if defined(__cplusplus)
-}
-#endif
-
-#endif
diff --git a/1.2-netsec/include/asterisk/agi.h b/1.2-netsec/include/asterisk/agi.h
deleted file mode 100644
index 226041173..000000000
--- a/1.2-netsec/include/asterisk/agi.h
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- * 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.
- */
-
-/*! \file
- * \brief AGI Extension interfaces - Asterisk Gateway Interface
- */
-
-#ifndef _ASTERISK_AGI_H
-#define _ASTERISK_AGI_H
-
-#if defined(__cplusplus) || defined(c_plusplus)
-extern "C" {
-#endif
-
-typedef struct agi_state {
- int fd; /* FD for general output */
- int audio; /* FD for audio output */
- int ctrl; /* FD for input control */
-} AGI;
-
-typedef struct agi_command {
- /* Null terminated list of the words of the command */
- char *cmda[AST_MAX_CMD_LEN];
- /* Handler for the command (channel, AGI state, # of arguments, argument list).
- Returns RESULT_SHOWUSAGE for improper arguments */
- int (*handler)(struct ast_channel *chan, AGI *agi, int argc, char *argv[]);
- /* Summary of the command (< 60 characters) */
- char *summary;
- /* Detailed usage information */
- char *usage;
- struct agi_command *next;
-} agi_command;
-
-int agi_register(agi_command *cmd);
-void agi_unregister(agi_command *cmd);
-
-#if defined(__cplusplus) || defined(c_plusplus)
-}
-#endif
-
-#endif /* _ASTERISK_AGI_H */
diff --git a/1.2-netsec/include/asterisk/alaw.h b/1.2-netsec/include/asterisk/alaw.h
deleted file mode 100644
index 6feb07aa2..000000000
--- a/1.2-netsec/include/asterisk/alaw.h
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- * 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.
- */
-
-/*! \file
- * \brief A-Law to Signed linear conversion
- */
-
-#ifndef _ASTERISK_ALAW_H
-#define _ASTERISK_ALAW_H
-
-/*! Init the ulaw conversion stuff */
-/*!
- * To init the ulaw to slinear conversion stuff, this needs to be run.
- */
-extern void ast_alaw_init(void);
-
-/*! converts signed linear to mulaw */
-/*!
- */
-extern unsigned char __ast_lin2a[8192];
-
-/*! help */
-extern short __ast_alaw[256];
-
-#define AST_LIN2A(a) (__ast_lin2a[((unsigned short)(a)) >> 3])
-#define AST_ALAW(a) (__ast_alaw[(int)(a)])
-
-#endif /* _ASTERISK_ALAW_H */
diff --git a/1.2-netsec/include/asterisk/app.h b/1.2-netsec/include/asterisk/app.h
deleted file mode 100644
index 38b1fdb73..000000000
--- a/1.2-netsec/include/asterisk/app.h
+++ /dev/null
@@ -1,351 +0,0 @@
-/*
- * 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.
- */
-
-/*! \file
- * \brief Application convenience functions, designed to give consistent
- look and feel to Asterisk apps.
- */
-
-#ifndef _ASTERISK_APP_H
-#define _ASTERISK_APP_H
-
-#if defined(__cplusplus) || defined(c_plusplus)
-extern "C" {
-#endif
-
-/* IVR stuff */
-
-/*! \brief Callback function for IVR
- \return returns 0 on completion, -1 on hangup or digit if interrupted
- */
-typedef int (*ast_ivr_callback)(struct ast_channel *chan, char *option, void *cbdata);
-
-typedef enum {
- AST_ACTION_UPONE, /*!< adata is unused */
- AST_ACTION_EXIT, /*!< adata is the return value for ast_ivr_menu_run if channel was not hungup */
- AST_ACTION_CALLBACK, /*!< adata is an ast_ivr_callback */
- AST_ACTION_PLAYBACK, /*!< adata is file to play */
- AST_ACTION_BACKGROUND, /*!< adata is file to play */
- AST_ACTION_PLAYLIST, /*!< adata is list of files, separated by ; to play */
- AST_ACTION_MENU, /*!< adata is a pointer to an ast_ivr_menu */
- AST_ACTION_REPEAT, /*!< adata is max # of repeats, cast to a pointer */
- AST_ACTION_RESTART, /*!< adata is like repeat, but resets repeats to 0 */
- AST_ACTION_TRANSFER, /*!< adata is a string with exten[@context] */
- AST_ACTION_WAITOPTION, /*!< adata is a timeout, or 0 for defaults */
- AST_ACTION_NOOP, /*!< adata is unused */
- AST_ACTION_BACKLIST, /*!< adata is list of files separated by ; allows interruption */
-} ast_ivr_action;
-
-/*!
- Special "options" are:
- \arg "s" - "start here (one time greeting)"
- \arg "g" - "greeting/instructions"
- \arg "t" - "timeout"
- \arg "h" - "hangup"
- \arg "i" - "invalid selection"
-
-*/
-struct ast_ivr_option {
- char *option;
- ast_ivr_action action;
- void *adata;
-};
-
-struct ast_ivr_menu {
- char *title; /*!< Title of menu */
- unsigned int flags; /*!< Flags */
- struct ast_ivr_option *options; /*!< All options */
-};
-
-#define AST_IVR_FLAG_AUTORESTART (1 << 0)
-
-#define AST_IVR_DECLARE_MENU(holder, title, flags, foo...) \
- static struct ast_ivr_option __options_##holder[] = foo;\
- static struct ast_ivr_menu holder = { title, flags, __options_##holder }
-
-
-/*! \brief Runs an IVR menu
- \return returns 0 on successful completion, -1 on hangup, or -2 on user error in menu */
-extern int ast_ivr_menu_run(struct ast_channel *c, struct ast_ivr_menu *menu, void *cbdata);
-
-/*! \brief Plays a stream and gets DTMF data from a channel
- * \param c Which channel one is interacting with
- * \param prompt File to pass to ast_streamfile (the one that you wish to play)
- * \param s The location where the DTMF data will be stored
- * \param maxlen Max Length of the data
- * \param timeout Timeout length waiting for data(in milliseconds). Set to 0 for standard timeout(six seconds), or -1 for no time out.
- *
- * This function was designed for application programmers for situations where they need
- * to play a message and then get some DTMF data in response to the message. If a digit
- * is pressed during playback, it will immediately break out of the message and continue
- * execution of your code.
- */
-extern int ast_app_getdata(struct ast_channel *c, char *prompt, char *s, int maxlen, int timeout);
-
-/*! \brief Full version with audiofd and controlfd. NOTE: returns '2' on ctrlfd available, not '1' like other full functions */
-extern int ast_app_getdata_full(struct ast_channel *c, char *prompt, char *s, int maxlen, int timeout, int audiofd, int ctrlfd);
-
-/*! Record voice (after playing prompt if specified), waiting for silence (in ms) up to a given timeout (in s) or '#' */
-int ast_app_getvoice(struct ast_channel *c, char *dest, char *dstfmt, char *prompt, int silence, int maxsec);
-
-void ast_install_vm_functions(int (*has_voicemail_func)(const char *mailbox, const char *folder),
- int (*messagecount_func)(const char *mailbox, int *newmsgs, int *oldmsgs));
-
-void ast_uninstall_vm_functions(void);
-
-/*! Determine if a given mailbox has any voicemail */
-int ast_app_has_voicemail(const char *mailbox, const char *folder);
-
-/*! Determine number of new/old messages in a mailbox */
-int ast_app_messagecount(const char *mailbox, int *newmsgs, int *oldmsgs);
-
-/*! Safely spawn an external program while closing file descriptors
- \note This replaces the \b system call in all Asterisk modules
-*/
-extern int ast_safe_system(const char *s);
-
-/*! Send DTMF to chan (optionally entertain peer) */
-int ast_dtmf_stream(struct ast_channel *chan, struct ast_channel *peer, char *digits, int between);
-
-/*! Stream a filename (or file descriptor) as a generator. */
-int ast_linear_stream(struct ast_channel *chan, const char *filename, int fd, int allowoverride);
-
-/*! Stream a file with fast forward, pause, reverse, restart. */
-int ast_control_streamfile(struct ast_channel *chan, const char *file, const char *fwd, const char *rev, const char *stop, const char *pause, const char *restart, int skipms);
-
-/*! Play a stream and wait for a digit, returning the digit that was pressed */
-int ast_play_and_wait(struct ast_channel *chan, const char *fn);
-
-/*! Record a file for a max amount of time (in seconds), in a given list of formats separated by '|', outputting the duration of the recording, and with a maximum
- \n
- permitted silence time in milliseconds of 'maxsilence' under 'silencethreshold' or use '-1' for either or both parameters for defaults.
- calls ast_unlock_path() on 'path' if passed */
-int ast_play_and_record(struct ast_channel *chan, const char *playfile, const char *recordfile, int maxtime_sec, const char *fmt, int *duration, int silencethreshold, int maxsilence_ms, const char *path);
-
-/*! Record a message and prepend the message to the given record file after
- playing the optional playfile (or a beep), storing the duration in
- 'duration' and with a maximum
-\n
- permitted silence time in milliseconds of 'maxsilence' under
- 'silencethreshold' or use '-1' for either or both parameters for defaults. */
-int ast_play_and_prepend(struct ast_channel *chan, char *playfile, char *recordfile, int maxtime_sec, char *fmt, int *duration, int beep, int silencethreshold, int maxsilence_ms);
-
-enum AST_LOCK_RESULT {
- AST_LOCK_SUCCESS = 0,
- AST_LOCK_TIMEOUT = -1,
- AST_LOCK_PATH_NOT_FOUND = -2,
- AST_LOCK_FAILURE = -3,
-};
-
-/*!
- * \brief Lock a filesystem path.
- * \param path the path to be locked
- * \return one of \ref AST_LOCK_RESULT values
- */
-enum AST_LOCK_RESULT ast_lock_path(const char *path);
-
-/*! Unlock a path */
-int ast_unlock_path(const char *path);
-
-/*! Read a file into asterisk*/
-char *ast_read_textfile(const char *file);
-
-#define GROUP_CATEGORY_PREFIX "GROUP"
-
-/*! Split a group string into group and category, returning a default category if none is provided. */
-int ast_app_group_split_group(char *data, char *group, int group_max, char *category, int category_max);
-
-/*! Set the group for a channel, splitting the provided data into group and category, if specified. */
-int ast_app_group_set_channel(struct ast_channel *chan, char *data);
-
-/*! Get the current channel count of the specified group and category. */
-int ast_app_group_get_count(char *group, char *category);
-
-/*! Get the current channel count of all groups that match the specified pattern and category. */
-int ast_app_group_match_get_count(char *groupmatch, char *category);
-
-/*!
- \brief Define an application argument
- \param name The name of the argument
-*/
-#define AST_APP_ARG(name) char *name
-
-/*!
- \brief Declare a structure to hold the application's arguments.
- \param name The name of the structure
- \param arglist The list of arguments, defined using AST_APP_ARG
-
- This macro defines a structure intended to be used in a call
- to ast_app_separate_args(). The structure includes all the
- arguments specified, plus an argv array that overlays them and an
- argc argument counter. The arguments must be declared using AST_APP_ARG,
- and they will all be character pointers (strings).
-
- \note The structure is <b>not</b> initialized, as the call to
- ast_app_separate_args() will perform that function before parsing
- the arguments.
- */
-#define AST_DECLARE_APP_ARGS(name, arglist) \
- struct { \
- unsigned int argc; \
- char *argv[0]; \
- arglist \
- } name
-
-/*!
- \brief Performs the 'standard' argument separation process for an application.
- \param args An argument structure defined using AST_DECLARE_APP_ARGS
- \param parse A modifiable buffer containing the input to be parsed
-
- This function will separate the input string using the standard argument
- separator character '|' and fill in the provided structure, including
- the argc argument counter field.
- */
-#define AST_STANDARD_APP_ARGS(args, parse) \
- args.argc = ast_app_separate_args(parse, '|', args.argv, (sizeof(args) - sizeof(args.argc)) / sizeof(args.argv[0]))
-
-/*!
- \brief Separate a string into arguments in an array
- \param buf The string to be parsed (this must be a writable copy, as it will be modified)
- \param delim The character to be used to delimit arguments
- \param array An array of 'char *' to be filled in with pointers to the found arguments
- \param arraylen The number of elements in the array (i.e. the number of arguments you will accept)
-
- Note: if there are more arguments in the string than the array will hold, the last element of
- the array will contain the remaining arguments, not separated.
-
- The array will be completely zeroed by this function before it populates any entries.
-
- \return The number of arguments found, or zero if the function arguments are not valid.
-*/
-unsigned int ast_app_separate_args(char *buf, char delim, char **array, int arraylen);
-
-/*!
- \brief A structure to hold the description of an application 'option'.
-
- Application 'options' are single-character flags that can be supplied
- to the application to affect its behavior; they can also optionally
- accept arguments enclosed in parenthesis.
-
- These structures are used by the ast_app_parse_options function, uses
- this data to fill in a flags structure (to indicate which options were
- supplied) and array of argument pointers (for those options that had
- arguments supplied).
- */
-struct ast_app_option {
- /*! \brief The flag bit that represents this option. */
- unsigned int flag;
- /*! \brief The index of the entry in the arguments array
- that should be used for this option's argument. */
- unsigned int arg_index;
-};
-
-/*!
- \brief Declares an array of options for an application.
- \param holder The name of the array to be created
- \param options The actual options to be placed into the array
- \sa ast_app_parse_options
-
- This macro declares a 'static const' array of \c struct \c ast_option
- elements to hold the list of available options for an application.
- Each option must be declared using either the AST_APP_OPTION()
- or AST_APP_OPTION_ARG() macros.
-
- Example usage:
- \code
- enum {
- OPT_JUMP = (1 << 0),
- OPT_BLAH = (1 << 1),
- OPT_BLORT = (1 << 2),
- } my_app_option_flags;
-
- enum {
- OPT_ARG_BLAH = 0,
- OPT_ARG_BLORT,
- !! this entry tells how many possible arguments there are,
- and must be the last entry in the list
- OPT_ARG_ARRAY_SIZE,
- } my_app_option_args;
-
- AST_APP_OPTIONS(my_app_options, {
- AST_APP_OPTION('j', OPT_JUMP),
- AST_APP_OPTION_ARG('b', OPT_BLAH, OPT_ARG_BLAH),
- AST_APP_OPTION_BLORT('B', OPT_BLORT, OPT_ARG_BLORT),
- });
-
- static int my_app_exec(struct ast_channel *chan, void *data)
- {
- char *options;
- struct ast_flags opts = { 0, };
- char *opt_args[OPT_ARG_ARRAY_SIZE];
-
- ... do any argument parsing here ...
-
- if (ast_parseoptions(my_app_options, &opts, opt_args, options)) {
- LOCAL_USER_REMOVE(u);
- return -1;
- }
- }
- \endcode
- */
-#define AST_APP_OPTIONS(holder, options...) \
- static const struct ast_app_option holder[128] = options
-
-/*!
- \brief Declares an application option that does not accept an argument.
- \param option The single character representing the option
- \param flagno The flag index to be set if this option is present
- \sa AST_APP_OPTIONS, ast_app_parse_options
- */
-#define AST_APP_OPTION(option, flagno) \
- [option] = { .flag = flagno }
-
-/*!
- \brief Declares an application option that accepts an argument.
- \param option The single character representing the option
- \param flagno The flag index to be set if this option is present
- \param argno The index into the argument array where the argument should
- be placed
- \sa AST_APP_OPTIONS, ast_app_parse_options
- */
-#define AST_APP_OPTION_ARG(option, flagno, argno) \
- [option] = { .flag = flagno, .arg_index = argno + 1 }
-
-/*!
- \brief Parses a string containing application options and sets flags/arguments.
- \param options The array of possible options declared with AST_APP_OPTIONS
- \param flags The flag structure to have option flags set
- \param args The array of argument pointers to hold arguments found
- \param optstr The string containing the options to be parsed
- \return zero for success, non-zero if an error occurs
- \sa AST_APP_OPTIONS
- */
-int ast_app_parse_options(const struct ast_app_option *options, struct ast_flags *flags, char **args, char *optstr);
-
-/*! \brief Present a dialtone and collect a certain length extension.
- \return Returns 1 on valid extension entered, -1 on hangup, or 0 on invalid extension.
-\note Note that if 'collect' holds digits already, new digits will be appended, so be sure it's initialized properly */
-int ast_app_dtget(struct ast_channel *chan, const char *context, char *collect, size_t size, int maxlen, int timeout);
-
-/*! Allow to record message and have a review option */
-int ast_record_review(struct ast_channel *chan, const char *playfile, const char *recordfile, int maxtime, const char *fmt, int *duration, const char *path);
-
-#if defined(__cplusplus) || defined(c_plusplus)
-}
-#endif
-
-#endif /* _ASTERISK_APP_H */
diff --git a/1.2-netsec/include/asterisk/ast_expr.h b/1.2-netsec/include/asterisk/ast_expr.h
deleted file mode 100644
index bc0331309..000000000
--- a/1.2-netsec/include/asterisk/ast_expr.h
+++ /dev/null
@@ -1,32 +0,0 @@
-/*
- * 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.
- */
-
-#ifndef _ASTERISK_EXPR_H
-#define _ASTERISK_EXPR_H
-
-#if defined(__cplusplus) || defined(c_plusplus)
-extern "C" {
-#endif
-
-int ast_expr(char *expr, char *buf, int length);
-
-#if defined(__cplusplus) || defined(c_plusplus)
-}
-#endif
-
-#endif /* _ASTERISK_EXPR_H */
diff --git a/1.2-netsec/include/asterisk/astdb.h b/1.2-netsec/include/asterisk/astdb.h
deleted file mode 100644
index 828fe9725..000000000
--- a/1.2-netsec/include/asterisk/astdb.h
+++ /dev/null
@@ -1,52 +0,0 @@
-/*
- * 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.
- */
-
-/*! \file
- * \brief Persistant data storage (akin to *doze registry)
- */
-
-#ifndef _ASTERISK_ASTDB_H
-#define _ASTERISK_ASTDB_H
-
-#if defined(__cplusplus) || defined(c_plusplus)
-extern "C" {
-#endif
-
-struct ast_db_entry {
- struct ast_db_entry *next;
- char *key;
- char data[0];
-};
-
-int ast_db_get(const char *family, const char *key, char *out, int outlen);
-
-int ast_db_put(const char *family, const char *key, char *value);
-
-int ast_db_del(const char *family, const char *key);
-
-int ast_db_deltree(const char *family, const char *keytree);
-
-struct ast_db_entry *ast_db_gettree(const char *family, const char *keytree);
-
-void ast_db_freetree(struct ast_db_entry *entry);
-
-#if defined(__cplusplus) || defined(c_plusplus)
-}
-#endif
-
-#endif /* _ASTERISK_ASTDB_H */
diff --git a/1.2-netsec/include/asterisk/astmm.h b/1.2-netsec/include/asterisk/astmm.h
deleted file mode 100644
index 9e70366fa..000000000
--- a/1.2-netsec/include/asterisk/astmm.h
+++ /dev/null
@@ -1,79 +0,0 @@
-/*
- * 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.
- */
-
-/*! \file
- * \brief Asterisk memory usage debugging
- */
-
-#ifndef NO_AST_MM
-#ifndef _ASTERISK_ASTMM_H
-#define _ASTERISK_ASTMM_H
-
-#define __AST_DEBUG_MALLOC
-
-/* Include these now to prevent them from being needed later */
-#include <sys/types.h>
-#include <stdlib.h>
-#include <string.h>
-#include <stdio.h>
-
-/* Undefine any macros */
-#undef malloc
-#undef calloc
-#undef realloc
-#undef strdup
-#undef strndup
-#undef vasprintf
-
-void *__ast_calloc(size_t nmemb, size_t size, const char *file, int lineno, const char *func);
-void *__ast_malloc(size_t size, const char *file, int lineno, const char *func);
-void __ast_free(void *ptr, const char *file, int lineno, const char *func);
-void *__ast_realloc(void *ptr, size_t size, const char *file, int lineno, const char *func);
-char *__ast_strdup(const char *s, const char *file, int lineno, const char *func);
-char *__ast_strndup(const char *s, size_t n, const char *file, int lineno, const char *func);
-int __ast_vasprintf(char **strp, const char *format, va_list ap, const char *file, int lineno, const char *func);
-
-void __ast_mm_init(void);
-
-
-/* Provide our own definitions */
-#define calloc(a,b) \
- __ast_calloc(a,b,__FILE__, __LINE__, __PRETTY_FUNCTION__)
-
-#define malloc(a) \
- __ast_malloc(a,__FILE__, __LINE__, __PRETTY_FUNCTION__)
-
-#define free(a) \
- __ast_free(a,__FILE__, __LINE__, __PRETTY_FUNCTION__)
-
-#define realloc(a,b) \
- __ast_realloc(a,b,__FILE__, __LINE__, __PRETTY_FUNCTION__)
-
-#define strdup(a) \
- __ast_strdup(a,__FILE__, __LINE__, __PRETTY_FUNCTION__)
-
-#define strndup(a,b) \
- __ast_strndup(a,b,__FILE__, __LINE__, __PRETTY_FUNCTION__)
-
-#define vasprintf(a,b,c) \
- __ast_vasprintf(a,b,c,__FILE__, __LINE__, __PRETTY_FUNCTION__)
-
-#else
-#error "NEVER INCLUDE astmm.h DIRECTLY!!"
-#endif /* _ASTERISK_ASTMM_H */
-#endif
diff --git a/1.2-netsec/include/asterisk/astobj.h b/1.2-netsec/include/asterisk/astobj.h
deleted file mode 100644
index 8e373c6c5..000000000
--- a/1.2-netsec/include/asterisk/astobj.h
+++ /dev/null
@@ -1,752 +0,0 @@
-/*
- * 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.
- */
-
-/*
- * Object Model for Asterisk
- */
-
-#ifndef _ASTERISK_ASTOBJ_H
-#define _ASTERISK_ASTOBJ_H
-
-#include <string.h>
-
-#include "asterisk/lock.h"
-#include "asterisk/compiler.h"
-
-/*! \file
- * \brief A set of macros implementing objects and containers.
- * Macros are used for maximum performance, to support multiple inheritance,
- * and to be easily integrated into existing structures without additional
- * malloc calls, etc.
- *
- * These macros expect to operate on two different object types, ASTOBJs and
- * ASTOBJ_CONTAINERs. These are not actual types, as any struct can be
- * converted into an ASTOBJ compatible object or container using the supplied
- * macros.
- *
- * <b>Sample Usage:</b>
- * \code
- * struct sample_object {
- * ASTOBJ_COMPONENTS(struct sample_object);
- * };
- *
- * struct sample_container {
- * ASTOBJ_CONTAINER_COMPONENTS(struct sample_object);
- * } super_container;
- *
- * void sample_object_destroy(struct sample_object *obj)
- * {
- * free(obj);
- * }
- *
- * int init_stuff()
- * {
- * struct sample_object *obj1;
- * struct sample_object *found_obj;
- *
- * obj1 = malloc(sizeof(struct sample_object));
- *
- * ASTOBJ_CONTAINER_INIT(&super_container);
- *
- * ASTOBJ_INIT(obj1);
- * ASTOBJ_WRLOCK(obj1);
- * ast_copy_string(obj1->name, "obj1", sizeof(obj1->name));
- * ASTOBJ_UNLOCK(obj1);
- *
- * ASTOBJ_CONTAINER_LINK(&super_container, obj1);
- *
- * found_obj = ASTOBJ_CONTAINER_FIND(&super_container, "obj1");
- *
- * if(found_obj) {
- * printf("Found object: %s", found_obj->name);
- * ASTOBJ_UNREF(found_obj,sample_object_destroy);
- * }
- *
- * ASTOBJ_CONTAINER_DESTROYALL(&super_container,sample_object_destroy);
- * ASTOBJ_CONTAINER_DESTROY(&super_container);
- *
- * return 0;
- * }
- * \endcode
- */
-
-#if defined(__cplusplus) || defined(c_plusplus)
-extern "C" {
-#endif
-
-#define ASTOBJ_DEFAULT_NAMELEN 80
-#define ASTOBJ_DEFAULT_BUCKETS 256
-#define ASTOBJ_DEFAULT_HASH ast_strhash
-
-#define ASTOBJ_FLAG_MARKED (1 << 0) /* Object has been marked for future operation */
-
-/* C++ is simply a syntactic crutch for those who cannot think for themselves
- in an object oriented way. */
-
-/*! \brief Lock an ASTOBJ for reading.
- */
-#define ASTOBJ_RDLOCK(object) ast_mutex_lock(&(object)->_lock)
-
-/*! \brief Lock an ASTOBJ for writing.
- */
-#define ASTOBJ_WRLOCK(object) ast_mutex_lock(&(object)->_lock)
-
-/*! \brief Unlock a locked object. */
-#define ASTOBJ_UNLOCK(object) ast_mutex_unlock(&(object)->_lock)
-
-#ifdef ASTOBJ_CONTAINER_HASHMODEL
-#define __ASTOBJ_HASH(type,hashes) \
- type *next[hashes]
-#else
-#define __ASTOBJ_HASH(type,hashes) \
- type *next[1]
-#endif
-
-/*! \brief Add ASTOBJ components to a struct (without locking support).
- *
- * \param type The datatype of the object.
- * \param namelen The length to make the name char array.
- * \param hashes The number of containers the object can be present in.
- *
- * This macro adds components to a struct to make it an ASTOBJ. This macro
- * differs from ASTOBJ_COMPONENTS_FULL in that it does not create a mutex for
- * locking.
- *
- * <b>Sample Usage:</b>
- * \code
- * struct sample_struct {
- * ASTOBJ_COMPONENTS_NOLOCK_FULL(struct sample_struct,1,1);
- * };
- * \endcode
- */
-#define ASTOBJ_COMPONENTS_NOLOCK_FULL(type,namelen,hashes) \
- char name[namelen]; \
- unsigned int refcount; \
- unsigned int objflags; \
- __ASTOBJ_HASH(type,hashes)
-
-/*! \brief Add ASTOBJ components to a struct (without locking support).
- *
- * \param type The datatype of the object.
- *
- * This macro works like #ASTOBJ_COMPONENTS_NOLOCK_FULL() except it only accepts a
- * type and uses default values for namelen and hashes.
- *
- * <b>Sample Usage:</b>
- * \code
- * struct sample_struct_componets {
- * ASTOBJ_COMPONENTS_NOLOCK(struct sample_struct);
- * };
- * \endcode
- */
-#define ASTOBJ_COMPONENTS_NOLOCK(type) \
- ASTOBJ_COMPONENTS_NOLOCK_FULL(type,ASTOBJ_DEFAULT_NAMELEN,1)
-
-/*! \brief Add ASTOBJ components to a struct (with locking support).
- *
- * \param type The datatype of the object.
- *
- * This macro works like #ASTOBJ_COMPONENTS_NOLOCK() except it includes locking
- * support.
- *
- * <b>Sample Usage:</b>
- * \code
- * struct sample_struct {
- * ASTOBJ_COMPONENTS(struct sample_struct);
- * };
- * \endcode
- */
-#define ASTOBJ_COMPONENTS(type) \
- ASTOBJ_COMPONENTS_NOLOCK(type); \
- ast_mutex_t _lock;
-
-/*! \brief Add ASTOBJ components to a struct (with locking support).
- *
- * \param type The datatype of the object.
- * \param namelen The length to make the name char array.
- * \param hashes The number of containers the object can be present in.
- *
- * This macro adds components to a struct to make it an ASTOBJ and includes
- * support for locking.
- *
- * <b>Sample Usage:</b>
- * \code
- * struct sample_struct {
- * ASTOBJ_COMPONENTS_FULL(struct sample_struct,1,1);
- * };
- * \endcode
- */
-#define ASTOBJ_COMPONENTS_FULL(type,namelen,hashes) \
- ASTOBJ_COMPONENTS_NOLOCK_FULL(type,namelen,hashes); \
- ast_mutex_t _lock;
-
-/*! \brief Increment an object reference count.
- * \param object A pointer to the object to operate on.
- * \return The object.
- */
-#define ASTOBJ_REF(object) \
- ({ \
- ASTOBJ_WRLOCK(object); \
- (object)->refcount++; \
- ASTOBJ_UNLOCK(object); \
- (object); \
- })
-
-/*! \brief Decrement the reference count on an object.
- *
- * \param object A pointer the object to operate on.
- * \param destructor The destructor to call if the object is no longer referenced. It will be passed the pointer as an argument.
- *
- * This macro unreferences an object and calls the specfied destructor if the
- * object is no longer referenced. The destructor should free the object if it
- * was dynamically allocated.
- */
-#define ASTOBJ_UNREF(object,destructor) \
- do { \
- int newcount = 0; \
- ASTOBJ_WRLOCK(object); \
- if (__builtin_expect((object)->refcount > 0, 1)) \
- newcount = --((object)->refcount); \
- else \
- ast_log(LOG_WARNING, "Unreferencing unreferenced (object)!\n"); \
- ASTOBJ_UNLOCK(object); \
- if (newcount == 0) { \
- ast_mutex_destroy(&(object)->_lock); \
- destructor((object)); \
- } \
- (object) = NULL; \
- } while(0)
-
-/*! \brief Mark an ASTOBJ by adding the #ASTOBJ_FLAG_MARKED flag to its objflags mask.
- * \param object A pointer to the object to operate on.
- *
- * This macro "marks" an object. Marked objects can later be unlinked from a container using
- * #ASTOBJ_CONTAINER_PRUNE_MARKED().
- *
- */
-#define ASTOBJ_MARK(object) \
- do { \
- ASTOBJ_WRLOCK(object); \
- (object)->objflags |= ASTOBJ_FLAG_MARKED; \
- ASTOBJ_UNLOCK(object); \
- } while(0)
-
-/*! \brief Unmark an ASTOBJ by subtracting the #ASTOBJ_FLAG_MARKED flag from its objflags mask.
- * \param object A pointer to the object to operate on.
- */
-#define ASTOBJ_UNMARK(object) \
- do { \
- ASTOBJ_WRLOCK(object); \
- (object)->objflags &= ~ASTOBJ_FLAG_MARKED; \
- ASTOBJ_UNLOCK(object); \
- } while(0)
-
-/*! \brief Initialize an object.
- * \param object A pointer to the object to operate on.
- *
- * \note This should only be used on objects that support locking (objects
- * created with #ASTOBJ_COMPONENTS() or #ASTOBJ_COMPONENTS_FULL())
- */
-#define ASTOBJ_INIT(object) \
- do { \
- ast_mutex_init(&(object)->_lock); \
- object->name[0] = '\0'; \
- object->refcount = 1; \
- } while(0)
-
-/* Containers for objects -- current implementation is linked lists, but
- should be able to be converted to hashes relatively easily */
-
-/*! \brief Lock an ASTOBJ_CONTAINER for reading.
- */
-#define ASTOBJ_CONTAINER_RDLOCK(container) ast_mutex_lock(&(container)->_lock)
-
-/*! \brief Lock an ASTOBJ_CONTAINER for writing.
- */
-#define ASTOBJ_CONTAINER_WRLOCK(container) ast_mutex_lock(&(container)->_lock)
-
-/*! \brief Unlock an ASTOBJ_CONTAINER. */
-#define ASTOBJ_CONTAINER_UNLOCK(container) ast_mutex_unlock(&(container)->_lock)
-
-#ifdef ASTOBJ_CONTAINER_HASHMODEL
-#error "Hash model for object containers not yet implemented!"
-#else
-/* Linked lists */
-
-/*! \brief Create a container for ASTOBJs (without locking support).
- *
- * \param type The type of objects the container will hold.
- * \param hashes Currently unused.
- * \param buckets Currently unused.
- *
- * This macro is used to create a container for ASTOBJs without locking
- * support.
- *
- * <b>Sample Usage:</b>
- * \code
- * struct sample_struct_nolock_container {
- * ASTOBJ_CONTAINER_COMPONENTS_NOLOCK_FULL(struct sample_struct,1,1);
- * };
- * \endcode
- */
-#define ASTOBJ_CONTAINER_COMPONENTS_NOLOCK_FULL(type,hashes,buckets) \
- type *head
-
-/*! \brief Initialize a container.
- *
- * \param container A pointer to the container to initialize.
- * \param hashes Currently unused.
- * \param buckets Currently unused.
- *
- * This macro initializes a container. It should only be used on containers
- * that support locking.
- *
- * <b>Sample Usage:</b>
- * \code
- * struct sample_struct_container {
- * ASTOBJ_CONTAINER_COMPONENTS_FULL(struct sample_struct,1,1);
- * } container;
- *
- * int func()
- * {
- * ASTOBJ_CONTAINER_INIT_FULL(&container,1,1);
- * }
- * \endcode
- */
-#define ASTOBJ_CONTAINER_INIT_FULL(container,hashes,buckets) \
- do { \
- ast_mutex_init(&(container)->_lock); \
- } while(0)
-
-/*! \brief Destroy a container.
- *
- * \param container A pointer to the container to destroy.
- * \param hashes Currently unused.
- * \param buckets Currently unused.
- *
- * This macro frees up resources used by a container. It does not operate on
- * the objects in the container. To unlink the objects from the container use
- * #ASTOBJ_CONTAINER_DESTROYALL().
- *
- * \note This macro should only be used on containers with locking support.
- */
-#define ASTOBJ_CONTAINER_DESTROY_FULL(container,hashes,buckets) \
- do { \
- ast_mutex_destroy(&(container)->_lock); \
- } while(0)
-
-/*! \brief Iterate through the objects in a container.
- *
- * \param container A pointer to the container to traverse.
- * \param continue A condition to allow the traversal to continue.
- * \param eval A statement to evaluate in the iteration loop.
- *
- * This is macro is a little complicated, but it may help to think of it as a
- * loop. Basically it iterates through the specfied containter as long as the
- * condition is met. Two variables, iterator and next, are provided for use in
- * your \p eval statement. See the sample code for an example.
- *
- * <b>Sample Usage:</b>
- * \code
- * ASTOBJ_CONTAINER_TRAVERSE(&sample_container,1, {
- * ASTOBJ_RDLOCK(iterator);
- * printf("Currently iterating over '%s'\n", iterator->name);
- * ASTOBJ_UNLOCK(iterator);
- * } );
- * \endcode
- *
- * \code
- * ASTOBJ_CONTAINER_TRAVERSE(&sample_container,1, sample_func(iterator));
- * \endcode
- */
-#define ASTOBJ_CONTAINER_TRAVERSE(container,continue,eval) \
- do { \
- typeof((container)->head) iterator; \
- typeof((container)->head) next; \
- ASTOBJ_CONTAINER_RDLOCK(container); \
- next = (container)->head; \
- while((continue) && (iterator = next)) { \
- next = iterator->next[0]; \
- eval; \
- } \
- ASTOBJ_CONTAINER_UNLOCK(container); \
- } while(0)
-
-/*! \brief Find an object in a container.
- *
- * \param container A pointer to the container to search.
- * \param namestr The name to search for.
- *
- * Use this function to find an object with the specfied name in a container.
- *
- * \note When the returned object is no longer in use, #ASTOBJ_UNREF() should
- * be used to free the additional reference created by this macro.
- *
- * \return A new reference to the object located or NULL if nothing is found.
- */
-#define ASTOBJ_CONTAINER_FIND(container,namestr) \
- ({ \
- typeof((container)->head) found = NULL; \
- ASTOBJ_CONTAINER_TRAVERSE(container, !found, do { \
- if (!(strcasecmp(iterator->name, (namestr)))) \
- found = ASTOBJ_REF(iterator); \
- } while (0)); \
- found; \
- })
-
-/*! \brief Find an object in a container.
- *
- * \param container A pointer to the container to search.
- * \param data The data to search for.
- * \param field The field/member of the container's objects to search.
- * \param hashfunc The hash function to use, currently not implemented.
- * \param hashoffset The hash offset to use, currently not implemented.
- * \param comparefunc The function used to compare the field and data values.
- *
- * This macro iterates through a container passing the specified field and data
- * elements to the specified comparefunc. The function should return 0 when a match is found.
- *
- * \note When the returned object is no longer in use, #ASTOBJ_UNREF() should
- * be used to free the additional reference created by this macro.
- *
- * \return A pointer to the object located or NULL if nothing is found.
- */
-#define ASTOBJ_CONTAINER_FIND_FULL(container,data,field,hashfunc,hashoffset,comparefunc) \
- ({ \
- typeof((container)->head) found = NULL; \
- ASTOBJ_CONTAINER_TRAVERSE(container, !found, do { \
- ASTOBJ_RDLOCK(iterator); \
- if (!(comparefunc(iterator->field, (data)))) { \
- found = ASTOBJ_REF(iterator); \
- } \
- ASTOBJ_UNLOCK(iterator); \
- } while (0)); \
- found; \
- })
-
-/*! \brief Empty a container.
- *
- * \param container A pointer to the container to operate on.
- * \param destructor A destructor function to call on each object.
- *
- * This macro loops through a container removing all the items from it using
- * #ASTOBJ_UNREF(). This does not destroy the container itself, use
- * #ASTOBJ_CONTAINER_DESTROY() for that.
- *
- * \note If any object in the container is only referenced by the container,
- * the destructor will be called for that object once it has been removed.
- */
-#define ASTOBJ_CONTAINER_DESTROYALL(container,destructor) \
- do { \
- typeof((container)->head) iterator; \
- ASTOBJ_CONTAINER_WRLOCK(container); \
- while((iterator = (container)->head)) { \
- (container)->head = (iterator)->next[0]; \
- ASTOBJ_UNREF(iterator,destructor); \
- } \
- ASTOBJ_CONTAINER_UNLOCK(container); \
- } while(0)
-
-/*! \brief Remove an object from a container.
- *
- * \param container A pointer to the container to operate on.
- * \param obj A pointer to the object to remove.
- *
- * This macro iterates through a container and removes the specfied object if
- * it exists in the container.
- *
- * \note This macro does not destroy any objects, it simply unlinks
- * them from the list. No destructors are called.
- *
- * \return The container's reference to the removed object or NULL if no
- * matching object was found.
- */
-#define ASTOBJ_CONTAINER_UNLINK(container,obj) \
- ({ \
- typeof((container)->head) found = NULL; \
- typeof((container)->head) prev = NULL; \
- ASTOBJ_CONTAINER_TRAVERSE(container, !found, do { \
- if (iterator == obj) { \
- found = iterator; \
- found->next[0] = NULL; \
- ASTOBJ_CONTAINER_WRLOCK(container); \
- if (prev) \
- prev->next[0] = next; \
- else \
- (container)->head = next; \
- ASTOBJ_CONTAINER_UNLOCK(container); \
- } \
- prev = iterator; \
- } while (0)); \
- found; \
- })
-
-/*! \brief Find and remove an object from a container.
- *
- * \param container A pointer to the container to operate on.
- * \param namestr The name of the object to remove.
- *
- * This macro iterates through a container and removes the first object with
- * the specfied name from the container.
- *
- * \note This macro does not destroy any objects, it simply unlinks
- * them. No destructors are called.
- *
- * \return The container's reference to the removed object or NULL if no
- * matching object was found.
- */
-#define ASTOBJ_CONTAINER_FIND_UNLINK(container,namestr) \
- ({ \
- typeof((container)->head) found = NULL; \
- typeof((container)->head) prev = NULL; \
- ASTOBJ_CONTAINER_TRAVERSE(container, !found, do { \
- if (!(strcasecmp(iterator->name, (namestr)))) { \
- found = iterator; \
- found->next[0] = NULL; \
- ASTOBJ_CONTAINER_WRLOCK(container); \
- if (prev) \
- prev->next[0] = next; \
- else \
- (container)->head = next; \
- ASTOBJ_CONTAINER_UNLOCK(container); \
- } \
- prev = iterator; \
- } while (0)); \
- found; \
- })
-
-/*! \brief Find and remove an object in a container.
- *
- * \param container A pointer to the container to search.
- * \param data The data to search for.
- * \param field The field/member of the container's objects to search.
- * \param hashfunc The hash function to use, currently not implemented.
- * \param hashoffset The hash offset to use, currently not implemented.
- * \param comparefunc The function used to compare the field and data values.
- *
- * This macro iterates through a container passing the specified field and data
- * elements to the specified comparefunc. The function should return 0 when a match is found.
- * If a match is found it is removed from the list.
- *
- * \note This macro does not destroy any objects, it simply unlinks
- * them. No destructors are called.
- *
- * \return The container's reference to the removed object or NULL if no match
- * was found.
- */
-#define ASTOBJ_CONTAINER_FIND_UNLINK_FULL(container,data,field,hashfunc,hashoffset,comparefunc) \
- ({ \
- typeof((container)->head) found = NULL; \
- typeof((container)->head) prev = NULL; \
- ASTOBJ_CONTAINER_TRAVERSE(container, !found, do { \
- ASTOBJ_RDLOCK(iterator); \
- if (!(comparefunc(iterator->field, (data)))) { \
- found = iterator; \
- found->next[0] = NULL; \
- ASTOBJ_CONTAINER_WRLOCK(container); \
- if (prev) \
- prev->next[0] = next; \
- else \
- (container)->head = next; \
- ASTOBJ_CONTAINER_UNLOCK(container); \
- } \
- ASTOBJ_UNLOCK(iterator); \
- prev = iterator; \
- } while (0)); \
- found; \
- })
-
-/*! \brief Prune marked objects from a container.
- *
- * \param container A pointer to the container to prune.
- * \param destructor A destructor function to call on each marked object.
- *
- * This macro iterates through the specfied container and prunes any marked
- * objects executing the specfied destructor if necessary.
- */
-#define ASTOBJ_CONTAINER_PRUNE_MARKED(container,destructor) \
- do { \
- typeof((container)->head) prev = NULL; \
- ASTOBJ_CONTAINER_TRAVERSE(container, 1, do { \
- ASTOBJ_RDLOCK(iterator); \
- if (iterator->objflags & ASTOBJ_FLAG_MARKED) { \
- ASTOBJ_CONTAINER_WRLOCK(container); \
- if (prev) \
- prev->next[0] = next; \
- else \
- (container)->head = next; \
- ASTOBJ_CONTAINER_UNLOCK(container); \
- ASTOBJ_UNLOCK(iterator); \
- ASTOBJ_UNREF(iterator,destructor); \
- continue; \
- } \
- ASTOBJ_UNLOCK(iterator); \
- prev = iterator; \
- } while (0)); \
- } while(0)
-
-/*! \brief Add an object to a container.
- *
- * \param container A pointer to the container to operate on.
- * \param newobj A pointer to the object to be added.
- * \param data Currently unused.
- * \param field Currently unused.
- * \param hashfunc Currently unused.
- * \param hashoffset Currently unused.
- * \param comparefunc Currently unused.
- *
- * Currently this function adds an object to the head of the list. One day it
- * will support adding objects atthe position specified using the various
- * options this macro offers.
- */
-#define ASTOBJ_CONTAINER_LINK_FULL(container,newobj,data,field,hashfunc,hashoffset,comparefunc) \
- do { \
- ASTOBJ_CONTAINER_WRLOCK(container); \
- (newobj)->next[0] = (container)->head; \
- (container)->head = ASTOBJ_REF(newobj); \
- ASTOBJ_CONTAINER_UNLOCK(container); \
- } while(0)
-
-#endif /* List model */
-
-/* Common to hash and linked list models */
-
-/*! \brief Create a container for ASTOBJs (without locking support).
- *
- * \param type The type of objects the container will hold.
- *
- * This macro is used to create a container for ASTOBJs without locking
- * support.
- *
- * <b>Sample Usage:</b>
- * \code
- * struct sample_struct_nolock_container {
- * ASTOBJ_CONTAINER_COMPONENTS_NOLOCK(struct sample_struct);
- * };
- * \endcode
- */
-#define ASTOBJ_CONTAINER_COMPONENTS_NOLOCK(type) \
- ASTOBJ_CONTAINER_COMPONENTS_NOLOCK_FULL(type,1,ASTOBJ_DEFAULT_BUCKETS)
-
-
-/*! \brief Create a container for ASTOBJs (with locking support).
- *
- * \param type The type of objects the container will hold.
- *
- * This macro is used to create a container for ASTOBJs with locking support.
- *
- * <b>Sample Usage:</b>
- * \code
- * struct sample_struct_container {
- * ASTOBJ_CONTAINER_COMPONENTS(struct sample_struct);
- * };
- * \endcode
- */
-#define ASTOBJ_CONTAINER_COMPONENTS(type) \
- ast_mutex_t _lock; \
- ASTOBJ_CONTAINER_COMPONENTS_NOLOCK(type)
-
-/*! \brief Initialize a container.
- *
- * \param container A pointer to the container to initialize.
- *
- * This macro initializes a container. It should only be used on containers
- * that support locking.
- *
- * <b>Sample Usage:</b>
- * \code
- * struct sample_struct_container {
- * ASTOBJ_CONTAINER_COMPONENTS(struct sample_struct);
- * } container;
- *
- * int func()
- * {
- * ASTOBJ_CONTAINER_INIT(&container);
- * }
- * \endcode
- */
-#define ASTOBJ_CONTAINER_INIT(container) \
- ASTOBJ_CONTAINER_INIT_FULL(container,1,ASTOBJ_DEFAULT_BUCKETS)
-
-/*! \brief Destroy a container.
- *
- * \param container A pointer to the container to destory.
- *
- * This macro frees up resources used by a container. It does not operate on
- * the objects in the container. To unlink the objects from the container use
- * #ASTOBJ_CONTAINER_DESTROYALL().
- *
- * \note This macro should only be used on containers with locking support.
- */
-#define ASTOBJ_CONTAINER_DESTROY(container) \
- ASTOBJ_CONTAINER_DESTROY_FULL(container,1,ASTOBJ_DEFAULT_BUCKETS)
-
-/*! \brief Add an object to a container.
- *
- * \param container A pointer to the container to operate on.
- * \param newobj A pointer to the object to be added.
- *
- * Currently this macro adds an object to the head of a container. One day it
- * should add an object in alphabetical order.
- */
-#define ASTOBJ_CONTAINER_LINK(container,newobj) \
- ASTOBJ_CONTAINER_LINK_FULL(container,newobj,(newobj)->name,name,ASTOBJ_DEFAULT_HASH,0,strcasecmp)
-
-/*! \brief Mark all the objects in a container.
- * \param container A pointer to the container to operate on.
- */
-#define ASTOBJ_CONTAINER_MARKALL(container) \
- ASTOBJ_CONTAINER_TRAVERSE(container, 1, ASTOBJ_MARK(iterator))
-
-/*! \brief Unmark all the objects in a container.
- * \param container A pointer to the container to operate on.
- */
-#define ASTOBJ_CONTAINER_UNMARKALL(container) \
- ASTOBJ_CONTAINER_TRAVERSE(container, 1, ASTOBJ_UNMARK(iterator))
-
-/*! \brief Dump information about an object into a string.
- *
- * \param s A pointer to the string buffer to use.
- * \param slen The length of s.
- * \param obj A pointer to the object to dump.
- *
- * This macro dumps a text representation of the name, objectflags, and
- * refcount fields of an object to the specfied string buffer.
- */
-#define ASTOBJ_DUMP(s,slen,obj) \
- snprintf((s),(slen),"name: %s\nobjflags: %d\nrefcount: %d\n\n", (obj)->name, (obj)->objflags, (obj)->refcount);
-
-/*! \brief Dump information about all the objects in a container to a file descriptor.
- *
- * \param fd The file descriptor to write to.
- * \param s A string buffer, same as #ASTOBJ_DUMP().
- * \param slen The length of s, same as #ASTOBJ_DUMP().
- * \param container A pointer to the container to dump.
- *
- * This macro dumps a text representation of the name, objectflags, and
- * refcount fields of all the objects in a container to the specified file
- * descriptor.
- */
-#define ASTOBJ_CONTAINER_DUMP(fd,s,slen,container) \
- ASTOBJ_CONTAINER_TRAVERSE(container, 1, do { ASTOBJ_DUMP(s,slen,iterator); ast_cli(fd, s); } while(0))
-
-#if defined(__cplusplus) || defined(c_plusplus)
-}
-#endif
-
-#endif /* _ASTERISK_ASTOBJ_H */
diff --git a/1.2-netsec/include/asterisk/astosp.h b/1.2-netsec/include/asterisk/astosp.h
deleted file mode 100644
index ee809bbc2..000000000
--- a/1.2-netsec/include/asterisk/astosp.h
+++ /dev/null
@@ -1,48 +0,0 @@
-/*
- * 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.
- */
-
-/*! \file
- * \brief OSP support (Open Settlement Protocol)
- */
-
-#ifndef _ASTERISK_OSP_H
-#define _ASTERISK_OSP_H
-
-#include "asterisk/channel.h"
-#include <netinet/in.h>
-#include <time.h>
-
-struct ast_osp_result {
- int handle;
- int numresults;
- char tech[20];
- char dest[256];
- char token[4096];
-};
-
-/* Note: Channel will be auto-serviced if specified. Returns -1 on hangup,
- 0 if nothing found, or 1 if something is found */
-int ast_osp_lookup(struct ast_channel *chan, char *provider, char *extension, char *callerid, struct ast_osp_result *result);
-
-int ast_osp_next(struct ast_osp_result *result, int cause);
-
-int ast_osp_terminate(int handle, int cause, time_t start, time_t duration);
-
-int ast_osp_validate(char *provider, char *token, int *handle, unsigned int *timeout, char *callerid, struct in_addr addr, char *extension);
-
-#endif /* _ASTERISK_OSP_H */
diff --git a/1.2-netsec/include/asterisk/callerid.h b/1.2-netsec/include/asterisk/callerid.h
deleted file mode 100644
index 45ff8b057..000000000
--- a/1.2-netsec/include/asterisk/callerid.h
+++ /dev/null
@@ -1,306 +0,0 @@
-/*
- * 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.
- */
-
-/*! \file
- * \brief CallerID (and other GR30) management and generation
- * Includes code and algorithms from the Zapata library.
- * Caller ID names are currently 8 bit characters, propably
- * ISO8859-1, depending on what your channel drivers handle.
- * \note Asterisk does not currently support SIP utf8 caller ID names or caller ID's.
- *
- * \par See also
- * \arg \ref callerid.c
- * \arg \ref Def_CallerPres
- */
-
-#ifndef _ASTERISK_CALLERID_H
-#define _ASTERISK_CALLERID_H
-
-#define MAX_CALLERID_SIZE 32000
-
-#define CID_PRIVATE_NAME (1 << 0)
-#define CID_PRIVATE_NUMBER (1 << 1)
-#define CID_UNKNOWN_NAME (1 << 2)
-#define CID_UNKNOWN_NUMBER (1 << 3)
-
-#define CID_SIG_BELL 1
-#define CID_SIG_V23 2
-#define CID_SIG_DTMF 3
-
-#define CID_START_RING 1
-#define CID_START_POLARITY 2
-
-
-#define AST_LIN2X(a) ((codec == AST_FORMAT_ALAW) ? (AST_LIN2A(a)) : (AST_LIN2MU(a)))
-#define AST_XLAW(a) ((codec == AST_FORMAT_ALAW) ? (AST_ALAW(a)) : (AST_MULAW(a)))
-
-
-struct callerid_state;
-typedef struct callerid_state CIDSTATE;
-
-/*! \brief CallerID Initialization
- * \par
- * Initializes the callerid system. Mostly stuff for inverse FFT
- */
-extern void callerid_init(void);
-
-/*! \brief Generates a CallerID FSK stream in ulaw format suitable for transmission.
- * \param buf Buffer to use. If "buf" is supplied, it will use that buffer instead of allocating its own. "buf" must be at least 32000 bytes in size of you want to be sure you don't have an overrun.
- * \param number Use NULL for no number or "P" for "private"
- * \param name name to be used
- * \param flags passed flags
- * \param callwaiting callwaiting flag
- * \param codec -- either AST_FORMAT_ULAW or AST_FORMAT_ALAW
- * This function creates a stream of callerid (a callerid spill) data in ulaw format.
- * \return It returns the size
- * (in bytes) of the data (if it returns a size of 0, there is probably an error)
-*/
-extern int callerid_generate(unsigned char *buf, char *number, char *name, int flags, int callwaiting, int codec);
-
-/*! \brief Create a callerID state machine
- * \param cid_signalling Type of signalling in use
- *
- * This function returns a malloc'd instance of the callerid_state data structure.
- * \return Returns a pointer to a malloc'd callerid_state structure, or NULL on error.
- */
-extern struct callerid_state *callerid_new(int cid_signalling);
-
-/*! \brief Read samples into the state machine.
- * \param cid Which state machine to act upon
- * \param ubuf containing your samples
- * \param samples number of samples contained within the buffer.
- * \param codec which codec (AST_FORMAT_ALAW or AST_FORMAT_ULAW)
- *
- * Send received audio to the Caller*ID demodulator.
- * \return Returns -1 on error, 0 for "needs more samples",
- * and 1 if the CallerID spill reception is complete.
- */
-extern int callerid_feed(struct callerid_state *cid, unsigned char *ubuf, int samples, int codec);
-
-/*! \brief Extract info out of callerID state machine. Flags are listed above
- * \param cid Callerid state machine to act upon
- * \param number Pass the address of a pointer-to-char (will contain the phone number)
- * \param name Pass the address of a pointer-to-char (will contain the name)
- * \param flags Pass the address of an int variable(will contain the various callerid flags)
- *
- * This function extracts a callerid string out of a callerid_state state machine.
- * If no number is found, *number will be set to NULL. Likewise for the name.
- * Flags can contain any of the following:
- *
- * \return Returns nothing.
- */
-void callerid_get(struct callerid_state *cid, char **number, char **name, int *flags);
-
-/*! Get and parse DTMF-based callerid */
-/*!
- * \param cidstring The actual transmitted string.
- * \param number The cid number is returned here.
- * \param flags The cid flags are returned here.
- * This function parses DTMF callerid.
- */
-void callerid_get_dtmf(char *cidstring, char *number, int *flags);
-
-/*! \brief Free a callerID state
- * \param cid This is the callerid_state state machine to free
- * This function frees callerid_state cid.
- */
-extern void callerid_free(struct callerid_state *cid);
-
-/*! \brief Generate Caller-ID spill from the "callerid" field of asterisk (in e-mail address like format)
- * \param buf buffer for output samples. See callerid_generate() for details regarding buffer.
- * \param name Caller-ID Name
- * \param number Caller-ID Number
- * \param codec Asterisk codec (either AST_FORMAT_ALAW or AST_FORMAT_ULAW)
- *
- * Acts like callerid_generate except uses an asterisk format callerid string.
- */
-extern int ast_callerid_generate(unsigned char *buf, char *name, char *number, int codec);
-
-/*! \brief Generate message waiting indicator (stutter tone) */
-extern int vmwi_generate(unsigned char *buf, int active, int mdmf, int codec);
-
-/*! \brief Generate Caller-ID spill but in a format suitable for Call Waiting(tm)'s Caller*ID(tm)
- * See ast_callerid_generate() for other details
- */
-extern int ast_callerid_callwaiting_generate(unsigned char *buf, char *name, char *number, int codec);
-
-/*! \brief Destructively parse inbuf into name and location (or number)
- * Parses callerid stream from inbuf and changes into useable form, outputed in name and location.
- * \param instr buffer of callerid stream (in audio form) to be parsed. Warning, data in buffer is changed.
- * \param name address of a pointer-to-char for the name value of the stream.
- * \param location address of a pointer-to-char for the phone number value of the stream.
- * \return Returns 0 on success, -1 on failure.
- */
-extern int ast_callerid_parse(char *instr, char **name, char **location);
-
-/*! Generate a CAS (CPE Alert Signal) tone for 'n' samples */
-/*!
- * \param outbuf Allocated buffer for data. Must be at least 2400 bytes unless no SAS is desired
- * \param sas Non-zero if CAS should be preceeded by SAS
- * \param len How many samples to generate.
- * \param codec Which codec (AST_FORMAT_ALAW or AST_FORMAT_ULAW)
- * \return Returns -1 on error (if len is less than 2400), 0 on success.
- */
-extern int ast_gen_cas(unsigned char *outbuf, int sas, int len, int codec);
-
-/*! \brief Shrink a phone number in place to just digits (more accurately it just removes ()'s, .'s, and -'s... */
-/*!
- * \param n The number to be stripped/shrunk
- * \return Returns nothing important
- */
-extern void ast_shrink_phone_number(char *n);
-
-/*! \brief Check if a string consists only of digits.
- \param n number to be checked.
- \return Returns 0 if n is a number, 1 if it's not.
- */
-extern int ast_isphonenumber(char *n);
-
-extern int ast_callerid_split(const char *src, char *name, int namelen, char *num, int numlen);
-
-extern char *ast_callerid_merge(char *buf, int bufsiz, const char *name, const char *num, const char *unknown);
-
-/*
- * Caller*ID and other GR-30 compatible generation
- * routines (used by ADSI for example)
- */
-
-extern float cid_dr[4];
-extern float cid_di[4];
-extern float clidsb;
-
-static inline float callerid_getcarrier(float *cr, float *ci, int bit)
-{
- /* Move along. There's nothing to see here... */
- float t;
- t = *cr * cid_dr[bit] - *ci * cid_di[bit];
- *ci = *cr * cid_di[bit] + *ci * cid_dr[bit];
- *cr = t;
-
- t = 2.0 - (*cr * *cr + *ci * *ci);
- *cr *= t;
- *ci *= t;
- return *cr;
-}
-
-#define PUT_BYTE(a) do { \
- *(buf++) = (a); \
- bytes++; \
-} while(0)
-
-#define PUT_AUDIO_SAMPLE(y) do { \
- int index = (short)(rint(8192.0 * (y))); \
- *(buf++) = AST_LIN2X(index); \
- bytes++; \
-} while(0)
-
-#define PUT_CLID_MARKMS do { \
- int x; \
- for (x=0;x<8;x++) \
- PUT_AUDIO_SAMPLE(callerid_getcarrier(&cr, &ci, 1)); \
-} while(0)
-
-#define PUT_CLID_BAUD(bit) do { \
- while(scont < clidsb) { \
- PUT_AUDIO_SAMPLE(callerid_getcarrier(&cr, &ci, bit)); \
- scont += 1.0; \
- } \
- scont -= clidsb; \
-} while(0)
-
-
-#define PUT_CLID(byte) do { \
- int z; \
- unsigned char b = (byte); \
- PUT_CLID_BAUD(0); /* Start bit */ \
- for (z=0;z<8;z++) { \
- PUT_CLID_BAUD(b & 1); \
- b >>= 1; \
- } \
- PUT_CLID_BAUD(1); /* Stop bit */ \
-} while(0);
-
-/* Various defines and bits for handling PRI- and SS7-type restriction */
-
-#define AST_PRES_NUMBER_TYPE 0x03
-#define AST_PRES_USER_NUMBER_UNSCREENED 0x00
-#define AST_PRES_USER_NUMBER_PASSED_SCREEN 0x01
-#define AST_PRES_USER_NUMBER_FAILED_SCREEN 0x02
-#define AST_PRES_NETWORK_NUMBER 0x03
-
-#define AST_PRES_RESTRICTION 0x60
-#define AST_PRES_ALLOWED 0x00
-#define AST_PRES_RESTRICTED 0x20
-#define AST_PRES_UNAVAILABLE 0x40
-#define AST_PRES_RESERVED 0x60
-
-#define AST_PRES_ALLOWED_USER_NUMBER_NOT_SCREENED \
- AST_PRES_USER_NUMBER_UNSCREENED + AST_PRES_ALLOWED
-
-#define AST_PRES_ALLOWED_USER_NUMBER_PASSED_SCREEN \
- AST_PRES_USER_NUMBER_PASSED_SCREEN + AST_PRES_ALLOWED
-
-#define AST_PRES_ALLOWED_USER_NUMBER_FAILED_SCREEN \
- AST_PRES_USER_NUMBER_FAILED_SCREEN + AST_PRES_ALLOWED
-
-#define AST_PRES_ALLOWED_NETWORK_NUMBER \
- AST_PRES_NETWORK_NUMBER + AST_PRES_ALLOWED
-
-#define AST_PRES_PROHIB_USER_NUMBER_NOT_SCREENED \
- AST_PRES_USER_NUMBER_UNSCREENED + AST_PRES_RESTRICTED
-
-#define AST_PRES_PROHIB_USER_NUMBER_PASSED_SCREEN \
- AST_PRES_USER_NUMBER_PASSED_SCREEN + AST_PRES_RESTRICTED
-
-#define AST_PRES_PROHIB_USER_NUMBER_FAILED_SCREEN \
- AST_PRES_USER_NUMBER_FAILED_SCREEN + AST_PRES_RESTRICTED
-
-#define AST_PRES_PROHIB_NETWORK_NUMBER \
- AST_PRES_NETWORK_NUMBER + AST_PRES_RESTRICTED
-
-#define AST_PRES_NUMBER_NOT_AVAILABLE \
- AST_PRES_NETWORK_NUMBER + AST_PRES_UNAVAILABLE
-
-int ast_parse_caller_presentation(const char *data);
-const char *ast_describe_caller_presentation(int data);
-
-/*! \page Def_CallerPres Caller ID Presentation
-
- Caller ID presentation values are used to set properties to a
- caller ID in PSTN networks, and as RPID value in SIP transactions.
-
- The following values are available to use:
- \arg \b Defined value, text string in config file, explanation
- .
-
- \arg \b AST_PRES_ALLOWED_USER_NUMBER_NOT_SCREENED, "allowed_not_screened", Presentation Allowed, Not Screened,
- \arg \b AST_PRES_ALLOWED_USER_NUMBER_PASSED_SCREEN, "allowed_passed_screen", Presentation Allowed, Passed Screen,
- \arg \b AST_PRES_ALLOWED_USER_NUMBER_FAILED_SCREEN, "allowed_failed_screen", Presentation Allowed, Failed Screen,
- \arg \b AST_PRES_ALLOWED_NETWORK_NUMBER, "allowed", Presentation Allowed, Network Number,
- \arg \b AST_PRES_PROHIB_USER_NUMBER_NOT_SCREENED, "prohib_not_screened", Presentation Prohibited, Not Screened,
- \arg \b AST_PRES_PROHIB_USER_NUMBER_PASSED_SCREEN, "prohib_passed_screen", Presentation Prohibited, Passed Screen,
- \arg \b AST_PRES_PROHIB_USER_NUMBER_FAILED_SCREEN, "prohib_failed_screen", Presentation Prohibited, Failed Screen,
- \arg \b AST_PRES_PROHIB_NETWORK_NUMBER, "prohib", Presentation Prohibited, Network Number,
-
- \par References
- \arg \ref callerid.h Definitions
- \arg \ref callerid.c Functions
-*/
-
-
-#endif /* _ASTERISK_CALLERID_H */
diff --git a/1.2-netsec/include/asterisk/causes.h b/1.2-netsec/include/asterisk/causes.h
deleted file mode 100644
index fc27c7970..000000000
--- a/1.2-netsec/include/asterisk/causes.h
+++ /dev/null
@@ -1,82 +0,0 @@
-/*
- * Asterisk -- An open source telephony toolkit.
- *
- * Copyright (C) 1999 - 2005, Digium, Inc.
- *
- * Martin Pycko <martinp@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.
- */
-
-/*! \file
- * \brief Internal Asterisk hangup causes
- */
-
-#ifndef _ASTERISK_CAUSES_H
-#define _ASTERISK_CAUSES_H
-
-/* Causes for disconnection (from Q.931) */
-#define AST_CAUSE_UNALLOCATED 1
-#define AST_CAUSE_NO_ROUTE_TRANSIT_NET 2
-#define AST_CAUSE_NO_ROUTE_DESTINATION 3
-#define AST_CAUSE_CHANNEL_UNACCEPTABLE 6
-#define AST_CAUSE_CALL_AWARDED_DELIVERED 7
-#define AST_CAUSE_NORMAL_CLEARING 16
-#define AST_CAUSE_USER_BUSY 17
-#define AST_CAUSE_NO_USER_RESPONSE 18
-#define AST_CAUSE_NO_ANSWER 19
-#define AST_CAUSE_CALL_REJECTED 21
-#define AST_CAUSE_NUMBER_CHANGED 22
-#define AST_CAUSE_DESTINATION_OUT_OF_ORDER 27
-#define AST_CAUSE_INVALID_NUMBER_FORMAT 28
-#define AST_CAUSE_FACILITY_REJECTED 29
-#define AST_CAUSE_RESPONSE_TO_STATUS_ENQUIRY 30
-#define AST_CAUSE_NORMAL_UNSPECIFIED 31
-#define AST_CAUSE_NORMAL_CIRCUIT_CONGESTION 34
-#define AST_CAUSE_NETWORK_OUT_OF_ORDER 38
-#define AST_CAUSE_NORMAL_TEMPORARY_FAILURE 41
-#define AST_CAUSE_SWITCH_CONGESTION 42
-#define AST_CAUSE_ACCESS_INFO_DISCARDED 43
-#define AST_CAUSE_REQUESTED_CHAN_UNAVAIL 44
-#define AST_CAUSE_PRE_EMPTED 45
-#define AST_CAUSE_FACILITY_NOT_SUBSCRIBED 50
-#define AST_CAUSE_OUTGOING_CALL_BARRED 52
-#define AST_CAUSE_INCOMING_CALL_BARRED 54
-#define AST_CAUSE_BEARERCAPABILITY_NOTAUTH 57
-#define AST_CAUSE_BEARERCAPABILITY_NOTAVAIL 58
-#define AST_CAUSE_BEARERCAPABILITY_NOTIMPL 65
-#define AST_CAUSE_CHAN_NOT_IMPLEMENTED 66
-#define AST_CAUSE_FACILITY_NOT_IMPLEMENTED 69
-#define AST_CAUSE_INVALID_CALL_REFERENCE 81
-#define AST_CAUSE_INCOMPATIBLE_DESTINATION 88
-#define AST_CAUSE_INVALID_MSG_UNSPECIFIED 95
-#define AST_CAUSE_MANDATORY_IE_MISSING 96
-#define AST_CAUSE_MESSAGE_TYPE_NONEXIST 97
-#define AST_CAUSE_WRONG_MESSAGE 98
-#define AST_CAUSE_IE_NONEXIST 99
-#define AST_CAUSE_INVALID_IE_CONTENTS 100
-#define AST_CAUSE_WRONG_CALL_STATE 101
-#define AST_CAUSE_RECOVERY_ON_TIMER_EXPIRE 102
-#define AST_CAUSE_MANDATORY_IE_LENGTH_ERROR 103
-#define AST_CAUSE_PROTOCOL_ERROR 111
-#define AST_CAUSE_INTERWORKING 127
-
-/* Special Asterisk aliases */
-#define AST_CAUSE_BUSY AST_CAUSE_USER_BUSY
-#define AST_CAUSE_FAILURE AST_CAUSE_NETWORK_OUT_OF_ORDER
-#define AST_CAUSE_NORMAL AST_CAUSE_NORMAL_CLEARING
-#define AST_CAUSE_NOANSWER AST_CAUSE_NO_ANSWER
-#define AST_CAUSE_CONGESTION AST_CAUSE_NORMAL_CIRCUIT_CONGESTION
-#define AST_CAUSE_UNREGISTERED AST_CAUSE_NO_ROUTE_DESTINATION
-#define AST_CAUSE_NOTDEFINED 0
-#define AST_CAUSE_NOSUCHDRIVER AST_CAUSE_CHAN_NOT_IMPLEMENTED
-
-#endif /* _ASTERISK_CAUSES_H */
diff --git a/1.2-netsec/include/asterisk/cdr.h b/1.2-netsec/include/asterisk/cdr.h
deleted file mode 100644
index c43882946..000000000
--- a/1.2-netsec/include/asterisk/cdr.h
+++ /dev/null
@@ -1,297 +0,0 @@
-/*
- * 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.
- */
-
-/*! \file
- * \brief Call Detail Record API
- */
-
-#ifndef _ASTERISK_CDR_H
-#define _ASTERISK_CDR_H
-
-#include <sys/time.h>
-#define AST_CDR_FLAG_KEEP_VARS (1 << 0)
-#define AST_CDR_FLAG_POSTED (1 << 1)
-#define AST_CDR_FLAG_LOCKED (1 << 2)
-#define AST_CDR_FLAG_CHILD (1 << 3)
-#define AST_CDR_FLAG_POST_DISABLED (1 << 4)
-
-#define AST_CDR_NOANSWER (1 << 0)
-#define AST_CDR_BUSY (1 << 1)
-#define AST_CDR_ANSWERED (1 << 2)
-#define AST_CDR_FAILED (1 << 3)
-
-/*! AMA Flags */
-#define AST_CDR_OMIT (1)
-#define AST_CDR_BILLING (2)
-#define AST_CDR_DOCUMENTATION (3)
-
-#define AST_MAX_USER_FIELD 256
-#define AST_MAX_ACCOUNT_CODE 20
-
-/* Include channel.h after relevant declarations it will need */
-#include "asterisk/channel.h"
-#include "asterisk/utils.h"
-
-struct ast_channel;
-
-/*! Responsible for call detail data */
-struct ast_cdr {
- /*! Caller*ID with text */
- char clid[AST_MAX_EXTENSION];
- /*! Caller*ID number */
- char src[AST_MAX_EXTENSION];
- /*! Destination extension */
- char dst[AST_MAX_EXTENSION];
- /*! Destination context */
- char dcontext[AST_MAX_EXTENSION];
-
- char channel[AST_MAX_EXTENSION];
- /*! Destination channel if appropriate */
- char dstchannel[AST_MAX_EXTENSION];
- /*! Last application if appropriate */
- char lastapp[AST_MAX_EXTENSION];
- /*! Last application data */
- char lastdata[AST_MAX_EXTENSION];
-
- struct timeval start;
-
- struct timeval answer;
-
- struct timeval end;
- /*! Total time in system, in seconds */
- long int duration;
- /*! Total time call is up, in seconds */
- long int billsec;
- /*! What happened to the call */
- long int disposition;
- /*! What flags to use */
- long int amaflags;
- /*! What account number to use */
- char accountcode[AST_MAX_ACCOUNT_CODE];
- /*! flags */
- unsigned int flags;
- /* Unique Channel Identifier */
- char uniqueid[32];
- /* User field */
- char userfield[AST_MAX_USER_FIELD];
-
- /* A linked list for variables */
- struct varshead varshead;
-
- struct ast_cdr *next;
-};
-
-extern void ast_cdr_getvar(struct ast_cdr *cdr, const char *name, char **ret, char *workspace, int workspacelen, int recur);
-extern int ast_cdr_setvar(struct ast_cdr *cdr, const char *name, const char *value, int recur);
-extern int ast_cdr_serialize_variables(struct ast_cdr *cdr, char *buf, size_t size, char delim, char sep, int recur);
-extern void ast_cdr_free_vars(struct ast_cdr *cdr, int recur);
-extern int ast_cdr_copy_vars(struct ast_cdr *to_cdr, struct ast_cdr *from_cdr);
-
-typedef int (*ast_cdrbe)(struct ast_cdr *cdr);
-
-/*! \brief Allocate a CDR record
- * Returns a malloc'd ast_cdr structure, returns NULL on error (malloc failure)
- */
-extern struct ast_cdr *ast_cdr_alloc(void);
-
-/*! \brief Duplicate a record
- * Returns a malloc'd ast_cdr structure, returns NULL on error (malloc failure)
- */
-extern struct ast_cdr *ast_cdr_dup(struct ast_cdr *cdr);
-
-/*! \brief Free a CDR record
- * \param cdr ast_cdr structure to free
- * Returns nothing important
- */
-extern void ast_cdr_free(struct ast_cdr *cdr);
-
-/*! \brief Initialize based on a channel
- * \param cdr Call Detail Record to use for channel
- * \param chan Channel to bind CDR with
- * Initializes a CDR and associates it with a particular channel
- * Return is negligible. (returns 0 by default)
- */
-extern int ast_cdr_init(struct ast_cdr *cdr, struct ast_channel *chan);
-
-/*! Initialize based on a channel */
-/*!
- * \param cdr Call Detail Record to use for channel
- * \param chan Channel to bind CDR with
- * Initializes a CDR and associates it with a particular channel
- * Return is negligible. (returns 0 by default)
- */
-extern int ast_cdr_setcid(struct ast_cdr *cdr, struct ast_channel *chan);
-
-/*! Register a CDR handling engine */
-/*!
- * \param name name associated with the particular CDR handler
- * \param desc description of the CDR handler
- * \param be function pointer to a CDR handler
- * Used to register a Call Detail Record handler.
- * Returns -1 on error, 0 on success.
- */
-extern int ast_cdr_register(char *name, char *desc, ast_cdrbe be);
-
-/*! Unregister a CDR handling engine */
-/*!
- * \param name name of CDR handler to unregister
- * Unregisters a CDR by it's name
- */
-extern void ast_cdr_unregister(char *name);
-
-/*! Start a call */
-/*!
- * \param cdr the cdr you wish to associate with the call
- * Starts all CDR stuff necessary for monitoring a call
- * Returns nothing important
- */
-extern void ast_cdr_start(struct ast_cdr *cdr);
-
-/*! Answer a call */
-/*!
- * \param cdr the cdr you wish to associate with the call
- * Starts all CDR stuff necessary for doing CDR when answering a call
- */
-extern void ast_cdr_answer(struct ast_cdr *cdr);
-
-/*! Busy a call */
-/*!
- * \param cdr the cdr you wish to associate with the call
- * Returns nothing important
- */
-extern void ast_cdr_busy(struct ast_cdr *cdr);
-
-/*! Fail a call */
-/*!
- * \param cdr the cdr you wish to associate with the call
- * Returns nothing important
- */
-extern void ast_cdr_failed(struct ast_cdr *cdr);
-
-/*! Save the result of the call based on the AST_CAUSE_* */
-/*!
- * \param cdr the cdr you wish to associate with the call
- * Returns nothing important
- * \param cause the AST_CAUSE_*
- */
-extern int ast_cdr_disposition(struct ast_cdr *cdr, int cause);
-
-/*! End a call */
-/*!
- * \param cdr the cdr you have associated the call with
- * Registers the end of call time in the cdr structure.
- * Returns nothing important
- */
-extern void ast_cdr_end(struct ast_cdr *cdr);
-
-/*! Detaches the detail record for posting (and freeing) either now or at a
- * later time in bulk with other records during batch mode operation */
-/*!
- * \param cdr Which CDR to detach from the channel thread
- * Prevents the channel thread from blocking on the CDR handling
- * Returns nothing
- */
-extern void ast_cdr_detach(struct ast_cdr *cdr);
-
-/*! Spawns (possibly) a new thread to submit a batch of CDRs to the backend engines */
-/*!
- * \param shutdown Whether or not we are shutting down
- * Blocks the asterisk shutdown procedures until the CDR data is submitted.
- * Returns nothing
- */
-extern void ast_cdr_submit_batch(int shutdown);
-
-/*! Set the destination channel, if there was one */
-/*!
- * \param cdr Which cdr it's applied to
- * \param chan Channel to which dest will be
- * Sets the destination channel the CDR is applied to
- * Returns nothing
- */
-extern void ast_cdr_setdestchan(struct ast_cdr *cdr, char *chan);
-
-/*! Set the last executed application */
-/*!
- * \param cdr which cdr to act upon
- * \param app the name of the app you wish to change it to
- * \param data the data you want in the data field of app you set it to
- * Changes the value of the last executed app
- * Returns nothing
- */
-extern void ast_cdr_setapp(struct ast_cdr *cdr, char *app, char *data);
-
-/*! Convert a string to a detail record AMA flag */
-/*!
- * \param flag string form of flag
- * Converts the string form of the flag to the binary form.
- * Returns the binary form of the flag
- */
-extern int ast_cdr_amaflags2int(const char *flag);
-
-/*! Disposition to a string */
-/*!
- * \param disposition input binary form
- * Converts the binary form of a disposition to string form.
- * Returns a pointer to the string form
- */
-extern char *ast_cdr_disp2str(int disposition);
-
-/*! Reset the detail record, optionally posting it first */
-/*!
- * \param cdr which cdr to act upon
- * \param flags |AST_CDR_FLAG_POSTED whether or not to post the cdr first before resetting it
- * |AST_CDR_FLAG_LOCKED whether or not to reset locked CDR's
- */
-extern void ast_cdr_reset(struct ast_cdr *cdr, struct ast_flags *flags);
-
-/*! Flags to a string */
-/*!
- * \param flags binary flag
- * Converts binary flags to string flags
- * Returns string with flag name
- */
-extern char *ast_cdr_flags2str(int flags);
-
-extern int ast_cdr_setaccount(struct ast_channel *chan, const char *account);
-extern int ast_cdr_setamaflags(struct ast_channel *chan, const char *amaflags);
-
-
-extern int ast_cdr_setuserfield(struct ast_channel *chan, const char *userfield);
-extern int ast_cdr_appenduserfield(struct ast_channel *chan, const char *userfield);
-
-
-/* Update CDR on a channel */
-extern int ast_cdr_update(struct ast_channel *chan);
-
-
-extern int ast_default_amaflags;
-
-extern char ast_default_accountcode[AST_MAX_ACCOUNT_CODE];
-
-extern struct ast_cdr *ast_cdr_append(struct ast_cdr *cdr, struct ast_cdr *newcdr);
-
-/*! Reload the configuration file cdr.conf and start/stop CDR scheduling thread */
-extern void ast_cdr_engine_reload(void);
-
-/*! Load the configuration file cdr.conf and possibly start the CDR scheduling thread */
-extern int ast_cdr_engine_init(void);
-
-/*! Submit any remaining CDRs and prepare for shutdown */
-extern void ast_cdr_engine_term(void);
-
-#endif /* _ASTERISK_CDR_H */
diff --git a/1.2-netsec/include/asterisk/channel.h b/1.2-netsec/include/asterisk/channel.h
deleted file mode 100644
index 11fb0a7d0..000000000
--- a/1.2-netsec/include/asterisk/channel.h
+++ /dev/null
@@ -1,1207 +0,0 @@
-/*
- * 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.
- */
-
-/*! \file
- * \brief General Asterisk PBX channel definitions.
- * \par See also:
- * \arg \ref Def_Channel
- * \arg \ref channel_drivers
- */
-
-/*! \page Def_Channel Asterisk Channels
- \par What is a Channel?
- A phone call through Asterisk consists of an incoming
- connection and an outbound connection. Each call comes
- in through a channel driver that supports one technology,
- like SIP, ZAP, IAX2 etc.
- \par
- Each channel driver, technology, has it's own private
- channel or dialog structure, that is technology-dependent.
- Each private structure is "owned" by a generic Asterisk
- channel structure, defined in channel.h and handled by
- channel.c .
- \par Call scenario
- This happens when an incoming call arrives to Asterisk
- -# Call arrives on a channel driver interface
- -# Channel driver creates a PBX channel and starts a
- pbx thread on the channel
- -# The dial plan is executed
- -# At this point at least two things can happen:
- -# The call is answered by Asterisk and
- Asterisk plays a media stream or reads media
- -# The dial plan forces Asterisk to create an outbound
- call somewhere with the dial (see \ref app_dial.c)
- application
-
- .
- \par Bridging channels
- If Asterisk dials out this happens:
- -# Dial creates an outbound PBX channel and asks one of the
- channel drivers to create a call
- -# When the call is answered, Asterisk bridges the media streams
- so the caller on the first channel can speak with the callee
- on the second, outbound channel
- -# In some cases where we have the same technology on both
- channels and compatible codecs, a native bridge is used.
- In a native bridge, the channel driver handles forwarding
- of incoming audio to the outbound stream internally, without
- sending audio frames through the PBX.
- -# In SIP, theres an "external native bridge" where Asterisk
- redirects the endpoint, so audio flows directly between the
- caller's phone and the callee's phone. Signalling stays in
- Asterisk in order to be able to provide a proper CDR record
- for the call.
-
-
- \par Masquerading channels
- In some cases, a channel can masquerade itself into another
- channel. This happens frequently in call transfers, where
- a new channel takes over a channel that is already involved
- in a call. The new channel sneaks in and takes over the bridge
- and the old channel, now a zombie, is hung up.
-
- \par Reference
- \arg channel.c - generic functions
- \arg channel.h - declarations of functions, flags and structures
- \arg \ref channel_drivers - Implemented channel drivers
- \arg \ref Def_Frame Asterisk Multimedia Frames
-
-*/
-
-#ifndef _ASTERISK_CHANNEL_H
-#define _ASTERISK_CHANNEL_H
-
-#include <unistd.h>
-#include <setjmp.h>
-#ifdef POLLCOMPAT
-#include "asterisk/poll-compat.h"
-#else
-#include <sys/poll.h>
-#endif
-
-#if defined(__cplusplus) || defined(c_plusplus)
-extern "C" {
-#endif
-
-/*! Max length of an extension */
-#define AST_MAX_EXTENSION 80
-
-#define AST_MAX_CONTEXT 80
-
-#define AST_CHANNEL_NAME 80
-
-#include "asterisk/compat.h"
-#include "asterisk/frame.h"
-#include "asterisk/sched.h"
-#include "asterisk/chanvars.h"
-#include "asterisk/config.h"
-#include "asterisk/lock.h"
-#include "asterisk/cdr.h"
-#include "asterisk/utils.h"
-#include "asterisk/linkedlists.h"
-
-#define MAX_LANGUAGE 20
-
-#define MAX_MUSICCLASS 20
-
-#define AST_MAX_FDS 8
-
-enum ast_bridge_result {
- AST_BRIDGE_COMPLETE = 0,
- AST_BRIDGE_FAILED = -1,
- AST_BRIDGE_FAILED_NOWARN = -2,
- AST_BRIDGE_RETRY = -3,
-};
-
-typedef unsigned long long ast_group_t;
-
-struct ast_generator {
- void *(*alloc)(struct ast_channel *chan, void *params);
- void (*release)(struct ast_channel *chan, void *data);
- int (*generate)(struct ast_channel *chan, void *data, int len, int samples);
-};
-
-/*! Structure for all kinds of caller ID identifications */
-struct ast_callerid {
- /*! Malloc'd Dialed Number Identifier */
- char *cid_dnid;
- /*! Malloc'd Caller Number */
- char *cid_num;
- /*! Malloc'd Caller Name */
- char *cid_name;
- /*! Malloc'd ANI */
- char *cid_ani;
- /*! Malloc'd RDNIS */
- char *cid_rdnis;
- /*! Callerid presentation/screening */
- int cid_pres;
- /*! Callerid ANI 2 (Info digits) */
- int cid_ani2;
- /*! Callerid Type of Number */
- int cid_ton;
- /*! Callerid Transit Network Select */
- int cid_tns;
-};
-
-/*! Structure to describe a channel "technology", ie a channel driver
- See
- \arg chan_iax2.c - The Inter-Asterisk exchange protocol
- \arg chan_sip.c - The SIP channel driver
- \arg chan_zap.c - PSTN connectivity (TDM, PRI, T1/E1, FXO, FXS)
-
- If you develop your own channel driver, this is where you
- tell the PBX at registration of your driver what properties
- this driver supports and where different callbacks are
- implemented.
-*/
-
-
-struct ast_channel_tech {
- const char * const type;
- const char * const description;
-
- /*! Bitmap of formats this channel can handle */
- int capabilities;
-
- /*! Technology Properties */
- int properties;
-
- /*! Requester - to set up call data structures (pvt's) */
- struct ast_channel *(* const requester)(const char *type, int format, void *data, int *cause);
-
- /*! Devicestate call back */
- int (* const devicestate)(void *data);
-
- /*! Send a literal DTMF digit */
- int (* const send_digit)(struct ast_channel *chan, char digit);
-
- /*! Call a given phone number (address, etc), but don't
- take longer than timeout seconds to do so. */
- int (* const call)(struct ast_channel *chan, char *addr, int timeout);
-
- /*! Hangup (and possibly destroy) the channel */
- int (* const hangup)(struct ast_channel *chan);
-
- /*! Answer the channel */
- int (* const answer)(struct ast_channel *chan);
-
- /*! Read a frame, in standard format (see frame.h) */
- struct ast_frame * (* const read)(struct ast_channel *chan);
-
- /*! Write a frame, in standard format (see frame.h) */
- int (* const write)(struct ast_channel *chan, struct ast_frame *frame);
-
- /*! Display or transmit text */
- int (* const send_text)(struct ast_channel *chan, const char *text);
-
- /*! Display or send an image */
- int (* const send_image)(struct ast_channel *chan, struct ast_frame *frame);
-
- /*! Send HTML data */
- int (* const send_html)(struct ast_channel *chan, int subclass, const char *data, int len);
-
- /*! Handle an exception, reading a frame */
- struct ast_frame * (* const exception)(struct ast_channel *chan);
-
- /*! Bridge two channels of the same type together */
- enum ast_bridge_result (* const bridge)(struct ast_channel *c0, struct ast_channel *c1, int flags,
- struct ast_frame **fo, struct ast_channel **rc, int timeoutms);
-
- /*! Indicate a particular condition (e.g. AST_CONTROL_BUSY or AST_CONTROL_RINGING or AST_CONTROL_CONGESTION */
- int (* const indicate)(struct ast_channel *c, int condition);
-
- /*! Fix up a channel: If a channel is consumed, this is called. Basically update any ->owner links */
- int (* const fixup)(struct ast_channel *oldchan, struct ast_channel *newchan);
-
- /*! Set a given option */
- int (* const setoption)(struct ast_channel *chan, int option, void *data, int datalen);
-
- /*! Query a given option */
- int (* const queryoption)(struct ast_channel *chan, int option, void *data, int *datalen);
-
- /*! Blind transfer other side (see app_transfer.c and ast_transfer() */
- int (* const transfer)(struct ast_channel *chan, const char *newdest);
-
- /*! Write a frame, in standard format */
- int (* const write_video)(struct ast_channel *chan, struct ast_frame *frame);
-
- /*! Find bridged channel */
- struct ast_channel *(* const bridged_channel)(struct ast_channel *chan, struct ast_channel *bridge);
-};
-
-struct ast_channel_spy_list;
-
-/*! Main Channel structure associated with a channel.
- * This is the side of it mostly used by the pbx and call management.
- */
-struct ast_channel {
- /*! ASCII unique channel name */
- char name[AST_CHANNEL_NAME];
-
- /*! Technology (point to channel driver) */
- const struct ast_channel_tech *tech;
-
- /*! Private data used by the technology driver */
- void *tech_pvt;
-
- /*! Language requested for voice prompts */
- char language[MAX_LANGUAGE];
- /*! Type of channel */
- const char *type;
- /*! File descriptor for channel -- Drivers will poll on these file descriptors, so at least one must be non -1. */
- int fds[AST_MAX_FDS];
-
- /*! Default music class */
- char musicclass[MAX_MUSICCLASS];
- /*! Music State*/
- void *music_state;
- /*! Current generator data if there is any */
- void *generatordata;
- /*! Current active data generator */
- struct ast_generator *generator;
-
- /*! Who are we bridged to, if we're bridged Do not access directly,
- use ast_bridged_channel(chan) */
- struct ast_channel *_bridge;
- /*! Channel that will masquerade as us */
- struct ast_channel *masq;
- /*! Who we are masquerading as */
- struct ast_channel *masqr;
- /*! Call Detail Record Flags */
- int cdrflags;
- /*! Whether or not we have been hung up... Do not set this value
- directly, use ast_softhangup */
- int _softhangup;
- /*! Non-zero, set to actual time when channel is to be hung up */
- time_t whentohangup;
- /*! If anyone is blocking, this is them */
- pthread_t blocker;
- /*! Lock, can be used to lock a channel for some operations */
- ast_mutex_t lock;
- /*! Procedure causing blocking */
- const char *blockproc;
-
- /*! Current application */
- char *appl;
- /*! Data passed to current application */
- char *data;
-
- /*! Which fd had an event detected on */
- int fdno;
- /*! Schedule context */
- struct sched_context *sched;
- /*! For streaming playback, the schedule ID */
- int streamid;
- /*! Stream itself. */
- struct ast_filestream *stream;
- /*! For streaming video playback, the schedule ID */
- int vstreamid;
- /*! Video Stream itself. */
- struct ast_filestream *vstream;
- /*! Original writer format */
- int oldwriteformat;
-
- /*! Timing fd */
- int timingfd;
- int (*timingfunc)(void *data);
- void *timingdata;
-
- /*! State of line -- Don't write directly, use ast_setstate */
- int _state;
- /*! Number of rings so far */
- int rings;
-
- /*! Kinds of data this channel can natively handle */
- int nativeformats;
- /*! Requested read format */
- int readformat;
- /*! Requested write format */
- int writeformat;
-
- struct ast_callerid cid;
-
- /*! Current extension context */
- char context[AST_MAX_CONTEXT];
- /*! Current non-macro context */
- char macrocontext[AST_MAX_CONTEXT];
- /*! Current non-macro extension */
- char macroexten[AST_MAX_EXTENSION];
- /*! Current non-macro priority */
- int macropriority;
- /*! Current extension number */
- char exten[AST_MAX_EXTENSION];
- /* Current extension priority */
- int priority;
- /*! Any/all queued DTMF characters */
- char dtmfq[AST_MAX_EXTENSION];
- /*! DTMF frame */
- struct ast_frame dtmff;
-
- /*! PBX private structure */
- struct ast_pbx *pbx;
- /*! Set BEFORE PBX is started to determine AMA flags */
- int amaflags;
- /*! Account code for billing */
- char accountcode[AST_MAX_ACCOUNT_CODE];
- /*! Call Detail Record */
- struct ast_cdr *cdr;
- /*! Whether or not ADSI is detected on CPE */
- int adsicpe;
- /*! Where to forward to if asked to dial on this interface */
- char call_forward[AST_MAX_EXTENSION];
-
- /*! Tone zone as set in indications.conf */
- struct tone_zone *zone;
-
- /* Channel monitoring */
- struct ast_channel_monitor *monitor;
-
- /*! Track the read/written samples for monitor use */
- unsigned long insmpl;
- unsigned long outsmpl;
-
- /* Frames in/out counters */
- unsigned int fin;
- unsigned int fout;
-
- /* Unique Channel Identifier */
- char uniqueid[32];
-
- /* Why is the channel hanged up */
- int hangupcause;
-
- /* A linked list for variables */
- struct varshead varshead;
-
- unsigned int callgroup;
- unsigned int pickupgroup;
-
- /*! channel flags of AST_FLAG_ type */
- unsigned int flags;
-
- /*! ISDN Transfer Capbility - AST_FLAG_DIGITAL is not enough */
- unsigned short transfercapability;
-
- struct ast_frame *readq;
- int alertpipe[2];
- /*! Write translation path */
- struct ast_trans_pvt *writetrans;
- /*! Read translation path */
- struct ast_trans_pvt *readtrans;
- /*! Raw read format */
- int rawreadformat;
- /*! Raw write format */
- int rawwriteformat;
-
- /*! Chan Spy stuff */
- struct ast_channel_spy_list *spies;
-
- /*! For easy linking */
- struct ast_channel *next;
-};
-
-/* \defgroup chanprop Channel tech properties:
- \brief Channels have this property if they can accept input with jitter; i.e. most VoIP channels */
-/* @{ */
-#define AST_CHAN_TP_WANTSJITTER (1 << 0)
-
-/* This flag has been deprecated by the transfercapbilty data member in struct ast_channel */
-/* #define AST_FLAG_DIGITAL (1 << 0) */ /* if the call is a digital ISDN call */
-#define AST_FLAG_DEFER_DTMF (1 << 1) /*!< if dtmf should be deferred */
-#define AST_FLAG_WRITE_INT (1 << 2) /*!< if write should be interrupt generator */
-#define AST_FLAG_BLOCKING (1 << 3) /*!< if we are blocking */
-#define AST_FLAG_ZOMBIE (1 << 4) /*!< if we are a zombie */
-#define AST_FLAG_EXCEPTION (1 << 5) /*!< if there is a pending exception */
-#define AST_FLAG_MOH (1 << 6) /*!< XXX anthm promises me this will disappear XXX listening to moh */
-#define AST_FLAG_SPYING (1 << 7) /*!< XXX might also go away XXX is spying on someone */
-#define AST_FLAG_NBRIDGE (1 << 8) /*!< is it in a native bridge */
-#define AST_FLAG_IN_AUTOLOOP (1 << 9) /*!< the channel is in an auto-incrementing dialplan processor,
- so when ->priority is set, it will get incremented before
- finding the next priority to run
- */
-/* @} */
-
-#define AST_FEATURE_PLAY_WARNING (1 << 0)
-#define AST_FEATURE_REDIRECT (1 << 1)
-#define AST_FEATURE_DISCONNECT (1 << 2)
-#define AST_FEATURE_ATXFER (1 << 3)
-#define AST_FEATURE_AUTOMON (1 << 4)
-
-#define AST_FEATURE_FLAG_NEEDSDTMF (1 << 0)
-#define AST_FEATURE_FLAG_CALLEE (1 << 1)
-#define AST_FEATURE_FLAG_CALLER (1 << 2)
-
-struct ast_bridge_config {
- struct ast_flags features_caller;
- struct ast_flags features_callee;
- struct timeval start_time;
- long feature_timer;
- long timelimit;
- long play_warning;
- long warning_freq;
- char *warning_sound;
- char *end_sound;
- char *start_sound;
- int firstpass;
- unsigned int flags;
-};
-
-struct chanmon;
-
-#define LOAD_OH(oh) { \
- oh.context = context; \
- oh.exten = exten; \
- oh.priority = priority; \
- oh.cid_num = cid_num; \
- oh.cid_name = cid_name; \
- oh.account = account; \
- oh.vars = vars; \
- oh.parent_channel = NULL; \
-}
-
-struct outgoing_helper {
- const char *context;
- const char *exten;
- int priority;
- const char *cid_num;
- const char *cid_name;
- const char *account;
- struct ast_variable *vars;
- struct ast_channel *parent_channel;
-};
-
-#define AST_CDR_TRANSFER (1 << 0)
-#define AST_CDR_FORWARD (1 << 1)
-#define AST_CDR_CALLWAIT (1 << 2)
-#define AST_CDR_CONFERENCE (1 << 3)
-
-#define AST_ADSI_UNKNOWN (0)
-#define AST_ADSI_AVAILABLE (1)
-#define AST_ADSI_UNAVAILABLE (2)
-#define AST_ADSI_OFFHOOKONLY (3)
-
-#define AST_SOFTHANGUP_DEV (1 << 0) /*!< Soft hangup by device */
-#define AST_SOFTHANGUP_ASYNCGOTO (1 << 1) /*!< Soft hangup for async goto */
-#define AST_SOFTHANGUP_SHUTDOWN (1 << 2)
-#define AST_SOFTHANGUP_TIMEOUT (1 << 3)
-#define AST_SOFTHANGUP_APPUNLOAD (1 << 4)
-#define AST_SOFTHANGUP_EXPLICIT (1 << 5)
-#define AST_SOFTHANGUP_UNBRIDGE (1 << 6)
-
-
-/*! \defgroup ChanState Channel states
-\brief Bits 0-15 of state are reserved for the state (up/down) of the line */
-/*! @{ */
-/*! Channel is down and available */
-#define AST_STATE_DOWN 0
-/*! Channel is down, but reserved */
-#define AST_STATE_RESERVED 1
-/*! Channel is off hook */
-#define AST_STATE_OFFHOOK 2
-/*! Digits (or equivalent) have been dialed */
-#define AST_STATE_DIALING 3
-/*! Line is ringing */
-#define AST_STATE_RING 4
-/*! Remote end is ringing */
-#define AST_STATE_RINGING 5
-/*! Line is up */
-#define AST_STATE_UP 6
-/*! Line is busy */
-#define AST_STATE_BUSY 7
-/*! Digits (or equivalent) have been dialed while offhook */
-#define AST_STATE_DIALING_OFFHOOK 8
-/*! Channel has detected an incoming call and is waiting for ring */
-#define AST_STATE_PRERING 9
-
-/* Bits 16-32 of state are reserved for flags (See \ref ChanState ) */
-/*! Do not transmit voice data */
-#define AST_STATE_MUTE (1 << 16)
-/*! @} */
-
-/*! \brief Change the state of a channel */
-int ast_setstate(struct ast_channel *chan, int state);
-
-/*! \brief Create a channel structure
- \return Returns NULL on failure to allocate.
- \note New channels are
- by default set to the "default" context and
- extension "s"
- */
-struct ast_channel *ast_channel_alloc(int needalertpipe);
-
-/*! \brief Queue an outgoing frame */
-int ast_queue_frame(struct ast_channel *chan, struct ast_frame *f);
-
-/*! \brief Queue a hangup frame */
-int ast_queue_hangup(struct ast_channel *chan);
-
-/*! \brief Queue a control frame */
-int ast_queue_control(struct ast_channel *chan, int control);
-
-
-/*! \brief Change channel name */
-void ast_change_name(struct ast_channel *chan, char *newname);
-
-/*! \brief Free a channel structure */
-void ast_channel_free(struct ast_channel *);
-
-/*! \brief Requests a channel
- * \param type type of channel to request
- * \param format requested channel format
- * \param data data to pass to the channel requester
- * \param status status
- * Request a channel of a given type, with data as optional information used
- * by the low level module
- * \return Returns an ast_channel on success, NULL on failure.
- */
-struct ast_channel *ast_request(const char *type, int format, void *data, int *status);
-
-/*!
- * \brief Request a channel of a given type, with data as optional information used
- * by the low level module and attempt to place a call on it
- * \param type type of channel to request
- * \param format requested channel format
- * \param data data to pass to the channel requester
- * \param timeout maximum amount of time to wait for an answer
- * \param reason why unsuccessful (if unsuceessful)
- * \param cidnum Caller-ID Number
- * \param cidname Caller-ID Name
- * \return Returns an ast_channel on success or no answer, NULL on failure. Check the value of chan->_state
- * to know if the call was answered or not.
- */
-struct ast_channel *ast_request_and_dial(const char *type, int format, void *data, int timeout, int *reason, const char *cidnum, const char *cidname);
-
-struct ast_channel *__ast_request_and_dial(const char *type, int format, void *data, int timeout, int *reason, const char *cidnum, const char *cidname, struct outgoing_helper *oh);
-
-/*!\brief Register a channel technology (a new channel driver)
- * Called by a channel module to register the kind of channels it supports.
- * \param tech Structure defining channel technology or "type"
- * \return Returns 0 on success, -1 on failure.
- */
-int ast_channel_register(const struct ast_channel_tech *tech);
-
-/*! \brief Unregister a channel technology
- * \param tech Structure defining channel technology or "type" that was previously registered
- * \return No return value.
- */
-void ast_channel_unregister(const struct ast_channel_tech *tech);
-
-/*! \brief Get a channel technology structure by name
- * \param name name of technology to find
- * \return a pointer to the structure, or NULL if no matching technology found
- */
-const struct ast_channel_tech *ast_get_channel_tech(const char *name);
-
-/*! \brief Hang up a channel
- * \note This function performs a hard hangup on a channel. Unlike the soft-hangup, this function
- * performs all stream stopping, etc, on the channel that needs to end.
- * chan is no longer valid after this call.
- * \param chan channel to hang up
- * \return Returns 0 on success, -1 on failure.
- */
-int ast_hangup(struct ast_channel *chan);
-
-/*! \brief Softly hangup up a channel
- * \param chan channel to be soft-hung-up
- * Call the protocol layer, but don't destroy the channel structure (use this if you are trying to
- * safely hangup a channel managed by another thread.
- * \param cause Ast hangupcause for hangup
- * \return Returns 0 regardless
- */
-int ast_softhangup(struct ast_channel *chan, int cause);
-
-/*! \brief Softly hangup up a channel (no channel lock)
- * \param chan channel to be soft-hung-up
- * \param cause Ast hangupcause for hangup (see cause.h) */
-int ast_softhangup_nolock(struct ast_channel *chan, int cause);
-
-/*! \brief Check to see if a channel is needing hang up
- * \param chan channel on which to check for hang up
- * This function determines if the channel is being requested to be hung up.
- * \return Returns 0 if not, or 1 if hang up is requested (including time-out).
- */
-int ast_check_hangup(struct ast_channel *chan);
-
-/*! \brief Compare a offset with the settings of when to hang a channel up
- * \param chan channel on which to check for hang up
- * \param offset offset in seconds from current time
- * \return 1, 0, or -1
- * This function compares a offset from current time with the absolute time
- * out on a channel (when to hang up). If the absolute time out on a channel
- * is earlier than current time plus the offset, it returns 1, if the two
- * time values are equal, it return 0, otherwise, it retturn -1.
- */
-int ast_channel_cmpwhentohangup(struct ast_channel *chan, time_t offset);
-
-/*! \brief Set when to hang a channel up
- * \param chan channel on which to check for hang up
- * \param offset offset in seconds from current time of when to hang up
- * This function sets the absolute time out on a channel (when to hang up).
- */
-void ast_channel_setwhentohangup(struct ast_channel *chan, time_t offset);
-
-/*! \brief Answer a ringing call
- * \param chan channel to answer
- * This function answers a channel and handles all necessary call
- * setup functions.
- * \return Returns 0 on success, -1 on failure
- */
-int ast_answer(struct ast_channel *chan);
-
-/*! \brief Make a call
- * \param chan which channel to make the call on
- * \param addr destination of the call
- * \param timeout time to wait on for connect
- * Place a call, take no longer than timeout ms.
- \return Returns -1 on failure, 0 on not enough time
- (does not automatically stop ringing), and
- the number of seconds the connect took otherwise.
- */
-int ast_call(struct ast_channel *chan, char *addr, int timeout);
-
-/*! \brief Indicates condition of channel
- * \note Indicate a condition such as AST_CONTROL_BUSY, AST_CONTROL_RINGING, or AST_CONTROL_CONGESTION on a channel
- * \param chan channel to change the indication
- * \param condition which condition to indicate on the channel
- * \return Returns 0 on success, -1 on failure
- */
-int ast_indicate(struct ast_channel *chan, int condition);
-
-/* Misc stuff ------------------------------------------------ */
-
-/*! \brief Wait for input on a channel
- * \param chan channel to wait on
- * \param ms length of time to wait on the channel
- * Wait for input on a channel for a given # of milliseconds (<0 for indefinite).
- \return Returns < 0 on failure, 0 if nothing ever arrived, and the # of ms remaining otherwise */
-int ast_waitfor(struct ast_channel *chan, int ms);
-
-/*! \brief Wait for a specied amount of time, looking for hangups
- * \param chan channel to wait for
- * \param ms length of time in milliseconds to sleep
- * Waits for a specified amount of time, servicing the channel as required.
- * \return returns -1 on hangup, otherwise 0.
- */
-int ast_safe_sleep(struct ast_channel *chan, int ms);
-
-/*! \brief Wait for a specied amount of time, looking for hangups and a condition argument
- * \param chan channel to wait for
- * \param ms length of time in milliseconds to sleep
- * \param cond a function pointer for testing continue condition
- * \param data argument to be passed to the condition test function
- * \return returns -1 on hangup, otherwise 0.
- * Waits for a specified amount of time, servicing the channel as required. If cond
- * returns 0, this function returns.
- */
-int ast_safe_sleep_conditional(struct ast_channel *chan, int ms, int (*cond)(void*), void *data );
-
-/*! \brief Waits for activity on a group of channels
- * \param chan an array of pointers to channels
- * \param n number of channels that are to be waited upon
- * \param fds an array of fds to wait upon
- * \param nfds the number of fds to wait upon
- * \param exception exception flag
- * \param outfd fd that had activity on it
- * \param ms how long the wait was
- * Big momma function here. Wait for activity on any of the n channels, or any of the nfds
- file descriptors.
- \return Returns the channel with activity, or NULL on error or if an FD
- came first. If the FD came first, it will be returned in outfd, otherwise, outfd
- will be -1 */
-struct ast_channel *ast_waitfor_nandfds(struct ast_channel **chan, int n, int *fds, int nfds, int *exception, int *outfd, int *ms);
-
-/*! Waits for input on a group of channels */
-/*! Wait for input on an array of channels for a given # of milliseconds. Return channel
- with activity, or NULL if none has activity. time "ms" is modified in-place, if applicable */
-struct ast_channel *ast_waitfor_n(struct ast_channel **chan, int n, int *ms);
-
-/*! Waits for input on an fd */
-/*! This version works on fd's only. Be careful with it. */
-int ast_waitfor_n_fd(int *fds, int n, int *ms, int *exception);
-
-
-/*! Reads a frame */
-/*!
- * \param chan channel to read a frame from
- * Read a frame. Returns a frame, or NULL on error. If it returns NULL, you
- best just stop reading frames and assume the channel has been
- disconnected. */
-struct ast_frame *ast_read(struct ast_channel *chan);
-
-/*! Write a frame to a channel */
-/*!
- * \param chan destination channel of the frame
- * \param frame frame that will be written
- * This function writes the given frame to the indicated channel.
- * It returns 0 on success, -1 on failure.
- */
-int ast_write(struct ast_channel *chan, struct ast_frame *frame);
-
-/*! Write video frame to a channel */
-/*!
- * \param chan destination channel of the frame
- * \param frame frame that will be written
- * This function writes the given frame to the indicated channel.
- * It returns 1 on success, 0 if not implemented, and -1 on failure.
- */
-int ast_write_video(struct ast_channel *chan, struct ast_frame *frame);
-
-/* Send empty audio to prime a channel driver */
-int ast_prod(struct ast_channel *chan);
-
-/*! Sets read format on channel chan */
-/*!
- * \param chan channel to change
- * \param format format to change to
- * Set read format for channel to whichever component of "format" is best.
- * Returns 0 on success, -1 on failure
- */
-int ast_set_read_format(struct ast_channel *chan, int format);
-
-/*! Sets write format on channel chan */
-/*!
- * \param chan channel to change
- * \param format new format for writing
- * Set write format for channel to whichever compoent of "format" is best.
- * Returns 0 on success, -1 on failure
- */
-int ast_set_write_format(struct ast_channel *chan, int format);
-
-/*! Sends text to a channel */
-/*!
- * \param chan channel to act upon
- * \param text string of text to send on the channel
- * Write text to a display on a channel
- * Returns 0 on success, -1 on failure
- */
-int ast_sendtext(struct ast_channel *chan, const char *text);
-
-/*! Receives a text character from a channel */
-/*!
- * \param chan channel to act upon
- * \param timeout timeout in milliseconds (0 for infinite wait)
- * Read a char of text from a channel
- * Returns 0 on success, -1 on failure
- */
-int ast_recvchar(struct ast_channel *chan, int timeout);
-
-/*! Send a DTMF digit to a channel */
-/*!
- * \param chan channel to act upon
- * \param digit the DTMF digit to send, encoded in ASCII
- * Send a DTMF digit to a channel.
- * Returns 0 on success, -1 on failure
- */
-int ast_senddigit(struct ast_channel *chan, char digit);
-
-/*! Receives a text string from a channel */
-/*!
- * \param chan channel to act upon
- * \param timeout timeout in milliseconds (0 for infinite wait)
- * \return the received text, or NULL to signify failure.
- * Read a string of text from a channel
- */
-char *ast_recvtext(struct ast_channel *chan, int timeout);
-
-/*! Browse channels in use */
-/*!
- * \param prev where you want to start in the channel list
- * Browse the channels currently in use
- * Returns the next channel in the list, NULL on end.
- * If it returns a channel, that channel *has been locked*!
- */
-struct ast_channel *ast_channel_walk_locked(const struct ast_channel *prev);
-
-/*! Get channel by name (locks channel) */
-struct ast_channel *ast_get_channel_by_name_locked(const char *chan);
-
-/*! Get channel by name prefix (locks channel) */
-struct ast_channel *ast_get_channel_by_name_prefix_locked(const char *name, const int namelen);
-
-/*! Get channel by name prefix (locks channel) */
-struct ast_channel *ast_walk_channel_by_name_prefix_locked(struct ast_channel *chan, const char *name, const int namelen);
-
-/*--- ast_get_channel_by_exten_locked: Get channel by exten (and optionally context) and lock it */
-struct ast_channel *ast_get_channel_by_exten_locked(const char *exten, const char *context);
-
-/*! Waits for a digit */
-/*!
- * \param c channel to wait for a digit on
- * \param ms how many milliseconds to wait
- * Wait for a digit. Returns <0 on error, 0 on no entry, and the digit on success. */
-int ast_waitfordigit(struct ast_channel *c, int ms);
-
-/* Same as above with audio fd for outputing read audio and ctrlfd to monitor for
- reading. Returns 1 if ctrlfd becomes available */
-int ast_waitfordigit_full(struct ast_channel *c, int ms, int audiofd, int ctrlfd);
-
-/*! Reads multiple digits */
-/*!
- * \param c channel to read from
- * \param s string to read in to. Must be at least the size of your length
- * \param len how many digits to read (maximum)
- * \param timeout how long to timeout between digits
- * \param rtimeout timeout to wait on the first digit
- * \param enders digits to end the string
- * Read in a digit string "s", max length "len", maximum timeout between
- digits "timeout" (-1 for none), terminated by anything in "enders". Give them rtimeout
- for the first digit. Returns 0 on normal return, or 1 on a timeout. In the case of
- a timeout, any digits that were read before the timeout will still be available in s.
- RETURNS 2 in full version when ctrlfd is available, NOT 1*/
-int ast_readstring(struct ast_channel *c, char *s, int len, int timeout, int rtimeout, char *enders);
-int ast_readstring_full(struct ast_channel *c, char *s, int len, int timeout, int rtimeout, char *enders, int audiofd, int ctrlfd);
-
-/*! Report DTMF on channel 0 */
-#define AST_BRIDGE_DTMF_CHANNEL_0 (1 << 0)
-/*! Report DTMF on channel 1 */
-#define AST_BRIDGE_DTMF_CHANNEL_1 (1 << 1)
-/*! Return all voice frames on channel 0 */
-#define AST_BRIDGE_REC_CHANNEL_0 (1 << 2)
-/*! Return all voice frames on channel 1 */
-#define AST_BRIDGE_REC_CHANNEL_1 (1 << 3)
-/*! Ignore all signal frames except NULL */
-#define AST_BRIDGE_IGNORE_SIGS (1 << 4)
-
-
-/*! Makes two channel formats compatible */
-/*!
- * \param c0 first channel to make compatible
- * \param c1 other channel to make compatible
- * Set two channels to compatible formats -- call before ast_channel_bridge in general . Returns 0 on success
- and -1 if it could not be done */
-int ast_channel_make_compatible(struct ast_channel *c0, struct ast_channel *c1);
-
-/*! Bridge two channels together */
-/*!
- * \param c0 first channel to bridge
- * \param c1 second channel to bridge
- * \param config config for the channels
- * \param fo destination frame(?)
- * \param rc destination channel(?)
- * Bridge two channels (c0 and c1) together. If an important frame occurs, we return that frame in
- *rf (remember, it could be NULL) and which channel (0 or 1) in rc */
-/* int ast_channel_bridge(struct ast_channel *c0, struct ast_channel *c1, int flags, struct ast_frame **fo, struct ast_channel **rc); */
-int ast_channel_bridge(struct ast_channel *c0,struct ast_channel *c1,struct ast_bridge_config *config, struct ast_frame **fo, struct ast_channel **rc);
-
-/*! Weird function made for call transfers */
-/*!
- * \param original channel to make a copy of
- * \param clone copy of the original channel
- * This is a very strange and freaky function used primarily for transfer. Suppose that
- "original" and "clone" are two channels in random situations. This function takes
- the guts out of "clone" and puts them into the "original" channel, then alerts the
- channel driver of the change, asking it to fixup any private information (like the
- p->owner pointer) that is affected by the change. The physical layer of the original
- channel is hung up. */
-int ast_channel_masquerade(struct ast_channel *original, struct ast_channel *clone);
-
-/*! Gives the string form of a given cause code */
-/*!
- * \param state cause to get the description of
- * Give a name to a cause code
- * Returns the text form of the binary cause code given
- */
-const char *ast_cause2str(int state);
-
-/*! Gives the string form of a given channel state */
-/*!
- * \param state state to get the name of
- * Give a name to a state
- * Returns the text form of the binary state given
- */
-char *ast_state2str(int state);
-
-/*! Gives the string form of a given transfer capability */
-/*!
- * \param transfercapability transfercapabilty to get the name of
- * Give a name to a transfercapbility
- * See above
- * Returns the text form of the binary transfer capbility
- */
-char *ast_transfercapability2str(int transfercapability);
-
-/* Options: Some low-level drivers may implement "options" allowing fine tuning of the
- low level channel. See frame.h for options. Note that many channel drivers may support
- none or a subset of those features, and you should not count on this if you want your
- asterisk application to be portable. They're mainly useful for tweaking performance */
-
-/*! Sets an option on a channel */
-/*!
- * \param channel channel to set options on
- * \param option option to change
- * \param data data specific to option
- * \param datalen length of the data
- * \param block blocking or not
- * Set an option on a channel (see frame.h), optionally blocking awaiting the reply
- * Returns 0 on success and -1 on failure
- */
-int ast_channel_setoption(struct ast_channel *channel, int option, void *data, int datalen, int block);
-
-/*! Pick the best codec */
-/* Choose the best codec... Uhhh... Yah. */
-extern int ast_best_codec(int fmts);
-
-
-/*! Checks the value of an option */
-/*!
- * Query the value of an option, optionally blocking until a reply is received
- * Works similarly to setoption except only reads the options.
- */
-struct ast_frame *ast_channel_queryoption(struct ast_channel *channel, int option, void *data, int *datalen, int block);
-
-/*! Checks for HTML support on a channel */
-/*! Returns 0 if channel does not support HTML or non-zero if it does */
-int ast_channel_supports_html(struct ast_channel *channel);
-
-/*! Sends HTML on given channel */
-/*! Send HTML or URL on link. Returns 0 on success or -1 on failure */
-int ast_channel_sendhtml(struct ast_channel *channel, int subclass, const char *data, int datalen);
-
-/*! Sends a URL on a given link */
-/*! Send URL on link. Returns 0 on success or -1 on failure */
-int ast_channel_sendurl(struct ast_channel *channel, const char *url);
-
-/*! Defers DTMF */
-/*! Defer DTMF so that you only read things like hangups and audio. Returns
- non-zero if channel was already DTMF-deferred or 0 if channel is just now
- being DTMF-deferred */
-int ast_channel_defer_dtmf(struct ast_channel *chan);
-
-/*! Undeos a defer */
-/*! Undo defer. ast_read will return any dtmf characters that were queued */
-void ast_channel_undefer_dtmf(struct ast_channel *chan);
-
-/*! Initiate system shutdown -- prevents new channels from being allocated.
- If "hangup" is non-zero, all existing channels will receive soft
- hangups */
-void ast_begin_shutdown(int hangup);
-
-/*! Cancels an existing shutdown and returns to normal operation */
-void ast_cancel_shutdown(void);
-
-/*! Returns number of active/allocated channels */
-int ast_active_channels(void);
-
-/*! Returns non-zero if Asterisk is being shut down */
-int ast_shutting_down(void);
-
-/*! Activate a given generator */
-int ast_activate_generator(struct ast_channel *chan, struct ast_generator *gen, void *params);
-
-/*! Deactive an active generator */
-void ast_deactivate_generator(struct ast_channel *chan);
-
-void ast_set_callerid(struct ast_channel *chan, const char *cidnum, const char *cidname, const char *ani);
-
-/*! Start a tone going */
-int ast_tonepair_start(struct ast_channel *chan, int freq1, int freq2, int duration, int vol);
-/*! Stop a tone from playing */
-void ast_tonepair_stop(struct ast_channel *chan);
-/*! Play a tone pair for a given amount of time */
-int ast_tonepair(struct ast_channel *chan, int freq1, int freq2, int duration, int vol);
-
-/*! Automatically service a channel for us... */
-int ast_autoservice_start(struct ast_channel *chan);
-
-/*! Stop servicing a channel for us... Returns -1 on error or if channel has been hungup */
-int ast_autoservice_stop(struct ast_channel *chan);
-
-/* If built with zaptel optimizations, force a scheduled expiration on the
- timer fd, at which point we call the callback function / data */
-int ast_settimeout(struct ast_channel *c, int samples, int (*func)(void *data), void *data);
-
-/*! \brief Transfer a channel (if supported). Returns -1 on error, 0 if not supported
- and 1 if supported and requested
- \param chan current channel
- \param dest destination extension for transfer
-*/
-int ast_transfer(struct ast_channel *chan, char *dest);
-
-/*! \brief Start masquerading a channel
- XXX This is a seriously wacked out operation. We're essentially putting the guts of
- the clone channel into the original channel. Start by killing off the original
- channel's backend. I'm not sure we're going to keep this function, because
- while the features are nice, the cost is very high in terms of pure nastiness. XXX
- \param chan Channel to masquerade
-*/
-int ast_do_masquerade(struct ast_channel *chan);
-
-/*! \brief Find bridged channel
- \param chan Current channel
-*/
-struct ast_channel *ast_bridged_channel(struct ast_channel *chan);
-
-/*!
- \brief Inherits channel variable from parent to child channel
- \param parent Parent channel
- \param child Child channel
-
- Scans all channel variables in the parent channel, looking for those
- that should be copied into the child channel.
- Variables whose names begin with a single '_' are copied into the
- child channel with the prefix removed.
- Variables whose names begin with '__' are copied into the child
- channel with their names unchanged.
-*/
-void ast_channel_inherit_variables(const struct ast_channel *parent, struct ast_channel *child);
-
-/*!
- \brief adds a list of channel variables to a channel
- \param chan the channel
- \param vars a linked list of variables
-
- Variable names can be for a regular channel variable or a dialplan function
- that has the ability to be written to.
-*/
-void ast_set_variables(struct ast_channel *chan, struct ast_variable *vars);
-
-/*!
- \brief An opaque 'object' structure use by silence generators on channels.
- */
-struct ast_silence_generator;
-
-/*!
- \brief Starts a silence generator on the given channel.
- \param chan The channel to generate silence on
- \return An ast_silence_generator pointer, or NULL if an error occurs
-
- This function will cause SLINEAR silence to be generated on the supplied
- channel until it is disabled; if the channel cannot be put into SLINEAR
- mode then the function will fail.
-
- The pointer returned by this function must be preserved and passed to
- ast_channel_stop_silence_generator when you wish to stop the silence
- generation.
- */
-struct ast_silence_generator *ast_channel_start_silence_generator(struct ast_channel *chan);
-
-/*!
- \brief Stops a previously-started silence generator on the given channel.
- \param chan The channel to operate on
- \param state The ast_silence_generator pointer return by a previous call to
- ast_channel_start_silence_generator.
- \return nothing
-
- This function will stop the operating silence generator and return the channel
- to its previous write format.
- */
-void ast_channel_stop_silence_generator(struct ast_channel *chan, struct ast_silence_generator *state);
-
-/* Misc. functions below */
-
-/* Helper function for migrating select to poll */
-static inline int ast_fdisset(struct pollfd *pfds, int fd, int max, int *start)
-{
- int x;
- for (x=start ? *start : 0;x<max;x++)
- if (pfds[x].fd == fd) {
- if (start) {
- if (x==*start)
- (*start)++;
- }
- return pfds[x].revents;
- }
- return 0;
-}
-
-#ifdef SOLARIS
-static inline void timersub(struct timeval *tvend, struct timeval *tvstart, struct timeval *tvdiff)
-{
- tvdiff->tv_sec = tvend->tv_sec - tvstart->tv_sec;
- tvdiff->tv_usec = tvend->tv_usec - tvstart->tv_usec;
- if (tvdiff->tv_usec < 0) {
- tvdiff->tv_sec --;
- tvdiff->tv_usec += 1000000;
- }
-
-}
-#endif
-
-/*! \brief Waits for activity on a group of channels
- * \param nfds the maximum number of file descriptors in the sets
- * \param rfds file descriptors to check for read availability
- * \param wfds file descriptors to check for write availability
- * \param efds file descriptors to check for exceptions (OOB data)
- * \param tvp timeout while waiting for events
- * This is the same as a standard select(), except it guarantees the
- * behaviour where the passed struct timeval is updated with how much
- * time was not slept while waiting for the specified events
- */
-static inline int ast_select(int nfds, fd_set *rfds, fd_set *wfds, fd_set *efds, struct timeval *tvp)
-{
-#ifdef __linux__
- return select(nfds, rfds, wfds, efds, tvp);
-#else
- if (tvp) {
- struct timeval tv, tvstart, tvend, tvlen;
- int res;
-
- tv = *tvp;
- gettimeofday(&tvstart, NULL);
- res = select(nfds, rfds, wfds, efds, tvp);
- gettimeofday(&tvend, NULL);
- timersub(&tvend, &tvstart, &tvlen);
- timersub(&tv, &tvlen, tvp);
- if (tvp->tv_sec < 0 || (tvp->tv_sec == 0 && tvp->tv_usec < 0)) {
- tvp->tv_sec = 0;
- tvp->tv_usec = 0;
- }
- return res;
- }
- else
- return select(nfds, rfds, wfds, efds, NULL);
-#endif
-}
-
-#if !defined(ast_strdupa) && defined(__GNUC__)
-# define ast_strdupa(s) \
- (__extension__ \
- ({ \
- __const char *__old = (s); \
- size_t __len = strlen (__old) + 1; \
- char *__new = (char *) __builtin_alloca (__len); \
- (char *) memcpy (__new, __old, __len); \
- }))
-#endif
-
-#ifdef DO_CRASH
-#define CRASH do { fprintf(stderr, "!! Forcing immediate crash a-la abort !!\n"); *((int *)0) = 0; } while(0)
-#else
-#define CRASH do { } while(0)
-#endif
-
-#define CHECK_BLOCKING(c) { \
- if (ast_test_flag(c, AST_FLAG_BLOCKING)) {\
- ast_log(LOG_WARNING, "Thread %ld Blocking '%s', already blocked by thread %ld in procedure %s\n", (long) pthread_self(), (c)->name, (long) (c)->blocker, (c)->blockproc); \
- CRASH; \
- } else { \
- (c)->blocker = pthread_self(); \
- (c)->blockproc = __PRETTY_FUNCTION__; \
- ast_set_flag(c, AST_FLAG_BLOCKING); \
- } }
-
-extern ast_group_t ast_get_group(char *s);
-/* print call- and pickup groups into buffer */
-extern char *ast_print_group(char *buf, int buflen, ast_group_t group);
-
-
-#if defined(__cplusplus) || defined(c_plusplus)
-}
-#endif
-
-#endif /* _ASTERISK_CHANNEL_H */
diff --git a/1.2-netsec/include/asterisk/chanspy.h b/1.2-netsec/include/asterisk/chanspy.h
deleted file mode 100644
index 5b2f5df18..000000000
--- a/1.2-netsec/include/asterisk/chanspy.h
+++ /dev/null
@@ -1,140 +0,0 @@
-/*
- * 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.
- */
-
-/*! \file
- * \brief Asterisk PBX channel spy definitions
- */
-
-#ifndef _ASTERISK_CHANSPY_H
-#define _ASTERISK_CHANSPY_H
-
-#if defined(__cplusplus) || defined(c_plusplus)
-extern "C" {
-#endif
-
-#include "asterisk/linkedlists.h"
-
-enum chanspy_states {
- CHANSPY_NEW = 0, /*!< spy not yet operating */
- CHANSPY_RUNNING = 1, /*!< normal operation, spy is still operating */
- CHANSPY_DONE = 2, /*!< spy is stopped and already removed from channel */
- CHANSPY_STOP = 3, /*!< spy requested to stop, still attached to channel */
-};
-
-enum chanspy_flags {
- CHANSPY_MIXAUDIO = (1 << 0),
- CHANSPY_READ_VOLADJUST = (1 << 1),
- CHANSPY_WRITE_VOLADJUST = (1 << 2),
- CHANSPY_FORMAT_AUDIO = (1 << 3),
- CHANSPY_TRIGGER_MODE = (3 << 4),
- CHANSPY_TRIGGER_READ = (1 << 4),
- CHANSPY_TRIGGER_WRITE = (2 << 4),
- CHANSPY_TRIGGER_NONE = (3 << 4),
- CHANSPY_TRIGGER_FLUSH = (1 << 6),
-};
-
-struct ast_channel_spy_queue {
- struct ast_frame *head;
- unsigned int samples;
- unsigned int format;
-};
-
-struct ast_channel_spy {
- AST_LIST_ENTRY(ast_channel_spy) list;
- ast_mutex_t lock;
- ast_cond_t trigger;
- struct ast_channel_spy_queue read_queue;
- struct ast_channel_spy_queue write_queue;
- unsigned int flags;
- enum chanspy_states status;
- const char *type;
- /* The volume adjustment values are very straightforward:
- positive values cause the samples to be multiplied by that amount
- negative values cause the samples to be divided by the absolute value of that amount
- */
- int read_vol_adjustment;
- int write_vol_adjustment;
-};
-
-/*!
- \brief Adds a spy to a channel, to begin receiving copies of the channel's audio frames.
- \param chan The channel to add the spy to.
- \param spy A pointer to ast_channel_spy structure describing how the spy is to be used.
- \return 0 for success, non-zero for failure
-
- Note: This function performs no locking; you must hold the channel's lock before
- calling this function.
- */
-int ast_channel_spy_add(struct ast_channel *chan, struct ast_channel_spy *spy);
-
-/*!
- \brief Remove a spy from a channel.
- \param chan The channel to remove the spy from
- \param spy The spy to be removed
- \return nothing
-
- Note: This function performs no locking; you must hold the channel's lock before
- calling this function.
- */
-void ast_channel_spy_remove(struct ast_channel *chan, struct ast_channel_spy *spy);
-
-/*!
- \brief Find all spies of a particular type on a channel and stop them.
- \param chan The channel to operate on
- \param type A character string identifying the type of spies to be stopped
- \return nothing
-
- Note: This function performs no locking; you must hold the channel's lock before
- calling this function.
- */
-void ast_channel_spy_stop_by_type(struct ast_channel *chan, const char *type);
-
-/*!
- \brief Read one (or more) frames of audio from a channel being spied upon.
- \param spy The spy to operate on
- \param samples The number of audio samples to read
- \return NULL for failure, one ast_frame pointer, or a chain of ast_frame pointers
-
- This function can return multiple frames if the spy structure needs to be 'flushed'
- due to mismatched queue lengths, or if the spy structure is configured to return
- unmixed audio (in which case each call to this function will return a frame of audio
- from each side of channel).
-
- Note: This function performs no locking; you must hold the spy's lock before calling
- this function. You must <b>not</b> hold the channel's lock at the same time.
- */
-struct ast_frame *ast_channel_spy_read_frame(struct ast_channel_spy *spy, unsigned int samples);
-
-/*!
- \brief Efficiently wait until audio is available for a spy, or an exception occurs.
- \param spy The spy to wait on
- \return nothing
-
- Note: The locking rules for this function are non-obvious... first, you must <b>not</b>
- hold the channel's lock when calling this function. Second, you must hold the spy's lock
- before making the function call; while the function runs the lock will be released, and
- when the trigger event occurs, the lock will be re-obtained. This means that when control
- returns to your code, you will again hold the spy's lock.
- */
-void ast_channel_spy_trigger_wait(struct ast_channel_spy *spy);
-
-#if defined(__cplusplus) || defined(c_plusplus)
-}
-#endif
-
-#endif /* _ASTERISK_CHANSPY_H */
diff --git a/1.2-netsec/include/asterisk/chanvars.h b/1.2-netsec/include/asterisk/chanvars.h
deleted file mode 100644
index d31c05e86..000000000
--- a/1.2-netsec/include/asterisk/chanvars.h
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- * 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.
- */
-
-/*! \file
- * \brief Channel Variables
- */
-
-#ifndef _ASTERISK_CHANVARS_H
-#define _ASTERISK_CHANVARS_H
-
-#include "asterisk/linkedlists.h"
-
-struct ast_var_t {
- AST_LIST_ENTRY(ast_var_t) entries;
- char *value;
- char name[0];
-};
-
-AST_LIST_HEAD_NOLOCK(varshead, ast_var_t);
-
-struct ast_var_t *ast_var_assign(const char *name, const char *value);
-void ast_var_delete(struct ast_var_t *var);
-char *ast_var_name(struct ast_var_t *var);
-char *ast_var_full_name(struct ast_var_t *var);
-char *ast_var_value(struct ast_var_t *var);
-
-#endif /* _ASTERISK_CHANVARS_H */
diff --git a/1.2-netsec/include/asterisk/cli.h b/1.2-netsec/include/asterisk/cli.h
deleted file mode 100644
index 4dcdeab65..000000000
--- a/1.2-netsec/include/asterisk/cli.h
+++ /dev/null
@@ -1,111 +0,0 @@
-/*
- * 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.
- */
-
-/*! \file
- * \brief Standard Command Line Interface
- */
-
-#ifndef _ASTERISK_CLI_H
-#define _ASTERISK_CLI_H
-
-#if defined(__cplusplus) || defined(c_plusplus)
-extern "C" {
-#endif
-
-#include <stdarg.h>
-
-extern void ast_cli(int fd, char *fmt, ...)
- __attribute__ ((format (printf, 2, 3)));
-
-#define RESULT_SUCCESS 0
-#define RESULT_SHOWUSAGE 1
-#define RESULT_FAILURE 2
-
-#define AST_MAX_CMD_LEN 16
-
-#define AST_MAX_ARGS 64
-
-#define AST_CLI_COMPLETE_EOF "_EOF_"
-
-/*! \brief A command line entry */
-struct ast_cli_entry {
- /*! Null terminated list of the words of the command */
- char *cmda[AST_MAX_CMD_LEN];
- /*! Handler for the command (fd for output, # of arguments, argument list). Returns RESULT_SHOWUSAGE for improper arguments */
- int (*handler)(int fd, int argc, char *argv[]);
- /*! Summary of the command (< 60 characters) */
- char *summary;
- /*! Detailed usage information */
- char *usage;
- /*! Generate a list of possible completions for a given word */
- char *(*generator)(char *line, char *word, int pos, int state);
- /*! For linking */
- struct ast_cli_entry *next;
- /*! For keeping track of usage */
- int inuse;
-};
-
-/*! \brief Interprets a command
- * Interpret a command s, sending output to fd
- * Returns 0 on succes, -1 on failure
- */
-extern int ast_cli_command(int fd, char *s);
-
-/*! \brief Registers a command or an array of commands
- * \param e which cli entry to register
- * Register your own command
- * Returns 0 on success, -1 on failure
- */
-extern int ast_cli_register(struct ast_cli_entry *e);
-
-/*!
- * \brief Register multiple commands
- * \param e pointer to first cli entry to register
- * \param len number of entries to register
- */
-extern void ast_cli_register_multiple(struct ast_cli_entry *e, int len);
-
-/*! \brief Unregisters a command or an array of commands
- *
- * \param e which cli entry to unregister
- * Unregister your own command. You must pass a completed ast_cli_entry structure
- * Returns 0.
- */
-extern int ast_cli_unregister(struct ast_cli_entry *e);
-
-/*!
- * \brief Unregister multiple commands
- * \param e pointer to first cli entry to unregister
- * \param len number of entries to unregister
- */
-extern void ast_cli_unregister_multiple(struct ast_cli_entry *e, int len);
-
-/*! \brief Readline madness
- * Useful for readline, that's about it
- * Returns 0 on success, -1 on failure
- */
-extern char *ast_cli_generator(char *, char *, int);
-
-extern int ast_cli_generatornummatches(char *, char *);
-extern char **ast_cli_completion_matches(char *, char *);
-
-#if defined(__cplusplus) || defined(c_plusplus)
-}
-#endif
-
-#endif /* _ASTERISK_CLI_H */
diff --git a/1.2-netsec/include/asterisk/compat.h b/1.2-netsec/include/asterisk/compat.h
deleted file mode 100644
index 139f4f81b..000000000
--- a/1.2-netsec/include/asterisk/compat.h
+++ /dev/null
@@ -1,97 +0,0 @@
-/*
- * Asterisk -- A telephony toolkit for Linux.
- *
- * Copyright (C) 1999-2005, Mark Spencer
- *
- * Mark Spencer <markster@digium.com>
- *
- * This program is free software, distributed under the terms of
- * the GNU General Public License
- */
-
-/*! \file
- * \brief General Definitions for Asterisk top level program
- */
-
-#ifndef _COMPAT_H
-#define _COMPAT_H
-
-#ifdef SOLARIS
-#define __BEGIN_DECLS
-#define __END_DECLS
-
-#ifndef __P
-#define __P(p) p
-#endif
-
-#include <alloca.h>
-#include <strings.h>
-#include <string.h>
-#include <pthread.h>
-#include <sys/stat.h>
-#include <signal.h>
-#include <netinet/in.h>
-
-#ifndef BYTE_ORDER
-#define LITTLE_ENDIAN 1234
-#define BIG_ENDIAN 4321
-
-#ifdef __sparc__
-#define BYTE_ORDER BIG_ENDIAN
-#else
-#define BYTE_ORDER LITTLE_ENDIAN
-#endif
-#endif
-
-#ifndef __BYTE_ORDER
-#define __LITTLE_ENDIAN LITTLE_ENDIAN
-#define __BIG_ENDIAN BIG_ENDIAN
-#define __BYTE_ORDER BYTE_ORDER
-#endif
-
-#ifndef __BIT_TYPES_DEFINED__
-#define __BIT_TYPES_DEFINED__
-typedef unsigned char u_int8_t;
-typedef unsigned short u_int16_t;
-typedef unsigned int u_int32_t;
-#endif
-
-char* strsep(char** str, const char* delims);
-int setenv(const char *name, const char *value, int overwrite);
-int unsetenv(const char *name);
-#endif /* SOLARIS */
-
-#ifdef __CYGWIN__
-#define _WIN32_WINNT 0x0500
-#ifndef INET_ADDRSTRLEN
-#define INET_ADDRSTRLEN 16
-#endif
-#ifndef INET6_ADDRSTRLEN
-#define INET6_ADDRSTRLEN 46
-#endif
-#endif /* __CYGWIN__ */
-
-#define HAVE_VASPRINTF
-#define HAVE_STRTOQ
-
-#ifdef _BSD_SOURCE
-#define HAVE_GETLOADAVG
-#endif
-
-#ifdef __linux__
-#define HAVE_STRCASESTR
-#define HAVE_STRNDUP
-#define HAVE_STRNLEN
-#endif
-
-#ifdef SOLARIS
-#undef HAVE_VASPRINTF
-#undef HAVE_STRTOQ
-#endif
-
-#ifdef __CYGWIN__
-#undef HAVE_STRTOQ
-typedef unsigned long long uint64_t;
-#endif
-
-#endif
diff --git a/1.2-netsec/include/asterisk/compiler.h b/1.2-netsec/include/asterisk/compiler.h
deleted file mode 100644
index 24f6907d1..000000000
--- a/1.2-netsec/include/asterisk/compiler.h
+++ /dev/null
@@ -1,33 +0,0 @@
-/*
- * 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.
- */
-
-/*! \file
- * \brief Compiler-specific macros and other items
- */
-
-#ifndef _ASTERISK_COMPILER_H
-#define _ASTERISK_COMPILER_H
-
-#if __GNUC__ < 2 || (__GNUC__ == 2 && __GNUC_MINOR__ < 96)
-#define __builtin_expect(exp, c) (exp)
-#define force_inline inline
-#else
-#define force_inline inline __attribute__((always_inline))
-#endif
-
-#endif /* _ASTERISK_COMPILER_H */
diff --git a/1.2-netsec/include/asterisk/config.h b/1.2-netsec/include/asterisk/config.h
deleted file mode 100644
index aa639aaae..000000000
--- a/1.2-netsec/include/asterisk/config.h
+++ /dev/null
@@ -1,194 +0,0 @@
-/*
- * 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.
- */
-
-/*! \file
- * \brief Configuration File Parser
- */
-
-#ifndef _ASTERISK_CONFIG_H
-#define _ASTERISK_CONFIG_H
-
-#if defined(__cplusplus) || defined(c_plusplus)
-extern "C" {
-#endif
-
-#include <stdarg.h>
-
-struct ast_config;
-
-struct ast_category;
-
-struct ast_variable {
- char *name;
- char *value;
- int lineno;
- int object; /*!< 0 for variable, 1 for object */
- int blanklines; /*!< Number of blanklines following entry */
- struct ast_comment *precomments;
- struct ast_comment *sameline;
- struct ast_variable *next;
- char stuff[0];
-};
-
-typedef struct ast_config *config_load_func(const char *database, const char *table, const char *configfile, struct ast_config *config);
-typedef struct ast_variable *realtime_var_get(const char *database, const char *table, va_list ap);
-typedef struct ast_config *realtime_multi_get(const char *database, const char *table, va_list ap);
-typedef int realtime_update(const char *database, const char *table, const char *keyfield, const char *entity, va_list ap);
-
-struct ast_config_engine {
- char *name;
- config_load_func *load_func;
- realtime_var_get *realtime_func;
- realtime_multi_get *realtime_multi_func;
- realtime_update *update_func;
- struct ast_config_engine *next;
-};
-
-/*! \brief Load a config file
- * \param filename path of file to open. If no preceding '/' character, path is considered relative to AST_CONFIG_DIR
- * Create a config structure from a given configuration file.
- *
- * Returns NULL on error, or an ast_config data structure on success
- */
-struct ast_config *ast_config_load(const char *filename);
-
-/*! \brief Destroys a config
- * \param config pointer to config data structure
- * Free memory associated with a given config
- *
- */
-void ast_config_destroy(struct ast_config *config);
-
-/*! \brief Goes through categories
- * \param config Which config structure you wish to "browse"
- * \param prev A pointer to a previous category.
- * This funtion is kind of non-intuitive in it's use. To begin, one passes NULL as the second arguement. It will return a pointer to the string of the first category in the file. From here on after, one must then pass the previous usage's return value as the second pointer, and it will return a pointer to the category name afterwards.
- *
- * Returns a category on success, or NULL on failure/no-more-categories
- */
-char *ast_category_browse(struct ast_config *config, const char *prev);
-
-/*! \brief Goes through variables
- * Somewhat similar in intent as the ast_category_browse.
- * List variables of config file category
- *
- * Returns ast_variable list on success, or NULL on failure
- */
-struct ast_variable *ast_variable_browse(const struct ast_config *config, const char *category);
-
-/*! \brief Gets a variable
- * \param config which (opened) config to use
- * \param category category under which the variable lies
- * \param variable which variable you wish to get the data for
- * Goes through a given config file in the given category and searches for the given variable
- *
- * Returns the variable value on success, or NULL if unable to find it.
- */
-char *ast_variable_retrieve(const struct ast_config *config, const char *category, const char *variable);
-
-/*! \brief Retrieve a category if it exists
- * \param config which config to use
- * \param category_name name of the category you're looking for
- * This will search through the categories within a given config file for a match.
- *
- * Returns pointer to category if found, NULL if not.
- */
-struct ast_category *ast_category_get(const struct ast_config *config, const char *category_name);
-
-/*! \brief Check for category duplicates
- * \param config which config to use
- * \param category_name name of the category you're looking for
- * This will search through the categories within a given config file for a match.
- *
- * Return non-zero if found
- */
-int ast_category_exist(const struct ast_config *config, const char *category_name);
-
-/*! \brief Retrieve realtime configuration
- * \param family which family/config to lookup
- * This will use builtin configuration backends to look up a particular
- * entity in realtime and return a variable list of its parameters. Note
- * that unlike the variables in ast_config, the resulting list of variables
- * MUST be fred with ast_free_runtime() as there is no container.
- */
-struct ast_variable *ast_load_realtime(const char *family, ...);
-
-/*! \brief Retrieve realtime configuration
- * \param family which family/config to lookup
- * This will use builtin configuration backends to look up a particular
- * entity in realtime and return a variable list of its parameters. Unlike
- * the ast_load_realtime, this function can return more than one entry and
- * is thus stored inside a taditional ast_config structure rather than
- * just returning a linked list of variables.
- */
-struct ast_config *ast_load_realtime_multientry(const char *family, ...);
-
-/*! \brief Update realtime configuration
- * \param family which family/config to be updated
- * \param keyfield which field to use as the key
- * \param lookup which value to look for in the key field to match the entry.
- * This function is used to update a parameter in realtime configuration space.
- *
- */
-int ast_update_realtime(const char *family, const char *keyfield, const char *lookup, ...);
-
-/*! \brief Check if realtime engine is configured for family
- * returns 1 if family is configured in realtime and engine exists
- * \param family which family/config to be checked
-*/
-int ast_check_realtime(const char *family);
-
-/*! \brief Free variable list
- * \param var the linked list of variables to free
- * This function frees a list of variables.
- */
-void ast_variables_destroy(struct ast_variable *var);
-
-/*! \brief Register config engine */
-int ast_config_engine_register(struct ast_config_engine *newconfig);
-
-/*! \brief Deegister config engine */
-int ast_config_engine_deregister(struct ast_config_engine *del);
-
-int register_config_cli(void);
-void read_config_maps(void);
-
-struct ast_config *ast_config_new(void);
-struct ast_category *ast_config_get_current_category(const struct ast_config *cfg);
-void ast_config_set_current_category(struct ast_config *cfg, const struct ast_category *cat);
-
-struct ast_category *ast_category_new(const char *name);
-void ast_category_append(struct ast_config *config, struct ast_category *cat);
-int ast_category_delete(struct ast_config *cfg, char *category);
-void ast_category_destroy(struct ast_category *cat);
-struct ast_variable *ast_category_detach_variables(struct ast_category *cat);
-void ast_category_rename(struct ast_category *cat, const char *name);
-
-struct ast_variable *ast_variable_new(const char *name, const char *value);
-void ast_variable_append(struct ast_category *category, struct ast_variable *variable);
-int ast_variable_delete(struct ast_config *cfg, char *category, char *variable, char *value);
-
-int config_text_file_save(const char *filename, const struct ast_config *cfg, const char *generator);
-
-struct ast_config *ast_config_internal_load(const char *configfile, struct ast_config *cfg);
-
-#if defined(__cplusplus) || defined(c_plusplus)
-}
-#endif
-
-#endif /* _ASTERISK_CONFIG_H */
diff --git a/1.2-netsec/include/asterisk/crypto.h b/1.2-netsec/include/asterisk/crypto.h
deleted file mode 100644
index d0f852caf..000000000
--- a/1.2-netsec/include/asterisk/crypto.h
+++ /dev/null
@@ -1,112 +0,0 @@
-/*
- * 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.
- */
-
-/*! \file
- * \brief Provide cryptographic signature routines
- */
-
-#ifndef _ASTERISK_CRYPTO_H
-#define _ASTERISK_CRYPTO_H
-
-#if defined(__cplusplus) || defined(c_plusplus)
-extern "C" {
-#endif
-
-#define AST_KEY_PUBLIC (1 << 0)
-#define AST_KEY_PRIVATE (1 << 1)
-
-struct ast_key;
-
-/*! \brief Retrieve a key
- * \param name of the key we are retrieving
- * \param int type of key (AST_KEY_PUBLIC or AST_KEY_PRIVATE)
- *
- * Returns the key on success or NULL on failure
- */
-extern struct ast_key *(*ast_key_get)(const char *key, int type);
-
-/*! \brief Check the authenticity of a message signature using a given public key
- * \param key a public key to use to verify
- * \param msg the message that has been signed
- * \param sig the proposed valid signature in mime64-like encoding
- *
- * Returns 0 if the signature is valid, or -1 otherwise
- *
- */
-extern int (*ast_check_signature)(struct ast_key *key, const char *msg, const char *sig);
-
-/*! \brief Check the authenticity of a message signature using a given public key
- * \param key a public key to use to verify
- * \param msg the message that has been signed
- * \param sig the proposed valid signature in raw binary representation
- *
- * Returns 0 if the signature is valid, or -1 otherwise
- *
- */
-extern int (*ast_check_signature_bin)(struct ast_key *key, const char *msg, int msglen, const unsigned char *sig);
-
-/*!
- * \param key a private key to use to create the signature
- * \param msg the message to sign
- * \param sig a pointer to a buffer of at least 256 bytes in which the
- * mime64-like encoded signature will be stored
- *
- * Returns 0 on success or -1 on failure.
- *
- */
-extern int (*ast_sign)(struct ast_key *key, char *msg, char *sig);
-
-/*!
- * \param key a private key to use to create the signature
- * \param msg the message to sign
- * \param sig a pointer to a buffer of at least 128 bytes in which the
- * raw encoded signature will be stored
- *
- * Returns 0 on success or -1 on failure.
- *
- */
-extern int (*ast_sign_bin)(struct ast_key *key, const char *msg, int msglen, unsigned char *sig);
-
-/*!
- * \param key a private key to use to encrypt
- * \param src the message to encrypt
- * \param srclen the length of the message to encrypt
- * \param dst a pointer to a buffer of at least srclen * 1.5 bytes in which the encrypted
- * answer will be stored
- *
- * Returns length of encrypted data on success or -1 on failure.
- *
- */
-extern int (*ast_encrypt_bin)(unsigned char *dst, const unsigned char *src, int srclen, struct ast_key *key);
-
-/*!
- * \param key a private key to use to decrypt
- * \param src the message to decrypt
- * \param srclen the length of the message to decrypt
- * \param dst a pointer to a buffer of at least srclen bytes in which the decrypted
- * answer will be stored
- *
- * Returns length of decrypted data on success or -1 on failure.
- *
- */
-extern int (*ast_decrypt_bin)(unsigned char *dst, const unsigned char *src, int srclen, struct ast_key *key);
-#if defined(__cplusplus) || defined(c_plusplus)
-}
-#endif
-
-#endif /* _ASTERISK_CRYPTO_H */
diff --git a/1.2-netsec/include/asterisk/devicestate.h b/1.2-netsec/include/asterisk/devicestate.h
deleted file mode 100644
index e41b9ee27..000000000
--- a/1.2-netsec/include/asterisk/devicestate.h
+++ /dev/null
@@ -1,104 +0,0 @@
-/*
- * 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.
- */
-
-/*! \file
- * \brief Device state management
- */
-
-#ifndef _ASTERISK_DEVICESTATE_H
-#define _ASTERISK_DEVICESTATE_H
-
-#if defined(__cplusplus) || defined(c_plusplus)
-extern "C" {
-#endif
-
-/*! Device is valid but channel didn't know state */
-#define AST_DEVICE_UNKNOWN 0
-/*! Device is not used */
-#define AST_DEVICE_NOT_INUSE 1
-/*! Device is in use */
-#define AST_DEVICE_INUSE 2
-/*! Device is busy */
-#define AST_DEVICE_BUSY 3
-/*! Device is invalid */
-#define AST_DEVICE_INVALID 4
-/*! Device is unavailable */
-#define AST_DEVICE_UNAVAILABLE 5
-/*! Device is ringing */
-#define AST_DEVICE_RINGING 6
-
-typedef int (*ast_devstate_cb_type)(const char *dev, int state, void *data);
-
-/*! \brief Convert device state to text string for output
- * \param devstate Current device state
- */
-const char *devstate2str(int devstate);
-
-/*! \brief Search the Channels by Name
- * \param device like a dialstring
- * Search the Device in active channels by compare the channelname against
- * the devicename. Compared are only the first chars to the first '-' char.
- * Returns an AST_DEVICE_UNKNOWN if no channel found or
- * AST_DEVICE_INUSE if a channel is found
- */
-int ast_parse_device_state(const char *device);
-
-/*! \brief Asks a channel for device state
- * \param device like a dialstring
- * Asks a channel for device state, data is normaly a number from dialstring
- * used by the low level module
- * Trys the channel devicestate callback if not supported search in the
- * active channels list for the device.
- * Returns an AST_DEVICE_??? state -1 on failure
- */
-int ast_device_state(const char *device);
-
-/*! \brief Tells Asterisk the State for Device is changed
- * \param fmt devicename like a dialstring with format parameters
- * Asterisk polls the new extensionstates and calls the registered
- * callbacks for the changed extensions
- * Returns 0 on success, -1 on failure
- */
-int ast_device_state_changed(const char *fmt, ...)
- __attribute__ ((format (printf, 1, 2)));
-
-
-/*! \brief Tells Asterisk the State for Device is changed
- * \param device devicename like a dialstrin
- * Asterisk polls the new extensionstates and calls the registered
- * callbacks for the changed extensions
- * Returns 0 on success, -1 on failure
- */
-int ast_device_state_changed_literal(const char *device);
-
-/*! \brief Registers a device state change callback
- * \param callback Callback
- * \param data to pass to callback
- * The callback is called if the state for extension is changed
- * Return -1 on failure, ID on success
- */
-int ast_devstate_add(ast_devstate_cb_type callback, void *data);
-void ast_devstate_del(ast_devstate_cb_type callback, void *data);
-
-int ast_device_state_engine_init(void);
-
-#if defined(__cplusplus) || defined(c_plusplus)
-}
-#endif
-
-#endif /* _ASTERISK_DEVICESTATE_H */
diff --git a/1.2-netsec/include/asterisk/dlfcn-compat.h b/1.2-netsec/include/asterisk/dlfcn-compat.h
deleted file mode 100644
index 2ce827a6a..000000000
--- a/1.2-netsec/include/asterisk/dlfcn-compat.h
+++ /dev/null
@@ -1,88 +0,0 @@
-/*
- * Asterisk -- An open source telephony toolkit.
- *
- * 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.
- */
-
-/*
-Copyright (c) 2002 Jorge Acereda <jacereda@users.sourceforge.net> &
- Peter O'Gorman <ogorman@users.sourceforge.net>
-
-Portions may be copyright others, see the AUTHORS file included with this
-distribution.
-
-Maintained by Peter O'Gorman <ogorman@users.sourceforge.net>
-
-Bug Reports and other queries should go to <ogorman@users.sourceforge.net>
-
-Permission is hereby granted, free of charge, to any person obtaining
-a copy of this software and associated documentation files (the
-"Software"), to deal in the Software without restriction, including
-without limitation the rights to use, copy, modify, merge, publish,
-distribute, sublicense, and/or sell copies of the Software, and to
-permit persons to whom the Software is furnished to do so, subject to
-the following conditions:
-
-The above copyright notice and this permission notice shall be
-included in all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-*/
-
-#ifndef _DLFCN_H_
-#define _DLFCN_H_
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-#if defined (__GNUC__) && __GNUC__ > 3
-#define dl_restrict __restrict
-#else
-#define dl_restrict
-#endif
-/*
- * Structure filled in by dladdr().
- */
-
-typedef struct dl_info {
- const char *dli_fname; /* Pathname of shared object */
- void *dli_fbase; /* Base address of shared object */
- const char *dli_sname; /* Name of nearest symbol */
- void *dli_saddr; /* Address of nearest symbol */
-} Dl_info;
-
-extern void * dlopen(const char *path, int mode);
-extern void * dlsym(void * dl_restrict handle, const char * dl_restrict symbol);
-extern const char * dlerror(void);
-extern int dlclose(void * handle);
-extern int dladdr(const void * dl_restrict, Dl_info * dl_restrict);
-
-#define RTLD_LAZY 0x1
-#define RTLD_NOW 0x2
-#define RTLD_LOCAL 0x4
-#define RTLD_GLOBAL 0x8
-#define RTLD_NOLOAD 0x10
-#define RTLD_NODELETE 0x80
-
-/*
- * Special handle arguments for dlsym().
- */
-#define RTLD_NEXT ((void *) -1) /* Search subsequent objects. */
-#define RTLD_DEFAULT ((void *) -2) /* Use default search algorithm. */
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* _DLFCN_H_ */
diff --git a/1.2-netsec/include/asterisk/dns.h b/1.2-netsec/include/asterisk/dns.h
deleted file mode 100644
index 18ebaf585..000000000
--- a/1.2-netsec/include/asterisk/dns.h
+++ /dev/null
@@ -1,39 +0,0 @@
-/*
- * Asterisk -- An open source telephony toolkit.
- *
- * Written by Thorsten Lockert <tholo@trollphone.org>
- *
- * Funding provided by Troll Phone Networks AS
- *
- * 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.
- */
-
-/*! \file
- * \brief DNS support for Asterisk
- * \author Thorsten Lockert <tholo@trollphone.org>
- */
-
-#ifndef _ASTERISK_DNS_H
-#define _ASTERISK_DNS_H
-
-struct ast_channel;
-
-/*! \brief Perform DNS lookup (used by enum and SRV lookups)
- \param context
- \param dname Domain name to lookup (host, SRV domain, TXT record name)
- \param class Record Class (see "man res_search")
- \param type Record type (see "man res_search")
- \param callback Callback function for handling DNS result
-*/
-extern int ast_search_dns(void *context, const char *dname, int class, int type,
- int (*callback)(void *context, char *answer, int len, char *fullanswer));
-
-#endif /* _ASTERISK_DNS_H */
diff --git a/1.2-netsec/include/asterisk/dnsmgr.h b/1.2-netsec/include/asterisk/dnsmgr.h
deleted file mode 100644
index b5cc2a7ed..000000000
--- a/1.2-netsec/include/asterisk/dnsmgr.h
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- * Asterisk -- An open source telephony toolkit.
- *
- * Copyright (C) 1999 - 2005, Digium, Inc.
- *
- * Kevin P. Fleming <kpfleming@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.
- */
-
-/*! \file
- * \brief Background DNS update manager
- */
-
-#ifndef _ASTERISK_DNSMGR_H
-#define _ASTERISK_DNSMGR_H
-
-#if defined(__cplusplus) || defined(c_plusplus)
-extern "C" {
-#endif
-
-#include <netinet/in.h>
-
-struct ast_dnsmgr_entry;
-
-struct ast_dnsmgr_entry *ast_dnsmgr_get(const char *name, struct in_addr *result);
-
-void ast_dnsmgr_release(struct ast_dnsmgr_entry *entry);
-
-int ast_dnsmgr_lookup(const char *name, struct in_addr *result, struct ast_dnsmgr_entry **dnsmgr);
-
-#if defined(__cplusplus) || defined(c_plusplus)
-}
-#endif /* c_plusplus */
-
-#endif /* ASTERISK_DNSMGR_H */
diff --git a/1.2-netsec/include/asterisk/doxyref.h b/1.2-netsec/include/asterisk/doxyref.h
deleted file mode 100644
index 507e112b3..000000000
--- a/1.2-netsec/include/asterisk/doxyref.h
+++ /dev/null
@@ -1,449 +0,0 @@
-/*
- * 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.
- */
-
-/* \file This file generates Doxygen pages from files in the /doc
- directory of the Asterisk source code tree
- */
-
-/* The following is for Doxygen Developer's documentation generated
- * by running "make progdocs" with doxygen installed on your
- * system.
- */
-/*! \page DevDoc Asterisk Developer's Documentation - appendices
- * \arg \ref CodeGuide : The must-read document for all developer's
- * \arg \ref AstAPI
- * \arg \ref Def_Channel : What's a channel, anyway?
- * \arg \ref channel_drivers : Existing channel drivers
- * \arg \ref AstDebug : Hints on debugging
- * \arg \ref AstAMI : The Call management socket API
- * \arg \ref AstARA : A generic data storage and retrieval API for Asterisk
- * \arg \ref AstDUNDi : A way to find phone services dynamically by using the DUNDi protocol
- * \arg \ref AstCDR
- * \arg \ref AstREADME
- * \arg \ref AstVar
- * \arg \ref AstENUM : The IETF way to redirect from phone numbers to VoIP calls
- * \arg \ref ConfigFiles
- * \arg \ref SoundFiles included in the Asterisk distribution
- * \arg \ref AstCREDITS : A Thank You to contributors
- \n\n
- * \section weblinks Web sites
- * \arg \b Main: Asterisk Developer's website http://www.asterisk.org/developers/
- * \arg \b Bugs: The Issue tracker http://bugs.digium.com
- * \arg \b Lists: List server http://lists.digium.com
- * \arg \b Wiki: The Asterisk Wiki http://www.voip-info.org
- * \arg \b Docs: The Asterisk Documentation Project http://www.asteriskdocs.org
- * \arg \b Digium: The Asterisk company http://www.digium.com
- *
- */
-
-/*! \page CodeGuide Coding Guidelines
- * \section Coding Guidelines
- * This file is in the /doc directory in your Asterisk source tree.
- * Make sure to stay up to date with the latest guidelines.
- * \verbinclude CODING-GUIDELINES
- */
-
-/*! \page AstAPI Asterisk API
- * \section Asteriskapi Asterisk API
- * Some generic documents on the Asterisk architecture
- * \subsection model_txt Generic Model
- * \verbinclude model.txt
- * \subsection channel_txt Channels
- * \arg See \link Def_Channel
- * \verbinclude channel.txt
- */
-
-/*! \page AstDebug Debugging
- * \section debug Debugging
- * \verbinclude README.backtrace
- */
-
-/*! \page AstAMI AMI - The Manager Interface
- * \section ami AMI - The manager Interface
- * \arg \link Config_ami Configuration file \endlink
- * \arg \ref manager.c
- * \verbinclude manager.txt
- */
-
-/*! \page AstARA ARA - The Asterisk Realtime Interface
- * \section realtime ARA - a generic API to storage and retrieval
- * Implemented in \ref config.c
- * Implemented in \ref pbx_realtime.c
- * \verbinclude README.realtime
- * \verbinclude README.extconfig
- */
-
-/*! \page AstDUNDi DUNDi
-DUNDi is a peer-to-peer system for locating Internet gateways to telephony services. Unlike traditional centralized services (such as the remarkably simple and concise ENUM standard), DUNDi is fully-distributed with no centralized authority whatsoever.
-
-DUNDi is not itself a Voice-over IP signaling or media protocol. Instead, it publishes routes which are in turn accessed via industry standard protocols such as IAX, SIP and H.323.
-
- \par References
- \arg DUNDi is documented at http://www.dundi.com
- \arg Implemented in \ref pbx_dundi.c and \ref dundi-parser.c
- \arg Configuration in \link Config_dun dundi.conf \endlink
- */
-
-/*! \page AstCDR CDR - Call Data Records and billing
- * \section cdr Call Data Records
- * \par See also
- * \arg \ref cdr.c
- * \arg \ref cdr_drivers
- * \arg \ref Config_cdr CDR configuration files
- *
- * \verbinclude README.cdr
- */
-
-/*! \page AstREADME README - the general administrator introduction
- * \verbinclude README
- */
-
-/*! \page AstCREDITS CREDITS
- * \verbinclude CREDITS
- */
-
-/*! \page AstVar Global channel variables
- * \section globchan Global Channel Variables
- * \verbinclude README.variables
- */
-
-/*! \page AstENUM ENUM
- * \section enumreadme ENUM
- * \arg Configuration: \ref Config_enum
- * \arg \ref enum.c
- * \arg \ref app_enumlookup.c
- *
- * \verbinclude README.enum
- */
-
-/*! \page ConfigFiles Configuration files
- * \section config Main configuration files
- * \arg \link Config_ast asterisk.conf - the main configuration file \endlink
- * \arg \link Config_ext extensions.conf - The Dial Plan \endlink
- * \arg \link Config_mod modules.conf - which modules to load and not to load \endlink
- * \arg \link Config_fea features.conf - call features (transfer, parking, etc) \endlink
- * \section chanconf Channel configuration files
- * \arg \link Config_iax IAX2 configuration \endlink
- * \arg \link Config_sip SIP configuration \endlink
- * \arg \link Config_mgcp MGCP configuration \endlink
- * \arg \link Config_rtp RTP configuration \endlink
- * \arg \link Config_zap Zaptel configuration \endlink
- * \arg \link Config_oss OSS (sound card) configuration \endlink
- * \arg \link Config_alsa ALSA (sound card) configuration \endlink
- * \arg \link Config_agent Agent (proxy channel) configuration \endlink
- * \arg \link Config_misdn MISDN Experimental ISDN BRI channel configuration \endlink
- * \arg \link Config_h323 H.323 configuration \endlink
- * \section appconf Application configuration files
- * \arg \link Config_mm Meetme (conference bridge) configuration \endlink
- * \arg \link Config_qu Queue system configuration \endlink
- * \arg \link Config_vm Voicemail configuration \endlink
- * \section cdrconf CDR configuration files
- * \arg \link Config_cdr CDR configuration \endlink
- * \arg \link cdr_custom Custom CDR driver configuration \endlink
- * \arg \link cdr_ami Manager CDR driver configuration \endlink
- * \arg \link cdr_odbc ODBC CDR driver configuration \endlink
- * \arg \link cdr_pgsql PostgreSQL CDR driver configuration \endlink
- * \arg \link cdr_sqlite SQLite CDR driver configuration \endlink
- * \arg \link cdr_tds FreeTDS CDR driver configuration (Microsoft SQL Server) \endlink
- * \section miscconf Miscellenaous configuration files
- * \arg \link Config_adsi ADSI configuration \endlink
- * \arg \link Config_ami AMI - Manager configuration \endlink
- * \arg \link Config_ara Realtime configuration \endlink
- * \arg \link Config_codec Codec configuration \endlink
- * \arg \link Config_dun DUNDi configuration \endlink
- * \arg \link Config_enum ENUM configuration \endlink
- * \arg \link Config_moh Music on Hold configuration \endlink
- * \arg \link Config_vm Voicemail configuration \endlink
- */
-
-/*! \page Config_ast Asterisk.conf
- * \verbinclude README.asterisk.conf
- */
-/*! \page Config_mod Modules configuration
- * All res_ resource modules are loaded with globals on, which means
- * that non-static functions are callable from other modules.
- *
- * If you want your non res_* module to export functions to other modules
- * you have to include it in the [global] section.
- * \verbinclude modules.conf.sample
- */
-
-/*! \page Config_fea Call features configuration
- * \par See also
- * \arg \ref res_features.c : Call feature implementation
- * \section featconf features.conf
- * \verbinclude features.conf.sample
- */
-
-/*! \page Config_ext Extensions.conf - the Dial Plan
- * \section dialplan Extensions.conf
- * \verbinclude extensions.conf.sample
- */
-
-/*! \page Config_iax IAX2 configuration
- * IAX2 is implemented in \ref chan_iax2.c
- * \arg \link Config_iax iax.conf Configuration file example \endlink
- * \section iaxreadme IAX readme file
- * \verbinclude README.iax
- * \section Config_iax IAX Configuration example
- * \verbinclude iax.conf.sample
- * \section iaxjitter IAX Jitterbuffer information
- * \verbinclude README.jitterbuffer
- */
-
-/*! \page Config_iax IAX configuration
- * \arg Implemented in \ref chan_iax2.c
- * \section iaxconf iax.conf
- * \verbinclude iax.conf.sample
- */
-
-/*! \page Config_sip SIP configuration
- * Also see \ref Config_rtp RTP configuration
- * \arg Implemented in \ref chan_sip.c
- * \section sipconf sip.conf
- * \verbinclude sip.conf.sample
- *
- * \arg \b Back \ref chanconf
- */
-
-/*! \page Config_mgcp MGCP configuration
- * Also see \ref Config_rtp RTP configuration
- * \arg Implemented in \ref chan_mgcp.c
- * \section mgcpconf mgcp.conf
- * \verbinclude mgcp.conf.sample
- */
-
-/*! \page Config_misdn MISDN configuration
- * \arg Implemented in \ref chan_misdn.c
- * \section misdnconf misdn.conf
- * \verbinclude misdn.conf.sample
- */
-
-/*! \page Config_vm VoiceMail configuration
- * \section vmconf voicemail.conf
- * \arg Implemented in \ref app_voicemail.c
- * \verbinclude voicemail.conf.sample
- */
-
-/*! \page Config_zap Zaptel configuration
- * \section zapconf zapata.conf
- * \arg Implemented in \ref chan_zap.c
- * \verbinclude zapata.conf.sample
- */
-
-/*! \page Config_h323 H.323 channel driver information
- * This is the configuration of the H.323 channel driver within the Asterisk
- * distribution. There's another one, called OH323, in asterisk-addons
- * \arg Implemented in \ref chan_h323.c
- * \section h323conf h323.conf
- * \ref chan_h323.c
- * \verbinclude README.h323
- */
-
-/*! \page Config_oss OSS configuration
- * \section ossconf oss.conf
- * \arg Implemented in \ref chan_oss.c
- * \verbinclude oss.conf.sample
- */
-
-/*! \page Config_alsa ALSA configuration
- * \section alsaconf alsa.conf
- * \arg Implemented in \ref chan_alsa.c
- * \verbinclude alsa.conf.sample
- */
-
-/*! \page Config_agent Agent configuration
- * \section agentconf agents.conf
- * The agent channel is a proxy channel for queues
- * \arg Implemented in \ref chan_agent.c
- * \verbinclude agents.conf.sample
- */
-
-/*! \page Config_rtp RTP configuration
- * \arg Implemented in \ref rtp.c
- * Used in \ref chan_sip.c and \ref chan_mgcp.c (and various H.323 channels)
- * \section rtpconf rtp.conf
- * \verbinclude rtp.conf.sample
- */
-
-/*! \page Config_dun DUNDi Configuration
- * \arg See also \ref AstDUNDi
- * \section dundiconf dundi.conf
- * \verbinclude dundi.conf.sample
- */
-
-/*! \page Config_enum ENUM Configuration
- * \section enumconf enum.conf
- * \arg See also \ref enumreadme
- * \arg Implemented in \ref app_enumlookup.c and \ref enum.c
- * \verbinclude enum.conf.sample
- */
-
-/*! \page cdr_custom Custom CDR Configuration
- * \par See also
- * \arg \ref cdrconf
- * \arg \ref cdr_custom.c
- * \verbinclude cdr_custom.conf.sample
- */
-
-/*! \page cdr_ami Manager CDR driver configuration
- * \par See also
- * \arg \ref cdrconf
- * \arg \ref AstAMI
- * \arg \ref cdr_manager.c
- * \verbinclude cdr_manager.conf.sample
- */
-
-/*! \page cdr_odbc ODBC CDR driver configuration
- * \arg See also \ref cdrconf
- * \arg \ref cdr_odbc.c
- * \verbinclude cdr_odbc.conf.sample
- * See also:
- * \arg http://www.unixodbc.org
- */
-
-/*! \page cdr_pgsql PostgreSQL CDR driver configuration
- * \arg See also \ref cdrconf
- * \arg \ref cdr_pgsql.c
- * See also:
- * \arg http://www.postgresql.org
- * \verbinclude cdr_pgsql.conf.sample
- */
-
-/*! \page cdr_sqlite SQLite CDR driver configuration
- * \arg See also \ref cdrconf
- * \arg \ref cdr_sqlite.c
- * See also:
- * \arg http://www.sqlite.org
- */
-
-/*! \page cdr_tds FreeTDS CDR driver configuration
- * \arg See also \ref cdrconf
- * See also:
- * \arg http://www.freetds.org
- * \verbinclude cdr_tds.conf.sample
- */
-
-/*! \page Config_cdr CDR configuration
- * \par See also
- * \arg \ref cdr_drivers
- * \arg \link Config_cdr CDR configuration \endlink
- * \arg \link cdr_custom Custom CDR driver configuration \endlink
- * \arg \link cdr_ami Manager CDR driver configuration \endlink
- * \arg \link cdr_odbc ODBC CDR driver configuration \endlink
- * \arg \link cdr_pgsql PostgreSQL CDR driver configuration \endlink
- * \arg \link cdr_sqlite SQLite CDR driver configuration \endlink
- * \arg \link cdr_tds FreeTDS CDR driver configuration (Microsoft SQL Server) \endlink
- * \verbinclude cdr.conf.sample
- */
-
-/*! \page Config_moh Music on Hold Configuration
- * \arg Implemented in \ref res_musiconhold.c
- * \section mohconf musiconhold.conf
- * \verbinclude musiconhold.conf.sample
- */
-
-/*! \page Config_adsi ADSI Configuration
- * \section adsiconf adsi.conf
- * \verbinclude adsi.conf.sample
- */
-
-/*! \page Config_codec CODEC Configuration
- * \section codecsconf codecs.conf
- * \verbinclude codecs.conf.sample
- */
-
-/*! \page Config_ara REALTIME Configuration
- * \arg See also: \arg \link AstARA \endlink
- * \section extconf extconfig.conf
- * \verbinclude extconfig.conf.sample
- */
-
-/*! \page Config_ami AMI configuration
- * \arg See also: \arg \link AstAMI \endlink
- * \section amiconf manager.conf
- * \verbinclude manager.conf.sample
- */
-
-/*! \page Config_qu ACD - Queue system configuration
- * \arg Implemented in \ref app_queue.c
- * \section quconf queues.conf
- * \verbinclude queues.conf.sample
- */
-
-/*! \page Config_mm Meetme - The conference bridge configuration
- * \arg Implemented in \ref app_meetme.c
- * \section mmconf meetme.conf
- * \verbinclude meetme.conf.sample
- */
-
-/*! \page SoundFiles Sound files
- * \section SecSound Asterisk Sound files
- * Asterisk includes a large amount of sound files. Many of these
- * are used by applications and demo scripts within asterisk.
- *
- * Additional sound files are available in the asterisk-addons
- * repository on cvs.digium.com
- *
- * \section SoundList List of included sound files
- * \verbinclude sounds.txt
- */
-
-/*! \addtogroup cdr_drivers Module: CDR Drivers
- * \section CDR_generic Asterisk CDR Drivers
- * \brief CDR drivers are loaded dynamically (see \ref Config_mod "Modules Configuration"). Each loaded CDR driver produce a billing record for each call.
- * \arg \ref Config_cdr "CDR Configuration"
- */
-
-
-/*! \addtogroup channel_drivers Module: Asterisk Channel Drivers
- * \section channel_generic Asterisk Channel Drivers
- * \brief Channel drivers are loaded dynamically (see \ref Config_mod "Modules Configuration").
- */
-
-/*! \addtogroup applications Module: Dial plan applications
- * \section app_generic Asterisk Dial Plan Applications
- * \brief Applications support the dialplan. They register dynamically with \ref ast_register_application() and unregister with ast_unregister_application()
- * \par See also
- * \arg \ref functions
- *
- */
-
-/*! \addtogroup functions Module: Dial plan functions
- * \section func_generic Asterisk Dial Plan Functions
- * \brief Functions support the dialplan. They do not change any property of a channel
- * or touch a channel in any way.
- * \par See also
- * \arg \ref applications
- *
- */
-
-/*! \addtogroup codecs Module: Codecs
- * \section codec_generic Asterisk Codec Modules
- * Codecs are referenced in configuration files by name
- * \par See also
- * \arg \ref formats
- *
- */
-
-/*! \addtogroup formats Module: Media File Formats
- * \section codec_generic Asterisk Format drivers
- * Formats are modules that read or write media files to disk.
- * \par See also
- * \arg \ref codecs
- */
diff --git a/1.2-netsec/include/asterisk/dsp.h b/1.2-netsec/include/asterisk/dsp.h
deleted file mode 100644
index b34701f30..000000000
--- a/1.2-netsec/include/asterisk/dsp.h
+++ /dev/null
@@ -1,111 +0,0 @@
-/*
- * 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.
- */
-
-/*! \file
- * \brief Convenient Signal Processing routines
- */
-
-#ifndef _ASTERISK_DSP_H
-#define _ASTERISK_DSP_H
-
-#define DSP_FEATURE_SILENCE_SUPPRESS (1 << 0)
-#define DSP_FEATURE_BUSY_DETECT (1 << 1)
-#define DSP_FEATURE_DTMF_DETECT (1 << 3)
-#define DSP_FEATURE_FAX_DETECT (1 << 4)
-
-#define DSP_DIGITMODE_DTMF 0 /* Detect DTMF digits */
-#define DSP_DIGITMODE_MF 1 /* Detect MF digits */
-
-#define DSP_DIGITMODE_NOQUELCH (1 << 8) /* Do not quelch DTMF from in-band */
-#define DSP_DIGITMODE_MUTECONF (1 << 9) /* Mute conference */
-#define DSP_DIGITMODE_MUTEMAX (1 << 10) /* Delay audio by a frame to try to extra quelch */
-#define DSP_DIGITMODE_RELAXDTMF (1 << 11) /* "Radio" mode (relaxed DTMF) */
-
-#define DSP_PROGRESS_TALK (1 << 16) /* Enable talk detection */
-#define DSP_PROGRESS_RINGING (1 << 17) /* Enable calling tone detection */
-#define DSP_PROGRESS_BUSY (1 << 18) /* Enable busy tone detection */
-#define DSP_PROGRESS_CONGESTION (1 << 19) /* Enable congestion tone detection */
-#define DSP_FEATURE_CALL_PROGRESS (DSP_PROGRESS_TALK | DSP_PROGRESS_RINGING | DSP_PROGRESS_BUSY | DSP_PROGRESS_CONGESTION)
-
-#define DSP_TONE_STATE_SILENCE 0
-#define DSP_TONE_STATE_RINGING 1
-#define DSP_TONE_STATE_DIALTONE 2
-#define DSP_TONE_STATE_TALKING 3
-#define DSP_TONE_STATE_BUSY 4
-#define DSP_TONE_STATE_SPECIAL1 5
-#define DSP_TONE_STATE_SPECIAL2 6
-#define DSP_TONE_STATE_SPECIAL3 7
-#define DSP_TONE_STATE_HUNGUP 8
-
-struct ast_dsp;
-
-struct ast_dsp *ast_dsp_new(void);
-void ast_dsp_free(struct ast_dsp *dsp);
-
-/*! \brief Set threshold value for silence */
-void ast_dsp_set_threshold(struct ast_dsp *dsp, int threshold);
-
-/*! \brief Set number of required cadences for busy */
-void ast_dsp_set_busy_count(struct ast_dsp *dsp, int cadences);
-
-/*! \brief Set expected lengths of the busy tone */
-void ast_dsp_set_busy_pattern(struct ast_dsp *dsp, int tonelength, int quietlength);
-
-/*! \brief Scans for progress indication in audio */
-int ast_dsp_call_progress(struct ast_dsp *dsp, struct ast_frame *inf);
-
-/*! \brief Set zone for doing progress detection */
-int ast_dsp_set_call_progress_zone(struct ast_dsp *dsp, char *zone);
-
-/*! \brief Return AST_FRAME_NULL frames when there is silence, AST_FRAME_BUSY on
- busies, and call progress, all dependent upon which features are enabled */
-struct ast_frame *ast_dsp_process(struct ast_channel *chan, struct ast_dsp *dsp, struct ast_frame *inf);
-
-/*! \brief Return non-zero if this is silence. Updates "totalsilence" with the total
- number of seconds of silence */
-int ast_dsp_silence(struct ast_dsp *dsp, struct ast_frame *f, int *totalsilence);
-
-/*! \brief Return non-zero if historically this should be a busy, request that
- ast_dsp_silence has already been called */
-int ast_dsp_busydetect(struct ast_dsp *dsp);
-
-/*! \brief Return non-zero if DTMF hit was found */
-int ast_dsp_digitdetect(struct ast_dsp *dsp, struct ast_frame *f);
-
-/*! \brief Reset total silence count */
-void ast_dsp_reset(struct ast_dsp *dsp);
-
-/*! \brief Reset DTMF detector */
-void ast_dsp_digitreset(struct ast_dsp *dsp);
-
-/*! \brief Select feature set */
-void ast_dsp_set_features(struct ast_dsp *dsp, int features);
-
-/*! \brief Get pending DTMF/MF digits */
-int ast_dsp_getdigits(struct ast_dsp *dsp, char *buf, int max);
-
-/*! \brief Set digit mode */
-int ast_dsp_digitmode(struct ast_dsp *dsp, int digitmode);
-
-/*! \brief Get tstate (Tone State) */
-int ast_dsp_get_tstate(struct ast_dsp *dsp);
-
-/*! \brief Get tcount (Threshold counter) */
-int ast_dsp_get_tcount(struct ast_dsp *dsp);
-
-#endif /* _ASTERISK_DSP_H */
diff --git a/1.2-netsec/include/asterisk/dundi.h b/1.2-netsec/include/asterisk/dundi.h
deleted file mode 100644
index 9290536d6..000000000
--- a/1.2-netsec/include/asterisk/dundi.h
+++ /dev/null
@@ -1,226 +0,0 @@
-/*
- * 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.
- */
-
-/*! \file
- * \brief Distributed Universal Number Discovery (DUNDi)
- * See also \ref AstDUNDi
- */
-
-#ifndef _ASTERISK_DUNDI_H
-#define _ASTERISK_DUNDI_H
-
-#include "asterisk/channel.h"
-
-#define DUNDI_PORT 4520
-
-/*!\brief A DUNDi Entity ID is essentially a MAC address, brief and unique */
-struct _dundi_eid {
- unsigned char eid[6];
-} __attribute__ ((__packed__));
-
-typedef struct _dundi_eid dundi_eid;
-
-struct dundi_hdr {
- unsigned short strans; /*!< Source transaction */
- unsigned short dtrans; /*!< Destination transaction */
- unsigned char iseqno; /*!< Next expected incoming sequence number */
- unsigned char oseqno; /*!< Outgoing sequence number */
- unsigned char cmdresp; /*!< Command / Response */
- unsigned char cmdflags; /*!< Command / Response specific flags*/
- unsigned char ies[0];
-} __attribute__ ((__packed__));
-
-struct dundi_ie_hdr {
- unsigned char ie;
- unsigned char len;
- unsigned char iedata[0];
-} __attribute__ ((__packed__));
-
-#define DUNDI_FLAG_RETRANS (1 << 16) /*!< Applies to dtrans */
-#define DUNDI_FLAG_RESERVED (1 << 16) /*!< Applies to strans */
-
-#define DUNDI_PROTO_NONE 0 /*!< No answer yet */
-#define DUNDI_PROTO_IAX 1 /*!< IAX version 2 */
-#define DUNDI_PROTO_SIP 2 /*!< Session Initiation Protocol */
-#define DUNDI_PROTO_H323 3 /*!< ITU H.323 */
-
-#define DUNDI_FLAG_NONEXISTENT (0) /*!< Isn't and can't be a valid number */
-#define DUNDI_FLAG_EXISTS (1 << 0) /*!< Is a valid number */
-#define DUNDI_FLAG_MATCHMORE (1 << 1) /*!< Might be valid if you add more digits */
-#define DUNDI_FLAG_CANMATCH (1 << 2) /*!< Might be a match */
-#define DUNDI_FLAG_IGNOREPAT (1 << 3) /*!< Keep dialtone */
-#define DUNDI_FLAG_RESIDENTIAL (1 << 4) /*!< Destination known to be residential */
-#define DUNDI_FLAG_COMMERCIAL (1 << 5) /*!< Destination known to be commercial */
-#define DUNDI_FLAG_MOBILE (1 << 6) /*!< Destination known to be cellular/mobile */
-#define DUNDI_FLAG_NOUNSOLICITED (1 << 7) /*!< No unsolicited calls of any kind through this route */
-#define DUNDI_FLAG_NOCOMUNSOLICIT (1 << 8) /*!< No commercial unsolicited calls through this route */
-
-#define DUNDI_HINT_NONE (0)
-#define DUNDI_HINT_TTL_EXPIRED (1 << 0) /*!< TTL Expired */
-#define DUNDI_HINT_DONT_ASK (1 << 1) /*!< Don't ask for anything beginning with data */
-#define DUNDI_HINT_UNAFFECTED (1 << 2) /*!< Answer not affected by entity list */
-
-struct dundi_encblock { /*!< AES-128 encrypted block */
- unsigned char iv[16]; /*!< Initialization vector of random data */
- unsigned char encdata[0]; /*!< Encrypted / compressed data */
-} __attribute__ ((__packed__));
-
-struct dundi_answer {
- dundi_eid eid; /*!< Original source of answer */
- unsigned char protocol; /*!< Protocol (DUNDI_PROTO_*) */
- unsigned short flags; /*!< Flags relating to answer */
- unsigned short weight; /*!< Weight of answers */
- unsigned char data[0]; /*!< Protocol specific URI */
-} __attribute__ ((__packed__));
-
-struct dundi_hint {
- unsigned short flags; /*!< Flags relating to answer */
- unsigned char data[0]; /*!< For data for hint */
-} __attribute__ ((__packed__));
-
-#define DUNDI_CAUSE_SUCCESS 0 /*!< Success */
-#define DUNDI_CAUSE_GENERAL 1 /*!< General unspecified failure */
-#define DUNDI_CAUSE_DYNAMIC 2 /*!< Requested entity is dynamic */
-#define DUNDI_CAUSE_NOAUTH 3 /*!< No or improper authorization */
-#define DUNDI_CAUSE_DUPLICATE 4 /*!< Duplicate request */
-#define DUNDI_CAUSE_TTL_EXPIRED 5 /*!< Expired TTL */
-#define DUNDI_CAUSE_NEEDKEY 6 /*!< Need new session key to decode */
-#define DUNDI_CAUSE_BADENCRYPT 7 /*!< Badly encrypted data */
-
-struct dundi_cause {
- unsigned char causecode; /*!< Numerical cause (DUNDI_CAUSE_*) */
- char desc[0]; /*!< Textual description */
-} __attribute__ ((__packed__));
-
-struct dundi_peer_status {
- unsigned int flags;
- unsigned short netlag;
- unsigned short querylag;
- dundi_eid peereid;
-} __attribute__ ((__packed__));
-
-#define DUNDI_PEER_PRIMARY (1 << 0)
-#define DUNDI_PEER_SECONDARY (1 << 1)
-#define DUNDI_PEER_UNAVAILABLE (1 << 2)
-#define DUNDI_PEER_REGISTERED (1 << 3)
-#define DUNDI_PEER_MOD_OUTBOUND (1 << 4)
-#define DUNDI_PEER_MOD_INBOUND (1 << 5)
-#define DUNDI_PEER_PCMOD_OUTBOUND (1 << 6)
-#define DUNDI_PEER_PCMOD_INBOUND (1 << 7)
-
-#define DUNDI_COMMAND_FINAL (0x80) /*!< Or'd with other flags */
-
-#define DUNDI_COMMAND_ACK (0 | 0x40) /*!< Ack a message */
-#define DUNDI_COMMAND_DPDISCOVER 1 /*!< Request discovery */
-#define DUNDI_COMMAND_DPRESPONSE (2 | 0x40) /*!< Respond to a discovery request */
-#define DUNDI_COMMAND_EIDQUERY 3 /*!< Request information for a peer */
-#define DUNDI_COMMAND_EIDRESPONSE (4 | 0x40) /*!< Response to a peer query */
-#define DUNDI_COMMAND_PRECACHERQ 5 /*!< Pre-cache Request */
-#define DUNDI_COMMAND_PRECACHERP (6 | 0x40) /*!< Pre-cache Response */
-#define DUNDI_COMMAND_INVALID (7 | 0x40) /*!< Invalid dialog state (does not require ack) */
-#define DUNDI_COMMAND_UNKNOWN (8 | 0x40) /*!< Unknown command */
-#define DUNDI_COMMAND_NULL 9 /*!< No-op */
-#define DUNDI_COMMAND_REGREQ (10) /*!< Register Request */
-#define DUNDI_COMMAND_REGRESPONSE (11 | 0x40) /*!< Register Response */
-#define DUNDI_COMMAND_CANCEL (12) /*!< Cancel transaction entirely */
-#define DUNDI_COMMAND_ENCRYPT (13) /*!< Send an encrypted message */
-#define DUNDI_COMMAND_ENCREJ (14 | 0x40) /*!< Reject an encrypted message */
-
-#define DUNDI_COMMAND_STATUS 15 /*!< Status command */
-
-/*
- * Remember that some information elements may occur
- * more than one time within a message
- */
-
-#define DUNDI_IE_EID 1 /*!< Entity identifier (dundi_eid) */
-#define DUNDI_IE_CALLED_CONTEXT 2 /*!< DUNDi Context (string) */
-#define DUNDI_IE_CALLED_NUMBER 3 /*!< Number of equivalent (string) */
-#define DUNDI_IE_EID_DIRECT 4 /*!< Entity identifier (dundi_eid), direct connect */
-#define DUNDI_IE_ANSWER 5 /*!< An answer (struct dundi_answer) */
-#define DUNDI_IE_TTL 6 /*!< Max TTL for this request / Remaining TTL for the response (short)*/
-#define DUNDI_IE_VERSION 10 /*!< DUNDi version (should be 1) (short) */
-#define DUNDI_IE_EXPIRATION 11 /*!< Recommended expiration (short) */
-#define DUNDI_IE_UNKNOWN 12 /*!< Unknown command (byte) */
-#define DUNDI_IE_CAUSE 14 /*!< Success or cause of failure */
-#define DUNDI_IE_REQEID 15 /*!< EID being requested for EIDQUERY*/
-#define DUNDI_IE_ENCDATA 16 /*!< AES-128 encrypted data */
-#define DUNDI_IE_SHAREDKEY 17 /*!< RSA encrypted AES-128 key */
-#define DUNDI_IE_SIGNATURE 18 /*!< RSA Signature of encrypted shared key */
-#define DUNDI_IE_KEYCRC32 19 /*!< CRC32 of encrypted key (int) */
-#define DUNDI_IE_HINT 20 /*!< Answer hints (struct ast_hint) */
-
-#define DUNDI_IE_DEPARTMENT 21 /*!< Department, for EIDQUERY (string) */
-#define DUNDI_IE_ORGANIZATION 22 /*!< Organization, for EIDQUERY (string) */
-#define DUNDI_IE_LOCALITY 23 /*!< City/Locality, for EIDQUERY (string) */
-#define DUNDI_IE_STATE_PROV 24 /*!< State/Province, for EIDQUERY (string) */
-#define DUNDI_IE_COUNTRY 25 /*!< Country, for EIDQUERY (string) */
-#define DUNDI_IE_EMAIL 26 /*!< E-mail addy, for EIDQUERY (string) */
-#define DUNDI_IE_PHONE 27 /*!< Contact Phone, for EIDQUERY (string) */
-#define DUNDI_IE_IPADDR 28 /*!< IP Address, for EIDQUERY (string) */
-#define DUNDI_IE_CACHEBYPASS 29 /*!< Bypass cache (empty) */
-
-#define DUNDI_IE_PEERSTATUS 30 /*!< Peer/peer status (struct dundi_peer_status) */
-
-#define DUNDI_FLUFF_TIME 2000 /*!< Amount of time for answer */
-#define DUNDI_TTL_TIME 200 /*!< Incremental average time */
-
-#define DUNDI_DEFAULT_RETRANS 5
-#define DUNDI_DEFAULT_RETRANS_TIMER 1000
-#define DUNDI_DEFAULT_TTL 120 /*!< In seconds/hops like TTL */
-#define DUNDI_DEFAULT_VERSION 1
-#define DUNDI_DEFAULT_CACHE_TIME 3600 /*!< In seconds */
-#define DUNDI_DEFAULT_KEY_EXPIRE 3600 /*!< Life of shared key In seconds */
-#define DUNDI_DEF_EMPTY_CACHE_TIME 60 /*!< In seconds, cache of empty answer */
-#define DUNDI_WINDOW 1 /*!< Max 1 message in window */
-
-#define DEFAULT_MAXMS 2000
-
-struct dundi_result {
- unsigned int flags;
- int weight;
- int expiration;
- int techint;
- dundi_eid eid;
- char eid_str[20];
- char tech[10];
- char dest[256];
-};
-
-struct dundi_entity_info {
- char country[80];
- char stateprov[80];
- char locality[80];
- char org[80];
- char orgunit[80];
- char email[80];
- char phone[80];
- char ipaddr[80];
-};
-
-/*! \brief Lookup the given number in the given dundi context (or e164 if unspecified) using the given callerid (if specified) and return up to maxret results in the array specified.
- returns the number of results found or -1 on a hangup of teh channel. */
-int dundi_lookup(struct dundi_result *result, int maxret, struct ast_channel *chan, const char *dcontext, const char *number, int nocache);
-
-/*! \brief Retrieve information on a specific EID */
-int dundi_query_eid(struct dundi_entity_info *dei, const char *dcontext, dundi_eid eid);
-
-/*! \brief Pre-cache to push upstream peers */
-int dundi_precache(const char *dcontext, const char *number);
-
-#endif /* _ASTERISK_DUNDI_H */
diff --git a/1.2-netsec/include/asterisk/endian.h b/1.2-netsec/include/asterisk/endian.h
deleted file mode 100644
index 55108b4e1..000000000
--- a/1.2-netsec/include/asterisk/endian.h
+++ /dev/null
@@ -1,65 +0,0 @@
-/*
- * 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.
- */
-
-/*! \file
- * \brief Asterisk architecture endianess compatibility definitions
- */
-
-#ifndef _ASTERISK_ENDIAN_H
-#define _ASTERISK_ENDIAN_H
-
-/*
- * Autodetect system endianess
- */
-
-#include "asterisk/compat.h"
-
-#ifndef __BYTE_ORDER
-#ifdef __linux__
-#include <endian.h>
-#elif defined(__OpenBSD__) || defined(__FreeBSD__) || defined(__NetBSD__) || defined(__APPLE__)
-#if defined(__OpenBSD__)
-#include <machine/types.h>
-#endif /* __OpenBSD__ */
-#include <machine/endian.h>
-#define __BYTE_ORDER BYTE_ORDER
-#define __LITTLE_ENDIAN LITTLE_ENDIAN
-#define __BIG_ENDIAN BIG_ENDIAN
-#else
-#ifdef __LITTLE_ENDIAN__
-#define __BYTE_ORDER __LITTLE_ENDIAN
-#endif /* __LITTLE_ENDIAN */
-
-#if defined(i386) || defined(__i386__)
-#define __BYTE_ORDER __LITTLE_ENDIAN
-#endif /* defined i386 */
-
-#if defined(sun) && defined(unix) && defined(sparc)
-#define __BYTE_ORDER __BIG_ENDIAN
-#endif /* sun unix sparc */
-
-#endif /* linux */
-
-#endif /* __BYTE_ORDER */
-
-#ifndef __BYTE_ORDER
-#error Need to know endianess
-#endif /* __BYTE_ORDER */
-
-#endif /* _ASTERISK_ENDIAN_H */
-
diff --git a/1.2-netsec/include/asterisk/enum.h b/1.2-netsec/include/asterisk/enum.h
deleted file mode 100644
index e36a9d910..000000000
--- a/1.2-netsec/include/asterisk/enum.h
+++ /dev/null
@@ -1,57 +0,0 @@
-/*
- * 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.
- */
-
-/*! \file enum.h
- \brief DNS and ENUM functions
-*/
-
-#ifndef _ASTERISK_ENUM_H
-#define _ASTERISK_ENUM_H
-
-#include "asterisk/channel.h"
-
-/*! \brief Lookup entry in ENUM Returns 1 if found, 0 if not found, -1 on hangup
- \param chan Channel
- \param number E164 number with or without the leading +
- \param location Number returned (or SIP uri)
- \param maxloc Max length
- \param technology Technology (from url scheme in response)
- You can set it to get particular answer RR, if there are many techs in DNS response, example: "sip"
- If you need any record, then set it to empty string
- \param maxtech Max length
- \param suffix Zone suffix (if is NULL then use enum.conf 'search' variable)
- \param options Options ('c' to count number of NAPTR RR, or number - the position of required RR in the answer list
-*/
-extern int ast_get_enum(struct ast_channel *chan, const char *number, char *location, int maxloc, char *technology, int maxtech, char* suffix, char* options);
-
-/*! \brief Lookup DNS TXT record (used by app TXTCIDnum
- \param chan Channel
- \param number E164 number with or without the leading +
- \param location Number returned (or SIP uri)
- \param maxloc Max length of number
- \param technology Technology (not used in TXT records)
- \param maxtech Max length
- \param txt Text string (return value)
- \param maxtxt Max length of "txt"
-*/
-extern int ast_get_txt(struct ast_channel *chan, const char *number, char *location, int maxloc, char *technology, int maxtech, char *txt, int maxtxt);
-
-extern int ast_enum_init(void);
-extern int ast_enum_reload(void);
-
-#endif /* _ASTERISK_ENUM_H */
diff --git a/1.2-netsec/include/asterisk/features.h b/1.2-netsec/include/asterisk/features.h
deleted file mode 100644
index ffea39d2a..000000000
--- a/1.2-netsec/include/asterisk/features.h
+++ /dev/null
@@ -1,95 +0,0 @@
-/*
- * 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.
- */
-
-/*! \file
- * \brief Call Parking and Pickup API
- * Includes code and algorithms from the Zapata library.
- */
-
-#ifndef _AST_FEATURES_H
-#define _AST_FEATURES_H
-
-#define FEATURE_MAX_LEN 11
-#define FEATURE_APP_LEN 64
-#define FEATURE_APP_ARGS_LEN 256
-#define FEATURE_SNAME_LEN 32
-#define FEATURE_EXTEN_LEN 32
-
-/*! \brief main call feature structure */
-struct ast_call_feature {
- int feature_mask;
- char *fname;
- char sname[FEATURE_SNAME_LEN];
- char exten[FEATURE_MAX_LEN];
- char default_exten[FEATURE_MAX_LEN];
- int (*operation)(struct ast_channel *chan, struct ast_channel *peer, struct ast_bridge_config *config, char *code, int sense);
- unsigned int flags;
- char app[FEATURE_APP_LEN];
- char app_args[FEATURE_APP_ARGS_LEN];
- AST_LIST_ENTRY(ast_call_feature) feature_entry;
-};
-
-
-
-/*! \brief Park a call and read back parked location
- * \param chan the channel to actually be parked
- \param host the channel which will have the parked location read to
- Park the channel chan, and read back the parked location to the
- host. If the call is not picked up within a specified period of
- time, then the call will return to the last step that it was in
- (in terms of exten, priority and context)
- \param timeout is a timeout in milliseconds
- \param extout is a parameter to an int that will hold the parked location, or NULL if you want
-*/
-extern int ast_park_call(struct ast_channel *chan, struct ast_channel *host, int timeout, int *extout);
-
-/*! \brief Park a call via a masqueraded channel
- * \param rchan the real channel to be parked
- \param host the channel to have the parking read to
- Masquerade the channel rchan into a new, empty channel which is then
- parked with ast_park_call
- \param timeout is a timeout in milliseconds
- \param extout is a parameter to an int that will hold the parked location, or NULL if you want
-*/
-extern int ast_masq_park_call(struct ast_channel *rchan, struct ast_channel *host, int timeout, int *extout);
-
-/*! \brief Determine system parking extension
- * Returns the call parking extension for drivers that provide special
- call parking help */
-extern char *ast_parking_ext(void);
-
-/*! \brief Determine system call pickup extension */
-extern char *ast_pickup_ext(void);
-
-/*! \brief Bridge a call, optionally allowing redirection */
-extern int ast_bridge_call(struct ast_channel *chan, struct ast_channel *peer,struct ast_bridge_config *config);
-
-/*! \brief Pickup a call */
-extern int ast_pickup_call(struct ast_channel *chan);
-
-/*! \brief register new feature into feature_set
- \param feature an ast_call_feature object which contains a keysequence
- and a callback function which is called when this keysequence is pressed
- during a call. */
-extern void ast_register_feature(struct ast_call_feature *feature);
-
-/*! \brief unregister feature from feature_set
- \param feature the ast_call_feature object which was registered before*/
-extern void ast_unregister_feature(struct ast_call_feature *feature);
-
-#endif /* _AST_FEATURES_H */
diff --git a/1.2-netsec/include/asterisk/file.h b/1.2-netsec/include/asterisk/file.h
deleted file mode 100644
index e52570183..000000000
--- a/1.2-netsec/include/asterisk/file.h
+++ /dev/null
@@ -1,318 +0,0 @@
-/*
- * 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.
- */
-
-/*! \file
- * \brief Generic File Format Support.
- */
-
-#ifndef _ASTERISK_FILE_H
-#define _ASTERISK_FILE_H
-
-#ifndef stdin
-#error You must include stdio.h before file.h!
-#endif /* !stdin */
-
-#include "asterisk/channel.h"
-#include "asterisk/frame.h"
-#include <fcntl.h>
-
-
-#if defined(__cplusplus) || defined(c_plusplus)
-extern "C" {
-#endif
-
-
-/*! Convenient for waiting */
-#define AST_DIGIT_ANY "0123456789#*ABCD"
-#define AST_DIGIT_ANYNUM "0123456789"
-
-#define SEEK_FORCECUR 10
-
-/* Defined by individual formats. First item MUST be a
- pointer for use by the stream manager */
-struct ast_filestream;
-
-/*! Registers a new file format */
-/*! Register a new file format capability
- * Adds a format to asterisk's format abilities. Fill in the fields, and it will work. For examples, look at some of the various format code.
- * returns 0 on success, -1 on failure
- */
-int ast_format_register(const char *name, const char *exts, int format,
- struct ast_filestream * (*open)(FILE *f),
- struct ast_filestream * (*rewrite)(FILE *f, const char *comment),
- int (*write)(struct ast_filestream *, struct ast_frame *),
- int (*seek)(struct ast_filestream *, long offset, int whence),
- int (*trunc)(struct ast_filestream *),
- long (*tell)(struct ast_filestream *),
- struct ast_frame * (*read)(struct ast_filestream *, int *timetonext),
- void (*close)(struct ast_filestream *),
- char * (*getcomment)(struct ast_filestream *));
-
-/*! Unregisters a file format */
-/*!
- * \param name the name of the format you wish to unregister
- * Unregisters a format based on the name of the format.
- * Returns 0 on success, -1 on failure to unregister
- */
-int ast_format_unregister(const char *name);
-
-/*! Streams a file */
-/*!
- * \param c channel to stream the file to
- * \param filename the name of the file you wish to stream, minus the extension
- * \param preflang the preferred language you wish to have the file streamed to you in
- * Prepares a channel for the streaming of a file. To start the stream, afterward do a ast_waitstream() on the channel
- * Also, it will stop any existing streams on the channel.
- * Returns 0 on success, or -1 on failure.
- */
-int ast_streamfile(struct ast_channel *c, const char *filename, const char *preflang);
-
-/*! Stops a stream */
-/*!
- * \param c The channel you wish to stop playback on
- * Stop playback of a stream
- * Returns 0 regardless
- */
-int ast_stopstream(struct ast_channel *c);
-
-/*! Checks for the existence of a given file */
-/*!
- * \param filename name of the file you wish to check, minus the extension
- * \param fmt the format you wish to check (the extension)
- * \param preflang (the preferred language you wisht to find the file in)
- * See if a given file exists in a given format. If fmt is NULL, any format is accepted.
- * Returns -1 if file does not exist, non-zero positive otherwise.
- */
-int ast_fileexists(const char *filename, const char *fmt, const char *preflang);
-
-/*! Renames a file */
-/*!
- * \param oldname the name of the file you wish to act upon (minus the extension)
- * \param newname the name you wish to rename the file to (minus the extension)
- * \param fmt the format of the file
- * Rename a given file in a given format, or if fmt is NULL, then do so for all
- * Returns -1 on failure
- */
-int ast_filerename(const char *oldname, const char *newname, const char *fmt);
-
-/*! Deletes a file */
-/*!
- * \param filename name of the file you wish to delete (minus the extension)
- * \param fmt of the file
- * Delete a given file in a given format, or if fmt is NULL, then do so for all
- */
-int ast_filedelete(const char *filename, const char *fmt);
-
-/*! Copies a file */
-/*!
- * \param oldname name of the file you wish to copy (minus extension)
- * \param newname name you wish the file to be copied to (minus extension)
- * \param fmt the format of the file
- * Copy a given file in a given format, or if fmt is NULL, then do so for all
- */
-int ast_filecopy(const char *oldname, const char *newname, const char *fmt);
-
-/*! Waits for a stream to stop or digit to be pressed */
-/*!
- * \param c channel to waitstram on
- * \param breakon string of DTMF digits to break upon
- * Begins playback of a stream...
- * Wait for a stream to stop or for any one of a given digit to arrive, Returns 0
- * if the stream finishes, the character if it was interrupted, and -1 on error
- */
-int ast_waitstream(struct ast_channel *c, const char *breakon);
-
-/*! Waits for a stream to stop or digit matching a valid one digit exten to be pressed */
-/*!
- * \param c channel to waitstram on
- * \param context string of context to match digits to break upon
- * Begins playback of a stream...
- * Wait for a stream to stop or for any one of a valid extension digit to arrive, Returns 0
- * if the stream finishes, the character if it was interrupted, and -1 on error
- */
-int ast_waitstream_exten(struct ast_channel *c, const char *context);
-
-/*! Same as waitstream but allows stream to be forwarded or rewound */
-/*!
- * \param c channel to waitstram on
- * \param breakon string of DTMF digits to break upon
- * \param forward DTMF digit to fast forward upon
- * \param rewind DTMF digit to rewind upon
- * \param ms How many miliseconds to skip forward/back
- * Begins playback of a stream...
- * Wait for a stream to stop or for any one of a given digit to arrive, Returns 0
- * if the stream finishes, the character if it was interrupted, and -1 on error
- */
-int ast_waitstream_fr(struct ast_channel *c, const char *breakon, const char *forward, const char *rewind, int ms);
-
-/* Same as waitstream, but with audio output to fd and monitored fd checking. Returns
- 1 if monfd is ready for reading */
-int ast_waitstream_full(struct ast_channel *c, const char *breakon, int audiofd, int monfd);
-
-/*! Starts reading from a file */
-/*!
- * \param filename the name of the file to read from
- * \param type format of file you wish to read from
- * \param comment comment to go with
- * \param flags file flags
- * \param check (unimplemented, hence negligible)
- * \param mode Open mode
- * Open an incoming file stream. flags are flags for the open() command, and
- * if check is non-zero, then it will not read a file if there are any files that
- * start with that name and have an extension
- * Please note, this is a blocking function. Program execution will not return until ast_waitstream completes it's execution.
- * Returns a struct ast_filestream on success, NULL on failure
- */
-struct ast_filestream *ast_readfile(const char *filename, const char *type, const char *comment, int flags, int check, mode_t mode);
-
-/*! Starts writing a file */
-/*!
- * \param filename the name of the file to write to
- * \param type format of file you wish to write out to
- * \param comment comment to go with
- * \param flags output file flags
- * \param check (unimplemented, hence negligible)
- * \param mode Open mode
- * Create an outgoing file stream. oflags are flags for the open() command, and
- * if check is non-zero, then it will not write a file if there are any files that
- * start with that name and have an extension
- * Please note, this is a blocking function. Program execution will not return until ast_waitstream completes it's execution.
- * Returns a struct ast_filestream on success, NULL on failure
- */
-struct ast_filestream *ast_writefile(const char *filename, const char *type, const char *comment, int flags, int check, mode_t mode);
-
-/*! Writes a frame to a stream */
-/*!
- * \param fs filestream to write to
- * \param f frame to write to the filestream
- * Send a frame to a filestream -- note: does NOT free the frame, call ast_frfree manually
- * Returns 0 on success, -1 on failure.
- */
-int ast_writestream(struct ast_filestream *fs, struct ast_frame *f);
-
-/*! Closes a stream */
-/*!
- * \param f filestream to close
- * Close a playback or recording stream
- * Returns 0 on success, -1 on failure
- */
-int ast_closestream(struct ast_filestream *f);
-
-/*! Opens stream for use in seeking, playing */
-/*!
- * \param chan channel to work with
- * \param filename to use
- * \param preflang prefered language to use
- * Returns a ast_filestream pointer if it opens the file, NULL on error
- */
-struct ast_filestream *ast_openstream(struct ast_channel *chan, const char *filename, const char *preflang);
-
-/*! Opens stream for use in seeking, playing */
-/*!
- * \param chan channel to work with
- * \param filename to use
- * \param preflang prefered language to use
- * \param asis if set, don't clear generators
- * Returns a ast_filestream pointer if it opens the file, NULL on error
- */
-struct ast_filestream *ast_openstream_full(struct ast_channel *chan, const char *filename, const char *preflang, int asis);
-/*! Opens stream for use in seeking, playing */
-/*!
- * \param chan channel to work with
- * \param filename to use
- * \param preflang prefered language to use
- * Returns a ast_filestream pointer if it opens the file, NULL on error
- */
-struct ast_filestream *ast_openvstream(struct ast_channel *chan, const char *filename, const char *preflang);
-
-/*! Applys a open stream to a channel. */
-/*!
- * \param chan channel to work
- * \param s ast_filestream to apply
- * Returns 0 for success, -1 on failure
- */
-int ast_applystream(struct ast_channel *chan, struct ast_filestream *s);
-
-/*! play a open stream on a channel. */
-/*!
- * \param s filestream to play
- * Returns 0 for success, -1 on failure
- */
-int ast_playstream(struct ast_filestream *s);
-
-/*! Seeks into stream */
-/*!
- * \param fs ast_filestream to perform seek on
- * \param sample_offset numbers of samples to seek
- * \param whence SEEK_SET, SEEK_CUR, SEEK_END
- * Returns 0 for success, or -1 for error
- */
-int ast_seekstream(struct ast_filestream *fs, long sample_offset, int whence);
-
-/*! Trunc stream at current location */
-/*!
- * \param fs filestream to act on
- * Returns 0 for success, or -1 for error
- */
-int ast_truncstream(struct ast_filestream *fs);
-
-/*! Fast forward stream ms */
-/*!
- * \param fs filestream to act on
- * \param ms milliseconds to move
- * Returns 0 for success, or -1 for error
- */
-int ast_stream_fastforward(struct ast_filestream *fs, long ms);
-
-/*! Rewind stream ms */
-/*!
- * \param fs filestream to act on
- * \param ms milliseconds to move
- * Returns 0 for success, or -1 for error
- */
-int ast_stream_rewind(struct ast_filestream *fs, long ms);
-
-/*! Tell where we are in a stream */
-/*!
- * \param fs fs to act on
- * Returns a long as a sample offset into stream
- */
-long ast_tellstream(struct ast_filestream *fs);
-
-/*! Read a frame from a filestream */
-/*!
- * \param s ast_filestream to act on
- * Returns a frame or NULL if read failed
- */
-struct ast_frame *ast_readframe(struct ast_filestream *s);
-
-/*! Initialize file stuff */
-/*!
- * Initializes all the various file stuff. Basically just registers the cli stuff
- * Returns 0 all the time
- */
-extern int ast_file_init(void);
-
-
-#define AST_RESERVED_POINTERS 20
-
-#if defined(__cplusplus) || defined(c_plusplus)
-}
-#endif
-
-#endif /* _ASTERISK_FILE_H */
diff --git a/1.2-netsec/include/asterisk/frame.h b/1.2-netsec/include/asterisk/frame.h
deleted file mode 100644
index ccba41539..000000000
--- a/1.2-netsec/include/asterisk/frame.h
+++ /dev/null
@@ -1,484 +0,0 @@
-/*
- * 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.
- */
-
-/*! \file
- * \brief Asterisk internal frame definitions.
- * \arg For an explanation of frames, see \ref Def_Frame
- * \arg Frames are send of Asterisk channels, see \ref Def_Channel
- */
-
-#ifndef _ASTERISK_FRAME_H
-#define _ASTERISK_FRAME_H
-
-#if defined(__cplusplus) || defined(c_plusplus)
-extern "C" {
-#endif
-
-#include <sys/types.h>
-#include <sys/time.h>
-#include "asterisk/endian.h"
-
-struct ast_codec_pref {
- char order[32];
-};
-
-/*! \page Def_Frame AST Multimedia and signalling frames
- \section Def_AstFrame What is an ast_frame ?
- A frame of data read used to communicate between
- between channels and applications.
- Frames are divided into frame types and subclasses.
-
- \par Frame types
- \arg \b VOICE: Voice data, subclass is codec (AST_FORMAT_*)
- \arg \b VIDEO: Video data, subclass is codec (AST_FORMAT_*)
- \arg \b DTMF: A DTMF digit, subclass is the digit
- \arg \b IMAGE: Image transport, mostly used in IAX
- \arg \b TEXT: Text messages
- \arg \b HTML: URL's and web pages
- \arg \b T38: T38 Fax transport frames
- \arg \b IAX: Private frame type for the IAX protocol
- \arg \b CNG: Comfort noice frames
- \arg \b CONTROL: A control frame, subclass defined as AST_CONTROL_
- \arg \b NULL: Empty, useless frame
-
- \par Files
- \arg frame.h Definitions
- \arg frame.c Function library
- \arg \ref Def_Channel Asterisk channels
- \section Def_ControlFrame Control Frames
- Control frames send signalling information between channels
- and devices. They are prefixed with AST_CONTROL_, like AST_CONTROL_FRAME_HANGUP
- \arg \b HANGUP The other end has hungup
- \arg \b RING Local ring
- \arg \b RINGING The other end is ringing
- \arg \b ANSWER The other end has answered
- \arg \b BUSY Remote end is busy
- \arg \b TAKEOFFHOOK Make it go off hook (what's "it" ? )
- \arg \b OFFHOOK Line is off hook
- \arg \b CONGESTION Congestion (circuit is busy, not available)
- \arg \b FLASH Other end sends flash hook
- \arg \b WINK Other end sends wink
- \arg \b OPTION Send low-level option
- \arg \b RADIO_KEY Key radio (see app_rpt.c)
- \arg \b RADIO_UNKEY Un-key radio (see app_rpt.c)
- \arg \b PROGRESS Other end indicates call progress
- \arg \b PROCEEDING Indicates proceeding
- \arg \b HOLD Call is placed on hold
- \arg \b UNHOLD Call is back from hold
- \arg \b VIDUPDATE Video update requested
-
-*/
-
-/*! \brief Data structure associated with a single frame of data
- */
-struct ast_frame {
- /*! Kind of frame */
- int frametype;
- /*! Subclass, frame dependent */
- int subclass;
- /*! Length of data */
- int datalen;
- /*! Number of 8khz samples in this frame */
- int samples;
- /*! Was the data malloc'd? i.e. should we free it when we discard the frame? */
- int mallocd;
- /*! How many bytes exist _before_ "data" that can be used if needed */
- int offset;
- /*! Optional source of frame for debugging */
- const char *src;
- /*! Pointer to actual data */
- void *data;
- /*! Global delivery time */
- struct timeval delivery;
- /*! Next/Prev for linking stand alone frames */
- struct ast_frame *prev;
- /*! Next/Prev for linking stand alone frames */
- struct ast_frame *next;
-};
-
-#define AST_FRIENDLY_OFFSET 64 /*! It's polite for a a new frame to
- have this number of bytes for additional
- headers. */
-#define AST_MIN_OFFSET 32 /*! Make sure we keep at least this much handy */
-
-/*! Need the header be free'd? */
-#define AST_MALLOCD_HDR (1 << 0)
-/*! Need the data be free'd? */
-#define AST_MALLOCD_DATA (1 << 1)
-/*! Need the source be free'd? (haha!) */
-#define AST_MALLOCD_SRC (1 << 2)
-
-/* Frame types */
-/*! A DTMF digit, subclass is the digit */
-#define AST_FRAME_DTMF 1
-/*! Voice data, subclass is AST_FORMAT_* */
-#define AST_FRAME_VOICE 2
-/*! Video frame, maybe?? :) */
-#define AST_FRAME_VIDEO 3
-/*! A control frame, subclass is AST_CONTROL_* */
-#define AST_FRAME_CONTROL 4
-/*! An empty, useless frame */
-#define AST_FRAME_NULL 5
-/*! Inter Asterisk Exchange private frame type */
-#define AST_FRAME_IAX 6
-/*! Text messages */
-#define AST_FRAME_TEXT 7
-/*! Image Frames */
-#define AST_FRAME_IMAGE 8
-/*! HTML Frame */
-#define AST_FRAME_HTML 9
-/*! Comfort Noise frame (subclass is level of CNG in -dBov),
- body may include zero or more 8-bit quantization coefficients */
-#define AST_FRAME_CNG 10
-/*! T.38 Fax-over-IP data stream */
-#define AST_FRAME_T38 11
-
-/* HTML subclasses */
-/*! Sending a URL */
-#define AST_HTML_URL 1
-/*! Data frame */
-#define AST_HTML_DATA 2
-/*! Beginning frame */
-#define AST_HTML_BEGIN 4
-/*! End frame */
-#define AST_HTML_END 8
-/*! Load is complete */
-#define AST_HTML_LDCOMPLETE 16
-/*! Peer is unable to support HTML */
-#define AST_HTML_NOSUPPORT 17
-/*! Send URL, and track */
-#define AST_HTML_LINKURL 18
-/*! No more HTML linkage */
-#define AST_HTML_UNLINK 19
-/*! Reject link request */
-#define AST_HTML_LINKREJECT 20
-
-/* Data formats for capabilities and frames alike */
-/*! G.723.1 compression */
-#define AST_FORMAT_G723_1 (1 << 0)
-/*! GSM compression */
-#define AST_FORMAT_GSM (1 << 1)
-/*! Raw mu-law data (G.711) */
-#define AST_FORMAT_ULAW (1 << 2)
-/*! Raw A-law data (G.711) */
-#define AST_FORMAT_ALAW (1 << 3)
-/*! ADPCM (G.726, 32kbps) */
-#define AST_FORMAT_G726 (1 << 4)
-/*! ADPCM (IMA) */
-#define AST_FORMAT_ADPCM (1 << 5)
-/*! Raw 16-bit Signed Linear (8000 Hz) PCM */
-#define AST_FORMAT_SLINEAR (1 << 6)
-/*! LPC10, 180 samples/frame */
-#define AST_FORMAT_LPC10 (1 << 7)
-/*! G.729A audio */
-#define AST_FORMAT_G729A (1 << 8)
-/*! SpeeX Free Compression */
-#define AST_FORMAT_SPEEX (1 << 9)
-/*! iLBC Free Compression */
-#define AST_FORMAT_ILBC (1 << 10)
-/*! Maximum audio format */
-#define AST_FORMAT_MAX_AUDIO (1 << 15)
-/*! JPEG Images */
-#define AST_FORMAT_JPEG (1 << 16)
-/*! PNG Images */
-#define AST_FORMAT_PNG (1 << 17)
-/*! H.261 Video */
-#define AST_FORMAT_H261 (1 << 18)
-/*! H.263 Video */
-#define AST_FORMAT_H263 (1 << 19)
-/*! H.263+ Video */
-#define AST_FORMAT_H263_PLUS (1 << 20)
-/*! Maximum video format */
-#define AST_FORMAT_MAX_VIDEO (1 << 24)
-
-/* Control frame types */
-/*! Other end has hungup */
-#define AST_CONTROL_HANGUP 1
-/*! Local ring */
-#define AST_CONTROL_RING 2
-/*! Remote end is ringing */
-#define AST_CONTROL_RINGING 3
-/*! Remote end has answered */
-#define AST_CONTROL_ANSWER 4
-/*! Remote end is busy */
-#define AST_CONTROL_BUSY 5
-/*! Make it go off hook */
-#define AST_CONTROL_TAKEOFFHOOK 6
-/*! Line is off hook */
-#define AST_CONTROL_OFFHOOK 7
-/*! Congestion (circuits busy) */
-#define AST_CONTROL_CONGESTION 8
-/*! Flash hook */
-#define AST_CONTROL_FLASH 9
-/*! Wink */
-#define AST_CONTROL_WINK 10
-/*! Set a low-level option */
-#define AST_CONTROL_OPTION 11
-/*! Key Radio */
-#define AST_CONTROL_RADIO_KEY 12
-/*! Un-Key Radio */
-#define AST_CONTROL_RADIO_UNKEY 13
-/*! Indicate PROGRESS */
-#define AST_CONTROL_PROGRESS 14
-/*! Indicate CALL PROCEEDING */
-#define AST_CONTROL_PROCEEDING 15
-/*! Indicate call is placed on hold */
-#define AST_CONTROL_HOLD 16
-/*! Indicate call is left from hold */
-#define AST_CONTROL_UNHOLD 17
-/*! Indicate video frame update */
-#define AST_CONTROL_VIDUPDATE 18
-
-#define AST_SMOOTHER_FLAG_G729 (1 << 0)
-
-/* Option identifiers and flags */
-#define AST_OPTION_FLAG_REQUEST 0
-#define AST_OPTION_FLAG_ACCEPT 1
-#define AST_OPTION_FLAG_REJECT 2
-#define AST_OPTION_FLAG_QUERY 4
-#define AST_OPTION_FLAG_ANSWER 5
-#define AST_OPTION_FLAG_WTF 6
-
-/*! Verify touchtones by muting audio transmission
- (and reception) and verify the tone is still present */
-#define AST_OPTION_TONE_VERIFY 1
-
-/*! Put a compatible channel into TDD (TTY for the hearing-impared) mode */
-#define AST_OPTION_TDD 2
-
-/*! Relax the parameters for DTMF reception (mainly for radio use) */
-#define AST_OPTION_RELAXDTMF 3
-
-/*! Set (or clear) Audio (Not-Clear) Mode */
-#define AST_OPTION_AUDIO_MODE 4
-
-/*! Set channel transmit gain
- * Option data is a single signed char
- representing number of decibels (dB)
- to set gain to (on top of any gain
- specified in channel driver)
-*/
-#define AST_OPTION_TXGAIN 5
-
-/*! Set channel receive gain
- * Option data is a single signed char
- representing number of decibels (dB)
- to set gain to (on top of any gain
- specified in channel driver)
-*/
-#define AST_OPTION_RXGAIN 6
-
-struct ast_option_header {
- /* Always keep in network byte order */
-#if __BYTE_ORDER == __BIG_ENDIAN
- u_int16_t flag:3;
- u_int16_t option:13;
-#else
-#if __BYTE_ORDER == __LITTLE_ENDIAN
- u_int16_t option:13;
- u_int16_t flag:3;
-#else
-#error Byte order not defined
-#endif
-#endif
- u_int8_t data[0];
-};
-
-/*! \brief Requests a frame to be allocated
- *
- * \param source
- * Request a frame be allocated. source is an optional source of the frame,
- * len is the requested length, or "0" if the caller will supply the buffer
- */
-#if 0 /* Unimplemented */
-struct ast_frame *ast_fralloc(char *source, int len);
-#endif
-
-/*! \brief Frees a frame
- * \param fr Frame to free
- * Free a frame, and the memory it used if applicable
- * \return no return.
- */
-void ast_frfree(struct ast_frame *fr);
-
-/*! \brief Copies a frame
- * \param fr frame to act upon
- * Take a frame, and if it's not been malloc'd, make a malloc'd copy
- * and if the data hasn't been malloced then make the
- * data malloc'd. If you need to store frames, say for queueing, then
- * you should call this function.
- * \return Returns a frame on success, NULL on error
- */
-struct ast_frame *ast_frisolate(struct ast_frame *fr);
-
-/*! \brief Copies a frame
- * \param fr frame to copy
- * Dupliates a frame -- should only rarely be used, typically frisolate is good enough
- * \return Returns a frame on success, NULL on error
- */
-struct ast_frame *ast_frdup(struct ast_frame *fr);
-
-/*! \brief Reads a frame from an fd
- * Read a frame from a stream or packet fd, as written by fd_write
- * \param fd an opened fd to read from
- * \return returns a frame on success, NULL on error
- */
-struct ast_frame *ast_fr_fdread(int fd);
-
-/*! Writes a frame to an fd
- * Write a frame to an fd
- * \param fd Which fd to write to
- * \param frame frame to write to the fd
- * \return Returns 0 on success, -1 on failure
- */
-int ast_fr_fdwrite(int fd, struct ast_frame *frame);
-
-/*! \brief Sends a hangup to an fd
- * Send a hangup (NULL equivalent) on an fd
- * \param fd fd to write to
- * \return Returns 0 on success, -1 on failure
- */
-int ast_fr_fdhangup(int fd);
-
-void ast_swapcopy_samples(void *dst, const void *src, int samples);
-
-/* Helpers for byteswapping native samples to/from
- little-endian and big-endian. */
-#if __BYTE_ORDER == __LITTLE_ENDIAN
-#define ast_frame_byteswap_le(fr) do { ; } while(0)
-#define ast_frame_byteswap_be(fr) do { struct ast_frame *__f = (fr); ast_swapcopy_samples(__f->data, __f->data, __f->samples); } while(0)
-#else
-#define ast_frame_byteswap_le(fr) do { struct ast_frame *__f = (fr); ast_swapcopy_samples(__f->data, __f->data, __f->samples); } while(0)
-#define ast_frame_byteswap_be(fr) do { ; } while(0)
-#endif
-
-
-/*! \brief Get the name of a format
- * \param format id of format
- * \return A static string containing the name of the format or "UNKN" if unknown.
- */
-extern char* ast_getformatname(int format);
-
-/*! \brief Get the names of a set of formats
- * \param buf a buffer for the output string
- * \param size size of buf (bytes)
- * \param format the format (combined IDs of codecs)
- * Prints a list of readable codec names corresponding to "format".
- * ex: for format=AST_FORMAT_GSM|AST_FORMAT_SPEEX|AST_FORMAT_ILBC it will return "0x602 (GSM|SPEEX|ILBC)"
- * \return The return value is buf.
- */
-extern char* ast_getformatname_multiple(char *buf, size_t size, int format);
-
-/*!
- * \brief Gets a format from a name.
- * \param name string of format
- * \return This returns the form of the format in binary on success, 0 on error.
- */
-extern int ast_getformatbyname(char *name);
-
-/*! \brief Get a name from a format
- * Gets a name from a format
- * \param codec codec number (1,2,4,8,16,etc.)
- * \return This returns a static string identifying the format on success, 0 on error.
- */
-extern char *ast_codec2str(int codec);
-
-struct ast_smoother;
-
-extern struct ast_format_list *ast_get_format_list_index(int index);
-extern struct ast_format_list *ast_get_format_list(size_t *size);
-extern struct ast_smoother *ast_smoother_new(int bytes);
-extern void ast_smoother_set_flags(struct ast_smoother *smoother, int flags);
-extern int ast_smoother_get_flags(struct ast_smoother *smoother);
-extern void ast_smoother_free(struct ast_smoother *s);
-extern void ast_smoother_reset(struct ast_smoother *s, int bytes);
-extern int __ast_smoother_feed(struct ast_smoother *s, struct ast_frame *f, int swap);
-extern struct ast_frame *ast_smoother_read(struct ast_smoother *s);
-#define ast_smoother_feed(s,f) __ast_smoother_feed(s, f, 0)
-#if __BYTE_ORDER == __LITTLE_ENDIAN
-#define ast_smoother_feed_be(s,f) __ast_smoother_feed(s, f, 1)
-#define ast_smoother_feed_le(s,f) __ast_smoother_feed(s, f, 0)
-#else
-#define ast_smoother_feed_be(s,f) __ast_smoother_feed(s, f, 0)
-#define ast_smoother_feed_le(s,f) __ast_smoother_feed(s, f, 1)
-#endif
-
-extern void ast_frame_dump(char *name, struct ast_frame *f, char *prefix);
-
-/*! \brief Initialize a codec preference to "no preference" */
-extern void ast_codec_pref_init(struct ast_codec_pref *pref);
-
-/*! \brief Codec located at a particular place in the preference index */
-extern int ast_codec_pref_index(struct ast_codec_pref *pref, int index);
-
-/*! \brief Remove a codec from a preference list */
-extern void ast_codec_pref_remove(struct ast_codec_pref *pref, int format);
-
-/*! \brief Append a codec to a preference list, removing it first if it was already there */
-extern int ast_codec_pref_append(struct ast_codec_pref *pref, int format);
-
-/*! \brief Select the best format according to preference list from supplied options.
- If "find_best" is non-zero then if nothing is found, the "Best" format of
- the format list is selected, otherwise 0 is returned. */
-extern int ast_codec_choose(struct ast_codec_pref *pref, int formats, int find_best);
-
-/*! \brief Parse an "allow" or "deny" line and update the mask and pref if provided */
-extern void ast_parse_allow_disallow(struct ast_codec_pref *pref, int *mask, const char *list, int allowing);
-
-/*! \brief Dump codec preference list into a string */
-extern int ast_codec_pref_string(struct ast_codec_pref *pref, char *buf, size_t size);
-
-/*! \brief Shift a codec preference list up or down 65 bytes so that it becomes an ASCII string */
-extern void ast_codec_pref_convert(struct ast_codec_pref *pref, char *buf, size_t size, int right);
-
-/*! \brief Returns the number of samples contained in the frame */
-extern int ast_codec_get_samples(struct ast_frame *f);
-
-/*! \brief Returns the number of bytes for the number of samples of the given format */
-extern int ast_codec_get_len(int format, int samples);
-
-/*! \brief Gets duration in ms of interpolation frame for a format */
-static inline int ast_codec_interp_len(int format)
-{
- return (format == AST_FORMAT_ILBC) ? 30 : 20;
-}
-
-/*!
- \brief Adjusts the volume of the audio samples contained in a frame.
- \param f The frame containing the samples (must be AST_FRAME_VOICE and AST_FORMAT_SLINEAR)
- \param adjustment The number of dB to adjust up or down.
- \return 0 for success, non-zero for an error
- */
-int ast_frame_adjust_volume(struct ast_frame *f, int adjustment);
-
-/*!
- \brief Sums two frames of audio samples.
- \param f1 The first frame (which will contain the result)
- \param f2 The second frame
- \return 0 for success, non-zero for an error
-
- The frames must be AST_FRAME_VOICE and must contain AST_FORMAT_SLINEAR samples,
- and must contain the same number of samples.
- */
-int ast_frame_slinear_sum(struct ast_frame *f1, struct ast_frame *f2);
-
-#if defined(__cplusplus) || defined(c_plusplus)
-}
-#endif
-
-#endif /* _ASTERISK_FRAME_H */
diff --git a/1.2-netsec/include/asterisk/fskmodem.h b/1.2-netsec/include/asterisk/fskmodem.h
deleted file mode 100644
index ea863fc2f..000000000
--- a/1.2-netsec/include/asterisk/fskmodem.h
+++ /dev/null
@@ -1,72 +0,0 @@
-/*
- * 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.
- */
-
-/*! \file
- * \brief FSK Modem Support
- * \note Includes code and algorithms from the Zapata library.
- * \todo Translate Emiliano Zapata's spanish comments to english, please.
- */
-
-#ifndef _ASTERISK_FSKMODEM_H
-#define _ASTERISK_FSKMODEM_H
-
-#define PARITY_NONE 0
-#define PARITY_EVEN 1
-#define PARITY_ODD 2
-
-
-#define NCOLA 0x4000
-
-typedef struct {
- float spb; /*!< Samples / Bit */
- int nbit; /*!< Number of Data Bits (5,7,8) */
- float nstop; /*!< Number of Stop Bits 1,1.5,2 */
- int paridad; /*!< Parity 0=none 1=even 2=odd */
- int hdlc; /*!< Modo Packet */
- float x0;
- float x1;
- float x2;
- float cont;
- int bw; /*!< Ancho de Banda */
- double fmxv[8],fmyv[8]; /*!< filter stuff for M filter */
- int fmp; /*!< pointer for M filter */
- double fsxv[8],fsyv[8]; /*!< filter stuff for S filter */
- int fsp; /*!< pointer for S filter */
- double flxv[8],flyv[8]; /*!< filter stuff for L filter */
- int flp; /*!< pointer for L filter */
- int f_mark_idx; /*!< Indice de frecuencia de marca (f_M-500)/5 */
- int f_space_idx; /*!< Indice de frecuencia de espacio (f_S-500)/5 */
- int state;
- int pcola; /*!< Puntero de las colas de datos */
- float cola_in[NCOLA]; /*!< Cola de muestras de entrada */
- float cola_filtro[NCOLA]; /*!< Cola de muestras tras filtros */
- float cola_demod[NCOLA]; /*!< Cola de muestras demoduladas */
-} fsk_data;
-
-/* \brief Retrieve a serial byte into outbyte.
- Buffer is a pointer into a series of
- shorts and len records the number of bytes in the buffer. len will be
- overwritten with the number of bytes left that were not consumed.
- \return return value is as follows:
- \arg 0: Still looking for something...
- \arg 1: An output byte was received and stored in outbyte
- \arg -1: An error occured in the transmission
- He must be called with at least 80 bytes of buffer. */
-extern int fsk_serie(fsk_data *fskd, short *buffer, int *len, int *outbyte);
-
-#endif /* _ASTERISK_FSKMODEM_H */
diff --git a/1.2-netsec/include/asterisk/image.h b/1.2-netsec/include/asterisk/image.h
deleted file mode 100644
index 1b29b1daa..000000000
--- a/1.2-netsec/include/asterisk/image.h
+++ /dev/null
@@ -1,96 +0,0 @@
-/*
- * 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.
- */
-
-/*! \file
- * \brief General Asterisk channel definitions for image handling
- */
-
-#ifndef _ASTERISK_IMAGE_H
-#define _ASTERISK_IMAGE_H
-
-/*! \brief structure associated with registering an image format */
-struct ast_imager {
- /*! Name */
- char *name;
- /*! Description */
- char *desc;
- /*! Extension(s) (separated by '|' ) */
- char *exts;
- /*! Image format */
- int format;
- /*! Read an image from a file descriptor */
- struct ast_frame *(*read_image)(int fd, int len);
- /*! Identify if this is that type of file */
- int (*identify)(int fd);
- /*! Returns length written */
- int (*write_image)(int fd, struct ast_frame *frame);
- /*! For linked list */
- struct ast_imager *next;
-};
-
-/*! Check for image support on a channel */
-/*!
- * \param chan channel to check
- * Checks the channel to see if it supports the transmission of images
- * Returns non-zero if image transmission is supported
- */
-extern int ast_supports_images(struct ast_channel *chan);
-
-/*! Sends an image */
-/*!
- * \param chan channel to send image on
- * \param filename filename of image to send (minus extension)
- * Sends an image on the given channel.
- * Returns 0 on success, -1 on error
- */
-extern int ast_send_image(struct ast_channel *chan, char *filename);
-
-/*! Make an image */
-/*!
- * \param filename filename of image to prepare
- * \param preflang preferred language to get the image...?
- * \param format the format of the file
- * Make an image from a filename ??? No estoy positivo
- * Returns an ast_frame on success, NULL on failure
- */
-extern struct ast_frame *ast_read_image(char *filename, char *preflang, int format);
-
-/*! Register image format */
-/*!
- * \param imgdrv Populated ast_imager structure with info to register
- * Registers an image format
- * Returns 0 regardless
- */
-extern int ast_image_register(struct ast_imager *imgdrv);
-
-/*! Unregister an image format */
-/*!
- * \param imgdrv pointer to the ast_imager structure you wish to unregister
- * Unregisters the image format passed in
- * Returns nothing
- */
-extern void ast_image_unregister(struct ast_imager *imgdrv);
-
-/*! Initialize image stuff */
-/*!
- * Initializes all the various image stuff. Basically just registers the cli stuff
- * Returns 0 all the time
- */
-extern int ast_image_init(void);
-
-#endif /* _ASTERISK_IMAGE_H */
diff --git a/1.2-netsec/include/asterisk/indications.h b/1.2-netsec/include/asterisk/indications.h
deleted file mode 100644
index 6b55d90aa..000000000
--- a/1.2-netsec/include/asterisk/indications.h
+++ /dev/null
@@ -1,87 +0,0 @@
-/*
- * Asterisk -- An open source telephony toolkit.
- *
- * 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.
- */
-
-/*! \file
- * \brief BSD Telephony Of Mexico "Tormenta" Tone Zone Support 2/22/01
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- *
- * Primary Author: Pauline Middelink <middelink@polyware.nl>
- *
- */
-
-#ifndef _ASTERISK_INDICATIONS_H
-#define _ASTERISK_INDICATIONS_H
-
-#include "asterisk/lock.h"
-
-/* forward reference */
-struct ast_channel;
-
-struct tone_zone_sound {
- struct tone_zone_sound *next; /* next element */
- const char *name; /* Identifing name */
- const char *data; /* Actual zone description */
- /* Description is a series of tones of the format:
- [!]freq1[+freq2][/duration] separated by commas. There
- are no spaces. The sequence is repeated back to the
- first tone description not preceeded by !. Duration is
- specified in milliseconds */
-};
-
-struct tone_zone {
- struct tone_zone* next; /* next in list */
- char country[5]; /* Country code */
- char alias[5]; /* is this an alias? */
- char description[40]; /* Description */
- int nrringcadence; /* # registered ringcadence elements */
- int *ringcadence; /* Ring cadence */
- struct tone_zone_sound *tones; /* The known tones for this zone */
-};
-
-/* set the default tone country */
-extern int ast_set_indication_country(const char *country);
-
-/* locate tone_zone, given the country. if country == NULL, use the default country */
-extern struct tone_zone *ast_get_indication_zone(const char *country);
-/* locate a tone_zone_sound, given the tone_zone. if tone_zone == NULL, use the default tone_zone */
-extern struct tone_zone_sound *ast_get_indication_tone(const struct tone_zone *zone, const char *indication);
-
-/* add a new country, if country exists, it will be replaced. */
-extern int ast_register_indication_country(struct tone_zone *country);
-/* remove an existing country and all its indications, country must exist */
-extern int ast_unregister_indication_country(const char *country);
-/* add a new indication to a tone_zone. tone_zone must exist. if the indication already
- * exists, it will be replaced. */
-extern int ast_register_indication(struct tone_zone *zone, const char *indication, const char *tonelist);
-/* remove an existing tone_zone's indication. tone_zone must exist */
-extern int ast_unregister_indication(struct tone_zone *zone, const char *indication);
-
-/* Start a tone-list going */
-int ast_playtones_start(struct ast_channel *chan, int vol, const char* tonelist, int interruptible);
-/*! Stop the tones from playing */
-void ast_playtones_stop(struct ast_channel *chan);
-
-extern struct tone_zone *tone_zones;
-extern ast_mutex_t tzlock;
-
-#endif /* _ASTERISK_INDICATIONS_H */
diff --git a/1.2-netsec/include/asterisk/inline_api.h b/1.2-netsec/include/asterisk/inline_api.h
deleted file mode 100644
index 2347d09d7..000000000
--- a/1.2-netsec/include/asterisk/inline_api.h
+++ /dev/null
@@ -1,66 +0,0 @@
-/*
- * Asterisk -- An open source telephony toolkit.
- *
- * Copyright (C) 1999 - 2005, Digium, Inc.
- *
- * Kevin P. Fleming <kpfleming@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.
- */
-
-#ifndef __ASTERISK_INLINEAPI_H
-#define __ASTERISK_INLINEAPI_H
-
-/*! \file
- * \brief Inlinable API function macro
-
- Small API functions that are candidates for inlining need to be specially
- declared and defined, to ensure that the 'right thing' always happens.
- For example:
- - there must _always_ be a non-inlined version of the function
- available for modules compiled out of the tree to link to
- - references to a function that cannot be inlined (for any
- reason that the compiler deems proper) must devolve into an
- 'extern' reference, instead of 'static', so that multiple
- copies of the function body are not built in different modules
- - when LOW_MEMORY is defined, inlining should be disabled
- completely, even if the compiler is configured to support it
-
- The AST_INLINE_API macro allows this to happen automatically, when
- used to define your function. Proper usage is as follows:
- - define your function one place, in a header file, using the macro
- to wrap the function (see strings.h or time.h for examples)
- - choose a module to 'host' the function body for non-inline
- usages, and in that module _only_, define AST_API_MODULE before
- including the header file
- */
-
-#if !defined(LOW_MEMORY)
-
-#if !defined(AST_API_MODULE)
-#define AST_INLINE_API(hdr, body) hdr; extern inline hdr body
-#else
-#define AST_INLINE_API(hdr, body) hdr; hdr body
-#endif
-
-#else /* defined(LOW_MEMORY) */
-
-#if !defined(AST_API_MODULE)
-#define AST_INLINE_API(hdr, body) hdr;
-#else
-#define AST_INLINE_API(hdr, body) hdr; hdr body
-#endif
-
-#endif
-
-#undef AST_API_MODULE
-
-#endif /* __ASTERISK_INLINEAPI_H */
diff --git a/1.2-netsec/include/asterisk/io.h b/1.2-netsec/include/asterisk/io.h
deleted file mode 100644
index c33fb515b..000000000
--- a/1.2-netsec/include/asterisk/io.h
+++ /dev/null
@@ -1,145 +0,0 @@
-/*
- * 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.
- */
-
-/*! \file
- * \brief I/O Management (derived from Cheops-NG)
- */
-
-#ifndef _ASTERISK_IO_H
-#define _ASTERISK_IO_H
-
-#ifdef POLLCOMPAT
-#include "asterisk/poll-compat.h"
-#else
-#include <sys/poll.h> /* For POLL* constants */
-#endif
-
-#if defined(__cplusplus) || defined(c_plusplus)
-extern "C" {
-#endif
-
-/*! Input ready */
-#define AST_IO_IN POLLIN
-/*! Output ready */
-#define AST_IO_OUT POLLOUT
-/*! Priority input ready */
-#define AST_IO_PRI POLLPRI
-
-/* Implicitly polled for */
-/*! Error condition (errno or getsockopt) */
-#define AST_IO_ERR POLLERR
-/*! Hangup */
-#define AST_IO_HUP POLLHUP
-/*! Invalid fd */
-#define AST_IO_NVAL POLLNVAL
-
-/*
- * An Asterisk IO callback takes its id, a file descriptor, list of events, and
- * callback data as arguments and returns 0 if it should not be
- * run again, or non-zero if it should be run again.
- */
-
-struct io_context;
-
-/*! Creates a context */
-/*!
- * Create a context for I/O operations
- * Basically mallocs an IO structure and sets up some default values.
- * Returns an allocated io_context structure
- */
-extern struct io_context *io_context_create(void);
-
-/*! Destroys a context */
-/*
- * \param ioc structure to destroy
- * Destroy a context for I/O operations
- * Frees all memory associated with the given io_context structure along with the structure itself
- */
-extern void io_context_destroy(struct io_context *ioc);
-
-typedef int (*ast_io_cb)(int *id, int fd, short events, void *cbdata);
-#define AST_IO_CB(a) ((ast_io_cb)(a))
-
-/*! Adds an IO context */
-/*!
- * \param ioc which context to use
- * \param fd which fd to monitor
- * \param callback callback function to run
- * \param events event mask of events to wait for
- * \param data data to pass to the callback
- * Watch for any of revents activites on fd, calling callback with data as
- * callback data. Returns a pointer to ID of the IO event, or NULL on failure.
- */
-extern int *ast_io_add(struct io_context *ioc, int fd, ast_io_cb callback, short events, void *data);
-
-/*! Changes an IO handler */
-/*!
- * \param ioc which context to use
- * \param id
- * \param fd the fd you wish it to contain now
- * \param callback new callback function
- * \param events event mask to wait for
- * \param data data to pass to the callback function
- * Change an i/o handler, updating fd if > -1, callback if non-null, and revents
- * if >-1, and data if non-null. Returns a pointero to the ID of the IO event,
- * or NULL on failure.
- */
-extern int *ast_io_change(struct io_context *ioc, int *id, int fd, ast_io_cb callback, short events, void *data);
-
-/*! Removes an IO context */
-/*!
- * \param ioc which io_context to remove it from
- * \param id which ID to remove
- * Remove an I/O id from consideration Returns 0 on success or -1 on failure.
- */
-extern int ast_io_remove(struct io_context *ioc, int *id);
-
-/*! Waits for IO */
-/*!
- * \param ioc which context to act upon
- * \param howlong how many milliseconds to wait
- * Wait for I/O to happen, returning after
- * howlong milliseconds, and after processing
- * any necessary I/O. Returns the number of
- * I/O events which took place.
- */
-extern int ast_io_wait(struct io_context *ioc, int howlong);
-
-/*! Dumps the IO array */
-/*
- * Debugging: Dump everything in the I/O array
- */
-extern void ast_io_dump(struct io_context *ioc);
-
-/*! Set fd into non-echoing mode (if fd is a tty) */
-
-extern int ast_hide_password(int fd);
-
-/*! Restores TTY mode */
-/*
- * Call with result from previous ast_hide_password
- */
-extern int ast_restore_tty(int fd, int oldstatus);
-
-extern int ast_get_termcols(int fd);
-
-#if defined(__cplusplus) || defined(c_plusplus)
-}
-#endif
-
-#endif /* _ASTERISK_IO_H */
diff --git a/1.2-netsec/include/asterisk/linkedlists.h b/1.2-netsec/include/asterisk/linkedlists.h
deleted file mode 100644
index 8cf251b8b..000000000
--- a/1.2-netsec/include/asterisk/linkedlists.h
+++ /dev/null
@@ -1,443 +0,0 @@
-/*
- * Asterisk -- An open source telephony toolkit.
- *
- * Copyright (C) 1999 - 2005, Digium, Inc.
- *
- * Mark Spencer <markster@digium.com>
- * Kevin P. Fleming <kpfleming@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.
- */
-
-#ifndef ASTERISK_LINKEDLISTS_H
-#define ASTERISK_LINKEDLISTS_H
-
-#include "asterisk/lock.h"
-
-/*!
- \file linkedlists.h
- \brief A set of macros to manage forward-linked lists.
-*/
-
-/*!
- \brief Attempts to lock a list.
- \param head This is a pointer to the list head structure
-
- This macro attempts to place an exclusive lock in the
- list head structure pointed to by head.
- Returns non-zero on success, 0 on failure
-*/
-#define AST_LIST_LOCK(head) \
- ast_mutex_lock(&(head)->lock)
-
-/*!
- \brief Attempts to unlock a list.
- \param head This is a pointer to the list head structure
-
- This macro attempts to remove an exclusive lock from the
- list head structure pointed to by head. If the list
- was not locked by this thread, this macro has no effect.
-*/
-#define AST_LIST_UNLOCK(head) \
- ast_mutex_unlock(&(head)->lock)
-
-/*!
- \brief Defines a structure to be used to hold a list of specified type.
- \param name This will be the name of the defined structure.
- \param type This is the type of each list entry.
-
- This macro creates a structure definition that can be used
- to hold a list of the entries of type \a type. It does not actually
- declare (allocate) a structure; to do that, either follow this
- macro with the desired name of the instance you wish to declare,
- or use the specified \a name to declare instances elsewhere.
-
- Example usage:
- \code
- static AST_LIST_HEAD(entry_list, entry) entries;
- \endcode
-
- This would define \c struct \c entry_list, and declare an instance of it named
- \a entries, all intended to hold a list of type \c struct \c entry.
-*/
-#define AST_LIST_HEAD(name, type) \
-struct name { \
- struct type *first; \
- struct type *last; \
- ast_mutex_t lock; \
-}
-
-/*!
- \brief Defines a structure to be used to hold a list of specified type (with no lock).
- \param name This will be the name of the defined structure.
- \param type This is the type of each list entry.
-
- This macro creates a structure definition that can be used
- to hold a list of the entries of type \a type. It does not actually
- declare (allocate) a structure; to do that, either follow this
- macro with the desired name of the instance you wish to declare,
- or use the specified \a name to declare instances elsewhere.
-
- Example usage:
- \code
- static AST_LIST_HEAD_NOLOCK(entry_list, entry) entries;
- \endcode
-
- This would define \c struct \c entry_list, and declare an instance of it named
- \a entries, all intended to hold a list of type \c struct \c entry.
-*/
-#define AST_LIST_HEAD_NOLOCK(name, type) \
-struct name { \
- struct type *first; \
- struct type *last; \
-}
-
-/*!
- \brief Defines a structure to be used to hold a list of specified type, statically initialized.
- \param name This will be the name of the defined structure.
- \param type This is the type of each list entry.
-
- This macro creates a structure definition that can be used
- to hold a list of the entries of type \a type, and allocates an instance
- of it, initialized to be empty.
-
- Example usage:
- \code
- static AST_LIST_HEAD_STATIC(entry_list, entry);
- \endcode
-
- This would define \c struct \c entry_list, intended to hold a list of
- type \c struct \c entry.
-*/
-#define AST_LIST_HEAD_STATIC(name, type) \
-struct name { \
- struct type *first; \
- struct type *last; \
- ast_mutex_t lock; \
-} name = { \
- .first = NULL, \
- .last = NULL, \
- .lock = AST_MUTEX_INIT_VALUE, \
-};
-
-/*!
- \brief Initializes a list head structure with a specified first entry.
- \param head This is a pointer to the list head structure
- \param entry pointer to the list entry that will become the head of the list
-
- This macro initializes a list head structure by setting the head
- entry to the supplied value and recreating the embedded lock.
-*/
-#define AST_LIST_HEAD_SET(head, entry) do { \
- (head)->first = (entry); \
- (head)->last = (entry); \
- ast_mutex_init(&(head)->lock); \
-} while (0)
-
-/*!
- \brief Initializes a list head structure with a specified first entry.
- \param head This is a pointer to the list head structure
- \param entry pointer to the list entry that will become the head of the list
-
- This macro initializes a list head structure by setting the head
- entry to the supplied value.
-*/
-#define AST_LIST_HEAD_SET_NOLOCK(head, entry) do { \
- (head)->first = (entry); \
- (head)->last = (entry); \
-} while (0)
-
-/*!
- \brief Declare a forward link structure inside a list entry.
- \param type This is the type of each list entry.
-
- This macro declares a structure to be used to link list entries together.
- It must be used inside the definition of the structure named in
- \a type, as follows:
-
- \code
- struct list_entry {
- ...
- AST_LIST_ENTRY(list_entry) list;
- }
- \endcode
-
- The field name \a list here is arbitrary, and can be anything you wish.
-*/
-#define AST_LIST_ENTRY(type) \
-struct { \
- struct type *next; \
-}
-
-/*!
- \brief Returns the first entry contained in a list.
- \param head This is a pointer to the list head structure
- */
-#define AST_LIST_FIRST(head) ((head)->first)
-
-/*!
- \brief Returns the next entry in the list after the given entry.
- \param elm This is a pointer to the current entry.
- \param field This is the name of the field (declared using AST_LIST_ENTRY())
- used to link entries of this list together.
-*/
-#define AST_LIST_NEXT(elm, field) ((elm)->field.next)
-
-/*!
- \brief Checks whether the specified list contains any entries.
- \param head This is a pointer to the list head structure
-
- Returns non-zero if the list has entries, zero if not.
- */
-#define AST_LIST_EMPTY(head) (AST_LIST_FIRST(head) == NULL)
-
-/*!
- \brief Loops over (traverses) the entries in a list.
- \param head This is a pointer to the list head structure
- \param var This is the name of the variable that will hold a pointer to the
- current list entry on each iteration. It must be declared before calling
- this macro.
- \param field This is the name of the field (declared using AST_LIST_ENTRY())
- used to link entries of this list together.
-
- This macro is use to loop over (traverse) the entries in a list. It uses a
- \a for loop, and supplies the enclosed code with a pointer to each list
- entry as it loops. It is typically used as follows:
- \code
- static AST_LIST_HEAD(entry_list, list_entry) entries;
- ...
- struct list_entry {
- ...
- AST_LIST_ENTRY(list_entry) list;
- }
- ...
- struct list_entry *current;
- ...
- AST_LIST_TRAVERSE(&entries, current, list) {
- (do something with current here)
- }
- \endcode
- \warning If you modify the forward-link pointer contained in the \a current entry while
- inside the loop, the behavior will be unpredictable. At a minimum, the following
- macros will modify the forward-link pointer, and should not be used inside
- AST_LIST_TRAVERSE() against the entry pointed to by the \a current pointer without
- careful consideration of their consequences:
- \li AST_LIST_NEXT() (when used as an lvalue)
- \li AST_LIST_INSERT_AFTER()
- \li AST_LIST_INSERT_HEAD()
- \li AST_LIST_INSERT_TAIL()
-*/
-#define AST_LIST_TRAVERSE(head,var,field) \
- for((var) = (head)->first; (var); (var) = (var)->field.next)
-
-/*!
- \brief Loops safely over (traverses) the entries in a list.
- \param head This is a pointer to the list head structure
- \param var This is the name of the variable that will hold a pointer to the
- current list entry on each iteration. It must be declared before calling
- this macro.
- \param field This is the name of the field (declared using AST_LIST_ENTRY())
- used to link entries of this list together.
-
- This macro is used to safely loop over (traverse) the entries in a list. It
- uses a \a for loop, and supplies the enclosed code with a pointer to each list
- entry as it loops. It is typically used as follows:
-
- \code
- static AST_LIST_HEAD(entry_list, list_entry) entries;
- ...
- struct list_entry {
- ...
- AST_LIST_ENTRY(list_entry) list;
- }
- ...
- struct list_entry *current;
- ...
- AST_LIST_TRAVERSE_SAFE_BEGIN(&entries, current, list) {
- (do something with current here)
- }
- AST_LIST_TRAVERSE_SAFE_END;
- \endcode
-
- It differs from AST_LIST_TRAVERSE() in that the code inside the loop can modify
- (or even free, after calling AST_LIST_REMOVE_CURRENT()) the entry pointed to by
- the \a current pointer without affecting the loop traversal.
-*/
-#define AST_LIST_TRAVERSE_SAFE_BEGIN(head, var, field) { \
- typeof((head)->first) __list_next; \
- typeof((head)->first) __list_prev = NULL; \
- typeof((head)->first) __new_prev = NULL; \
- for ((var) = (head)->first, __new_prev = (var), \
- __list_next = (var) ? (var)->field.next : NULL; \
- (var); \
- __list_prev = __new_prev, (var) = __list_next, \
- __list_next = (var) ? (var)->field.next : NULL \
- )
-
-/*!
- \brief Removes the \a current entry from a list during a traversal.
- \param head This is a pointer to the list head structure
- \param field This is the name of the field (declared using AST_LIST_ENTRY())
- used to link entries of this list together.
-
- \note This macro can \b only be used inside an AST_LIST_TRAVERSE_SAFE_BEGIN()
- block; it is used to unlink the current entry from the list without affecting
- the list traversal (and without having to re-traverse the list to modify the
- previous entry, if any).
- */
-#define AST_LIST_REMOVE_CURRENT(head, field) \
- __new_prev = __list_prev; \
- if (__list_prev) \
- __list_prev->field.next = __list_next; \
- else \
- (head)->first = __list_next; \
- if (!__list_next) \
- (head)->last = __list_prev;
-
-/*!
- \brief Closes a safe loop traversal block.
- */
-#define AST_LIST_TRAVERSE_SAFE_END }
-
-/*!
- \brief Initializes a list head structure.
- \param head This is a pointer to the list head structure
-
- This macro initializes a list head structure by setting the head
- entry to \a NULL (empty list) and recreating the embedded lock.
-*/
-#define AST_LIST_HEAD_INIT(head) { \
- (head)->first = NULL; \
- (head)->last = NULL; \
- ast_mutex_init(&(head)->lock); \
-}
-
-/*!
- \brief Destroys a list head structure.
- \param head This is a pointer to the list head structure
-
- This macro destroys a list head structure by setting the head
- entry to \a NULL (empty list) and destroying the embedded lock.
- It does not free the structure from memory.
-*/
-#define AST_LIST_HEAD_DESTROY(head) { \
- (head)->first = NULL; \
- (head)->last = NULL; \
- ast_mutex_destroy(&(head)->lock); \
-}
-
-/*!
- \brief Initializes a list head structure.
- \param head This is a pointer to the list head structure
-
- This macro initializes a list head structure by setting the head
- entry to \a NULL (empty list) and recreating the embedded lock.
-*/
-#define AST_LIST_HEAD_INIT_NOLOCK(head) { \
- (head)->first = NULL; \
- (head)->last = NULL; \
-}
-
-/*!
- \brief Inserts a list entry after a given entry.
- \param head This is a pointer to the list head structure
- \param listelm This is a pointer to the entry after which the new entry should
- be inserted.
- \param elm This is a pointer to the entry to be inserted.
- \param field This is the name of the field (declared using AST_LIST_ENTRY())
- used to link entries of this list together.
- */
-#define AST_LIST_INSERT_AFTER(head, listelm, elm, field) do { \
- (elm)->field.next = (listelm)->field.next; \
- (listelm)->field.next = (elm); \
- if ((head)->last == (listelm)) \
- (head)->last = (elm); \
-} while (0)
-
-/*!
- \brief Inserts a list entry at the head of a list.
- \param head This is a pointer to the list head structure
- \param elm This is a pointer to the entry to be inserted.
- \param field This is the name of the field (declared using AST_LIST_ENTRY())
- used to link entries of this list together.
- */
-#define AST_LIST_INSERT_HEAD(head, elm, field) do { \
- (elm)->field.next = (head)->first; \
- (head)->first = (elm); \
- if (!(head)->last) \
- (head)->last = (elm); \
-} while (0)
-
-/*!
- \brief Appends a list entry to the tail of a list.
- \param head This is a pointer to the list head structure
- \param elm This is a pointer to the entry to be appended.
- \param field This is the name of the field (declared using AST_LIST_ENTRY())
- used to link entries of this list together.
-
- Note: The link field in the appended entry is \b not modified, so if it is
- actually the head of a list itself, the entire list will be appended
- temporarily (until the next AST_LIST_INSERT_TAIL is performed).
- */
-#define AST_LIST_INSERT_TAIL(head, elm, field) do { \
- if (!(head)->first) { \
- (head)->first = (elm); \
- (head)->last = (elm); \
- } else { \
- (head)->last->field.next = (elm); \
- (head)->last = (elm); \
- } \
-} while (0)
-
-/*!
- \brief Removes and returns the head entry from a list.
- \param head This is a pointer to the list head structure
- \param field This is the name of the field (declared using AST_LIST_ENTRY())
- used to link entries of this list together.
-
- Removes the head entry from the list, and returns a pointer to it.
- This macro is safe to call on an empty list.
- */
-#define AST_LIST_REMOVE_HEAD(head, field) ({ \
- typeof((head)->first) cur = (head)->first; \
- if (cur) { \
- (head)->first = cur->field.next; \
- cur->field.next = NULL; \
- if ((head)->last == cur) \
- (head)->last = NULL; \
- } \
- cur; \
- })
-
-/*!
- \brief Removes a specific entry from a list.
- \param head This is a pointer to the list head structure
- \param elm This is a pointer to the entry to be removed.
- \param field This is the name of the field (declared using AST_LIST_ENTRY())
- used to link entries of this list together.
- \warning The removed entry is \b not freed nor modified in any way.
- */
-#define AST_LIST_REMOVE(head, elm, field) do { \
- if ((head)->first == (elm)) { \
- (head)->first = (elm)->field.next; \
- if ((head)->last == (elm)) \
- (head)->last = NULL; \
- } else { \
- typeof(elm) curelm = (head)->first; \
- while (curelm->field.next != (elm)) \
- curelm = curelm->field.next; \
- curelm->field.next = (elm)->field.next; \
- if ((head)->last == (elm)) \
- (head)->last = curelm; \
- } \
-} while (0)
-
-#endif /* _ASTERISK_LINKEDLISTS_H */
diff --git a/1.2-netsec/include/asterisk/localtime.h b/1.2-netsec/include/asterisk/localtime.h
deleted file mode 100644
index fac1788c0..000000000
--- a/1.2-netsec/include/asterisk/localtime.h
+++ /dev/null
@@ -1,34 +0,0 @@
-/*
- * Asterisk -- An open source telephony toolkit.
- *
- * Copyright (C) 1999 - 2005, Digium, Inc.
- *
- * Mark Spencer <markster@digium.com>
- * Tilghman Lesher <tlesher@vcch.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.
- */
-
-/*! \file
- * \brief Custom localtime functions for multiple timezones
- */
-
-#ifndef _ASTERISK_LOCALTIME_H
-#define _ASTERISK_LOCALTIME_H
-
-extern int ast_tzsetwall(void);
-extern void ast_tzset(const char *name);
-extern struct tm *ast_localtime(const time_t *timep, struct tm *p_tm, const char *zone);
-extern time_t ast_mktime(struct tm * const tmp, const char *zone);
-extern char *ast_ctime(const time_t * const timep);
-extern char *ast_ctime_r(const time_t * const timep, char *buf);
-
-#endif /* _ASTERISK_LOCALTIME_H */
diff --git a/1.2-netsec/include/asterisk/lock.h b/1.2-netsec/include/asterisk/lock.h
deleted file mode 100644
index 38c4e64ac..000000000
--- a/1.2-netsec/include/asterisk/lock.h
+++ /dev/null
@@ -1,660 +0,0 @@
-/*
- * 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.
- */
-
-/*! \file
- * \brief General Asterisk channel locking definitions.
- */
-
-#ifndef _ASTERISK_LOCK_H
-#define _ASTERISK_LOCK_H
-
-#include <pthread.h>
-#include <netdb.h>
-#include <time.h>
-#include <sys/param.h>
-
-#include "asterisk/logger.h"
-
-#define AST_PTHREADT_NULL (pthread_t) -1
-#define AST_PTHREADT_STOP (pthread_t) -2
-
-#ifdef __APPLE__
-/* Provide the Linux initializers for MacOS X */
-#define PTHREAD_MUTEX_RECURSIVE_NP PTHREAD_MUTEX_RECURSIVE
-#define PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP { 0x4d555458, \
- { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, \
- 0x20 } }
-#endif
-
-#ifdef BSD
-#ifdef __GNUC__
-#define AST_MUTEX_INIT_W_CONSTRUCTORS
-#else
-#define AST_MUTEX_INIT_ON_FIRST_USE
-#endif
-#endif /* BSD */
-
-/* From now on, Asterisk REQUIRES Recursive (not error checking) mutexes
- and will not run without them. */
-#if defined(__CYGWIN__)
-#define PTHREAD_MUTEX_RECURSIVE_NP PTHREAD_MUTEX_RECURSIVE
-#define PTHREAD_MUTEX_INIT_VALUE (ast_mutex_t)18
-#define AST_MUTEX_KIND PTHREAD_MUTEX_RECURSIVE_NP
-#elif defined(PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP)
-#define PTHREAD_MUTEX_INIT_VALUE PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP
-#define AST_MUTEX_KIND PTHREAD_MUTEX_RECURSIVE_NP
-#else
-#define PTHREAD_MUTEX_INIT_VALUE PTHREAD_MUTEX_INITIALIZER
-#define AST_MUTEX_KIND PTHREAD_MUTEX_RECURSIVE
-#endif /* PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP */
-
-#ifdef SOLARIS
-#define AST_MUTEX_INIT_W_CONSTRUCTORS
-#endif
-
-#ifdef DEBUG_THREADS
-
-#define __ast_mutex_logger(...) { if (canlog) ast_log(LOG_ERROR, __VA_ARGS__); else fprintf(stderr, __VA_ARGS__); }
-
-#ifdef THREAD_CRASH
-#define DO_THREAD_CRASH do { *((int *)(0)) = 1; } while(0)
-#endif
-
-#include <errno.h>
-#include <string.h>
-#include <stdio.h>
-#include <unistd.h>
-
-#define AST_MUTEX_INIT_VALUE { PTHREAD_MUTEX_INIT_VALUE, { NULL }, { 0 }, 0, { NULL }, { 0 } }
-
-#define AST_MAX_REENTRANCY 10
-
-struct ast_mutex_info {
- pthread_mutex_t mutex;
- const char *file[AST_MAX_REENTRANCY];
- int lineno[AST_MAX_REENTRANCY];
- int reentrancy;
- const char *func[AST_MAX_REENTRANCY];
- pthread_t thread[AST_MAX_REENTRANCY];
-};
-
-typedef struct ast_mutex_info ast_mutex_t;
-
-typedef pthread_cond_t ast_cond_t;
-
-static inline int __ast_pthread_mutex_init_attr(const char *filename, int lineno, const char *func,
- const char *mutex_name, ast_mutex_t *t,
- pthread_mutexattr_t *attr)
-{
-#ifdef AST_MUTEX_INIT_W_CONSTRUCTORS
- int canlog = strcmp(filename, "logger.c");
-
- if ((t->mutex) != ((pthread_mutex_t) PTHREAD_MUTEX_INITIALIZER)) {
- __ast_mutex_logger("%s line %d (%s): Error: mutex '%s' is already initialized.\n",
- filename, lineno, func, mutex_name);
- __ast_mutex_logger("%s line %d (%s): Error: previously initialization of mutex '%s'.\n",
- t->file, t->lineno, t->func, mutex_name);
-#ifdef THREAD_CRASH
- DO_THREAD_CRASH;
-#endif
- return 0;
- }
-#endif
-
- t->file[0] = filename;
- t->lineno[0] = lineno;
- t->func[0] = func;
- t->thread[0] = 0;
- t->reentrancy = 0;
-
- return pthread_mutex_init(&t->mutex, attr);
-}
-
-static inline int __ast_pthread_mutex_init(const char *filename, int lineno, const char *func,
- const char *mutex_name, ast_mutex_t *t)
-{
- static pthread_mutexattr_t attr;
-
- pthread_mutexattr_init(&attr);
- pthread_mutexattr_settype(&attr, AST_MUTEX_KIND);
-
- return __ast_pthread_mutex_init_attr(filename, lineno, func, mutex_name, t, &attr);
-}
-
-static inline int __ast_pthread_mutex_destroy(const char *filename, int lineno, const char *func,
- const char *mutex_name, ast_mutex_t *t)
-{
- int res;
- int canlog = strcmp(filename, "logger.c");
-
-#ifdef AST_MUTEX_INIT_W_CONSTRUCTORS
- if ((t->mutex) == ((pthread_mutex_t) PTHREAD_MUTEX_INITIALIZER)) {
- __ast_mutex_logger("%s line %d (%s): Error: mutex '%s' is uninitialized.\n",
- filename, lineno, func, mutex_name);
- }
-#endif
-
- res = pthread_mutex_trylock(&t->mutex);
- switch (res) {
- case 0:
- pthread_mutex_unlock(&t->mutex);
- break;
- case EINVAL:
- __ast_mutex_logger("%s line %d (%s): Error: attempt to destroy invalid mutex '%s'.\n",
- filename, lineno, func, mutex_name);
- break;
- case EBUSY:
- __ast_mutex_logger("%s line %d (%s): Error: attempt to destroy locked mutex '%s'.\n",
- filename, lineno, func, mutex_name);
- __ast_mutex_logger("%s line %d (%s): Error: '%s' was locked here.\n",
- t->file[t->reentrancy-1], t->lineno[t->reentrancy-1], t->func[t->reentrancy-1], mutex_name);
- break;
- }
-
- if ((res = pthread_mutex_destroy(&t->mutex)))
- __ast_mutex_logger("%s line %d (%s): Error destroying mutex: %s\n",
- filename, lineno, func, strerror(res));
-#ifndef PTHREAD_RECURSIVE_MUTEX_INITIALIZER_NP
- else
- t->mutex = PTHREAD_MUTEX_INIT_VALUE;
-#endif
- t->file[0] = filename;
- t->lineno[0] = lineno;
- t->func[0] = func;
-
- return res;
-}
-
-#if defined(AST_MUTEX_INIT_W_CONSTRUCTORS)
-/* if AST_MUTEX_INIT_W_CONSTRUCTORS is defined, use file scope
- constrictors/destructors to create/destroy mutexes. */
-#define __AST_MUTEX_DEFINE(scope,mutex) \
- scope ast_mutex_t mutex = AST_MUTEX_INIT_VALUE; \
-static void __attribute__ ((constructor)) init_##mutex(void) \
-{ \
- ast_mutex_init(&mutex); \
-} \
-static void __attribute__ ((destructor)) fini_##mutex(void) \
-{ \
- ast_mutex_destroy(&mutex); \
-}
-#elif defined(AST_MUTEX_INIT_ON_FIRST_USE)
-/* if AST_MUTEX_INIT_ON_FIRST_USE is defined, mutexes are created on
- first use. The performance impact on FreeBSD should be small since
- the pthreads library does this itself to initialize errror checking
- (defaulty type) mutexes. If nither is defined, the pthreads librariy
- does the initialization itself on first use. */
-#define __AST_MUTEX_DEFINE(scope,mutex) \
- scope ast_mutex_t mutex = AST_MUTEX_INIT_VALUE
-#else /* AST_MUTEX_INIT_W_CONSTRUCTORS */
-/* By default, use static initialization of mutexes.*/
-#define __AST_MUTEX_DEFINE(scope,mutex) \
- scope ast_mutex_t mutex = AST_MUTEX_INIT_VALUE
-#endif /* AST_MUTEX_INIT_W_CONSTRUCTORS */
-
-static inline int __ast_pthread_mutex_lock(const char *filename, int lineno, const char *func,
- const char* mutex_name, ast_mutex_t *t)
-{
- int res;
- int canlog = strcmp(filename, "logger.c");
-
-#if defined(AST_MUTEX_INIT_W_CONSTRUCTORS) || defined(AST_MUTEX_INIT_ON_FIRST_USE)
- if ((t->mutex) == ((pthread_mutex_t) PTHREAD_MUTEX_INITIALIZER)) {
-#ifdef AST_MUTEX_INIT_W_CONSTRUCTORS
- ast_mutex_logger("%s line %d (%s): Error: mutex '%s' is uninitialized.\n",
- filename, lineno, func, mutex_name);
-#endif
- ast_mutex_init(t);
- }
-#endif /* defined(AST_MUTEX_INIT_W_CONSTRUCTORS) || defined(AST_MUTEX_INIT_ON_FIRST_USE) */
-
-#ifdef DETECT_DEADLOCKS
- {
- time_t seconds = time(NULL);
- time_t current;
- do {
- res = pthread_mutex_trylock(&t->mutex);
- if (res == EBUSY) {
- current = time(NULL);
- if ((current - seconds) && (!((current - seconds) % 5))) {
- __ast_mutex_logger("%s line %d (%s): Deadlock? waited %d sec for mutex '%s'?\n",
- filename, lineno, func, (int)(current - seconds), mutex_name);
- __ast_mutex_logger("%s line %d (%s): '%s' was locked here.\n",
- t->file[t->reentrancy-1], t->lineno[t->reentrancy-1],
- t->func[t->reentrancy-1], mutex_name);
- }
- usleep(200);
- }
- } while (res == EBUSY);
- }
-#else
- res = pthread_mutex_lock(&t->mutex);
-#endif /* DETECT_DEADLOCKS */
-
- if (!res) {
- if (t->reentrancy < AST_MAX_REENTRANCY) {
- t->file[t->reentrancy] = filename;
- t->lineno[t->reentrancy] = lineno;
- t->func[t->reentrancy] = func;
- t->thread[t->reentrancy] = pthread_self();
- t->reentrancy++;
- } else {
- __ast_mutex_logger("%s line %d (%s): '%s' really deep reentrancy!\n",
- filename, lineno, func, mutex_name);
- }
- } else {
- __ast_mutex_logger("%s line %d (%s): Error obtaining mutex: %s\n",
- filename, lineno, func, strerror(errno));
-#ifdef THREAD_CRASH
- DO_THREAD_CRASH;
-#endif
- }
-
- return res;
-}
-
-static inline int __ast_pthread_mutex_trylock(const char *filename, int lineno, const char *func,
- const char* mutex_name, ast_mutex_t *t)
-{
- int res;
- int canlog = strcmp(filename, "logger.c");
-
-#if defined(AST_MUTEX_INIT_W_CONSTRUCTORS) || defined(AST_MUTEX_INIT_ON_FIRST_USE)
- if ((t->mutex) == ((pthread_mutex_t) PTHREAD_MUTEX_INITIALIZER)) {
-#ifdef AST_MUTEX_INIT_W_CONSTRUCTORS
-
- __ast_mutex_logger("%s line %d (%s): Error: mutex '%s' is uninitialized.\n",
- filename, lineno, func, mutex_name);
-#endif
- ast_mutex_init(t);
- }
-#endif /* defined(AST_MUTEX_INIT_W_CONSTRUCTORS) || defined(AST_MUTEX_INIT_ON_FIRST_USE) */
-
- if (!(res = pthread_mutex_trylock(&t->mutex))) {
- if (t->reentrancy < AST_MAX_REENTRANCY) {
- t->file[t->reentrancy] = filename;
- t->lineno[t->reentrancy] = lineno;
- t->func[t->reentrancy] = func;
- t->thread[t->reentrancy] = pthread_self();
- t->reentrancy++;
- } else {
- __ast_mutex_logger("%s line %d (%s): '%s' really deep reentrancy!\n",
- filename, lineno, func, mutex_name);
- }
- }
-
- return res;
-}
-
-static inline int __ast_pthread_mutex_unlock(const char *filename, int lineno, const char *func,
- const char *mutex_name, ast_mutex_t *t)
-{
- int res;
- int canlog = strcmp(filename, "logger.c");
-
-#ifdef AST_MUTEX_INIT_W_CONSTRUCTORS
- if ((t->mutex) == ((pthread_mutex_t) PTHREAD_MUTEX_INITIALIZER)) {
- __ast_mutex_logger("%s line %d (%s): Error: mutex '%s' is uninitialized.\n",
- filename, lineno, func, mutex_name);
- }
-#endif
-
- if (t->reentrancy && (t->thread[t->reentrancy-1] != pthread_self())) {
- __ast_mutex_logger("%s line %d (%s): attempted unlock mutex '%s' without owning it!\n",
- filename, lineno, func, mutex_name);
- __ast_mutex_logger("%s line %d (%s): '%s' was locked here.\n",
- t->file[t->reentrancy-1], t->lineno[t->reentrancy-1], t->func[t->reentrancy-1], mutex_name);
-#ifdef THREAD_CRASH
- DO_THREAD_CRASH;
-#endif
- }
-
- if (--t->reentrancy < 0) {
- __ast_mutex_logger("%s line %d (%s): mutex '%s' freed more times than we've locked!\n",
- filename, lineno, func, mutex_name);
- t->reentrancy = 0;
- }
-
- if (t->reentrancy < AST_MAX_REENTRANCY) {
- t->file[t->reentrancy] = NULL;
- t->lineno[t->reentrancy] = 0;
- t->func[t->reentrancy] = NULL;
- t->thread[t->reentrancy] = 0;
- }
-
- if ((res = pthread_mutex_unlock(&t->mutex))) {
- __ast_mutex_logger("%s line %d (%s): Error releasing mutex: %s\n",
- filename, lineno, func, strerror(res));
-#ifdef THREAD_CRASH
- DO_THREAD_CRASH;
-#endif
- }
-
- return res;
-}
-
-static inline int __ast_cond_init(const char *filename, int lineno, const char *func,
- const char *cond_name, ast_cond_t *cond, pthread_condattr_t *cond_attr)
-{
- return pthread_cond_init(cond, cond_attr);
-}
-
-static inline int __ast_cond_signal(const char *filename, int lineno, const char *func,
- const char *cond_name, ast_cond_t *cond)
-{
- return pthread_cond_signal(cond);
-}
-
-static inline int __ast_cond_broadcast(const char *filename, int lineno, const char *func,
- const char *cond_name, ast_cond_t *cond)
-{
- return pthread_cond_broadcast(cond);
-}
-
-static inline int __ast_cond_destroy(const char *filename, int lineno, const char *func,
- const char *cond_name, ast_cond_t *cond)
-{
- return pthread_cond_destroy(cond);
-}
-
-static inline int __ast_cond_wait(const char *filename, int lineno, const char *func,
- const char *cond_name, const char *mutex_name,
- ast_cond_t *cond, ast_mutex_t *t)
-{
- int res;
- int canlog = strcmp(filename, "logger.c");
-
-#ifdef AST_MUTEX_INIT_W_CONSTRUCTORS
- if ((t->mutex) == ((pthread_mutex_t) PTHREAD_MUTEX_INITIALIZER)) {
- __ast_mutex_logger("%s line %d (%s): Error: mutex '%s' is uninitialized.\n",
- filename, lineno, func, mutex_name);
- }
-#endif
-
- if (t->reentrancy && (t->thread[t->reentrancy-1] != pthread_self())) {
- __ast_mutex_logger("%s line %d (%s): attempted unlock mutex '%s' without owning it!\n",
- filename, lineno, func, mutex_name);
- __ast_mutex_logger("%s line %d (%s): '%s' was locked here.\n",
- t->file[t->reentrancy-1], t->lineno[t->reentrancy-1], t->func[t->reentrancy-1], mutex_name);
-#ifdef THREAD_CRASH
- DO_THREAD_CRASH;
-#endif
- }
-
- if (t->reentrancy > 1)
- __ast_mutex_logger("%s line %d (%s): mutex '%s' locked more than once, cond_wait will block!\n",
- filename, lineno, func, mutex_name);
-
- if (--t->reentrancy < 0) {
- __ast_mutex_logger("%s line %d (%s): mutex '%s' freed more times than we've locked!\n",
- filename, lineno, func, mutex_name);
- t->reentrancy = 0;
- }
-
- if (t->reentrancy < AST_MAX_REENTRANCY) {
- t->file[t->reentrancy] = NULL;
- t->lineno[t->reentrancy] = 0;
- t->func[t->reentrancy] = NULL;
- t->thread[t->reentrancy] = 0;
- }
-
- if ((res = pthread_cond_wait(cond, &t->mutex))) {
- __ast_mutex_logger("%s line %d (%s): Error waiting on condition mutex '%s'\n",
- filename, lineno, func, strerror(res));
-#ifdef THREAD_CRASH
- DO_THREAD_CRASH;
-#endif
- } else {
- if (t->reentrancy < AST_MAX_REENTRANCY) {
- t->file[t->reentrancy] = filename;
- t->lineno[t->reentrancy] = lineno;
- t->func[t->reentrancy] = func;
- t->thread[t->reentrancy] = pthread_self();
- t->reentrancy++;
- } else {
- __ast_mutex_logger("%s line %d (%s): '%s' really deep reentrancy!\n",
- filename, lineno, func, mutex_name);
- }
- }
-
- return res;
-}
-
-static inline int __ast_cond_timedwait(const char *filename, int lineno, const char *func,
- const char *cond_name, const char *mutex_name, ast_cond_t *cond,
- ast_mutex_t *t, const struct timespec *abstime)
-{
- int res;
- int canlog = strcmp(filename, "logger.c");
-
-#ifdef AST_MUTEX_INIT_W_CONSTRUCTORS
- if ((t->mutex) == ((pthread_mutex_t) PTHREAD_MUTEX_INITIALIZER)) {
- __ast_mutex_logger("%s line %d (%s): Error: mutex '%s' is uninitialized.\n",
- filename, lineno, func, mutex_name);
- }
-#endif
-
- if (t->reentrancy && (t->thread[t->reentrancy-1] != pthread_self())) {
- __ast_mutex_logger("%s line %d (%s): attempted unlock mutex '%s' without owning it!\n",
- filename, lineno, func, mutex_name);
- __ast_mutex_logger("%s line %d (%s): '%s' was locked here.\n",
- t->file[t->reentrancy-1], t->lineno[t->reentrancy-1], t->func[t->reentrancy-1], mutex_name);
-#ifdef THREAD_CRASH
- DO_THREAD_CRASH;
-#endif
- }
-
- if (t->reentrancy > 1)
- __ast_mutex_logger("%s line %d (%s): mutex '%s' locked more than once, cond_timedwait will block!\n",
- filename, lineno, func, mutex_name);
-
- if (--t->reentrancy < 0) {
- __ast_mutex_logger("%s line %d (%s): mutex '%s' freed more times than we've locked!\n",
- filename, lineno, func, mutex_name);
- t->reentrancy = 0;
- }
-
- if (t->reentrancy < AST_MAX_REENTRANCY) {
- t->file[t->reentrancy] = NULL;
- t->lineno[t->reentrancy] = 0;
- t->func[t->reentrancy] = NULL;
- t->thread[t->reentrancy] = 0;
- }
-
- if ((res = pthread_cond_timedwait(cond, &t->mutex, abstime))) {
- __ast_mutex_logger("%s line %d (%s): Error waiting on condition mutex '%s'\n",
- filename, lineno, func, strerror(res));
-#ifdef THREAD_CRASH
- DO_THREAD_CRASH;
-#endif
- } else {
- if (t->reentrancy < AST_MAX_REENTRANCY) {
- t->file[t->reentrancy] = filename;
- t->lineno[t->reentrancy] = lineno;
- t->func[t->reentrancy] = func;
- t->thread[t->reentrancy] = pthread_self();
- t->reentrancy++;
- } else {
- __ast_mutex_logger("%s line %d (%s): '%s' really deep reentrancy!\n",
- filename, lineno, func, mutex_name);
- }
- }
-
- return res;
-}
-
-#define ast_mutex_init(pmutex) __ast_pthread_mutex_init(__FILE__, __LINE__, __PRETTY_FUNCTION__, #pmutex, pmutex)
-#define ast_mutex_destroy(a) __ast_pthread_mutex_destroy(__FILE__, __LINE__, __PRETTY_FUNCTION__, #a, a)
-#define ast_mutex_lock(a) __ast_pthread_mutex_lock(__FILE__, __LINE__, __PRETTY_FUNCTION__, #a, a)
-#define ast_mutex_unlock(a) __ast_pthread_mutex_unlock(__FILE__, __LINE__, __PRETTY_FUNCTION__, #a, a)
-#define ast_mutex_trylock(a) __ast_pthread_mutex_trylock(__FILE__, __LINE__, __PRETTY_FUNCTION__, #a, a)
-#define ast_cond_init(cond, attr) __ast_cond_init(__FILE__, __LINE__, __PRETTY_FUNCTION__, #cond, cond, attr)
-#define ast_cond_destroy(cond) __ast_cond_destroy(__FILE__, __LINE__, __PRETTY_FUNCTION__, #cond, cond)
-#define ast_cond_signal(cond) __ast_cond_signal(__FILE__, __LINE__, __PRETTY_FUNCTION__, #cond, cond)
-#define ast_cond_broadcast(cond) __ast_cond_broadcast(__FILE__, __LINE__, __PRETTY_FUNCTION__, #cond, cond)
-#define ast_cond_wait(cond, mutex) __ast_cond_wait(__FILE__, __LINE__, __PRETTY_FUNCTION__, #cond, #mutex, cond, mutex)
-#define ast_cond_timedwait(cond, mutex, time) __ast_cond_timedwait(__FILE__, __LINE__, __PRETTY_FUNCTION__, #cond, #mutex, cond, mutex, time)
-
-#else /* !DEBUG_THREADS */
-
-
-#define AST_MUTEX_INIT_VALUE PTHREAD_MUTEX_INIT_VALUE
-
-
-typedef pthread_mutex_t ast_mutex_t;
-
-static inline int ast_mutex_init(ast_mutex_t *pmutex)
-{
- pthread_mutexattr_t attr;
- pthread_mutexattr_init(&attr);
- pthread_mutexattr_settype(&attr, AST_MUTEX_KIND);
- return pthread_mutex_init(pmutex, &attr);
-}
-
-#define ast_pthread_mutex_init(pmutex,a) pthread_mutex_init(pmutex,a)
-
-static inline int ast_mutex_unlock(ast_mutex_t *pmutex)
-{
- return pthread_mutex_unlock(pmutex);
-}
-
-static inline int ast_mutex_destroy(ast_mutex_t *pmutex)
-{
- return pthread_mutex_destroy(pmutex);
-}
-
-#if defined(AST_MUTEX_INIT_W_CONSTRUCTORS)
-/* if AST_MUTEX_INIT_W_CONSTRUCTORS is defined, use file scope
- constrictors/destructors to create/destroy mutexes. */
-#define __AST_MUTEX_DEFINE(scope,mutex) \
- scope ast_mutex_t mutex = AST_MUTEX_INIT_VALUE; \
-static void __attribute__ ((constructor)) init_##mutex(void) \
-{ \
- ast_mutex_init(&mutex); \
-} \
-static void __attribute__ ((destructor)) fini_##mutex(void) \
-{ \
- ast_mutex_destroy(&mutex); \
-}
-
-static inline int ast_mutex_lock(ast_mutex_t *pmutex)
-{
- return pthread_mutex_lock(pmutex);
-}
-
-static inline int ast_mutex_trylock(ast_mutex_t *pmutex)
-{
- return pthread_mutex_trylock(pmutex);
-}
-
-#elif defined(AST_MUTEX_INIT_ON_FIRST_USE)
-/* if AST_MUTEX_INIT_ON_FIRST_USE is defined, mutexes are created on
- first use. The performance impact on FreeBSD should be small since
- the pthreads library does this itself to initialize errror checking
- (defaulty type) mutexes.*/
-#define __AST_MUTEX_DEFINE(scope,mutex) \
- scope ast_mutex_t mutex = AST_MUTEX_INIT_VALUE
-
-static inline int ast_mutex_lock(ast_mutex_t *pmutex)
-{
- if (*pmutex == (ast_mutex_t)AST_MUTEX_KIND)
- ast_mutex_init(pmutex);
- return pthread_mutex_lock(pmutex);
-}
-static inline int ast_mutex_trylock(ast_mutex_t *pmutex)
-{
- if (*pmutex == (ast_mutex_t)AST_MUTEX_KIND)
- ast_mutex_init(pmutex);
- return pthread_mutex_trylock(pmutex);
-}
-#else
-/* By default, use static initialization of mutexes.*/
-#define __AST_MUTEX_DEFINE(scope,mutex) \
- scope ast_mutex_t mutex = AST_MUTEX_INIT_VALUE
-
-static inline int ast_mutex_lock(ast_mutex_t *pmutex)
-{
- return pthread_mutex_lock(pmutex);
-}
-
-static inline int ast_mutex_trylock(ast_mutex_t *pmutex)
-{
- return pthread_mutex_trylock(pmutex);
-}
-
-#endif /* AST_MUTEX_INIT_W_CONSTRUCTORS */
-
-typedef pthread_cond_t ast_cond_t;
-
-static inline int ast_cond_init(ast_cond_t *cond, pthread_condattr_t *cond_attr)
-{
- return pthread_cond_init(cond, cond_attr);
-}
-
-static inline int ast_cond_signal(ast_cond_t *cond)
-{
- return pthread_cond_signal(cond);
-}
-
-static inline int ast_cond_broadcast(ast_cond_t *cond)
-{
- return pthread_cond_broadcast(cond);
-}
-
-static inline int ast_cond_destroy(ast_cond_t *cond)
-{
- return pthread_cond_destroy(cond);
-}
-
-static inline int ast_cond_wait(ast_cond_t *cond, ast_mutex_t *t)
-{
- return pthread_cond_wait(cond, t);
-}
-
-static inline int ast_cond_timedwait(ast_cond_t *cond, ast_mutex_t *t, const struct timespec *abstime)
-{
- return pthread_cond_timedwait(cond, t, abstime);
-}
-
-#endif /* !DEBUG_THREADS */
-
-#define pthread_mutex_t use_ast_mutex_t_instead_of_pthread_mutex_t
-#define pthread_mutex_lock use_ast_mutex_lock_instead_of_pthread_mutex_lock
-#define pthread_mutex_unlock use_ast_mutex_unlock_instead_of_pthread_mutex_unlock
-#define pthread_mutex_trylock use_ast_mutex_trylock_instead_of_pthread_mutex_trylock
-#define pthread_mutex_init use_ast_mutex_init_instead_of_pthread_mutex_init
-#define pthread_mutex_destroy use_ast_mutex_destroy_instead_of_pthread_mutex_destroy
-#define pthread_cond_t use_ast_cond_t_instead_of_pthread_cond_t
-#define pthread_cond_init use_ast_cond_init_instead_of_pthread_cond_init
-#define pthread_cond_destroy use_ast_cond_destroy_instead_of_pthread_cond_destroy
-#define pthread_cond_signal use_ast_cond_signal_instead_of_pthread_cond_signal
-#define pthread_cond_broadcast use_ast_cond_broadcast_instead_of_pthread_cond_broadcast
-#define pthread_cond_wait use_ast_cond_wait_instead_of_pthread_cond_wait
-#define pthread_cond_timedwait use_ast_cond_wait_instead_of_pthread_cond_timedwait
-
-#define AST_MUTEX_DEFINE_STATIC(mutex) __AST_MUTEX_DEFINE(static,mutex)
-#define AST_MUTEX_DEFINE_EXPORTED(mutex) __AST_MUTEX_DEFINE(/**/,mutex)
-
-#define AST_MUTEX_INITIALIZER __use_AST_MUTEX_DEFINE_STATIC_rather_than_AST_MUTEX_INITIALIZER__
-
-#define gethostbyname __gethostbyname__is__not__reentrant__use__ast_gethostbyname__instead__
-#ifndef __linux__
-#define pthread_create __use_ast_pthread_create_instead__
-#endif
-
-#endif /* _ASTERISK_LOCK_H */
diff --git a/1.2-netsec/include/asterisk/logger.h b/1.2-netsec/include/asterisk/logger.h
deleted file mode 100644
index ac764baa4..000000000
--- a/1.2-netsec/include/asterisk/logger.h
+++ /dev/null
@@ -1,126 +0,0 @@
-/*
- * 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.
- */
-
-/*!
- \file logger.h
- \brief Support for logging to various files, console and syslog
- Configuration in file logger.conf
-*/
-
-#ifndef _ASTERISK_LOGGER_H
-#define _ASTERISK_LOGGER_H
-
-#include "asterisk/compat.h"
-
-#include <stdarg.h>
-
-#if defined(__cplusplus) || defined(c_plusplus)
-extern "C" {
-#endif
-
-#define EVENTLOG "event_log"
-#define QUEUELOG "queue_log"
-
-#define DEBUG_M(a) { \
- a; \
-}
-
-/*! Used for sending a log message */
-/*!
- \brief This is the standard logger function. Probably the only way you will invoke it would be something like this:
- ast_log(LOG_WHATEVER, "Problem with the %s Captain. We should get some more. Will %d be enough?", "flux capacitor", 10);
- where WHATEVER is one of ERROR, DEBUG, EVENT, NOTICE, or WARNING depending
- on which log you wish to output to. These are implemented as macros, that
- will provide the function with the needed arguments.
-
- \param level Type of log event
- \param file Will be provided by the LOG_* macro
- \param line Will be provided by the LOG_* macro
- \param function Will be provided by the LOG_* macro
- \param fmt This is what is important. The format is the same as your favorite breed of printf. You know how that works, right? :-)
- */
-extern void ast_log(int level, const char *file, int line, const char *function, const char *fmt, ...)
- __attribute__ ((format (printf, 5, 6)));
-
-extern void ast_queue_log(const char *queuename, const char *callid, const char *agent, const char *event, const char *fmt, ...)
- __attribute__ ((format (printf, 5, 6)));
-
-/*! Send a verbose message (based on verbose level)
- \brief This works like ast_log, but prints verbose messages to the console depending on verbosity level set.
- ast_verbose(VERBOSE_PREFIX_3 "Whatever %s is happening\n", "nothing");
- This will print the message to the console if the verbose level is set to a level >= 3
- Note the abscence of a comma after the VERBOSE_PREFIX_3. This is important.
- VERBOSE_PREFIX_1 through VERBOSE_PREFIX_3 are defined.
- */
-extern void ast_verbose(const char *fmt, ...)
- __attribute__ ((format (printf, 1, 2)));
-
-extern int ast_register_verbose(void (*verboser)(const char *string, int opos, int replacelast, int complete));
-extern int ast_unregister_verbose(void (*verboser)(const char *string, int opos, int replacelast, int complete));
-extern int ast_verbose_dmesg(void (*verboser)(const char *string, int opos, int replacelast, int complete));
-extern void ast_console_puts(const char *string);
-
-#define _A_ __FILE__, __LINE__, __PRETTY_FUNCTION__
-
-#ifdef LOG_DEBUG
-#undef LOG_DEBUG
-#endif
-#define __LOG_DEBUG 0
-#define LOG_DEBUG __LOG_DEBUG, _A_
-
-#ifdef LOG_EVENT
-#undef LOG_EVENT
-#endif
-#define __LOG_EVENT 1
-#define LOG_EVENT __LOG_EVENT, _A_
-
-#ifdef LOG_NOTICE
-#undef LOG_NOTICE
-#endif
-#define __LOG_NOTICE 2
-#define LOG_NOTICE __LOG_NOTICE, _A_
-
-#ifdef LOG_WARNING
-#undef LOG_WARNING
-#endif
-#define __LOG_WARNING 3
-#define LOG_WARNING __LOG_WARNING, _A_
-
-#ifdef LOG_ERROR
-#undef LOG_ERROR
-#endif
-#define __LOG_ERROR 4
-#define LOG_ERROR __LOG_ERROR, _A_
-
-#ifdef LOG_VERBOSE
-#undef LOG_VERBOSE
-#endif
-#define __LOG_VERBOSE 5
-#define LOG_VERBOSE __LOG_VERBOSE, _A_
-
-#ifdef LOG_DTMF
-#undef LOG_DTMF
-#endif
-#define __LOG_DTMF 6
-#define LOG_DTMF __LOG_DTMF, _A_
-
-#if defined(__cplusplus) || defined(c_plusplus)
-}
-#endif
-
-#endif /* _ASTERISK_LOGGER_H */
diff --git a/1.2-netsec/include/asterisk/manager.h b/1.2-netsec/include/asterisk/manager.h
deleted file mode 100644
index dc1e30063..000000000
--- a/1.2-netsec/include/asterisk/manager.h
+++ /dev/null
@@ -1,172 +0,0 @@
-/*
- * 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.
- */
-
-#ifndef _ASTERISK_MANAGER_H
-#define _ASTERISK_MANAGER_H
-
-#include <stdarg.h>
-#include <sys/types.h>
-#include <sys/socket.h>
-#include <netinet/in.h>
-#include <arpa/inet.h>
-
-#include "asterisk/lock.h"
-
-/*!
- \file
- \brief The AMI - Asterisk Manager Interface - is a TCP protocol created to
- manage Asterisk with third-party software.
-
- Manager protocol packages are text fields of the form a: b. There is
- always exactly one space after the colon.
-
- The first header type is the "Event" header. Other headers vary from
- event to event. Headers end with standard \r\n termination.
- The last line of the manager response or event is an empty line.
- (\r\n)
-
- ** Please try to re-use existing headers to simplify manager message parsing in clients.
- Don't re-use an existing header with a new meaning, please.
- You can find a reference of standard headers in doc/manager.txt
- */
-
-#define DEFAULT_MANAGER_PORT 5038 /* Default port for Asterisk management via TCP */
-
-#define EVENT_FLAG_SYSTEM (1 << 0) /* System events such as module load/unload */
-#define EVENT_FLAG_CALL (1 << 1) /* Call event, such as state change, etc */
-#define EVENT_FLAG_LOG (1 << 2) /* Log events */
-#define EVENT_FLAG_VERBOSE (1 << 3) /* Verbose messages */
-#define EVENT_FLAG_COMMAND (1 << 4) /* Ability to read/set commands */
-#define EVENT_FLAG_AGENT (1 << 5) /* Ability to read/set agent info */
-#define EVENT_FLAG_USER (1 << 6) /* Ability to read/set user info */
-
-/* Export manager structures */
-#define AST_MAX_MANHEADERS 80
-#define AST_MAX_MANHEADER_LEN 256
-
-struct eventqent {
- struct eventqent *next;
- char eventdata[1];
-};
-
-struct mansession {
- /*! Execution thread */
- pthread_t t;
- /*! Thread lock -- don't use in action callbacks, it's already taken care of */
- ast_mutex_t __lock;
- /*! socket address */
- struct sockaddr_in sin;
- /*! TCP socket */
- int fd;
- /*! Whether or not we're busy doing an action */
- int busy;
- /*! Whether or not we're "dead" */
- int dead;
- /*! Logged in username */
- char username[80];
- /*! Authentication challenge */
- char challenge[10];
- /*! Authentication status */
- int authenticated;
- /*! Authorization for reading */
- int readperm;
- /*! Authorization for writing */
- int writeperm;
- /*! Buffer */
- char inbuf[AST_MAX_MANHEADER_LEN];
- int inlen;
- int send_events;
- /* Queued events that we've not had the ability to send yet */
- struct eventqent *eventq;
- /* Timeout for ast_carefulwrite() */
- int writetimeout;
- struct mansession *next;
-};
-
-
-struct message {
- int hdrcount;
- char headers[AST_MAX_MANHEADERS][AST_MAX_MANHEADER_LEN];
-};
-
-struct manager_action {
- /*! Name of the action */
- const char *action;
- /*! Short description of the action */
- const char *synopsis;
- /*! Detailed description of the action */
- const char *description;
- /*! Permission required for action. EVENT_FLAG_* */
- int authority;
- /*! Function to be called */
- int (*func)(struct mansession *s, struct message *m);
- /*! For easy linking */
- struct manager_action *next;
-};
-
-int ast_carefulwrite(int fd, char *s, int len, int timeoutms);
-
-/* External routines may register/unregister manager callbacks this way */
-#define ast_manager_register(a, b, c, d) ast_manager_register2(a, b, c, d, NULL)
-
-/* Use ast_manager_register2 to register with help text for new manager commands */
-
-/*! Register a manager command with the manager interface */
-/*! \param action Name of the requested Action:
- \param authority Required authority for this command
- \param func Function to call for this command
- \param synopsis Help text (one line, up to 30 chars) for CLI manager show commands
- \param description Help text, several lines
-*/
-int ast_manager_register2(
- const char *action,
- int authority,
- int (*func)(struct mansession *s, struct message *m),
- const char *synopsis,
- const char *description);
-
-/*! Unregister a registred manager command */
-/*! \param action Name of registred Action:
-*/
-int ast_manager_unregister( char *action );
-
-/*! External routines may send asterisk manager events this way */
-/*! \param category Event category, matches manager authorization
- \param event Event name
- \param contents Contents of event
-*/
-extern int manager_event(int category, char *event, char *contents, ...)
- __attribute__ ((format (printf, 3,4)));
-
-/*! Get header from mananger transaction */
-extern char *astman_get_header(struct message *m, char *var);
-
-/*! Get a linked list of the Variable: headers */
-struct ast_variable *astman_get_variables(struct message *m);
-
-/*! Send error in manager transaction */
-extern void astman_send_error(struct mansession *s, struct message *m, char *error);
-extern void astman_send_response(struct mansession *s, struct message *m, char *resp, char *msg);
-extern void astman_send_ack(struct mansession *s, struct message *m, char *msg);
-
-/*! Called by Asterisk initialization */
-extern int init_manager(void);
-/*! Called by Asterisk initialization */
-extern int reload_manager(void);
-
-#endif /* _ASTERISK_MANAGER_H */
diff --git a/1.2-netsec/include/asterisk/md5.h b/1.2-netsec/include/asterisk/md5.h
deleted file mode 100644
index f738bd5b6..000000000
--- a/1.2-netsec/include/asterisk/md5.h
+++ /dev/null
@@ -1,40 +0,0 @@
-/*
- * 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.
- */
-
-/*!\file
- * \brief MD5 digest functions
- */
-
-#ifndef _ASTERISK_MD5_H
-#define _ASTERISK_MD5_H
-
-#include <inttypes.h>
-
-struct MD5Context {
- uint32_t buf[4];
- uint32_t bits[2];
- unsigned char in[64];
-};
-
-void MD5Init(struct MD5Context *context);
-void MD5Update(struct MD5Context *context, unsigned char const *buf,
- unsigned len);
-void MD5Final(unsigned char digest[16], struct MD5Context *context);
-void MD5Transform(uint32_t buf[4], uint32_t const in[16]);
-
-#endif /* _ASTERISK_MD5_H */
diff --git a/1.2-netsec/include/asterisk/module.h b/1.2-netsec/include/asterisk/module.h
deleted file mode 100644
index afb90ce24..000000000
--- a/1.2-netsec/include/asterisk/module.h
+++ /dev/null
@@ -1,419 +0,0 @@
-/*
- * 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.
- */
-
-/*! \file
- * \brief Asterisk module definitions.
- *
- * This file contains the definitons for functions Asterisk modules should
- * provide and some other module related functions.
- */
-
-#ifndef _ASTERISK_MODULE_H
-#define _ASTERISK_MODULE_H
-
-#if defined(__cplusplus) || defined(c_plusplus)
-extern "C" {
-#endif
-
-/* Every module should provide these functions */
-
-/*!
- * \brief Initialize the module.
- *
- * This function is called at module load time. Put all code in here
- * that needs to set up your module's hardware, software, registrations,
- * etc.
- *
- * \return This function should return 0 on success and non-zero on failure.
- * If the module is not loaded successfully, Asterisk will call its
- * unload_module() function.
- */
-int load_module(void);
-
-/*!
- * \brief Cleanup all module structures, sockets, etc.
- *
- * This is called at exit. Any registrations and memory allocations need to be
- * unregistered and free'd here. Nothing else will do these for you (until
- * exit).
- *
- * \return Zero on success, or non-zero on error.
- */
-int unload_module(void);
-
-/*!
- * \brief Provides a usecount.
- *
- * This function will be called by various parts of asterisk. Basically, all
- * it has to do is to return a usecount when called. You will need to maintain
- * your usecount within the module somewhere. The usecount should be how many
- * channels provided by this module are in use.
- *
- * \return The module's usecount.
- */
-int usecount(void); /* How many channels provided by this module are in use? */
-
-/*! \brief Provides a description of the module.
- *
- * \return a short description of your module
- */
-char *description(void); /* Description of this module */
-
-/*!
- * \brief Returns the ASTERISK_GPL_KEY
- *
- * This returns the ASTERISK_GPL_KEY, signifiying that you agree to the terms of
- * the GPL stated in the ASTERISK_GPL_KEY. Your module will not load if it does
- * not return the EXACT message:
- *
- * \code
- * char *key(void) {
- * return ASTERISK_GPL_KEY;
- * }
- * \endcode
- *
- * \return ASTERISK_GPL_KEY
- */
-char *key(void); /* Return the below mentioned key, unmodified */
-
-/*!
- * \brief Reload stuff.
- *
- * This function is where any reload routines take place. Re-read config files,
- * change signalling, whatever is appropriate on a reload.
- *
- * \return The return value is not used.
- */
-int reload(void); /* reload configs */
-
-/*! \brief The text the key() function should return. */
-#define ASTERISK_GPL_KEY \
- "This paragraph is Copyright (C) 2000, Linux Support Services, Inc. \
-In order for your module to load, it must return this key via a function \
-called \"key\". Any code which includes this paragraph must be licensed under \
-the GNU General Public License version 2 or later (at your option). Linux \
-Support Services, Inc. reserves the right to allow other parties to license \
-this paragraph under other terms as well."
-
-#define AST_MODULE_CONFIG "modules.conf" /*!< \brief Module configuration file */
-
-/*!
- * \brief Softly unload a module.
- *
- * This flag signals ast_unload_resource() to unload a module only if it is not
- * in use, according to the module's usecount.
- */
-#define AST_FORCE_SOFT 0
-
-/*!
- * \brief Firmly unload a module.
- *
- * This flag signals ast_unload_resource() to attempt to unload a module even
- * if it is in use. It will attempt to use the module's unload_module
- * function.
- */
-#define AST_FORCE_FIRM 1
-
-/*!
- * \brief Unconditionally unload a module.
- *
- * This flag signals ast_unload_resource() to first attempt to unload a module
- * using the module's unload_module function, then if that fails to unload the
- * module using dlclose. The module will be unloaded even if it is still in
- * use. Use of this flag is not recommended.
- */
-#define AST_FORCE_HARD 2
-
-/*!
- * \brief Load a module.
- * \param resource_name The filename of the module to load.
- *
- * This function is run by the PBX to load the modules. It performs
- * all loading and initilization tasks. Basically, to load a module, just
- * give it the name of the module and it will do the rest.
- *
- * \return Zero on success, -1 on error.
- */
-int ast_load_resource(const char *resource_name);
-
-/*!
- * \brief Unloads a module.
- * \param resource_name The name of the module to unload.
- * \param force The force flag. This should be set using one of the AST_FORCE*
- * flags.
- *
- * This function unloads a module. It will only unload modules that are not in
- * use (usecount not zero), unless #AST_FORCE_FIRM or #AST_FORCE_HARD is
- * specified. Setting #AST_FORCE_FIRM or #AST_FORCE_HARD will unload the
- * module regardless of consequences (NOT_RECOMMENDED).
- *
- * \return Zero on success, -1 on error.
- */
-int ast_unload_resource(const char *resource_name, int force);
-
-/*!
- * \brief Notify when usecount has been changed.
- *
- * This function calulates use counts and notifies anyone trying to keep track
- * of them. It should be called whenever your module's usecount changes.
- *
- * \note The LOCAL_USER macros take care of calling this function for you.
- */
-void ast_update_use_count(void);
-
-/*!
- * \brief Ask for a list of modules, descriptions, and use counts.
- * \param modentry A callback to an updater function.
- * \param like
- *
- * For each of the modules loaded, modentry will be executed with the resource,
- * description, and usecount values of each particular module.
- *
- * \return the number of modules loaded
- */
-int ast_update_module_list(int (*modentry)(const char *module, const char *description, int usecnt, const char *like),
- const char *like);
-
-/*!
- * \brief Add a procedure to be run when modules have been updated.
- * \param updater The function to run when modules have been updated.
- *
- * This function adds the given function to a linked list of functions to be
- * run when the modules are updated.
- *
- * \return Zero on success and -1 on failure.
- */
-int ast_loader_register(int (*updater)(void));
-
-/*!
- * \brief Remove a procedure to be run when modules are updated.
- * \param updater The updater function to unregister.
- *
- * This removes the given function from the updater list.
- *
- * \return Zero on success, -1 on failure.
- */
-int ast_loader_unregister(int (*updater)(void));
-
-/*!
- * \brief Reload asterisk modules.
- * \param name the name of the module to reload
- *
- * This function reloads the specified module, or if no modules are specified,
- * it will reload all loaded modules.
- *
- * \note Modules are reloaded using their reload() functions, not unloading
- * them and loading them again.
- *
- * \return Zero if the specified module was not found, 1 if the module was
- * found but cannot be reloaded, -1 if a reload operation is already in
- * progress, and 2 if the specfied module was found and reloaded.
- */
-int ast_module_reload(const char *name);
-
-/*!
- * \brief Match modules names for the Asterisk cli.
- * \param line Unused by this function, but this should be the line we are
- * matching.
- * \param word The partial name to match.
- * \param pos The position the word we are completing is in.
- * \param state The possible match to return.
- * \param rpos The position we should be matching. This should be the same as
- * pos.
- * \param needsreload This should be 1 if we need to reload this module and 0
- * otherwise. This function will only return modules that are reloadble
- * if this is 1.
- *
- * \return A possible completion of the partial match, or NULL if no matches
- * were found.
- */
-char *ast_module_helper(char *line, char *word, int pos, int state, int rpos, int needsreload);
-
-/*!
- * \brief Register a function to be executed before Asterisk exits.
- * \param func The callback function to use.
- *
- * \return Zero on success, -1 on error.
- */
-int ast_register_atexit(void (*func)(void));
-
-/*!
- * \brief Unregister a function registered with ast_register_atexit().
- * \param func The callback function to unregister.
- */
-void ast_unregister_atexit(void (*func)(void));
-
-/* Local user routines keep track of which channels are using a given module
- resource. They can help make removing modules safer, particularly if
- they're in use at the time they have been requested to be removed */
-
-/*!
- * \brief Standard localuser struct definition.
- *
- * This macro defines a localuser struct. The channel.h file must be included
- * to use this macro because it refrences ast_channel.
- */
-#define STANDARD_LOCAL_USER struct localuser { \
- struct ast_channel *chan; \
- struct localuser *next; \
- }
-
-/*!
- * \brief The localuser declaration.
- *
- * This macro should be used in combination with #STANDARD_LOCAL_USER. It
- * creates a localuser mutex and several other variables used for keeping the
- * use count.
- *
- * <b>Sample Usage:</b>
- * \code
- * STANDARD_LOCAL_USER;
- * LOCAL_USER_DECL;
- * \endcode
- */
-#define LOCAL_USER_DECL AST_MUTEX_DEFINE_STATIC(localuser_lock); \
- static struct localuser *localusers = NULL; \
- static int localusecnt = 0;
-
-#define STANDARD_INCREMENT_USECOUNT \
- ast_mutex_lock(&localuser_lock); \
- localusecnt++; \
- ast_mutex_unlock(&localuser_lock); \
- ast_update_use_count();
-
-#define STANDARD_DECREMENT_USECOUNT \
- ast_mutex_lock(&localuser_lock); \
- localusecnt--; \
- ast_mutex_unlock(&localuser_lock); \
- ast_update_use_count();
-
-/*!
- * \brief Add a localuser.
- * \param u a pointer to a localuser struct
- *
- * This macro adds a localuser to the list of users and increments the
- * usecount. It expects a variable named \p chan of type \p ast_channel in the
- * current scope.
- *
- * \note This function dynamically allocates memory. If this operation fails
- * it will cause your function to return -1 to the caller.
- */
-#define LOCAL_USER_ADD(u) { \
- \
- if (!(u=calloc(1,sizeof(*u)))) { \
- ast_log(LOG_WARNING, "Out of memory\n"); \
- return -1; \
- } \
- ast_mutex_lock(&localuser_lock); \
- u->chan = chan; \
- u->next = localusers; \
- localusers = u; \
- localusecnt++; \
- ast_mutex_unlock(&localuser_lock); \
- ast_update_use_count(); \
-}
-
-#define LOCAL_USER_ACF_ADD(u) { \
- \
- if (!(u=calloc(1,sizeof(*u)))) { \
- ast_log(LOG_WARNING, "Out of memory\n"); \
- return ""; \
- } \
- ast_mutex_lock(&localuser_lock); \
- u->chan = chan; \
- u->next = localusers; \
- localusers = u; \
- localusecnt++; \
- ast_mutex_unlock(&localuser_lock); \
- ast_update_use_count(); \
-}
-
-/*!
- * \brief Remove a localuser.
- * \param u the user to add, should be of type struct localuser
- *
- * This macro removes a localuser from the list of users and decrements the
- * usecount.
- */
-#define LOCAL_USER_REMOVE(u) { \
- struct localuser *uc, *ul = NULL; \
- ast_mutex_lock(&localuser_lock); \
- uc = localusers; \
- while (uc) { \
- if (uc == u) { \
- if (ul) \
- ul->next = uc->next; \
- else \
- localusers = uc->next; \
- break; \
- } \
- ul = uc; \
- uc = uc->next; \
- }\
- free(u); \
- localusecnt--; \
- ast_mutex_unlock(&localuser_lock); \
- ast_update_use_count(); \
-}
-
-/*!
- * \brief Hangup all localusers.
- *
- * This macro hangs up on all current localusers and sets the usecount to zero
- * when finished.
- */
-#define STANDARD_HANGUP_LOCALUSERS { \
- struct localuser *u, *ul; \
- ast_mutex_lock(&localuser_lock); \
- u = localusers; \
- while(u) { \
- ast_softhangup(u->chan, AST_SOFTHANGUP_APPUNLOAD); \
- ul = u; \
- u = u->next; \
- free(ul); \
- } \
- localusecnt=0; \
- ast_mutex_unlock(&localuser_lock); \
- ast_update_use_count(); \
-}
-
-/*!
- * \brief Set the specfied integer to the current usecount.
- * \param res the integer variable to set.
- *
- * This macro sets the specfied integer variable to the local usecount.
- *
- * <b>Sample Usage:</b>
- * \code
- * int usecount(void)
- * {
- * int res;
- * STANDARD_USECOUNT(res);
- * return res;
- * }
- * \endcode
- */
-#define STANDARD_USECOUNT(res) { \
- res = localusecnt; \
-}
-
-#if defined(__cplusplus) || defined(c_plusplus)
-}
-#endif
-
-#endif /* _ASTERISK_MODULE_H */
diff --git a/1.2-netsec/include/asterisk/monitor.h b/1.2-netsec/include/asterisk/monitor.h
deleted file mode 100644
index ff482f847..000000000
--- a/1.2-netsec/include/asterisk/monitor.h
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- * 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.
- */
-
-/*! \file
- * \brief Channel monitoring
- */
-
-#ifndef _ASTERISK_MONITOR_H
-#define _ASTERISK_MONITOR_H
-
-#include "asterisk/channel.h"
-
-struct ast_channel;
-
-/*! Responsible for channel monitoring data */
-struct ast_channel_monitor {
- struct ast_filestream *read_stream;
- struct ast_filestream *write_stream;
- char read_filename[FILENAME_MAX];
- char write_filename[FILENAME_MAX];
- char filename_base[FILENAME_MAX];
- int filename_changed;
- char *format;
- int joinfiles;
- int (*stop)(struct ast_channel *chan, int need_lock);
-};
-
-/* Start monitoring a channel */
-int ast_monitor_start(struct ast_channel *chan, const char *format_spec,
- const char *fname_base, int need_lock );
-
-/* Stop monitoring a channel */
-int ast_monitor_stop(struct ast_channel *chan, int need_lock);
-
-/* Change monitoring filename of a channel */
-int ast_monitor_change_fname(struct ast_channel *chan,
- const char *fname_base, int need_lock);
-
-void ast_monitor_setjoinfiles(struct ast_channel *chan, int turnon);
-
-#endif /* _ASTERISK_MONITOR_H */
diff --git a/1.2-netsec/include/asterisk/musiconhold.h b/1.2-netsec/include/asterisk/musiconhold.h
deleted file mode 100644
index 8a0bf6417..000000000
--- a/1.2-netsec/include/asterisk/musiconhold.h
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
- * 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.
- */
-
-/*! \file
- * \brief Music on hold handling
- */
-
-#ifndef _ASTERISK_MOH_H
-#define _ASTERISK_MOH_H
-
-#if defined(__cplusplus) || defined(c_plusplus)
-extern "C" {
-#endif
-
-/*! Turn on music on hold on a given channel */
-extern int ast_moh_start(struct ast_channel *chan, char *mclass);
-
-/*! Turn off music on hold on a given channel */
-extern void ast_moh_stop(struct ast_channel *chan);
-
-extern void ast_install_music_functions(int (*start_ptr)(struct ast_channel *, char *),
- void (*stop_ptr)(struct ast_channel *),
- void (*cleanup_ptr)(struct ast_channel *));
-
-extern void ast_uninstall_music_functions(void);
-void ast_moh_cleanup(struct ast_channel *chan);
-
-#if defined(__cplusplus) || defined(c_plusplus)
-}
-#endif
-
-#endif /* _ASTERISK_MOH_H */
diff --git a/1.2-netsec/include/asterisk/netsock.h b/1.2-netsec/include/asterisk/netsock.h
deleted file mode 100644
index 73a2dd224..000000000
--- a/1.2-netsec/include/asterisk/netsock.h
+++ /dev/null
@@ -1,68 +0,0 @@
-/*
- * Asterisk -- An open source telephony toolkit.
- *
- * Copyright (C) 1999 - 2005, Digium, Inc.
- *
- * Mark Spencer <markster@digium.com>
- * Kevin P. Fleming <kpfleming@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.
- */
-
-/*! \file
- * \brief Network socket handling
- */
-
-#ifndef _ASTERISK_NETSOCK_H
-#define _ASTERISK_NETSOCK_H
-
-#if defined(__cplusplus) || defined(c_plusplus)
-extern "C" {
-#endif
-
-#include <netinet/in.h>
-#include "asterisk/io.h"
-#include "asterisk/astobj.h"
-
-struct ast_netsock;
-
-struct ast_netsock_list;
-
-struct ast_netsock_list *ast_netsock_list_alloc(void);
-
-int ast_netsock_init(struct ast_netsock_list *list);
-
-struct ast_netsock *ast_netsock_bind(struct ast_netsock_list *list, struct io_context *ioc,
- const char *bindinfo, int defaultport, int tos, ast_io_cb callback, void *data);
-
-struct ast_netsock *ast_netsock_bindaddr(struct ast_netsock_list *list, struct io_context *ioc,
- struct sockaddr_in *bindaddr, int tos, ast_io_cb callback, void *data);
-
-int ast_netsock_free(struct ast_netsock_list *list, struct ast_netsock *netsock);
-
-int ast_netsock_release(struct ast_netsock_list *list);
-
-struct ast_netsock *ast_netsock_find(struct ast_netsock_list *list,
- struct sockaddr_in *sa);
-
-int ast_netsock_sockfd(const struct ast_netsock *ns);
-
-const struct sockaddr_in *ast_netsock_boundaddr(const struct ast_netsock *ns);
-
-void *ast_netsock_data(const struct ast_netsock *ns);
-
-void ast_netsock_unref(struct ast_netsock *ns);
-
-#if defined(__cplusplus) || defined(c_plusplus)
-}
-#endif
-
-#endif /* _ASTERISK_NETSOCK_H */
diff --git a/1.2-netsec/include/asterisk/options.h b/1.2-netsec/include/asterisk/options.h
deleted file mode 100644
index fd8f3aadb..000000000
--- a/1.2-netsec/include/asterisk/options.h
+++ /dev/null
@@ -1,66 +0,0 @@
-/*
- * 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.
- */
-
-/*! \file
- * \brief Options provided by main asterisk program
- */
-
-#ifndef _ASTERISK_OPTIONS_H
-#define _ASTERISK_OPTIONS_H
-
-#if defined(__cplusplus) || defined(c_plusplus)
-extern "C" {
-#endif
-
-#define AST_CACHE_DIR_LEN 512
-#define AST_FILENAME_MAX 80
-
-extern int option_verbose;
-extern int option_debug;
-extern int option_nofork;
-extern int option_quiet;
-extern int option_console;
-extern int option_initcrypto;
-extern int option_nocolor;
-extern int fully_booted;
-extern int option_exec_includes;
-extern int option_cache_record_files;
-extern int option_timestamp;
-extern int option_transcode_slin;
-extern int option_transmit_silence_during_record;
-extern int option_maxcalls;
-extern double option_maxload;
-extern int option_dontwarn;
-extern int option_priority_jumping;
-extern char defaultlanguage[];
-extern time_t ast_startuptime;
-extern time_t ast_lastreloadtime;
-extern int ast_mainpid;
-extern char record_cache_dir[AST_CACHE_DIR_LEN];
-extern char debug_filename[AST_FILENAME_MAX];
-
-#define VERBOSE_PREFIX_1 " "
-#define VERBOSE_PREFIX_2 " == "
-#define VERBOSE_PREFIX_3 " -- "
-#define VERBOSE_PREFIX_4 " > "
-
-#if defined(__cplusplus) || defined(c_plusplus)
-}
-#endif
-
-#endif /* _ASTERISK_OPTIONS_H */
diff --git a/1.2-netsec/include/asterisk/pbx.h b/1.2-netsec/include/asterisk/pbx.h
deleted file mode 100644
index d2902002c..000000000
--- a/1.2-netsec/include/asterisk/pbx.h
+++ /dev/null
@@ -1,665 +0,0 @@
-/*
- * 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.
- */
-
-/*! \file
- * \brief Core PBX routines and definitions.
- */
-
-#ifndef _ASTERISK_PBX_H
-#define _ASTERISK_PBX_H
-
-#include "asterisk/sched.h"
-#include "asterisk/channel.h"
-
-#if defined(__cplusplus) || defined(c_plusplus)
-extern "C" {
-#endif
-
-#define AST_PBX_KEEP 0
-#define AST_PBX_REPLACE 1
-
-/*! Max length of an application */
-#define AST_MAX_APP 32
-
-/*! Special return values from applications to the PBX */
-#define AST_PBX_KEEPALIVE 10 /* Destroy the thread, but don't hang up the channel */
-#define AST_PBX_NO_HANGUP_PEER 11
-
-/*! Special Priority for an hint */
-#define PRIORITY_HINT -1
-
-/*! Extension states */
-enum ast_extension_states {
- /*! Extension removed */
- AST_EXTENSION_REMOVED = -2,
- /*! Extension hint removed */
- AST_EXTENSION_DEACTIVATED = -1,
- /*! No device INUSE or BUSY */
- AST_EXTENSION_NOT_INUSE = 0,
- /*! One or more devices INUSE */
- AST_EXTENSION_INUSE = 1 << 0,
- /*! All devices BUSY */
- AST_EXTENSION_BUSY = 1 << 1,
- /*! All devices UNAVAILABLE/UNREGISTERED */
- AST_EXTENSION_UNAVAILABLE = 1 << 2,
- /*! All devices RINGING */
- AST_EXTENSION_RINGING = 1 << 3,
-};
-
-
-static const struct cfextension_states {
- int extension_state;
- const char * const text;
-} extension_states[] = {
- { AST_EXTENSION_NOT_INUSE, "Idle" },
- { AST_EXTENSION_INUSE, "InUse" },
- { AST_EXTENSION_BUSY, "Busy" },
- { AST_EXTENSION_UNAVAILABLE, "Unavailable" },
- { AST_EXTENSION_RINGING, "Ringing" },
- { AST_EXTENSION_INUSE | AST_EXTENSION_RINGING, "InUse&Ringing" }
-};
-
-struct ast_context;
-struct ast_exten;
-struct ast_include;
-struct ast_ignorepat;
-struct ast_sw;
-
-typedef int (*ast_state_cb_type)(char *context, char* id, enum ast_extension_states state, void *data);
-
-/*! Data structure associated with a custom function */
-struct ast_custom_function {
- char *name;
- char *synopsis;
- char *desc;
- char *syntax;
- char *(*read)(struct ast_channel *, char *, char *, char *, size_t);
- void (*write)(struct ast_channel *, char *, char *, const char *);
- struct ast_custom_function *next;
-};
-
-/*! Data structure associated with an asterisk switch */
-struct ast_switch {
- /*! NULL */
- struct ast_switch *next;
- /*! Name of the switch */
- const char *name;
- /*! Description of the switch */
- const char *description;
-
- int (*exists)(struct ast_channel *chan, const char *context, const char *exten, int priority, const char *callerid, const char *data);
-
- int (*canmatch)(struct ast_channel *chan, const char *context, const char *exten, int priority, const char *callerid, const char *data);
-
- int (*exec)(struct ast_channel *chan, const char *context, const char *exten, int priority, const char *callerid, int newstack, const char *data);
-
- int (*matchmore)(struct ast_channel *chan, const char *context, const char *exten, int priority, const char *callerid, const char *data);
-};
-
-struct ast_timing {
- int hastime; /* If time construct exists */
- unsigned int monthmask; /* Mask for month */
- unsigned int daymask; /* Mask for date */
- unsigned int dowmask; /* Mask for day of week (mon-sun) */
- unsigned int minmask[24]; /* Mask for minute */
-};
-
-extern int ast_build_timing(struct ast_timing *i, char *info);
-extern int ast_check_timing(struct ast_timing *i);
-
-struct ast_pbx {
- int dtimeout; /* Timeout between digits (seconds) */
- int rtimeout; /* Timeout for response
- (seconds) */
-};
-
-
-/*! Register an alternative switch */
-/*!
- * \param sw switch to register
- * This function registers a populated ast_switch structure with the
- * asterisk switching architecture.
- * It returns 0 on success, and other than 0 on failure
- */
-extern int ast_register_switch(struct ast_switch *sw);
-
-/*! Unregister an alternative switch */
-/*!
- * \param sw switch to unregister
- * Unregisters a switch from asterisk.
- * Returns nothing
- */
-extern void ast_unregister_switch(struct ast_switch *sw);
-
-/*! Look up an application */
-/*!
- * \param app name of the app
- * This function searches for the ast_app structure within
- * the apps that are registered for the one with the name
- * you passed in.
- * Returns the ast_app structure that matches on success, or NULL on failure
- */
-extern struct ast_app *pbx_findapp(const char *app);
-
-/*! executes an application */
-/*!
- * \param c channel to execute on
- * \param app which app to execute
- * \param data the data passed into the app
- * \param newstack stack pointer
- * This application executes an application on a given channel. It
- * saves the stack and executes the given appliation passing in
- * the given data.
- * It returns 0 on success, and -1 on failure
- */
-int pbx_exec(struct ast_channel *c, struct ast_app *app, void *data, int newstack);
-
-/*! Register a new context */
-/*!
- * \param extcontexts pointer to the ast_context structure pointer
- * \param name name of the new context
- * \param registrar registrar of the context
- * This will first search for a context with your name. If it exists already, it will not
- * create a new one. If it does not exist, it will create a new one with the given name
- * and registrar.
- * It returns NULL on failure, and an ast_context structure on success
- */
-struct ast_context *ast_context_create(struct ast_context **extcontexts, const char *name, const char *registrar);
-
-/*! Merge the temporary contexts into a global contexts list and delete from the global list the ones that are being added */
-/*!
- * \param extcontexts pointer to the ast_context structure pointer
- * \param registrar of the context; if it's set the routine will delete all contexts that belong to that registrar; if NULL only the contexts that are specified in extcontexts
- */
-void ast_merge_contexts_and_delete(struct ast_context **extcontexts, const char *registrar);
-
-/*! Destroy a context (matches the specified context (or ANY context if NULL) */
-/*!
- * \param con context to destroy
- * \param registrar who registered it
- * You can optionally leave out either parameter. It will find it
- * based on either the ast_context or the registrar name.
- * Returns nothing
- */
-void ast_context_destroy(struct ast_context *con, const char *registrar);
-
-/*! Find a context */
-/*!
- * \param name name of the context to find
- * Will search for the context with the given name.
- * Returns the ast_context on success, NULL on failure.
- */
-struct ast_context *ast_context_find(const char *name);
-
-enum ast_pbx_result {
- AST_PBX_SUCCESS = 0,
- AST_PBX_FAILED = -1,
- AST_PBX_CALL_LIMIT = -2,
-};
-
-/*! Create a new thread and start the PBX (or whatever) */
-/*!
- * \param c channel to start the pbx on
- * \return Zero on success, non-zero on failure
- */
-enum ast_pbx_result ast_pbx_start(struct ast_channel *c);
-
-/*! Execute the PBX in the current thread */
-/*!
- * \param c channel to run the pbx on
- * \return Zero on success, non-zero on failure
- * This executes the PBX on a given channel. It allocates a new
- * PBX structure for the channel, and provides all PBX functionality.
- */
-enum ast_pbx_result ast_pbx_run(struct ast_channel *c);
-
-/*!
- * \param context context to add the extension to
- * \param replace
- * \param extension extension to add
- * \param priority priority level of extension addition
- * \param label extension label
- * \param callerid callerid of extension
- * \param application application to run on the extension with that priority level
- * \param data data to pass to the application
- * \param datad
- * \param registrar who registered the extension
- * Add and extension to an extension context.
- * Callerid is a pattern to match CallerID, or NULL to match any callerid
- * Returns 0 on success, -1 on failure
- */
-int ast_add_extension(const char *context, int replace, const char *extension, int priority, const char *label, const char *callerid,
- const char *application, void *data, void (*datad)(void *), const char *registrar);
-
-/*! Add an extension to an extension context, this time with an ast_context *. CallerID is a pattern to match on callerid, or NULL to not care about callerid */
-/*!
- * For details about the arguements, check ast_add_extension()
- */
-int ast_add_extension2(struct ast_context *con,
- int replace, const char *extension, int priority, const char *label, const char *callerid,
- const char *application, void *data, void (*datad)(void *),
- const char *registrar);
-
-/*! Add an application. The function 'execute' should return non-zero if the line needs to be hung up. */
-/*!
- \param app Short name of the application
- \param execute a function callback to execute the application
- \param synopsis a short description of the application
- \param description long description of the application
- Include a one-line synopsis (e.g. 'hangs up a channel') and a more lengthy, multiline
- description with more detail, including under what conditions the application
- will return 0 or -1.
- This registers an application with asterisks internal application list. Please note:
- The individual applications themselves are responsible for registering and unregistering
- CLI commands.
- It returns 0 on success, -1 on failure.
-*/
-int ast_register_application(const char *app, int (*execute)(struct ast_channel *, void *),
- const char *synopsis, const char *description);
-
-/*! Remove an application */
-/*!
- * \param app name of the application (does not have to be the same string as the one that was registered)
- * This unregisters an application from asterisk's internal registration mechanisms.
- * It returns 0 on success, and -1 on failure.
- */
-int ast_unregister_application(const char *app);
-
-/*! Uses hint and devicestate callback to get the state of an extension */
-/*!
- * \param c this is not important
- * \param context which context to look in
- * \param exten which extension to get state
- * Returns extension state !! = AST_EXTENSION_???
- */
-int ast_extension_state(struct ast_channel *c, char *context, char *exten);
-
-/*! Return string of the state of an extension */
-/*!
- * \param extension_state is the numerical state delivered by ast_extension_state
- * Returns the state of an extension as string
- */
-const char *ast_extension_state2str(int extension_state);
-
-/*! Registers a state change callback */
-/*!
- * \param context which context to look in
- * \param exten which extension to get state
- * \param callback callback to call if state changed
- * \param data to pass to callback
- * The callback is called if the state for extension is changed
- * Return -1 on failure, ID on success
- */
-int ast_extension_state_add(const char *context, const char *exten,
- ast_state_cb_type callback, void *data);
-
-/*! Deletes a registered state change callback by ID */
-/*!
- * \param id of the callback to delete
- * \param callback callback
- * Removes the callback from list of callbacks
- * Return 0 on success, -1 on failure
- */
-int ast_extension_state_del(int id, ast_state_cb_type callback);
-
-/*! If an extension exists, return non-zero */
-/*!
- * \param hint buffer for hint
- * \param maxlen size of hint buffer
- * \param name buffer for name portion of hint
- * \param maxnamelen size of name buffer
- * \param c this is not important
- * \param context which context to look in
- * \param exten which extension to search for
- * If an extension within the given context with the priority PRIORITY_HINT
- * is found a non zero value will be returned.
- * Otherwise, 0 is returned.
- */
-int ast_get_hint(char *hint, int maxlen, char *name, int maxnamelen, struct ast_channel *c, const char *context, const char *exten);
-
-/*! If an extension exists, return non-zero */
-/* work */
-/*!
- * \param c this is not important
- * \param context which context to look in
- * \param exten which extension to search for
- * \param priority priority of the action within the extension
- * \param callerid callerid to search for
- * If an extension within the given context(or callerid) with the given priority is found a non zero value will be returned.
- * Otherwise, 0 is returned.
- */
-int ast_exists_extension(struct ast_channel *c, const char *context, const char *exten, int priority, const char *callerid);
-
-/*! If an extension exists, return non-zero */
-/* work */
-/*!
- * \param c this is not important
- * \param context which context to look in
- * \param exten which extension to search for
- * \param label label of the action within the extension to match to priority
- * \param callerid callerid to search for
- * If an priority which matches given label in extension or -1 if not found.
-\ */
-int ast_findlabel_extension(struct ast_channel *c, const char *context, const char *exten, const char *label, const char *callerid);
-
-int ast_findlabel_extension2(struct ast_channel *c, struct ast_context *con, const char *exten, const char *label, const char *callerid);
-
-/*! Looks for a valid matching extension */
-/*!
- \param c not really important
- \param context context to serach within
- \param exten extension to check
- \param priority priority of extension path
- \param callerid callerid of extension being searched for
- If "exten" *could be* a valid extension in this context with or without
- some more digits, return non-zero. Basically, when this returns 0, no matter
- what you add to exten, it's not going to be a valid extension anymore
-*/
-int ast_canmatch_extension(struct ast_channel *c, const char *context, const char *exten, int priority, const char *callerid);
-
-/*! Looks to see if adding anything to this extension might match something. (exists ^ canmatch) */
-/*!
- \param c not really important
- \param context context to serach within
- \param exten extension to check
- \param priority priority of extension path
- \param callerid callerid of extension being searched for
- If "exten" *could match* a valid extension in this context with
- some more digits, return non-zero. Does NOT return non-zero if this is
- an exact-match only. Basically, when this returns 0, no matter
- what you add to exten, it's not going to be a valid extension anymore
-*/
-int ast_matchmore_extension(struct ast_channel *c, const char *context, const char *exten, int priority, const char *callerid);
-
-/*! Determine if a given extension matches a given pattern (in NXX format) */
-/*!
- * \param pattern pattern to match
- * \param extension extension to check against the pattern.
- * Checks whether or not the given extension matches the given pattern.
- * Returns 1 on match, 0 on failure
- */
-int ast_extension_match(const char *pattern, const char *extension);
-int ast_extension_close(const char *pattern, const char *data, int needmore);
-/*! Launch a new extension (i.e. new stack) */
-/*!
- * \param c not important
- * \param context which context to generate the extension within
- * \param exten new extension to add
- * \param priority priority of new extension
- * \param callerid callerid of extension
- * This adds a new extension to the asterisk extension list.
- * It returns 0 on success, -1 on failure.
- */
-int ast_spawn_extension(struct ast_channel *c, const char *context, const char *exten, int priority, const char *callerid);
-
-/*! Execute an extension. */
-/*!
- \param c channel to execute upon
- \param context which context extension is in
- \param exten extension to execute
- \param priority priority to execute within the given extension
- \param callerid Caller-ID
- If it's not available, do whatever you should do for
- default extensions and halt the thread if necessary. This function does not
- return, except on error.
-*/
-int ast_exec_extension(struct ast_channel *c, const char *context, const char *exten, int priority, const char *callerid);
-
-/*! Add an include */
-/*!
- \param context context to add include to
- \param include new include to add
- \param registrar who's registering it
- Adds an include taking a char * string as the context parameter
- Returns 0 on success, -1 on error
-*/
-int ast_context_add_include(const char *context, const char *include, const char *registrar);
-
-/*! Add an include */
-/*!
- \param con context to add the include to
- \param include include to add
- \param registrar who registered the context
- Adds an include taking a struct ast_context as the first parameter
- Returns 0 on success, -1 on failure
-*/
-int ast_context_add_include2(struct ast_context *con, const char *include, const char *registrar);
-
-/*! Removes an include */
-/*!
- * See add_include
- */
-int ast_context_remove_include(const char *context, const char *include,const char *registrar);
-/*! Removes an include by an ast_context structure */
-/*!
- * See add_include2
- */
-int ast_context_remove_include2(struct ast_context *con, const char *include, const char *registrar);
-
-/*! Verifies includes in an ast_contect structure */
-/*!
- * \param con context in which to verify the includes
- * Returns 0 if no problems found, -1 if there were any missing context
- */
-int ast_context_verify_includes(struct ast_context *con);
-
-/*! Add a switch */
-/*!
- * \param context context to which to add the switch
- * \param sw switch to add
- * \param data data to pass to switch
- * \param eval whether to evaluate variables when running switch
- * \param registrar whoever registered the switch
- * This function registers a switch with the asterisk switch architecture
- * It returns 0 on success, -1 on failure
- */
-int ast_context_add_switch(const char *context, const char *sw, const char *data, int eval, const char *registrar);
-/*! Adds a switch (first param is a ast_context) */
-/*!
- * See ast_context_add_switch()
- */
-int ast_context_add_switch2(struct ast_context *con, const char *sw, const char *data, int eval, const char *registrar);
-
-/*! Remove a switch */
-/*!
- * Removes a switch with the given parameters
- * Returns 0 on success, -1 on failure
- */
-int ast_context_remove_switch(const char *context, const char *sw, const char *data, const char *registrar);
-int ast_context_remove_switch2(struct ast_context *con, const char *sw, const char *data, const char *registrar);
-
-/*! Simply remove extension from context */
-/*!
- * \param context context to remove extension from
- * \param extension which extension to remove
- * \param priority priority of extension to remove
- * \param registrar registrar of the extension
- * This function removes an extension from a given context.
- * Returns 0 on success, -1 on failure
- */
-int ast_context_remove_extension(const char *context, const char *extension, int priority,
- const char *registrar);
-int ast_context_remove_extension2(struct ast_context *con, const char *extension,
- int priority, const char *registrar);
-
-/*! Add an ignorepat */
-/*!
- * \param context which context to add the ignorpattern to
- * \param ignorepat ignorepattern to set up for the extension
- * \param registrar registrar of the ignore pattern
- * Adds an ignore pattern to a particular context.
- * Returns 0 on success, -1 on failure
- */
-int ast_context_add_ignorepat(const char *context, const char *ignorepat, const char *registrar);
-int ast_context_add_ignorepat2(struct ast_context *con, const char *ignorepat, const char *registrar);
-
-/* Remove an ignorepat */
-/*!
- * \param context context from which to remove the pattern
- * \param ignorepat the pattern to remove
- * \param registrar the registrar of the ignore pattern
- * This removes the given ignorepattern
- * Returns 0 on success, -1 on failure
- */
-int ast_context_remove_ignorepat(const char *context, const char *ignorepat, const char *registrar);
-int ast_context_remove_ignorepat2(struct ast_context *con, const char *ignorepat, const char *registrar);
-
-/*! Checks to see if a number should be ignored */
-/*!
- * \param context context to search within
- * \param pattern to check whether it should be ignored or not
- * Check if a number should be ignored with respect to dialtone cancellation.
- * Returns 0 if the pattern should not be ignored, or non-zero if the pattern should be ignored
- */
-int ast_ignore_pattern(const char *context, const char *pattern);
-
-/* Locking functions for outer modules, especially for completion functions */
-/*! Locks the contexts */
-/*! Locks the context list
- * Returns 0 on success, -1 on error
- */
-int ast_lock_contexts(void);
-
-/*! Unlocks contexts */
-/*!
- * Returns 0 on success, -1 on failure
- */
-int ast_unlock_contexts(void);
-
-/*! Locks a given context */
-/*!
- * \param con context to lock
- * Locks the context.
- * Returns 0 on success, -1 on failure
- */
-int ast_lock_context(struct ast_context *con);
-/*! Unlocks the given context */
-/*!
- * \param con context to unlock
- * Unlocks the given context
- * Returns 0 on success, -1 on failure
- */
-int ast_unlock_context(struct ast_context *con);
-
-
-int ast_async_goto(struct ast_channel *chan, const char *context, const char *exten, int priority);
-
-int ast_async_goto_by_name(const char *chan, const char *context, const char *exten, int priority);
-
-/* Synchronously or asynchronously make an outbound call and send it to a
- particular extension */
-int ast_pbx_outgoing_exten(const char *type, int format, void *data, int timeout, const char *context, const char *exten, int priority, int *reason, int sync, const char *cid_num, const char *cid_name, struct ast_variable *vars, const char *account, struct ast_channel **locked_channel);
-
-/* Synchronously or asynchronously make an outbound call and send it to a
- particular application with given extension */
-int ast_pbx_outgoing_app(const char *type, int format, void *data, int timeout, const char *app, const char *appdata, int *reason, int sync, const char *cid_num, const char *cid_name, struct ast_variable *vars, const char *account, struct ast_channel **locked_channel);
-
-/* Functions for returning values from structures */
-const char *ast_get_context_name(struct ast_context *con);
-const char *ast_get_extension_name(struct ast_exten *exten);
-const char *ast_get_include_name(struct ast_include *include);
-const char *ast_get_ignorepat_name(struct ast_ignorepat *ip);
-const char *ast_get_switch_name(struct ast_sw *sw);
-const char *ast_get_switch_data(struct ast_sw *sw);
-
-/* Other extension stuff */
-int ast_get_extension_priority(struct ast_exten *exten);
-int ast_get_extension_matchcid(struct ast_exten *e);
-const char *ast_get_extension_cidmatch(struct ast_exten *e);
-const char *ast_get_extension_app(struct ast_exten *e);
-const char *ast_get_extension_label(struct ast_exten *e);
-void *ast_get_extension_app_data(struct ast_exten *e);
-
-/* Registrar info functions ... */
-const char *ast_get_context_registrar(struct ast_context *c);
-const char *ast_get_extension_registrar(struct ast_exten *e);
-const char *ast_get_include_registrar(struct ast_include *i);
-const char *ast_get_ignorepat_registrar(struct ast_ignorepat *ip);
-const char *ast_get_switch_registrar(struct ast_sw *sw);
-
-/* Walking functions ... */
-struct ast_context *ast_walk_contexts(struct ast_context *con);
-struct ast_exten *ast_walk_context_extensions(struct ast_context *con,
- struct ast_exten *priority);
-struct ast_exten *ast_walk_extension_priorities(struct ast_exten *exten,
- struct ast_exten *priority);
-struct ast_include *ast_walk_context_includes(struct ast_context *con,
- struct ast_include *inc);
-struct ast_ignorepat *ast_walk_context_ignorepats(struct ast_context *con,
- struct ast_ignorepat *ip);
-struct ast_sw *ast_walk_context_switches(struct ast_context *con, struct ast_sw *sw);
-
-int pbx_builtin_serialize_variables(struct ast_channel *chan, char *buf, size_t size);
-extern char *pbx_builtin_getvar_helper(struct ast_channel *chan, const char *name);
-extern void pbx_builtin_pushvar_helper(struct ast_channel *chan, const char *name, const char *value);
-extern void pbx_builtin_setvar_helper(struct ast_channel *chan, const char *name, const char *value);
-extern void pbx_retrieve_variable(struct ast_channel *c, const char *var, char **ret, char *workspace, int workspacelen, struct varshead *headp);
-extern void pbx_builtin_clear_globals(void);
-extern int pbx_builtin_setvar(struct ast_channel *chan, void *data);
-extern void pbx_substitute_variables_helper(struct ast_channel *c,const char *cp1,char *cp2,int count);
-extern void pbx_substitute_variables_varshead(struct varshead *headp, const char *cp1, char *cp2, int count);
-
-int ast_extension_patmatch(const char *pattern, const char *data);
-
-/* Set "autofallthrough" flag, if newval is <0, does not acutally set. If
- set to 1, sets to auto fall through. If newval set to 0, sets to no auto
- fall through (reads extension instead). Returns previous value. */
-extern int pbx_set_autofallthrough(int newval);
-int ast_goto_if_exists(struct ast_channel *chan, char* context, char *exten, int priority);
-/* I can find neither parsable nor parseable at dictionary.com, but google gives me 169000 hits for parseable and only 49,800 for parsable */
-int ast_parseable_goto(struct ast_channel *chan, const char *goto_string);
-int ast_explicit_goto(struct ast_channel *chan, const char *context, const char *exten, int priority);
-int ast_async_goto_if_exists(struct ast_channel *chan, char* context, char *exten, int priority);
-
-struct ast_custom_function* ast_custom_function_find(char *name);
-int ast_custom_function_unregister(struct ast_custom_function *acf);
-int ast_custom_function_register(struct ast_custom_function *acf);
-
-/* Number of active calls */
-int ast_active_calls(void);
-
-/*! executes a read operation on a function */
-/*!
- * \param chan Channel to execute on
- * \param in Data containing the function call string
- * \param workspace A pointer to safe memory to use for a return value
- * \param len the number of bytes in workspace
- * This application executes an function in read mode on a given channel.
- * It returns a pointer to workspace if the buffer contains any new data
- * or NULL if there was a problem.
- */
-
-char *ast_func_read(struct ast_channel *chan, const char *in, char *workspace, size_t len);
-
-/*! executes a write operation on a function */
-/*!
- * \param chan Channel to execute on
- * \param in Data containing the function call string
- * \param value A value parameter to pass for writing
- * This application executes an function in write mode on a given channel.
- * It has no return value.
- */
-void ast_func_write(struct ast_channel *chan, const char *in, const char *value);
-
-void ast_hint_state_changed(const char *device);
-
-#if defined(__cplusplus) || defined(c_plusplus)
-}
-#endif
-
-#endif /* _ASTERISK_PBX_H */
diff --git a/1.2-netsec/include/asterisk/plc.h b/1.2-netsec/include/asterisk/plc.h
deleted file mode 100644
index a790ca167..000000000
--- a/1.2-netsec/include/asterisk/plc.h
+++ /dev/null
@@ -1,161 +0,0 @@
-/*! \file
- * \brief SpanDSP - a series of DSP components for telephony
- *
- * plc.h
- *
- * \author Steve Underwood <steveu@coppice.org>
- *
- * Copyright (C) 2004 Steve Underwood
- *
- * All rights reserved.
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- *
- * This version may be optionally licenced under the GNU LGPL licence.
- * This version is disclaimed to DIGIUM for inclusion in the Asterisk project.
- */
-
-
-#if !defined(_PLC_H_)
-#define _PLC_H_
-
-#ifdef SOLARIS
-#include <sys/int_types.h>
-#else
-#if defined(__OpenBSD__) || defined( __FreeBSD__)
-#include <inttypes.h>
-#else
-#include <stdint.h>
-#endif
-#endif
-
-/*! \page plc_page Packet loss concealment
-\section plc_page_sec_1 What does it do?
-The packet loss concealment module provides a suitable synthetic fill-in signal,
-to minimise the audible effect of lost packets in VoIP applications. It is not
-tied to any particular codec, and could be used with almost any codec which does not
-specify its own procedure for packet loss concealment.
-
-Where a codec specific concealment procedure exists, the algorithm is usually built
-around knowledge of the characteristics of the particular codec. It will, therefore,
-generally give better results for that particular codec than this generic concealer will.
-
-\section plc_page_sec_2 How does it work?
-While good packets are being received, the plc_rx() routine keeps a record of the trailing
-section of the known speech signal. If a packet is missed, plc_fillin() is called to produce
-a synthetic replacement for the real speech signal. The average mean difference function
-(AMDF) is applied to the last known good signal, to determine its effective pitch.
-Based on this, the last pitch period of signal is saved. Essentially, this cycle of speech
-will be repeated over and over until the real speech resumes. However, several refinements
-are needed to obtain smooth pleasant sounding results.
-
-- The two ends of the stored cycle of speech will not always fit together smoothly. This can
- cause roughness, or even clicks, at the joins between cycles. To soften this, the
- 1/4 pitch period of real speech preceeding the cycle to be repeated is blended with the last
- 1/4 pitch period of the cycle to be repeated, using an overlap-add (OLA) technique (i.e.
- in total, the last 5/4 pitch periods of real speech are used).
-
-- The start of the synthetic speech will not always fit together smoothly with the tail of
- real speech passed on before the erasure was identified. Ideally, we would like to modify
- the last 1/4 pitch period of the real speech, to blend it into the synthetic speech. However,
- it is too late for that. We could have delayed the real speech a little, but that would
- require more buffer manipulation, and hurt the efficiency of the no-lost-packets case
- (which we hope is the dominant case). Instead we use a degenerate form of OLA to modify
- the start of the synthetic data. The last 1/4 pitch period of real speech is time reversed,
- and OLA is used to blend it with the first 1/4 pitch period of synthetic speech. The result
- seems quite acceptable.
-
-- As we progress into the erasure, the chances of the synthetic signal being anything like
- correct steadily fall. Therefore, the volume of the synthesized signal is made to decay
- linearly, such that after 50ms of missing audio it is reduced to silence.
-
-- When real speech resumes, an extra 1/4 pitch period of sythetic speech is blended with the
- start of the real speech. If the erasure is small, this smoothes the transition. If the erasure
- is long, and the synthetic signal has faded to zero, the blending softens the start up of the
- real signal, avoiding a kind of "click" or "pop" effect that might occur with a sudden onset.
-
-\section plc_page_sec_3 How do I use it?
-Before audio is processed, call plc_init() to create an instance of the packet loss
-concealer. For each received audio packet that is acceptable (i.e. not including those being
-dropped for being too late) call plc_rx() to record the content of the packet. Note this may
-modify the packet a little after a period of packet loss, to blend real synthetic data smoothly.
-When a real packet is not available in time, call plc_fillin() to create a sythetic substitute.
-That's it!
-*/
-
-#define SAMPLE_RATE 8000
-
-/*! Minimum allowed pitch (66 Hz) */
-#define PLC_PITCH_MIN 120
-/*! Maximum allowed pitch (200 Hz) */
-#define PLC_PITCH_MAX 40
-/*! Maximum pitch OLA window */
-#define PLC_PITCH_OVERLAP_MAX (PLC_PITCH_MIN >> 2)
-/*! The length over which the AMDF function looks for similarity (20 ms) */
-#define CORRELATION_SPAN 160
-/*! History buffer length. The buffer much also be at leat 1.25 times
- PLC_PITCH_MIN, but that is much smaller than the buffer needs to be for
- the pitch assessment. */
-#define PLC_HISTORY_LEN (CORRELATION_SPAN + PLC_PITCH_MIN)
-
-typedef struct
-{
- /*! Consecutive erased samples */
- int missing_samples;
- /*! Current offset into pitch period */
- int pitch_offset;
- /*! Pitch estimate */
- int pitch;
- /*! Buffer for a cycle of speech */
- float pitchbuf[PLC_PITCH_MIN];
- /*! History buffer */
- int16_t history[PLC_HISTORY_LEN];
- /*! Current pointer into the history buffer */
- int buf_ptr;
-} plc_state_t;
-
-
-#ifdef __cplusplus
-extern "C" {
-#endif
-
-/*! Process a block of received audio samples.
- \brief Process a block of received audio samples.
- \param s The packet loss concealer context.
- \param amp The audio sample buffer.
- \param len The number of samples in the buffer.
- \return The number of samples in the buffer. */
-int plc_rx(plc_state_t *s, int16_t amp[], int len);
-
-/*! Fill-in a block of missing audio samples.
- \brief Fill-in a block of missing audio samples.
- \param s The packet loss concealer context.
- \param amp The audio sample buffer.
- \param len The number of samples to be synthesised.
- \return The number of samples synthesized. */
-int plc_fillin(plc_state_t *s, int16_t amp[], int len);
-
-/*! Process a block of received V.29 modem audio samples.
- \brief Process a block of received V.29 modem audio samples.
- \param s The packet loss concealer context.
- \return A pointer to the he packet loss concealer context. */
-plc_state_t *plc_init(plc_state_t *s);
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif
-/*- End of file ------------------------------------------------------------*/
diff --git a/1.2-netsec/include/asterisk/poll-compat.h b/1.2-netsec/include/asterisk/poll-compat.h
deleted file mode 100644
index 5f795a894..000000000
--- a/1.2-netsec/include/asterisk/poll-compat.h
+++ /dev/null
@@ -1,111 +0,0 @@
-/*
- * Asterisk -- An open source telephony toolkit.
- *
- * 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.
- */
-
-/*---------------------------------------------------------------------------*\
- $Id$
-
- NAME
-
- poll - select(2)-based poll() emulation function for BSD systems.
-
- SYNOPSIS
- #include "poll.h"
-
- struct pollfd
- {
- int fd;
- short events;
- short revents;
- }
-
- int poll (struct pollfd *pArray, unsigned long n_fds, int timeout)
-
- DESCRIPTION
-
- This file, and the accompanying "poll.c", implement the System V
- poll(2) system call for BSD systems (which typically do not provide
- poll()). Poll() provides a method for multiplexing input and output
- on multiple open file descriptors; in traditional BSD systems, that
- capability is provided by select(). While the semantics of select()
- differ from those of poll(), poll() can be readily emulated in terms
- of select() -- which is how this function is implemented.
-
- REFERENCES
- Stevens, W. Richard. Unix Network Programming. Prentice-Hall, 1990.
-
- NOTES
- 1. This software requires an ANSI C compiler.
-
- LICENSE
-
- This software is released under the following license:
-
- Copyright (c) 1995-2002 Brian M. Clapper
- All rights reserved.
-
- Redistribution and use in source and binary forms are
- permitted provided that: (1) source distributions retain
- this entire copyright notice and comment; (2) modifications
- made to the software are prominently mentioned, and a copy
- of the original software (or a pointer to its location) are
- included; and (3) distributions including binaries display
- the following acknowledgement: "This product includes
- software developed by Brian M. Clapper <bmc@clapper.org>"
- in the documentation or other materials provided with the
- distribution. The name of the author may not be used to
- endorse or promote products derived from this software
- without specific prior written permission.
-
- THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS
- OR IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE
- IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
- PARTICULAR PURPOSE.
-
- Effectively, this means you can do what you want with the software
- except remove this notice or take advantage of the author's name.
- If you modify the software and redistribute your modified version,
- you must indicate that your version is a modification of the
- original, and you must provide either a pointer to or a copy of the
- original.
-\*---------------------------------------------------------------------------*/
-
-#ifndef _POLL_EMUL_H_
-#define _POLL_EMUL_H_
-
-#define POLLIN 0x01
-#define POLLPRI 0x02
-#define POLLOUT 0x04
-#define POLLERR 0x08
-#define POLLHUP 0x10
-#define POLLNVAL 0x20
-
-struct pollfd
-{
- int fd;
- short events;
- short revents;
-};
-
-#ifdef __cplusplus
-extern "C"
-{
-#endif
-
-#if (__STDC__ > 0) || defined(__cplusplus)
-extern int poll (struct pollfd *pArray, unsigned long n_fds, int timeout);
-#else
-extern int poll();
-#endif
-
-#ifdef __cplusplus
-}
-#endif
-
-#endif /* _POLL_EMUL_H_ */
diff --git a/1.2-netsec/include/asterisk/privacy.h b/1.2-netsec/include/asterisk/privacy.h
deleted file mode 100644
index 686a14d75..000000000
--- a/1.2-netsec/include/asterisk/privacy.h
+++ /dev/null
@@ -1,46 +0,0 @@
-/*
- * 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.
- */
-
-/*! \file
- * \brief Persistant data storage (akin to *doze registry)
- */
-
-#ifndef _ASTERISK_PRIVACY_H
-#define _ASTERISK_PRIVACY_H
-
-#if defined(__cplusplus) || defined(c_plusplus)
-extern "C" {
-#endif
-
-#define AST_PRIVACY_DENY (1 << 0) /* Don't bother ringing, send to voicemail */
-#define AST_PRIVACY_ALLOW (1 << 1) /* Pass directly to me */
-#define AST_PRIVACY_KILL (1 << 2) /* Play anti-telemarketer message and hangup */
-#define AST_PRIVACY_TORTURE (1 << 3) /* Send directly to tele-torture */
-#define AST_PRIVACY_UNKNOWN (1 << 16)
-
-int ast_privacy_check(char *dest, char *cid);
-
-int ast_privacy_set(char *dest, char *cid, int status);
-
-int ast_privacy_reset(char *dest);
-
-#if defined(__cplusplus) || defined(c_plusplus)
-}
-#endif
-
-#endif /* _ASTERISK_PRIVACY_H */
diff --git a/1.2-netsec/include/asterisk/res_odbc.h b/1.2-netsec/include/asterisk/res_odbc.h
deleted file mode 100644
index 9e4070beb..000000000
--- a/1.2-netsec/include/asterisk/res_odbc.h
+++ /dev/null
@@ -1,62 +0,0 @@
-/*
- * Asterisk -- An open source telephony toolkit.
- *
- * Copyright (C) 1999 - 2005, Digium, Inc.
- * Copyright (C) 2004 - 2005, Anthony Minessale II
- *
- * Mark Spencer <markster@digium.com>
- * Anthony Minessale <anthmct@yahoo.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.
- */
-
-/*! \file
- * \brief ODBC resource manager
- */
-
-#ifndef _ASTERISK_RES_ODBC_H
-#define _ASTERISK_RES_ODBC_H
-
-#include <sql.h>
-#include <sqlext.h>
-#include <sqltypes.h>
-
-typedef struct odbc_obj odbc_obj;
-
-typedef enum { ODBC_SUCCESS=0,ODBC_FAIL=-1} odbc_status;
-
-struct odbc_obj {
- char *name;
- char *dsn;
- char *username;
- char *password;
- SQLHENV env; /* ODBC Environment */
- SQLHDBC con; /* ODBC Connection Handle */
- SQLHSTMT stmt; /* ODBC Statement Handle */
- ast_mutex_t lock;
- int up;
-
-};
-
-/* functions */
-odbc_obj *new_odbc_obj(char *name,char *dsn,char *username, char *password);
-odbc_status odbc_obj_connect(odbc_obj *obj);
-odbc_status odbc_obj_disconnect(odbc_obj *obj);
-void destroy_odbc_obj(odbc_obj **obj);
-int register_odbc_obj(char *name,odbc_obj *obj);
-odbc_obj *fetch_odbc_obj(const char *name, int check);
-int odbc_dump_fd(int fd,odbc_obj *obj);
-int odbc_sanity_check(odbc_obj *obj);
-SQLHSTMT odbc_prepare_and_execute(odbc_obj *obj, SQLHSTMT (*prepare_cb)(odbc_obj *obj, void *data), void *data);
-int odbc_smart_execute(odbc_obj *obj, SQLHSTMT stmt);
-int odbc_smart_direct_execute(odbc_obj *obj, SQLHSTMT stmt, char *sql);
-
-#endif /* _ASTERISK_RES_ODBC_H */
diff --git a/1.2-netsec/include/asterisk/rtp.h b/1.2-netsec/include/asterisk/rtp.h
deleted file mode 100644
index f1e771e34..000000000
--- a/1.2-netsec/include/asterisk/rtp.h
+++ /dev/null
@@ -1,172 +0,0 @@
-/*
- * 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.
- */
-
-/*!
- * \file rtp.h
- * \brief Supports RTP and RTCP with Symmetric RTP support for NAT traversal.
- *
- * RTP is defined in RFC 3550.
- */
-
-#ifndef _ASTERISK_RTP_H
-#define _ASTERISK_RTP_H
-
-#include "asterisk/frame.h"
-#include "asterisk/io.h"
-#include "asterisk/sched.h"
-#include "asterisk/channel.h"
-
-#include <netinet/in.h>
-
-#if defined(__cplusplus) || defined(c_plusplus)
-extern "C" {
-#endif
-
-/* Codes for RTP-specific data - not defined by our AST_FORMAT codes */
-/*! DTMF (RFC2833) */
-#define AST_RTP_DTMF (1 << 0)
-/*! 'Comfort Noise' (RFC3389) */
-#define AST_RTP_CN (1 << 1)
-/*! DTMF (Cisco Proprietary) */
-#define AST_RTP_CISCO_DTMF (1 << 2)
-/*! Maximum RTP-specific code */
-#define AST_RTP_MAX AST_RTP_CISCO_DTMF
-
-struct ast_rtp_protocol {
- /* Get RTP struct, or NULL if unwilling to transfer */
- struct ast_rtp *(* const get_rtp_info)(struct ast_channel *chan);
- /* Get RTP struct, or NULL if unwilling to transfer */
- struct ast_rtp *(* const get_vrtp_info)(struct ast_channel *chan);
- /* Set RTP peer */
- int (* const set_rtp_peer)(struct ast_channel *chan, struct ast_rtp *peer, struct ast_rtp *vpeer, int codecs, int nat_active);
- int (* const get_codec)(struct ast_channel *chan);
- const char * const type;
- struct ast_rtp_protocol *next;
-};
-
-/*!
- * \brief Structure representing a RTP session.
- *
- * RTP session is defined on page 9 of RFC 3550: "An association among a set of participants communicating with RTP. A participant may be involved in multiple RTP sessions at the same time [...]"
- *
- */
-struct ast_rtp;
-
-typedef int (*ast_rtp_callback)(struct ast_rtp *rtp, struct ast_frame *f, void *data);
-
-/*!
- * \brief Initializate a RTP session.
- *
- * \param sched
- * \param io
- * \param rtcpenable
- * \param callbackmode
- * \returns A representation (structure) of an RTP session.
- */
-struct ast_rtp *ast_rtp_new(struct sched_context *sched, struct io_context *io, int rtcpenable, int callbackmode);
-
-/*!
- * \brief Initializate a RTP session using an in_addr structure.
- *
- * This fuction gets called by ast_rtp_new().
- *
- * \param sched
- * \param io
- * \param rtcpenable
- * \param callbackmode
- * \param in
- * \returns A representation (structure) of an RTP session.
- */
-struct ast_rtp *ast_rtp_new_with_bindaddr(struct sched_context *sched, struct io_context *io, int rtcpenable, int callbackmode, struct in_addr in);
-
-void ast_rtp_set_peer(struct ast_rtp *rtp, struct sockaddr_in *them);
-
-void ast_rtp_get_peer(struct ast_rtp *rtp, struct sockaddr_in *them);
-
-void ast_rtp_get_us(struct ast_rtp *rtp, struct sockaddr_in *us);
-
-#ifdef MIDCOM
-void ast_rtp_nat_us(struct ast_rtp *rtp, struct sockaddr_in *our_nat);
-void ast_rtp_get_their_nat(struct ast_rtp *rtp, struct sockaddr_in *their_nat);
-#endif
-
-void ast_rtp_destroy(struct ast_rtp *rtp);
-
-void ast_rtp_reset(struct ast_rtp *rtp);
-
-void ast_rtp_set_callback(struct ast_rtp *rtp, ast_rtp_callback callback);
-
-void ast_rtp_set_data(struct ast_rtp *rtp, void *data);
-
-int ast_rtp_write(struct ast_rtp *rtp, struct ast_frame *f);
-
-struct ast_frame *ast_rtp_read(struct ast_rtp *rtp);
-
-struct ast_frame *ast_rtcp_read(struct ast_rtp *rtp);
-
-int ast_rtp_fd(struct ast_rtp *rtp);
-
-int ast_rtcp_fd(struct ast_rtp *rtp);
-
-int ast_rtp_senddigit(struct ast_rtp *rtp, char digit);
-
-int ast_rtp_sendcng(struct ast_rtp *rtp, int level);
-
-int ast_rtp_settos(struct ast_rtp *rtp, int tos);
-
-/* Setting RTP payload types from lines in a SDP description: */
-void ast_rtp_pt_clear(struct ast_rtp* rtp);
-/* Set payload types to defaults */
-void ast_rtp_pt_default(struct ast_rtp* rtp);
-void ast_rtp_set_m_type(struct ast_rtp* rtp, int pt);
-void ast_rtp_set_rtpmap_type(struct ast_rtp* rtp, int pt,
- char* mimeType, char* mimeSubtype);
-
-/* Mapping between RTP payload format codes and Asterisk codes: */
-struct rtpPayloadType ast_rtp_lookup_pt(struct ast_rtp* rtp, int pt);
-int ast_rtp_lookup_code(struct ast_rtp* rtp, int isAstFormat, int code);
-void ast_rtp_offered_from_local(struct ast_rtp* rtp, int local);
-
-void ast_rtp_get_current_formats(struct ast_rtp* rtp,
- int* astFormats, int* nonAstFormats);
-
-/* Mapping an Asterisk code into a MIME subtype (string): */
-char* ast_rtp_lookup_mime_subtype(int isAstFormat, int code);
-
-/* Build a string of MIME subtype names from a capability list */
-char *ast_rtp_lookup_mime_multiple(char *buf, int size, const int capability, const int isAstFormat);
-
-void ast_rtp_setnat(struct ast_rtp *rtp, int nat);
-
-int ast_rtp_bridge(struct ast_channel *c0, struct ast_channel *c1, int flags, struct ast_frame **fo, struct ast_channel **rc, int timeoutms);
-
-int ast_rtp_proto_register(struct ast_rtp_protocol *proto);
-
-void ast_rtp_proto_unregister(struct ast_rtp_protocol *proto);
-
-void ast_rtp_stop(struct ast_rtp *rtp);
-
-void ast_rtp_init(void);
-
-void ast_rtp_reload(void);
-
-#if defined(__cplusplus) || defined(c_plusplus)
-}
-#endif
-
-#endif /* _ASTERISK_RTP_H */
diff --git a/1.2-netsec/include/asterisk/say.h b/1.2-netsec/include/asterisk/say.h
deleted file mode 100644
index ac498cde2..000000000
--- a/1.2-netsec/include/asterisk/say.h
+++ /dev/null
@@ -1,102 +0,0 @@
-/*
- * 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.
- */
-
-/*! \file
- * \brief Say numbers and dates (maybe words one day too)
- */
-
-#ifndef _ASTERISK_SAY_H
-#define _ASTERISK_SAY_H
-
-#include "asterisk/channel.h"
-#include "asterisk/file.h"
-
-#include <time.h>
-
-#if defined(__cplusplus) || defined(c_plusplus)
-extern "C" {
-#endif
-
-/* says a number
- * \param chan channel to say them number on
- * \param num number to say on the channel
- * \param ints which dtmf to interrupt on
- * \param lang language to speak the number
- * \param options set to 'f' for female, 'm' for male, 'c' for commune, 'n' for neuter, 'p' for plural
- * Vocally says a number on a given channel
- * Returns 0 on success, DTMF digit on interrupt, -1 on failure
- */
-int ast_say_number(struct ast_channel *chan, int num, const char *ints, const char *lang, const char *options);
-
-/* Same as above with audiofd for received audio and returns 1 on ctrlfd being readable */
-int ast_say_number_full(struct ast_channel *chan, int num, const char *ints, const char *lang, const char *options, int audiofd, int ctrlfd);
-
-/* says an enumeration
- * \param chan channel to say them enumeration on
- * \param num number to say on the channel
- * \param ints which dtmf to interrupt on
- * \param lang language to speak the enumeration
- * \param options set to 'f' for female, 'm' for male, 'c' for commune, 'n' for neuter, 'p' for plural
- * Vocally says a enumeration on a given channel (first, sencond, third, forth, thirtyfirst, hundredth, ....)
- * especially useful for dates and messages. says 'last' if num equals to INT_MAX
- * Returns 0 on success, DTMF digit on interrupt, -1 on failure
- */
-int ast_say_enumeration(struct ast_channel *chan, int num, const char *ints, const char *lang, const char *options);
-int ast_say_enumeration_full(struct ast_channel *chan, int num, const char *ints, const char *lang, const char *options, int audiofd, int ctrlfd);
-
-/* says digits
- * \param chan channel to act upon
- * \param num number to speak
- * \param ints which dtmf to interrupt on
- * \param lang language to speak
- * Vocally says digits of a given number
- * Returns 0 on success, dtmf if interrupted, -1 on failure
- */
-int ast_say_digits(struct ast_channel *chan, int num, const char *ints, const char *lang);
-int ast_say_digits_full(struct ast_channel *chan, int num, const char *ints, const char *lang, int audiofd, int ctrlfd);
-
-/* says digits of a string
- * \param chan channel to act upon
- * \param num string to speak
- * \param ints which dtmf to interrupt on
- * \param lang language to speak in
- * Vocally says the digits of a given string
- * Returns 0 on success, dtmf if interrupted, -1 on failure
- */
-int ast_say_digit_str(struct ast_channel *chan, const char *num, const char *ints, const char *lang);
-int ast_say_digit_str_full(struct ast_channel *chan, const char *num, const char *ints, const char *lang, int audiofd, int ctrlfd);
-int ast_say_character_str(struct ast_channel *chan, const char *num, const char *ints, const char *lang);
-int ast_say_character_str_full(struct ast_channel *chan, const char *num, const char *ints, const char *lang, int audiofd, int ctrlfd);
-int ast_say_phonetic_str(struct ast_channel *chan, const char *num, const char *ints, const char *lang);
-int ast_say_phonetic_str_full(struct ast_channel *chan, const char *num, const char *ints, const char *lang, int audiofd, int ctrlfd);
-
-int ast_say_datetime(struct ast_channel *chan, time_t t, const char *ints, const char *lang);
-
-int ast_say_time(struct ast_channel *chan, time_t t, const char *ints, const char *lang);
-
-int ast_say_date(struct ast_channel *chan, time_t t, const char *ints, const char *lang);
-
-int ast_say_datetime_from_now(struct ast_channel *chan, time_t t, const char *ints, const char *lang);
-
-int ast_say_date_with_format(struct ast_channel *chan, time_t t, const char *ints, const char *lang, const char *format, const char *timezone);
-
-#if defined(__cplusplus) || defined(c_plusplus)
-}
-#endif
-
-#endif /* _ASTERISK_SAY_H */
diff --git a/1.2-netsec/include/asterisk/sched.h b/1.2-netsec/include/asterisk/sched.h
deleted file mode 100644
index eca928ca4..000000000
--- a/1.2-netsec/include/asterisk/sched.h
+++ /dev/null
@@ -1,160 +0,0 @@
-/*
- * 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.
- */
-
-/*! \file
- * \brief Scheduler Routines (derived from cheops)
- */
-
-#ifndef _ASTERISK_SCHED_H
-#define _ASTERISK_SCHED_H
-
-#if defined(__cplusplus) || defined(c_plusplus)
-extern "C" {
-#endif
-
-/*! Max num of schedule structs */
-/*!
- * The max number of schedule structs to keep around
- * for use. Undefine to disable schedule structure
- * caching. (Only disable this on very low memory
- * machines)
- */
-#define SCHED_MAX_CACHE 128
-
-struct sched_context;
-
-/*! New schedule context */
-/* !
- * Create a scheduling context
- * Returns a malloc'd sched_context structure, NULL on failure
- */
-extern struct sched_context *sched_context_create(void);
-
-/*! destroys a schedule context */
-/*!
- * \param c Context to free
- * Destroys (free's) the given sched_context structure
- * Returns 0 on success, -1 on failure
- */
-void sched_context_destroy(struct sched_context *c);
-
-/*! callback for a cheops scheduler */
-/*!
- * A cheops scheduler callback takes a pointer with callback data and
- * returns a 0 if it should not be run again, or non-zero if it should be
- * rescheduled to run again
- */
-typedef int (*ast_sched_cb)(void *data);
-#define AST_SCHED_CB(a) ((ast_sched_cb)(a))
-
-/*!Adds a scheduled event */
-/*!
- * \param con Schduler context to add
- * \param when how many milliseconds to wait for event to occur
- * \param callback function to call when the amount of time expires
- * \param data data to pass to the callback
- * Schedule an event to take place at some point in the future. callback
- * will be called with data as the argument, when milliseconds into the
- * future (approximately)
- * If callback returns 0, no further events will be re-scheduled
- * Returns a schedule item ID on success, -1 on failure
- */
-extern int ast_sched_add(struct sched_context *con, int when, ast_sched_cb callback, void *data);
-
-/*!Adds a scheduled event */
-/*!
- * \param con Schduler context to add
- * \param when how many milliseconds to wait for event to occur
- * \param callback function to call when the amount of time expires
- * \param data data to pass to the callback
- * \param variable If true, the result value of callback function will be
- * used for rescheduling
- * Schedule an event to take place at some point in the future. callback
- * will be called with data as the argument, when milliseconds into the
- * future (approximately)
- * If callback returns 0, no further events will be re-scheduled
- * Returns a schedule item ID on success, -1 on failure
- */
-extern int ast_sched_add_variable(struct sched_context *con, int when, ast_sched_cb callback, void *data, int variable);
-
-/*! Deletes a scheduled event */
-/*!
- * \param con scheduling context to delete item from
- * \param id ID of the scheduled item to delete
- * Remove this event from being run. A procedure should not remove its
- * own event, but return 0 instead.
- * Returns 0 on success, -1 on failure
- */
-extern int ast_sched_del(struct sched_context *con, int id);
-
-/*! Determines number of seconds until the next outstanding event to take place */
-/*!
- * \param con context to act upon
- * Determine the number of seconds until the next outstanding event
- * should take place, and return the number of milliseconds until
- * it needs to be run. This value is perfect for passing to the poll
- * call. Returns "-1" if there is nothing there are no scheduled events
- * (and thus the poll should not timeout)
- */
-extern int ast_sched_wait(struct sched_context *con);
-
-/*! Runs the queue */
-/*!
- * \param con Scheduling context to run
- * Run the queue, executing all callbacks which need to be performed
- * at this time. Returns the number of events processed.
- */
-extern int ast_sched_runq(struct sched_context *con);
-
-/*!Dumps the scheduler contents */
-/*!
- * \param con Context to dump
- * Debugging: Dump the contents of the scheduler to stderr
- */
-extern void ast_sched_dump(const struct sched_context *con);
-
-/*!Returns the number of seconds before an event takes place */
-/*!
- * \param con Context to use
- * \param id Id to dump
- */
-extern long ast_sched_when(struct sched_context *con,int id);
-
-/*
- *! Convenience macro for objects and reference (add)
- *
- */
-#define ast_sched_add_object(obj,con,when,callback) ast_sched_add((con),(when),(callback), ASTOBJ_REF((obj)))
-
-/*
- *! Convenience macro for objects and reference (del)
- *
- */
-#define ast_sched_del_object(obj,destructor,con,id) do { \
- if ((id) > -1) { \
- ast_sched_del((con),(id)); \
- (id) = -1; \
- ASTOBJ_UNREF((obj),(destructor)); \
- } \
-} while(0)
-
-#if defined(__cplusplus) || defined(c_plusplus)
-}
-#endif
-
-#endif /* _ASTERISK_SCHED_H */
diff --git a/1.2-netsec/include/asterisk/slinfactory.h b/1.2-netsec/include/asterisk/slinfactory.h
deleted file mode 100644
index e7403032c..000000000
--- a/1.2-netsec/include/asterisk/slinfactory.h
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- * Asterisk -- An open source telephony toolkit.
- *
- * Copyright (C) 2005, Anthony Minessale II
- *
- * Anthony Minessale <anthmct@yahoo.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.
- */
-
-/*! \file
- * \brief A machine to gather up arbitrary frames and convert them
- * to raw slinear on demand.
- */
-
-#ifndef _ASTERISK_SLINFACTORY_H
-#define _ASTERISK_SLINFACTORY_H
-#include <stdlib.h>
-#include <unistd.h>
-#include <string.h>
-
-
-#if defined(__cplusplus) || defined(c_plusplus)
-extern "C" {
-#endif
-
-struct ast_slinfactory {
- struct ast_frame *queue;
- struct ast_trans_pvt *trans;
- short hold[1280];
- short *offset;
- size_t holdlen;
- int size;
- int format;
-};
-
-void ast_slinfactory_init(struct ast_slinfactory *sf);
-void ast_slinfactory_destroy(struct ast_slinfactory *sf);
-int ast_slinfactory_feed(struct ast_slinfactory *sf, struct ast_frame *f);
-int ast_slinfactory_read(struct ast_slinfactory *sf, short *buf, size_t bytes);
-
-
-
-#if defined(__cplusplus) || defined(c_plusplus)
-}
-#endif
-
-#endif /* _ASTERISK_SLINFACTORY_H */
diff --git a/1.2-netsec/include/asterisk/srv.h b/1.2-netsec/include/asterisk/srv.h
deleted file mode 100644
index 08dcac0f2..000000000
--- a/1.2-netsec/include/asterisk/srv.h
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
- * 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.
- */
-
-/*
- * DNS SRV record support
- */
-
-#ifndef _ASTERISK_SRV_H
-#define _ASTERISK_SRV_H
-
-struct ast_channel;
-
-/*!
- \file srv.h
- \brief Support for DNS SRV records, used in to locate SIP services.
- \note Note: The Asterisk DNS SRV record support is broken, it only
- supports the first DNS SRV record and will give no load
- balancing or failover support.
-*/
-
-/*! Lookup entry in SRV records Returns 1 if found, 0 if not found, -1 on hangup
- Only do SRV record lookup if you get a domain without a port. If you get a port #, it's a DNS host name.
-*/
-/*! \param chan Ast channel
- \param host host name (return value)
- \param hostlen Length of string "host"
- \param port Port number (return value)
- \param service Service tag for SRV lookup (like "_sip._udp" or "_stun._udp"
-*/
-extern int ast_get_srv(struct ast_channel *chan, char *host, int hostlen, int *port, const char *service);
-
-#endif /* _ASTERISK_SRV_H */
diff --git a/1.2-netsec/include/asterisk/strings.h b/1.2-netsec/include/asterisk/strings.h
deleted file mode 100644
index 52bbc3629..000000000
--- a/1.2-netsec/include/asterisk/strings.h
+++ /dev/null
@@ -1,251 +0,0 @@
-/*
- * 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.
- */
-
-/*! \file
- * \brief String manipulation functions
- */
-
-#ifndef _ASTERISK_STRINGS_H
-#define _ASTERISK_STRINGS_H
-
-#include <string.h>
-#include <stdarg.h>
-
-#include "asterisk/inline_api.h"
-#include "asterisk/compiler.h"
-#include "asterisk/compat.h"
-
-static force_inline int ast_strlen_zero(const char *s)
-{
- return (!s || (*s == '\0'));
-}
-
-/*!
- \brief Gets a pointer to the first non-whitespace character in a string.
- \param ast_skip_blanks function being used
- \param str the input string
- \return a pointer to the first non-whitespace character
- */
-AST_INLINE_API(
-char *ast_skip_blanks(char *str),
-{
- while (*str && *str < 33)
- str++;
- return str;
-}
-)
-
-/*!
- \brief Trims trailing whitespace characters from a string.
- \param ast_trim_blanks function being used
- \param str the input string
- \return a pointer to the modified string
- */
-AST_INLINE_API(
-char *ast_trim_blanks(char *str),
-{
- char *work = str;
-
- if (work) {
- work += strlen(work) - 1;
- /* It's tempting to only want to erase after we exit this loop,
- but since ast_trim_blanks *could* receive a constant string
- (which we presumably wouldn't have to touch), we shouldn't
- actually set anything unless we must, and it's easier just
- to set each position to \0 than to keep track of a variable
- for it */
- while ((work >= str) && *work < 33)
- *(work--) = '\0';
- }
- return str;
-}
-)
-
-/*!
- \brief Gets a pointer to first whitespace character in a string.
- \param ast_skip_noblanks function being used
- \param str the input string
- \return a pointer to the first whitespace character
- */
-AST_INLINE_API(
-char *ast_skip_nonblanks(char *str),
-{
- while (*str && *str > 32)
- str++;
- return str;
-}
-)
-
-/*!
- \brief Strip leading/trailing whitespace from a string.
- \param s The string to be stripped (will be modified).
- \return The stripped string.
-
- This functions strips all leading and trailing whitespace
- characters from the input string, and returns a pointer to
- the resulting string. The string is modified in place.
-*/
-AST_INLINE_API(
-char *ast_strip(char *s),
-{
- s = ast_skip_blanks(s);
- if (s)
- ast_trim_blanks(s);
- return s;
-}
-)
-
-/*!
- \brief Strip leading/trailing whitespace and quotes from a string.
- \param s The string to be stripped (will be modified).
- \param beg_quotes The list of possible beginning quote characters.
- \param end_quotes The list of matching ending quote characters.
- \return The stripped string.
-
- This functions strips all leading and trailing whitespace
- characters from the input string, and returns a pointer to
- the resulting string. The string is modified in place.
-
- It can also remove beginning and ending quote (or quote-like)
- characters, in matching pairs. If the first character of the
- string matches any character in beg_quotes, and the last
- character of the string is the matching character in
- end_quotes, then they are removed from the string.
-
- Examples:
- \code
- ast_strip_quoted(buf, "\"", "\"");
- ast_strip_quoted(buf, "'", "'");
- ast_strip_quoted(buf, "[{(", "]})");
- \endcode
- */
-char *ast_strip_quoted(char *s, const char *beg_quotes, const char *end_quotes);
-
-/*!
- \brief Size-limited null-terminating string copy.
- \param ast_copy_string function being used
- \param dst The destination buffer.
- \param src The source string
- \param size The size of the destination buffer
- \return Nothing.
-
- This is similar to \a strncpy, with two important differences:
- - the destination buffer will \b always be null-terminated
- - the destination buffer is not filled with zeros past the copied string length
- These differences make it slightly more efficient, and safer to use since it will
- not leave the destination buffer unterminated. There is no need to pass an artificially
- reduced buffer size to this function (unlike \a strncpy), and the buffer does not need
- to be initialized to zeroes prior to calling this function.
-*/
-AST_INLINE_API(
-void ast_copy_string(char *dst, const char *src, size_t size),
-{
- while (*src && size) {
- *dst++ = *src++;
- size--;
- }
- if (__builtin_expect(!size, 0))
- dst--;
- *dst = '\0';
-}
-)
-
-/*!
- \brief Build a string in a buffer, designed to be called repeatedly
-
- This is a wrapper for snprintf, that properly handles the buffer pointer
- and buffer space available.
-
- \param buffer current position in buffer to place string into (will be updated on return)
- \param space remaining space in buffer (will be updated on return)
- \param fmt printf-style format string
- \return 0 on success, non-zero on failure.
-*/
-int ast_build_string(char **buffer, size_t *space, const char *fmt, ...) __attribute__ ((format (printf, 3, 4)));
-
-/*!
- \brief Build a string in a buffer, designed to be called repeatedly
-
- This is a wrapper for snprintf, that properly handles the buffer pointer
- and buffer space available.
-
- \return 0 on success, non-zero on failure.
- \param buffer current position in buffer to place string into (will be updated on return)
- \param space remaining space in buffer (will be updated on return)
- \param fmt printf-style format string
- \param ap varargs list of arguments for format
-*/
-int ast_build_string_va(char **buffer, size_t *space, const char *fmt, va_list ap);
-
-/*! Make sure something is true */
-/*!
- * Determine if a string containing a boolean value is "true".
- * This function checks to see whether a string passed to it is an indication of an "true" value. It checks to see if the string is "yes", "true", "y", "t", "on" or "1".
- *
- * Returns 0 if val is a NULL pointer, -1 if "true", and 0 otherwise.
- */
-int ast_true(const char *val);
-
-/*! Make sure something is false */
-/*!
- * Determine if a string containing a boolean value is "false".
- * This function checks to see whether a string passed to it is an indication of an "false" value. It checks to see if the string is "no", "false", "n", "f", "off" or "0".
- *
- * Returns 0 if val is a NULL pointer, -1 if "false", and 0 otherwise.
- */
-int ast_false(const char *val);
-
-/* The realloca lets us ast_restrdupa(), but you can't mix any other ast_strdup calls! */
-
-struct ast_realloca {
- char *ptr;
- int alloclen;
-};
-
-#define ast_restrdupa(ra, s) \
- ({ \
- if ((ra)->ptr && strlen(s) + 1 < (ra)->alloclen) { \
- strcpy((ra)->ptr, s); \
- } else { \
- (ra)->ptr = alloca(strlen(s) + 1 - (ra)->alloclen); \
- if ((ra)->ptr) (ra)->alloclen = strlen(s) + 1; \
- } \
- (ra)->ptr; \
- })
-
-#ifndef HAVE_STRCASESTR
-char *strcasestr(const char *, const char *);
-#endif
-
-#if !defined(HAVE_STRNDUP) && !defined(__AST_DEBUG_MALLOC)
-char *strndup(const char *, size_t);
-#endif
-
-#ifndef HAVE_STRNLEN
-size_t strnlen(const char *, size_t);
-#endif
-
-#if !defined(HAVE_VASPRINTF) && !defined(__AST_DEBUG_MALLOC)
-int vasprintf(char **strp, const char *fmt, va_list ap);
-#endif
-
-#ifndef HAVE_STRTOQ
-uint64_t strtoq(const char *nptr, char **endptr, int base);
-#endif
-
-#endif /* _ASTERISK_STRINGS_H */
diff --git a/1.2-netsec/include/asterisk/tdd.h b/1.2-netsec/include/asterisk/tdd.h
deleted file mode 100644
index 66af1e52f..000000000
--- a/1.2-netsec/include/asterisk/tdd.h
+++ /dev/null
@@ -1,82 +0,0 @@
-/*
- * 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.
- */
-
-/*! \file
- * \brief TTY/TDD Generation support
- * \note Includes code and algorithms from the Zapata library.
- */
-
-#ifndef _ASTERISK_TDD_H
-#define _ASTERISK_TDD_H
-
-#define TDD_BYTES_PER_CHAR 2700
-
-struct tdd_state;
-typedef struct tdd_state TDDSTATE;
-
-/*! CallerID Initialization */
-/*!
- * Initializes the TDD system. Mostly stuff for inverse FFT
- */
-extern void tdd_init(void);
-
-/*! Generates a CallerID FSK stream in ulaw format suitable for transmission. */
-/*!
- * \param tdd tdd structure
- * \param buf Buffer to use. This needs to be large enough to accomodate all the generated samples.
- * \param string This is the string to send.
- * This function creates a stream of TDD data in ulaw format. It returns the size
- * (in bytes) of the data (if it returns a size of 0, there is probably an error)
-*/
-extern int tdd_generate(struct tdd_state *tdd, unsigned char *buf, const char *string);
-
-/*! Create a TDD state machine */
-/*!
- * This function returns a malloc'd instance of the tdd_state data structure.
- * Returns a pointer to a malloc'd tdd_state structure, or NULL on error.
- */
-extern struct tdd_state *tdd_new(void);
-
-/*! Read samples into the state machine, and return character (if any). */
-/*!
- * \param tdd Which state machine to act upon
- * \param ubuf containing your samples
- * \param samples number of samples contained within the buffer.
- *
- * Send received audio to the TDD demodulator.
- * Returns -1 on error, 0 for "needs more samples",
- * and > 0 (the character) if reception of a character is complete.
- */
-extern int tdd_feed(struct tdd_state *tdd, unsigned char *ubuf, int samples);
-
-/*! Free a TDD state machine */
-/*!
- * \param tdd This is the tdd_state state machine to free
- * This function frees tdd_state tdd.
- */
-extern void tdd_free(struct tdd_state *tdd);
-
-/*! Generate Echo Canceller diable tone (2100HZ) */
-/*!
- * \param outbuf This is the buffer to receive the tone data
- * \param len This is the length (in samples) of the tone data to generate
- * Returns 0 if no error, and -1 if error.
- */
-extern int ast_tdd_gen_ecdisa(unsigned char *outbuf, int len);
-
-#endif /* _ASTERISK_TDD_H */
diff --git a/1.2-netsec/include/asterisk/term.h b/1.2-netsec/include/asterisk/term.h
deleted file mode 100644
index 499927600..000000000
--- a/1.2-netsec/include/asterisk/term.h
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
- * 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.
- */
-
-/*! \file
- * \brief Handy terminal functions for vt* terms
- */
-
-#ifndef _ASTERISK_TERM_H
-#define _ASTERISK_TERM_H
-
-#if defined(__cplusplus) || defined(c_plusplus)
-extern "C" {
-#endif
-
-#define ESC 0x1b
-#define ATTR_RESET 0
-#define ATTR_BRIGHT 1
-#define ATTR_DIM 2
-#define ATTR_UNDER 4
-#define ATTR_BLINK 5
-#define ATTR_REVER 7
-#define ATTR_HIDDEN 8
-
-#define COLOR_BLACK 30
-#define COLOR_GRAY 30 | 128
-#define COLOR_RED 31
-#define COLOR_BRRED 31 | 128
-#define COLOR_GREEN 32
-#define COLOR_BRGREEN 32 | 128
-#define COLOR_BROWN 33
-#define COLOR_YELLOW 33 | 128
-#define COLOR_BLUE 34
-#define COLOR_BRBLUE 34 | 128
-#define COLOR_MAGENTA 35
-#define COLOR_BRMAGENTA 35 | 128
-#define COLOR_CYAN 36
-#define COLOR_BRCYAN 36 | 128
-#define COLOR_WHITE 37
-#define COLOR_BRWHITE 37 | 128
-
-extern char *term_color(char *outbuf, const char *inbuf, int fgcolor, int bgcolor, int maxout);
-
-extern char *term_color_code(char *outbuf, int fgcolor, int bgcolor, int maxout);
-
-extern char *term_strip(char *outbuf, char *inbuf, int maxout);
-
-extern char *term_prompt(char *outbuf, const char *inbuf, int maxout);
-
-extern char *term_prep(void);
-
-extern char *term_end(void);
-
-extern char *term_quit(void);
-
-#if defined(__cplusplus) || defined(c_plusplus)
-}
-#endif
-
-#endif /* _ASTERISK_TERM_H */
diff --git a/1.2-netsec/include/asterisk/time.h b/1.2-netsec/include/asterisk/time.h
deleted file mode 100644
index 8132e9cd1..000000000
--- a/1.2-netsec/include/asterisk/time.h
+++ /dev/null
@@ -1,143 +0,0 @@
-/*
- * 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.
- */
-
-/*! \file
- * \brief Time-related functions and macros
- */
-
-#ifndef _ASTERISK_TIME_H
-#define _ASTERISK_TIME_H
-
-#include <sys/time.h>
-
-#include "asterisk/inline_api.h"
-
-/* We have to let the compiler learn what types to use for the elements of a
- struct timeval since on linux, it's time_t and suseconds_t, but on *BSD,
- they are just a long. */
-extern struct timeval tv;
-typedef typeof(tv.tv_sec) ast_time_t;
-typedef typeof(tv.tv_usec) ast_suseconds_t;
-
-/*!
- * \brief Computes the difference (in milliseconds) between two \c struct \c timeval instances.
- * \param end the beginning of the time period
- * \param start the end of the time period
- * \return the difference in milliseconds
- */
-AST_INLINE_API(
-int ast_tvdiff_ms(struct timeval end, struct timeval start),
-{
- /* the offset by 1,000,000 below is intentional...
- it avoids differences in the way that division
- is handled for positive and negative numbers, by ensuring
- that the divisor is always positive
- */
- return ((end.tv_sec - start.tv_sec) * 1000) +
- (((1000000 + end.tv_usec - start.tv_usec) / 1000) - 1000);
-}
-)
-
-/*!
- * \brief Returns true if the argument is 0,0
- */
-AST_INLINE_API(
-int ast_tvzero(const struct timeval t),
-{
- return (t.tv_sec == 0 && t.tv_usec == 0);
-}
-)
-
-/*!
- * \brief Compres two \c struct \c timeval instances returning
- * -1, 0, 1 if the first arg is smaller, equal or greater to the second.
- */
-AST_INLINE_API(
-int ast_tvcmp(struct timeval _a, struct timeval _b),
-{
- if (_a.tv_sec < _b.tv_sec)
- return -1;
- if (_a.tv_sec > _b.tv_sec)
- return 1;
- /* now seconds are equal */
- if (_a.tv_usec < _b.tv_usec)
- return -1;
- if (_a.tv_usec > _b.tv_usec)
- return 1;
- return 0;
-}
-)
-
-/*!
- * \brief Returns true if the two \c struct \c timeval arguments are equal.
- */
-AST_INLINE_API(
-int ast_tveq(struct timeval _a, struct timeval _b),
-{
- return (_a.tv_sec == _b.tv_sec && _a.tv_usec == _b.tv_usec);
-}
-)
-
-/*!
- * \brief Returns current timeval. Meant to replace calls to gettimeofday().
- */
-AST_INLINE_API(
-struct timeval ast_tvnow(void),
-{
- struct timeval t;
- gettimeofday(&t, NULL);
- return t;
-}
-)
-
-/*!
- * \brief Returns the sum of two timevals a + b
- */
-struct timeval ast_tvadd(struct timeval a, struct timeval b);
-
-/*!
- * \brief Returns the difference of two timevals a - b
- */
-struct timeval ast_tvsub(struct timeval a, struct timeval b);
-
-/*!
- * \brief Returns a timeval from sec, usec
- */
-AST_INLINE_API(
-struct timeval ast_tv(ast_time_t sec, ast_suseconds_t usec),
-{
- struct timeval t;
- t.tv_sec = sec;
- t.tv_usec = usec;
- return t;
-}
-)
-
-/*!
- * \brief Returns a timeval corresponding to the duration of n samples at rate r.
- * Useful to convert samples to timevals, or even milliseconds to timevals
- * in the form ast_samp2tv(milliseconds, 1000)
- */
-AST_INLINE_API(
-struct timeval ast_samp2tv(unsigned int _nsamp, unsigned int _rate),
-{
- return ast_tv(_nsamp / _rate, (_nsamp % _rate) * (1000000 / _rate));
-}
-)
-
-#endif /* _ASTERISK_TIME_H */
diff --git a/1.2-netsec/include/asterisk/transcap.h b/1.2-netsec/include/asterisk/transcap.h
deleted file mode 100644
index 5da8329dc..000000000
--- a/1.2-netsec/include/asterisk/transcap.h
+++ /dev/null
@@ -1,42 +0,0 @@
-/*
- * Asterisk -- An open source telephony toolkit.
- *
- * Copyright (C) 1999 - 2005, Digium, Inc.
- *
- * Matthew Fredrickson <creslin@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.
- */
-
-/*! \file
- * \brief General Asterisk channel transcoding definitions.
- */
-
-#ifndef _ASTERISK_TRANSCAP_H
-#define _ASTERISK_TRANSCAP_H
-
-/* These definitions are taken directly out of libpri.h and used here.
- * DO NOT change them as it will cause unexpected behavior in channels
- * that utilize these fields.
- */
-
-#define AST_TRANS_CAP_SPEECH 0x0
-#define AST_TRANS_CAP_DIGITAL 0x08
-#define AST_TRANS_CAP_RESTRICTED_DIGITAL 0x09
-#define AST_TRANS_CAP_3_1K_AUDIO 0x10
-#define AST_TRANS_CAP_7K_AUDIO 0x11 /* Depriciated ITU Q.931 (05/1998)*/
-#define AST_TRANS_CAP_DIGITAL_W_TONES 0x11
-#define AST_TRANS_CAP_VIDEO 0x18
-
-#define IS_DIGITAL(cap)\
- (cap) & AST_TRANS_CAP_DIGITAL ? 1 : 0
-
-#endif /* _ASTERISK_TRANSCAP_H */
diff --git a/1.2-netsec/include/asterisk/translate.h b/1.2-netsec/include/asterisk/translate.h
deleted file mode 100644
index 7bb4aa441..000000000
--- a/1.2-netsec/include/asterisk/translate.h
+++ /dev/null
@@ -1,120 +0,0 @@
-/*
- * 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.
- */
-
-/*! \file
- * \brief Translate via the use of pseudo channels
- */
-
-#ifndef _ASTERISK_TRANSLATE_H
-#define _ASTERISK_TRANSLATE_H
-
-#define MAX_FORMAT 32
-
-#if defined(__cplusplus) || defined(c_plusplus)
-extern "C" {
-#endif
-
-#include "asterisk/frame.h"
-#include "asterisk/plc.h"
-
-/* Declared by individual translators */
-struct ast_translator_pvt;
-
-/*! data structure associated with a translator */
-struct ast_translator {
- /*! Name of translator */
- char name[80];
- /*! Source format */
- int srcfmt;
- /*! Destination format */
- int dstfmt;
- /*! Private data associated with the translator */
- struct ast_translator_pvt *(*newpvt)(void);
- /*! Input frame callback */
- int (*framein)(struct ast_translator_pvt *pvt, struct ast_frame *in);
- /*! Output frame callback */
- struct ast_frame * (*frameout)(struct ast_translator_pvt *pvt);
- /*! Destroy translator callback */
- void (*destroy)(struct ast_translator_pvt *pvt);
- /* For performance measurements */
- /*! Generate an example frame */
- struct ast_frame * (*sample)(void);
- /*! Cost in milliseconds for encoding/decoding 1 second of sound */
- int cost;
- /*! For linking, not to be modified by the translator */
- struct ast_translator *next;
-};
-
-struct ast_trans_pvt;
-
-/*! Register a translator */
-/*!
- * \param t populated ast_translator structure
- * This registers a codec translator with asterisk
- * Returns 0 on success, -1 on failure
- */
-extern int ast_register_translator(struct ast_translator *t);
-
-/*! Unregister a translator */
-/*!
- * \param t translator to unregister
- * Unregisters the given tranlator
- * Returns 0 on success, -1 on failure
- */
-extern int ast_unregister_translator(struct ast_translator *t);
-
-/*! Chooses the best translation path */
-/*!
- * Given a list of sources, and a designed destination format, which should
- I choose? Returns 0 on success, -1 if no path could be found. Modifies
- dests and srcs in place
- */
-extern int ast_translator_best_choice(int *dsts, int *srcs);
-
-/*!Builds a translator path */
-/*!
- * \param dest destination format
- * \param source source format
- * Build a path (possibly NULL) from source to dest
- * Returns ast_trans_pvt on success, NULL on failure
- * */
-extern struct ast_trans_pvt *ast_translator_build_path(int dest, int source);
-
-/*! Frees a translator path */
-/*!
- * \param tr translator path to get rid of
- * Frees the given translator path structure
- */
-extern void ast_translator_free_path(struct ast_trans_pvt *tr);
-
-/*! translates one or more frames */
-/*!
- * \param tr translator structure to use for translation
- * \param f frame to translate
- * \param consume Whether or not to free the original frame
- * Apply an input frame into the translator and receive zero or one output frames. Consume
- * determines whether the original frame should be freed
- * Returns an ast_frame of the new translation format on success, NULL on failure
- */
-extern struct ast_frame *ast_translate(struct ast_trans_pvt *tr, struct ast_frame *f, int consume);
-
-#if defined(__cplusplus) || defined(c_plusplus)
-}
-#endif
-
-#endif /* _ASTERISK_TRANSLATE_H */
diff --git a/1.2-netsec/include/asterisk/ulaw.h b/1.2-netsec/include/asterisk/ulaw.h
deleted file mode 100644
index b9edacb97..000000000
--- a/1.2-netsec/include/asterisk/ulaw.h
+++ /dev/null
@@ -1,43 +0,0 @@
-/*
- * 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.
- */
-
-/*! \file
- * \brief u-Law to Signed linear conversion
- */
-
-#ifndef _ASTERISK_ULAW_H
-#define _ASTERISK_ULAW_H
-
-/*! Init the ulaw conversion stuff */
-/*!
- * To init the ulaw to slinear conversion stuff, this needs to be run.
- */
-extern void ast_ulaw_init(void);
-
-/*! converts signed linear to mulaw */
-/*!
- */
-extern unsigned char __ast_lin2mu[16384];
-
-/*! help */
-extern short __ast_mulaw[256];
-
-#define AST_LIN2MU(a) (__ast_lin2mu[((unsigned short)(a)) >> 2])
-#define AST_MULAW(a) (__ast_mulaw[(a)])
-
-#endif /* _ASTERISK_ULAW_H */
diff --git a/1.2-netsec/include/asterisk/unaligned.h b/1.2-netsec/include/asterisk/unaligned.h
deleted file mode 100644
index 16791d6f0..000000000
--- a/1.2-netsec/include/asterisk/unaligned.h
+++ /dev/null
@@ -1,102 +0,0 @@
-/*
- * 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.
- */
-
-/*! \file
- * \brief Handle unaligned data access
- */
-
-#ifndef _ASTERISK_UNALIGNED_H
-#define _ASTERISK_UNALIGNED_H
-
-#if defined(__cplusplus) || defined(c_plusplus)
-extern "C" {
-#endif
-
-#ifdef __GNUC__
-/* If we just tell GCC what's going on, we can trust it to behave optimally */
-static inline unsigned int get_unaligned_uint32(void *p)
-{
- struct { unsigned int d; } __attribute__((packed)) *pp = (void *)p;
-
- return pp->d;
-}
-static inline unsigned short get_unaligned_uint16(void *p)
-{
- struct { unsigned short d; } __attribute__((packed)) *pp = (void *)p;
-
- return pp->d;
-}
-
-static inline void put_unaligned_uint32(void *p, unsigned int datum)
-{
- struct { unsigned int d; } __attribute__((packed)) *pp = (void *)p;
-
- pp->d = datum;
-}
-
-static inline void put_unaligned_uint16(void *p, unsigned short datum)
-{
- struct { unsigned short d; } __attribute__((packed)) *pp = (void *)p;
-
- pp->d = datum;
-}
-#elif defined(SOLARIS) && defined(__sparc__)
-static inline unsigned int get_unaligned_uint32(void *p)
-{
- unsigned char *cp = p;
-
- return (cp[0] << 24) | (cp[1] << 16) | (cp[2] << 8) | cp[3];
-}
-
-static inline unsigned short get_unaligned_uint16(void *p)
-{
- unsigned char *cp = p;
-
- return (cp[0] << 8) | cp[1] ;
-}
-
-static inline void put_unaligned_uint32(void *p, unsigned int datum)
-{
- unsigned char *cp = p;
-
- cp[0] = datum >> 24;
- cp[1] = datum >> 16;
- cp[2] = datum >> 8;
- cp[3] = datum;
-}
-
-static inline void put_unaligned_uint16(void *p, unsigned int datum)
-{
- unsigned char *cp = p;
-
- cp[0] = datum >> 8;
- cp[1] = datum;
-}
-#else /* Not GCC, not Solaris/SPARC. Assume we can handle direct load/store. */
-#define get_unaligned_uint32(p) (*((unsigned int *)(p)))
-#define get_unaligned_uint16(p) (*((unsigned short *)(p)))
-#define put_unaligned_uint32(p,d) do { unsigned int *__P = (p); *__P = d; } while(0)
-#define put_unaligned_uint16(p,d) do { unsigned short *__P = (p); *__P = d; } while(0)
-#endif
-
-#if defined(__cplusplus) || defined(c_plusplus)
-}
-#endif
-
-
-#endif /* _ASTERISK_UNALIGNED_H */
diff --git a/1.2-netsec/include/asterisk/utils.h b/1.2-netsec/include/asterisk/utils.h
deleted file mode 100644
index b6b85df4e..000000000
--- a/1.2-netsec/include/asterisk/utils.h
+++ /dev/null
@@ -1,238 +0,0 @@
-/*
- * 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.
- */
-
-/*! \file
- * \brief Utility functions
- */
-
-#ifndef _ASTERISK_UTILS_H
-#define _ASTERISK_UTILS_H
-
-#include "asterisk/compat.h"
-
-#include <netinet/in.h>
-#include <arpa/inet.h> /* we want to override inet_ntoa */
-#include <netdb.h>
-#include <limits.h>
-
-#include "asterisk/lock.h"
-#include "asterisk/time.h"
-#include "asterisk/strings.h"
-
-/*! \note
- \verbatim
- Note:
- It is very important to use only unsigned variables to hold
- bit flags, as otherwise you can fall prey to the compiler's
- sign-extension antics if you try to use the top two bits in
- your variable.
-
- The flag macros below use a set of compiler tricks to verify
- that the caller is using an "unsigned int" variable to hold
- the flags, and nothing else. If the caller uses any other
- type of variable, a warning message similar to this:
-
- warning: comparison of distinct pointer types lacks cast
- will be generated.
-
- The "dummy" variable below is used to make these comparisons.
-
- Also note that at -O2 or above, this type-safety checking
- does _not_ produce any additional object code at all.
- \endverbatim
-*/
-
-extern unsigned int __unsigned_int_flags_dummy;
-
-#define ast_test_flag(p,flag) ({ \
- typeof ((p)->flags) __p = (p)->flags; \
- typeof (__unsigned_int_flags_dummy) __x = 0; \
- (void) (&__p == &__x); \
- ((p)->flags & (flag)); \
- })
-
-#define ast_set_flag(p,flag) do { \
- typeof ((p)->flags) __p = (p)->flags; \
- typeof (__unsigned_int_flags_dummy) __x = 0; \
- (void) (&__p == &__x); \
- ((p)->flags |= (flag)); \
- } while(0)
-
-#define ast_clear_flag(p,flag) do { \
- typeof ((p)->flags) __p = (p)->flags; \
- typeof (__unsigned_int_flags_dummy) __x = 0; \
- (void) (&__p == &__x); \
- ((p)->flags &= ~(flag)); \
- } while(0)
-
-#define ast_copy_flags(dest,src,flagz) do { \
- typeof ((dest)->flags) __d = (dest)->flags; \
- typeof ((src)->flags) __s = (src)->flags; \
- typeof (__unsigned_int_flags_dummy) __x = 0; \
- (void) (&__d == &__x); \
- (void) (&__s == &__x); \
- (dest)->flags &= ~(flagz); \
- (dest)->flags |= ((src)->flags & (flagz)); \
- } while (0)
-
-#define ast_set2_flag(p,value,flag) do { \
- typeof ((p)->flags) __p = (p)->flags; \
- typeof (__unsigned_int_flags_dummy) __x = 0; \
- (void) (&__p == &__x); \
- if (value) \
- (p)->flags |= (flag); \
- else \
- (p)->flags &= ~(flag); \
- } while (0)
-
-/* Non-type checking variations for non-unsigned int flags. You
- should only use non-unsigned int flags where required by
- protocol etc and if you know what you're doing :) */
-#define ast_test_flag_nonstd(p,flag) ({ \
- ((p)->flags & (flag)); \
- })
-
-#define ast_set_flag_nonstd(p,flag) do { \
- ((p)->flags |= (flag)); \
- } while(0)
-
-#define ast_clear_flag_nonstd(p,flag) do { \
- ((p)->flags &= ~(flag)); \
- } while(0)
-
-#define ast_copy_flags_nonstd(dest,src,flagz) do { \
- (dest)->flags &= ~(flagz); \
- (dest)->flags |= ((src)->flags & (flagz)); \
- } while (0)
-
-#define ast_set2_flag_nonstd(p,value,flag) do { \
- if (value) \
- (p)->flags |= (flag); \
- else \
- (p)->flags &= ~(flag); \
- } while (0)
-
-#define AST_FLAGS_ALL UINT_MAX
-
-struct ast_flags {
- unsigned int flags;
-};
-
-struct ast_hostent {
- struct hostent hp;
- char buf[1024];
-};
-
-struct hostent *ast_gethostbyname(const char *host, struct ast_hostent *hp);
-
-/* ast_md5_hash
- \brief Produces MD5 hash based on input string */
-void ast_md5_hash(char *output, char *input);
-
-int ast_base64encode(char *dst, const unsigned char *src, int srclen, int max);
-int ast_base64decode(unsigned char *dst, const char *src, int max);
-
-/*! ast_uri_encode
- \brief Turn text string to URI-encoded %XX version
- At this point, we're converting from ISO-8859-x (8-bit), not UTF8
- as in the SIP protocol spec
- If doreserved == 1 we will convert reserved characters also.
- RFC 2396, section 2.4
- outbuf needs to have more memory allocated than the instring
- to have room for the expansion. Every char that is converted
- is replaced by three ASCII characters.
- \param string String to be converted
- \param outbuf Resulting encoded string
- \param buflen Size of output buffer
- \param doreserved Convert reserved characters
-*/
-
-char *ast_uri_encode(char *string, char *outbuf, int buflen, int doreserved);
-
-/*! \brief Decode URI, URN, URL (overwrite string)
- \param s String to be decoded
- */
-void ast_uri_decode(char *s);
-
-static force_inline void ast_slinear_saturated_add(short *input, short *value)
-{
- int res;
-
- res = (int) *input + *value;
- if (res > 32767)
- *input = 32767;
- else if (res < -32767)
- *input = -32767;
- else
- *input = (short) res;
-}
-
-static force_inline void ast_slinear_saturated_multiply(short *input, short *value)
-{
- int res;
-
- res = (int) *input * *value;
- if (res > 32767)
- *input = 32767;
- else if (res < -32767)
- *input = -32767;
- else
- *input = (short) res;
-}
-
-static force_inline void ast_slinear_saturated_divide(short *input, short *value)
-{
- *input /= *value;
-}
-
-int test_for_thread_safety(void);
-
-const char *ast_inet_ntoa(char *buf, int bufsiz, struct in_addr ia);
-
-#ifdef inet_ntoa
-#undef inet_ntoa
-#endif
-#define inet_ntoa __dont__use__inet_ntoa__use__ast_inet_ntoa__instead__
-
-int ast_utils_init(void);
-int ast_wait_for_input(int fd, int ms);
-
-/*! Compares the source address and port of two sockaddr_in */
-static force_inline int inaddrcmp(const struct sockaddr_in *sin1, const struct sockaddr_in *sin2)
-{
- return ((sin1->sin_addr.s_addr != sin2->sin_addr.s_addr)
- || (sin1->sin_port != sin2->sin_port));
-}
-
-#define AST_STACKSIZE 256 * 1024
-#define ast_pthread_create(a,b,c,d) ast_pthread_create_stack(a,b,c,d,0)
-int ast_pthread_create_stack(pthread_t *thread, pthread_attr_t *attr, void *(*start_routine)(void *), void *data, size_t stacksize);
-
-/*!
- \brief Process a string to find and replace characters
- \param start The string to analyze
- \param find The character to find
- \param replace_with The character that will replace the one we are looking for
-*/
-char *ast_process_quotes_and_slashes(char *start, char find, char replace_with);
-
-#ifndef HAVE_GETLOADAVG
-int getloadavg(double *list, int nelem);
-#endif
-
-#endif /* _ASTERISK_UTILS_H */
diff --git a/1.2-netsec/include/asterisk/vmodem.h b/1.2-netsec/include/asterisk/vmodem.h
deleted file mode 100644
index 8d700653b..000000000
--- a/1.2-netsec/include/asterisk/vmodem.h
+++ /dev/null
@@ -1,184 +0,0 @@
-/*
- * 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.
- */
-
-/*! \file
- * \brief Voice Modem Definitions
- */
-
-#ifndef _ASTERISK_VMODEM_H
-#define _ASTERISK_VMODEM_H
-
-#include "asterisk/frame.h"
-#include "asterisk/channel.h"
-
-#define CHAR_DLE 0x10
-#define CHAR_ETX 0x03
-#define CHAR_DC4 0x14
-
-#define MODEM_DEV_TELCO 0
-#define MODEM_DEV_TELCO_SPK 4
-#define MODEM_DEV_SPKRPHONE 6
-#define MODEM_DEV_HANDSET 9
-
-#define MODEM_DTMF_NONE (1 << 0)
-#define MODEM_DTMF_AST (1 << 1)
-#define MODEM_DTMF_I4L (1 << 2)
-
-/* Thirty millisecond sections */
-#define MODEM_MAX_LEN 30
-#define MODEM_MAX_BUF MODEM_MAX_LEN * 16
-
-#define AST_MAX_INIT_STR 256
-
-struct ast_modem_pvt;
-
-struct ast_modem_driver {
- char *name;
- char **idents;
- int formats;
- int fullduplex;
- void (*incusecnt)(void);
- void (*decusecnt)(void);
- char * (*identify)(struct ast_modem_pvt *);
- int (*init)(struct ast_modem_pvt *);
- int (*setdev)(struct ast_modem_pvt *, int dev);
- struct ast_frame * (*read)(struct ast_modem_pvt *);
- int (*write)(struct ast_modem_pvt *, struct ast_frame *fr);
- int (*dial)(struct ast_modem_pvt *, char *);
- int (*answer)(struct ast_modem_pvt *);
- int (*hangup)(struct ast_modem_pvt *);
- int (*startrec)(struct ast_modem_pvt *);
- int (*stoprec)(struct ast_modem_pvt *);
- int (*startpb)(struct ast_modem_pvt *);
- int (*stoppb)(struct ast_modem_pvt *);
- int (*setsilence)(struct ast_modem_pvt *, int onoff);
- int (*dialdigit)(struct ast_modem_pvt *, char digit);
- struct ast_modem_driver *next;
-};
-
-#define MODEM_MODE_IMMEDIATE 0
-#define MODEM_MODE_WAIT_RING 1
-#define MODEM_MODE_WAIT_ANSWER 2
-
-/*! Private data that needs to be filled by modem driver */
-struct ast_modem_pvt {
- /*! Raw file descriptor for this device */
- int fd;
- /*! FILE * representation of device */
- FILE *f;
- /*! Channel we belong to, possibly NULL */
- struct ast_channel *owner;
- /* Device name */
- char dev[256];
- /*! Frame */
- struct ast_frame fr;
-
- char offset[AST_FRIENDLY_OFFSET];
- /*! Outgoing buffer */
- char obuf[MODEM_MAX_BUF];
-
- int tail;
- /*! Pulse or tone dialling */
- char dialtype;
- /*! Time to wait for dial timeout */
- char dialtimeout;
-
- int obuflen;
- /*! Immediate, or wait for an answer */
- int mode;
- /*! State of modem in miniature */
- int ministate;
- /*! Digits to strip on outgoing numbers */
- int stripmsd;
- /*! Is the last thing we saw an escape */
- int escape;
- /*! flag to say if has caller*id yet*/
- int gotclid;
- /* Has a fax tone already been handled? */
- int faxhandled;
- /*! ringer timeout */
- int ringt;
- /*! actual time of last ring */
- time_t lastring;
- /*! dtmf receive state/data */
- char dtmfrx;
-
- char context[AST_MAX_EXTENSION];
- /*! Multiple Subscriber Number */
- char msn[AST_MAX_EXTENSION];
- /*! Multiple Subscriber Number we listen to (; separated list) */
- char incomingmsn[AST_MAX_EXTENSION];
- /*! Multiple Subscriber Number we accept for outgoing calls (; separated list) */
- char outgoingmsn[AST_MAX_EXTENSION];
- /*! Group(s) we belong to if available */
- ast_group_t group;
- /*! Caller ID if available */
- char cid_name[AST_MAX_EXTENSION];
- /*! Caller ID if available */
- char cid_num[AST_MAX_EXTENSION];
- /*! DTMF-detection mode (i4l/asterisk) */
- int dtmfmode;
- /*! DTMF-generation mode (i4l (outband) / asterisk (inband) */
- int dtmfmodegen;
- /*! DSP for DTMF detection */
- struct ast_dsp *dsp;
- /*! Dialed Number if available */
- char dnid[AST_MAX_EXTENSION];
- /*! Modem initialization String */
- char initstr[AST_MAX_INIT_STR];
- /*! default language */
- char language[MAX_LANGUAGE];
- /*! Static response buffer */
- char response[256];
- /*! Modem Capability */
- struct ast_modem_driver *mc;
- /*! Next channel in list */
- struct ast_modem_pvt *next;
-};
-
-
-/*! Register a modem driver */
-/*! Register a driver */
-extern int ast_register_modem_driver(struct ast_modem_driver *mc);
-
-/*! Unregisters a modem driver */
-/*! Unregister a driver */
-extern int ast_unregister_modem_driver(struct ast_modem_driver *mc);
-
-/*! Sends command */
-/*! Send the command cmd (length len, or 0 if pure ascii) on modem */
-extern int ast_modem_send(struct ast_modem_pvt *p, char *cmd, int len);
-
-/*! Waits for result */
-/*! Wait for result to occur. Return non-zero if times out or error, last
- response is stored in p->response */
-extern int ast_modem_expect(struct ast_modem_pvt *p, char *result, int timeout);
-
-/*! Waits for result */
-/*! Wait for result to occur. response is stored in p->response */
-extern int ast_modem_read_response(struct ast_modem_pvt *p, int timeout);
-
-/*! Used to start up the PBX on a RING */
-/*! Used by modem drivers to start up the PBX on a RING */
-extern struct ast_channel *ast_modem_new(struct ast_modem_pvt *i, int state);
-
-/*! Trim string of trailing stuff */
-/*! Trim off trailing mess */
-extern void ast_modem_trim(char *s);
-
-#endif /* _ASTERISK_VMODEM_H */
diff --git a/1.2-netsec/include/solaris-compat/compat.h b/1.2-netsec/include/solaris-compat/compat.h
deleted file mode 100644
index b34cf11f4..000000000
--- a/1.2-netsec/include/solaris-compat/compat.h
+++ /dev/null
@@ -1,46 +0,0 @@
-#ifndef _SOLARIS_COMPAT_H
-#define _SOLARIS_COMPAT_H
-
-#define __BEGIN_DECLS
-#define __END_DECLS
-
-#ifndef __P
-#define __P(p) p
-#endif
-
-#include <alloca.h>
-#include <strings.h>
-#include <string.h>
-#include <pthread.h>
-#include <sys/stat.h>
-#include <signal.h>
-#include <netinet/in.h>
-
-#ifndef BYTE_ORDER
-#define LITTLE_ENDIAN 1234
-#define BIG_ENDIAN 4321
-
-#ifdef __sparc__
-#define BYTE_ORDER BIG_ENDIAN
-#else
-#define BYTE_ORDER LITTLE_ENDIAN
-#endif
-#endif
-
-#ifndef __BYTE_ORDER
-#define __LITTLE_ENDIAN LITTLE_ENDIAN
-#define __BIG_ENDIAN BIG_ENDIAN
-#define __BYTE_ORDER BYTE_ORDER
-#endif
-
-#ifndef __BIT_TYPES_DEFINED__
-#define __BIT_TYPES_DEFINED__
-typedef unsigned char u_int8_t;
-typedef unsigned short u_int16_t;
-typedef unsigned int u_int32_t;
-#endif
-
-char* strsep(char** str, const char* delims);
-int setenv(const char *name, const char *value, int overwrite);
-int unsetenv(const char *name);
-#endif
diff --git a/1.2-netsec/include/solaris-compat/sys/cdefs.h b/1.2-netsec/include/solaris-compat/sys/cdefs.h
deleted file mode 100644
index 40f76af87..000000000
--- a/1.2-netsec/include/solaris-compat/sys/cdefs.h
+++ /dev/null
@@ -1,10 +0,0 @@
-#ifndef __SYS_CDEFS_H_
-#define __SYS_CDEFS_H_
-
-#define __BEGIN_DECLS
-#define __END_DECLS
-
-#define __P(p) p
-
-
-#endif
diff --git a/1.2-netsec/include/solaris-compat/sys/queue.h b/1.2-netsec/include/solaris-compat/sys/queue.h
deleted file mode 100644
index ac273dfe3..000000000
--- a/1.2-netsec/include/solaris-compat/sys/queue.h
+++ /dev/null
@@ -1,540 +0,0 @@
-/*
- * Copyright (c) 1991, 1993
- * The Regents of the University of California. All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. All advertising materials mentioning features or use of this software
- * must display the following acknowledgement:
- * This product includes software developed by the University of
- * California, Berkeley and its contributors.
- * 4. Neither the name of the University nor the names of its contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- *
- * @(#)queue.h 8.5 (Berkeley) 8/20/94
- * $FreeBSD: src/sys/sys/queue.h,v 1.24.2.4 2000/05/05 01:41:41 archie Exp $
- */
-
-#ifndef _SYS_QUEUE_H_
-#define _SYS_QUEUE_H_
-
-/*
- * This file defines five types of data structures: singly-linked lists,
- * singly-linked tail queues, lists, tail queues, and circular queues.
- *
- * A singly-linked list is headed by a single forward pointer. The elements
- * are singly linked for minimum space and pointer manipulation overhead at
- * the expense of O(n) removal for arbitrary elements. New elements can be
- * added to the list after an existing element or at the head of the list.
- * Elements being removed from the head of the list should use the explicit
- * macro for this purpose for optimum efficiency. A singly-linked list may
- * only be traversed in the forward direction. Singly-linked lists are ideal
- * for applications with large datasets and few or no removals or for
- * implementing a LIFO queue.
- *
- * A singly-linked tail queue is headed by a pair of pointers, one to the
- * head of the list and the other to the tail of the list. The elements are
- * singly linked for minimum space and pointer manipulation overhead at the
- * expense of O(n) removal for arbitrary elements. New elements can be added
- * to the list after an existing element, at the head of the list, or at the
- * end of the list. Elements being removed from the head of the tail queue
- * should use the explicit macro for this purpose for optimum efficiency.
- * A singly-linked tail queue may only be traversed in the forward direction.
- * Singly-linked tail queues are ideal for applications with large datasets
- * and few or no removals or for implementing a FIFO queue.
- *
- * A list is headed by a single forward pointer (or an array of forward
- * pointers for a hash table header). The elements are doubly linked
- * so that an arbitrary element can be removed without a need to
- * traverse the list. New elements can be added to the list before
- * or after an existing element or at the head of the list. A list
- * may only be traversed in the forward direction.
- *
- * A tail queue is headed by a pair of pointers, one to the head of the
- * list and the other to the tail of the list. The elements are doubly
- * linked so that an arbitrary element can be removed without a need to
- * traverse the list. New elements can be added to the list before or
- * after an existing element, at the head of the list, or at the end of
- * the list. A tail queue may be traversed in either direction.
- *
- * A circle queue is headed by a pair of pointers, one to the head of the
- * list and the other to the tail of the list. The elements are doubly
- * linked so that an arbitrary element can be removed without a need to
- * traverse the list. New elements can be added to the list before or after
- * an existing element, at the head of the list, or at the end of the list.
- * A circle queue may be traversed in either direction, but has a more
- * complex end of list detection.
- *
- * For details on the use of these macros, see the queue(3) manual page.
- *
- *
- * SLIST LIST STAILQ TAILQ CIRCLEQ
- * _HEAD + + + + +
- * _ENTRY + + + + +
- * _INIT + + + + +
- * _EMPTY + + + + +
- * _FIRST + + + + +
- * _NEXT + + + + +
- * _PREV - - - + +
- * _LAST - - + + +
- * _FOREACH + + + + +
- * _FOREACH_REVERSE - - - + +
- * _INSERT_HEAD + + + + +
- * _INSERT_BEFORE - + - + +
- * _INSERT_AFTER + + + + +
- * _INSERT_TAIL - - + + +
- * _REMOVE_HEAD + - + - -
- * _REMOVE + + + + +
- *
- */
-
-/*
- * Singly-linked List definitions.
- */
-#define SLIST_HEAD(name, type) \
-struct name { \
- struct type *slh_first; /* first element */ \
-}
-
-#define SLIST_HEAD_INITIALIZER(head) \
- { NULL }
-
-#define SLIST_ENTRY(type) \
-struct { \
- struct type *sle_next; /* next element */ \
-}
-
-/*
- * Singly-linked List functions.
- */
-#define SLIST_EMPTY(head) ((head)->slh_first == NULL)
-
-#define SLIST_FIRST(head) ((head)->slh_first)
-
-#define SLIST_FOREACH(var, head, field) \
- for((var) = (head)->slh_first; (var); (var) = (var)->field.sle_next)
-
-#define SLIST_INIT(head) { \
- (head)->slh_first = NULL; \
-}
-
-#define SLIST_INSERT_AFTER(slistelm, elm, field) do { \
- (elm)->field.sle_next = (slistelm)->field.sle_next; \
- (slistelm)->field.sle_next = (elm); \
-} while (0)
-
-#define SLIST_INSERT_HEAD(head, elm, field) do { \
- (elm)->field.sle_next = (head)->slh_first; \
- (head)->slh_first = (elm); \
-} while (0)
-
-#define SLIST_NEXT(elm, field) ((elm)->field.sle_next)
-
-#define SLIST_REMOVE_HEAD(head, field) do { \
- (head)->slh_first = (head)->slh_first->field.sle_next; \
-} while (0)
-
-#define SLIST_REMOVE(head, elm, type, field) do { \
- if ((head)->slh_first == (elm)) { \
- SLIST_REMOVE_HEAD((head), field); \
- } \
- else { \
- struct type *curelm = (head)->slh_first; \
- while( curelm->field.sle_next != (elm) ) \
- curelm = curelm->field.sle_next; \
- curelm->field.sle_next = \
- curelm->field.sle_next->field.sle_next; \
- } \
-} while (0)
-
-/*
- * Singly-linked Tail queue definitions.
- */
-#define STAILQ_HEAD(name, type) \
-struct name { \
- struct type *stqh_first;/* first element */ \
- struct type **stqh_last;/* addr of last next element */ \
-}
-
-#define STAILQ_HEAD_INITIALIZER(head) \
- { NULL, &(head).stqh_first }
-
-#define STAILQ_ENTRY(type) \
-struct { \
- struct type *stqe_next; /* next element */ \
-}
-
-/*
- * Singly-linked Tail queue functions.
- */
-#define STAILQ_EMPTY(head) ((head)->stqh_first == NULL)
-
-#define STAILQ_INIT(head) do { \
- (head)->stqh_first = NULL; \
- (head)->stqh_last = &(head)->stqh_first; \
-} while (0)
-
-#define STAILQ_FIRST(head) ((head)->stqh_first)
-#define STAILQ_LAST(head) (*(head)->stqh_last)
-
-#define STAILQ_FOREACH(var, head, field) \
- for((var) = (head)->stqh_first; (var); (var) = (var)->field.stqe_next)
-
-#define STAILQ_INSERT_HEAD(head, elm, field) do { \
- if (((elm)->field.stqe_next = (head)->stqh_first) == NULL) \
- (head)->stqh_last = &(elm)->field.stqe_next; \
- (head)->stqh_first = (elm); \
-} while (0)
-
-#define STAILQ_INSERT_TAIL(head, elm, field) do { \
- (elm)->field.stqe_next = NULL; \
- *(head)->stqh_last = (elm); \
- (head)->stqh_last = &(elm)->field.stqe_next; \
-} while (0)
-
-#define STAILQ_INSERT_AFTER(head, tqelm, elm, field) do { \
- if (((elm)->field.stqe_next = (tqelm)->field.stqe_next) == NULL)\
- (head)->stqh_last = &(elm)->field.stqe_next; \
- (tqelm)->field.stqe_next = (elm); \
-} while (0)
-
-#define STAILQ_NEXT(elm, field) ((elm)->field.stqe_next)
-
-#define STAILQ_REMOVE_HEAD(head, field) do { \
- if (((head)->stqh_first = \
- (head)->stqh_first->field.stqe_next) == NULL) \
- (head)->stqh_last = &(head)->stqh_first; \
-} while (0)
-
-#define STAILQ_REMOVE_HEAD_UNTIL(head, elm, field) do { \
- if (((head)->stqh_first = (elm)->field.stqe_next) == NULL) \
- (head)->stqh_last = &(head)->stqh_first; \
-} while (0)
-
-#define STAILQ_REMOVE(head, elm, type, field) do { \
- if ((head)->stqh_first == (elm)) { \
- STAILQ_REMOVE_HEAD(head, field); \
- } \
- else { \
- struct type *curelm = (head)->stqh_first; \
- while( curelm->field.stqe_next != (elm) ) \
- curelm = curelm->field.stqe_next; \
- if((curelm->field.stqe_next = \
- curelm->field.stqe_next->field.stqe_next) == NULL) \
- (head)->stqh_last = &(curelm)->field.stqe_next; \
- } \
-} while (0)
-
-/*
- * List definitions.
- */
-#define LIST_HEAD(name, type) \
-struct name { \
- struct type *lh_first; /* first element */ \
-}
-
-#define LIST_HEAD_INITIALIZER(head) \
- { NULL }
-
-#define LIST_ENTRY(type) \
-struct { \
- struct type *le_next; /* next element */ \
- struct type **le_prev; /* address of previous next element */ \
-}
-
-/*
- * List functions.
- */
-
-#define LIST_EMPTY(head) ((head)->lh_first == NULL)
-
-#define LIST_FIRST(head) ((head)->lh_first)
-
-#define LIST_FOREACH(var, head, field) \
- for((var) = (head)->lh_first; (var); (var) = (var)->field.le_next)
-
-#define LIST_INIT(head) do { \
- (head)->lh_first = NULL; \
-} while (0)
-
-#define LIST_INSERT_AFTER(listelm, elm, field) do { \
- if (((elm)->field.le_next = (listelm)->field.le_next) != NULL) \
- (listelm)->field.le_next->field.le_prev = \
- &(elm)->field.le_next; \
- (listelm)->field.le_next = (elm); \
- (elm)->field.le_prev = &(listelm)->field.le_next; \
-} while (0)
-
-#define LIST_INSERT_BEFORE(listelm, elm, field) do { \
- (elm)->field.le_prev = (listelm)->field.le_prev; \
- (elm)->field.le_next = (listelm); \
- *(listelm)->field.le_prev = (elm); \
- (listelm)->field.le_prev = &(elm)->field.le_next; \
-} while (0)
-
-#define LIST_INSERT_HEAD(head, elm, field) do { \
- if (((elm)->field.le_next = (head)->lh_first) != NULL) \
- (head)->lh_first->field.le_prev = &(elm)->field.le_next;\
- (head)->lh_first = (elm); \
- (elm)->field.le_prev = &(head)->lh_first; \
-} while (0)
-
-#define LIST_NEXT(elm, field) ((elm)->field.le_next)
-
-#define LIST_REMOVE(elm, field) do { \
- if ((elm)->field.le_next != NULL) \
- (elm)->field.le_next->field.le_prev = \
- (elm)->field.le_prev; \
- *(elm)->field.le_prev = (elm)->field.le_next; \
-} while (0)
-
-/*
- * Tail queue definitions.
- */
-#define TAILQ_HEAD(name, type) \
-struct name { \
- struct type *tqh_first; /* first element */ \
- struct type **tqh_last; /* addr of last next element */ \
-}
-
-#define TAILQ_HEAD_INITIALIZER(head) \
- { NULL, &(head).tqh_first }
-
-#define TAILQ_ENTRY(type) \
-struct { \
- struct type *tqe_next; /* next element */ \
- struct type **tqe_prev; /* address of previous next element */ \
-}
-
-/*
- * Tail queue functions.
- */
-#define TAILQ_EMPTY(head) ((head)->tqh_first == NULL)
-
-#define TAILQ_FOREACH(var, head, field) \
- for (var = TAILQ_FIRST(head); var; var = TAILQ_NEXT(var, field))
-
-#define TAILQ_FOREACH_REVERSE(var, head, headname, field) \
- for ((var) = TAILQ_LAST((head), headname); \
- (var); \
- (var) = TAILQ_PREV((var), headname, field))
-
-#define TAILQ_FIRST(head) ((head)->tqh_first)
-
-#define TAILQ_LAST(head, headname) \
- (*(((struct headname *)((head)->tqh_last))->tqh_last))
-
-#define TAILQ_NEXT(elm, field) ((elm)->field.tqe_next)
-
-#define TAILQ_PREV(elm, headname, field) \
- (*(((struct headname *)((elm)->field.tqe_prev))->tqh_last))
-
-#define TAILQ_INIT(head) do { \
- (head)->tqh_first = NULL; \
- (head)->tqh_last = &(head)->tqh_first; \
-} while (0)
-
-#define TAILQ_INSERT_HEAD(head, elm, field) do { \
- if (((elm)->field.tqe_next = (head)->tqh_first) != NULL) \
- (head)->tqh_first->field.tqe_prev = \
- &(elm)->field.tqe_next; \
- else \
- (head)->tqh_last = &(elm)->field.tqe_next; \
- (head)->tqh_first = (elm); \
- (elm)->field.tqe_prev = &(head)->tqh_first; \
-} while (0)
-
-#define TAILQ_INSERT_TAIL(head, elm, field) do { \
- (elm)->field.tqe_next = NULL; \
- (elm)->field.tqe_prev = (head)->tqh_last; \
- *(head)->tqh_last = (elm); \
- (head)->tqh_last = &(elm)->field.tqe_next; \
-} while (0)
-
-#define TAILQ_INSERT_AFTER(head, listelm, elm, field) do { \
- if (((elm)->field.tqe_next = (listelm)->field.tqe_next) != NULL)\
- (elm)->field.tqe_next->field.tqe_prev = \
- &(elm)->field.tqe_next; \
- else \
- (head)->tqh_last = &(elm)->field.tqe_next; \
- (listelm)->field.tqe_next = (elm); \
- (elm)->field.tqe_prev = &(listelm)->field.tqe_next; \
-} while (0)
-
-#define TAILQ_INSERT_BEFORE(listelm, elm, field) do { \
- (elm)->field.tqe_prev = (listelm)->field.tqe_prev; \
- (elm)->field.tqe_next = (listelm); \
- *(listelm)->field.tqe_prev = (elm); \
- (listelm)->field.tqe_prev = &(elm)->field.tqe_next; \
-} while (0)
-
-#define TAILQ_REMOVE(head, elm, field) do { \
- if (((elm)->field.tqe_next) != NULL) \
- (elm)->field.tqe_next->field.tqe_prev = \
- (elm)->field.tqe_prev; \
- else \
- (head)->tqh_last = (elm)->field.tqe_prev; \
- *(elm)->field.tqe_prev = (elm)->field.tqe_next; \
-} while (0)
-
-/*
- * Circular queue definitions.
- */
-#define CIRCLEQ_HEAD(name, type) \
-struct name { \
- struct type *cqh_first; /* first element */ \
- struct type *cqh_last; /* last element */ \
-}
-
-#define CIRCLEQ_ENTRY(type) \
-struct { \
- struct type *cqe_next; /* next element */ \
- struct type *cqe_prev; /* previous element */ \
-}
-
-/*
- * Circular queue functions.
- */
-#define CIRCLEQ_EMPTY(head) ((head)->cqh_first == (void *)(head))
-
-#define CIRCLEQ_FIRST(head) ((head)->cqh_first)
-
-#define CIRCLEQ_FOREACH(var, head, field) \
- for((var) = (head)->cqh_first; \
- (var) != (void *)(head); \
- (var) = (var)->field.cqe_next)
-
-#define CIRCLEQ_FOREACH_REVERSE(var, head, field) \
- for((var) = (head)->cqh_last; \
- (var) != (void *)(head); \
- (var) = (var)->field.cqe_prev)
-
-#define CIRCLEQ_INIT(head) do { \
- (head)->cqh_first = (void *)(head); \
- (head)->cqh_last = (void *)(head); \
-} while (0)
-
-#define CIRCLEQ_INSERT_AFTER(head, listelm, elm, field) do { \
- (elm)->field.cqe_next = (listelm)->field.cqe_next; \
- (elm)->field.cqe_prev = (listelm); \
- if ((listelm)->field.cqe_next == (void *)(head)) \
- (head)->cqh_last = (elm); \
- else \
- (listelm)->field.cqe_next->field.cqe_prev = (elm); \
- (listelm)->field.cqe_next = (elm); \
-} while (0)
-
-#define CIRCLEQ_INSERT_BEFORE(head, listelm, elm, field) do { \
- (elm)->field.cqe_next = (listelm); \
- (elm)->field.cqe_prev = (listelm)->field.cqe_prev; \
- if ((listelm)->field.cqe_prev == (void *)(head)) \
- (head)->cqh_first = (elm); \
- else \
- (listelm)->field.cqe_prev->field.cqe_next = (elm); \
- (listelm)->field.cqe_prev = (elm); \
-} while (0)
-
-#define CIRCLEQ_INSERT_HEAD(head, elm, field) do { \
- (elm)->field.cqe_next = (head)->cqh_first; \
- (elm)->field.cqe_prev = (void *)(head); \
- if ((head)->cqh_last == (void *)(head)) \
- (head)->cqh_last = (elm); \
- else \
- (head)->cqh_first->field.cqe_prev = (elm); \
- (head)->cqh_first = (elm); \
-} while (0)
-
-#define CIRCLEQ_INSERT_TAIL(head, elm, field) do { \
- (elm)->field.cqe_next = (void *)(head); \
- (elm)->field.cqe_prev = (head)->cqh_last; \
- if ((head)->cqh_first == (void *)(head)) \
- (head)->cqh_first = (elm); \
- else \
- (head)->cqh_last->field.cqe_next = (elm); \
- (head)->cqh_last = (elm); \
-} while (0)
-
-#define CIRCLEQ_LAST(head) ((head)->cqh_last)
-
-#define CIRCLEQ_NEXT(elm,field) ((elm)->field.cqe_next)
-
-#define CIRCLEQ_PREV(elm,field) ((elm)->field.cqe_prev)
-
-#define CIRCLEQ_REMOVE(head, elm, field) do { \
- if ((elm)->field.cqe_next == (void *)(head)) \
- (head)->cqh_last = (elm)->field.cqe_prev; \
- else \
- (elm)->field.cqe_next->field.cqe_prev = \
- (elm)->field.cqe_prev; \
- if ((elm)->field.cqe_prev == (void *)(head)) \
- (head)->cqh_first = (elm)->field.cqe_next; \
- else \
- (elm)->field.cqe_prev->field.cqe_next = \
- (elm)->field.cqe_next; \
-} while (0)
-
-#ifdef KERNEL
-
-/*
- * XXX insque() and remque() are an old way of handling certain queues.
- * They bogusly assumes that all queue heads look alike.
- */
-
-struct quehead {
- struct quehead *qh_link;
- struct quehead *qh_rlink;
-};
-
-#ifdef __GNUC__
-
-static __inline void
-insque(void *a, void *b)
-{
- struct quehead *element = a, *head = b;
-
- element->qh_link = head->qh_link;
- element->qh_rlink = head;
- head->qh_link = element;
- element->qh_link->qh_rlink = element;
-}
-
-static __inline void
-remque(void *a)
-{
- struct quehead *element = a;
-
- element->qh_link->qh_rlink = element->qh_rlink;
- element->qh_rlink->qh_link = element->qh_link;
- element->qh_rlink = 0;
-}
-
-#else /* !__GNUC__ */
-
-void insque __P((void *a, void *b));
-void remque __P((void *a));
-
-#endif /* __GNUC__ */
-
-#endif /* KERNEL */
-
-#endif /* !_SYS_QUEUE_H_ */
-