[asterisk-commits] file: branch file/usecnt-cleanup r57004 - in /team/file/usecnt-cleanup: ./ ap...

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Tue Feb 27 12:25:43 MST 2007


Author: file
Date: Tue Feb 27 13:25:42 2007
New Revision: 57004

URL: http://svn.digium.com/view/asterisk?view=rev&rev=57004
Log:
Merged revisions 56373,56408,56421,56431,56447,56458,56487,56506,56564,56574,56579,56594,56623,56629,56647-56648,56665,56686,56731-56732,56742,56784,56786,56811,56840,56849,56860,56889,56926,56952,56976 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/trunk

................
r56373 | kpfleming | 2007-02-23 14:00:23 -0500 (Fri, 23 Feb 2007) | 10 lines

Merged revisions 56372 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r56372 | kpfleming | 2007-02-23 12:59:09 -0600 (Fri, 23 Feb 2007) | 2 lines

build special version strings for AADK/S800i builds

........

................
r56408 | russell | 2007-02-23 15:21:35 -0500 (Fri, 23 Feb 2007) | 20 lines

Merged revisions 56407 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/branches/1.4

................
r56407 | russell | 2007-02-23 14:20:00 -0600 (Fri, 23 Feb 2007) | 12 lines

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

........
r56406 | russell | 2007-02-23 14:17:56 -0600 (Fri, 23 Feb 2007) | 4 lines

Don't destroy mutexes before unregistering all of the entry points from the core.
Also, fix a potential memory leak from not destroying the locks for all of the
possible call numbers (about 32k of them).

........

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

................
r56421 | russell | 2007-02-23 16:08:25 -0500 (Fri, 23 Feb 2007) | 2 lines

Add GetConfigJSON to the CHANGES file.

................
r56431 | russell | 2007-02-23 16:12:28 -0500 (Fri, 23 Feb 2007) | 2 lines

Note that the entries in the CHANGES file only list functionality changes

................
r56447 | russell | 2007-02-23 16:20:33 -0500 (Fri, 23 Feb 2007) | 25 lines

Merge team/russell/iax2_performance.

There is not a large amount of code here and the changes are not very invasive.
However, they should significantly improve performance of chan_iax2 under load.

IAX2 media frames only carry the *source* call number.  So, when one arrives,
the correct session that it is a part of has to be matched on IP address, port
number, and call number, instead of just a call number.  Had these frames
carried the *destination* call number, this would not be an issue, because that
would be a unique identifier that would make it easy to immediately identify
the correct session.

The way that chan_iax2 did this matching was extremely inefficient.  It starts
at the first available call number and traverses each call number sequentially,
locking and unlocking a mutex for each one, to try to match against it.  It
would do this regardless of whether the call number was in use or not.  So,
for a call with a local call number of 25000, every single incoming media
frame would require a traversal that required 25000 mutex lock and unlock
operations.  (Note that the max call number is about 32k).

I have introduced a hash table of active IAX2 calls to improve this lookup
process.  The hash is done on the IP address, port number, and call number.  
So, for the previous example, a few lock/unlock operations may be done versus 
25000 for each frame.

................
r56458 | file | 2007-02-23 16:57:07 -0500 (Fri, 23 Feb 2007) | 10 lines

Merged revisions 56457 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r56457 | file | 2007-02-23 16:53:41 -0500 (Fri, 23 Feb 2007) | 2 lines

Change log notice to debug. It is possible for a scheduled item to execute and be deleted at close to the same time and unavoidable. If this happens this message creeps up.

........

................
r56487 | russell | 2007-02-23 17:26:00 -0500 (Fri, 23 Feb 2007) | 3 lines

