Index: cryptostub.c
===================================================================
--- cryptostub.c	(revision 7472)
+++ cryptostub.c	(working copy)
@@ -1,84 +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.
- */
-
-#include <unistd.h>
-#include <stdlib.h>
-
-#include "asterisk/crypto.h"
-#include "asterisk/logger.h"
-
-/* Hrm, I wonder if the compiler is smart enough to only create two functions
-   for all these...  I could force it to only make two, but those would be some
-   really nasty looking casts. */
-   
-static struct ast_key *stub_ast_key_get(const char *kname, int ktype)
-{
-	ast_log(LOG_NOTICE, "Crypto support not loaded!\n");
-	return NULL;
-}
-
-static int stub_ast_check_signature(struct ast_key *key, const char *msg, const char *sig)
-{
-	ast_log(LOG_NOTICE, "Crypto support not loaded!\n");
-	return -1;
-}
-
-static int stub_ast_check_signature_bin(struct ast_key *key, const char *msg, int msglen, const unsigned char *sig)
-{
-	ast_log(LOG_NOTICE, "Crypto support not loaded!\n");
-	return -1;
-}
-
-static int stub_ast_sign(struct ast_key *key, char *msg, char *sig) 
-{
-	ast_log(LOG_NOTICE, "Crypto support not loaded!\n");
-	return -1;
-}
-
-static int stub_ast_sign_bin(struct ast_key *key, const char *msg, int msglen, unsigned char *sig)
-{
-	ast_log(LOG_NOTICE, "Crypto support not loaded!\n");
-	return -1;
-}
-
-static int stub_ast_encdec_bin(unsigned char *dst, const unsigned char *src, int srclen, struct ast_key *key)
-{
-	ast_log(LOG_NOTICE, "Crypto support not loaded!\n");
-	return -1;
-}
-
-struct ast_key *(*ast_key_get)(const char *key, int type) = 
-	stub_ast_key_get;
-
-int (*ast_check_signature)(struct ast_key *key, const char *msg, const char *sig) =
-	stub_ast_check_signature;
-	
-int (*ast_check_signature_bin)(struct ast_key *key, const char *msg, int msglen, const unsigned char *sig) =
-	stub_ast_check_signature_bin;
-	
-int (*ast_sign)(struct ast_key *key, char *msg, char *sig) = 
-	stub_ast_sign;
-
-int (*ast_sign_bin)(struct ast_key *key, const char *msg, int msglen, unsigned char *sig) =
-	stub_ast_sign_bin;
-	
-int (*ast_encrypt_bin)(unsigned char *dst, const unsigned char *src, int srclen, struct ast_key *key) =
-	stub_ast_encdec_bin;
-
-int (*ast_decrypt_bin)(unsigned char *dst, const unsigned char *src, int srclen, struct ast_key *key) =
-	stub_ast_encdec_bin;
Index: include/asterisk/adsi.h
===================================================================
--- include/asterisk/adsi.h	(revision 7472)
+++ include/asterisk/adsi.h	(working copy)
@@ -127,9 +127,9 @@
  */
 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_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);
+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 */
@@ -140,7 +140,7 @@
  * Returns 0 on success (or adsi unavailable) and -1 on hangup
  *
  */
-extern int adsi_channel_restore(struct ast_channel *chan);
+extern int (*adsi_channel_restore)(struct ast_channel *chan);
 
 /*! Display some stuff on the screen */
 /*!
@@ -152,7 +152,7 @@
  * 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);
+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. */
@@ -165,18 +165,18 @@
  * 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);
+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);
+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);
+extern int (*adsi_read_encoded_dtmf)(struct ast_channel *chan, unsigned char *buf, int maxlen);
 
 /* ADSI Layer 3 creation functions */
 
@@ -190,14 +190,14 @@
  *
  */
 
-extern int adsi_connect_session(unsigned char *buf, unsigned char *fdn, int ver);
+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);
+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. */
 /*!
@@ -205,9 +205,9 @@
  * 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_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);
+extern int (*adsi_get_cpeinfo)(struct ast_channel *chan, int *width, int *height, int *buttons, int voice);
 
 /*! Begin an ADSI script download */ 
 /*!
@@ -221,7 +221,7 @@
  *
  */
 
-extern int adsi_download_connect(unsigned char *buf, char *service, unsigned char *fdn, unsigned char *sec, int ver);
+extern int (*adsi_download_connect)(unsigned char *buf, char *service, unsigned char *fdn, unsigned char *sec, int ver);
 
 /*! Disconnects a running session */
 /*!
@@ -230,7 +230,7 @@
  * Returns number of bytes added to buffer or -1 on error.
  *
  */
-extern int adsi_disconnect_session(unsigned char *buf);
+extern int (*adsi_disconnect_session)(unsigned char *buf);
 
 /*! Disconnects (and hopefully saves) a downloaded script */
 /*!
@@ -239,7 +239,7 @@
  * Returns number of bytes added to buffer or -1 on error.
  *
  */
-extern int adsi_download_disconnect(unsigned char *buf);
+extern int (*adsi_download_disconnect)(unsigned char *buf);
 
 /*! Puts CPE in data mode... */
 /*!
@@ -248,9 +248,9 @@
  * 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);
+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... */
 /*!
@@ -260,14 +260,14 @@
  * Returns number of bytes added to buffer or -1 on error.
  *
  */
-extern int adsi_voice_mode(unsigned char *buf, int when);
+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);
+extern int (*adsi_available)(struct ast_channel *chan);
 
 /*! Loads a line of info into the display */ 
 /*!
@@ -283,7 +283,7 @@
  *
  */
 
-extern int adsi_display(unsigned char *buf, int page, int line, int just, int wrap, char *col1, char *col2);
+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 */ 
 /*!
@@ -295,7 +295,7 @@
  *
  */
 
-extern int adsi_set_line(unsigned char *buf, int page, int line);
+extern int (*adsi_set_line)(unsigned char *buf, int page, int line);
 
 /*! Creates "load soft key" parameters */
 /*! 
@@ -309,7 +309,7 @@
  * 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);
+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 */
 /*!
@@ -320,7 +320,7 @@
  * Returns number of bytes added to buffer or -1 on error.
  *
  */
-extern int adsi_set_keys(unsigned char *buf, unsigned char *keys);
+extern int (*adsi_set_keys)(unsigned char *buf, unsigned char *keys);
 
 /*! Set input information */
 /*!
@@ -334,7 +334,7 @@
  * 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);
+extern int (*adsi_input_control)(unsigned char *buf, int page, int line, int display, int format, int just);
 
 /*! Set input format */
 /*!
@@ -348,6 +348,6 @@
  * 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);
+extern int (*adsi_input_format)(unsigned char *buf, int num, int dir, int wrap, char *format1, char *format2);
 
 #endif /* _ASTERISK_ADSI_H */
Index: include/asterisk/features.h
===================================================================
--- include/asterisk/features.h	(revision 7472)
+++ include/asterisk/features.h	(working copy)
@@ -56,7 +56,7 @@
 	\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);
+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
@@ -66,30 +66,30 @@
 	\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);
+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);
+extern char *(*ast_parking_ext)(void);
 
 /*! \brief Determine system call pickup extension */
-extern char *ast_pickup_ext(void);
+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);
+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);
+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);
+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);
+extern void (*ast_unregister_feature)(struct ast_call_feature *feature);
 
 #endif /* _AST_FEATURES_H */
Index: include/asterisk/monitor.h
===================================================================
--- include/asterisk/monitor.h	(revision 7472)
+++ include/asterisk/monitor.h	(working copy)
@@ -41,16 +41,16 @@
 };
 
 /* Start monitoring a channel */
