[asterisk-commits] kpfleming: branch kpfleming/optional_api r157745 - in /team/kpfleming/optiona...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Wed Nov 19 07:48:35 CST 2008


Author: kpfleming
Date: Wed Nov 19 07:48:27 2008
New Revision: 157745

URL: http://svn.digium.com/view/asterisk?view=rev&rev=157745
Log:
bring up to date

Added:
    team/kpfleming/optional_api/UPGRADE-1.6.txt
      - copied unchanged from r157739, trunk/UPGRADE-1.6.txt
    team/kpfleming/optional_api/contrib/init.d/rc.archlinux.asterisk
      - copied unchanged from r157739, trunk/contrib/init.d/rc.archlinux.asterisk
Modified:
    team/kpfleming/optional_api/   (props changed)
    team/kpfleming/optional_api/Makefile
    team/kpfleming/optional_api/UPGRADE.txt   (contents, props changed)
    team/kpfleming/optional_api/apps/app_dial.c
    team/kpfleming/optional_api/apps/app_followme.c
    team/kpfleming/optional_api/apps/app_meetme.c
    team/kpfleming/optional_api/apps/app_stack.c
    team/kpfleming/optional_api/apps/app_voicemail.c
    team/kpfleming/optional_api/build_tools/make_buildopts_h
    team/kpfleming/optional_api/build_tools/make_version
    team/kpfleming/optional_api/channels/chan_local.c
    team/kpfleming/optional_api/channels/chan_sip.c
    team/kpfleming/optional_api/configs/cdr_adaptive_odbc.conf.sample
    team/kpfleming/optional_api/configure
    team/kpfleming/optional_api/configure.ac
    team/kpfleming/optional_api/include/asterisk/agi.h
    team/kpfleming/optional_api/include/asterisk/channel.h
    team/kpfleming/optional_api/include/asterisk/logger.h
    team/kpfleming/optional_api/include/asterisk/strings.h
    team/kpfleming/optional_api/main/astmm.c
    team/kpfleming/optional_api/main/config.c
    team/kpfleming/optional_api/main/features.c
    team/kpfleming/optional_api/main/logger.c
    team/kpfleming/optional_api/main/utils.c
    team/kpfleming/optional_api/makeopts.in
    team/kpfleming/optional_api/res/res_agi.c
    team/kpfleming/optional_api/res/res_musiconhold.c

Propchange: team/kpfleming/optional_api/
------------------------------------------------------------------------------
Binary property 'branch-1.4-merged' - no diff available.

Propchange: team/kpfleming/optional_api/
------------------------------------------------------------------------------
--- svnmerge-integrated (original)
+++ svnmerge-integrated Wed Nov 19 07:48:27 2008
@@ -1,1 +1,1 @@
-/trunk:1-157234
+/trunk:1-157742

Modified: team/kpfleming/optional_api/Makefile
URL: http://svn.digium.com/view/asterisk/team/kpfleming/optional_api/Makefile?view=diff&rev=157745&r1=157744&r2=157745
==============================================================================
--- team/kpfleming/optional_api/Makefile (original)
+++ team/kpfleming/optional_api/Makefile Wed Nov 19 07:48:27 2008
@@ -92,6 +92,7 @@
 export AWK
 export GREP
 export ID
+export MD5
 
 # even though we could use '-include makeopts' here, use a wildcard
 # lookup anyway, so that make won't try to build makeopts if it doesn't
@@ -565,8 +566,8 @@
 	mkdir -p $(DESTDIR)$(ASTDATADIR)/firmware
 	mkdir -p $(DESTDIR)$(ASTDATADIR)/firmware/iax
 	mkdir -p $(DESTDIR)$(ASTMANDIR)/man8
-	$(INSTALL) -m 644 doc/core-*.xml $(ASTDATADIR)/documentation
-	$(INSTALL) -m 644 doc/appdocsxml.dtd $(ASTVARLIBDIR)/documentation
+	$(INSTALL) -m 644 doc/core-*.xml $(DESTDIR)$(ASTDATADIR)/documentation
+	$(INSTALL) -m 644 doc/appdocsxml.dtd $(DESTDIR)$(ASTVARLIBDIR)/documentation
 	$(INSTALL) -m 644 keys/iaxtel.pub $(DESTDIR)$(ASTDATADIR)/keys
 	$(INSTALL) -m 644 keys/freeworlddialup.pub $(DESTDIR)$(ASTDATADIR)/keys
 	$(INSTALL) -m 644 doc/asterisk.8 $(DESTDIR)$(ASTMANDIR)/man8
@@ -811,6 +812,8 @@
 		elif [ -f /etc/SuSE-release -o -f /etc/novell-release ]; then \
 			$(INSTALL) -m 755 contrib/init.d/rc.suse.asterisk $(DESTDIR)/etc/init.d/asterisk; \
 			if [ -z "$(DESTDIR)" ]; then /sbin/chkconfig --add asterisk; fi; \
+		elif [ -f /etc/arch-release -o -f /etc/arch-release ]; then \
+			$(INSTALL) -m 755 contrib/init.d/rc.archlinux.asterisk $(DESTDIR)/etc/rc.d/asterisk; \
 		elif [ -f /etc/slackware-version ]; then \
 			echo "Slackware is not currently supported, although an init script does exist for it." \
 		else \