Make the hashing function calculate something that makes more sense.
(Thanks to bmd on #asterisk-dev for pointing out my pointless math).

................
r56506 | russell | 2007-02-23 18:25:22 -0500 (Fri, 23 Feb 2007) | 24 lines

Merged revisions 56505 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/branches/1.4

................
r56505 | russell | 2007-02-23 17:24:18 -0600 (Fri, 23 Feb 2007) | 16 lines

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

........
r56504 | russell | 2007-02-23 17:20:55 -0600 (Fri, 23 Feb 2007) | 8 lines

Fix up a couple more signal handlers to not do bad things that could cause
various undesirable results.  The other day, I made Asterisk deadlock by
hitting Control-C because of a bad signal handler.  Now, signal handlers
just set a flag and write to an alert pipe for the flag to be handled.  Then,
there is another thread that is monitoring for these flags.  If being run in
console mode, it is just the main thread.  If Asterisk is in the background,
a thread is created to do it.

........

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

................
r56564 | file | 2007-02-23 20:56:41 -0500 (Fri, 23 Feb 2007) | 2 lines

Make Meetme build again under dev mode.

................
r56574 | qwell | 2007-02-23 21:04:34 -0500 (Fri, 23 Feb 2007) | 13 lines

Merged revisions 56569 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r56569 | qwell | 2007-02-23 20:02:53 -0600 (Fri, 23 Feb 2007) | 4 lines

Make sure to set a speeddials parent on creation.
Don't crash if hold is pressed when no call is active.
Don't return in places that we shouldn't..
Update softkey map when call is connected

........

................
r56579 | qwell | 2007-02-23 21:06:44 -0500 (Fri, 23 Feb 2007) | 4 lines

Support devicestate requests.

Now you should be able to subscribe to a Skinny device/line.

................
r56594 | qwell | 2007-02-23 21:23:43 -0500 (Fri, 23 Feb 2007) | 8 lines

Allow a Skinny device to monitor a dialplan hint (w00t!).

See skinny.conf.sample for configuration example.


Note: Some devices (seen on 12SP+/30VIP) will lock up if they monitor too many hints.
This seems to be a hardware limitation - there isn't anything we can do about it.

................
r56623 | oej | 2007-02-24 12:51:23 -0500 (Sat, 24 Feb 2007) | 2 lines

Doxygen updates for AJI - The Asterisk Jabber API

................
r56629 | oej | 2007-02-24 13:03:17 -0500 (Sat, 24 Feb 2007) | 2 lines

Add some external references

................
r56647 | oej | 2007-02-24 14:27:50 -0500 (Sat, 24 Feb 2007) | 8 lines

Creating new doxygen macro "\extref" to create page that lists 
external libraries and URLs to these. Please help me add these
references.

We might want to create a similar macro "\linuxpackage" to list
the needed Linux packages in popular distributions.


................
r56648 | oej | 2007-02-24 14:49:11 -0500 (Sat, 24 Feb 2007) | 2 lines

Doxygen updates and corrections

................
r56665 | oej | 2007-02-24 15:29:41 -0500 (Sat, 24 Feb 2007) | 2 lines

Doxygen additions, corrections

................
r56686 | tilghman | 2007-02-25 09:53:40 -0500 (Sun, 25 Feb 2007) | 19 lines

Merged revisions 56685 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/branches/1.4

................
r56685 | tilghman | 2007-02-25 08:46:41 -0600 (Sun, 25 Feb 2007) | 11 lines

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

........
r56684 | tilghman | 2007-02-25 08:38:03 -0600 (Sun, 25 Feb 2007) | 3 lines

Issue 9130 - If prev is the last item on the channel list, then evaluating
additional conditions (e.g. name prefix) will cause a NULL dereference.

........

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

................
r56731 | russell | 2007-02-25 19:37:03 -0500 (Sun, 25 Feb 2007) | 3 lines

There is no need to look in the iaxs array for the pvt struct when we already
have a pointer to it.

................
r56732 | russell | 2007-02-25 19:38:49 -0500 (Sun, 25 Feb 2007) | 3 lines

Remove redundant check to ensure that LOW_MEMORY is not defined.
(issue #9136, mvanbaak)

................
r56742 | russell | 2007-02-25 20:05:15 -0500 (Sun, 25 Feb 2007) | 10 lines

Merged revisions 56740 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r56740 | russell | 2007-02-25 19:04:40 -0600 (Sun, 25 Feb 2007) | 2 lines

Move a comment to be in the correct struct.

........

................
r56784 | file | 2007-02-26 11:38:10 -0500 (Mon, 26 Feb 2007) | 10 lines

Merged revisions 56783 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r56783 | file | 2007-02-26 11:36:08 -0500 (Mon, 26 Feb 2007) | 2 lines

Allow both of the show version files and core show file versions CLI commands to work. (issue #9135 reported by mvanbaak)

........

................
r56786 | russell | 2007-02-26 11:54:17 -0500 (Mon, 26 Feb 2007) | 11 lines

Merged revisions 56785 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r56785 | russell | 2007-02-26 10:51:18 -0600 (Mon, 26 Feb 2007) | 3 lines

Do more complete locking of the chan_iax2_pvt struct in the indicate callback.
(Problem brought up by Ben Smithurst on the asterisk-dev list)

........

................
r56811 | file | 2007-02-26 12:12:18 -0500 (Mon, 26 Feb 2007) | 10 lines

Merged revisions 56805 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r56805 | file | 2007-02-26 12:09:53 -0500 (Mon, 26 Feb 2007) | 2 lines

Use ast_strlen_zero to see if the language and/or context argument is not present for Background instead of just checking if it is NULL. (issue #9141 reported by mjagdis)

........

................
r56840 | file | 2007-02-26 14:34:59 -0500 (Mon, 26 Feb 2007) | 10 lines

Merged revisions 56839 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r56839 | file | 2007-02-26 14:33:48 -0500 (Mon, 26 Feb 2007) | 2 lines

Update app_record documentation to use new CLI command, core show file formats. (issue #9151 reported by junky)

........

................
r56849 | russell | 2007-02-26 15:04:53 -0500 (Mon, 26 Feb 2007) | 10 lines

Merged revisions 56847 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r56847 | russell | 2007-02-26 14:04:13 -0600 (Mon, 26 Feb 2007) | 2 lines

Fix a crash in my last change to iax2_indicate(). (issue #9150)

........

................
r56860 | file | 2007-02-26 15:09:06 -0500 (Mon, 26 Feb 2007) | 18 lines

Merged revisions 56856 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/branches/1.4

................
r56856 | file | 2007-02-26 15:07:18 -0500 (Mon, 26 Feb 2007) | 10 lines

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

........
r56850 | file | 2007-02-26 15:05:02 -0500 (Mon, 26 Feb 2007) | 2 lines

Obey the clearglobalvars option in extensions reload (or dialplan reload depending on your version). (issue #9146 reported by ramonpeek)

........

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

................
r56889 | russell | 2007-02-26 15:43:18 -0500 (Mon, 26 Feb 2007) | 12 lines

Merged revisions 56888 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r56888 | russell | 2007-02-26 14:42:21 -0600 (Mon, 26 Feb 2007) | 4 lines

Restore the behavior of Asterisk 1.2 where if a device was not specified in
alsa.conf, then we just use the system default, instead of creating our own
default of hw:0,0.  (issue #9139)

........

................
r56926 | tilghman | 2007-02-26 17:02:54 -0500 (Mon, 26 Feb 2007) | 9 lines

Blocked revisions 56922 via svnmerge

........
r56922 | tilghman | 2007-02-26 16:01:23 -0600 (Mon, 26 Feb 2007) | 2 lines

Picky, picky... show deprecation warning in application help, too (reported via list)

........

................
r56952 | tilghman | 2007-02-26 19:11:32 -0500 (Mon, 26 Feb 2007) | 2 lines

Issue 7789 - some telcos want the TON set based on the number, but without the NANP prefix removed

................
r56976 | russell | 2007-02-27 12:38:57 -0500 (Tue, 27 Feb 2007) | 14 lines

(also issue #9159)

Merged revisions 56975 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r56975 | russell | 2007-02-27 11:36:09 -0600 (Tue, 27 Feb 2007) | 4 lines

Fix voicemail email attachments.  I missed the conversion of one of the line
endings and there was an extra one where it should not have been.
(issue #9128)

........

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

Modified:
    team/file/usecnt-cleanup/   (props changed)
    team/file/usecnt-cleanup/CHANGES
    team/file/usecnt-cleanup/apps/app_amd.c
    team/file/usecnt-cleanup/apps/app_festival.c
    team/file/usecnt-cleanup/apps/app_meetme.c
    team/file/usecnt-cleanup/apps/app_osplookup.c
    team/file/usecnt-cleanup/apps/app_record.c
    team/file/usecnt-cleanup/apps/app_voicemail.c
    team/file/usecnt-cleanup/build_tools/make_version_h
    team/file/usecnt-cleanup/cdr/cdr_pgsql.c
    team/file/usecnt-cleanup/cdr/cdr_radius.c
    team/file/usecnt-cleanup/cdr/cdr_sqlite.c
    team/file/usecnt-cleanup/channels/chan_alsa.c
    team/file/usecnt-cleanup/channels/chan_h323.c
    team/file/usecnt-cleanup/channels/chan_iax2.c
    team/file/usecnt-cleanup/channels/chan_skinny.c
    team/file/usecnt-cleanup/channels/chan_zap.c
    team/file/usecnt-cleanup/codecs/codec_speex.c
    team/file/usecnt-cleanup/configs/skinny.conf.sample
    team/file/usecnt-cleanup/configs/zapata.conf.sample
    team/file/usecnt-cleanup/contrib/asterisk-ng-doxygen
    team/file/usecnt-cleanup/funcs/func_curl.c
    team/file/usecnt-cleanup/include/asterisk/ael_structs.h
    team/file/usecnt-cleanup/include/asterisk/config.h
    team/file/usecnt-cleanup/include/asterisk/doxyref.h
    team/file/usecnt-cleanup/include/asterisk/frame.h
    team/file/usecnt-cleanup/include/asterisk/http.h
    team/file/usecnt-cleanup/include/asterisk/jabber.h
    team/file/usecnt-cleanup/include/asterisk/jingle.h
    team/file/usecnt-cleanup/include/asterisk/utils.h
    team/file/usecnt-cleanup/include/asterisk/zapata.h
    team/file/usecnt-cleanup/main/asterisk.c
    team/file/usecnt-cleanup/main/channel.c
    team/file/usecnt-cleanup/main/config.c
    team/file/usecnt-cleanup/main/manager.c
    team/file/usecnt-cleanup/main/pbx.c
    team/file/usecnt-cleanup/main/rtp.c
    team/file/usecnt-cleanup/main/sched.c
    team/file/usecnt-cleanup/pbx/pbx_ael.c
    team/file/usecnt-cleanup/pbx/pbx_config.c
    team/file/usecnt-cleanup/res/res_crypto.c
    team/file/usecnt-cleanup/res/res_limit.c
    team/file/usecnt-cleanup/res/res_snmp.c

Propchange: team/file/usecnt-cleanup/
------------------------------------------------------------------------------
Binary property 'branch-1.4-blocked' - no diff available.

Propchange: team/file/usecnt-cleanup/
------------------------------------------------------------------------------
Binary property 'branch-1.4-merged' - no diff available.

Propchange: team/file/usecnt-cleanup/
------------------------------------------------------------------------------
--- svnmerge-integrated (original)
+++ svnmerge-integrated Tue Feb 27 13:25:42 2007
@@ -1,1 +1,1 @@
-/trunk:1-56371
+/trunk:1-57003

Modified: team/file/usecnt-cleanup/CHANGES
URL: http://svn.digium.com/view/asterisk/team/file/usecnt-cleanup/CHANGES?view=diff&rev=57004&r1=57003&r2=57004
==============================================================================
--- team/file/usecnt-cleanup/CHANGES (original)
+++ team/file/usecnt-cleanup/CHANGES Tue Feb 27 13:25:42 2007
@@ -1,4 +1,10 @@
-Changes since Asterisk 1.4-beta was branched:
+-------------------------------------------------------------------------------
+--- Functionality changes since Asterisk 1.4-beta was branched ----------------
+-------------------------------------------------------------------------------
+
+Miscellaneous 
+-------------
+
   * Added the bindaddr option to gtalk.conf.
   * Added the ability to specify arguments to the Dial application when using
     the DUNDi switch in the dialplan.
@@ -69,6 +75,10 @@
      CallerIDNum is used for number and CallerIDName for name.
   * enable https support for builtin web server.
      See configs/http.conf.sample for details.
+  * Added a new action, GetConfigJSON, which can return the contents of an
+    Asterisk configuration file in JSON format.  This is intended to help
+    improve the performance of AJAX applications using the manager interface
+    over HTTP.
 
 Dialplan functions
 ------------------

Modified: team/file/usecnt-cleanup/apps/app_amd.c
URL: http://svn.digium.com/view/asterisk/team/file/usecnt-cleanup/apps/app_amd.c?view=diff&rev=57004&r1=57003&r2=57004
==============================================================================
--- team/file/usecnt-cleanup/apps/app_amd.c (original)
+++ team/file/usecnt-cleanup/apps/app_amd.c Tue Feb 27 13:25:42 2007
@@ -18,6 +18,14 @@
  * A license has been granted to Digium (via disclaimer) for the use of
  * this code.
  */
+
+/*! \file
+ *
+ * \brief Answering machine detection
+ *
+ * \author Claude Klimos (claude.klimos at aheeva.com)
+ */
+
 
 #include "asterisk.h"
  

Modified: team/file/usecnt-cleanup/apps/app_festival.c
URL: http://svn.digium.com/view/asterisk/team/file/usecnt-cleanup/apps/app_festival.c?view=diff&rev=57004&r1=57003&r2=57004
==============================================================================
--- team/file/usecnt-cleanup/apps/app_festival.c (original)
+++ team/file/usecnt-cleanup/apps/app_festival.c Tue Feb 27 13:25:42 2007
@@ -21,6 +21,8 @@
  * \brief Connect to festival
  *
  * \author Christos Ricudis <ricudis at itc.auth.gr>
+ *
+ * \extref  The Festival Speech Synthesis System - http://www.cstr.ed.ac.uk/projects/festival/
  * 
  * \ingroup applications
  */

Modified: team/file/usecnt-cleanup/apps/app_meetme.c
URL: http://svn.digium.com/view/asterisk/team/file/usecnt-cleanup/apps/app_meetme.c?view=diff&rev=57004&r1=57003&r2=57004
==============================================================================
--- team/file/usecnt-cleanup/apps/app_meetme.c (original)
+++ team/file/usecnt-cleanup/apps/app_meetme.c Tue Feb 27 13:25:42 2007
@@ -334,6 +334,7 @@
 	int actual;                             /*!< Actual volume adjustment (for channels that can't adjust) */
 };
 
+/*! \brief The MeetMe User object */
 struct ast_conf_user {
 	int user_no;                            /*!< User Number */
 	int userflags;                          /*!< Flags as set in the conference */
@@ -399,9 +400,6 @@
 	/*! Number of stations that have this trunk on hold. */
 	unsigned int hold_stations;
 	struct ast_channel *chan;
-	/*! Ring timeout to use when this trunk is ringing on this specific
-	 *  station.  This takes higher priority than a ring timeout set at
-	 *  the station level. */
 	unsigned int ring_timeout;
 };
 
@@ -410,6 +408,9 @@
 	struct sla_trunk *trunk;
 	enum sla_trunk_state state;
 	struct ast_channel *chan;
+	/*! Ring timeout to use when this trunk is ringing on this specific
+	 *  station.  This takes higher priority than a ring timeout set at
+	 *  the station level. */
 	unsigned int ring_timeout;
 };
 
@@ -3197,7 +3198,7 @@
 
 	AST_LIST_TRAVERSE_SAFE_BEGIN(&sla.ringing_stations, ringing_station, entry) {
 		struct sla_trunk_ref *s_trunk_ref;
-		struct sla_ringing_trunk *ringing_trunk;
+		struct sla_ringing_trunk *ringing_trunk = NULL;
 		struct run_station_args args;
 		enum ast_dial_result dial_res;
 		pthread_attr_t attr;

Modified: team/file/usecnt-cleanup/apps/app_osplookup.c
URL: http://svn.digium.com/view/asterisk/team/file/usecnt-cleanup/apps/app_osplookup.c?view=diff&rev=57004&r1=57003&r2=57004
==============================================================================
--- team/file/usecnt-cleanup/apps/app_osplookup.c (original)
+++ team/file/usecnt-cleanup/apps/app_osplookup.c Tue Feb 27 13:25:42 2007
@@ -21,6 +21,9 @@
  * \brief Open Settlement Protocol (OSP) Applications
  *
  * \author Mark Spencer <markster at digium.com>
+ *
+ * \extref The OSP Toolkit: http://www.transnexus.com
+ * \extref OpenSSL http://www.openssl.org
  *
  * \ingroup applications
  */

Modified: team/file/usecnt-cleanup/apps/app_record.c
URL: http://svn.digium.com/view/asterisk/team/file/usecnt-cleanup/apps/app_record.c?view=diff&rev=57004&r1=57003&r2=57004
==============================================================================
--- team/file/usecnt-cleanup/apps/app_record.c (original)
+++ team/file/usecnt-cleanup/apps/app_record.c Tue Feb 27 13:25:42 2007
@@ -69,7 +69,7 @@
 "If filename contains '%d', these characters will be replaced with a number\n"
 "incremented by one each time the file is recorded. A channel variable\n"
 "named RECORDED_FILE will also be set, which contains the final filemname.\n\n"
-"Use 'show file formats' to see the available formats on your system\n\n"
+"Use 'core show file formats' to see the available formats on your system\n\n"
 "User can press '#' to terminate the recording and continue to the next priority.\n\n"
 "If the user should hangup during a recording, all data will be lost and the\n"
 "application will teminate. \n";

Modified: team/file/usecnt-cleanup/apps/app_voicemail.c
URL: http://svn.digium.com/view/asterisk/team/file/usecnt-cleanup/apps/app_voicemail.c?view=diff&rev=57004&r1=57003&r2=57004
==============================================================================
--- team/file/usecnt-cleanup/apps/app_voicemail.c (original)
+++ team/file/usecnt-cleanup/apps/app_voicemail.c Tue Feb 27 13:25:42 2007
@@ -21,6 +21,10 @@
  * \brief Comedian Mail - Voicemail System
  *
  * \author Mark Spencer <markster at digium.com>
+ *
+ * \extref Unixodbc - http://www.unixodbc.org
+ * \extref A source distribution of University of Washington's IMAP
+c-client (http://www.washington.edu/imap/
  * 
  * \par See also
  * \arg \ref Config_vm

Modified: team/file/usecnt-cleanup/build_tools/make_version_h
URL: http://svn.digium.com/view/asterisk/team/file/usecnt-cleanup/build_tools/make_version_h?view=diff&rev=57004&r1=57003&r2=57004
==============================================================================
--- team/file/usecnt-cleanup/build_tools/make_version_h (original)
+++ team/file/usecnt-cleanup/build_tools/make_version_h Tue Feb 27 13:25:42 2007
@@ -1,5 +1,6 @@
 #!/bin/sh
-cat << END
+if [ ! -f ../.flavor ]; then
+    cat << END
 /*
  * version.h 
  * Automatically generated
@@ -8,3 +9,17 @@
 #define ASTERISK_VERSION_NUM ${ASTERISKVERSIONNUM}
 
 END
+else
+    aadkver=`cat ../.version`
+    aadkflavor=`cat ../.flavor`
+    cat << END
+/*
+ * version.h 
+ * Automatically generated
+ */
+#define ASTERISK_VERSION "${ASTERISKVERSION} (${aadkflavor} ${aadkver})"
+#define ASTERISK_VERSION_NUM ${ASTERISKVERSIONNUM}
+
+END
+fi
+

Modified: team/file/usecnt-cleanup/cdr/cdr_pgsql.c
URL: http://svn.digium.com/view/asterisk/team/file/usecnt-cleanup/cdr/cdr_pgsql.c?view=diff&rev=57004&r1=57003&r2=57004
==============================================================================
--- team/file/usecnt-cleanup/cdr/cdr_pgsql.c (original)
+++ team/file/usecnt-cleanup/cdr/cdr_pgsql.c Tue Feb 27 13:25:42 2007
@@ -25,6 +25,7 @@
  * \brief PostgreSQL CDR logger 
  * 
  * \author Matthew D. Hardeman <mhardemn at papersoft.com> 
+ * \extref PostgreSQL http://www.postgresql.org/
  *
  * See also
  * \arg \ref Config_cdr

Modified: team/file/usecnt-cleanup/cdr/cdr_radius.c
URL: http://svn.digium.com/view/asterisk/team/file/usecnt-cleanup/cdr/cdr_radius.c?view=diff&rev=57004&r1=57003&r2=57004
==============================================================================
--- team/file/usecnt-cleanup/cdr/cdr_radius.c (original)
+++ team/file/usecnt-cleanup/cdr/cdr_radius.c Tue Feb 27 13:25:42 2007
@@ -20,6 +20,7 @@
  *
  * \brief RADIUS CDR Support
  * \author Philippe Sultan
+ * \extref FreeRadius http://www.freeradius.org/
  * 
  * \arg See also \ref AstCDR
  * \ingroup cdr_drivers

Modified: team/file/usecnt-cleanup/cdr/cdr_sqlite.c
URL: http://svn.digium.com/view/asterisk/team/file/usecnt-cleanup/cdr/cdr_sqlite.c?view=diff&rev=57004&r1=57003&r2=57004
==============================================================================
--- team/file/usecnt-cleanup/cdr/cdr_sqlite.c (original)
+++ team/file/usecnt-cleanup/cdr/cdr_sqlite.c Tue Feb 27 13:25:42 2007
@@ -22,6 +22,7 @@
  * \brief Store CDR records in a SQLite database.
  * 
  * \author Holger Schurig <hs4233 at mail.mn-solutions.de>
+ * \extref SQLite http://www.sqlite.org/
  *
  * See also
  * \arg \ref Config_cdr

Modified: team/file/usecnt-cleanup/channels/chan_alsa.c
URL: http://svn.digium.com/view/asterisk/team/file/usecnt-cleanup/channels/chan_alsa.c?view=diff&rev=57004&r1=57003&r2=57004
==============================================================================
--- team/file/usecnt-cleanup/channels/chan_alsa.c (original)
+++ team/file/usecnt-cleanup/channels/chan_alsa.c Tue Feb 27 13:25:42 2007
@@ -83,8 +83,8 @@
 
 #define DEBUG 0
 /* Which device to use */
-#define ALSA_INDEV "hw:0,0"
-#define ALSA_OUTDEV "hw:0,0"
+#define ALSA_INDEV "default"
+#define ALSA_OUTDEV "default"
 #define DESIRED_RATE 8000
 
 /* Lets use 160 sample frames, just like GSM.  */

Modified: team/file/usecnt-cleanup/channels/chan_h323.c
URL: http://svn.digium.com/view/asterisk/team/file/usecnt-cleanup/channels/chan_h323.c?view=diff&rev=57004&r1=57003&r2=57004
==============================================================================
--- team/file/usecnt-cleanup/channels/chan_h323.c (original)
+++ team/file/usecnt-cleanup/channels/chan_h323.c Tue Feb 27 13:25:42 2007
@@ -29,6 +29,7 @@
  *
  * \par See also
  * \arg Config_h323
+ * \extref OpenH323 http://www.openh323.org/
  *
  * \ingroup channel_drivers
  */
@@ -119,10 +120,9 @@
 setpeercapabilities_cb on_setpeercapabilities;
 onhold_cb on_hold;
 
-/* global debug flag */
-int h323debug;
-
-/*! Global jitterbuffer configuration - by default, jb is disabled */
+int h323debug; /*!< global debug flag */
+
+/*! \brief Global jitterbuffer configuration - by default, jb is disabled */
 static struct ast_jb_conf default_jbconf =
 {
 	.flags = 0,
@@ -155,79 +155,81 @@
 
 static call_options_t global_options;
 
-/** Private structure of a OpenH323 channel */
+/*! \brief Private structure of a OpenH323 channel */
 struct oh323_pvt {
-	ast_mutex_t lock;					/* Channel private lock */
-	call_options_t options;				/* Options to be used during call setup */
-	int alreadygone;					/* Whether or not we've already been destroyed by our peer */
-	int needdestroy;					/* if we need to be destroyed */
-	call_details_t cd;					/* Call details */
-	struct ast_channel *owner;			/* Who owns us */
-	struct sockaddr_in sa;				/* Our peer */
-	struct sockaddr_in redirip;			/* Where our RTP should be going if not to us */
-	int nonCodecCapability;				/* non-audio capability */
-	int outgoing;						/* Outgoing or incoming call? */
-	char exten[AST_MAX_EXTENSION];		/* Requested extension */
-	char context[AST_MAX_CONTEXT];		/* Context where to start */
-	char accountcode[256];				/* Account code */
-	char rdnis[80];						/* Referring DNIS, if available */
-	int amaflags;						/* AMA Flags */
-	struct ast_rtp *rtp;				/* RTP Session */
-	struct ast_dsp *vad;				/* Used for in-band DTMF detection */
-	int nativeformats;					/* Codec formats supported by a channel */
-	int needhangup;						/* Send hangup when Asterisk is ready */
-	int hangupcause;					/* Hangup cause from OpenH323 layer */
-	int newstate;						/* Pending state change */
-	int newcontrol;						/* Pending control to send */
-	int newdigit;						/* Pending DTMF digit to send */
-	int newduration;					/* Pending DTMF digit duration to send */
-	int pref_codec;						/* Preferred codec */
-	int peercapability;					/* Capabilities learned from peer */
-	int jointcapability;				/* Common capabilities for local and remote side */
-	struct ast_codec_pref peer_prefs;	/* Preferenced list of codecs which remote side supports */
-	int dtmf_pt[2];						/* Payload code used for RFC2833/CISCO messages */
-	int curDTMF;						/* DTMF tone being generated to Asterisk side */
-	int DTMFsched;						/* Scheduler descriptor for DTMF */
-	int update_rtp_info;				/* Configuration of fd's array is pending */
-	int recvonly;						/* Peer isn't wish to receive our voice stream */
-	int txDtmfDigit;					/* DTMF digit being to send to H.323 side */
-	int noInbandDtmf;					/* Inband DTMF processing by DSP isn't available */
-	int connection_established;			/* Call got CONNECT message */
-	int got_progress;					/* Call got PROGRESS message, pass inband audio */
-	struct oh323_pvt *next;				/* Next channel in list */
+	ast_mutex_t lock;			/*!< Channel private lock */
+	call_options_t options;			/*!<!< Options to be used during call setup */
+	int alreadygone;			/*!< Whether or not we've already been destroyed by our peer */
+	int needdestroy;			/*!< if we need to be destroyed */
+	call_details_t cd;			/*!< Call details */
+	struct ast_channel *owner;		/*!< Who owns us */
+	struct sockaddr_in sa;			/*!< Our peer */
+	struct sockaddr_in redirip;		/*!< Where our RTP should be going if not to us */
+	int nonCodecCapability;			/*!< non-audio capability */
+	int outgoing;				/*!< Outgoing or incoming call? */
+	char exten[AST_MAX_EXTENSION];		/*!< Requested extension */
+	char context[AST_MAX_CONTEXT];		/*!< Context where to start */
+	char accountcode[256];			/*!< Account code */
+	char rdnis[80];				/*!< Referring DNIS, if available */
+	int amaflags;				/*!< AMA Flags */
+	struct ast_rtp *rtp;			/*!< RTP Session */
+	struct ast_dsp *vad;			/*!< Used for in-band DTMF detection */
+	int nativeformats;			/*!< Codec formats supported by a channel */
+	int needhangup;				/*!< Send hangup when Asterisk is ready */
+	int hangupcause;			/*!< Hangup cause from OpenH323 layer */
+	int newstate;				/*!< Pending state change */
+	int newcontrol;				/*!< Pending control to send */
+	int newdigit;				/*!< Pending DTMF digit to send */
+	int newduration;			/*!< Pending DTMF digit duration to send */
+	int pref_codec;				/*!< Preferred codec */
+	int peercapability;			/*!< Capabilities learned from peer */
+	int jointcapability;			/*!< Common capabilities for local and remote side */
+	struct ast_codec_pref peer_prefs;	/*!< Preferenced list of codecs which remote side supports */
+	int dtmf_pt[2];				/*!< Payload code used for RFC2833/CISCO messages */
+	int curDTMF;				/*!< DTMF tone being generated to Asterisk side */
+	int DTMFsched;				/*!< Scheduler descriptor for DTMF */
+	int update_rtp_info;			/*!< Configuration of fd's array is pending */
+	int recvonly;				/*!< Peer isn't wish to receive our voice stream */
+	int txDtmfDigit;			/*!< DTMF digit being to send to H.323 side */
+	int noInbandDtmf;			/*!< Inband DTMF processing by DSP isn't available */
+	int connection_established;		/*!< Call got CONNECT message */
+	int got_progress;			/*!< Call got PROGRESS message, pass inband audio */
+	struct oh323_pvt *next;			/*!< Next channel in list */
 } *iflist = NULL;
 
-static struct ast_user_list {
+/*! \brief H323 User list */
+static struct h323_user_list {
 	ASTOBJ_CONTAINER_COMPONENTS(struct oh323_user);
 } userl;
 
-static struct ast_peer_list {
+/*! \brief H323 peer list */
+static struct h323_peer_list {
 	ASTOBJ_CONTAINER_COMPONENTS(struct oh323_peer);
 } peerl;
 
-static struct ast_alias_list {
+/*! \brief H323 alias list */
+static struct h323_alias_list {
 	ASTOBJ_CONTAINER_COMPONENTS(struct oh323_alias);
 } aliasl;
 
-/** Asterisk RTP stuff */
+/* Asterisk RTP stuff */
 static struct sched_context *sched;
 static struct io_context *io;
 
-/** Protect the interface list (oh323_pvt) */
-AST_MUTEX_DEFINE_STATIC(iflock);
-
-/* Protect the monitoring thread, so only one process can kill or start it, and not
+AST_MUTEX_DEFINE_STATIC(iflock);	/*!< Protect the interface list (oh323_pvt) */
+
+/*! \brief  Protect the H.323 monitoring thread, so only one process can kill or start it, and not
    when it's doing something critical. */
 AST_MUTEX_DEFINE_STATIC(monlock);
 
-/* Protect the H.323 capabilities list, to avoid more than one channel to set the capabilities simultaneaously in the h323 stack. */
+/*! \brief Protect the H.323 capabilities list, to avoid more than one channel to set the capabilities simultaneaously in the h323 stack. */
 AST_MUTEX_DEFINE_STATIC(caplock);
 
-/* Protect the reload process */
+/*! \brief Protect the reload process */
 AST_MUTEX_DEFINE_STATIC(h323_reload_lock);
 static int h323_reloading = 0;
 
-/* This is the thread for the monitor which checks for input on the channels
+/*! \brief This is the thread for the monitor which checks for input on the channels
    which are not currently in use. */
 static pthread_t monitor_thread = AST_PTHREADT_NULL;
 static int restart_monitor(void);
@@ -335,7 +337,7 @@
 	return 0;
 }
 
-/* Channel and private structures should be already locked */
+/*! \brief Channel and private structures should be already locked */
 static void __oh323_update_info(struct ast_channel *c, struct oh323_pvt *pvt)
 {
 	if (c->nativeformats != pvt->nativeformats) {
@@ -401,7 +403,7 @@
 	}
 }
 
-/* Only channel structure should be locked */
+/*! \brief Only channel structure should be locked */
 static void oh323_update_info(struct ast_channel *c)
 {
 	struct oh323_pvt *pvt = c->tech_pvt;
@@ -545,7 +547,7 @@
 	return 0;
 }
 
-/**
+/*! \brief
  * Send (play) the specified digit to the channel.
  *
  */
@@ -583,7 +585,7 @@
 	return 0;
 }
 
-/**
+/*! \brief
  * Make a call over the specified channel to the specified
  * destination.
  * Returns -1 on error, 0 on success.
@@ -753,9 +755,9 @@
 	return 0;
 }
 
+/*! \brief Retrieve audio/etc from channel. Assumes pvt->lock is already held. */
 static struct ast_frame *oh323_rtp_read(struct oh323_pvt *pvt)
 {
-	/* Retrieve audio/etc from channel. Assumes pvt->lock is already held. */
 	struct ast_frame *f;
 
 	/* Only apply it for the first packet, we just need the correct ip/port */
@@ -1000,7 +1002,7 @@
 	return 0;
 }
 
-/* Private structure should be locked on a call */
+/*! \brief Private structure should be locked on a call */
 static struct ast_channel *__oh323_new(struct oh323_pvt *pvt, int state, const char *host)
 {
 	struct ast_channel *ch;
@@ -1805,7 +1807,7 @@
 	return tmpc;
 }
 
-/** Find a call by alias */
+/*! \brief Find a call by alias */
 static struct oh323_alias *find_alias(const char *source_aliases, int realtime)
 {
 	struct oh323_alias *a;
@@ -1818,7 +1820,7 @@
 	return a;
 }
 
-/**
+/*! \brief
   * Callback for sending digits from H.323 up to asterisk
   *
   */
@@ -1889,10 +1891,10 @@
 	return res;
 }
 
-/**
+/*! \brief
   * Callback function used to inform the H.323 stack of the local rtp ip/port details
   *
-  * Returns the local RTP information
+  * \return Returns the local RTP information
   */
 static struct rtp_info *external_rtp_create(unsigned call_reference, const char * token)
 {
@@ -1930,7 +1932,7 @@
 	return info;
 }
 
-/**
+/*! \brief
  * Definition taken from rtp.c for rtpPayloadType because we need it here.
  */
 struct rtpPayloadType {
@@ -1938,7 +1940,7 @@
 	int code;
 };
 
-/**
+/*! \brief
   * Call-back function passing remote ip/port information from H.323 to asterisk
   *
   * Returns nothing
@@ -2048,7 +2050,7 @@
 	return;
 }
 
-/**
+/*! \brief
   *	Call-back function to signal asterisk that the channel has been answered
   * Returns nothing
   */
@@ -2102,7 +2104,7 @@
 	return 0;
 }
 
-/**
+/*! \brief
  *  Call-back function for incoming calls
  *
  *  Returns 1 on success
@@ -2222,7 +2224,7 @@
 	return &pvt->options;
 }
 
-/**
+/*! \brief
  * Call-back function to start PBX when OpenH323 ready to serve incoming call
  *
  * Returns 1 on success
@@ -2301,7 +2303,7 @@
 	return 1;
 }
 
-/**
+/*! \brief
  * Call-back function to establish an outgoing H.323 call
  *
  * Returns 1 on success
@@ -2314,7 +2316,7 @@
 	return 1;
 }
 
-/**
+/*! \brief
   *  Call-back function to signal asterisk that the channel is ringing
   *  Returns nothing
   */
@@ -2340,7 +2342,7 @@
 	return;
 }
 
-/**
+/*! \brief
   * Call-back function to cleanup communication
   * Returns nothing,
   */

Modified: team/file/usecnt-cleanup/channels/chan_iax2.c
URL: http://svn.digium.com/view/asterisk/team/file/usecnt-cleanup/channels/chan_iax2.c?view=diff&rev=57004&r1=57003&r2=57004
==============================================================================
--- team/file/usecnt-cleanup/channels/chan_iax2.c (original)
+++ team/file/usecnt-cleanup/channels/chan_iax2.c Tue Feb 27 13:25:42 2007
@@ -631,7 +631,14 @@
 	int frames_dropped;
 	/*! received frame count: (just for stats) */
 	int frames_received;
+
+	AST_LIST_ENTRY(chan_iax2_pvt) entry;
+	unsigned short hash;
 };
+
+/* Somewhat arbitrary prime number */
+#define PVT_HASH_SIZE 563
+static AST_RWLIST_HEAD(pvt_list, chan_iax2_pvt) pvt_hash_tbl[PVT_HASH_SIZE];
 
 static AST_LIST_HEAD_STATIC(queue, iax_frame);
 
@@ -1162,7 +1169,7 @@
 #define NEW_ALLOW 	1
 #define NEW_FORCE 	2
 
-static int match(struct sockaddr_in *sin, unsigned short callno, unsigned short dcallno, struct chan_iax2_pvt *cur)
+static int match(struct sockaddr_in *sin, unsigned short callno, unsigned short dcallno, const struct chan_iax2_pvt *cur)
 {
 	if ((cur->addr.sin_addr.s_addr == sin->sin_addr.s_addr) &&
 		(cur->addr.sin_port == sin->sin_port)) {
@@ -1258,20 +1265,27 @@
 	return res;
 }
 
-/*!
- * \todo XXX Note that this function contains a very expensive operation that
- * happens for *every* incoming media frame.  It iterates through every
- * possible call number, locking and unlocking each one, to try to match the
- * incoming frame to an active call.  Call numbers can be up to 2^15, 32768.
- * So, for an call with a local call number of 20000, every incoming audio
- * frame would require 20000 mutex lock and unlock operations.  Ouch.
- *
- * It's a shame that IAX2 media frames carry the source call number instead of
- * the destination call number.  If they did, this lookup wouldn't be needed.
- * However, it's too late to change that now.  Instead, we need to come up with
- * a better way of indexing active calls so that these frequent lookups are not
- * so expensive.
- */
+static inline unsigned short peer_hash_val(const struct sockaddr_in *sin, unsigned short callno)
+{
+	return ( (sin->sin_addr.s_addr >> 16) ^ sin->sin_addr.s_addr ^
+	         sin->sin_port ^ callno ) % PVT_HASH_SIZE;
+}
+
+static inline void hash_on_peer(struct chan_iax2_pvt *pvt)
+{
+	if (pvt->hash) {
+		AST_RWLIST_WRLOCK(&pvt_hash_tbl[pvt->hash]);
+		AST_RWLIST_REMOVE(&pvt_hash_tbl[pvt->hash], pvt, entry);
+		AST_RWLIST_UNLOCK(&pvt_hash_tbl[pvt->hash]);	
+	}
+
+	pvt->hash = peer_hash_val(&pvt->addr, pvt->peercallno);
+
+	AST_RWLIST_WRLOCK(&pvt_hash_tbl[pvt->hash]);
+	AST_RWLIST_INSERT_HEAD(&pvt_hash_tbl[pvt->hash], pvt, entry);
+	AST_RWLIST_UNLOCK(&pvt_hash_tbl[pvt->hash]);
+}
+
 static int find_callno(unsigned short callno, unsigned short dcallno, struct sockaddr_in *sin, int new, int lockpeer, int sockfd)
 {
 	int res = 0;
@@ -1279,7 +1293,19 @@
 	struct timeval now;
 	char host[80];
 	if (new <= NEW_ALLOW) {
-		/* Look for an existing connection first */
+		unsigned short hash = peer_hash_val(sin, callno);
+		const struct chan_iax2_pvt *pvt;
+		AST_RWLIST_RDLOCK(&pvt_hash_tbl[hash]);
+		AST_RWLIST_TRAVERSE(&pvt_hash_tbl[hash], pvt, entry) {
+			ast_mutex_lock(&iaxsl[pvt->callno]);
+			if (match(sin, callno, dcallno, pvt))
+				res = pvt->callno;
+			ast_mutex_unlock(&iaxsl[pvt->callno]);
+			if (res > 0)
+				break;
+ 		}
+		AST_RWLIST_UNLOCK(&pvt_hash_tbl[hash]);
+		/* Not hashed yet, Look for an existing connection */
 		for (x=1;(res < 1) && (x<maxnontrunkcall);x++) {
 			ast_mutex_lock(&iaxsl[x]);
 			if (iaxs[x]) {
@@ -1326,6 +1352,7 @@
 			iaxs[x]->addr.sin_family = sin->sin_family;
 			iaxs[x]->addr.sin_addr.s_addr = sin->sin_addr.s_addr;
 			iaxs[x]->peercallno = callno;
+			hash_on_peer(iaxs[x]);
 			iaxs[x]->callno = x;
 			iaxs[x]->pingtime = DEFAULT_RETRY_TIME;
 			iaxs[x]->expiry = min_reg_expire;
@@ -1808,6 +1835,12 @@
 		if (!owner)
 			pvt->owner = NULL;
 		iax2_destroy_helper(pvt);
+
+		if (pvt->hash) {

[... 1670 lines stripped ...]


More information about the asterisk-commits mailing list