-int ast_monitor_start(struct ast_channel *chan, const char *format_spec,
+extern 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);
+extern 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,
+extern 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);
+extern void (*ast_monitor_setjoinfiles)(struct ast_channel *chan, int turnon);
 
 #endif /* _ASTERISK_MONITOR_H */
Index: Makefile
===================================================================
--- Makefile	(revision 7472)
+++ Makefile	(working copy)
@@ -343,7 +343,8 @@
 	astmm.o enum.o srv.o dns.o aescrypt.o aestab.o aeskey.o \
 	utils.o plc.o jitterbuf.o dnsmgr.o devicestate.o \
 	netsock.o slinfactory.o ast_expr2.o ast_expr2f.o \
-	cryptostub.o
+	stubfunctions-adsi.o stubfunctions-crypto.o \
+	stubfunctions-features.o stubfunctions-monitor.o
 
 ifeq ($(wildcard $(CROSS_COMPILE_TARGET)/usr/include/sys/poll.h),)
   OBJS+= poll.o
Index: res/res_adsi.c
===================================================================
--- res/res_adsi.c	(revision 7472)
+++ res/res_adsi.c	(working copy)
@@ -66,6 +66,12 @@
 
 static int alignment = 0;
 
+static int __adsi_transmit_message_full(struct ast_channel *, unsigned char *, int, int, int);
+static int __adsi_download_connect(unsigned char *, char *,  unsigned char *, unsigned char *, int);
+static int __adsi_data_mode(unsigned char *);
+static int __adsi_voice_mode(unsigned char *, int);
+static int __adsi_download_disconnect(unsigned char *);
+
 static int adsi_generate(unsigned char *buf, int msgtype, unsigned char *msg, int msglen, int msgnum, int last, int codec)
 {
 	int sum;
@@ -316,7 +322,7 @@
 	
 }
 
-int adsi_begin_download(struct ast_channel *chan, char *service, unsigned char *fdn, unsigned char *sec, int version)
+static int __adsi_begin_download(struct ast_channel *chan, char *service, unsigned char *fdn, unsigned char *sec, int version)
 {
 	int bytes;
 	unsigned char buf[256];
@@ -324,8 +330,8 @@
 	bytes = 0;
 	/* Setup the resident soft key stuff, a piece at a time */
 	/* Upload what scripts we can for voicemail ahead of time */
-	bytes += adsi_download_connect(buf + bytes, service, fdn, sec, version);
-	if (adsi_transmit_message_full(chan, buf, bytes, ADSI_MSG_DOWNLOAD, 0))
+	bytes += __adsi_download_connect(buf + bytes, service, fdn, sec, version);
+	if (__adsi_transmit_message_full(chan, buf, bytes, ADSI_MSG_DOWNLOAD, 0))
 		return -1;
 	if (ast_readstring(chan, ack, 1, 10000, 10000, ""))
 		return -1;
@@ -335,20 +341,20 @@
 	return -1;
 }
 
-int adsi_end_download(struct ast_channel *chan)
+static int __adsi_end_download(struct ast_channel *chan)
 {
 	int bytes;
 	unsigned char buf[256];
         bytes = 0;
         /* Setup the resident soft key stuff, a piece at a time */
         /* Upload what scripts we can for voicemail ahead of time */
-        bytes += adsi_download_disconnect(buf + bytes);
-	if (adsi_transmit_message_full(chan, buf, bytes, ADSI_MSG_DOWNLOAD, 0))
+        bytes += __adsi_download_disconnect(buf + bytes);
+	if (__adsi_transmit_message_full(chan, buf, bytes, ADSI_MSG_DOWNLOAD, 0))
 		return -1;
 	return 0;
 }
 
-int adsi_transmit_message_full(struct ast_channel *chan, unsigned char *msg, int msglen, int msgtype, int dowait)
+static int __adsi_transmit_message_full(struct ast_channel *chan, unsigned char *msg, int msglen, int msgtype, int dowait)
 {
 	unsigned char *msgs[5] = { NULL, NULL, NULL, NULL, NULL };
 	int msglens[5];
@@ -422,9 +428,9 @@
 	return res;
 }
 
-int adsi_transmit_message(struct ast_channel *chan, unsigned char *msg, int msglen, int msgtype)
+static int __adsi_transmit_message(struct ast_channel *chan, unsigned char *msg, int msglen, int msgtype)
 {
-	return adsi_transmit_message_full(chan, msg, msglen, msgtype, 1);
+	return __adsi_transmit_message_full(chan, msg, msglen, msgtype, 1);
 }
 
 static inline int ccopy(unsigned char *dst, unsigned char *src, int max)
@@ -438,7 +444,7 @@
 	return x;
 }
 
-int adsi_load_soft_key(unsigned char *buf, int key, char *llabel, char *slabel, char *ret, int data)
+static int __adsi_load_soft_key(unsigned char *buf, int key, char *llabel, char *slabel, char *ret, int data)
 {
 	int bytes=0;
 
@@ -477,7 +483,7 @@
 	
 }
 
-int adsi_connect_session(unsigned char *buf, unsigned char *fdn, int ver)
+static int __adsi_connect_session(unsigned char *buf, unsigned char *fdn, int ver)
 {
 	int bytes=0;
 	int x;
@@ -500,7 +506,7 @@
 
 }
 
-int adsi_download_connect(unsigned char *buf, char *service,  unsigned char *fdn, unsigned char *sec, int ver)
+static int __adsi_download_connect(unsigned char *buf, char *service,  unsigned char *fdn, unsigned char *sec, int ver)
 {
 	int bytes=0;
 	int x;
@@ -530,7 +536,7 @@
 
 }
 
-int adsi_disconnect_session(unsigned char *buf)
+static int __adsi_disconnect_session(unsigned char *buf)
 {
 	int bytes=0;
 
@@ -545,7 +551,7 @@
 
 }
 
-int adsi_query_cpeid(unsigned char *buf)
+static int __adsi_query_cpeid(unsigned char *buf)
 {
 	int bytes = 0;
 	buf[bytes++] = ADSI_QUERY_CPEID;
@@ -555,7 +561,7 @@
 	return bytes;
 }
 
-int adsi_query_cpeinfo(unsigned char *buf)
+static int __adsi_query_cpeinfo(unsigned char *buf)
 {
 	int bytes = 0;
 	buf[bytes++] = ADSI_QUERY_CONFIG;
@@ -565,7 +571,7 @@
 	return bytes;
 }
 
-int adsi_read_encoded_dtmf(struct ast_channel *chan, unsigned char *buf, int maxlen)
+static int __adsi_read_encoded_dtmf(struct ast_channel *chan, unsigned char *buf, int maxlen)
 {
 	int bytes = 0;
 	int res;
@@ -600,21 +606,21 @@
 	return bytes;
 }
 