Modified: team/kpfleming/optional_api/UPGRADE.txt
URL: http://svn.digium.com/view/asterisk/team/kpfleming/optional_api/UPGRADE.txt?view=diff&rev=157745&r1=157744&r2=157745
==============================================================================
--- team/kpfleming/optional_api/UPGRADE.txt (original)
+++ team/kpfleming/optional_api/UPGRADE.txt Wed Nov 19 07:48:27 2008
@@ -1,262 +1,51 @@
-=========================================================
-=== Information for upgrading from Asterisk 1.4 to 1.6
+===========================================================
+=== Information for upgrading between Asterisk 1.6 versions
 ===
 ===
 === UPGRADE-1.2.txt -- Upgrade info for 1.0 to 1.2
 === UPGRADE-1.4.txt -- Upgrade info for 1.2 to 1.4
-=== UPGRADE.txt     -- Upgrade info for 1.4 to 1.6
-=========================================================
+=== UPGRADE-1.6.txt -- Upgrade info for 1.4 to 1.6
+===========================================================
 
-AEL:
+From 1.6.0.1 to 1.6.1:
 
-* Macros are now implemented underneath with the Gosub() application.
-  Heaven Help You if you wrote code depending on any aspect of this!
-  Previous to 1.6, macros were implemented with the Macro() app, which
-  provided a nice feature of auto-returning. The compiler will do its
-  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 ast_agi_register_multiple() and ast_agi_unregister_multiple()
+  API calls were added in 1.6.0, so that modules that provide multiple
+  AGI commands could register/unregister them all with a single
+  step. However, these API calls were not implemented properly, and did
+  not allow the caller to know whether registration or unregistration
+  succeeded or failed. They have been redefined to now return success
+  or failure, but this means any code using these functions will need
+  be recompiled after upgrading to a version of Asterisk containing
+  these changes. In addition, the source code using these functions
+  should be reviewed to ensure it can properly react to failure
+  of registration or unregistration of its API commands.
 
-* 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.
+* The ast_agi_fdprintf() API call has been renamed to ast_agi_send()
+  to better match what it really does, and the argument order has been
+  changed to be consistent with other API calls that perform similar
+  operations.
 
-Core:
+From 1.6.0.x to 1.6.1:
 
