Commit Graph

1100 Commits

Author SHA1 Message Date
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
Olle Johansson
ff2943dd59 Issue #9738 - Make sure we can unload res_jabber. Patch by phsultan - thanks!
Due to a bug in the iksemel library, this will not work if you are using GTLS
in the connection. That's being investigated. If you figure out a way to handle
that without us having to patch iksemel, let us know in the bug report. Thanks.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@67993 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-06-07 09:00:44 +00:00
Russell Bryant
e7dd69eea8 Merged revisions 67715 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r67715 | russell | 2007-06-06 11:40:51 -0500 (Wed, 06 Jun 2007) | 5 lines

We have some bug reports showing crashes due to a double free of a channel.
Add a sanity check to ast_channel_free() to make sure we don't go on trying
to free a channel that wasn't found in the channel list.
(issue #8850, and others...)

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@67716 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-06-06 16:55:59 +00:00
Russell Bryant
fe9a3bef4e This bug has been hanging over my head ever since I wrote this SLA code.
Every time I tried to go debug it by adding some debug output, the behavior
would change.  It turns out I wasn't crazy.  I had the following piece of code:

   if (remove)
      AST_LIST_REMOVE_CURRENT(...);

Well, AST_LIST_REMOVE_CURRENT was not wrapped in braces, so my conditional
statement didn't do much good at all.  It always ran at least all of the
macro minus the first statement, so I was seeing list entries magically
disappear when they weren't supposed to.

After many hours of debugging, I have come to this extremely irritating fix. :)

(issues #9581, #9497)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@67492 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-06-05 20:53:28 +00:00
Russell Bryant
d5fd0cff73 When shutting down "gracefully", go through and run the unload() callbacks for
all of the modules.  "stop now" is considered a non-graceful shutdown and will
not go through this process.
(issue #9804, reported by chrisost, patch by me)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@67308 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-06-05 15:51:53 +00:00
Russell Bryant
35e7f6e86e Fix some compiler warnings in C++ modules.
(issue #9866, reported by osk, patch by Corydon76)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@67018 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-06-04 15:28:33 +00:00
Russell Bryant
19a2be29f3 Change a couple of header files to not use "new", which is a reserved keyword
in C++.  (issue #9830, reported by osk)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@66775 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-05-31 18:41:58 +00:00
Russell Bryant
c061b86966 Checking for the strip application needs to be done with AC_PATH_TOOL
instead of AC_PATH_PROG to properly handle cross compilation environments.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@66026 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-05-24 20:42:53 +00:00
Jason Parker
b4ea07a7eb Fix handling of zero-length frames when a codec is capable of native PLC.
Issue 9183, patch by Mihai.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@65877 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-05-24 15:14:02 +00:00
Steve Murphy
dfee354cfa Merged revisions 65172 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r65172 | murf | 2007-05-18 14:56:20 -0600 (Fri, 18 May 2007) | 1 line

This update will fix the situation that occurs as described by 9717, where when several targets are specified for a dial, if any one them reports FAIL, the whole call gets FAIL, even though others were ringing OK. I rearranged the priorities, so that a new disposition, NULL, is at the lowest level, and the disposition get init'd to NULL. Then, next up is FAIL, and next up is BUSY, then NOANSWER, then ANSWERED. All the related set routines will only do so if the disposition value to be set to is greater than what's already there. This gives the intended effect. So, if all the targets are busy, you'd get BUSY for the call disposition. If all get BUSY, but one, and that one rings is not answered, you get NOANSWER. If by some freak of nature, the NULL value doesn't get overridden, then the disp2str routine will report NOANSWER as before.
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@65200 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-05-18 22:06:27 +00:00
Tilghman Lesher
002214d84f Merged revisions 64819 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r64819 | tilghman | 2007-05-17 16:14:36 -0500 (Thu, 17 May 2007) | 2 lines

How is it that we never caught that this is returning the opposite of our documentation, until now?

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@64820 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-05-17 21:19:34 +00:00
Joshua Colp
99cdfb2542 Merged revisions 63285 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r63285 | file | 2007-05-07 17:39:52 -0400 (Mon, 07 May 2007) | 2 lines

Properly handle what happens during a masquerade in relation to group counting. (issue #9657 reported by ramonpeek)

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@63286 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-05-07 21:45:01 +00:00
Russell Bryant
63a37f4755 When serving dynamic content, include a Cache-Control header to instruct the
browsers to not store the resulting content.  
(issue #9621, reported by Pari, patch by me)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@62414 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-04-30 15:25:31 +00:00
Joshua Colp
1d4adc0174 Merged revisions 61804 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r61804 | file | 2007-04-25 14:52:50 -0400 (Wed, 25 Apr 2007) | 2 lines

Merge rewritten group counting support. No more storing data on the variable list of the channels. That was bad, mmmk? (issue #7497 reported by sabbathbh)

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@61805 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-04-25 19:21:54 +00:00
Russell Bryant
456cad8a47 Improve DTMF handling in ast_read() even more in response to a discussion on
the asterisk-dev mailing list.  I changed the enforced minimum length of a
digit from 100ms to 80ms.  Furthermore, I made it now enforce a gap of 45ms in
between digits.  These values are not configurable in a configuration file
right now, but they can be easily changed near the top of main/channel.c.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@61781 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-04-24 19:00:06 +00:00