-int adsi_get_cpeid(struct ast_channel *chan, unsigned char *cpeid, int voice)
+static int __adsi_get_cpeid(struct ast_channel *chan, unsigned char *cpeid, int voice)
 {
 	unsigned char buf[256];
 	int bytes = 0;
 	int res;
-	bytes += adsi_data_mode(buf);
-	adsi_transmit_message_full(chan, buf, bytes, ADSI_MSG_DISPLAY, 0);
+	bytes += __adsi_data_mode(buf);
+	__adsi_transmit_message_full(chan, buf, bytes, ADSI_MSG_DISPLAY, 0);
 
 	bytes = 0;
-	bytes += adsi_query_cpeid(buf);
-	adsi_transmit_message_full(chan, buf, bytes, ADSI_MSG_DISPLAY, 0);
+	bytes += __adsi_query_cpeid(buf);
+	__adsi_transmit_message_full(chan, buf, bytes, ADSI_MSG_DISPLAY, 0);
 
 	/* Get response */
 	memset(buf, 0, sizeof(buf));
-	res = adsi_read_encoded_dtmf(chan, cpeid, 4);
+	res = __adsi_read_encoded_dtmf(chan, cpeid, 4);
 	if (res != 4) {
 		ast_log(LOG_WARNING, "Got %d bytes back of encoded DTMF, expecting 4\n", res);
 		res = 0;
@@ -624,21 +630,21 @@
 
 	if (voice) {
 		bytes = 0;
-		bytes += adsi_voice_mode(buf, 0);
-		adsi_transmit_message_full(chan, buf, bytes, ADSI_MSG_DISPLAY, 0);
+		bytes += __adsi_voice_mode(buf, 0);
+		__adsi_transmit_message_full(chan, buf, bytes, ADSI_MSG_DISPLAY, 0);
 		/* Ignore the resulting DTMF B announcing it's in voice mode */
 		ast_waitfordigit(chan, 1000);
 	}
 	return res;
 }
 
-int adsi_get_cpeinfo(struct ast_channel *chan, int *width, int *height, int *buttons, int voice)
+static int __adsi_get_cpeinfo(struct ast_channel *chan, int *width, int *height, int *buttons, int voice)
 {
 	unsigned char buf[256];
 	int bytes = 0;
 	int res;
-	bytes += adsi_data_mode(buf);
-	adsi_transmit_message_full(chan, buf, bytes, ADSI_MSG_DISPLAY, 0);
+	bytes += __adsi_data_mode(buf);
+	__adsi_transmit_message_full(chan, buf, bytes, ADSI_MSG_DISPLAY, 0);
 
 	bytes = 0;
 	bytes += adsi_query_cpeinfo(buf);
@@ -689,15 +695,15 @@
 	}
 	if (voice) {
 		bytes = 0;
-		bytes += adsi_voice_mode(buf, 0);
-		adsi_transmit_message_full(chan, buf, bytes, ADSI_MSG_DISPLAY, 0);
+		bytes += __adsi_voice_mode(buf, 0);
+		__adsi_transmit_message_full(chan, buf, bytes, ADSI_MSG_DISPLAY, 0);
 		/* Ignore the resulting DTMF B announcing it's in voice mode */
 		ast_waitfordigit(chan, 1000);
 	}
 	return res;
 }
 
-int adsi_data_mode(unsigned char *buf)
+static int __adsi_data_mode(unsigned char *buf)
 {
 	int bytes=0;
 
@@ -712,7 +718,7 @@
 
 }
 
-int adsi_clear_soft_keys(unsigned char *buf)
+static int __adsi_clear_soft_keys(unsigned char *buf)
 {
 	int bytes=0;
 
@@ -727,7 +733,7 @@
 
 }
 
-int adsi_clear_screen(unsigned char *buf)
+static int __adsi_clear_screen(unsigned char *buf)
 {
 	int bytes=0;
 
@@ -742,7 +748,7 @@
 
 }
 
-int adsi_voice_mode(unsigned char *buf, int when)
+static int __adsi_voice_mode(unsigned char *buf, int when)
 {
 	int bytes=0;
 
@@ -759,7 +765,7 @@
 
 }
 