-* The 'languageprefix' option in asterisk.conf is now deprecated, and
-  the default sound file layout for non-English sounds is the 'new
-  style' layout introduced in Asterisk 1.4 (and used by the automatic
-  sound file installer in the Makefile).
-
-* The ast_expr2 stuff has been modified to handle floating-point numbers.
-  Numbers of the format D.D are now acceptable input for the expr parser, 
-  Where D is a string of base-10 digits. All math is now done in "long double",
-  if it is available on your compiler/architecture. This was half-way between
-  a bug-fix (because the MATH func returns fp by default), and an enhancement.
-  Also, for those counting on, or needing, integer operations, a series of
-  'functions' were also added to the expr language, to allow several styles
-  of rounding/truncation, along with a set of common floating point operations,
-  like sin, cos, tan, log, pow, etc. The ability to call external functions
-  like CDR(), etc. was also added, without having to use the ${...} notation.
- 
-* The delimiter passed to applications has been changed to the comma (','), as
-  that is what people are used to using within extensions.conf.  If you are
-  using realtime extensions, you will need to translate your existing dialplan
-  to use this separator.  To use a literal comma, you need merely to escape it
-  with a backslash ('\').  Another possible side effect is that you may need to
-  remove the obscene level of backslashing that was necessary for the dialplan
-  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.  If you would like to avoid this conversion immediately, set
-  pbx_realtime=1.4 in the [compat] section of asterisk.conf.  After
-  transitioning, set pbx_realtime=1.6 in the same section.
-
-* For the same purpose as above, you may set res_agi=1.4 in the [compat]
-  section of asterisk.conf to continue to use the '|' delimiter in the EXEC
-  arguments of AGI applications.  After converting to use the ',' delimiter,
-  change this option to res_agi=1.6.
-
-* 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.
-
-* The concise versions of various CLI commands are now deprecated. We recommend
-  using the manager interface (AMI) for application integration with Asterisk.
-
-* The following core commands dealing with dialplan has been deprecated: 'core
+* The following core commands dealing with dialplan have been deprecated: 'core
   show globals', 'core set global' and 'core set chanvar'. Use the equivalent
   'dialplan show globals', 'dialplan set global' and 'dialplan set chanvar'
   instead.
 
-* The silencethreshold used for various applications is now settable via a
-  centralized config option in dsp.conf.
-
-* The logical value of spaces immediately preceding a standalone 0 previously
-  evaluated to true.  It now evaluates to false.  This has confused a good
-  many people in the past (typically because they failed to realize the space
-  had any significance).  Since this violates the Principle of Least Surprise,
-  it has been changed.
-
-* The default console now will use colors according to the default background
-  color, instead of forcing the background color to black.  If you are using a
-  light colored background for your console, you may wish to use the option
-  flag '-W' to present better color choices for the various messages.  However,
-  if you'd prefer the old method of forcing colors to white text on a black
-  background, the compatiblity option -B is provided for this purpose.
-
-Voicemail:
-
-* The voicemail configuration values 'maxmessage' and 'minmessage' have
-  been changed to 'maxsecs' and 'minsecs' to clarify their purpose and
-  to make them more distinguishable from 'maxmsgs', which sets folder
-  size.  The old variables will continue to work in this version, albeit
-  with a deprecation warning.
-
-* If you use any interface for modifying voicemail aside from the built in
-  dialplan applications, then the option "pollmailboxes" *must* be set in
-  voicemail.conf for message waiting indication (MWI) to work properly.  This
-  is because Voicemail notification is now event based instead of polling
-  based.  The channel drivers are no longer responsible for constantly manually
-  checking mailboxes for changes so that they can send MWI information to users.
-  Examples of situations that would require this option are web interfaces to
-  voicemail or an email client in the case of using IMAP storage.
-
-* The externnotify script should accept an additional (last) parameter
-  containing the number of urgent messages in the INBOX.
-
-Applications:
-
-* SendImage() no longer hangs up the channel on transmission error or on
-  another type of error; in those cases, a FAILURE status is stored in 
-  SENDIMAGESTATUS and dialplan execution continues.  The possible return values
-  stored in SENDIMAGESTATUS are: SUCCESS, FAILURE, and UNSUPPORTED. ('OK' has
-  been replaced with 'SUCCESS', and 'NOSUPPORT' has been replaced with
-  'UNSUPPORTED').  This change makes the SendImage application more consistent
-  with other applications.
-
-* ChanIsAvail() now has a 't' option, which allows the specified device
-  to be queried for state without consulting the channel drivers. This
-  performs mostly a 'ChanExists' sort of function.
-
-* ChannelRedirect() will not terminate the channel that fails to do a
-  channelredirect as it has done previously. Instead CHANNELREDIRECT_STATUS
-  will reflect if the attempt was successful of not.
-
-* SetCallerPres() has been replaced with the CALLERPRES() dialplan function
-  and is now deprecated.
-
-* DISA()'s fifth argument is now an options argument.  If you have previously
-  used 'NOANSWER' in this argument, you'll need to convert that to the new
-  option 'n'.
-
-* Macro() is now deprecated.  If you need subroutines, you should use the
-  Gosub()/Return() applications.  To replace MacroExclusive(), we have
-  introduced dialplan functions LOCK(), TRYLOCK(), and UNLOCK().  You may use
-  these functions in any location where you desire to ensure that only one
-  channel is executing that path at any one time.  The Macro() applications
-  are deprecated for performance reasons.  However, since Macro() has been
-  around for a long time and so many dialplans depend heavily on it, for the
-  sake of backwards compatibility it will not be removed .  It is also worth
-  noting that using both Macro() and GoSub() at the same time is _heavily_
-  discouraged.
-
-* Read() now sets a READSTATUS variable on exit.  It does NOT automatically
-  return -1 (and hangup) anymore on error.  If you want to hangup on error,
-  you need to do so explicitly in your dialplan.
-
-* Privacy() no longer uses privacy.conf, so any options must be specified
-  directly in the application arguments.
-
-* MusicOnHold application now has duration parameter which allows specifying
-  timeout in seconds.
-
-* WaitMusicOnHold application is now deprecated in favor of extended MusicOnHold.
-
-* SetMusicOnHold is now deprecated. You should use Set(CHANNEL(musicclass)=...)
-  instead.
+* In the dialplan expression parser, the logical value of spaces
+  immediately preceding a standalone 0 previously evaluated to
+  true. It now evaluates to false.  This has confused a good many
+  people in the past (typically because they failed to realize the
+  space had any significance).  Since this violates the Principle of
+  Least Surprise, it has been changed.
 
 * While app_directory has always relied on having a voicemail.conf or users.conf file
   correctly set up, it now is dependent on app_voicemail being compiled as well.
 
-* The arguments in ExecIf changed a bit, to be more like other applications.
-  The syntax is now ExecIf(<cond>?appiftrue(args):appiffalse(args)).
-
-* The behavior of the Set application now depends upon a compatibility option,
-  set in asterisk.conf.  To use the old 1.4 behavior, which allowed Set to take
-  multiple key/value pairs, set app_set=1.4 in [compat] in asterisk.conf.  To
-  use the new behavior, which permits variables to be set with embedded commas,
-  set app_set=1.6 in [compat] in asterisk.conf.  Note that you can have both
-  behaviors at the same time, if you switch to using MSet if you want the old
-  behavior.
-
-Dialplan Functions:
-
-* QUEUE_MEMBER_COUNT() has been deprecated in favor of the QUEUE_MEMBER() function. For
-  more information, issue a "show function QUEUE_MEMBER" from the CLI.
-
-CDR:
-
-* The cdr_sqlite module has been marked as deprecated in favor of
-  cdr_sqlite3_custom.  It will potentially be removed from the tree
-  after Asterisk 1.6 is released.
-
-* The cdr_odbc module now uses res_odbc to manage its connections.  The
-  username and password parameters in cdr_odbc.conf, therefore, are no
-  longer used.  The dsn parameter now points to an entry in res_odbc.conf.
-
-* The uniqueid field in the core Asterisk structure has been changed from a
-  maximum 31 character field to a 149 character field, to account for all
-  possible values the systemname prefix could be.  In the past, if the
-  systemname was too long, the uniqueid would have been truncated.
-
-* The cdr_tds module now supports all versions of FreeTDS that contain
-  the db-lib frontend.  It will also now log the userfield variable if
-  the target database table contains a column for it.
-
-Formats:
-
-* format_wav: The GAIN preprocessor definition and source code that used it
-  is removed.  This change was made in response to user complaints of
-  choppiness or the clipping of loud signal peaks.  To increase the volume
-  of voicemail messages, use the 'volgain' option in voicemail.conf
-
-Channel Drivers:
-
-* SIP: a small upgrade to support the "Record" button on the SNOM360,
-  which sends a sip INFO message with a "Record: on" or "Record: off" 
-  header. If Asterisk is set up (via features.conf) to accept "One Touch Monitor"
-  requests (by default, via '*1'), then the user-configured dialpad sequence
-  is generated, and recording can be started and stopped via this button. The
-  file names and formats are all controlled via the normal mechanisms. If the
-  user has not configured the automon feature, the normal "415 Unsupported media type"
-  is returned, and nothing is done.
-
-* SIP: The "call-limit" option is marked as deprecated. It still works in this version of
-  Asterisk, but will be removed in the following version. Please use the groupcount functions
-  in the dialplan to enforce call limits. The "limitonpeer" configuration option is
-  now renamed to "counteronpeer".
-
-* SIP: The "username" option is now renamed to "defaultuser" to match "defaultip".
-  These are used only before registration to call a peer with the uri 
-	sip:defaultuser at defaultip
-  The "username" setting still work, but is deprecated and will not work in 
-  the next version of Asterisk.
-
 * SIP: All of the functionality in SIPCHANINFO() has been implemented in CHANNEL(),
   and you should start using that function instead for retrieving information about
   the channel in a technology-agnostic way.
-
-* chan_local.c: the comma delimiter inside the channel name has been changed to a
-  semicolon, in order to make the Local channel driver compatible with the comma
-  delimiter change in applications.
-
-* H323: The "tos" setting has changed name to "tos_audio" and "cos" to "cos_audio"
-  to be compatible with settings in sip.conf. The "tos" and "cos" configuration
-  is deprecated and will stop working in the next release of Asterisk.
-
-* Console: A new console channel driver, chan_console, has been added to Asterisk.
-  This new module can not be loaded at the same time as chan_alsa or chan_oss.  The
-  default modules.conf only loads one of them (chan_oss by default).  So, unless you
-  have modified your modules.conf to not use the autoload option, then you will need
-  to modify modules.conf to add another "noload" line to ensure that only one of
-  these three modules gets loaded.
-
-* DAHDI: The chan_zap module that supported PSTN interfaces using
-  Zaptel has been renamed to chan_dahdi, and only supports the DAHDI
-  telephony driver package for PSTN interfaces. See the
-  Zaptel-to-DAHDI.txt file for more details on this transition.
-
-* DAHDI: The "msdstrip" option has been deprecated, as it provides no value over
-  the method of stripping digits in the dialplan using variable substring syntax.
-
-Configuration:
-
-* pbx_dundi.c: tos parameter changed to use new values. Old values like lowdelay,
-  lowcost and other is not acceptable now. Look into qos.tex for description of 
-  this parameter.
-
-* queues.conf: the queue-lessthan sound file option is no longer available, and the
-  queue-round-seconds option no longer takes '1' as a valid parameter.
 
 * If you have any third party modules which use a config file variable whose
   name ends in a '+', please note that the append capability added to this
@@ -265,48 +54,30 @@
   to differentiate your variable from the append operator.  This potential
   conflict is unlikely, but is documented here to be thorough.
 
+From 1.6.1 to 1.6.2:
+
+* The default console now will use colors according to the default background
+  color, instead of forcing the background color to black.  If you are using a
+  light colored background for your console, you may wish to use the option
+  flag '-W' to present better color choices for the various messages.  However,
+  if you'd prefer the old method of forcing colors to white text on a black
+  background, the compatibility option -B is provided for this purpose.
+
+* SendImage() no longer hangs up the channel on transmission error or on
+  any other error; in those cases, a FAILURE status is stored in
+  SENDIMAGESTATUS and dialplan execution continues.  The possible
+  return values stored in SENDIMAGESTATUS are: SUCCESS, FAILURE, and
+  UNSUPPORTED. ('OK' has been replaced with 'SUCCESS', and 'NOSUPPORT'
+  has been replaced with 'UNSUPPORTED').  This change makes the
+  SendImage application more consistent with other applications.
+
 * skinny.conf now has seperate sections for lines and devices.
   Please have a look at configs/skinny.conf.sample and update
   your skinny.conf.
 
-Manager:
-
-* Manager has been upgraded to version 1.1 with a lot of changes. 
-  Please check doc/manager_1_1.txt for information
-
-* The IAXpeers command output has been changed to more closely resemble the
-  output of the SIPpeers command.
-
-* cdr_manager now reports at the "cdr" level, not at "call"  You may need to
-  change your manager.conf to add the level to existing AMI users, if they
-  want to see the CDR events generated.
-
-* The Originate command now requires the Originate write permission.  For
-  Originate with the Application parameter, you need the additional System
-  privilege if you want to do anything that calls out to a subshell.
-
-Queues:
-
-* New queue log events ADDMEMBER and REMOVEMEMBER have been added.  Also, a
-  new value has been added to the TRANSFER event that indicates the caller's
-  original position in the queue they are being transfered from.
-
-* Prior to Asterisk 1.6.2, queue names were treated in a case-sensitive
-  manner, meaning that queues with names like "sales" and "sALeS" would
-  be seen as unique queues. The parsing logic has changed to use case-
-  insensitive comparisons now when originally hashing based on queue
-  names, meaning that now the two queues mentioned as examples earlier
-  will be seen as having the same name.
-
-iLBC Codec:
-
-* Previously, the Asterisk source code distribution included the iLBC
-  encoder/decoder source code, from Global IP Solutions
-  (http://www.gipscorp.com). This code is not licensed for
-  distribution, and thus has been removed from the Asterisk source
-  code distribution. If you wish to use codec_ilbc to support iLBC
-  channels in Asterisk, you can run the contrib/scripts/get_ilbc_source.sh
-  script to download the source and put it in the proper place in
-  the Asterisk build tree. Once that is done you can follow your normal
-  steps of building Asterisk. You will need to run 'menuselect' and enable
-  the iLBC codec in the 'Codec  Translators' category.
+* Queue names previously were treated in a case-sensitive manner,
+  meaning that queues with names like "sales" and "sALeS" would be
+  seen as unique queues. The parsing logic has changed to use
+  case-insensitive comparisons now when originally hashing based on
+  queue names, meaning that now the two queues mentioned as examples
+  earlier will be seen as having the same name.

Propchange: team/kpfleming/optional_api/UPGRADE.txt
------------------------------------------------------------------------------
    svn:mergeinfo = 

Modified: team/kpfleming/optional_api/apps/app_dial.c
URL: http://svn.digium.com/view/asterisk/team/kpfleming/optional_api/apps/app_dial.c?view=diff&rev=157745&r1=157744&r2=157745
==============================================================================
--- team/kpfleming/optional_api/apps/app_dial.c (original)
+++ team/kpfleming/optional_api/apps/app_dial.c Wed Nov 19 07:48:27 2008
@@ -1170,7 +1170,7 @@
 		play_to_caller = 1;
 
 	var = pbx_builtin_getvar_helper(chan, "LIMIT_WARNING_FILE");
-	config->warning_sound = !ast_strlen_zero(var) ? ast_strdupa(var) : "timeleft";
+	config->warning_sound = !ast_strlen_zero(var) ? ast_strdup(var) : ast_strdup("timeleft");
 
 	/* The code looking at config wants a NULL, not just "", to decide
 	 * that the message should not be played, so we replace "" with NULL.
@@ -1179,10 +1179,10 @@
 	 */
 
 	var = pbx_builtin_getvar_helper(chan, "LIMIT_TIMEOUT_FILE");
-	config->end_sound = !ast_strlen_zero(var) ? ast_strdupa(var) : NULL;
+	config->end_sound = !ast_strlen_zero(var) ? ast_strdup(var) : NULL;
 
 	var = pbx_builtin_getvar_helper(chan, "LIMIT_CONNECT_FILE");
-	config->start_sound = !ast_strlen_zero(var) ? ast_strdupa(var) : NULL;
+	config->start_sound = !ast_strlen_zero(var) ? ast_strdup(var) : NULL;
 
 	ast_channel_unlock(chan);
 
@@ -1488,6 +1488,10 @@
 		pbx_builtin_setvar_helper(chan, "DIALEDTIME", buf);
 	}
 	ast_channel_unlock(chan);
+}
+
+static void end_bridge_callback_data_fixup(struct ast_bridge_config *bconfig, struct ast_channel *originator, struct ast_channel *terminator) {
+	bconfig->end_bridge_callback_data = originator;
 }
 
 static int dial_exec_full(struct ast_channel *chan, void *data, struct ast_flags64 *peerflags, int *continue_exec)
