Commit Graph

1314 Commits

Author SHA1 Message Date
Russell Bryant
6f38c9d211 really picky formatting tweak ...
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@85997 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-10-16 22:36:16 +00:00
Russell Bryant
7cd8afd1ea Some locking errors exposed the fact that the lock debugging code itself was
not thread safe.  How ironic!  Anyway, these changes ensure that the code that
is accessing the lock debugging data is thread-safe.  

Many thanks to Ivan for finding and fixing the core issue here, and also 
thanks to those that tested the patch and provided test results.

(closes issue #10571)
(closes issue #10886)
(closes issue #10875)
(might close some others, as well ...)

Patches: (from issue #10571)
      ivan_ast_1_4_12_rel_patch_lock.h.diff uploaded by Ivan (license 229)
       - a few small changes by me


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@85994 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-10-16 22:14:36 +00:00
Russell Bryant
6b9addb181 Make a few changes so that characters in the upper half of the ISO-8859-1
character set don't get stripped when reading configuration.
(closes issue #10982, dandre)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@85561 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-10-15 16:34:13 +00:00
Russell Bryant
bad30446a6 Fix an issue with console verbosity when running asterisk -rx to execute a command
and retrieve its output.  The issue was that there was no way for the main Asterisk
process to know that the remote console was connecting in the -rx mode.  The way that
James has fixed this is to have all remote consoles muted by default.  Then, regular
remote consoles automatically execute a CLI command to unmute themselves when they
first start up.

(closes issue #10847)
Reported by: atis
Patches: 
      asterisk-consolemute.diff.txt uploaded by jamesgolovich (license 176)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@85533 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-10-13 05:48:10 +00:00
Russell Bryant
6c18b111b9 Properly handle the case where read() may return the text for more than one
CLI command at once for a remote console.

(closes issue #10888)
Reported by: jamesgolovich
Patches: 
      asterisk-climultiple.diff.txt uploaded by jamesgolovich (license 176)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@85532 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-10-13 05:24:33 +00:00
Russell Bryant
863ae211da I introduced a new member to the ast_filestream struct in 1.4.12, but put it
in the middle of the struct, instead of at the end.  One of the Debian folks,
paravoid, pointed out that this breaks binary compatability with modules
compiled against older headers.  So, I'm moving the new member to the end
of the struct to resolve the situation.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@85316 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-10-10 15:56:23 +00:00
Kevin P. Fleming
9cdda4fc78 use a macro instead of an inline function, so that backtraces will report the caller of ast_frame_free() properly
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@85195 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-10-10 06:24:41 +00:00
Tilghman Lesher
96d11d3e02 This commit fixes the following issues:
- Deadlock in ast_write (issue #10406)
- Deadlock in ast_read (issue #10406)
- Possible mutex initialization error in lock.h (issue #10571)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@85158 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-10-09 21:55:06 +00:00
Russell Bryant
5fdc354155 Fulfull a feature request from Qwell on the "core show locks" output. It will
now note the lock type for each lock that a thread holds.
(mutex, rdlock, or wrlock)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@84271 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-10-01 21:07:06 +00:00
Russell Bryant
2cc21a3e83 Show rwlocks in the "core show locks" output. Before, it only showed mutexes.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@84206 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-10-01 19:34:12 +00:00
Russell Bryant
2ef9410363 Fix the AST_MODULE_INFO macro for C++ modules. The load and reload parameters
were in the wrong place.
(closes issue #10846, alebm)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@84146 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-09-30 20:02:16 +00:00
Dwayne M. Hubbard
7c4e477fde if an Agent is redirected, the base channel should actually be redirected. This was causing multiple issues, especially issue 7706 and BE-160
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@84018 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-09-27 23:12:25 +00:00
Russell Bryant
d6b8fb4dc0 gcc 4.2 has a new set of warnings dealing with cosnt pointers. This set of
changes gets all of Asterisk (minus chan_alsa for now) to compile with gcc 4.2.
(closes issue #10774, patch from qwell)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@83432 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-09-21 14:37:20 +00:00
Russell Bryant
0f23b76a39 Add a new patch to handle interrupting the fgets() call when using FastAGI.
This version of the patch maintains the original behavior of the code when
not using FastAGI.
(closes issue #10553)
Reported by: juggie
Patches:
      res_agi_fgets-4.patch uploaded by juggie (license 24)
      res_agi_fgets_1.4svn.patch uploaded by juggie (license 24)
	  Slight mods by me
Tested by: juggie, festr


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@82929 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-09-18 22:42:27 +00:00
Russell Bryant
5213f548f5 Add checking for libusb here, so nobody has to deal with conflicts in the
chan_usbradio-1.4 branch every time the configure script gets changed


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@82385 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-09-14 15:50:49 +00:00
Russell Bryant
c8dd4e7430 Only compile in tracking astobj2 statistics if dev-mode is enabled. Also, when
dev mode is enabled, register the CLI command that can be used to run the astobj2
test and print out statistics.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@82337 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-09-13 18:45:59 +00:00
Tilghman Lesher
e28d1357de Working on issue #10531 exposed a rather nasty 64-bit issue on ast_mktime, so we
updated the localtime.c file from source.  Next we'll have to write ast_strptime
to match.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@82285 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-09-12 20:12:06 +00:00
Tilghman Lesher
2fc5a853d4 Fix inline compiles on really old compilers (who uses gcc 2.7 anymore, really?)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@82028 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-09-09 02:35:18 +00:00
Jason Parker
82c701b0eb This should fix a build issue that people building against uClibc were seeing with the addition of astobj2
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@81778 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-09-06 19:59:07 +00:00
Philippe Sultan
8e10babcbd Various string length fixes. Removed an unused variable in aji_client structure (context)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@81743 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-09-06 16:56:29 +00:00
Russell Bryant
aa3b7e22f5 Fix an issue that can occur when you do an attended transfer to parking. If
you complete the transfer before the announcement of the parking spot finishes,
then the channel being parked will hear the remainder of the announcement.
These changes make it so that will not happen anymore.

Basically, res_features sets a flag on the channel is playing the announcement
to so that the file streaming core knows that it needs to watch out for a
channel masquerade, and if it occurs, to abort the announcement.

(closes BE-182)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@81599 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-09-05 20:53:41 +00:00
Tilghman Lesher
f0cf18cc75 Solaris x86 compatibility fix
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@81569 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-09-05 17:18:24 +00:00
Russell Bryant
c95389856a Remove the typedefs on ao2_container and ao2_iterator. This is simply because
we don't typedef objects anywhere else in Asterisk, so we might as well make
this follow the same convention.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@81448 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-09-04 18:37:44 +00:00
Mark Michelson
e0b90d3b06 Making match_by_addr into ao2_match_by_addr and making it available
everywhere since it could be a handy callback to have



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@81426 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-09-01 06:02:06 +00:00
Russell Bryant
abc5bbdc36 Remove references to a debugging parameter that does not exist
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@81418 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-08-31 21:27:49 +00:00
Russell Bryant
ed6d4ec72c When executing a dynamic feature, don't look it up a second time by digit pattern
after we already looked it up by name.  This causes broken behavior if there is
more than one feature defined with the same digit pattern.
(closes issue #10539, reported by bungalow, patch by me)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@80573 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-08-23 20:16:41 +00:00
Russell Bryant
b2c65cf51d This is a hack to maintain old behavior of chan_iax2. This ensures that if
the peers and users are being stored in a linked list, that they go in the
list in the same order that the older code used.  This is necessary to maintain
the behavior of which peers and users get matched when traversing the container.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@80497 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-08-23 16:53:52 +00:00
Russell Bryant
e8c2f715b5 Add some more documentation on iterating ao2 containers. The documentation
implies that is possible to miss an object or see an object twice while
iterating.  After looking through the code and talking with mmichelson, I have
documented the exact conditions under which this can happen (which are rare and
harmless in most cases).


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@80426 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-08-22 22:54:03 +00:00
Russell Bryant
566371bd50 Merge changes from team/russell/iax_refcount.
This set of changes fixes problems with the handling of iax2_user and iax2_peer
objects.  It was very possible for a thread to still hold a reference to one of
these objects while a reload operation tries to delete them.  The fix here is to
ensure that all references to these objects are tracked so that they can't go away
while still in use.

To accomplish this, I used the astobj2 reference counted object model.  This
code has been in one of Luigi Rizzo's branches for a long time and was primarily
developed by one of his students, Marta Carbone.  I wanted to go ahead and bring
this in to 1.4 because there are other problems similar to the ones fixed by these
changes, so we might as well go ahead and use the new astobj if we're going to go
through all of the work necessary to fix the problems.

As a nice side benefit of these changes, peer and user handling got more efficient.
Using astobj2 lets us not hold the container lock for peers or users nearly as long
while iterating.  Also, by changing a define at the top of chan_iax2.c, the objects
will be distributed in a hash table, drastically increasing lookup speed in these
containers, which will have a very big impact on systems that have a large number of
users or peers.

The use of the hash table will be made the default in trunk.  It is not the default
in 1.4 because it changes the behavior slightly.  Previously, since peers and users
were stored in memory in the same order they were specified in the configuration file,
you could influence peer and user matching order based on the order they are specified
in the configuration.  The hash table does not guarantee any order in the container,
so this behavior will be going away.  It just means that you have to be a little
more careful ensuring that peers and users are matched explicitly and not forcing
chan_iax2 to have to guess which user is the right one based on secret, host, and
access list settings, instead of simply using the username.

If you have any questions, feel free to ask on the asterisk-dev list.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@80362 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-08-22 20:21:36 +00:00
Steve Murphy
b84f9590a0 ugh. removing the diffs from ulaw.h and alaw.h for now; accidentally added them in 80166
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@80167 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-08-21 16:39:09 +00:00
Steve Murphy
4b5a9ae533 This patch solves problem 1 in 8126; it should not slow down the alaw codec, but should prevent signal degradation via multiple trips thru the codec. Fossil estimates the twice thru this codec will prevent fax from working. 4-6 times thru would result hearable, noticeable, voice degradation.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@80166 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-08-21 16:36:34 +00:00
Jason Parker
f1cb3f70b7 Don't send a semicolon over the wire in sip notify messages.
Caused by fix for issue 9938.

I basically took the code that existed before 9938 was fixed, and
 copied it into a new function - ast_unescape_semicolon

There should be very few places this will be needed (pbx_config
 does NOT need this (see issue 9938 for details))

Issue 10430, patch by me, with help/ideas from murf (thanks murf).


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@79904 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-08-17 19:12:19 +00:00
Joshua Colp
924c88d3d0 Instead of accepting a single DTMF character accept a full string.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@79334 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-08-13 21:57:20 +00:00
Joshua Colp
4f8857d608 Add an API call to allow the engine to know that DTMF was received.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@79207 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-08-13 14:51:09 +00:00
Steve Murphy
241769b53c From a user complaint on #asterisk, I have forced pbx_spool to explain what reason codes mean, when they are logged
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@79099 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-08-10 20:53:43 +00:00
Russell Bryant
d21e1596f8 The last set of changes that I made to "core show locks" made it not able to
track mutexes unless they were declared using AST_MUTEX_DEFINE_STATIC.  Locks
initialized with ast_mutex_init() were not tracked.  It should work now.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@78995 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-08-10 15:20:09 +00:00
Russell Bryant
ad13307328 Fix the return value of AST_LIST_REMOVE(). This shouldn't be causing any
problems, though, because the only code that uses the return value only checks
to see if it is NULL.
(closes issue #10390, pointed out by mihai)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@78184 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-08-06 16:50:54 +00:00
Russell Bryant
38a51a53db Fix compilation failure when MALLOC_DEBUG is enabled, but DEBUG_THREADS is not
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@78143 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-08-05 04:15:31 +00:00
Mark Michelson
05ba4d90d4 Changed the behavior of sip's realtime_peer function to match the corresponding way of matching for non-realtime peers.
Now matches are made on both the IP address and port number, or if the insecure setting is set to "port" then just match on the
IP address.

In order to accomplish this, I also added a new API call, ast_category_root, which returns the first variable of an ast_category struct



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@78103 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-08-03 20:25:22 +00:00
Russell Bryant
2f41cceb1f Add some improvements to lock debugging. These changes take effect
with DEBUG_THREADS enabled and provide the following:

 * This will keep track of which locks are held by which thread as well as
   which lock a thread is waiting for in a thread-local data structure.  A
   reference to this structure is available on the stack in the dummy_start()
   function, which is the common entry point for all threads.  This information
   can be easily retrieved using gdb if you switch to the dummy_start() stack
   frame of any thread and print the contents of the lock_info variable.

 * All of the thread-local structures for keeping track of this lock information
   are also stored in a list so that the information can be dumped to the CLI
   using the "core show locks" CLI command.  This introduces a little bit of a
   performance hit as it requires additional underlying locking operations
   inside of every lock/unlock on an ast_mutex.  However, the benefits of
   having this information available at the CLI is huge, especially considering
   this is only done in DEBUG_THREADS mode.  It means that in most cases where
   we debug deadlocks, we no longer have to request access to the machine to
   analyze the contents of ast_mutex_t structures.  We can now just ask them
   to get the output of "core show locks", which gives us all of the information
   we needed in most cases.

I also had to make some additional changes to astmm.c to make this work when
both MALLOC_DEBUG and DEBUG_THREADS are enabled.  I disabled tracking of one
of the locks in astmm.c because it gets used inside the replacement memory
allocation routines, and the lock tracking code allocates memory.  This caused
infinite recursion.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@78095 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-08-03 19:39:49 +00:00
Joshua Colp
68c221f69a Add some fixes for building on Solaris.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@77869 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-08-01 17:56:59 +00:00
Joshua Colp
bc7150c380 Extend autoconf logic to determine which version of gethostbyname_r is on the system.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@77863 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-08-01 17:22:35 +00:00
Joshua Colp
35ceaca691 Add a flag to the speech API that allows an engine to set whether it received results or not.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@77831 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-07-31 16:17:09 +00:00
Tilghman Lesher
e5c3ef3388 Merged revisions 76934 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r76934 | tilghman | 2007-07-24 17:11:33 -0500 (Tue, 24 Jul 2007) | 2 lines

Oops, res contains the error code, not errno.  I was wondering why a mutex was reporting "No such file or directory"...

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@76937 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-07-24 22:12:43 +00:00
Joshua Colp
5f37fa26d2 Instead of figuring out kernel versions that have compiler.h and not... let's just use autoconf to check for it's presence. (issue #10174 reported by francesco_r)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@74572 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-07-11 17:03:08 +00:00
Jason Parker
d4a7eb584f Merged revisions 74373 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r74373 | qwell | 2007-07-10 13:37:23 -0500 (Tue, 10 Jul 2007) | 5 lines

Use res_ndestroy on systems that have it.  Otherwise, use res_nclose.
This prevents a memleak on NetBSD - and possibly others.

Issue 10133, patch by me, reported and tested by scw

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@74374 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-07-10 18:39:30 +00:00
Russell Bryant
ef2ae2f856 regenerate the configure script for rizzo
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@72493 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-06-28 19:44:11 +00:00
Russell Bryant
cbdc6b5b2d To prevent 92138749238754 more reports of "I have unixodbc installed, but
still can't build *_odbc.so!", check for ltdl directly, instead of just listing
it as another library to include in the unixodbc check in the configure script.
This also makes ltdl show up as a dependency in menuselect so people know what
to go install.  (related to issue #9989, patch by me)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@69702 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-06-18 16:35:02 +00:00
Kevin P. Fleming
ae82d97c6d use ast_localtime() in every place localtime_r() was being used
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@69392 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-06-14 21:50:40 +00:00
Jason Parker
0f45225441 Solaris 10 sometimes (?) needs this include in order to have NULL defined.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@68814 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-06-11 21:20:15 +00:00