[asterisk-commits] russell: branch group/res_config_ldap r81385 - in /team/group/res_config_ldap...
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Thu Aug 30 10:46:51 CDT 2007
Author: russell
Date: Thu Aug 30 10:46:48 2007
New Revision: 81385
URL: http://svn.digium.com/view/asterisk?view=rev&rev=81385
Log:
resolve conflict, reset automerge
Added:
team/group/res_config_ldap/apps/app_readexten.c
- copied unchanged from r81384, trunk/apps/app_readexten.c
team/group/res_config_ldap/funcs/func_volume.c
- copied unchanged from r81384, trunk/funcs/func_volume.c
team/group/res_config_ldap/include/asterisk/astobj2.h
- copied unchanged from r81384, trunk/include/asterisk/astobj2.h
team/group/res_config_ldap/include/asterisk/audiohook.h
- copied unchanged from r81384, trunk/include/asterisk/audiohook.h
team/group/res_config_ldap/include/asterisk/extconf.h
- copied unchanged from r81384, trunk/include/asterisk/extconf.h
team/group/res_config_ldap/include/asterisk/pval.h
- copied unchanged from r81384, trunk/include/asterisk/pval.h
team/group/res_config_ldap/main/astobj2.c
- copied unchanged from r81384, trunk/main/astobj2.c
team/group/res_config_ldap/main/audiohook.c
- copied unchanged from r81384, trunk/main/audiohook.c
team/group/res_config_ldap/pbx/ael/ael-test/ael-vtest21/
- copied from r81384, trunk/pbx/ael/ael-test/ael-vtest21/
team/group/res_config_ldap/pbx/ael/ael-test/ael-vtest21/extensions.ael
- copied unchanged from r81384, trunk/pbx/ael/ael-test/ael-vtest21/extensions.ael
team/group/res_config_ldap/pbx/ael/ael-test/ref.ael-vtest21
- copied unchanged from r81384, trunk/pbx/ael/ael-test/ref.ael-vtest21
team/group/res_config_ldap/res/ael/
- copied from r81384, trunk/res/ael/
team/group/res_config_ldap/res/ael/ael.flex
- copied unchanged from r81384, trunk/res/ael/ael.flex
team/group/res_config_ldap/res/ael/ael.tab.c
- copied unchanged from r81384, trunk/res/ael/ael.tab.c
team/group/res_config_ldap/res/ael/ael.tab.h
- copied unchanged from r81384, trunk/res/ael/ael.tab.h
team/group/res_config_ldap/res/ael/ael.y
- copied unchanged from r81384, trunk/res/ael/ael.y
team/group/res_config_ldap/res/ael/ael_lex.c
- copied unchanged from r81384, trunk/res/ael/ael_lex.c
team/group/res_config_ldap/res/ael/pval.c
- copied unchanged from r81384, trunk/res/ael/pval.c
team/group/res_config_ldap/res/res_ael_share.c
- copied unchanged from r81384, trunk/res/res_ael_share.c
team/group/res_config_ldap/utils/conf2ael.c
- copied unchanged from r81384, trunk/utils/conf2ael.c
team/group/res_config_ldap/utils/extconf.c
- copied unchanged from r81384, trunk/utils/extconf.c
Removed:
team/group/res_config_ldap/configs/modem.conf.sample
team/group/res_config_ldap/include/asterisk/chanspy.h
team/group/res_config_ldap/pbx/ael/ael.flex
team/group/res_config_ldap/pbx/ael/ael.tab.c
team/group/res_config_ldap/pbx/ael/ael.tab.h
team/group/res_config_ldap/pbx/ael/ael.y
team/group/res_config_ldap/pbx/ael/ael_lex.c
team/group/res_config_ldap/res/res_eventtest.c
Modified:
team/group/res_config_ldap/ (props changed)
team/group/res_config_ldap/CHANGES
team/group/res_config_ldap/Makefile
team/group/res_config_ldap/UPGRADE.txt
team/group/res_config_ldap/apps/app_alarmreceiver.c
team/group/res_config_ldap/apps/app_amd.c
team/group/res_config_ldap/apps/app_chanspy.c
team/group/res_config_ldap/apps/app_dial.c
team/group/res_config_ldap/apps/app_directed_pickup.c
team/group/res_config_ldap/apps/app_directory.c
team/group/res_config_ldap/apps/app_exec.c
team/group/res_config_ldap/apps/app_externalivr.c
team/group/res_config_ldap/apps/app_festival.c
team/group/res_config_ldap/apps/app_followme.c
team/group/res_config_ldap/apps/app_meetme.c
team/group/res_config_ldap/apps/app_minivm.c
team/group/res_config_ldap/apps/app_mixmonitor.c
team/group/res_config_ldap/apps/app_osplookup.c
team/group/res_config_ldap/apps/app_parkandannounce.c
team/group/res_config_ldap/apps/app_playback.c
team/group/res_config_ldap/apps/app_privacy.c
team/group/res_config_ldap/apps/app_queue.c
team/group/res_config_ldap/apps/app_rpt.c
team/group/res_config_ldap/apps/app_senddtmf.c
team/group/res_config_ldap/apps/app_speech_utils.c
team/group/res_config_ldap/apps/app_test.c
team/group/res_config_ldap/apps/app_voicemail.c
team/group/res_config_ldap/apps/app_while.c
team/group/res_config_ldap/build_tools/cflags.xml
team/group/res_config_ldap/build_tools/make_build_h
team/group/res_config_ldap/build_tools/make_buildopts_h
team/group/res_config_ldap/build_tools/make_version
team/group/res_config_ldap/build_tools/mkpkgconfig
team/group/res_config_ldap/build_tools/prep_moduledeps
team/group/res_config_ldap/build_tools/strip_nonapi
team/group/res_config_ldap/cdr/cdr_adaptive_odbc.c
team/group/res_config_ldap/cdr/cdr_csv.c
team/group/res_config_ldap/cdr/cdr_custom.c
team/group/res_config_ldap/cdr/cdr_manager.c
team/group/res_config_ldap/cdr/cdr_odbc.c
team/group/res_config_ldap/cdr/cdr_pgsql.c
team/group/res_config_ldap/cdr/cdr_radius.c
team/group/res_config_ldap/cdr/cdr_sqlite3_custom.c
team/group/res_config_ldap/cdr/cdr_tds.c
team/group/res_config_ldap/channels/chan_agent.c
team/group/res_config_ldap/channels/chan_alsa.c
team/group/res_config_ldap/channels/chan_features.c
team/group/res_config_ldap/channels/chan_gtalk.c
team/group/res_config_ldap/channels/chan_h323.c
team/group/res_config_ldap/channels/chan_iax2.c
team/group/res_config_ldap/channels/chan_jingle.c
team/group/res_config_ldap/channels/chan_local.c
team/group/res_config_ldap/channels/chan_mgcp.c
team/group/res_config_ldap/channels/chan_misdn.c
team/group/res_config_ldap/channels/chan_nbs.c
team/group/res_config_ldap/channels/chan_oss.c
team/group/res_config_ldap/channels/chan_phone.c
team/group/res_config_ldap/channels/chan_sip.c
team/group/res_config_ldap/channels/chan_skinny.c
team/group/res_config_ldap/channels/chan_vpb.cc
team/group/res_config_ldap/channels/chan_zap.c
team/group/res_config_ldap/channels/h323/ast_h323.cxx
team/group/res_config_ldap/channels/iax2-parser.c
team/group/res_config_ldap/channels/iax2-provision.c
team/group/res_config_ldap/channels/iax2-provision.h
team/group/res_config_ldap/channels/misdn/chan_misdn_config.h
team/group/res_config_ldap/channels/misdn/ie.c
team/group/res_config_ldap/channels/misdn/isdn_lib.c
team/group/res_config_ldap/channels/misdn/isdn_msg_parser.c
team/group/res_config_ldap/channels/misdn_config.c
team/group/res_config_ldap/codecs/codec_adpcm.c
team/group/res_config_ldap/codecs/codec_alaw.c
team/group/res_config_ldap/codecs/codec_g722.c
team/group/res_config_ldap/codecs/codec_g726.c
team/group/res_config_ldap/codecs/codec_gsm.c
team/group/res_config_ldap/codecs/codec_lpc10.c
team/group/res_config_ldap/codecs/codec_speex.c
team/group/res_config_ldap/codecs/codec_ulaw.c
team/group/res_config_ldap/codecs/codec_zap.c
team/group/res_config_ldap/codecs/slin_ulaw_ex.h
team/group/res_config_ldap/codecs/ulaw_slin_ex.h
team/group/res_config_ldap/configs/cdr.conf.sample
team/group/res_config_ldap/configs/enum.conf.sample
team/group/res_config_ldap/configs/extensions.ael.sample
team/group/res_config_ldap/configs/extensions.conf.sample
team/group/res_config_ldap/configs/indications.conf.sample
team/group/res_config_ldap/configs/logger.conf.sample
team/group/res_config_ldap/configs/queues.conf.sample
team/group/res_config_ldap/configs/sip.conf.sample
team/group/res_config_ldap/configs/skinny.conf.sample
team/group/res_config_ldap/configure
team/group/res_config_ldap/configure.ac
team/group/res_config_ldap/contrib/scripts/vmail.cgi
team/group/res_config_ldap/doc/asterisk-mib.txt
team/group/res_config_ldap/doc/jabber.txt
team/group/res_config_ldap/doc/tex/asterisk-conf.tex
team/group/res_config_ldap/funcs/func_devstate.c
team/group/res_config_ldap/funcs/func_enum.c
team/group/res_config_ldap/funcs/func_lock.c
team/group/res_config_ldap/funcs/func_odbc.c
team/group/res_config_ldap/funcs/func_timeout.c
team/group/res_config_ldap/include/asterisk/ael_structs.h
team/group/res_config_ldap/include/asterisk/alaw.h
team/group/res_config_ldap/include/asterisk/app.h
team/group/res_config_ldap/include/asterisk/ast_expr.h
team/group/res_config_ldap/include/asterisk/autoconfig.h.in
team/group/res_config_ldap/include/asterisk/channel.h
team/group/res_config_ldap/include/asterisk/config.h
team/group/res_config_ldap/include/asterisk/devicestate.h
team/group/res_config_ldap/include/asterisk/event.h
team/group/res_config_ldap/include/asterisk/event_defs.h
team/group/res_config_ldap/include/asterisk/features.h
team/group/res_config_ldap/include/asterisk/fskmodem.h
team/group/res_config_ldap/include/asterisk/linkedlists.h
team/group/res_config_ldap/include/asterisk/lock.h
team/group/res_config_ldap/include/asterisk/manager.h
team/group/res_config_ldap/include/asterisk/pbx.h
team/group/res_config_ldap/include/asterisk/sched.h
team/group/res_config_ldap/include/asterisk/slinfactory.h
team/group/res_config_ldap/include/asterisk/speech.h
team/group/res_config_ldap/include/asterisk/strings.h
team/group/res_config_ldap/include/asterisk/ulaw.h
team/group/res_config_ldap/include/asterisk/utils.h
team/group/res_config_ldap/main/Makefile
team/group/res_config_ldap/main/alaw.c
team/group/res_config_ldap/main/app.c
team/group/res_config_ldap/main/asterisk.c
team/group/res_config_ldap/main/astmm.c
team/group/res_config_ldap/main/callerid.c
team/group/res_config_ldap/main/cdr.c
team/group/res_config_ldap/main/channel.c
team/group/res_config_ldap/main/config.c
team/group/res_config_ldap/main/devicestate.c
team/group/res_config_ldap/main/dial.c
team/group/res_config_ldap/main/dnsmgr.c
team/group/res_config_ldap/main/dsp.c
team/group/res_config_ldap/main/enum.c
team/group/res_config_ldap/main/event.c
team/group/res_config_ldap/main/file.c
team/group/res_config_ldap/main/frame.c
team/group/res_config_ldap/main/fskmodem.c
team/group/res_config_ldap/main/http.c
team/group/res_config_ldap/main/loader.c
team/group/res_config_ldap/main/logger.c
team/group/res_config_ldap/main/manager.c
team/group/res_config_ldap/main/minimime/mm.h
team/group/res_config_ldap/main/minimime/mm_base64.c
team/group/res_config_ldap/main/minimime/mm_codecs.c
team/group/res_config_ldap/main/minimime/mm_mem.h
team/group/res_config_ldap/main/minimime/mm_util.c
team/group/res_config_ldap/main/pbx.c
team/group/res_config_ldap/main/rtp.c
team/group/res_config_ldap/main/sched.c
team/group/res_config_ldap/main/sha1.c
team/group/res_config_ldap/main/slinfactory.c
team/group/res_config_ldap/main/tdd.c
team/group/res_config_ldap/main/translate.c
team/group/res_config_ldap/main/udptl.c
team/group/res_config_ldap/main/ulaw.c
team/group/res_config_ldap/main/utils.c
team/group/res_config_ldap/pbx/Makefile
team/group/res_config_ldap/pbx/ael/ael-test/ael-test5/extensions.ael
team/group/res_config_ldap/pbx/ael/ael-test/ael-test6/extensions.ael
team/group/res_config_ldap/pbx/ael/ael-test/ref.ael-ntest10
team/group/res_config_ldap/pbx/ael/ael-test/ref.ael-test1
team/group/res_config_ldap/pbx/ael/ael-test/ref.ael-test11
team/group/res_config_ldap/pbx/ael/ael-test/ref.ael-test14
team/group/res_config_ldap/pbx/ael/ael-test/ref.ael-test15
team/group/res_config_ldap/pbx/ael/ael-test/ref.ael-test16
team/group/res_config_ldap/pbx/ael/ael-test/ref.ael-test19
team/group/res_config_ldap/pbx/ael/ael-test/ref.ael-test2
team/group/res_config_ldap/pbx/ael/ael-test/ref.ael-test3
team/group/res_config_ldap/pbx/ael/ael-test/ref.ael-test4
team/group/res_config_ldap/pbx/ael/ael-test/ref.ael-test5
team/group/res_config_ldap/pbx/ael/ael-test/ref.ael-test6
team/group/res_config_ldap/pbx/ael/ael-test/ref.ael-test7
team/group/res_config_ldap/pbx/ael/ael-test/ref.ael-vtest13
team/group/res_config_ldap/pbx/ael/ael-test/ref.ael-vtest17
team/group/res_config_ldap/pbx/pbx_ael.c
team/group/res_config_ldap/pbx/pbx_config.c
team/group/res_config_ldap/pbx/pbx_dundi.c
team/group/res_config_ldap/pbx/pbx_spool.c
team/group/res_config_ldap/res/Makefile
team/group/res_config_ldap/res/res_adsi.c
team/group/res_config_ldap/res/res_agi.c
team/group/res_config_ldap/res/res_config_odbc.c
team/group/res_config_ldap/res/res_config_pgsql.c
team/group/res_config_ldap/res/res_config_sqlite.c
team/group/res_config_ldap/res/res_crypto.c
team/group/res_config_ldap/res/res_features.c
team/group/res_config_ldap/res/res_indications.c
team/group/res_config_ldap/res/res_jabber.c
team/group/res_config_ldap/res/res_musiconhold.c
team/group/res_config_ldap/res/res_odbc.c
team/group/res_config_ldap/res/res_smdi.c
team/group/res_config_ldap/res/res_snmp.c
team/group/res_config_ldap/res/res_speech.c
team/group/res_config_ldap/res/snmp/agent.c
team/group/res_config_ldap/utils/Makefile
team/group/res_config_ldap/utils/ael_main.c
team/group/res_config_ldap/utils/check_expr.c
team/group/res_config_ldap/utils/smsq.c
Propchange: team/group/res_config_ldap/
------------------------------------------------------------------------------
Binary property 'branch-1.4-blocked' - no diff available.
Propchange: team/group/res_config_ldap/
------------------------------------------------------------------------------
Binary property 'branch-1.4-merged' - no diff available.
Propchange: team/group/res_config_ldap/
------------------------------------------------------------------------------
--- svnmerge-integrated (original)
+++ svnmerge-integrated Thu Aug 30 10:46:48 2007
@@ -1,1 +1,1 @@
-/trunk:1-78029
+/trunk:1-81384
Modified: team/group/res_config_ldap/CHANGES
URL: http://svn.digium.com/view/asterisk/team/group/res_config_ldap/CHANGES?view=diff&rev=81385&r1=81384&r2=81385
==============================================================================
--- team/group/res_config_ldap/CHANGES (original)
+++ team/group/res_config_ldap/CHANGES Thu Aug 30 10:46:48 2007
@@ -21,6 +21,7 @@
are currently active on the system.
* Added a "ListAllVoicemailUsers" action that allows you to get a list of all
the voicemail users setup.
+ * Added 'DBDel' and 'DBDelTree' manager commands.
Dialplan functions
------------------
@@ -124,6 +125,11 @@
* Added support for storage of greetings using an IMAP server
* Added ability to customize forward, reverse, stop, and pause keys for message playback
* SMDI is now enabled in voicemail using the smdienable option.
+ * A "lockmode" option has been added to asterisk.conf to configure the file
+ locking method used for voicemail, and potentially other things in the
+ future. The default is the old behavior, lockfile. However, there is a
+ new method, "flock", that uses a different method for situations where the
+ lockfile will not work, such as on SMB/CIFS mounts.
Queue changes
-------------
@@ -144,6 +150,7 @@
position changes frequently.
* Added additional information to EXITWITHTIMEOUT and EXITWITHKEY events in the
queue log.
+ * Added ability for non-realtime queues to have realtime members
MeetMe Changes
--------------
@@ -185,6 +192,12 @@
by saying "local myvar=someval;" or using Set() in this
fashion: Set(LOCAL(myvar)=someval); ("local" is now
an AEL keyword).
+ * utils/conf2ael introduced. Will convert an extensions.conf
+ file into extensions.ael. Very crude and unfinished, but
+ will be improved as time goes by. Should be useful for a
+ first pass at conversion.
+ * aelparse will now read extensions.conf to see if a referenced
+ macro or context is there before issueing a warning.
Zaptel channel driver (chan_zap) Changes
----------------------------------------
@@ -245,7 +258,6 @@
* Added G729 passthrough support to chan_phone for Sigma Designs boards.
* Added 's' option to Page application.
* Added 'E' and 'V' commands to ExternalIVR.
- * Added 'DBDel' and 'DBDelTree' manager commands.
* Added 'o' and 'X' options to Chanspy.
* Added a new CDR module, cdr_sqlite3_custom.
* The cdr_manager module has a [mappings] feature, like cdr_custom,
@@ -260,3 +272,5 @@
* The device state functionality in the Local channel driver has been updated
to indicate INUSE or NOT_INUSE when a Local channel is being used as opposed
to just UNKNOWN if the extension exists.
+ * When originating a call using AMI or pbx_spool that fails the reason for failure
+ will now be available in the failed extension using the REASON dialplan variable.
Modified: team/group/res_config_ldap/Makefile
URL: http://svn.digium.com/view/asterisk/team/group/res_config_ldap/Makefile?view=diff&rev=81385&r1=81384&r2=81385
==============================================================================
--- team/group/res_config_ldap/Makefile (original)
+++ team/group/res_config_ldap/Makefile Thu Aug 30 10:46:48 2007
@@ -59,6 +59,8 @@
export SOLINK
export STRIP
export DOWNLOAD
+export GREP
+export ID
export OSARCH
export CURSES_DIR
export NCURSES_DIR
@@ -73,6 +75,10 @@
ifneq ($(wildcard makeopts),)
include makeopts
endif
+
+# Some build systems, such as the one in openwrt, like to pass custom target
+# CFLAGS in the COPTS variable.
+ASTCFLAGS+=$(COPTS)
#Uncomment this to see all build commands instead of 'quiet' output
#NOISY_BUILD=yes
@@ -281,7 +287,11 @@
@echo " + Asterisk has successfully been built, and +"
@echo " + can be installed by running: +"
@echo " + +"
+ifeq ($(MAKE), gmake)
+ @echo " + $(MAKE) install +"
+else
@echo " + $(MAKE) install +"
+endif
@echo " +-------------------------------------------+"
_all: cleantest $(SUBDIRS)
@@ -490,14 +500,22 @@
@echo " + configuration files (overwriting any +"
@echo " + existing config files), run: +"
@echo " + +"
+ifeq ($(MAKE), gmake)
+ @echo " + $(MAKE) samples +"
+else
@echo " + $(MAKE) samples +"
+endif
@echo " + +"
@echo " +----------------- or ---------------------+"
@echo " + +"
@echo " + You can go ahead and install the asterisk +"
@echo " + program documentation now or later run: +"
@echo " + +"
+ifeq ($(MAKE), gmake)
+ @echo " + $(MAKE) progdocs +"
+else
@echo " + $(MAKE) progdocs +"
+endif
@echo " + +"
@echo " + **Note** This requires that you have +"
@echo " + doxygen installed on your local system +"
@@ -638,9 +656,7 @@
# last clean count we had
cleantest:
- @if ! cmp -s .cleancount .lastclean ; then \
- $(MAKE) clean;\
- fi
+ @cmp -s .cleancount .lastclean || $(MAKE) clean
$(SUBDIRS_UNINSTALL):
@$(MAKE) --no-print-directory -C $(@:-uninstall=) uninstall
@@ -669,7 +685,11 @@
@echo " + directories, and logs, run the following +"
@echo " + command: +"
@echo " + +"
+ifeq ($(MAKE), gmake)
+ @echo " + $(MAKE) uninstall-all +"
+else
@echo " + $(MAKE) uninstall-all +"
+endif
@echo " +-------------------------------------------+"
uninstall-all: _uninstall
Modified: team/group/res_config_ldap/UPGRADE.txt
URL: http://svn.digium.com/view/asterisk/team/group/res_config_ldap/UPGRADE.txt?view=diff&rev=81385&r1=81384&r2=81385
==============================================================================
--- team/group/res_config_ldap/UPGRADE.txt (original)
+++ team/group/res_config_ldap/UPGRADE.txt Thu Aug 30 10:46:48 2007
@@ -16,6 +16,10 @@
best to insert a Return() app call at the end of your macro if you did
not include it, but really, you should make sure that all execution
paths within your macros end in "return;".
+
+* The conf2ael program is 'introduced' in this release; it is in a rather
+ crude state, but deemed useful for making a first pass at converting
+ extensions.conf code into AEL. More intelligence will come with time.
Core:
@@ -44,6 +48,10 @@
to work correctly in 1.4 and previous versions. This should make writing
dialplans less painful in the future, albeit with the pain of a one-time
conversion.
+
+* The logger.conf option 'rotatetimestamp' has been deprecated in favor of
+ 'rotatestrategy'. This new option supports a 'rotate' strategy that more
+ closely mimics the system logger in terms of file rotation.
Voicemail:
Modified: team/group/res_config_ldap/apps/app_alarmreceiver.c
URL: http://svn.digium.com/view/asterisk/team/group/res_config_ldap/apps/app_alarmreceiver.c?view=diff&rev=81385&r1=81384&r2=81385
==============================================================================
--- team/group/res_config_ldap/apps/app_alarmreceiver.c (original)
+++ team/group/res_config_ldap/apps/app_alarmreceiver.c Thu Aug 30 10:46:48 2007
@@ -714,10 +714,11 @@
{
struct ast_config *cfg;
const char *p;
+ struct ast_flags config_flags = { 0 };
/* Read in the config file */
- cfg = ast_config_load(ALMRCV_CONFIG);
+ cfg = ast_config_load(ALMRCV_CONFIG, config_flags);
if(!cfg){
Modified: team/group/res_config_ldap/apps/app_amd.c
URL: http://svn.digium.com/view/asterisk/team/group/res_config_ldap/apps/app_amd.c?view=diff&rev=81385&r1=81384&r2=81385
==============================================================================
--- team/group/res_config_ldap/apps/app_amd.c (original)
+++ team/group/res_config_ldap/apps/app_amd.c Thu Aug 30 10:46:48 2007
@@ -317,16 +317,18 @@
return 0;
}
-static void load_config(void)
+static void load_config(int reload)
{
struct ast_config *cfg = NULL;
char *cat = NULL;
struct ast_variable *var = NULL;
-
- if (!(cfg = ast_config_load("amd.conf"))) {
+ struct ast_flags config_flags = { reload ? CONFIG_FLAG_FILEUNCHANGED : 0 };
+
+ if (!(cfg = ast_config_load("amd.conf", config_flags))) {
ast_log(LOG_ERROR, "Configuration file amd.conf missing.\n");
return;
- }
+ } else if (cfg == CONFIG_STATUS_FILEUNCHANGED)
+ return;
cat = ast_category_browse(cfg, NULL);
@@ -377,13 +379,13 @@
static int load_module(void)
{
- load_config();
+ load_config(0);
return ast_register_application(app, amd_exec, synopsis, descrip);
}
static int reload(void)
{
- load_config();
+ load_config(1);
return 0;
}
Modified: team/group/res_config_ldap/apps/app_chanspy.c
URL: http://svn.digium.com/view/asterisk/team/group/res_config_ldap/apps/app_chanspy.c?view=diff&rev=81385&r1=81384&r2=81385
==============================================================================
--- team/group/res_config_ldap/apps/app_chanspy.c (original)
+++ team/group/res_config_ldap/apps/app_chanspy.c Thu Aug 30 10:46:48 2007
@@ -40,7 +40,7 @@
#include "asterisk/file.h"
#include "asterisk/logger.h"
#include "asterisk/channel.h"
-#include "asterisk/chanspy.h"
+#include "asterisk/audiohook.h"
#include "asterisk/features.h"
#include "asterisk/options.h"
#include "asterisk/app.h"
@@ -166,7 +166,8 @@
struct chanspy_translation_helper {
/* spy data */
- struct ast_channel_spy spy;
+ struct ast_audiohook spy_audiohook;
+ struct ast_audiohook whisper_audiohook;
int fd;
int volfactor;
};
@@ -185,15 +186,18 @@
static int spy_generate(struct ast_channel *chan, void *data, int len, int samples)
{
struct chanspy_translation_helper *csth = data;
- struct ast_frame *f;
+ struct ast_frame *f = NULL;
- if (csth->spy.status != CHANSPY_RUNNING)
+ ast_audiohook_lock(&csth->spy_audiohook);
+ if (csth->spy_audiohook.status != AST_AUDIOHOOK_STATUS_RUNNING) {
/* Channel is already gone more than likely */
+ ast_audiohook_unlock(&csth->spy_audiohook);
return -1;
-
- ast_mutex_lock(&csth->spy.lock);
- f = ast_channel_spy_read_frame(&csth->spy, samples);
- ast_mutex_unlock(&csth->spy.lock);
+ }
+
+ f = ast_audiohook_read_frame(&csth->spy_audiohook, samples, AST_AUDIOHOOK_DIRECTION_BOTH, AST_FORMAT_SLINEAR);
+
+ ast_audiohook_unlock(&csth->spy_audiohook);
if (!f)
return 0;
@@ -217,50 +221,19 @@
.generate = spy_generate,
};
-static int start_spying(struct ast_channel *chan, struct ast_channel *spychan, struct ast_channel_spy *spy)
-{
- int res;
- struct ast_channel *peer;
+static int start_spying(struct ast_channel *chan, struct ast_channel *spychan, struct ast_audiohook *audiohook)
+{
+ int res = 0;
+ struct ast_channel *peer = NULL;
ast_log(LOG_NOTICE, "Attaching %s to %s\n", spychan->name, chan->name);
- ast_channel_lock(chan);
- res = ast_channel_spy_add(chan, spy);
- ast_channel_unlock(chan);
+ res = ast_audiohook_attach(chan, audiohook);
if (!res && ast_test_flag(chan, AST_FLAG_NBRIDGE) && (peer = ast_bridged_channel(chan)))
ast_softhangup(peer, AST_SOFTHANGUP_UNBRIDGE);
return res;
-}
-
-/* Map 'volume' levels from -4 through +4 into
- decibel (dB) settings for channel drivers
-*/
-static signed char volfactor_map[] = {
- -24,
- -18,
- -12,
- -6,
- 0,
- 6,
- 12,
- 18,
- 24,
-};
-
-/* attempt to set the desired gain adjustment via the channel driver;
- if successful, clear it out of the csth structure so the
- generator will not attempt to do the adjustment itself
-*/
-static void set_volume(struct ast_channel *chan, struct chanspy_translation_helper *csth)
-{
- signed char volume_adjust = volfactor_map[csth->volfactor + 4];
-
- if (!ast_channel_setoption(chan, AST_OPTION_TXGAIN, &volume_adjust, sizeof(volume_adjust), 0))
- csth->volfactor = 0;
- csth->spy.read_vol_adjustment = csth->volfactor;
- csth->spy.write_vol_adjustment = csth->volfactor;
}
static int channel_spy(struct ast_channel *chan, struct ast_channel *spyee, int *volfactor, int fd,
@@ -280,49 +253,17 @@
ast_verb(2, "Spying on channel %s\n", name);
memset(&csth, 0, sizeof(csth));
- ast_set_flag(&csth.spy, CHANSPY_FORMAT_AUDIO);
- ast_set_flag(&csth.spy, CHANSPY_TRIGGER_NONE);
- if (!ast_test_flag(flags, OPTION_READONLY))
- ast_set_flag(&csth.spy, CHANSPY_MIXAUDIO);
- csth.spy.type = "ChanSpy";
- csth.spy.status = CHANSPY_RUNNING;
- csth.spy.read_queue.format = AST_FORMAT_SLINEAR;
- csth.spy.write_queue.format = AST_FORMAT_SLINEAR;
- ast_mutex_init(&csth.spy.lock);
- csth.volfactor = *volfactor;
- set_volume(chan, &csth);
- if (csth.volfactor) {
- ast_set_flag(&csth.spy, CHANSPY_READ_VOLADJUST);
- csth.spy.read_vol_adjustment = csth.volfactor;
- ast_set_flag(&csth.spy, CHANSPY_WRITE_VOLADJUST);
- csth.spy.write_vol_adjustment = csth.volfactor;
- }
- csth.fd = fd;
+
+ ast_audiohook_init(&csth.spy_audiohook, AST_AUDIOHOOK_TYPE_SPY, "ChanSpy");
- if (start_spying(spyee, chan, &csth.spy)) {
- ast_mutex_destroy(&csth.spy.lock);
+ if (start_spying(spyee, chan, &csth.spy_audiohook)) {
+ ast_audiohook_destroy(&csth.spy_audiohook);
return 0;
}
if (ast_test_flag(flags, OPTION_WHISPER)) {
- struct ast_filestream *beepstream;
- int old_write_format = 0;
-
- ast_channel_whisper_start(csth.spy.chan);
- old_write_format = chan->writeformat;
- if ((beepstream = ast_openstream_full(chan, "beep", chan->language, 1))) {
- struct ast_frame *f;
-
- while ((f = ast_readframe(beepstream))) {
- ast_channel_whisper_feed(csth.spy.chan, f);
- ast_frfree(f);
- }
-
- ast_closestream(beepstream);
- chan->stream = NULL;
- }
- if (old_write_format)
- ast_set_write_format(chan, old_write_format);
+ ast_audiohook_init(&csth.whisper_audiohook, AST_AUDIOHOOK_TYPE_WHISPER, "ChanSpy");
+ start_spying(spyee, chan, &csth.whisper_audiohook);
}
if (ast_test_flag(flags, OPTION_PRIVATE))
@@ -344,21 +285,20 @@
has arrived, since the spied-on channel could have gone away while
we were waiting
*/
- while ((res = ast_waitfor(chan, -1) > -1) &&
- csth.spy.status == CHANSPY_RUNNING &&
- csth.spy.chan) {
+ while ((res = ast_waitfor(chan, -1) > -1) && csth.spy_audiohook.status == AST_AUDIOHOOK_STATUS_RUNNING) {
if (!(f = ast_read(chan)) || ast_check_hangup(chan)) {
running = -1;
break;
}
- if (ast_test_flag(flags, OPTION_WHISPER) &&
- (f->frametype == AST_FRAME_VOICE)) {
- ast_channel_whisper_feed(csth.spy.chan, f);
+ if (ast_test_flag(flags, OPTION_WHISPER) && f->frametype == AST_FRAME_VOICE) {
+ ast_audiohook_lock(&csth.whisper_audiohook);
+ ast_audiohook_write_frame(&csth.whisper_audiohook, AST_AUDIOHOOK_DIRECTION_WRITE, f);
+ ast_audiohook_unlock(&csth.whisper_audiohook);
ast_frfree(f);
continue;
}
-
+
res = (f->frametype == AST_FRAME_DTMF) ? f->subclass : 0;
ast_frfree(f);
if (!res)
@@ -401,37 +341,25 @@
if (*volfactor > 4)
*volfactor = -4;
ast_verb(3, "Setting spy volume on %s to %d\n", chan->name, *volfactor);
- csth.volfactor = *volfactor;
- set_volume(chan, &csth);
- if (csth.volfactor) {
- ast_set_flag(&csth.spy, CHANSPY_READ_VOLADJUST);
- csth.spy.read_vol_adjustment = csth.volfactor;
- ast_set_flag(&csth.spy, CHANSPY_WRITE_VOLADJUST);
- csth.spy.write_vol_adjustment = csth.volfactor;
- } else {
- ast_clear_flag(&csth.spy, CHANSPY_READ_VOLADJUST);
- ast_clear_flag(&csth.spy, CHANSPY_WRITE_VOLADJUST);
- }
- }
- }
-
- if (ast_test_flag(flags, OPTION_WHISPER) && csth.spy.chan)
- ast_channel_whisper_stop(csth.spy.chan);
+ }
+ }
if (ast_test_flag(flags, OPTION_PRIVATE))
ast_channel_stop_silence_generator(chan, silgen);
else
ast_deactivate_generator(chan);
- csth.spy.status = CHANSPY_DONE;
-
- /* If a channel still exists on our spy structure then we need to remove ourselves */
- if (csth.spy.chan) {
- ast_channel_lock(csth.spy.chan);
- ast_channel_spy_remove(csth.spy.chan, &csth.spy);
- ast_channel_unlock(csth.spy.chan);
- }
- ast_channel_spy_free(&csth.spy);
+ if (ast_test_flag(flags, OPTION_WHISPER)) {
+ ast_audiohook_lock(&csth.whisper_audiohook);
+ ast_audiohook_detach(&csth.whisper_audiohook);
+ ast_audiohook_unlock(&csth.whisper_audiohook);
+ ast_audiohook_destroy(&csth.whisper_audiohook);
+ }
+
+ ast_audiohook_lock(&csth.spy_audiohook);
+ ast_audiohook_detach(&csth.spy_audiohook);
+ ast_audiohook_unlock(&csth.spy_audiohook);
+ ast_audiohook_destroy(&csth.spy_audiohook);
if (option_verbose >= 2)
ast_verbose(VERBOSE_PREFIX_2 "Done Spying on channel %s\n", name);
Modified: team/group/res_config_ldap/apps/app_dial.c
URL: http://svn.digium.com/view/asterisk/team/group/res_config_ldap/apps/app_dial.c?view=diff&rev=81385&r1=81384&r2=81385
==============================================================================
--- team/group/res_config_ldap/apps/app_dial.c (original)
+++ team/group/res_config_ldap/apps/app_dial.c Thu Aug 30 10:46:48 2007
@@ -560,6 +560,9 @@
struct ast_channel *peer = NULL;
/* single is set if only one destination is enabled */
int single = outgoing && !outgoing->next && !ast_test_flag64(outgoing, OPT_MUSICBACK | OPT_RINGBACK);
+#ifdef HAVE_EPOLL
+ struct chanlist *epollo;
+#endif
if (single) {
/* Turn off hold music, etc */
@@ -567,7 +570,11 @@
/* If we are calling a single channel, make them compatible for in-band tone purpose */
ast_channel_make_compatible(outgoing->chan, in);
}
-
+
+#ifdef HAVE_EPOLL
+ for (epollo = outgoing; epollo; epollo = epollo->next)
+ ast_poll_channel_add(in, epollo->chan);
+#endif
while (*to && !peer) {
struct chanlist *o;
@@ -814,6 +821,11 @@
}
+#ifdef HAVE_EPOLL
+ for (epollo = outgoing; epollo; epollo = epollo->next)
+ ast_poll_channel_del(in, epollo->chan);
+#endif
+
return peer;
}
@@ -1527,7 +1539,7 @@
/* Ok, done. stop autoservice */
res = ast_autoservice_stop(chan);
if (digit > 0 && !res)
- res = ast_senddigit(chan, digit);
+ res = ast_senddigit(chan, digit, 0);
else
res = digit;
@@ -1696,12 +1708,12 @@
if (!ast_strlen_zero(dtmfcalled)) {
if (option_verbose > 2)
ast_verbose(VERBOSE_PREFIX_3 "Sending DTMF '%s' to the called party.\n", dtmfcalled);
- res = ast_dtmf_stream(peer,chan,dtmfcalled,250);
+ res = ast_dtmf_stream(peer,chan,dtmfcalled,250,0);
}
if (!ast_strlen_zero(dtmfcalling)) {
if (option_verbose > 2)
ast_verbose(VERBOSE_PREFIX_3 "Sending DTMF '%s' to the calling party.\n", dtmfcalling);
- res = ast_dtmf_stream(chan,peer,dtmfcalling,250);
+ res = ast_dtmf_stream(chan,peer,dtmfcalling,250,0);
}
}
Modified: team/group/res_config_ldap/apps/app_directed_pickup.c
URL: http://svn.digium.com/view/asterisk/team/group/res_config_ldap/apps/app_directed_pickup.c?view=diff&rev=81385&r1=81384&r2=81385
==============================================================================
--- team/group/res_config_ldap/apps/app_directed_pickup.c (original)
+++ team/group/res_config_ldap/apps/app_directed_pickup.c Thu Aug 30 10:46:48 2007
@@ -42,17 +42,21 @@
#include "asterisk/lock.h"
#include "asterisk/app.h"
#include "asterisk/options.h"
+#include "asterisk/features.h"
#define PICKUPMARK "PICKUPMARK"
static const char *app = "Pickup";
static const char *synopsis = "Directed Call Pickup";
static const char *descrip =
-" Pickup(extension[@context][&extension2 at context...]): This application can pickup any ringing channel\n"
-"that is calling the specified extension. If no context is specified, the current\n"
-"context will be used. If you use the special string \"PICKUPMARK\" for the context parameter, for example\n"
-"10 at PICKUPMARK, this application tries to find a channel which has defined a channel variable with the same content\n"
-"as \"extension\".";
+" Pickup([extension[@context][&extension2 at context...]]): This application can\n"
+"pickup any ringing channel that is calling the specified extension. If no\n"
+"context is specified, the current context will be used. If you use the special\n"
+"string \"PICKUPMARK\" for the context parameter, for example 10 at PICKUPMARK,\n"
+"this application tries to find a channel which has defined a ${PICKUPMARK}\n"
+"channel variable with the same value as \"extension\" (in this example, \"10\").\n"
+"When no parameter is specified, the application will pickup a channel matching\n"
+"the pickup group of the active channel.";
/* Perform actual pickup between two channels */
static int pickup_do(struct ast_channel *chan, struct ast_channel *target)
@@ -137,8 +141,8 @@
char *exten = NULL, *context = NULL;
if (ast_strlen_zero(data)) {
- ast_log(LOG_WARNING, "Pickup requires an argument (extension)!\n");
- return -1;
+ res = ast_pickup_call(chan);
+ return res;
}
/* Parse extension (and context if there) */
Modified: team/group/res_config_ldap/apps/app_directory.c
URL: http://svn.digium.com/view/asterisk/team/group/res_config_ldap/apps/app_directory.c?view=diff&rev=81385&r1=81384&r2=81385
==============================================================================
--- team/group/res_config_ldap/apps/app_directory.c (original)
+++ team/group/res_config_ldap/apps/app_directory.c Thu Aug 30 10:46:48 2007
@@ -89,6 +89,36 @@
#ifdef ODBC_STORAGE
+struct generic_prepare_struct {
+ const char *sql;
+ const char *param;
+};
+
+static SQLHSTMT generic_prepare(struct odbc_obj *obj, void *data)
+{
+ struct generic_prepare_struct *gps = data;
+ SQLHSTMT stmt;
+ int res;
+
+ res = SQLAllocHandle(SQL_HANDLE_STMT, obj->con, &stmt);
+ if ((res != SQL_SUCCESS) && (res != SQL_SUCCESS_WITH_INFO)) {
+ ast_log(LOG_WARNING, "SQL Alloc Handle failed!\n");
+ return NULL;
+ }
+
+ res = SQLPrepare(stmt, (unsigned char *)gps->sql, SQL_NTS);
+ if ((res != SQL_SUCCESS) && (res != SQL_SUCCESS_WITH_INFO)) {
+ ast_log(LOG_WARNING, "SQL Prepare failed![%s]\n", (char *)gps->sql);
+ SQLFreeHandle(SQL_HANDLE_STMT, stmt);
+ return NULL;
+ }
+
+ if (!ast_strlen_zero(gps->param))
+ SQLBindParameter(stmt, 1, SQL_PARAM_INPUT, SQL_C_CHAR, SQL_CHAR, strlen(gps->param), 0, (void *)gps->param, 0, NULL);
+
+ return stmt;
+}
+
static void retrieve_file(char *dir)
{
int x = 0;
@@ -103,6 +133,7 @@
SQLLEN colsize;
char full_fn[256];
struct odbc_obj *obj;
+ struct generic_prepare_struct gps = { .sql = sql, .param = dir };
obj = ast_odbc_request_obj(odbc_database, 1);
if (obj) {
@@ -114,23 +145,11 @@
if (!strcasecmp(fmt, "wav49"))
strcpy(fmt, "WAV");
snprintf(full_fn, sizeof(full_fn), "%s.%s", dir, fmt);
- res = SQLAllocHandle(SQL_HANDLE_STMT, obj->con, &stmt);
- if ((res != SQL_SUCCESS) && (res != SQL_SUCCESS_WITH_INFO)) {
- ast_log(LOG_WARNING, "SQL Alloc Handle failed!\n");
- break;
- }
snprintf(sql, sizeof(sql), "SELECT recording FROM %s WHERE dir=? AND msgnum=-1", odbc_table);
- res = SQLPrepare(stmt, (unsigned char *)sql, SQL_NTS);
- if ((res != SQL_SUCCESS) && (res != SQL_SUCCESS_WITH_INFO)) {
- ast_log(LOG_WARNING, "SQL Prepare failed![%s]\n", sql);
- SQLFreeHandle(SQL_HANDLE_STMT, stmt);
- break;
- }
- SQLBindParameter(stmt, 1, SQL_PARAM_INPUT, SQL_C_CHAR, SQL_CHAR, strlen(dir), 0, (void *)dir, 0, NULL);
- res = ast_odbc_smart_execute(obj, stmt);
- if ((res != SQL_SUCCESS) && (res != SQL_SUCCESS_WITH_INFO)) {
+ stmt = ast_odbc_prepare_and_execute(obj, generic_prepare, &gps);
+
+ if (!stmt) {
ast_log(LOG_WARNING, "SQL Execute error!\n[%s]\n\n", sql);
- SQLFreeHandle(SQL_HANDLE_STMT, stmt);
break;
}
res = SQLFetch(stmt);
@@ -345,9 +364,10 @@
const char *fullname;
const char *hidefromdir;
char tmp[100];
+ struct ast_flags config_flags = { 0 };
/* Load flat file config. */
- cfg = ast_config_load(VOICEMAIL_CONFIG);
+ cfg = ast_config_load(VOICEMAIL_CONFIG, config_flags);
if (!cfg) {
/* Loading config failed. */
@@ -366,7 +386,7 @@
/* Does the context exist within the config file? If not, make one */
cat = ast_category_get(cfg, context);
if (!cat) {
- cat = ast_category_new(context);
+ cat = ast_category_new(context, "", 99999);
if (!cat) {
ast_log(LOG_WARNING, "Out of memory\n");
ast_config_destroy(cfg);
@@ -382,7 +402,7 @@
snprintf(tmp, sizeof(tmp), "no-password,%s,hidefromdir=%s",
fullname ? fullname : "",
hidefromdir ? hidefromdir : "no");
- var = ast_variable_new(mailbox, tmp);
+ var = ast_variable_new(mailbox, tmp, "");
if (var)
ast_variable_append(cat, var);
else
@@ -578,6 +598,7 @@
int fromappvm = 0;
const char *dirintro;
char *parse;
+ struct ast_flags config_flags = { 0 };
AST_DECLARE_APP_ARGS(args,
AST_APP_ARG(vmcontext);
AST_APP_ARG(dialcontext);
@@ -611,7 +632,7 @@
return -1;
}
- ucfg = ast_config_load("users.conf");
+ ucfg = ast_config_load("users.conf", config_flags);
dirintro = ast_variable_retrieve(cfg, args.vmcontext, "directoryintro");
if (ast_strlen_zero(dirintro))
@@ -655,7 +676,8 @@
static int load_module(void)
{
#ifdef ODBC_STORAGE
- struct ast_config *cfg = ast_config_load(VOICEMAIL_CONFIG);
+ struct ast_flags config_flags = { 0 };
+ struct ast_config *cfg = ast_config_load(VOICEMAIL_CONFIG, config_flags);
const char *tmp;
if (cfg) {
Modified: team/group/res_config_ldap/apps/app_exec.c
[... 30945 lines stripped ...]
More information about the asterisk-commits
mailing list