@@ -2170,7 +2174,8 @@
 
 			config.end_bridge_callback = end_bridge_callback;
 			config.end_bridge_callback_data = chan;
-
+			config.end_bridge_callback_data_fixup = end_bridge_callback_data_fixup;
+			
 			if (moh) {
 				moh = 0;
 				ast_moh_stop(chan);
@@ -2264,6 +2269,15 @@
 	}
 
 done:
+	if (config.warning_sound) {
+		ast_free((char *)config.warning_sound);
+	}
+	if (config.end_sound) {
+		ast_free((char *)config.end_sound);
+	}
+	if (config.start_sound) {
+		ast_free((char *)config.start_sound);
+	}
 	return res;
 }
 

Modified: team/kpfleming/optional_api/apps/app_followme.c
URL: http://svn.digium.com/view/asterisk/team/kpfleming/optional_api/apps/app_followme.c?view=diff&rev=157745&r1=157744&r2=157745
==============================================================================
--- team/kpfleming/optional_api/apps/app_followme.c (original)
+++ team/kpfleming/optional_api/apps/app_followme.c Wed Nov 19 07:48:27 2008
@@ -992,6 +992,11 @@
 	ast_channel_unlock(chan);
 }
 
+static void end_bridge_callback_data_fixup(struct ast_bridge_config *bconfig, struct ast_channel *originator, struct ast_channel *terminator)
+{
+	bconfig->end_bridge_callback_data = originator;
+}
+
 static int app_exec(struct ast_channel *chan, void *data)
 {
 	struct fm_args targs;
@@ -1116,6 +1121,7 @@
 		ast_set_flag(&(config.features_caller), AST_FEATURE_AUTOMON);
 		config.end_bridge_callback = end_bridge_callback;
 		config.end_bridge_callback_data = chan;
+		config.end_bridge_callback_data_fixup = end_bridge_callback_data_fixup;
 
 		ast_moh_stop(caller);
 		/* Be sure no generators are left on it */

Modified: team/kpfleming/optional_api/apps/app_meetme.c
URL: http://svn.digium.com/view/asterisk/team/kpfleming/optional_api/apps/app_meetme.c?view=diff&rev=157745&r1=157744&r2=157745
==============================================================================
--- team/kpfleming/optional_api/apps/app_meetme.c (original)
+++ team/kpfleming/optional_api/apps/app_meetme.c Wed Nov 19 07:48:27 2008
@@ -3647,7 +3647,7 @@
 	if (args.options) {
 		ast_app_parse_options(meetme_opts, &confflags, optargs, args.options);
 		dynamic = ast_test_flag(&confflags, CONFFLAG_DYNAMIC | CONFFLAG_DYNAMICPIN);
-		if (ast_test_flag(&confflags, CONFFLAG_DYNAMICPIN) && !args.pin)
+		if (ast_test_flag(&confflags, CONFFLAG_DYNAMICPIN) && ast_strlen_zero(args.pin))
 			strcpy(the_pin, "q");
 
 		empty = ast_test_flag(&confflags, CONFFLAG_EMPTY | CONFFLAG_EMPTYNOPIN);

Modified: team/kpfleming/optional_api/apps/app_stack.c
URL: http://svn.digium.com/view/asterisk/team/kpfleming/optional_api/apps/app_stack.c?view=diff&rev=157745&r1=157744&r2=157745
==============================================================================
--- team/kpfleming/optional_api/apps/app_stack.c (original)
+++ team/kpfleming/optional_api/apps/app_stack.c Wed Nov 19 07:48:27 2008
@@ -490,11 +490,11 @@
 		/* Lookup the priority label */
 		if ((priority = ast_findlabel_extension(chan, argv[1], argv[2], argv[3], chan->cid.cid_num)) < 0) {
 			ast_log(LOG_ERROR, "Priority '%s' not found in '%s@%s'\n", argv[3], argv[2], argv[1]);
-			ast_agi_fdprintf(chan, agi->fd, "200 result=-1 Gosub label not found\n");
+			ast_agi_send(agi->fd, chan, "200 result=-1 Gosub label not found\n");
 			return RESULT_FAILURE;
 		}
 	} else if (!ast_exists_extension(chan, argv[1], argv[2], priority, chan->cid.cid_num)) {
-		ast_agi_fdprintf(chan, agi->fd, "200 result=-1 Gosub label not found\n");
+		ast_agi_send(agi->fd, chan, "200 result=-1 Gosub label not found\n");
 		return RESULT_FAILURE;
 	}
 
@@ -505,7 +505,7 @@
 
 	if (!(theapp = pbx_findapp("Gosub"))) {
 		ast_log(LOG_ERROR, "Gosub() cannot be found in the list of loaded applications\n");
-		ast_agi_fdprintf(chan, agi->fd, "503 result=-2 Gosub is not loaded\n");
+		ast_agi_send(agi->fd, chan, "503 result=-2 Gosub is not loaded\n");
 		return RESULT_FAILURE;
 	}
 
@@ -539,19 +539,19 @@
 			struct ast_pbx *pbx = chan->pbx;
 			/* Suppress warning about PBX already existing */
 			chan->pbx = NULL;
-			ast_agi_fdprintf(chan, agi->fd, "100 result=0 Trying...\n");
+			ast_agi_send(agi->fd, chan, "100 result=0 Trying...\n");
 			ast_pbx_run(chan);
-			ast_agi_fdprintf(chan, agi->fd, "200 result=0 Gosub complete\n");
+			ast_agi_send(agi->fd, chan, "200 result=0 Gosub complete\n");
 			if (chan->pbx) {
 				ast_free(chan->pbx);
 			}
 			chan->pbx = pbx;
 		} else {
-			ast_agi_fdprintf(chan, agi->fd, "200 result=%d Gosub failed\n", res);
+			ast_agi_send(agi->fd, chan, "200 result=%d Gosub failed\n", res);
 		}
 		ast_free(gosub_args);
 	} else {
-		ast_agi_fdprintf(chan, agi->fd, "503 result=-2 Memory allocation failure\n");
+		ast_agi_send(agi->fd, chan, "503 result=-2 Memory allocation failure\n");
 		return RESULT_FAILURE;
 	}
 

