[asterisk-commits] branch russell/ast_malloc - r7629 in /team/russell/ast_malloc: ./ apps/ chann...

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Sun Dec 25 19:48:10 CST 2005


Author: russell
Date: Sun Dec 25 19:47:57 2005
New Revision: 7629

URL: http://svn.digium.com/view/asterisk?rev=7629&view=rev
Log:
Merged revisions 7528,7538-7542,7547-7548,7551,7554,7556,7565-7570,7573-7576,7578-7579,7583,7587,7589-7590,7594,7600,7602,7604,7607,7609,7613-7620,7627 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/trunk

................
r7528 | russell | 2005-12-19 18:41:53 -0500 (Mon, 19 Dec 2005) | 4 lines

- add note on required values of sip_methods struct
- remove duplicate function prototype
- remove duplicate ast_mutex_lock (issue #6025)

................
r7538 | russell | 2005-12-20 02:45:05 -0500 (Tue, 20 Dec 2005) | 3 lines

allow forcing the build to exclude PRI support using WITHOUT_PRI, similar to
how we already have WITHOUT_ZAPTEL (issue #5985)

................
r7539 | russell | 2005-12-20 03:16:53 -0500 (Tue, 20 Dec 2005) | 2 lines

use the system libgsm if available (issue #5434, modified to still work with builtin libgsm)

................
r7540 | markster | 2005-12-20 04:39:31 -0500 (Tue, 20 Dec 2005) | 2 lines

Fix reload of peer contexts (bug #6007)

................
r7541 | markster | 2005-12-20 04:56:55 -0500 (Tue, 20 Dec 2005) | 2 lines

Fix segfault on directed pickup when no CDR is available (bug #5998)

................
r7542 | markster | 2005-12-20 05:26:53 -0500 (Tue, 20 Dec 2005) | 2 lines

Fix choppy audio with > 20ms audio frames (bug #5697)

................
r7547 | markster | 2005-12-20 08:07:02 -0500 (Tue, 20 Dec 2005) | 3 lines

Major peformance improvements to meetme


................
r7548 | markster | 2005-12-20 09:14:01 -0500 (Tue, 20 Dec 2005) | 2 lines

Don't bother decode on muted participants

................
r7551 | markster | 2005-12-20 12:52:31 -0500 (Tue, 20 Dec 2005) | 3 lines

Major RTP fixes for using inbound SDP on outbound connection, get rid of 
old local rtp stuff...

................
r7554 | russell | 2005-12-20 14:56:52 -0500 (Tue, 20 Dec 2005) | 2 lines

add AGENT function, similar to SIPPEER or IAXPEER (issue #5531)

................
r7556 | russell | 2005-12-20 15:20:04 -0500 (Tue, 20 Dec 2005) | 7 lines

- move the string join() function to utils.c since it is used in both cli.c and res_agi.c
- reimplement ast_join to be of linear effieciency instead of quadratic
- remove some useless checks for "if (e)"
- reorder checks for strings starting with '_' to avoid a useless call to ast_join()
- check array bounds when parsing arguments to AGI
(issue #5868)

................
r7565 | markster | 2005-12-20 18:36:22 -0500 (Tue, 20 Dec 2005) | 2 lines

Avoid multiple free 

................
r7566 | jdixon | 2005-12-20 18:41:59 -0500 (Tue, 20 Dec 2005) | 2 lines

New version, including half/semi-half duplex modes and system announcements

................
r7567 | jdixon | 2005-12-20 18:53:26 -0500 (Tue, 20 Dec 2005) | 2 lines

Added docs for new features (duplex mode & tailmessages)

................
r7568 | russell | 2005-12-21 03:44:51 -0500 (Wed, 21 Dec 2005) | 4 lines

- change the default value of the global priority jumping option to 'off'
- update the UPGRADE.txt file to reflect this change
- remove old information from UPGRADE.txt

................
r7569 | russell | 2005-12-21 03:51:44 -0500 (Wed, 21 Dec 2005) | 4 lines

add a header to indicate who the call was parked by to the ParkedCall manager
events generated when parking status is requested.  This header was already
in the events that are generated when the call is first parked. (issue #5883)

................
r7570 | russell | 2005-12-21 04:33:41 -0500 (Wed, 21 Dec 2005) | 2 lines

add Log application for generating custom log messages from the dialplan (issue #5287)

................
r7573 | tilghman | 2005-12-21 10:16:08 -0500 (Wed, 21 Dec 2005) | 2 lines

Bug 5734 - add status variables indicating the success or failure of the realtime apps

................
r7574 | russell | 2005-12-21 11:36:48 -0500 (Wed, 21 Dec 2005) | 2 lines

move heading to the top of the file

................
r7575 | tilghman | 2005-12-21 12:09:54 -0500 (Wed, 21 Dec 2005) | 2 lines

Bug 5440 - Add STAT() dialplan function

................
r7576 | tilghman | 2005-12-21 13:43:10 -0500 (Wed, 21 Dec 2005) | 2 lines

Bug 5055 - Simple SQL commands from the dialplan

................
r7578 | tilghman | 2005-12-21 14:24:56 -0500 (Wed, 21 Dec 2005) | 3 lines

Merged revisions 7577 via svnmerge from
/branches/1.2

................
r7579 | bweschke | 2005-12-21 14:44:51 -0500 (Wed, 21 Dec 2005) | 3 lines

 Bug #6040 - Documentation correction


................
r7583 | tilghman | 2005-12-21 15:02:36 -0500 (Wed, 21 Dec 2005) | 3 lines

Merged revisions 7582 via svnmerge from
/branches/1.2

................
r7587 | russell | 2005-12-21 21:20:44 -0500 (Wed, 21 Dec 2005) | 7 lines

- construct the difference and have only one call to snprintf in build_via
- convert some while loops to for loops
- localize some variables and remove unneeded initializations
- store result of get_header locally so it only has to be called once
- remove some duplicate calls to strcasecmp by storing result
(issue #5955)

................
r7589 | kpfleming | 2005-12-21 22:49:41 -0500 (Wed, 21 Dec 2005) | 2 lines

don't try to build func_odbc when ODBC headers/libraries are not present

................
r7590 | kpfleming | 2005-12-21 22:50:44 -0500 (Wed, 21 Dec 2005) | 2 lines

forward-port per-peer videosupport changes from branches/1.2

................
r7594 | russell | 2005-12-22 11:14:38 -0500 (Thu, 22 Dec 2005) | 2 lines

remove stray unlock (issue #5955)

................
r7600 | russell | 2005-12-22 15:38:43 -0500 (Thu, 22 Dec 2005) | 11 lines

Merged revisions 7599 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r7599 | russell | 2005-12-22 15:36:47 -0500 (Thu, 22 Dec 2005) | 3 lines

revert changes to videosupport to allow per-peer setting, since it isn't quite
complete and there is not an obvious fix at this point

........

................
r7602 | tilghman | 2005-12-22 17:06:35 -0500 (Thu, 22 Dec 2005) | 3 lines

Merged revisions 7601 via svnmerge from
/branches/1.2

................
r7604 | bweschke | 2005-12-22 18:59:13 -0500 (Thu, 22 Dec 2005) | 3 lines

 Another app documentation tweak.


................
r7607 | kpfleming | 2005-12-22 22:04:38 -0500 (Thu, 22 Dec 2005) | 11 lines

Merged revisions 7606 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r7606 | kpfleming | 2005-12-22 21:01:24 -0600 (Thu, 22 Dec 2005) | 3 lines

add license reference to copyright notice displayed when CLI session begins
add 'show warranty' and 'show license' CLI commands (still need a complete list of non-GPL components included in Asterisk)

........

................
r7609 | tilghman | 2005-12-23 01:39:44 -0500 (Fri, 23 Dec 2005) | 3 lines

Merged revisions 7608 via svnmerge from
/branches/1.2

................
r7613 | tilghman | 2005-12-23 15:43:11 -0500 (Fri, 23 Dec 2005) | 2 lines

Make the English language of date format 'Q' and 'q' sound a little bit more natural

................
r7614 | tilghman | 2005-12-23 16:03:25 -0500 (Fri, 23 Dec 2005) | 2 lines

Bug 5327 - new function FILTER and optional argument to CALLERID

................
r7615 | tilghman | 2005-12-23 17:47:26 -0500 (Fri, 23 Dec 2005) | 2 lines

Alphabetize the functions list

................
r7616 | tilghman | 2005-12-23 18:42:58 -0500 (Fri, 23 Dec 2005) | 2 lines

Bug 5759 - Remove unused datetime code (current DateTime app is in app_sayunixtime)

................
r7617 | russell | 2005-12-24 00:18:40 -0500 (Sat, 24 Dec 2005) | 5 lines

minor cleanups ...
- use for loops instead of while loops for basic list traversals
- remove an unused 'res' variable
- formatting tweaks

................
r7618 | russell | 2005-12-24 01:23:36 -0500 (Sat, 24 Dec 2005) | 7 lines

minor cleanups ...
- use for loops instead of while loops for basic list traversals
- only calculate word length one time in CLI complete functions
- use calloc instead of malloc + memset
- remove some unnecessary casts
- formatting tweaks 

................
r7619 | tilghman | 2005-12-24 19:25:41 -0500 (Sat, 24 Dec 2005) | 2 lines

Bug 5727 - reduce duplicate code

................
r7620 | markster | 2005-12-24 20:27:47 -0500 (Sat, 24 Dec 2005) | 2 lines

Fix multiple free of a frame (bug #6058)

................
r7627 | markster | 2005-12-25 19:47:28 -0500 (Sun, 25 Dec 2005) | 3 lines

Add "local channel" variation so that we don't read/write to the same 
channel...  (bug #6058)

................

Added:
    team/russell/ast_malloc/configs/func_odbc.conf.sample
      - copied unchanged from r7627, trunk/configs/func_odbc.conf.sample
    team/russell/ast_malloc/funcs/func_odbc.c
      - copied unchanged from r7627, trunk/funcs/func_odbc.c
Removed:
    team/russell/ast_malloc/apps/app_datetime.c
Modified:
    team/russell/ast_malloc/   (props changed)
    team/russell/ast_malloc/UPGRADE.txt
    team/russell/ast_malloc/apps/Makefile
    team/russell/ast_malloc/apps/app_dial.c
    team/russell/ast_malloc/apps/app_directed_pickup.c
    team/russell/ast_malloc/apps/app_hasnewvoicemail.c
    team/russell/ast_malloc/apps/app_meetme.c
    team/russell/ast_malloc/apps/app_realtime.c
    team/russell/ast_malloc/apps/app_rpt.c
    team/russell/ast_malloc/apps/app_verbose.c
    team/russell/ast_malloc/apps/app_voicemail.c
    team/russell/ast_malloc/apps/app_waitforsilence.c
    team/russell/ast_malloc/asterisk.c
    team/russell/ast_malloc/channel.c
    team/russell/ast_malloc/channels/Makefile
    team/russell/ast_malloc/channels/chan_agent.c
    team/russell/ast_malloc/channels/chan_alsa.c
    team/russell/ast_malloc/channels/chan_iax2.c
    team/russell/ast_malloc/channels/chan_mgcp.c
    team/russell/ast_malloc/channels/chan_sip.c
    team/russell/ast_malloc/chanvars.c
    team/russell/ast_malloc/cli.c
    team/russell/ast_malloc/codecs/Makefile
    team/russell/ast_malloc/codecs/codec_gsm.c
    team/russell/ast_malloc/configs/agents.conf.sample
    team/russell/ast_malloc/configs/rpt.conf.sample
    team/russell/ast_malloc/configs/sip.conf.sample
    team/russell/ast_malloc/frame.c
    team/russell/ast_malloc/funcs/Makefile
    team/russell/ast_malloc/funcs/func_callerid.c
    team/russell/ast_malloc/funcs/func_env.c
    team/russell/ast_malloc/funcs/func_strings.c
    team/russell/ast_malloc/include/asterisk/channel.h
    team/russell/ast_malloc/include/asterisk/frame.h
    team/russell/ast_malloc/include/asterisk/pbx.h
    team/russell/ast_malloc/include/asterisk/rtp.h
    team/russell/ast_malloc/include/asterisk/strings.h
    team/russell/ast_malloc/pbx.c
    team/russell/ast_malloc/pbx/pbx_ael.c
    team/russell/ast_malloc/res/res_agi.c
    team/russell/ast_malloc/res/res_features.c
    team/russell/ast_malloc/rtp.c
    team/russell/ast_malloc/say.c
    team/russell/ast_malloc/utils.c

Propchange: team/russell/ast_malloc/
------------------------------------------------------------------------------
--- svnmerge-integrated (original)
+++ svnmerge-integrated Sun Dec 25 19:47:57 2005
@@ -1,1 +1,1 @@
-/trunk:1-7526
+/trunk:1-7628

Modified: team/russell/ast_malloc/UPGRADE.txt
URL: http://svn.digium.com/view/asterisk/team/russell/ast_malloc/UPGRADE.txt?rev=7629&r1=7628&r2=7629&view=diff
==============================================================================
--- team/russell/ast_malloc/UPGRADE.txt (original)
+++ team/russell/ast_malloc/UPGRADE.txt Sun Dec 25 19:47:57 2005
@@ -1,205 +1,10 @@
 Information for Upgrading From Previous Asterisk Releases
 =========================================================
 
-Compiling:
-
-* The Asterisk 1.2 source code now uses C language features
-  supported only by 'modern' C compilers.  Generally, this means GCC
-  version 3.0 or higher, although some GCC 2.96 releases will also
-  work.  Some non-GCC compilers that support C99 and the common GCC
-  extensions (including anonymous structures and unions) will also
-  work.  All releases of GCC 2.95 do _not_ have the requisite feature
-  support; systems using that compiler will need to be upgraded to
-  a more recent compiler release.
-
-Dialplan Expressions:
-
-* The dialplan expression parser (which handles $[ ... ] constructs)
-  has gone through a major upgrade, but has one incompatible change:
-  spaces are no longer required around expression operators, including
-  string comparisons. However, you can now use quoting to keep strings
-  together for comparison. For more details, please read the
-  doc/README.variables file, and check over your dialplan for possible
-  problems.
-
-Agents:
-
-* The default for ackcall has been changed to "no" instead of "yes" 
-  because of a bug which caused the "yes" behavior to generally act like
-  "no".  You may need to adjust the value if your agents behave 
-  differently than you expect with respect to acknowledgement.
-
-* The AgentCallBackLogin application now requires a second '|' before
-  specifying an extension at context.  This is to distinguish the options
-  string from the extension, so that they do not conflict.  See
-  'show application AgentCallbackLogin' for more details.
-
-Parking:
-
-* Parking behavior has changed slightly; when a parked call times out,
-  Asterisk will attempt to deliver the call back to the extension that
-  parked it, rather than the 's' extension. If that extension is busy
-  or unavailable, the parked call will be lost.
-
-Dialing:
-
-* The Caller*ID of the outbound leg is now the extension that was 
-  called, rather than the Caller*ID of the inbound leg of the call.  The 
-  "o" flag for Dial can be used to restore the original behavior if 
-  desired.  Note that if you are looking for the originating callerid
-  from the manager event, there is a new manager event "Dial" which 
-  provides the source and destination channels and callerid.
-
-IAX: 
-
-* The naming convention for IAX channels has changed in two ways: 
-   1. The call number follows a "-" rather than a "/" character.
-   2. The name of the channel has been simplified to IAX2/peer-callno,
-   rather than IAX2/peer at peer-callno or even IAX2/peer at peer/callno.
-
-SIP:
-
-* The global option "port" in 1.0.X that is used to set which port to
-  bind to has been changed to "bindport" to be more consistent with
-  the other channel drivers and to avoid confusion with the "port"
-  option for users/peers.
-
-* The "Registry" event now uses "Username" rather than "User" for 
-  consistency with IAX.
-
 Applications:
 
-* With the addition of dialplan functions (which operate similarly
-  to variables), the SetVar application has been renamed to Set.
-
-* The CallerPres application has been removed.  Use SetCallerPres 
-  instead.  It accepts both numeric and symbolic names.
-
-* The applications GetGroupCount, GetGroupMatchCount, SetGroup, and
-  CheckGroup have been deprecated in favor of functions.  Here is a
-  table of their replacements:
-
-  GetGroupCount([groupname][@category]	       GROUP_COUNT([groupname][@category])	Set(GROUPCOUNT=${GROUP_COUNT()})
-  GroupMatchCount(groupmatch[@category])       GROUP_MATCH_COUNT(groupmatch[@category])	Set(GROUPCOUNT=${GROUP_MATCH_COUNT(SIP/.*)})
-  SetGroup(groupname[@category])	       GROUP([category])=groupname		Set(GROUP()=test)
-  CheckGroup(max[@category])		       N/A					GotoIf($[ ${GROUP_COUNT()} > 5 ]?103)
-
-  Note that CheckGroup does not have a direct replacement.  There is
-  also a new function called GROUP_LIST() which will return a space
-  separated list of all of the groups set on a channel.  The GROUP()
-  function can also return the name of the group set on a channel when
-  used in a read environment.
-
-* The applications DBGet and DBPut have been deprecated in favor of
-  functions.  Here is a table of their replacements:
-
-  DBGet(foo=family/key)        Set(foo=${DB(family/key)})
-  DBPut(family/key=${foo})     Set(DB(family/key)=${foo})
-
-* The application SetLanguage has been deprecated in favor of the
-  function LANGUAGE().
-
-  SetLanguage(fr)		Set(LANGUAGE()=fr)
-
-  The LANGUAGE function can also return the currently set language:
-
-  Set(MYLANG=${LANGUAGE()})
-
-* The applications AbsoluteTimeout, DigitTimeout, and ResponseTimeout
-  have been deprecated in favor of the function TIMEOUT(timeouttype):
-
-  AbsoluteTimeout(300)		Set(TIMEOUT(absolute)=300)
-  DigitTimeout(15)		Set(TIMEOUT(digit)=15)
-  ResponseTimeout(15)		Set(TIMEOUT(response)=15)
-
-  The TIMEOUT() function can also return the currently set timeouts:
-
-  Set(DTIMEOUT=${TIMEOUT(digit)})
-
-* The applications SetCIDName, SetCIDNum, and SetRDNIS have been
-  deprecated in favor of the CALLERID(datatype) function:
-
-  SetCIDName(Joe Cool)		Set(CALLERID(name)=Joe Cool)
-  SetCIDNum(2025551212)		Set(CALLERID(number)=2025551212)
-  SetRDNIS(2024561414)		Set(CALLERID(RDNIS)=2024561414)
-
-* The application Record now uses the period to separate the filename
-  from the format, rather than the colon.
-
-* The application VoiceMail now supports a 'temporary' greeting for each
-  mailbox. This greeting can be recorded by using option 4 in the
-  'mailbox options' menu, and 'change your password' option has been
-  moved to option 5.
-
-* The application VoiceMailMain now only matches the 'default' context if
-  none is specified in the arguments.  (This was the previously 
-  documented behavior, however, we didn't follow that behavior.)  The old
-  behavior can be restored by setting searchcontexts=yes in voicemail.conf.
-
-Queues:
-
-* A queue is now considered empty not only if there are no members but if
-  none of the members are available (e.g. agents not logged on).  To
-  restore the original behavior, use "leavewhenempty=strict" or 
-  "joinwhenempty=strict" instead of "=yes" for those options.
-
-* It is now possible to use multi-digit extensions in the exit context
-  for a queue (although you should not have overlapping extensions,
-  as there is no digit timeout). This means that the EXITWITHKEY event
-  in queue_log can now contain a key field with more than a single
-  character in it.
-
-Extensions:
-
-* By default, there is a new option called "autofallthrough" in
-  extensions.conf that is set to yes.  Asterisk 1.0 (and earlier) 
-  behavior was to wait for an extension to be dialed after there were no 
-  more extensions to execute.  "autofallthrough" changes this behavior
-  so that the call will immediately be terminated with BUSY,
-  CONGESTION, or HANGUP based on Asterisk's best guess.  If you are
-  writing an extension for IVR, you must use the WaitExten application
-  if "autofallthrough" is set to yes.
-
-AGI:
-
-* AGI scripts did not always get SIGHUP at the end, previously.  That 
-  behavior has been fixed.  If you do not want your script to terminate 
-  at the end of AGI being called (e.g. on a hangup) then set SIGHUP to 
-  be ignored within your application.
-
-* CallerID is reported with agi_callerid and agi_calleridname instead
-  of a single parameter holding both.
-
-Music On Hold:
-
-* The preferred format for musiconhold.conf has changed; please see the
-  sample configuration file for the new format. The existing format
-  is still supported but will generate warnings when the module is loaded.
-
-chan_modem:
-
-* All the chan_modem channel drivers (aopen, bestdata and i4l) are deprecated
-  in this release, and will be removed in the next major Asterisk release.
-  Please migrate to chan_misdn for ISDN interfaces; there is no upgrade
-  path for aopen and bestdata modem users.
-
-MeetMe:
-
-* The conference application now allows users to increase/decrease their
-  speaking volume and listening volume (independently of each other and 
-  other users); the 'admin' and 'user' menus have changed, and new sound 
-  files are included with this release. However, if a user calling in 
-  over a Zaptel channel that does NOT have hardware DTMF detection 
-  increases their speaking volume, it is likely they will no longer be 
-  able to enter/exit the menu or make any further adjustments, as the  
-  software DTMF detector will not be able to recognize the DTMF coming 
-  from their device.
-
-GetVar Manager Action:
-
-* Previously, the behavior of the GetVar manager action reported the value
-  of a variable in the following manner:
-   > name: value
-  This has been changed to a manner similar to the SetVar action and is now
-   > Variable: name
-   > Value: value
+* In previous Asterisk releases, many applications would jump to priority n+101
+  to indicate some kind of status or error condition.  This functionality was
+  marked deprecated in Asterisk 1.2.  An option to disable it was provided with
+  the default value set to 'on'.  The default value for the global priority
+  jumping option is now 'off'.

Modified: team/russell/ast_malloc/apps/Makefile
URL: http://svn.digium.com/view/asterisk/team/russell/ast_malloc/apps/Makefile?rev=7629&r1=7628&r2=7629&view=diff
==============================================================================
--- team/russell/ast_malloc/apps/Makefile (original)
+++ team/russell/ast_malloc/apps/Makefile Sun Dec 25 19:47:57 2005
@@ -91,6 +91,7 @@
 
 install: all
 	for x in $(APPS); do $(INSTALL) -m 755 $$x $(DESTDIR)$(MODULES_DIR) ; done
+	rm -f $(DESTDIR)$(MODULES_DIR)/app_cut.so
 	rm -f $(DESTDIR)$(MODULES_DIR)/app_datetime.so
 	rm -f $(DESTDIR)$(MODULES_DIR)/app_qcall.so
 

Modified: team/russell/ast_malloc/apps/app_dial.c
URL: http://svn.digium.com/view/asterisk/team/russell/ast_malloc/apps/app_dial.c?rev=7629&r1=7628&r2=7629&view=diff
==============================================================================
--- team/russell/ast_malloc/apps/app_dial.c (original)
+++ team/russell/ast_malloc/apps/app_dial.c Sun Dec 25 19:47:57 2005
@@ -53,6 +53,7 @@
 #include "asterisk/utils.h"
 #include "asterisk/app.h"
 #include "asterisk/causes.h"
+#include "asterisk/rtp.h"
 #include "asterisk/manager.h"
 #include "asterisk/privacy.h"
 
@@ -310,7 +311,7 @@
 } while (0)
 
 
-static int onedigit_goto(struct ast_channel *chan, char *context, char exten, int pri) 
+static int onedigit_goto(struct ast_channel *chan, const char *context, char exten, int pri) 
 {
 	char rexten[2] = { exten, '\0' };
 
@@ -380,7 +381,7 @@
 	int pos;
 	int single;
 	struct ast_channel *winner;
-	char *context = NULL;
+	const char *context = NULL;
 	char cidname[AST_MAX_EXTENSION];
 
 	single = (outgoing && !outgoing->next && !ast_test_flag(outgoing, OPT_MUSICBACK | OPT_RINGBACK));
@@ -475,6 +476,7 @@
 						ast_clear_flag(o, DIAL_STILLGOING);	
 						HANDLE_CAUSE(cause, in);
 					} else {
+						ast_rtp_make_compatible(o->chan, in);
 						if (o->chan->cid.cid_num)
 							free(o->chan->cid.cid_num);
 						o->chan->cid.cid_num = NULL;
@@ -744,16 +746,17 @@
 	long timelimit = 0;
 	long play_warning = 0;
 	long warning_freq=0;
-	char *warning_sound=NULL;
-	char *end_sound=NULL;
-	char *start_sound=NULL;
+	const char *warning_sound=NULL;
+	const char *end_sound=NULL;
+	const char *start_sound=NULL;
 	char *dtmfcalled=NULL, *dtmfcalling=NULL;
-	char *var;
+	const char *var;
 	char status[256];
 	int play_to_caller=0,play_to_callee=0;
 	int sentringing=0, moh=0;
-	char *outbound_group = NULL;
-	char *macro_result = NULL, *macro_transfer_dest = NULL;
+	const char *outbound_group = NULL;
+	const char *macro_result = NULL;
+	char *macro_transfer_dest = NULL;
 	int digit = 0, result = 0;
 	time_t start_time, answer_time, end_time;
 	struct ast_app *app = NULL;
@@ -1052,6 +1055,9 @@
 			}
 		}
 
+		/* Setup outgoing SDP to match incoming one */
+		ast_rtp_make_compatible(tmp->chan, chan);
+		
 		/* Inherit specially named variables from parent channel */
 		ast_channel_inherit_variables(chan, tmp->chan);
 
@@ -1190,7 +1196,7 @@
 		if (peer->name)
 			pbx_builtin_setvar_helper(chan, "DIALEDPEERNAME", peer->name);
 
-		number = pbx_builtin_getvar_helper(peer, "DIALEDPEERNUMBER");
+		number = (char *)pbx_builtin_getvar_helper(peer, "DIALEDPEERNUMBER");
 		if (!number)
 			number = numsubst;
 		pbx_builtin_setvar_helper(chan, "DIALEDPEERNUMBER", number);
@@ -1602,7 +1608,8 @@
 
 static int retrydial_exec(struct ast_channel *chan, void *data)
 {
-	char *announce = NULL, *context = NULL, *dialdata = NULL;
+	char *announce = NULL, *dialdata = NULL;
+	const char *context = NULL;
 	int sleep = 0, loops = 0, res = 0;
 	struct localuser *u;
 	struct ast_flags peerflags;

Modified: team/russell/ast_malloc/apps/app_directed_pickup.c
URL: http://svn.digium.com/view/asterisk/team/russell/ast_malloc/apps/app_directed_pickup.c?rev=7629&r1=7628&r2=7629&view=diff
==============================================================================
--- team/russell/ast_malloc/apps/app_directed_pickup.c (original)
+++ team/russell/ast_malloc/apps/app_directed_pickup.c Sun Dec 25 19:47:57 2005
@@ -77,7 +77,7 @@
 
 	/* Find a channel to pickup */
 	origin = ast_get_channel_by_exten_locked(exten, context);
-	if (origin) {
+	if (origin && origin->cdr) {
 		ast_cdr_getvar(origin->cdr, "dstchannel", &tmp, workspace,
 			       sizeof(workspace), 0);
 		if (tmp) {
@@ -89,6 +89,8 @@
 		}
 		ast_mutex_unlock(&origin->lock);
 	} else {
+		if (origin)
+			ast_mutex_unlock(&origin->lock);
 		ast_log(LOG_DEBUG, "No originating channel found.\n");
 	}
 	

Modified: team/russell/ast_malloc/apps/app_hasnewvoicemail.c
URL: http://svn.digium.com/view/asterisk/team/russell/ast_malloc/apps/app_hasnewvoicemail.c?rev=7629&r1=7628&r2=7629&view=diff
==============================================================================
--- team/russell/ast_malloc/apps/app_hasnewvoicemail.c (original)
+++ team/russell/ast_malloc/apps/app_hasnewvoicemail.c Sun Dec 25 19:47:57 2005
@@ -90,7 +90,6 @@
 		while ((vment = readdir(vmdir))) {
 			if (!strncmp(vment->d_name + 7, ".txt", 4)) {
 				count++;
-				break;
 			}
 		}
 		closedir(vmdir);

Modified: team/russell/ast_malloc/apps/app_meetme.c
URL: http://svn.digium.com/view/asterisk/team/russell/ast_malloc/apps/app_meetme.c?rev=7629&r1=7628&r2=7629&view=diff
==============================================================================
--- team/russell/ast_malloc/apps/app_meetme.c (original)
+++ team/russell/ast_malloc/apps/app_meetme.c Sun Dec 25 19:47:57 2005
@@ -54,6 +54,8 @@
 #include "asterisk/cli.h"
 #include "asterisk/say.h"
 #include "asterisk/utils.h"
+#include "asterisk/translate.h"
+#include "asterisk/ulaw.h"
 
 static const char *tdesc = "MeetMe conference bridge";
 
@@ -95,6 +97,10 @@
 "      's' -- Present menu (user or admin) when '*' is received ('send' to menu)\n"
 "      't' -- set talk only mode. (Talk only, no listening)\n"
 "      'T' -- set talker detection (sent to manager interface and meetme list)\n"
+"      'o' -- set talker optimization - treats talkers who aren't speaking as\n"
+"             being muted, meaning (a) No encode is done on transmission and\n"
+"             (b) Received audio that is not registered as talking is omitted\n"
+"             causing no buildup in background noise\n"
 "      'v' -- video mode\n"
 "      'w' -- wait until the marked user enters the conference\n"
 "      'x' -- close the conference when last marked user exits\n"
@@ -129,8 +135,11 @@
 LOCAL_USER_DECL;
 
 static struct ast_conference {
+	ast_mutex_t playlock;				/* Conference specific lock (players) */
+	ast_mutex_t listenlock;				/* Conference specific lock (listeners) */
 	char confno[AST_MAX_EXTENSION];		/* Conference */
 	struct ast_channel *chan;		/* Announcements channel */
+	struct ast_channel *lchan;		/* Listen/Record channel */
 	int fd;					/* Announcements fd */
 	int zapconf;				/* Zaptel Conf # */
 	int users;				/* Number of active users */
@@ -147,6 +156,9 @@
 	const char *recordingformat;			/* Format to record the Conference in */
 	char pin[AST_MAX_EXTENSION];		/* If protected by a PIN */
 	char pinadmin[AST_MAX_EXTENSION];	/* If protected by a admin PIN */
+	struct ast_frame *transframe[32];
+	struct ast_frame *origframe;
+	struct ast_trans_pvt *transpath[32];
 	struct ast_conference *next;
 } *confs;
 
@@ -182,6 +194,8 @@
 #define MEETME_DELAYDETECTTALK 		300
 #define MEETME_DELAYDETECTENDTALK 	1000
 
+#define AST_FRAME_BITS 32
+
 enum volume_action {
 	VOL_UP,
 	VOL_DOWN,
@@ -190,6 +204,7 @@
 AST_MUTEX_DEFINE_STATIC(conflock);
 
 static int admin_exec(struct ast_channel *chan, void *data);
+static struct ast_frame null_frame = { AST_FRAME_NULL, };
 
 static void *recordthread(void *args);
 
@@ -200,8 +215,9 @@
 #define LEAVE	1
 
 #define MEETME_RECORD_OFF	0
-#define MEETME_RECORD_ACTIVE	1
-#define MEETME_RECORD_TERMINATE	2
+#define MEETME_RECORD_STARTED	1
+#define MEETME_RECORD_ACTIVE	2
+#define MEETME_RECORD_TERMINATE	3
 
 #define CONF_SIZE 320
 
@@ -227,12 +243,14 @@
 #define CONFFLAG_EMPTYNOPIN (1 << 20)
 #define CONFFLAG_ALWAYSPROMPT (1 << 21)
 #define CONFFLAG_ANNOUNCEUSERCOUNT (1 << 22)	/* If set, when user joins the conference, they will be told the number of users that are already in */
+#define CONFFLAG_OPTIMIZETALKER (1 << 23)	/* If set, treats talking users as muted users */
 
 
 AST_APP_OPTIONS(meetme_opts, {
 	AST_APP_OPTION('a', CONFFLAG_ADMIN ),
 	AST_APP_OPTION('c', CONFFLAG_ANNOUNCEUSERCOUNT ),
 	AST_APP_OPTION('T', CONFFLAG_MONITORTALKER ),
+	AST_APP_OPTION('o', CONFFLAG_OPTIMIZETALKER ),
 	AST_APP_OPTION('i', CONFFLAG_INTROUSER ),
 	AST_APP_OPTION('m', CONFFLAG_MONITOR ),
 	AST_APP_OPTION('p', CONFFLAG_POUNDEXIT ),
@@ -263,14 +281,17 @@
 		return "(not talking)";
 }
 
-static int careful_write(int fd, unsigned char *data, int len)
+static int careful_write(int fd, unsigned char *data, int len, int block)
 {
 	int res;
 	int x;
 
 	while (len) {
-		x = ZT_IOMUX_WRITE | ZT_IOMUX_SIGEVENT;
-		res = ioctl(fd, ZT_IOMUX, &x);
+		if (block) {
+			x = ZT_IOMUX_WRITE | ZT_IOMUX_SIGEVENT;
+			res = ioctl(fd, ZT_IOMUX, &x);
+		} else
+			res = 0;
 		if (res >= 0)
 			res = write(fd, data, len);
 		if (res < 1) {
@@ -403,6 +424,8 @@
 	unsigned char *data;
 	int len;
 	int res = -1;
+	short *data2;
+	int x;
 
 	if (!chan->_softhangup)
 		res = ast_autoservice_start(chan);
@@ -422,8 +445,12 @@
 		data = NULL;
 		len = 0;
 	}
-	if (data) 
-		careful_write(conf->fd, data, len);
+	if (data) {
+		data2 = alloca(len * 2);
+		for (x=0;x<len;x++)
+			data2[x] = AST_MULAW(data[x]);
+		careful_write(conf->fd, (unsigned char *)data2, len << 1, 1);
+	}
 
 	ast_mutex_unlock(&conflock);
 
@@ -447,12 +474,16 @@
 		/* Make a new one */
 		cnf = calloc(1, sizeof(*cnf));
 		if (cnf) {
+			ast_mutex_init(&cnf->playlock);
+			ast_mutex_init(&cnf->listenlock);
 			ast_copy_string(cnf->confno, confno, sizeof(cnf->confno));
 			ast_copy_string(cnf->pin, pin, sizeof(cnf->pin));
 			ast_copy_string(cnf->pinadmin, pinadmin, sizeof(cnf->pinadmin));
 			cnf->markedusers = 0;
-			cnf->chan = ast_request("zap", AST_FORMAT_ULAW, "pseudo", NULL);
+			cnf->chan = ast_request("zap", AST_FORMAT_SLINEAR, "pseudo", NULL);
 			if (cnf->chan) {
+				ast_set_read_format(cnf->chan, AST_FORMAT_SLINEAR);
+				ast_set_write_format(cnf->chan, AST_FORMAT_SLINEAR);
 				cnf->fd = cnf->chan->fds[0];	/* for use by conf_play() */
 			} else {
 				ast_log(LOG_WARNING, "Unable to open pseudo channel - trying device\n");
@@ -478,6 +509,18 @@
 				free(cnf);
 				cnf = NULL;
 				goto cnfout;
+			}
+			cnf->lchan = ast_request("zap", AST_FORMAT_SLINEAR, "pseudo", NULL);
+			if (cnf->lchan) {
+				ast_set_read_format(cnf->lchan, AST_FORMAT_SLINEAR);
+				ast_set_write_format(cnf->lchan, AST_FORMAT_SLINEAR);
+				ztc.chan = 0;
+				ztc.confmode = ZT_CONF_CONFANN | ZT_CONF_CONFANNMON;
+				if (ioctl(cnf->lchan->fds[0], ZT_SETCONF, &ztc)) {
+					ast_log(LOG_WARNING, "Error setting conference\n");
+					ast_hangup(cnf->lchan);
+					cnf->lchan = NULL;
+				}
 			}
 			/* Fill the conference struct */
 			cnf->start = time(NULL);
@@ -749,7 +792,8 @@
 static int conf_free(struct ast_conference *conf)
 {
 	struct ast_conference *prev = NULL, *cur = confs;
-
+	int x;
+	
 	while (cur) {
 		if (cur == conf) {
 			if (prev)
@@ -776,6 +820,16 @@
 		}
 	}
 
+	for (x=0;x<AST_FRAME_BITS;x++) {
+		if (conf->transframe[x])
+			ast_frfree(conf->transframe[x]);
+		if (conf->transpath[x])
+			ast_translator_free_path(conf->transpath[x]);
+	}
+	if (conf->origframe)
+		ast_frfree(conf->origframe);
+	if (conf->lchan)
+		ast_hangup(conf->lchan);
 	if (conf->chan)
 		ast_hangup(conf->chan);
 	else
@@ -828,21 +882,26 @@
 		return ret;
 	}
 
-	if (confflags & CONFFLAG_RECORDCONF && conf->recording !=MEETME_RECORD_ACTIVE) {
-		conf->recordingfilename = pbx_builtin_getvar_helper(chan, "MEETME_RECORDINGFILE");
+	if (confflags & CONFFLAG_RECORDCONF) {
 		if (!conf->recordingfilename) {
-			snprintf(recordingtmp, sizeof(recordingtmp), "meetme-conf-rec-%s-%s", conf->confno, chan->uniqueid);
-			conf->recordingfilename = ast_strdupa(recordingtmp);
-		}
-		conf->recordingformat = pbx_builtin_getvar_helper(chan, "MEETME_RECORDINGFORMAT");
-		if (!conf->recordingformat) {
-			snprintf(recordingtmp, sizeof(recordingtmp), "wav");
-			conf->recordingformat = ast_strdupa(recordingtmp);
-		}
+			conf->recordingfilename = pbx_builtin_getvar_helper(chan, "MEETME_RECORDINGFILE");
+			if (!conf->recordingfilename) {
+				snprintf(recordingtmp, sizeof(recordingtmp), "meetme-conf-rec-%s-%s", conf->confno, chan->uniqueid);
+				conf->recordingfilename = ast_strdupa(recordingtmp);
+			}
+			conf->recordingformat = pbx_builtin_getvar_helper(chan, "MEETME_RECORDINGFORMAT");
+			if (!conf->recordingformat) {
+				snprintf(recordingtmp, sizeof(recordingtmp), "wav");
+				conf->recordingformat = ast_strdupa(recordingtmp);
+			}
+			ast_verbose(VERBOSE_PREFIX_4 "Starting recording of MeetMe Conference %s into file %s.%s.\n",
+				    conf->confno, conf->recordingfilename, conf->recordingformat);
+		}
+	}
+
+	if ((conf->recording == MEETME_RECORD_OFF) && ((confflags & CONFFLAG_RECORDCONF) || (conf->lchan))) {
 		pthread_attr_init(&conf->attr);
 		pthread_attr_setdetachstate(&conf->attr, PTHREAD_CREATE_DETACHED);
-		ast_verbose(VERBOSE_PREFIX_4 "Starting recording of MeetMe Conference %s into file %s.%s.\n",
-			    conf->confno, conf->recordingfilename, conf->recordingformat);
 		ast_pthread_create(&conf->recordthread, &conf->attr, recordthread, conf);
 	}
 
@@ -858,7 +917,7 @@
 	if (confflags & CONFFLAG_MARKEDUSER)
 		conf->markedusers++;
       
-   	ast_mutex_lock(&conflock);
+   	ast_mutex_lock(&conf->playlock);
 	if (!conf->firstuser) {
 		/* Fill the first new User struct */
 		user->user_no = 1;
@@ -870,7 +929,7 @@
 		user->prevuser = conf->lastuser;
 		if (conf->lastuser->nextuser) {
 			ast_log(LOG_WARNING, "Error in User Management!\n");
-			ast_mutex_unlock(&conflock);
+			ast_mutex_unlock(&conf->playlock);
 			goto outrun;
 		} else {
 			conf->lastuser->nextuser = user;
@@ -883,7 +942,7 @@
 	user->adminflags = 0;
 	user->talking = -1;
 	conf->users++;
-	ast_mutex_unlock(&conflock);
+	ast_mutex_unlock(&conf->playlock);
 
 	if (confflags & CONFFLAG_EXIT_CONTEXT) {
 		if ((agifile = pbx_builtin_getvar_helper(chan, "MEETME_EXIT_CONTEXT"))) 
@@ -1026,7 +1085,7 @@
 	ztc.chan = 0;	
 	ztc.confno = conf->zapconf;
 
-	ast_mutex_lock(&conflock);
+	ast_mutex_lock(&conf->playlock);
 
 	if (!(confflags & CONFFLAG_QUIET) && (confflags & CONFFLAG_INTROUSER) && conf->users > 1) {
 		if (conf->chan && ast_fileexists(user->namerecloc, NULL, NULL)) {
@@ -1047,7 +1106,7 @@
 	if (ioctl(fd, ZT_SETCONF, &ztc)) {
 		ast_log(LOG_WARNING, "Error setting conference\n");
 		close(fd);
-		ast_mutex_unlock(&conflock);
+		ast_mutex_unlock(&conf->playlock);
 		goto outrun;
 	}
 	ast_log(LOG_DEBUG, "Placed channel %s in ZAP conf %d\n", chan->name, conf->zapconf);
@@ -1066,7 +1125,7 @@
 				conf_play(chan, conf, ENTER);
 	}
 
-	ast_mutex_unlock(&conflock);
+	ast_mutex_unlock(&conf->playlock);
 
 	conf_flush(fd, chan);
 
@@ -1103,7 +1162,7 @@
 			x = 1;
 			ast_channel_setoption(chan, AST_OPTION_TONE_VERIFY, &x, sizeof(char), 0);
 		}	
-		if (confflags & CONFFLAG_MONITORTALKER && !(dsp = ast_dsp_new())) {
+		if (confflags & (CONFFLAG_MONITORTALKER | CONFFLAG_OPTIMIZETALKER) && !(dsp = ast_dsp_new())) {
 			ast_log(LOG_WARNING, "Unable to allocate DSP!\n");
 			res = -1;
 		}
@@ -1142,6 +1201,7 @@
 			}
 
 			c = ast_waitfor_nandfds(&chan, 1, &fd, nfds, NULL, &outfd, &ms);
+			
 			
 			/* Update the struct with the actual confflags */
 			user->userflags = confflags;
@@ -1266,14 +1326,17 @@
 					user->zapchannel = !retryzap;
 					goto zapretry;
 				}
-				f = ast_read(c);
+				if ((confflags & CONFFLAG_MONITOR) || (user->adminflags & ADMINFLAG_MUTED))
+					f = ast_read_noaudio(c);
+				else
+					f = ast_read(c);
 				if (!f)
 					break;
 				if ((f->frametype == AST_FRAME_VOICE) && (f->subclass == AST_FORMAT_SLINEAR)) {
 					if (user->talk.actual)
 						ast_frame_adjust_volume(f, user->talk.actual);
 
-					if (confflags &  CONFFLAG_MONITORTALKER) {
+					if (confflags & (CONFFLAG_MONITORTALKER | CONFFLAG_OPTIMIZETALKER)) {
 						int totalsilence;
 
 						if (user->talking == -1)
@@ -1282,7 +1345,8 @@
 						res = ast_dsp_silence(dsp, f, &totalsilence);
 						if (!user->talking && totalsilence < MEETME_DELAYDETECTTALK) {
 							user->talking = 1;
-							manager_event(EVENT_FLAG_CALL, "MeetmeTalking",
+							if (confflags & CONFFLAG_MONITORTALKER)
+								manager_event(EVENT_FLAG_CALL, "MeetmeTalking",
 								      "Channel: %s\r\n"
 								      "Uniqueid: %s\r\n"
 								      "Meetme: %s\r\n"
@@ -1291,7 +1355,8 @@
 						}
 						if (user->talking && totalsilence > MEETME_DELAYDETECTENDTALK) {
 							user->talking = 0;
-							manager_event(EVENT_FLAG_CALL, "MeetmeStopTalking",
+							if (confflags & CONFFLAG_MONITORTALKER)
+								manager_event(EVENT_FLAG_CALL, "MeetmeStopTalking",
 								      "Channel: %s\r\n"
 								      "Uniqueid: %s\r\n"
 								      "Meetme: %s\r\n"
@@ -1308,7 +1373,12 @@
 						   audio frames (in which case carefully writing would only
 						   have delayed the audio even further).
 						*/
-						write(fd, f->data, f->datalen);
+						/* As it turns out, we do want to use careful write.  We just
+						   don't want to block, but we do want to at least *try*
+						   to write out all the samples.
+						 */
+						if (user->talking || !(confflags & CONFFLAG_OPTIMIZETALKER))
+							careful_write(fd, f->data, f->datalen, 0);
 					}
 				} else if ((f->frametype == AST_FRAME_DTMF) && (confflags & CONFFLAG_EXIT_CONTEXT)) {
 					char tmp[2];
@@ -1504,10 +1574,46 @@
 					fr.samples = res/2;
 					fr.data = buf;
 					fr.offset = AST_FRIENDLY_OFFSET;
-					if (user->listen.actual)
-						ast_frame_adjust_volume(&fr, user->listen.actual);
-					if (ast_write(chan, &fr) < 0) {
-						ast_log(LOG_WARNING, "Unable to write frame to channel: %s\n", strerror(errno));
+					if (!user->listen.actual && 
+						((confflags & CONFFLAG_MONITOR) || 
+						 (user->adminflags & ADMINFLAG_MUTED) ||
+						 (user->talking && (confflags & CONFFLAG_OPTIMIZETALKER))
+						 )) {
+						int index;
+						for (index=0;index<AST_FRAME_BITS;index++)
+							if (chan->rawwriteformat & (1 << index))
+								break;
+						if (index >= AST_FRAME_BITS)
+							goto bailoutandtrynormal;
+						ast_mutex_lock(&conf->listenlock);
+						if (!conf->transframe[index]) {
+							if (conf->origframe) {
+								if (!conf->transpath[index])
+									conf->transpath[index] = ast_translator_build_path((1 << index), AST_FORMAT_SLINEAR);
+								if (conf->transpath[index]) {
+									conf->transframe[index] = ast_translate(conf->transpath[index], conf->origframe, 0);
+									if (!conf->transframe[index])
+										conf->transframe[index] = &null_frame;
+								}
+							}
+						}
+						if (conf->transframe[index]) {
+ 							if (conf->transframe[index]->frametype != AST_FRAME_NULL) {
+	 							if (ast_write(chan, conf->transframe[index]))
+									ast_log(LOG_WARNING, "Unable to write frame to channel: %s\n", strerror(errno));
+							}
+						} else {
+							ast_mutex_unlock(&conf->listenlock);

[... 7205 lines stripped ...]


More information about the asterisk-commits mailing list