-int adsi_available(struct ast_channel *chan)
+static int __adsi_available(struct ast_channel *chan)
 {
 	int cpe = chan->adsicpe & 0xff;
 	if ((cpe == AST_ADSI_AVAILABLE) ||
@@ -768,7 +774,7 @@
 	return 0;
 }
 
-int adsi_download_disconnect(unsigned char *buf)
+static int __adsi_download_disconnect(unsigned char *buf)
 {
 	int bytes=0;
 
@@ -783,7 +789,7 @@
 
 }
 
-int adsi_display(unsigned char *buf, int page, int line, int just, int wrap, 
+static int __adsi_display(unsigned char *buf, int page, int line, int just, int wrap, 
 		 char *col1, char *col2)
 {
 	int bytes=0;
@@ -829,7 +835,7 @@
 
 }
 
-int adsi_input_control(unsigned char *buf, int page, int line, int display, int format, int just)
+static int __adsi_input_control(unsigned char *buf, int page, int line, int display, int format, int just)
 {
 	int bytes=0;
 
@@ -852,7 +858,7 @@
 
 }
 
-int adsi_input_format(unsigned char *buf, int num, int dir, int wrap, char *format1, char *format2)
+static int __adsi_input_format(unsigned char *buf, int num, int dir, int wrap, char *format1, char *format2)
 {
 	int bytes = 0;
 
@@ -871,7 +877,7 @@
 	return bytes;
 }
 
-int adsi_set_keys(unsigned char *buf, unsigned char *keys)
+static int __adsi_set_keys(unsigned char *buf, unsigned char *keys)
 {
 	int bytes=0;
 	int x;
@@ -886,7 +892,7 @@
 	return bytes;
 }
 
-int adsi_set_line(unsigned char *buf, int page, int line)
+static int __adsi_set_line(unsigned char *buf, int page, int line)
 {
 	int bytes=0;
 
@@ -917,7 +923,7 @@
 static int total = 0;
 static int speeds = 0;
 
-int adsi_channel_restore(struct ast_channel *chan)
+static int __adsi_channel_restore(struct ast_channel *chan)
 {
 	unsigned char dsp[256];
 	int bytes;
@@ -928,7 +934,7 @@
 
 	/* Start with initial display setup */
 	bytes = 0;
-	bytes += adsi_set_line(dsp + bytes, ADSI_INFO_PAGE, 1);
+	bytes += __adsi_set_line(dsp + bytes, ADSI_INFO_PAGE, 1);
 
 	/* Prepare key setup messages */
 
@@ -937,26 +943,26 @@
 		for (x=0;x<speeds;x++) {
 			keyd[x] = ADSI_SPEED_DIAL + x;
 		}
-		bytes += adsi_set_keys(dsp + bytes, keyd);
+		bytes += __adsi_set_keys(dsp + bytes, keyd);
 	}
-	adsi_transmit_message_full(chan, dsp, bytes, ADSI_MSG_DISPLAY, 0);
+	__adsi_transmit_message_full(chan, dsp, bytes, ADSI_MSG_DISPLAY, 0);
 	return 0;
 
 }
 
-int adsi_print(struct ast_channel *chan, char **lines, int *aligns, int voice)
+static int __adsi_print(struct ast_channel *chan, char **lines, int *aligns, int voice)
 {
 	unsigned char buf[4096];
 	int bytes=0;
 	int res;
 	int x;
 	for(x=0;lines[x];x++) 
-		bytes += adsi_display(buf + bytes, ADSI_INFO_PAGE, x+1, aligns[x], 0, lines[x], "");
-	bytes += adsi_set_line(buf + bytes, ADSI_INFO_PAGE, 1);
+		bytes += __adsi_display(buf + bytes, ADSI_INFO_PAGE, x+1, aligns[x], 0, lines[x], "");
+	bytes += __adsi_set_line(buf + bytes, ADSI_INFO_PAGE, 1);
 	if (voice) {
-		bytes += adsi_voice_mode(buf + bytes, 0);
+		bytes += __adsi_voice_mode(buf + bytes, 0);
 	}
-	res = adsi_transmit_message_full(chan, buf, bytes, ADSI_MSG_DISPLAY, 0);
+	res = __adsi_transmit_message_full(chan, buf, bytes, ADSI_MSG_DISPLAY, 0);
 	if (voice) {
 		/* Ignore the resulting DTMF B announcing it's in voice mode */
 		ast_waitfordigit(chan, 1000);
@@ -964,7 +970,7 @@
 	return res;
 }
 
-int adsi_load_session(struct ast_channel *chan, unsigned char *app, int ver, int data)
+static int __adsi_load_session(struct ast_channel *chan, unsigned char *app, int ver, int data)
 {
 	unsigned char dsp[256];
 	int bytes;
@@ -975,13 +981,13 @@
 
 	/* Connect to session */
 	bytes = 0;
-	bytes += adsi_connect_session(dsp + bytes, app, ver);
+	bytes += __adsi_connect_session(dsp + bytes, app, ver);
 
 	if (data)
-		bytes += adsi_data_mode(dsp + bytes);
+		bytes += __adsi_data_mode(dsp + bytes);
 
 	/* Prepare key setup messages */
-	if (adsi_transmit_message_full(chan, dsp, bytes, ADSI_MSG_DISPLAY, 0))
+	if (__adsi_transmit_message_full(chan, dsp, bytes, ADSI_MSG_DISPLAY, 0))
 		return -1;
 	if (app) {
 		res = ast_readstring(chan, resp, 1, 1200, 1200, "");
@@ -1005,7 +1011,7 @@
 
 }
 
-int adsi_unload_session(struct ast_channel *chan)
+static int __adsi_unload_session(struct ast_channel *chan)
 {
 	unsigned char dsp[256];
 	int bytes;
@@ -1014,11 +1020,11 @@
 
 	/* Connect to session */
 	bytes = 0;
-	bytes += adsi_disconnect_session(dsp + bytes);
-	bytes += adsi_voice_mode(dsp + bytes, 0);
+	bytes += __adsi_disconnect_session(dsp + bytes);
+	bytes += __adsi_voice_mode(dsp + bytes, 0);
 
 	/* Prepare key setup messages */
-	if (adsi_transmit_message_full(chan, dsp, bytes, ADSI_MSG_DISPLAY, 0))
+	if (__adsi_transmit_message_full(chan, dsp, bytes, ADSI_MSG_DISPLAY, 0))
 		return -1;
 	return 0;
 }
@@ -1115,6 +1121,37 @@
 int load_module(void)
 {
 	adsi_load();
+
+	adsi_begin_download = __adsi_begin_download;
+	adsi_end_download = __adsi_end_download;
+	adsi_channel_restore = __adsi_channel_restore;
+	adsi_print = __adsi_print;
+	adsi_load_session = __adsi_load_session;
+	adsi_unload_session = __adsi_unload_session;
+	adsi_transmit_messages = __adsi_transmit_messages;
+	adsi_transmit_message = __adsi_transmit_message;
+	adsi_transmit_message_full = __adsi_transmit_message_full;
+	adsi_read_encoded_dtmf = __adsi_read_encoded_dtmf;
+	adsi_connect_session = __adsi_connect_session;
+	adsi_query_cpeid = __adsi_query_cpeid;
+	adsi_query_cpeinfo = __adsi_query_cpeinfo;
+	adsi_get_cpeid = __adsi_get_cpeid;
+	adsi_get_cpeinfo = __adsi_get_cpeinfo;
+	adsi_download_connect = __adsi_download_connect;
+	adsi_disconnect_session = __adsi_disconnect_session;
+	adsi_download_disconnect = __adsi_download_disconnect;
+	adsi_data_mode = __adsi_data_mode;
+	adsi_clear_soft_keys = __adsi_clear_soft_keys;
+	adsi_clear_screen = __adsi_clear_screen;
+	adsi_voice_mode = __adsi_voice_mode;
+	adsi_available = __adsi_available;
+	adsi_display = __adsi_display;
+	adsi_set_line = __adsi_set_line;
+	adsi_load_soft_key = __adsi_load_soft_key;
+	adsi_set_keys = __adsi_set_keys;
+	adsi_input_control = __adsi_input_control;
+	adsi_input_format = __adsi_input_format;
+
 	return 0;
 }
 
Index: res/res_features.c
===================================================================
--- res/res_features.c	(revision 7472)
+++ res/res_features.c	(working copy)
@@ -22,8 +22,8 @@
  * 
  */
 
+#include <stdlib.h>
 #include <pthread.h>
-#include <stdlib.h>
 #include <errno.h>
 #include <unistd.h>
 #include <string.h>
@@ -156,16 +156,26 @@
 
 static pthread_t parking_thread;
 
+static char *__ast_parking_ext(void);
+static void *__ast_bridge_call_thread(void *);
+static void __ast_bridge_call_thread_launch(void *);
+static int __ast_park_call(struct ast_channel *, struct ast_channel *, int, int *);
+static int __ast_masq_park_call(struct ast_channel *, struct ast_channel *, int, int *);
+static void __ast_register_feature(struct ast_call_feature *);
+static void __ast_unregister_feature(struct ast_call_feature *);
+static void __ast_unregister_features(void);
+static int __ast_bridge_call(struct ast_channel *,struct ast_channel *,struct ast_bridge_config *);
+
 STANDARD_LOCAL_USER;
 
 LOCAL_USER_DECL;
 
-char *ast_parking_ext(void)
+static char *__ast_parking_ext(void)
 {
 	return parking_ext;
 }
 
-char *ast_pickup_ext(void)
+char *__ast_pickup_ext(void)
 {
 	return pickup_ext;
 }
@@ -210,7 +220,7 @@
 static struct ast_channel *ast_feature_request_and_dial(struct ast_channel *caller, const char *type, int format, void *data, int timeout, int *outstate, const char *cid_num, const char *cid_name);
 
 
-static void *ast_bridge_call_thread(void *data) 
+static void *__ast_bridge_call_thread(void *data) 
 {
 	struct ast_bridge_thread_obj *tobj = data;
 
@@ -227,7 +237,7 @@
 		ast_cdr_setdestchan(tobj->peer->cdr, tobj->chan->name);
 	}
 
-	ast_bridge_call(tobj->peer, tobj->chan, &tobj->bconfig);
+	__ast_bridge_call(tobj->peer, tobj->chan, &tobj->bconfig);
 	ast_hangup(tobj->chan);
 	ast_hangup(tobj->peer);
 	tobj->chan = tobj->peer = NULL;
@@ -236,7 +246,7 @@
 	return NULL;
 }
 
-static void ast_bridge_call_thread_launch(void *data) 
+static void __ast_bridge_call_thread_launch(void *data) 
 {
 	pthread_t thread;
 	pthread_attr_t attr;
@@ -244,7 +254,7 @@
 
 	pthread_attr_init(&attr);
 	pthread_attr_setdetachstate(&attr, PTHREAD_CREATE_DETACHED);
-	ast_pthread_create(&thread, &attr,ast_bridge_call_thread, data);
+	ast_pthread_create(&thread, &attr,__ast_bridge_call_thread, data);
 	pthread_attr_destroy(&attr);
 	memset(&sched, 0, sizeof(sched));
 	pthread_setschedparam(thread, SCHED_RR, &sched);
@@ -271,7 +281,7 @@
 /*--- ast_park_call: Park a call */
 /* We put the user in the parking list, then wake up the parking thread to be sure it looks
 	   after these channels too */
-int ast_park_call(struct ast_channel *chan, struct ast_channel *peer, int timeout, int *extout)
+static int __ast_park_call(struct ast_channel *chan, struct ast_channel *peer, int timeout, int *extout)
 {
 	struct parkeduser *pu, *cur;
 	int i,x,parking_range;
@@ -394,7 +404,7 @@
 	return 0;
 }
 
-int ast_masq_park_call(struct ast_channel *rchan, struct ast_channel *peer, int timeout, int *extout)
+static int __ast_masq_park_call(struct ast_channel *rchan, struct ast_channel *peer, int timeout, int *extout)
 {
 	struct ast_channel *chan;
 	struct ast_frame *f;
@@ -419,7 +429,7 @@
 		f = ast_read(chan);
 		if (f)
 			ast_frfree(f);
-		ast_park_call(chan, peer, timeout, extout);
+		__ast_park_call(chan, peer, timeout, extout);
 	} else {
 		ast_log(LOG_WARNING, "Unable to create parked channel\n");
 		return -1;
@@ -596,14 +606,14 @@
 		ast_indicate(transferee, AST_CONTROL_UNHOLD);
 		return res;
 	}
-	if (!strcmp(newext, ast_parking_ext())) {
+	if (!strcmp(newext, __ast_parking_ext())) {
 		ast_moh_stop(transferee);
 
 		res = ast_autoservice_stop(transferee);
 		ast_indicate(transferee, AST_CONTROL_UNHOLD);
 		if (res)
 			res = -1;
-		else if (!ast_park_call(transferee, transferer, 0, NULL)) {
+		else if (!__ast_park_call(transferee, transferer, 0, NULL)) {
 			/* We return non-zero, but tell the PBX not to hang the channel when
 			   the thread dies -- We have to be careful now though.  We are responsible for 
 			   hanging up the channel, else it will never be hung up! */
@@ -736,7 +746,7 @@
 				memset(&bconfig,0,sizeof(struct ast_bridge_config));
 				ast_set_flag(&(bconfig.features_caller), AST_FEATURE_DISCONNECT);
 				ast_set_flag(&(bconfig.features_callee), AST_FEATURE_DISCONNECT);
-				res = ast_bridge_call(transferer,newchan,&bconfig);
+				res = __ast_bridge_call(transferer,newchan,&bconfig);
 				if (newchan->_softhangup || newchan->_state != AST_STATE_UP || !transferer->_softhangup) {
 					ast_hangup(newchan);
 					if (f) {
@@ -812,7 +822,7 @@
 							ast_log(LOG_WARNING, "Failed to play courtesy tone!\n");
 						}
 					}
-					ast_bridge_call_thread_launch(tobj);
+					__ast_bridge_call_thread_launch(tobj);
 				} else {
 					ast_log(LOG_WARNING, "Out of memory!\n");
 					ast_hangup(xferchan);
@@ -872,7 +882,7 @@
 static AST_LIST_HEAD(feature_list,ast_call_feature) feature_list;
 
 /* register new feature into feature_list*/
-void ast_register_feature(struct ast_call_feature *feature)
+static void __ast_register_feature(struct ast_call_feature *feature)
 {
 	if (!feature) {
 		ast_log(LOG_NOTICE,"You didn't pass a feature!\n");
@@ -888,7 +898,7 @@
 }
 
 /* unregister feature from feature_list */
-void ast_unregister_feature(struct ast_call_feature *feature)
+static void __ast_unregister_feature(struct ast_call_feature *feature)
 {
 	if (!feature) return;
 
@@ -898,7 +908,7 @@
 	free(feature);
 }
 
-static void ast_unregister_features(void)
+static void __ast_unregister_features(void)
 {
 	struct ast_call_feature *feature;
 
@@ -1247,7 +1257,7 @@
 	return chan;
 }
 
-int ast_bridge_call(struct ast_channel *chan,struct ast_channel *peer,struct ast_bridge_config *config)
+static int __ast_bridge_call(struct ast_channel *chan,struct ast_channel *peer,struct ast_bridge_config *config)
 {
 	/* Copy voice back and forth between the two channels.  Give the peer
 	   the ability to transfer calls with '#<extension' syntax. */
@@ -1670,7 +1680,7 @@
 	if (!res)
 		res = ast_safe_sleep(chan, 1000);
 	if (!res)
-		res = ast_park_call(chan, chan, 0, NULL);
+		res = __ast_park_call(chan, chan, 0, NULL);
 	LOCAL_USER_REMOVE(u);
 	if (!res)
 		res = AST_PBX_KEEPALIVE;
@@ -1769,7 +1779,7 @@
 		config.play_warning = 0;
 		config.warning_freq = 0;
 		config.warning_sound=NULL;
-		res = ast_bridge_call(chan, peer, &config);
+		res = __ast_bridge_call(chan, peer, &config);
 
 		/* Simulate the PBX hanging up */
 		if (res != AST_PBX_NO_HANGUP_PEER)
@@ -1802,7 +1812,7 @@
 	ast_cli(fd, format, "Builtin Feature", "Default", "Current");
 	ast_cli(fd, format, "---------------", "-------", "-------");
 
-	ast_cli(fd, format, "Pickup", "*8", ast_pickup_ext());		/* default hardcoded above, so we'll hardcode it here */
+	ast_cli(fd, format, "Pickup", "*8", __ast_pickup_ext());		/* default hardcoded above, so we'll hardcode it here */
 
 	fcount = sizeof(builtin_features) / sizeof(builtin_features[0]);
 
@@ -1917,7 +1927,7 @@
 }
 
 
-int ast_pickup_call(struct ast_channel *chan)
+int __ast_pickup_call(struct ast_channel *chan)
 {
 	struct ast_channel *cur = NULL;
 	int res = -1;
@@ -2043,7 +2053,7 @@
 		}
 
 		/* Map a key combination to an application*/
-		ast_unregister_features();
+		__ast_unregister_features();
 		var = ast_variable_browse(cfg, "applicationmap");
 		while(var) {
 			char *tmp_val=strdup(var->value);
@@ -2106,7 +2116,7 @@
 					continue;
 				}
 
-				ast_register_feature(feature);
+				__ast_register_feature(feature);
 				
 				if (option_verbose >=1) ast_verbose(VERBOSE_PREFIX_2 "Mapping Feature '%s' to app '%s' with code '%s'\n", var->name, app, exten);  
 			}
@@ -2127,7 +2137,7 @@
 			return -1;
 		}
 	}
-	return ast_add_extension2(con, 1, ast_parking_ext(), 1, NULL, NULL, parkcall, strdup(""), FREE, registrar);
+	return ast_add_extension2(con, 1, __ast_parking_ext(), 1, NULL, NULL, parkcall, strdup(""), FREE, registrar);
 }
 
 int reload(void) {
@@ -2153,6 +2163,15 @@
 	if (!res) {
 		ast_manager_register("ParkedCalls", 0, manager_parking_status, "List parked calls" );
 	}
+	/* Install our functions into stubs */
+	ast_park_call = __ast_park_call;
+	ast_masq_park_call = __ast_masq_park_call;
+	ast_parking_ext = __ast_parking_ext;
+	ast_pickup_ext = __ast_pickup_ext;
+	ast_bridge_call = __ast_bridge_call;
+	ast_pickup_call = __ast_pickup_call;
+	ast_register_feature = __ast_register_feature;
+	ast_unregister_feature = __ast_unregister_feature;
 	return res;
 }
 
Index: res/res_monitor.c
===================================================================
--- res/res_monitor.c	(revision 7472)
+++ res/res_monitor.c	(working copy)
@@ -88,8 +88,13 @@
 	"Changes monitoring filename of a channel. Has no effect if the channel is not monitored\n"
 	"The argument is the new filename base to use for monitoring this channel.\n";
 
+static int __ast_monitor_start(struct ast_channel *, const char *, const char *, int);
+static int __ast_monitor_stop(struct ast_channel *, int);
+static int __ast_monitor_change_fname(struct ast_channel *, const char *, int);
+static void __ast_monitor_setjoinfiles(struct ast_channel *, int);
+
 /* Start monitoring a channel */
-int ast_monitor_start(	struct ast_channel *chan, const char *format_spec,
+static int __ast_monitor_start(struct ast_channel *chan, const char *format_spec,
 		const char *fname_base, int need_lock)
 {
 	int res = 0;
@@ -159,7 +164,7 @@
 			}
 		}
 
-		monitor->stop = ast_monitor_stop;
+		monitor->stop = __ast_monitor_stop;
 
 		/* Determine file format */
 		if (!ast_strlen_zero(format_spec)) {
@@ -210,7 +215,7 @@
 }
 
 /* Stop monitoring a channel */
-int ast_monitor_stop(struct ast_channel *chan, int need_lock)
+static int __ast_monitor_stop(struct ast_channel *chan, int need_lock)
 {
 	int delfiles = 0;
 
@@ -294,7 +299,7 @@
 }
 
 /* Change monitoring filename of a channel */
-int ast_monitor_change_fname(struct ast_channel *chan, const char *fname_base, int need_lock)
+static int __ast_monitor_change_fname(struct ast_channel *chan, const char *fname_base, int need_lock)
 {
 	char tmp[256];
 	if (ast_strlen_zero(fname_base)) {
@@ -392,22 +397,22 @@
 		return 0;
 	}
 
-	res = ast_monitor_start(chan, format, fname_base, 1);
+	__res = ast_monitor_start(chan, format, fname_base, 1);
 	if (res < 0)
-		res = ast_monitor_change_fname(chan, fname_base, 1);
-	ast_monitor_setjoinfiles(chan, joinfiles);
+		res = __ast_monitor_change_fname(chan, fname_base, 1);
+	__ast_monitor_setjoinfiles(chan, joinfiles);
 
 	return res;
 }
 
 static int stop_monitor_exec(struct ast_channel *chan, void *data)
 {
-	return ast_monitor_stop(chan, 1);
+	return __ast_monitor_stop(chan, 1);
 }
 
 static int change_monitor_exec(struct ast_channel *chan, void *data)
 {
-	return ast_monitor_change_fname(chan, (const char*)data, 1);
+	return __ast_monitor_change_fname(chan, (const char*)data, 1);
 }
 
 static char start_monitor_action_help[] =
@@ -457,8 +462,8 @@
 		if ((d=strchr(fname, '/'))) *d='-';
 	}
 	
-	if (ast_monitor_start(c, format, fname, 1)) {
-		if (ast_monitor_change_fname(c, fname, 1)) {
+	if (__ast_monitor_start(c, format, fname, 1)) {
+		if (__ast_monitor_change_fname(c, fname, 1)) {
 			astman_send_error(s, m, "Could not start monitoring channel");
 			ast_mutex_unlock(&c->lock);
 			return 0;
@@ -466,7 +471,7 @@
 	}
 
 	if (ast_true(mix)) {
-		ast_monitor_setjoinfiles(c, 1);
+		__ast_monitor_setjoinfiles(c, 1);
 	}
 
 	ast_mutex_unlock(&c->lock);
@@ -493,7 +498,7 @@
 		astman_send_error(s, m, "No such channel");
 		return 0;
 	}
-	res = ast_monitor_stop(c, 1);
+	res = __ast_monitor_stop(c, 1);
 	ast_mutex_unlock(&c->lock);
 	if (res) {
 		astman_send_error(s, m, "Could not stop monitoring channel");
@@ -529,7 +534,7 @@
 		astman_send_error(s, m, "No such channel");
 		return 0;
 	}
-	if (ast_monitor_change_fname(c, fname, 1)) {
+	if (__ast_monitor_change_fname(c, fname, 1)) {
 		astman_send_error(s, m, "Could not change monitored filename of channel");
 		ast_mutex_unlock(&c->lock);
 		return 0;
@@ -539,7 +544,7 @@
 	return 0;
 }
 
-void ast_monitor_setjoinfiles(struct ast_channel *chan, int turnon)
+static void __ast_monitor_setjoinfiles(struct ast_channel *chan, int turnon)
 {
 	if (chan->monitor)
 		chan->monitor->joinfiles = turnon;
@@ -554,6 +559,11 @@
 	ast_manager_register2("StopMonitor", EVENT_FLAG_CALL, stop_monitor_action, stopmonitor_synopsis, stop_monitor_action_help);
 	ast_manager_register2("ChangeMonitor", EVENT_FLAG_CALL, change_monitor_action, changemonitor_synopsis, change_monitor_action_help);
 
+	ast_monitor_start = __ast_monitor_start;
+	ast_monitor_stop = __ast_monitor_stop;
+	ast_monitor_change_fname = __ast_monitor_change_fname;
+	ast_monitor_setjoinfiles = __ast_monitor_setjoinfiles;
+	
 	return 0;
 }
 
Index: stubfunctions-adsi.c
===================================================================
--- stubfunctions-adsi.c	(revision 0)
+++ stubfunctions-adsi.c	(revision 0)
@@ -0,0 +1,286 @@
+/*
+ * 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.
+ */
+
+#include <unistd.h>
+#include <stdlib.h>
+
+#include "asterisk/adsi.h"
+
+
+static int stub_adsi_begin_download(struct ast_channel *chan, char *service, unsigned char *fdn, unsigned char *sec, int version)
+{
+	ast_log(LOG_NOTICE, "res_adsi not loaded!\n");
+	return -1;
+}
+
+static int stub_adsi_end_download(struct ast_channel *chan)
+{
+	ast_log(LOG_NOTICE, "res_adsi not loaded!\n");
+	return -1;
+}
+
+static int stub_adsi_channel_restore(struct ast_channel *chan)
+{
+	ast_log(LOG_NOTICE, "res_adsi not loaded!\n");
+	return -1;
+}
+
+static int stub_adsi_print(struct ast_channel *chan, char **lines, int *align, int voice)
+{
+	ast_log(LOG_NOTICE, "res_adsi not loaded!\n");
+	return -1;
+}
+
+static int stub_adsi_load_session(struct ast_channel *chan, unsigned char *app, int ver, int data)
+{
+	ast_log(LOG_NOTICE, "res_adsi not loaded!\n");
+	return -1;
+}
+
+static int stub_adsi_unload_session(struct ast_channel *chan)
+{
+	ast_log(LOG_NOTICE, "res_adsi not loaded!\n");
+	return -1;
+}
+
+static int stub_adsi_transmit_messages(struct ast_channel *chan, unsigned char **msg, int *msglen, int *msgtype)
+{
+	ast_log(LOG_NOTICE, "res_adsi not loaded!\n");
+	return -1;
+}
+
+static int stub_adsi_transmit_message(struct ast_channel *chan, unsigned char *msg, int msglen, int msgtype)
+{
+	ast_log(LOG_NOTICE, "res_adsi not loaded!\n");
+	return -1;
+}
+
+static int stub_adsi_transmit_message_full(struct ast_channel *chan, unsigned char *msg, int msglen, int msgtype, int dowait)
+{
+	ast_log(LOG_NOTICE, "res_adsi not loaded!\n");
+	return -1;
+}
+
+static int stub_adsi_read_encoded_dtmf(struct ast_channel *chan, unsigned char *buf, int maxlen)
+{
+	ast_log(LOG_NOTICE, "res_adsi not loaded!\n");
+	return -1;
+}
+
+static int stub_adsi_connect_session(unsigned char *buf, unsigned char *fdn, int ver)
+{
+	ast_log(LOG_NOTICE, "res_adsi not loaded!\n");
+	return -1;
+}
+
+static int stub_adsi_query_cpeid(unsigned char *buf)
+{
+	ast_log(LOG_NOTICE, "res_adsi not loaded!\n");
+	return -1;
+}
+
+static int stub_adsi_query_cpeinfo(unsigned char *buf)
+{
+	ast_log(LOG_NOTICE, "res_adsi not loaded!\n");
+	return -1;
+}
+
+static int stub_adsi_get_cpeid(struct ast_channel *chan, unsigned char *cpeid, int voice)
+{
+	ast_log(LOG_NOTICE, "res_adsi not loaded!\n");
+	return -1;
+}
+
+static int stub_adsi_get_cpeinfo(struct ast_channel *chan, int *width, int *height, int *buttons, int voice)
+{
+	ast_log(LOG_NOTICE, "res_adsi not loaded!\n");
+	return -1;
+}
+
+static int stub_adsi_download_connect(unsigned char *buf, char *service, unsigned char *fdn, unsigned char *sec, int ver)
+{
+	ast_log(LOG_NOTICE, "res_adsi not loaded!\n");
+	return -1;
+}
+
+static int stub_adsi_disconnect_session(unsigned char *buf)
+{
+	ast_log(LOG_NOTICE, "res_adsi not loaded!\n");
+	return -1;
+}
+
+static int stub_adsi_download_disconnect(unsigned char *buf)
+{
+	ast_log(LOG_NOTICE, "res_adsi not loaded!\n");
+	return -1;
+}
+
+static int stub_adsi_data_mode(unsigned char *buf)
+{
+	ast_log(LOG_NOTICE, "res_adsi not loaded!\n");
+	return -1;
+}
+
+static int stub_adsi_clear_soft_keys(unsigned char *buf)
+{
+	ast_log(LOG_NOTICE, "res_adsi not loaded!\n");
+	return -1;
+}
+
+static int stub_adsi_clear_screen(unsigned char *buf)
+{
+	ast_log(LOG_NOTICE, "res_adsi not loaded!\n");
+	return -1;
+}
+
+static int stub_adsi_voice_mode(unsigned char *buf, int when)
+{
+	ast_log(LOG_NOTICE, "res_adsi not loaded!\n");
+	return -1;
+}
+
+static int stub_adsi_available(struct ast_channel *chan)
+{
+	ast_log(LOG_NOTICE, "res_adsi not loaded!\n");
+	return -1;
+}
+
+static int stub_adsi_display(unsigned char *buf, int page, int line, int just, int wrap, char *col1, char *col2)
+{
+	ast_log(LOG_NOTICE, "res_adsi not loaded!\n");
+	return -1;
+}
+
+static int stub_adsi_set_line(unsigned char *buf, int page, int line)
+{
+	ast_log(LOG_NOTICE, "res_adsi not loaded!\n");
+	return -1;
+}
+
+static int stub_adsi_load_soft_key(unsigned char *buf, int key, char *llabel, char *slabel, char *ret, int data)
+{
+	ast_log(LOG_NOTICE, "res_adsi not loaded!\n");
+	return -1;
+}
+
+static int stub_adsi_set_keys(unsigned char *buf, unsigned char *keys)
+{
+	ast_log(LOG_NOTICE, "res_adsi not loaded!\n");
+	return -1;
+}
+
+static int stub_adsi_input_control(unsigned char *buf, int page, int line, int display, int format, int just)
+{
+	ast_log(LOG_NOTICE, "res_adsi not loaded!\n");
+	return -1;
+}
+
+static int stub_adsi_input_format(unsigned char *buf, int num, int dir, int wrap, char *format1, char *format2)
+{
+	ast_log(LOG_NOTICE, "res_adsi not loaded!\n");
+	return -1;
+}
+
+
+
+int (*adsi_begin_download)(struct ast_channel *chan, char *service, unsigned char *fdn, unsigned char *sec, int version) =
+	stub_adsi_begin_download;
+
+int (*adsi_end_download)(struct ast_channel *chan) =
+	stub_adsi_end_download;
+
+int (*adsi_channel_restore)(struct ast_channel *chan) =
+	stub_adsi_channel_restore;
+
+int (*adsi_print)(struct ast_channel *chan, char **lines, int *align, int voice) =
+	stub_adsi_print;
+
+int (*adsi_load_session)(struct ast_channel *chan, unsigned char *app, int ver, int data) =
+	stub_adsi_load_session;
+
+int (*adsi_unload_session)(struct ast_channel *chan) =
+	stub_adsi_unload_session;
+
+int (*adsi_transmit_messages)(struct ast_channel *chan, unsigned char **msg, int *msglen, int *msgtype) =
+	stub_adsi_transmit_messages;
+
+int (*adsi_transmit_message)(struct ast_channel *chan, unsigned char *msg, int msglen, int msgtype) =
+	stub_adsi_transmit_message;
+
+int (*adsi_transmit_message_full)(struct ast_channel *chan, unsigned char *msg, int msglen, int msgtype, int dowait) =
+	stub_adsi_transmit_message_full;
+
+int (*adsi_read_encoded_dtmf)(struct ast_channel *chan, unsigned char *buf, int maxlen) =
+	stub_adsi_read_encoded_dtmf;
+
+int (*adsi_connect_session)(unsigned char *buf, unsigned char *fdn, int ver) =
+	stub_adsi_connect_session;
+
+int (*adsi_query_cpeid)(unsigned char *buf) =
+	stub_adsi_query_cpeid;
+
+int (*adsi_query_cpeinfo)(unsigned char *buf) =
+	stub_adsi_query_cpeinfo;
+
+int (*adsi_get_cpeid)(struct ast_channel *chan, unsigned char *cpeid, int voice) =
+	stub_adsi_get_cpeid;
+
+int (*adsi_get_cpeinfo)(struct ast_channel *chan, int *width, int *height, int *buttons, int voice) =
+	stub_adsi_get_cpeinfo;
+
+int (*adsi_download_connect)(unsigned char *buf, char *service, unsigned char *fdn, unsigned char *sec, int ver) =
+	stub_adsi_download_connect;
+
+int (*adsi_disconnect_session)(unsigned char *buf) =
+	stub_adsi_disconnect_session;
+
+int (*adsi_download_disconnect)(unsigned char *buf) =
+	stub_adsi_download_disconnect;
+
+int (*adsi_data_mode)(unsigned char *buf) =
+	stub_adsi_data_mode;
+
+int (*adsi_clear_soft_keys)(unsigned char *buf) =
+	stub_adsi_clear_soft_keys;
+
+int (*adsi_clear_screen)(unsigned char *buf) =
+	stub_adsi_clear_screen;
+
+int (*adsi_voice_mode)(unsigned char *buf, int when) =
+	stub_adsi_voice_mode;
+
+int (*adsi_available)(struct ast_channel *chan) =
+	stub_adsi_available;
+
+int (*adsi_display)(unsigned char *buf, int page, int line, int just, int wrap, char *col1, char *col2) =
+	stub_adsi_display;
+
+int (*adsi_set_line)(unsigned char *buf, int page, int line) =
+	stub_adsi_set_line;
+
+int (*adsi_load_soft_key)(unsigned char *buf, int key, char *llabel, char *slabel, char *ret, int data) =
+	stub_adsi_load_soft_key;
+
+int (*adsi_set_keys)(unsigned char *buf, unsigned char *keys) =
+	stub_adsi_set_keys;
+
+int (*adsi_input_control)(unsigned char *buf, int page, int line, int display, int format, int just) =
+	stub_adsi_input_control;
+
+int (*adsi_input_format)(unsigned char *buf, int num, int dir, int wrap, char *format1, char *format2) =
+	stub_adsi_input_format;
Index: stubfunctions-crypto.c
===================================================================
--- stubfunctions-crypto.c	(revision 0)
+++ stubfunctions-crypto.c	(revision 0)
@@ -0,0 +1,84 @@
+/*
+ * 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.
+ */
+
+#include <unistd.h>
+#include <stdlib.h>
+
+#include "asterisk/crypto.h"
+#include "asterisk/logger.h"
+
+/* Hrm, I wonder if the compiler is smart enough to only create two functions
+   for all these...  I could force it to only make two, but those would be some
+   really nasty looking casts. */
+   
+static struct ast_key *stub_ast_key_get(const char *kname, int ktype)
+{
+	ast_log(LOG_NOTICE, "Crypto support not loaded!\n");
+	return NULL;
+}
+
+static int stub_ast_check_signature(struct ast_key *key, const char *msg, const char *sig)
+{
+	ast_log(LOG_NOTICE, "Crypto support not loaded!\n");
+	return -1;
+}
+
+static int stub_ast_check_signature_bin(struct ast_key *key, const char *msg, int msglen, const unsigned char *sig)
+{
+	ast_log(LOG_NOTICE, "Crypto support not loaded!\n");
+	return -1;
+}
+
+static int stub_ast_sign(struct ast_key *key, char *msg, char *sig) 
+{
+	ast_log(LOG_NOTICE, "Crypto support not loaded!\n");
+	return -1;
+}
+
+static int stub_ast_sign_bin(struct ast_key *key, const char *msg, int msglen, unsigned char *sig)
+{
+	ast_log(LOG_NOTICE, "Crypto support not loaded!\n");
+	return -1;
+}
+
+static int stub_ast_encdec_bin(unsigned char *dst, const unsigned char *src, int srclen, struct ast_key *key)
+{
+	ast_log(LOG_NOTICE, "Crypto support not loaded!\n");
+	return -1;
+}
+
+struct ast_key *(*ast_key_get)(const char *key, int type) = 
+	stub_ast_key_get;
+
+int (*ast_check_signature)(struct ast_key *key, const char *msg, const char *sig) =
+	stub_ast_check_signature;
+	
+int (*ast_check_signature_bin)(struct ast_key *key, const char *msg, int msglen, const unsigned char *sig) =
+	stub_ast_check_signature_bin;
+	
+int (*ast_sign)(struct ast_key *key, char *msg, char *sig) = 
+	stub_ast_sign;
+
+int (*ast_sign_bin)(struct ast_key *key, const char *msg, int msglen, unsigned char *sig) =
+	stub_ast_sign_bin;
+	
+int (*ast_encrypt_bin)(unsigned char *dst, const unsigned char *src, int srclen, struct ast_key *key) =
+	stub_ast_encdec_bin;
+
+int (*ast_decrypt_bin)(unsigned char *dst, const unsigned char *src, int srclen, struct ast_key *key) =
+	stub_ast_encdec_bin;
Index: stubfunctions-features.c
===================================================================
--- stubfunctions-features.c	(revision 0)
+++ stubfunctions-features.c	(revision 0)
@@ -0,0 +1,97 @@
+/*
+ * 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.
+ */
+
+#include <unistd.h>
+#include <stdlib.h>
+
+#include "asterisk/features.h"
+
+
+static int stub_ast_park_call(struct ast_channel *chan, struct ast_channel *host, int timeout, int *extout)
+{
+	ast_log(LOG_NOTICE, "res_features not loaded!\n");
+	return -1;
+}
+
+static int stub_ast_masq_park_call(struct ast_channel *rchan, struct ast_channel *host, int timeout, int *extout)
+{
+	ast_log(LOG_NOTICE, "res_features not loaded!\n");
+	return -1;
+}
+
+static char *stub_ast_parking_ext(void)
+{
+	ast_log(LOG_NOTICE, "res_features not loaded!\n");
+	return NULL;
+}
+
+static char *stub_ast_pickup_ext(void)
+{
+	ast_log(LOG_NOTICE, "res_features not loaded!\n");
+	return NULL;
+}
+
+static int stub_ast_bridge_call(struct ast_channel *chan, struct ast_channel *peer,struct ast_bridge_config *config)
+{
+	ast_log(LOG_NOTICE, "res_features not loaded!\n");
+	return -1;
+}
+
+static int stub_ast_pickup_call(struct ast_channel *chan)
+{
+	ast_log(LOG_NOTICE, "res_features not loaded!\n");
+	return -1;
+}
+
+static void stub_ast_register_feature(struct ast_call_feature *feature)
+{
+	ast_log(LOG_NOTICE, "res_features not loaded!\n");
+}
+
+static void stub_ast_unregister_feature(struct ast_call_feature *feature)
+{
+	ast_log(LOG_NOTICE, "res_features not loaded!\n");
+}
+
+
+
+
+int (*ast_park_call)(struct ast_channel *chan, struct ast_channel *host, int timeout, int *extout) =
+	stub_ast_park_call;
+
+int (*ast_masq_park_call)(struct ast_channel *rchan, struct ast_channel *host, int timeout, int *extout) =
+	stub_ast_masq_park_call;
+
+char *(*ast_parking_ext)(void) =
+	stub_ast_parking_ext;
+
+char *(*ast_pickup_ext)(void) =
+	stub_ast_pickup_ext;
+
+int (*ast_bridge_call)(struct ast_channel *chan, struct ast_channel *peer,struct ast_bridge_config *config) =
+	stub_ast_bridge_call;
+
+int (*ast_pickup_call)(struct ast_channel *chan) =
+	stub_ast_pickup_call;
+
+void (*ast_register_feature)(struct ast_call_feature *feature) =
+	stub_ast_register_feature;
+
+void (*ast_unregister_feature)(struct ast_call_feature *feature) =
+	stub_ast_unregister_feature;
+
Index: stubfunctions-monitor.c
===================================================================
--- stubfunctions-monitor.c	(revision 0)
+++ stubfunctions-monitor.c	(revision 0)
@@ -0,0 +1,61 @@
+//*
+ * 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.
+ */
+
+#include <unistd.h>
+#include <stdlib.h>
+
+#include "asterisk/monitor.h"
+
+
+static int stub_ast_monitor_start( struct ast_channel *chan, const char *format_spec, const char *fname_base, int need_lock )
+{
+	ast_log(LOG_NOTICE, "res_monitor not loaded!\n");
+	return -1;
+}
+
+static int stub_ast_monitor_stop( struct ast_channel *chan, int need_lock)
+{
+	ast_log(LOG_NOTICE, "res_monitor not loaded!\n");
+	return -1;
+}
+
+static int stub_ast_monitor_change_fname( struct ast_channel *chan, const char *fname_base, int need_lock )
+{
+	ast_log(LOG_NOTICE, "res_monitor not loaded!\n");
+	return -1;
+}
+
+static void stub_ast_monitor_setjoinfiles(struct ast_channel *chan, int turnon)
+{
+	ast_log(LOG_NOTICE, "res_monitor not loaded!\n");
+}
+
+
+
+int (*ast_monitor_start)( struct ast_channel *chan, const char *format_spec, const char *fname_base, int need_lock ) =
+	stub_ast_monitor_start;
+
+int (*ast_monitor_stop)( struct ast_channel *chan, int need_lock) =
+	stub_ast_monitor_stop;
+
+int (*ast_monitor_change_fname)( struct ast_channel *chan, const char *fname_base, int need_lock ) =
+	stub_ast_monitor_change_fname;
+
+void (*ast_monitor_setjoinfiles)(struct ast_channel *chan, int turnon) =
+	stub_ast_monitor_setjoinfiles;
+