Modified: team/kpfleming/optional_api/apps/app_voicemail.c
URL: http://svn.digium.com/view/asterisk/team/kpfleming/optional_api/apps/app_voicemail.c?view=diff&rev=157745&r1=157744&r2=157745
==============================================================================
--- team/kpfleming/optional_api/apps/app_voicemail.c (original)
+++ team/kpfleming/optional_api/apps/app_voicemail.c Wed Nov 19 07:48:27 2008
@@ -153,6 +153,7 @@
 static void imap_mailbox_name(char *spec, size_t len, struct vm_state *vms, int box, int target);
 static int imap_store_file(char *dir, char *mailboxuser, char *mailboxcontext, int msgnum, struct ast_channel *chan, struct ast_vm_user *vmu, char *fmt, int duration, struct vm_state *vms, const char *flag);
 static void update_messages_by_imapuser(const char *user, unsigned long number);
+static int vm_delete(char *file);
 
 static int imap_remove_file (char *dir, int msgnum);
 static int imap_retrieve_file (const char *dir, const int msgnum, const char *mailbox, const char *context);
@@ -3510,6 +3511,7 @@
 	copy(frompath2, topath2);
 	ast_variables_destroy(var);
 }
+#endif
 
 /*! 
  * \brief Removes the voicemail sound and information file.
@@ -3536,7 +3538,6 @@
 	unlink(txt);
 	return ast_filedelete(file, NULL);
 }
-#endif
 
 /*!
  * \brief utility used by inchar(), for base_encode()
@@ -5199,6 +5200,19 @@
 		ast_log(AST_LOG_WARNING, "No format for saving voicemail?\n");
 leave_vm_out:
 	free_user(vmu);
+
+#ifdef IMAP_STORAGE
+	/* expunge message - use UID Expunge if supported on IMAP server*/
+	ast_debug(3, "*** Checking if we can expunge, expungeonhangup set to %d\n",expungeonhangup);
+	if (expungeonhangup == 1) {
+#ifdef HAVE_IMAP_TK2006
+		if (LEVELUIDPLUS (vms->mailstream)) {
+			mail_expunge_full(vms->mailstream,NIL,EX_UID);
+		} else 
+#endif
+			mail_expunge(vms->mailstream);
+	}
+#endif
 	
 	return res;
 }
@@ -6071,6 +6085,14 @@
 
 	manager_event(EVENT_FLAG_CALL, "MessageWaiting", "Mailbox: %s@%s\r\nWaiting: %d\r\nNew: %d\r\nOld: %d\r\n", vmu->mailbox, vmu->context, ast_app_has_voicemail(ext_context, NULL), newmsgs, oldmsgs);
 	run_externnotify(vmu->context, vmu->mailbox, flag);
+
+#ifdef IMAP_STORAGE
+	vm_delete(fn);  /* Delete the file, but not the IMAP message */
+	if (ast_test_flag(vmu, VM_DELETE))  { /* Delete the IMAP message if delete = yes */
+		vm_imap_delete(vms->curmsg, vmu);
+		vms->newmessages--;  /* Fix new message count */
+	}
+#endif
 
 	return 0;
 }

Modified: team/kpfleming/optional_api/build_tools/make_buildopts_h
URL: http://svn.digium.com/view/asterisk/team/kpfleming/optional_api/build_tools/make_buildopts_h?view=diff&rev=157745&r1=157744&r2=157745
==============================================================================
--- team/kpfleming/optional_api/build_tools/make_buildopts_h (original)
+++ team/kpfleming/optional_api/build_tools/make_buildopts_h Wed Nov 19 07:48:27 2008
@@ -26,13 +26,8 @@
 	echo "#define AST_DEVMODE 1"
 	TMP="${TMP} AST_DEVMODE"
 fi
-for x in md5 digest md5sum gmd5sum; do
-	BUILDSUM=`echo ${TMP} | $x 2> /dev/null`
-	if [ $? = 0 ]; then
-		BUILDSUM=`echo ${BUILDSUM} | cut -c1-32`
-		break;
-	fi
-done
+
+BUILDSUM=`echo ${TMP} | ${MD5} | cut -c1-32`
 
 echo "#define AST_BUILDOPT_SUM \"${BUILDSUM}\""
 echo "#define AST_BUILDOPTS \"${BUILDOPTS}\""

Modified: team/kpfleming/optional_api/build_tools/make_version
URL: http://svn.digium.com/view/asterisk/team/kpfleming/optional_api/build_tools/make_version?view=diff&rev=157745&r1=157744&r2=157745
==============================================================================
--- team/kpfleming/optional_api/build_tools/make_version (original)
+++ team/kpfleming/optional_api/build_tools/make_version Wed Nov 19 07:48:27 2008
@@ -30,7 +30,7 @@
       fi
 
       if [ ${BRANCH} != 0 ] ; then
-	  if [ -z ${RESULT} ] ; then
+	  if [ -z "${RESULT}" ] ; then
 	    RESULT="${PART}"
 	  else
 	    RESULT="${RESULT}-${PART}"
@@ -39,7 +39,7 @@
       fi
 
       if [ ${TEAM} != 0 ] ; then
-	  if [ -z ${RESULT} ] ; then
+	  if [ -z "${RESULT}" ] ; then
 	    RESULT="${PART}"
 	  else
 	    RESULT="${RESULT}-${PART}"

Modified: team/kpfleming/optional_api/channels/chan_local.c
URL: http://svn.digium.com/view/asterisk/team/kpfleming/optional_api/channels/chan_local.c?view=diff&rev=157745&r1=157744&r2=157745
==============================================================================
--- team/kpfleming/optional_api/channels/chan_local.c (original)
+++ team/kpfleming/optional_api/channels/chan_local.c Wed Nov 19 07:48:27 2008
@@ -287,7 +287,7 @@
 			if (!ast_check_hangup(p->chan->_bridge)) {
 				if (!ast_channel_trylock(p->owner)) {
 					if (!ast_check_hangup(p->owner)) {
-						if(p->owner->monitor && !p->chan->_bridge->monitor) {
+						if (p->owner->monitor && !p->chan->_bridge->monitor) {
 							/* If a local channel is being monitored, we don't want a masquerade
 							 * to cause the monitor to go away. Since the masquerade swaps the monitors,
 							 * pre-swapping the monitors before the masquerade will ensure that the monitor
@@ -296,6 +296,12 @@
 							tmp = p->owner->monitor;
 							p->owner->monitor = p->chan->_bridge->monitor;
 							p->chan->_bridge->monitor = tmp;
+						}
+						if (p->chan->audiohooks) {
+							struct ast_audiohook_list *audiohooks_swapper;
+							audiohooks_swapper = p->chan->audiohooks;
+							p->chan->audiohooks = p->owner->audiohooks;
+							p->owner->audiohooks = audiohooks_swapper;
 						}
 						ast_channel_masquerade(p->owner, p->chan->_bridge);
 						ast_set_flag(p, LOCAL_ALREADY_MASQED);

Modified: team/kpfleming/optional_api/channels/chan_sip.c
URL: http://svn.digium.com/view/asterisk/team/kpfleming/optional_api/channels/chan_sip.c?view=diff&rev=157745&r1=157744&r2=157745
==============================================================================
--- team/kpfleming/optional_api/channels/chan_sip.c (original)
+++ team/kpfleming/optional_api/channels/chan_sip.c Wed Nov 19 07:48:27 2008
@@ -5080,12 +5080,12 @@
 	ast_copy_string(name, fup->username, sizeof(name));
 
 	/* Check the list of devices */
-	if ( (p = find_peer(ast_strlen_zero(fup->peername) ? name : fup->peername, NULL, TRUE, FINDALLDEVICES, FALSE) ) ) { /* Try to find peer */
+	if ((p = find_peer(ast_strlen_zero(fup->peername) ? name : fup->peername, NULL, TRUE, FINDALLDEVICES, FALSE))) { 
 		inuse = &p->inUse;
 		call_limit = &p->call_limit;
 		inringing = &p->inRinging;
 		ast_copy_string(name, fup->peername, sizeof(name));
-	} 
+	}
 	if (!p) {
 		ast_debug(2, "%s is not a local device, no call limit\n", name);
 		return 0;
@@ -5095,20 +5095,44 @@
 	/* incoming and outgoing affects the inUse counter */
 	case DEC_CALL_LIMIT:
 		/* Decrement inuse count if applicable */
-		if (inuse && *inuse > 0 && ast_test_flag(&fup->flags[0], SIP_INC_COUNT)) {
-			ast_atomic_fetchadd_int(inuse, -1);
-			ast_clear_flag(&fup->flags[0], SIP_INC_COUNT);
-		} else
-			*inuse = 0;
+		if (inuse) {
+			sip_pvt_lock(fup);
+			ao2_lock(p);
+			if ((*inuse > 0) && ast_test_flag(&fup->flags[0], SIP_INC_COUNT)) {
+				(*inuse)--;
+				ast_clear_flag(&fup->flags[0], SIP_INC_COUNT);
+			} else {
+				*inuse = 0;
+			}
+			ao2_unlock(p);
+			sip_pvt_unlock(fup);
+		}
+
 		/* Decrement ringing count if applicable */
-		if (inringing && *inringing > 0 && ast_test_flag(&fup->flags[0], SIP_INC_RINGING)) {
-			ast_atomic_fetchadd_int(inringing, -1);
-			ast_clear_flag(&fup->flags[0], SIP_INC_RINGING);
-		}
+		if (inringing) {
+			sip_pvt_lock(fup);
+			ao2_lock(p);
+			if ((*inringing > 0)&& ast_test_flag(&fup->flags[0], SIP_INC_RINGING)) {
+				(*inringing)--;
+				ast_clear_flag(&fup->flags[0], SIP_INC_RINGING);
+			} else {
+			   *inringing = 0;
+			}
+			ao2_unlock(p);
+			sip_pvt_unlock(fup);
+		}
+
 		/* Decrement onhold count if applicable */
+		sip_pvt_lock(fup);
+		ao2_lock(p);
 		if (ast_test_flag(&fup->flags[1], SIP_PAGE2_CALL_ONHOLD) && global_notifyhold) {
 			ast_clear_flag(&fup->flags[1], SIP_PAGE2_CALL_ONHOLD);
+			ao2_unlock(p);
+			sip_pvt_unlock(fup);
 			sip_peer_hold(fup, FALSE);
+		} else {
+			ao2_unlock(p);
+			sip_pvt_unlock(fup);
 		}
 		if (sipdebug)
 			ast_debug(2, "Call %s %s '%s' removed from call limit %d\n", outgoing ? "to" : "from", "peer", name, *call_limit);
@@ -5125,29 +5149,47 @@
 			}
 		}
 		if (inringing && (event == INC_CALL_RINGING)) {
+			sip_pvt_lock(fup);
+			ao2_lock(p);
 			if (!ast_test_flag(&fup->flags[0], SIP_INC_RINGING)) {
-				ast_atomic_fetchadd_int(inringing, +1);
+				(*inringing)++;
 				ast_set_flag(&fup->flags[0], SIP_INC_RINGING);
 			}
-		}
-		/* Continue */
-		ast_atomic_fetchadd_int(inuse, +1);
-		ast_set_flag(&fup->flags[0], SIP_INC_COUNT);
+			ao2_unlock(p);
+			sip_pvt_unlock(fup);
+		}
+		if (inuse) {
+			sip_pvt_lock(fup);
+			ao2_lock(p);
+			if (!ast_test_flag(&fup->flags[0], SIP_INC_COUNT)) {
+				(*inuse)++;
+				ast_set_flag(&fup->flags[0], SIP_INC_COUNT);
+			}
+			ao2_unlock(p);
+			sip_pvt_unlock(fup);
+		}
 		if (sipdebug) {
 			ast_debug(2, "Call %s %s '%s' is %d out of %d\n", outgoing ? "to" : "from", "peer", name, *inuse, *call_limit);
 		}
 		break;
 
 	case DEC_CALL_RINGING:
-		if (inringing && *inringing > 0 && ast_test_flag(&fup->flags[0], SIP_INC_RINGING)) {
-			ast_atomic_fetchadd_int(inringing, -1);
-			ast_clear_flag(&fup->flags[0], SIP_INC_RINGING);
+		if (inringing) {
+			sip_pvt_lock(fup);
+			ao2_lock(p);
+			if (ast_test_flag(&fup->flags[0], SIP_INC_RINGING)) {
+				(*inringing)--;
+				ast_clear_flag(&fup->flags[0], SIP_INC_RINGING);
+			}
+			ao2_unlock(p);
+			sip_pvt_unlock(fup);
 		}
 		break;
 
 	default:
 		ast_log(LOG_ERROR, "update_call_counter(%s, %d) called with no event!\n", name, event);
 	}
+
 	if (p) {

[... 1402 lines stripped ...]



More information about the asterisk-commits mailing list