Commit Graph

925 Commits

Author SHA1 Message Date
Steve Murphy 86476c607f closes issue #11285, where an unload of a module that creates a dialplan context, causes a crash when you do a 'dialplan show' of that context. This is because the registrar string is defined in the module, and the stale pointer is traversed. The reporter offered a patch that would always strdup the registrar string, which is practical, but I preferred to destroy the created contexts in each module where one is created. That seemed more symmetric. There were only 6 place in asterisk where this is done: chan_sip, chan_iax2, chan_skinny, res_features, app_dial, and app_queue. The two apps destroyed the context, but left the contexts. All is fixed now and unloads should be dialplan friendly.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@89513 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-21 23:54:12 +00:00
Luigi Rizzo 7e8835e0d7 remove another set of redundant #include "asterisk/options.h"
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@89512 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-21 23:24:55 +00:00
Russell Bryant 192252ec58 fix a small gramatical error in a comment
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@89488 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-21 18:24:23 +00:00
Luigi Rizzo a23c055c3d move asterisk/paths.h outside asterisk.h and into those files
who really need it.



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@89466 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-20 23:16:15 +00:00
Luigi Rizzo 0595b5e2aa include "logger.h" and errno.h from asterisk.h - usage shows that they
were included almost everywhere.
Remove some of the instances.



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@89424 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-19 18:52:04 +00:00
Luigi Rizzo fdb7f7ba3d Start untangling header inclusion in a way that does not affect
build times - tested, there is no measureable difference before and
after this commit.

In this change:

use asterisk/compat.h to include a small set of system headers:
inttypes.h, unistd.h, stddef.h, stddint.h, sys/types.h, stdarg.h,
stdlib.h, alloca.h, stdio.h

Where available, the inclusion is conditional on HAVE_FOO_H as determined
by autoconf.

Normally, source files should not include any of the above system headers,
and instead use either "asterisk.h" or "asterisk/compat.h" which does it
better. 

For the time being I have left alone second-level directories
(main/db1-ast, etc.).



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@89333 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-16 20:04:58 +00:00
Tilghman Lesher fc74a46ee2 Merged revisions 89298 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r89298 | tilghman | 2007-11-15 12:05:56 -0600 (Thu, 15 Nov 2007) | 5 lines

Yet another memory corruption issue.
Reported by: atis
Patch by: tilghman
Fixes issue #10923

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@89299 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-15 18:11:36 +00:00
Luigi Rizzo 7f8ecd2cd3 make the 'name' and 'value' fields in ast_variable const char *
This prevents modifying the strings in the stored variables, 
and catched a few instances where this was actually done.

Given the differences between trunk and 1.4 (and the fact that this
is effectively an API change) it is better to fix 1.4 independently.
These are

chan_sip.c::sip_register()
chan_skinny.c:: near line 2847
config.c:: near line 1774
logger.c::make_components()
res_adsi.c:: near line 1049

I may have missed some instances for modules that do not build here.



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@89268 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-14 13:18:40 +00:00
Kevin P. Fleming edc78d6023 improve linked-list macros in two ways:
- the *_CURRENT macros no longer need the list head pointer argument
  - add AST_LIST_MOVE_CURRENT to encapsulate the remove/add operation when moving entries between lists


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@89106 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-08 05:28:47 +00:00
Luigi Rizzo 08b10da53b Simplify the implementation and the API for stringfields;
details and examples are in include/asterisk/stringfields.h.

Not applicable to older branches except for 1.4 which will
receive a fix for the routines that free memory pools.



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@88454 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-04 19:44:31 +00:00
Tilghman Lesher 97fe45ab93 Janitor: use ast_free to pair calls of ast_malloc and ast_calloc
Reported by: eliel
Patch by: eliel
Closes issue #11135


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@88008 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-11-01 06:07:18 +00:00
Russell Bryant 3978cb6f1c Merged revisions 87686 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r87686 | russell | 2007-10-30 16:19:09 -0500 (Tue, 30 Oct 2007) | 11 lines

Merge the changes from team/russell/iax2_poke_fix and iax2-poke-fix-trunk

There was a race condition related to the handling of POKEing peers.  Essentially, 
a reference to a peer is held by the scheduler when there are pending callbacks, 
but the reference count didn't reflect it.  So, it was possible for a peer to hit
a reference count of zero and have its destructor begin to be called at the same
time that the scheduler thread ran a POKE related callback.  If that happened,
a crash would likely occur.

(closes issue #11082, closes issue #11094)

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@87687 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-10-30 21:22:48 +00:00
Jason Parker ebe4050128 Switch from AST_CLI (formerly NEW_CLI) to AST_CLI_DEFINE, since the former didn't make much sense
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@86820 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-10-22 20:05:18 +00:00
Jason Parker b0f3e6097e Convert NEW_CLI to AST_CLI.
Closes issue #11039, as suggested by seanbright.


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@86536 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-10-19 18:29:40 +00:00
Jason Parker 65761cbd7a More changes to NEW_CLI.
Also fixes a few cli messages and some minor formatting.

(closes issue #11001)
Reported by: seanbright
Patches:
      newcli.1.patch uploaded by seanbright (license 71)
      newcli.2.patch uploaded by seanbright (license 71)
      newcli.4.patch uploaded by seanbright (license 71)
      newcli.5.patch uploaded by seanbright (license 71)
      newcli.6.patch uploaded by seanbright (license 71)
      newcli.7.patch uploaded by seanbright (license 71)


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@86534 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-10-19 18:01:00 +00:00
Jason Parker ed690fc348 Switch dundi to new tos config format.
Remove old unused defines for old style.

Closes issue 10860, patch by IgorG.


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@85764 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-10-15 23:20:40 +00:00
Russell Bryant d78463be1e Corydon posted this janitor project to the bug tracker and mvanbaak provided
a patch for it.  It replaces a bunch of simple calls to snprintf with ast_copy_string

(closes issue #10843)
Reported by: Corydon76
Patches: 
      2007092900_10843.diff uploaded by mvanbaak (license 7)


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@84173 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-10-01 15:23:19 +00:00
Russell Bryant 9f64905d4e Merged revisions 83432 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r83432 | russell | 2007-09-21 09:37:20 -0500 (Fri, 21 Sep 2007) | 4 lines

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/trunk@83433 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-09-21 14:40:10 +00:00
Russell Bryant 86e640bf77 Merged revisions 83175 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r83175 | russell | 2007-09-19 14:13:29 -0500 (Wed, 19 Sep 2007) | 8 lines

When handling a reload of chan_iax2, don't use an ao2_callback() to POKE all
peers.  Instead, use an iterator.  By using an iterator, the peers container
is not locked while the POKE is being done.  It can cause a deadlock if the
peers container is locked because poking a peer will try to lock pvt structs,
while there is a lot of other code that will hold a pvt lock when trying to
go lock the peers container.
(reported to me directly by Loic Didelot.  Thank you for the debug info!)

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@83176 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-09-19 19:14:58 +00:00
Russell Bryant ded76a8988 convert various places that access the channel lock directly to use the channel lock wrappers
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@82728 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-09-17 22:59:36 +00:00
Russell Bryant 9388173f85 Make the MALLOC_DEBUG output for free() useful again. After changing calls to
free to be ast_free, astmm said all calls to free were coming from utils.h


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@82628 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-09-17 18:57:56 +00:00
Jason Parker 6a90ea5cf4 After some discussions, we decided that the return values here were a bit messy.
This also fixes a bug on reload, where peers may not have reregistered properly.


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@82294 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-09-12 21:55:32 +00:00
Tilghman Lesher c121ed6bec Change the IAXPeers command to have manager-style output, instead of CLI-style output (closes issue #8254)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@82200 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-09-10 20:03:51 +00:00
Russell Bryant 9bda1c5a94 Merged revisions 81448 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r81448 | russell | 2007-09-04 13:37:44 -0500 (Tue, 04 Sep 2007) | 4 lines

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/trunk@81449 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-09-04 18:40:07 +00:00
Joshua Colp 3213f6dc2d Merged revisions 81439 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r81439 | file | 2007-09-04 11:23:18 -0300 (Tue, 04 Sep 2007) | 6 lines

(closes issue #10632)
Reported by: jamesgolovich
Patches:
      asterisk-iaxfirmwareleak.diff.txt uploaded by jamesgolovich (license 176)
Fix memory leak when unloading chan_iax2. The firmware files were not being freed.

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@81440 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-09-04 14:25:21 +00:00
Russell Bryant 51af103a79 Merged revisions 81433 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r81433 | russell | 2007-09-03 13:57:53 -0500 (Mon, 03 Sep 2007) | 5 lines

Remove a couple of calls to ast_string_field_free_pools() on peers in error
handling blocks in the code for building peers.  The peer object destructor
does this and doing it twice will cause a crash.
(closes issue #10625, reported by and patched by pnlarsson)

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@81434 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-09-03 18:59:08 +00:00
Steve Murphy b5cd67adc3 This code was in team/murf/bug8684-trunk; it should fix bug 8684 in trunk. I didn't add it to 1.4 yet, because it's not entirely clear to me if this is a bug fix or an enhancement. A lot of files were affected by small changes like ast_variable_new getting an added arg, for the file name the var was defined in; ast_category_new gets added args of filename and lineno; ast_category and ast_variable structures now record file and lineno for each entry; a list of all #include and #execs in a config file (or any of its inclusions are now kept in the ast_config struct; at save time, each entry is put back into its proper file of origin, in order. #include and #exec directives are folded in properly. Headers indicating that the file was generated, are generated also for each included file. Some changes to main/manager.c to take care of file renaming, via the UpdateConfig command. Multiple inclusions of the same file are handled by exploding these into multiple include files, uniquely named. There's probably more, but I can't remember it right now.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@81361 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-08-29 20:55:40 +00:00
Tilghman Lesher 6bdc66e9b0 Changed one too many variable settings in issue #9315 (closes issue #10592)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@81335 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-08-29 15:21:10 +00:00
Russell Bryant 225d9166ec Merged revisions 81291 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r81291 | russell | 2007-08-28 16:38:26 -0500 (Tue, 28 Aug 2007) | 3 lines

Change the message about receiving a mini-frame before the first full voice
frame to a DEBUG message.

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@81292 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-08-28 21:39:36 +00:00
Russell Bryant d3687bdb93 Merged revisions 80932 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r80932 | russell | 2007-08-26 13:11:26 -0500 (Sun, 26 Aug 2007) | 3 lines

Remove an extra signal_condition() for the scheduler thread.
(closes issue #10564, patch from casper)

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@80933 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-08-26 18:12:58 +00:00
Russell Bryant 7c41c3a5bc Merged revisions 80895 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r80895 | russell | 2007-08-25 12:37:39 -0500 (Sat, 25 Aug 2007) | 7 lines

Fix some issues with the handling of the scheduler in chan_iax2.  Most of the
places that scheduled items to be executed by the scheduler thread did not
signal the scheduler thread to wake up so that it could recalculate the time
until the next action.  These changes will make the scheduler thread more
responsive and ensure that actions get executed as close to when intended as
possible instead of it being possible for very long delays.

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@80898 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-08-25 17:55:45 +00:00
Russell Bryant 700b5d8442 Merged revisions 80849 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r80849 | russell | 2007-08-24 16:22:50 -0500 (Fri, 24 Aug 2007) | 5 lines

If dnsmgr is in use, and no DNS servers are available when Asterisk first
starts, then don't give up on poking peers.  Allow the poke to get rescheduled
so that it will work once the dnsmgr is able to resolve the host.
(closes issue #10521, patch by jamesgolovich)

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@80850 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-08-24 21:23:14 +00:00
Russell Bryant 488cd9a7a6 Merged revisions 80499 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r80499 | russell | 2007-08-23 12:02:50 -0500 (Thu, 23 Aug 2007) | 3 lines

Fix some code where it was possible for a reference to a peer to not get
released when it should.  Thank you to Marta Carbone for pointing this out!

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@80500 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-08-23 17:04:04 +00:00
Russell Bryant f6f9c14723 allow peers and users to go into a hash table
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@80408 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-08-22 21:35:08 +00:00
Russell Bryant f04ed4641b Unsubscribe from MWI events in the peer destructor
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@80388 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-08-22 20:46:16 +00:00
Russell Bryant 50d7fc81aa Merged revisions 80362 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r80362 | russell | 2007-08-22 15:21:36 -0500 (Wed, 22 Aug 2007) | 34 lines

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/trunk@80387 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-08-22 20:44:23 +00:00
Joshua Colp 477e7dcbc7 (closes issue #10495)
Reported by: stevedavies
Make sure context pointer is valid or else chan_iax2 will go kaboom.


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@79990 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-08-20 00:54:19 +00:00
Tilghman Lesher 749b67bd1d We weren't properly encapsulating the mtime ignores of config files (closes issue #10488)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@79940 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-08-18 13:52:44 +00:00
Russell Bryant c67f7fd3da Make use of ast_sched_replace() in some places in chan_iax2
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@79862 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-08-17 14:14:59 +00:00
Russell Bryant 0b44b92cf5 Merged revisions 79756 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r79756 | russell | 2007-08-16 16:29:24 -0500 (Thu, 16 Aug 2007) | 11 lines

Fix more deadlocks in chan_iax2 that were introduced by making frame handling
and scheduling multi-threaded.  Unfortunately, we have to do some expensive
deadlock avoidance when queueing frames on to the ast_channel owner of the IAX2
pvt struct.  This was already handled for regular frames, but ast_queue_hangup
and ast_queue_control were still used directly.  Making these changes introduced
even more places where the IAX2 pvt struct can disappear in the context of a
function holding its lock due to calling a function that has to unlock/lock it
to avoid deadlocks.  I went through and fixed all of these places to account for
this possibility.
(issue #10362, patch by me)

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@79764 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-08-16 21:33:38 +00:00
Tilghman Lesher 56b9568164 Don't reload a configuration file if nothing has changed.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@79747 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-08-16 21:09:46 +00:00
Dwayne M. Hubbard 6186647ac3 added counter for iax2 show registry CLI output, closes issue 10461, thanks junky
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@79725 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-08-16 18:23:39 +00:00
Russell Bryant 4b584bbdf7 Merged revisions 79470 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r79470 | russell | 2007-08-14 13:49:10 -0500 (Tue, 14 Aug 2007) | 2 lines

Fix another spot where an iax2_peer would be leaked if realtime was in use.

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@79471 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-08-14 18:50:12 +00:00
Russell Bryant 4e038cdc7c Merged revisions 79436 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r79436 | russell | 2007-08-14 12:31:39 -0500 (Tue, 14 Aug 2007) | 3 lines

Fix some memory leaks throughout chan_iax2 related to the use of realtime.
I found these while working on iax2_peer object reference tracking.

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@79437 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-08-14 17:33:12 +00:00
Russell Bryant e05da8e948 Merged revisions 79301 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r79301 | russell | 2007-08-13 15:37:50 -0500 (Mon, 13 Aug 2007) | 3 lines

Don't call find_peer in registry_authrequest with the pvt lock held to avoid a
deadlock.

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@79306 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-08-13 20:40:47 +00:00
Russell Bryant 16373a4e5f Merged revisions 79276 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r79276 | russell | 2007-08-13 15:18:30 -0500 (Mon, 13 Aug 2007) | 4 lines

Release the pvt lock before calling find_peer in register_verify to avoid a
deadlock.  Also, remove some unnecessary locking in auth_fail that was only done
recursively.

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@79277 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-08-13 20:20:43 +00:00
Russell Bryant 982a3ac424 Merged revisions 79274 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r79274 | russell | 2007-08-13 15:02:57 -0500 (Mon, 13 Aug 2007) | 3 lines

Don't call find_peer within update_registry with a pvt lock held.  This can
cause a deadlock as the code will eventually call find_callno.

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@79275 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-08-13 20:06:19 +00:00
Russell Bryant 0dd52f7196 Merged revisions 79272 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r79272 | russell | 2007-08-13 14:27:39 -0500 (Mon, 13 Aug 2007) | 9 lines

I am fighting deadlocks in chan_iax2.  I have tracked them down to a single
core issue.  You can not call find_callno() while holding a pvt lock as this
function has to lock another (every) other pvt lock.  Doing so can lead to a
classic deadlock.  So, I am tracking down all of the code paths where this
can happen and fixing them.

The fix I committed earlier today was along the same theme.  This patch fixes
some code down the path of authenticate_reply.

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@79273 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-08-13 19:29:30 +00:00
Russell Bryant a2847deb73 Merged revisions 79214 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r79214 | russell | 2007-08-13 10:28:13 -0500 (Mon, 13 Aug 2007) | 4 lines

Fix a potential deadlock in socket_process.  check_provisioning can eventually
call find_callno.  You can't hold a pvt lock while calling find_callno because
it goes through and locks every single one looking for a match.

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@79222 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-08-13 15:32:05 +00:00
Joshua Colp d5eda8709c Merged revisions 79174 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r79174 | file | 2007-08-13 11:18:04 -0300 (Mon, 13 Aug 2007) | 4 lines

(closes issue #10437)
Reported by: haklin
Don't set the callerid name and number a second time on a newly created channel. ast_channel_alloc itself already sets it and setting it twice would cause a memory leak.

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@79175 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-08-13 14:22:46 +00:00
Russell Bryant 9d1acad76b Fix a problem that I had introduced into MWI handling. I had ignored
the mailbox context.  Now, all related MWI event dealings pay attention
to the context as well.


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@78747 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-08-09 17:07:36 +00:00
Joshua Colp f2fc44d07e Correct spelling. s/threaads/threads/
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@78637 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-08-08 19:03:46 +00:00
Russell Bryant d9407da71d Merged revisions 78242 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r78242 | russell | 2007-08-06 15:44:09 -0500 (Mon, 06 Aug 2007) | 4 lines

Fix an issue where dynamic threads can get free'd, but still exist in the 
dynamic thread list.
(closes issue #10392, patch from Mihai, with credit to his colleague, Pete)

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@78243 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-08-06 20:45:09 +00:00
Russell Bryant 661fa0b374 Merged revisions 78063 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r78063 | russell | 2007-08-03 12:01:07 -0500 (Fri, 03 Aug 2007) | 4 lines

Only pass through HOLD and UNHOLD control frames when the mohinterpret option
is set to "passthrough".  This was pointed out by Kevin in the middle of a
training session.

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@78064 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-08-03 17:02:00 +00:00
Russell Bryant bcabfbb89a Merged revisions 78028 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r78028 | russell | 2007-08-02 21:04:22 -0500 (Thu, 02 Aug 2007) | 6 lines

Don't reuse the timespec that was set to 0 in the previous timedwait as it
will just return immediately.  Also, fix some logic so the thread's lock
isn't unlocked twice in the weird case of dynamic threads getting acquired
right after a timeout.
(pointed out by SteveK)

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@78029 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-08-03 02:05:02 +00:00
Russell Bryant 7b3dcbb842 Merged revisions 77949 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r77949 | russell | 2007-08-02 14:25:14 -0500 (Thu, 02 Aug 2007) | 5 lines

Fix the case where a dynamic thread times out waiting for something to do
during the first time it runs.  This shouldn't ever happen, but we should
account for it anyway.
(pointed out by pete, who works with mihai)

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@77950 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-08-02 19:26:12 +00:00
Russell Bryant 85ba8d515a Merged revisions 77943 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r77943 | russell | 2007-08-02 13:04:43 -0500 (Thu, 02 Aug 2007) | 9 lines

Fix another race condition in the handling of dynamic threads.  If the dynamic
thread timed out waiting for something to do, but was acquired to perform an
action immediately afterwords, then wait on the condition again to give the
other thread a chance to finish setting up the data for what action this thread
should perform.  Otherwise, if it immediately continues, it will perform the
wrong action.
(reported on IRC by mihai, patch by me)
(related to issue #10289)

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@77944 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-08-02 18:05:23 +00:00
Russell Bryant 12ed8e8d07 Fix an issue that Simon pointed out to me on IRC. There were cases in the
trunk version of find_idle_thread() where the old full frame processing
information was not cleared out.  This would have caused full frames to get
deferred for processing by threads that weren't actually processing frames for
that call.  Nice catch!!


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@77941 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-08-02 17:09:42 +00:00
Russell Bryant 171791dd8b Merged revisions 77939 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r77939 | russell | 2007-08-02 11:56:04 -0500 (Thu, 02 Aug 2007) | 4 lines

Add another sanity check to vnak_retransmit().  This check ensures that frames
that have already been marked for deletion don't get retransmitted.
(closes issue #10361, patch from mihai)

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@77940 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-08-02 16:58:26 +00:00
Russell Bryant 1990a00ca4 Merged revisions 77887 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r77887 | russell | 2007-08-01 17:16:17 -0500 (Wed, 01 Aug 2007) | 23 lines

Fix some race conditions which have been causing weird problems in chan_iax2.
The most notable problem is that people have been seeing storms of VNAK frames
being sent due to really old frames mysteriously being in the retransmission
queue and never getting removed.

It was possible that a dynamic thread got created, but did not acquire its lock
before the thread that created it signals it to perform an action.  When this
happens, the thread will sleep until it hits a timeout, and then get destroyed.
So, the action never gets performed and in some cases, means a frame doesn't
get transmitted and never gets freed since the scheduler never gets a chance
to reschedule transmission.

Another less severe race condition is in the handling of a timeout for a dynamic
thread.  It was possible for it to be acquired to perform at action at the same
time that it hit a timeout.  When this occurs, whatever action it was acquired
for would never get performed.

(patch contributed by Mihai and SteveK)
(closes issue #10289)
(closes issue #10248)
(closes issue #10232)
(possibly related to issue #10359)

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@77889 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-08-01 22:24:23 +00:00
Joshua Colp d9aee5e353 Merged revisions 77869 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r77869 | file | 2007-08-01 14:56:59 -0300 (Wed, 01 Aug 2007) | 2 lines

Add some fixes for building on Solaris.

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@77870 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-08-01 18:01:33 +00:00
Russell Bryant 3ca4126887 Change another unnecessary use of the increment operator to explicitly set the var to 1
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@77800 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-07-30 20:36:18 +00:00
Russell Bryant 3b49339387 Explicitly set a variable to 1 instead of using the increment operator.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@77799 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-07-30 20:33:44 +00:00
Russell Bryant a27203a5bc Merged revisions 77794 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r77794 | russell | 2007-07-30 15:16:43 -0500 (Mon, 30 Jul 2007) | 8 lines

Fix an issue that could potentially cause corruption of the global iax frame
queue.  In the network_thread() loop, it traverses the list using the
AST_LIST_TRAVERSE_SAFE macro.  However, to remove an element of the list within
this loop, it used AST_LIST_REMOVE, instead of AST_LIST_REMOVE_CURRENT, which I
believe could leave some of the internal variables of the SAFE macro invalid.
Mihai says that he already made this change in his local copy and it didn't help
his VNAK storm issues, but I still think it's wrong.  :)

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@77797 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-07-30 20:21:05 +00:00
Russell Bryant f8483a0d04 Do a massive conversion for using the ast_verb() macro
(closes issue #10277, patches by mvanbaak)

Basically, this changes ...

if (option_verbose > 2)
   ast_verbose(VERBOSE_PREFIX_3, "Something\n");

to ...

ast_verb(3, "Something\n");


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@77299 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-07-26 15:49:18 +00:00
Luigi Rizzo 546c742106 silence a warning in ast-devmode on a potentially uninitialized var.
At first sight (but the function is very large so i am not 100% sure)
the code seems correct, so maybe my compiler is just not smart
enough to figure that out at the optimization level it has.

Not worthwhile merging to 1.4 i believe.



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@77156 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-07-25 21:58:13 +00:00
Tilghman Lesher 1c17bc177d Merged revisions 76803 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r76803 | qwell | 2007-07-24 11:32:20 -0500 (Tue, 24 Jul 2007) | 3 lines

Don't create the Asterisk channel until we are starting the PBX on it.
(ASA-2007-018)

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@76807 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-07-24 17:05:10 +00:00
Russell Bryant 3c10aab644 Merged revisions 76485 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r76485 | russell | 2007-07-23 07:25:01 -0500 (Mon, 23 Jul 2007) | 6 lines

Use a signed integer for storing the number of bytes in the packet read from
the network.  Using an unsigned value here made it impossible to handle an
error returned from recvfrom().  Furthermore, in the case that recvfrom()
did return an error, this would cause a crash due to a heap overflow.
(closes issue #10265, reported by and fix suggested by timrobbins)

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@76486 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-07-23 12:29:46 +00:00
Steve Murphy 0e969271ae After some study, thought, comparing, etc. I've backed out the previous universal mod to make ast_flags a 64 bit thing. Instead, I added a 64-bit version of ast_flags (ast_flags64), and 64-bit versions of the test-flag, set-flag, etc. macros, and an app_parse_options64 routine, and I use these in app_dial alone, to eliminate the 30-option limit it had grown to meet. There is room now for 32 more options and flags. I was heavily tempted to implement some of the other ideas that were presented, but this solution does not intro any new versions of dial, doesn't have a different API, has a minimal/zero impact on code outside of dial, and doesn't seriously (I hope) affect the code structure of dial. It's the best I can think of right now. My goal was NOT to rewrite dial. I leave that to a future, coordinated effort.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@75983 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-07-19 23:24:27 +00:00
Russell Bryant 7b09e738f0 Merged revisions 75928 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

................
r75928 | russell | 2007-07-19 10:53:15 -0500 (Thu, 19 Jul 2007) | 14 lines

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

........
r75927 | russell | 2007-07-19 10:49:42 -0500 (Thu, 19 Jul 2007) | 6 lines

When processing full frames, take sequence number wraparound into account when
deciding whether or not we need to request retransmissions by sending a VNAK.
This code could cause VNAKs to be sent erroneously in some cases, and to not
be sent in other cases when it should have been.
(closes issue #10237, reported and patched by mihai)

........

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@75929 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-07-19 15:53:50 +00:00
Russell Bryant 5272289355 I thought I noticed a memory leak earlier when I saw that the contents of this
list were not destroyed when the module is unloaded.  However, after reading
the code related to the use of this list a lot today, I realized that it isn't
necessary.  So, I have added a comment to explain why it isn't necessary.


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@75806 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-07-18 22:52:54 +00:00
Tilghman Lesher 9c99cba373 Change IAX variables to use datastores (closes issue #9315)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@75805 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-07-18 22:40:03 +00:00
Russell Bryant 4681316959 Merged revisions 75759 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

................
r75759 | russell | 2007-07-18 16:09:46 -0500 (Wed, 18 Jul 2007) | 13 lines

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

........
r75757 | russell | 2007-07-18 16:09:13 -0500 (Wed, 18 Jul 2007) | 5 lines

When traversing the queue of frames for possible retransmission after
receiving a VNAK, handle sequence number wraparound so that all frames that 
should be retransmitted actually do get retransmitted.
(issue #10227, reported and patched by mihai)

........

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@75761 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-07-18 21:10:27 +00:00
Russell Bryant 707ca59923 convert some lines indented with spaces to tabs
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@75709 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-07-18 19:50:21 +00:00
Tilghman Lesher 81bc1d7af5 Merge in ast_strftime branch, which changes timestamps to be accurate to the microsecond, instead of only to the second
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@75706 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-07-18 19:47:20 +00:00
Russell Bryant b5ff588044 Merged revisions 75445 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

................
r75445 | russell | 2007-07-17 15:48:21 -0500 (Tue, 17 Jul 2007) | 13 lines

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

........
r75444 | russell | 2007-07-17 15:45:27 -0500 (Tue, 17 Jul 2007) | 5 lines

Ensure that when encoding the contents of an ast_frame into an iax_frame, that
the size of the destination buffer is known in the iax_frame so that code
won't write past the end of the allocated buffer when sending outgoing frames.
(ASA-2007-014)

........

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@75446 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-07-17 20:49:09 +00:00
Russell Bryant 681e45f0b2 Merged revisions 75441 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

................
r75441 | russell | 2007-07-17 15:42:12 -0500 (Tue, 17 Jul 2007) | 12 lines

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

........
r75440 | russell | 2007-07-17 15:41:41 -0500 (Tue, 17 Jul 2007) | 4 lines

After parsing information elements in IAX frames, set the data length to zero,
so that code later on does not think it has data to copy.
(ASA-2007-015)

........

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@75442 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-07-17 20:42:50 +00:00
Steve Murphy 8a7732f067 via 10206, I have added an option (e) to Dial to allow the h exten to get run on peer. Had to upgrade ast_flag stuff to 64 bits to do this.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@75400 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-07-17 19:40:29 +00:00
Russell Bryant 08b1a342e5 Merged revisions 74767 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

................
r74767 | russell | 2007-07-11 17:57:07 -0500 (Wed, 11 Jul 2007) | 13 lines

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

........
r74766 | russell | 2007-07-11 17:53:26 -0500 (Wed, 11 Jul 2007) | 5 lines

The function make_trunk() can fail and return -1 instead of a valid new call
number.  Fix the uses of this function to handle this instead of treating it
as the new call number.  This would cause a deadlock and memory corruption.
(possible cause of issue #9614 and others, patch by me)

........

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@74769 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-07-11 23:05:34 +00:00
Russell Bryant 04de82d61c Merged revisions 73555 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r73555 | russell | 2007-07-05 18:05:33 -0500 (Thu, 05 Jul 2007) | 3 lines

copy from the correct buffer when deferring a full frame
(related to issue #9937)

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@73557 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-07-05 23:06:01 +00:00
Russell Bryant d339ac7156 Merged revisions 73551 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r73551 | russell | 2007-07-05 17:31:31 -0500 (Thu, 05 Jul 2007) | 6 lines

* Store the call number that a thread is processing without the full frame bit
  set to ease debugging
* When deferring a full frame for processing, stick it into the queue for the
  thread that is processing frames for that call, not the one that read the
  current frame and is about to go back into the idle list
(related to issue #9937)

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@73552 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-07-05 22:32:30 +00:00
Joshua Colp fab0bded8c Yet another Solaris tweak...
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@72936 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-07-02 20:35:35 +00:00
Russell Bryant 8fd5e05635 Merged revisions 71003 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r71003 | russell | 2007-06-21 22:14:41 -0500 (Thu, 21 Jun 2007) | 3 lines

Fix a small typo which ... well ... completely broke chan_iax2.  oops!
(issue #9937, patch by me)

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@71004 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-06-22 03:15:34 +00:00
Russell Bryant 992c8ec757 Merged revisions 70883 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r70883 | russell | 2007-06-21 16:14:53 -0500 (Thu, 21 Jun 2007) | 3 lines

Put the thread reading from the socket back in the idle list if it deferred the
processing of a full frame to another thread

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@70887 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-06-21 21:16:36 +00:00
Russell Bryant 82151ac23f Merged revisions 70866 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r70866 | russell | 2007-06-21 16:07:04 -0500 (Thu, 21 Jun 2007) | 5 lines

If a full frame is received while one of the iax2 threads is in the middle
of handling a full frame for the same call, queue it up for processing by that
same thread later instead of dropping it.
(issue #9937, patch by me)

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@70877 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-06-21 21:12:03 +00:00
Kevin P. Fleming 5fdba27ea2 Merged revisions 69392 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r69392 | kpfleming | 2007-06-14 16:50:40 -0500 (Thu, 14 Jun 2007) | 2 lines

use ast_localtime() in every place localtime_r() was being used

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@69405 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-06-14 22:09:20 +00:00
Russell Bryant 055d82cbce Add a massive set of changes for converting to use the ast_debug() macro.
(issue #9957, patches from mvanbaak, caio1982, critch, and dimas)


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@69327 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-06-14 19:39:12 +00:00
Joshua Colp 6a35e6cfb6 Merged revisions 69221 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r69221 | file | 2007-06-13 17:17:28 -0400 (Wed, 13 Jun 2007) | 2 lines

Let's make chan_iax2 media only native transfers actually work. (issue #9376 reported by simone cittadini)

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@69223 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-06-13 21:20:32 +00:00
Russell Bryant 65880d7680 Merged revisions 69069 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r69069 | russell | 2007-06-13 11:29:12 -0500 (Wed, 13 Jun 2007) | 3 lines

Fix a place where a chan_iax2 pvt struct was accessed without the lock held.
This issue was reported to me via email by Dmitry Mishchenko.  Thanks!

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@69070 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-06-13 16:29:45 +00:00
Joshua Colp 0b75ad2db9 Merged revisions 69014 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r69014 | file | 2007-06-12 15:36:29 -0400 (Tue, 12 Jun 2007) | 2 lines

Change the full frame dropping log message to debug to avoid future bug reports.

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@69015 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-06-12 19:38:17 +00:00
Joshua Colp 74cda06deb Merged revisions 69012 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r69012 | file | 2007-06-12 15:26:38 -0400 (Tue, 12 Jun 2007) | 2 lines

Schedule the sending of a PING packet a second later than previously so that it does not collide with the LAGRQ.

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@69013 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-06-12 19:29:12 +00:00
Kevin P. Fleming a08922bb71 Merged revisions 68450 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r68450 | kpfleming | 2007-06-08 10:52:47 -0500 (Fri, 08 Jun 2007) | 2 lines

actually remember the type/subclass of full frames that are in process

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@68453 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-06-08 16:03:01 +00:00
Kevin P. Fleming 2c9173986a Merged revisions 68313 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r68313 | kpfleming | 2007-06-07 17:14:35 -0500 (Thu, 07 Jun 2007) | 6 lines

some improvements to the IAX2 full frame dropping logic recently added:

- use inaddrcmp(), since we have it
- output the type of frame and subclass being dropped, and the type/subclass that is already being processed (which caused the drop)


........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@68321 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-06-07 22:18:38 +00:00
Dwayne M. Hubbard 611c9ed353 added CLI 'iax2 unregister <peername>' for issue 9812, thanks eliel
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@67901 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-06-06 22:35:35 +00:00
Tilghman Lesher 9d05ff8ed5 Issue 9869 - replace malloc and memset with ast_calloc, and other coding guidelines changes
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@67864 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-06-06 21:20:11 +00:00
Russell Bryant 7d35df9d98 Make another small tweak ... mantis/svn testing
(issue #9828)


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@67779 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-06-06 18:47:58 +00:00
Joshua Colp 72cd0474f6 Merged revisions 67304 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r67304 | file | 2007-06-05 12:22:30 -0300 (Tue, 05 Jun 2007) | 2 lines

Only muck with the thread structure if an idle one was found/created.

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@67305 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-06-05 15:24:01 +00:00
Russell Bryant 05169b004d Doxygenify the comments for new members of the iax2_thread struct
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@67272 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-06-05 14:55:09 +00:00
Kevin P. Fleming a236af6137 Merged revisions 67270 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r67270 | kpfleming | 2007-06-05 09:35:52 -0500 (Tue, 05 Jun 2007) | 3 lines

ensure that a burst of full frames (AST_FRAME_DTMF being the prime example) will not be processed out of order... this is a brute force fix, but seems to be the safest fix for now (thanks to the Digium PQ department for finding this bug)


........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@67271 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-06-05 14:45:48 +00:00
Russell Bryant 71544542a0 Merged revisions 67158 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r67158 | russell | 2007-06-04 18:31:40 -0500 (Mon, 04 Jun 2007) | 5 lines

Fix up a bunch of places where the iax2 pvt structure can disappear and the
code did not account for it and crashes.
(issues #9642, #9569, #9666, probably others ... based on the work by
 stevedavies and mihai, with additional changes from me)

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@67160 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-06-04 23:32:26 +00:00
Russell Bryant 6857957000 Merged revisions 67119 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r67119 | russell | 2007-06-04 17:28:55 -0500 (Mon, 04 Jun 2007) | 6 lines

Add comments for two functions that get called with the appropriate call locked,
but perform operations that could result in the pvt structure getting destroyed
before returning again, causing numerous seg faults all over the module.
(inspired by issues #9642, #9569, and #9666, and the work done by stevedavies
 and mihai)

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@67120 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-06-04 22:29:43 +00:00
Russell Bryant c7fec92508 Remove a leftover unlock and lock of the iax2 pvt struct lock that was left
over from my attempt at putting pvt structs in a hash table.  It can cause
seg faults, and has no reason to stay.
(issue #9642, pointed out by stevedavies)


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@67070 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-06-04 21:45:24 +00:00
Russell Bryant d6f2b914e8 Merged revisions 67020 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r67020 | russell | 2007-06-04 10:47:40 -0500 (Mon, 04 Jun 2007) | 7 lines

Resolve a deadlock in chan_iax2.  When handling an implicit ACK to a frame that
was marked as the final transmission for a call, don't call iax2_destroy() for
that call while the global frame queue is still locked.  There is a very nice
explanation of the deadlock in the report.
(issue #9663, thorough report and patch from stevedavies, additional positive
 test reports from mihai and joff_oconnell)

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@67022 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-06-04 15:50:46 +00:00
Russell Bryant c9cf12b675 Remove 80 bytes in the iax2_registry struct that weren't being used
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@66957 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-06-01 23:02:57 +00:00
Kevin P. Fleming 4573b36af1 use the OpenSSL AES implementation if it's available (unless configured not to)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@66071 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-05-24 22:07:50 +00:00
Russell Bryant 4b3a3fb14c Add a new API call for creating detached threads. Then, go replace all of the
places in the code where the same block of code for creating detached threads
was replicated.  (patch from bbryant)


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@65968 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-05-24 18:30:19 +00:00
Kevin P. Fleming 48895d885d Merged revisions 65685 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r65685 | kpfleming | 2007-05-23 16:59:19 -0400 (Wed, 23 May 2007) | 2 lines

start the delayed PBX when receive voice or video full frames as well, and comment this delayed-PBX activity

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@65688 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-05-23 21:01:18 +00:00
Kevin P. Fleming 04da47df24 Merged revisions 65679-65680 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r65679 | kpfleming | 2007-05-23 16:30:24 -0400 (Wed, 23 May 2007) | 2 lines

don't start a PBX on a new incoming IAX2 channel until we have some sort of response to our ACCEPT (ACK or anything else)

........
r65680 | kpfleming | 2007-05-23 16:35:50 -0400 (Wed, 23 May 2007) | 2 lines

clear the 'delay PBX' flag when we are ready to start the PBX

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@65681 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-05-23 20:39:42 +00:00
Kevin P. Fleming 61a53d859e Merged revisions 65677 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

................
r65677 | kpfleming | 2007-05-23 16:07:59 -0400 (Wed, 23 May 2007) | 10 lines

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

........
r65676 | kpfleming | 2007-05-23 16:06:13 -0400 (Wed, 23 May 2007) | 2 lines

if we are going to set variables on a newly created channel, it should be done *before* we start the PBX on it

........

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@65678 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-05-23 20:08:59 +00:00
Jason Parker 2768946cf5 Merged revisions 63830 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

................
r63830 | qwell | 2007-05-10 18:15:37 -0500 (Thu, 10 May 2007) | 12 lines

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

........
r63828 | qwell | 2007-05-10 18:14:55 -0500 (Thu, 10 May 2007) | 4 lines

Fix an issue with trying to kill a thread before it gets created.

Issue 9709, patch by nic_bellamy.

........

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@63832 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-05-10 23:16:33 +00:00
Joshua Colp 28f4727e75 Lock iax2 pvt structure when passing off to the AMI function, and make sure it exists. (issue #9674 reported by arabe)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@63182 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-05-06 20:09:18 +00:00
Olle Johansson 1b15d8852d Add the new ChannelUpdate event to inform manager clients about the PVT ID and some other channel driver data that
is needed to follow the call through the PBX.


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@63032 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-05-04 13:56:25 +00:00
Tilghman Lesher 121561076e Merged revisions 62692 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

................
r62692 | tilghman | 2007-05-02 12:43:48 -0500 (Wed, 02 May 2007) | 12 lines

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

........
r62691 | tilghman | 2007-05-02 12:38:16 -0500 (Wed, 02 May 2007) | 4 lines

Issue 9638 - if a text frame is sent with no terminating NULL through a bridged
IAX connection, the remote end will receive garbage characters tacked onto the
end.

........

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@62693 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-05-02 17:49:36 +00:00
Russell Bryant b419fc1134 Add support for setting the CoS for VLAN traffic (802.1p) in Linux. The
file doc/qos.tex has been updated to document the new functionality.
(issue #9540, patch submitted by IgorG)


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@62457 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-04-30 16:16:26 +00:00
Russell Bryant b6b1bf3213 Merge changes from team/russell/events
This set of changes introduces a new generic event API for use within Asterisk.
I am still working on a way for events to be shared between servers, but this
part is ready and can already be used inside of Asterisk.

This set of changes introduces the first use of the API, as well.  I have
restructured the way that MWI (message waiting indication) is handled.  It is
now event based instead of polling based.  For example, if there are a bunch
of SIP phones subscribed to mailboxes, then chan_sip will not have to
constantly poll the mailboxes for changes.  app_voicemail will generate events
when changes occur.

See UPGRADE.txt and CHANGES for some more information on the effects of these
changes from the user perspective.  For developer information, see the text in
include/asterisk/event.h.

As always, additional feedback is welcome on the asterisk-dev mailing list.


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@62292 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-04-28 21:01:44 +00:00
Joshua Colp 14d8979b2f Merged revisions 62038 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

................
r62038 | file | 2007-04-26 12:33:52 -0400 (Thu, 26 Apr 2007) | 10 lines

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

........
r62037 | file | 2007-04-26 12:30:57 -0400 (Thu, 26 Apr 2007) | 2 lines

Revert previous fix for when the IAX2 channel goes funky (that's the technical term). This is causing legit calls to be prematurely hung up. (issue #9600 reported by justdave)

........

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@62039 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-04-26 16:35:14 +00:00
Russell Bryant dc7514a746 Merged revisions 61870 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

................
r61870 | russell | 2007-04-25 16:59:07 -0500 (Wed, 25 Apr 2007) | 10 lines

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

........
r61866 | russell | 2007-04-25 16:55:23 -0500 (Wed, 25 Apr 2007) | 2 lines

If the callerid= option is specified, but empty, clear any previous data.

........

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@61876 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-04-25 22:01:37 +00:00
Russell Bryant 891a005706 Merged revisions 61863 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

................
r61863 | russell | 2007-04-25 16:13:15 -0500 (Wed, 25 Apr 2007) | 10 lines

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

........
r61862 | russell | 2007-04-25 16:06:22 -0500 (Wed, 25 Apr 2007) | 2 lines

Ensure that callerid settings are reset on a reload.

........

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@61864 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-04-25 21:15:19 +00:00
Russell Bryant b94378b5e6 Merge changes from team/russell/iax2_osp
This set of changes adds OSP support to chan_iax2.  However, I have modified
the patch a bit from what was submitted.  You now use the CHANNEL() function
to get and set the OSP token for IAX2.

(issue #8531, reported by and original patch by homesick, patch updated by me)


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@61702 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-04-20 21:12:53 +00:00
Steve Murphy ecaf781933 Merged revisions 60989 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r60989 | murf | 2007-04-09 12:32:07 -0600 (Mon, 09 Apr 2007) | 1 line

This is a big improvement over the current CDR fixes. It may still need refinement, but this won't have as many folks bothered.
This also adds the mods from 1.4/r.61136;
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@61152 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-04-10 05:41:34 +00:00
Olle Johansson 4aef0155d6 use "ChannelType" in events to indicate which channel driver that generates the event. This replaces
"ChannelDriver" and "Channel", previously used to indicate channel driver. ChannelType is more
in line with "core show channeltypes"


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@60987 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-04-09 18:22:43 +00:00
Russell Bryant 592870b6ce This hashing code is still causing some random crashes on my system, and
probably others, too.  I don't really have time to work on it at the moment,
so I am just going to revert it for now.


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@59693 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-04-02 17:40:26 +00:00
Russell Bryant 5d4e6a480a Fix an issue with hashing iax2 pvt structures that caused random crashes on
systems under heavy load such as IAXtel.
(possibly related to issue #9403)


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@59368 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-03-29 18:31:35 +00:00
Russell Bryant 5a1c6826ce Merged revisions 59341 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r59341 | russell | 2007-03-29 11:55:39 -0500 (Thu, 29 Mar 2007) | 8 lines

When the IAX2 read callback gets called, return NULL instead of a "null frame".
This will cause Asterisk to hangup the call instead of keep trying whatever it
was doing.  Under normal conditions, this function would *never* be called.
However, the author of this patch says an error will occur that will cause it
to get called every 100 thousand calls or so.  When this does happen, it puts
the channel in a loop that eventually brings down the system.  So, hangup up
the call is certainly a better alternative.  (issue #8286, john)

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@59343 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-03-29 16:56:35 +00:00
Russell Bryant b5adacebf1 Merged revisions 59259 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

................
r59259 | russell | 2007-03-27 13:05:46 -0500 (Tue, 27 Mar 2007) | 12 lines

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

........
r59258 | russell | 2007-03-27 13:04:02 -0500 (Tue, 27 Mar 2007) | 4 lines

Fix the use of the "sourceaddress" option when "bindaddr" is set to 0.0.0.0
instead of having each interface explicitly listed.
(issue #7874, patch by stevens)

........

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@59260 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-03-27 18:08:59 +00:00
Joshua Colp 4787adb4e9 Merged revisions 58923 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r58923 | file | 2007-03-15 15:13:21 -0300 (Thu, 15 Mar 2007) | 2 lines

Don't assume that the pvt structure will still exist after calling schedule_delivery as it may not. (issue #9278 reported by fmachado)

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@58924 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-03-15 18:21:03 +00:00
Russell Bryant 5dc7f1d898 Merged revisions 58705 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r58705 | russell | 2007-03-10 12:11:11 -0600 (Sat, 10 Mar 2007) | 6 lines

Fix a few more places in chan_iax2 where the ast_frame used for receiving a
frame was not properly initialized.
 - Interpolating a frame when the jitterbuffer is in use
 - decrypting a frame when IAX2 encryption is on
 - frames in an IAX2 trunk

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@58706 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-03-10 18:15:41 +00:00
Russell Bryant f86aee41f7 Merged revisions 58243 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

................
r58243 | russell | 2007-03-07 12:19:19 -0600 (Wed, 07 Mar 2007) | 17 lines

(This bug was reported to me by Kinsey Moore)

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

........
r58242 | russell | 2007-03-07 12:17:07 -0600 (Wed, 07 Mar 2007) | 7 lines

Fix a problem where the Asterisk channel name could be that of the wrong IAX2
user for a call.  This is because the first step of choosing this name is to
look for an IAX2 peer that happens to have the same IP/port number that this
call is coming from and assuming that is it.  However, this is not always
correct.  So, I have made it change this name after authentication happens
since at that point, we have an exact match.

........

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@58244 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-03-07 18:20:51 +00:00
Joshua Colp 2adf4fa4e0 Merged revisions 57914 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r57914 | file | 2007-03-05 14:19:07 -0500 (Mon, 05 Mar 2007) | 2 lines

Since chan_iax2 does not support reception of DTMF with duration ensure that it is set to 0 on the frame. (issue #8521 reported by gdhgdh)

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@57915 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-03-05 19:20:45 +00:00
Russell Bryant c617945b5c 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)

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@56849 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-02-26 20:04:53 +00:00
Russell Bryant 82179d1202 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)

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@56786 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-02-26 16:54:17 +00:00
Russell Bryant 5873c9c90f There is no need to look in the iaxs array for the pvt struct when we already
have a pointer to it.


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@56731 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-02-26 00:37:03 +00:00
Russell Bryant b85a5ffbe3 Make the hashing function calculate something that makes more sense.
(Thanks to bmd on #asterisk-dev for pointing out my pointless math).


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@56487 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-02-23 22:26:00 +00:00
Russell Bryant 9fb1404279 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.


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@56447 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-02-23 21:20:33 +00:00
Russell Bryant 70ce880338 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).

........

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@56408 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-02-23 20:21:35 +00:00
Doug Bailey c6dd460655 Merged revisions 55397 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r55397 | dbailey | 2007-02-19 08:52:59 -0600 (Mon, 19 Feb 2007) | 3 lines

Changed iax2 process thread to detached to correct memory leak due to left over thread context on thread exit.  
Modified module unload process to avoid deadlocks on pthread cancels

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@55409 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-02-19 15:24:46 +00:00
Joshua Colp bd41ac0ae8 Merged revisions 53358 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

................
r53358 | file | 2007-02-07 10:43:39 -0500 (Wed, 07 Feb 2007) | 10 lines

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

........
r53357 | file | 2007-02-07 10:38:48 -0500 (Wed, 07 Feb 2007) | 2 lines

Fix a few potential memory leaks with realtime users and peers. (issue #8999 reported by bsmithurst)

........

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@53359 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-02-07 15:46:30 +00:00
Russell Bryant b233892198 Merged revisions 53046 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

................
r53046 | russell | 2007-01-31 15:32:08 -0600 (Wed, 31 Jan 2007) | 11 lines

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

........
r53045 | russell | 2007-01-31 15:25:11 -0600 (Wed, 31 Jan 2007) | 3 lines

Fix a bunch of places where pthread_attr_init() was called, but
pthread_attr_destroy() was not.

........

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@53047 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-01-31 21:35:15 +00:00
Russell Bryant 116952bba1 Merged revisions 52763 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

................
r52763 | russell | 2007-01-29 18:15:50 -0600 (Mon, 29 Jan 2007) | 13 lines

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

........
r52762 | russell | 2007-01-29 18:15:06 -0600 (Mon, 29 Jan 2007) | 5 lines

Fix the extraction of the timestamp from video frames.  It was using the
mapping for a mini-frame instead of a video-frame, which caused it to
get invalid data.
(issue #8795, mihai)

........

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@52764 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-01-30 00:16:38 +00:00
Joshua Colp 8e755c25ca Merged revisions 52370 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

................
r52370 | file | 2007-01-26 19:08:18 -0500 (Fri, 26 Jan 2007) | 10 lines

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

........
r52360 | file | 2007-01-26 19:03:23 -0500 (Fri, 26 Jan 2007) | 2 lines

Make the last context entry read in the dominant one. (issue #8918 reported by pj)

........

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@52371 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-01-27 00:10:19 +00:00
Joshua Colp ee3ab150f6 Merged revisions 51788 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r51788 | file | 2007-01-23 17:46:31 -0500 (Tue, 23 Jan 2007) | 2 lines

Update channel drivers to use module referencing so that unloading them while in use will not result in crashes. (issue #8897 reported by junky)

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@51801 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-01-23 22:59:55 +00:00
Joshua Colp 34df128519 Add SRV Lookup support on outbound calls to chan_iax2. It's listed in the RFC so we might want to support it and please don't hurt me Marko ... (issue #7812 reported by drorlb)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@51560 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-01-23 03:15:04 +00:00
Russell Bryant dcca8f345f Merged revisions 51311 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r51311 | russell | 2007-01-19 11:49:38 -0600 (Fri, 19 Jan 2007) | 23 lines

Merge the changes from the /team/group/vldtmf_fixup branch.

The main bug being addressed here is a problem introduced when two SIP
channels using SIP INFO dtmf have their media directly bridged.  So, when a
DTMF END frame comes into Asterisk from an incoming INFO message, Asterisk
would try to emulate a digit of some length by first sending a DTMF BEGIN
frame and sending a DTMF END later timed off of incoming audio.  However,
since there was no audio coming in, the DTMF_END was never generated.  This
caused DTMF based features to no longer work.

To fix this, the core now knows when a channel doesn't care about DTMF BEGIN
frames (such as a SIP channel sending INFO dtmf).  If this is the case, then
Asterisk will not emulate a digit of some length, and will instead just pass
through the single DTMF END event.

Channel drivers also now get passed the length of the digit to their digit_end
callback.  This improves SIP INFO support even further by enabling us to put
the real digit duration in the INFO message instead of a hard coded 250ms.
Also, for an incoming INFO message, the duration is read from the frame and
passed into the core instead of just getting ignored.

(issue #8597, maybe others...)

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@51314 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-01-19 18:06:03 +00:00
Luigi Rizzo a52fa7e5ad sizeof() is compatible with format %d so don't be too
picky on printf formats.



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@51309 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-01-19 17:45:46 +00:00
Luigi Rizzo dc31eaa025 include "asterisk/zapata.h" instead of looking
directly for the zaptel.h and tonezone.h



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@51292 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-01-19 16:16:19 +00:00
Joshua Colp 31224a6b52 Merged revisions 51172 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r51172 | file | 2007-01-16 19:46:29 -0500 (Tue, 16 Jan 2007) | 2 lines

Move rescheduling of lagrq/pings into the scheduler callback.

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@51173 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-01-17 00:50:59 +00:00
Tilghman Lesher 3d91c0a0c0 IAX2 remote variables - Bug 7619
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@51123 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-01-16 08:38:59 +00:00
Joshua Colp 033d849bda Drop trunkrealloc option and just have the maximum size be a configurable option. This is per Kevin's comments on -dev and my own thoughts after I put the previous option in.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@50698 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-01-13 04:04:04 +00:00
Joshua Colp c4b4615dcd Merge in trunkrealloc option for chan_iax2. (issue #8267 reported by marcodmb, branch by anthonyl)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@50676 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-01-13 03:26:04 +00:00
Russell Bryant 444acad95b Covert some spaces to tabs, and put a list of defines in an enum.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@50230 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-01-10 02:50:06 +00:00
Joshua Colp 585e0e3e09 Merged revisions 49890 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

................
r49890 | file | 2007-01-08 00:11:54 -0500 (Mon, 08 Jan 2007) | 10 lines

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

........
r49889 | file | 2007-01-08 00:10:07 -0500 (Mon, 08 Jan 2007) | 2 lines

Ensure we use the default refresh value of 60 if the remote server does not send one. (issue #8746 reported by maethor)

........

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@49891 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-01-08 05:13:24 +00:00
Kevin P. Fleming cd73a483f1 const-ify some more APIs, and fix rev 49710 from branch-1.4 in a better way here
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@49711 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-01-05 23:32:42 +00:00
Kevin P. Fleming 87b9abc892 Merged revisions 49676 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r49676 | kpfleming | 2007-01-05 16:16:33 -0600 (Fri, 05 Jan 2007) | 2 lines

reduce stack consumption for AMI and AMI/HTTP requests by nearly 20K in most cases

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@49678 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-01-05 22:43:18 +00:00
Kevin P. Fleming a8dc50812f Merged revisions 49636 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

................
r49636 | kpfleming | 2007-01-05 11:09:00 -0600 (Fri, 05 Jan 2007) | 10 lines

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

........
r49635 | kpfleming | 2007-01-05 10:56:40 -0600 (Fri, 05 Jan 2007) | 2 lines

ensure that threads which are supposed to be detached (because we aren't going to wait on them) are created properly

........

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@49637 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-01-05 17:10:59 +00:00
Kevin P. Fleming 6efd946f68 Merged revisions 49600 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r49600 | kpfleming | 2007-01-04 18:01:40 -0600 (Thu, 04 Jan 2007) | 2 lines

revert the dynamic_list insertion change... that was not the right thing to do

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@49603 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-01-05 00:02:48 +00:00
Kevin P. Fleming 55cc7f9a03 Merged revisions 49581 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r49581 | kpfleming | 2007-01-04 17:50:15 -0600 (Thu, 04 Jan 2007) | 3 lines

create the IAX2 processing threads as background threads so they will use smaller stacks
when we create a dynamic thread, put it on the dynamic_list right away so we don't lose track of it

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@49584 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-01-04 23:54:09 +00:00
Joshua Colp 5a140436f3 Merged revisions 49568 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r49568 | file | 2007-01-04 18:00:50 -0500 (Thu, 04 Jan 2007) | 2 lines

It's possible for the iax2 pvt to disappear, so if it has... don't bother looking for dpentries.

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@49573 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-01-04 23:02:32 +00:00
Kevin P. Fleming d6d713c84f Merged revisions 49465 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r49465 | kpfleming | 2007-01-04 12:31:55 -0600 (Thu, 04 Jan 2007) | 2 lines

only do IAX2 frame caching for voice and video frames

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@49466 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-01-04 18:32:23 +00:00
Joshua Colp 1825b70a4c Merged revisions 49259 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r49259 | file | 2007-01-02 20:19:53 -0500 (Tue, 02 Jan 2007) | 2 lines

Check pvt structure presence before passing to send_command. This gets rid of the irritating message about a packet without pvt structure. This happens because the scheduled item is getting cancelled at almost the exact moment it is getting executed.

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@49260 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-01-03 01:21:41 +00:00
Olle Johansson f83b845f08 - Implement error handling in ast_append_ha
- Use this in chan_sip
- Document ha functions in acl.c


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@49092 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2007-01-01 19:20:46 +00:00
Joshua Colp 7eb0f10f34 count is no longer used in the iaxq structure really so let's just make this a statically declared linked list.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@49089 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-12-31 19:15:23 +00:00
Joshua Colp ae649fef27 Merged revisions 49063 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r49063 | file | 2006-12-29 22:37:22 -0500 (Fri, 29 Dec 2006) | 2 lines

Initialize the packet queue in load_module instead of just declaring the list with the default value. (issue #8695 reported by ssokol)

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@49064 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-12-30 03:40:42 +00:00
Russell Bryant 539514d793 Merged revisions 48944 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

................
r48944 | russell | 2006-12-24 02:25:38 -0500 (Sun, 24 Dec 2006) | 11 lines

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

........
r48943 | russell | 2006-12-24 02:23:07 -0500 (Sun, 24 Dec 2006) | 3 lines

Check for the proper return value on an error in a call to mmap().
This was reported by Andy Wang on the asterisk-dev list.  Thanks!

........

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@48945 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-12-24 07:27:29 +00:00
Steve Murphy 7b338004bf a quick fix to app_sms.c to get rid of cursed compiler warnings so I can compile under --enable-dev-mode
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@48767 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-12-21 19:44:20 +00:00
Steve Murphy 9327720c37 As per bug 7978, this version introduces the jittertargetextra option in config files
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@48663 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-12-21 00:24:08 +00:00
Joshua Colp 381d49c9af Clean up find_idle_thread function and use atomic operations for dynamic thread count.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@48567 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-12-18 17:30:53 +00:00
Joshua Colp c17181aae3 Merged revisions 48564 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r48564 | file | 2006-12-18 12:15:49 -0500 (Mon, 18 Dec 2006) | 2 lines

Put thread into proper list if we abort handling due to an error, and also hold the lock while putting it back into the proper idle list so we don't prematurely get a signal. (issue #8604 reported by arkadia)

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@48565 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-12-18 17:18:18 +00:00
Joshua Colp 6bdd1a3388 Merged revisions 48504 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r48504 | file | 2006-12-15 14:38:51 -0500 (Fri, 15 Dec 2006) | 2 lines

Hold call structure lock in places where a qualify or peer action can destroy it.

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@48505 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-12-15 19:40:29 +00:00
Joshua Colp 12565be69e Merged revisions 48502 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r48502 | file | 2006-12-15 14:24:15 -0500 (Fri, 15 Dec 2006) | 2 lines

Lock network retransmission queue in all places that it is used.

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@48503 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-12-15 19:26:45 +00:00
Joshua Colp 315f8bb1b2 Merged revisions 48478 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r48478 | file | 2006-12-15 01:28:05 -0500 (Fri, 15 Dec 2006) | 2 lines

Use a wakeup variable so that we don't wait on IO indefinitely if packets need to be retransmitted.

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@48479 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-12-15 06:31:26 +00:00
Russell Bryant a9415d4b8e convert the thread IO state and type to use enums.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@48365 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-12-09 16:44:41 +00:00
Russell Bryant 86ad1435c1 Merged revisions 48363 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r48363 | russell | 2006-12-09 10:59:42 -0500 (Sat, 09 Dec 2006) | 8 lines

Use locking when accessing the registrations list.  This list is not actually
used very often, so the likelihood of there being a problem is pretty small,
but still possible.  For example, if the CLI command to list the registrations
was called at the same time that a reload was occurring and the registrations
list was getting destroyed and rebuilt, a crash could occur.

In passing, go ahead and convert this list to use the linked list macros.

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@48364 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-12-09 16:04:06 +00:00
Russell Bryant 62c5be4fda chan_iax2 has an extremely large function, socket_process(), to handle incoming
frames.  The function, before this commit, was roughly 1400 lines long.  So, I
am working on breaking this up into functions so that the code is easier to
follow and debug.  Also, I will be committing these changes in chunks as I do
them to ease tracking down any potentially introduced problems.

Break out roughly 150 lines from socket_process() and introduce a new function, 
socket_process_meta() which handles the parsing of an incoming meta frame.
Also, restructure some of this code a bit to reduce the deep nesting that was
in this code.


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@48360 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-12-09 07:10:55 +00:00
Russell Bryant 6592c25a69 - Fix a few spelling mistakes
- Use sizeof() to pass an array size to a function
- Use a single bit for a variable in the chan_iax2_pvt stuct since that is all
  it needs.
- Add some comments about the iaxs, iaxl, and lastused arrays.


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@48359 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-12-09 05:04:38 +00:00
Russell Bryant a44e55a3f3 Constify a bunch of the usage strings for CLI commands.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@48302 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-12-06 07:23:32 +00:00
Russell Bryant b761fb83cd Instead of creating an unused instance of an unnamed enum, give it a name.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@48300 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-12-06 07:16:09 +00:00
Joshua Colp a77935b674 Merged revisions 48158 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

................
r48158 | file | 2006-11-30 15:07:55 -0500 (Thu, 30 Nov 2006) | 10 lines

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

........
r48157 | file | 2006-11-30 15:06:43 -0500 (Thu, 30 Nov 2006) | 2 lines

Only print out debug message if bridged channel is not NULL. (issue #8412 reported by jubilex)

........

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@48160 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-11-30 20:09:46 +00:00
Russell Bryant c16c606cff Add a comment to note near some code that performs a very expensive operation
that occurs for every incoming media frame.


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@48099 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-11-28 23:13:37 +00:00
Russell Bryant 462407a3a6 The use of an ifdef to check for FreeBSD is useless here because the two
versions of the format string are identical.  Also, since each format is only
used once, get rid of the use of defines all together.  (issue #8344, julieng)

In passing, also clean up the formatting a but to get rid of the nesting
without the use of braces, as defined in the coding guidelines.


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@47520 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-11-12 19:22:19 +00:00
Russell Bryant e19fc06e2c Merged revisions 47497 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

................
r47497 | russell | 2006-11-12 01:23:23 -0500 (Sun, 12 Nov 2006) | 12 lines

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

........
r47496 | russell | 2006-11-12 01:09:03 -0500 (Sun, 12 Nov 2006) | 4 lines

Only do the check to determine whether the channel calling this function is an
IAX2 channel when getting the IP address using the special argument, 
CURRENTCHANNEL.  (issue #8341, jcovert)

........

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@47498 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-11-12 06:31:39 +00:00
Tilghman Lesher 691363656f Merged revisions 47436 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r47436 | tilghman | 2006-11-10 10:51:55 -0600 (Fri, 10 Nov 2006) | 2 lines

Discussion of these CLI changes resulted in more consistency (Bug 8236)

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@47439 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-11-10 17:01:06 +00:00
Steve Murphy 908f176cf3 A fair number of changes for the sake of bug 7506
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@47290 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-11-07 21:47:49 +00:00
Tilghman Lesher 10875731ec Merged revisions 47051 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r47051 | tilghman | 2006-11-02 17:00:20 -0600 (Thu, 02 Nov 2006) | 2 lines

Reverse change of "show" to "list" and make several other commands more consistent with "category verb arguments"

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@47052 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-11-02 23:16:09 +00:00
Joshua Colp 9f78577f5e Merged revisions 46775 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r46775 | file | 2006-11-01 13:21:34 -0500 (Wed, 01 Nov 2006) | 2 lines

It's another round of chan_iax2 fixes! Should hopefully fix the deadlock issues people have been reporting. IAXtel now has qualify turned on for 800 peers and it is handling it fine.

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@46777 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-11-01 18:26:12 +00:00
Luigi Rizzo bf3afe5641 remove old/useless usecount handling
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@46696 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-10-31 18:10:21 +00:00
Joshua Colp e3807ed8cc Merged revisions 46474 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r46474 | file | 2006-10-30 13:13:07 -0500 (Mon, 30 Oct 2006) | 2 lines

We need to lock the pvt structure during retransmission as another worker thread may be doing something as well.

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@46475 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-10-30 18:17:02 +00:00
Kevin P. Fleming 6ab133b9d2 restore bugfix that was reverted by trunk_mtu patch
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@46202 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-10-25 14:47:01 +00:00
Kevin P. Fleming 749029de38 Merged revisions 46200 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r46200 | kpfleming | 2006-10-25 09:32:08 -0500 (Wed, 25 Oct 2006) | 2 lines

apparently developers are still not aware that they should be use ast_copy_string instead of strncpy... fix up many more users, and fix some bugs in the process

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@46201 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-10-25 14:44:50 +00:00
Olle Johansson c30f1d12c5 Ok, second attempt...
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@46199 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-10-25 14:26:22 +00:00
Olle Johansson 25b8f577b8 On the other hand, don't use 1.4 patches for trunk... Sorry.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@46197 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-10-25 14:14:53 +00:00
Olle Johansson 13ea5fc0d0 Add ability to adapt the IAX trunk packets to the MTU size, to avoid bad audio
when the number of channels fill the MTU on a given link.

In the future, this needs to be configurable per peer with trunking enabled.



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@46195 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-10-25 14:06:13 +00:00
Kevin P. Fleming 88efcea05e Merged revisions 46154 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r46154 | kpfleming | 2006-10-24 19:26:17 -0500 (Tue, 24 Oct 2006) | 2 lines

add passthrough and file format support for G.722 16KHz audio (issue #5084, original patch by andrew, updated by mithraen)

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@46155 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-10-25 00:32:23 +00:00
Joshua Colp f41b2acc50 Merged revisions 46130 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r46130 | file | 2006-10-24 15:29:56 -0400 (Tue, 24 Oct 2006) | 2 lines

We need to initialize our scheduler pthread condition... yes.

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@46131 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-10-24 19:33:02 +00:00
Kevin P. Fleming 696f9ed677 Merged revisions 45408 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r45408 | kpfleming | 2006-10-17 17:24:10 -0500 (Tue, 17 Oct 2006) | 3 lines

optimize the 'quick response' code a bit more... no more malloc() or memset() for each response
expand stringfields API a bit to allow reusing the stringfield pool on a structure when needed, and remove some unnecessary code when the structure was being freed

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@45409 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-10-17 22:24:45 +00:00
Kevin P. Fleming 2194e57499 Merged revisions 45049 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

................
r45049 | kpfleming | 2006-10-13 11:19:35 -0500 (Fri, 13 Oct 2006) | 10 lines

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

........
r45048 | kpfleming | 2006-10-13 11:18:08 -0500 (Fri, 13 Oct 2006) | 2 lines

when sending a call to a peer, use the proper socket if we have multiple bindings (reported on asterisk-dev)

........

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@45050 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-10-13 16:20:26 +00:00
Joshua Colp 7b3665596f Merged revisions 44759 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r44759 | file | 2006-10-09 11:41:28 -0400 (Mon, 09 Oct 2006) | 2 lines

Properly avoid a collision with iax2_hangup (issue #8115 reported by vazir)

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@44762 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-10-09 15:49:45 +00:00
Kevin P. Fleming 3c876af5cf Merged revisions 44378 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r44378 | kpfleming | 2006-10-04 14:47:22 -0500 (Wed, 04 Oct 2006) | 4 lines

update thread creation code a bit
reduce standard thread stack size slightly to allow the pthreads library to allocate the stack+data and not overflow a power-of-2 allocation in the kernel and waste memory/address space
add a new stack size for 'background' threads (those that don't handle PBX calls) when LOW_MEMORY is defined

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@44379 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-10-04 19:51:38 +00:00
Matt O'Gorman ae8cc3e18b bug #8076 check option_debug before printing to debug channel.
patch provided in bugnote, with minor changes.


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@44253 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-10-03 15:53:07 +00:00
Mark Spencer 847fe77eb9 Don't use channel when you don't mean a channel
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@44147 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-10-02 02:38:52 +00:00
Joshua Colp 6c0391c42a One must remember to unlock their list... thanks to Qwell for letting me into his box
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@43961 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-09-29 01:36:26 +00:00
Joshua Colp 29d27bfe0d Merged revisions 43933 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r43933 | file | 2006-09-28 14:05:43 -0400 (Thu, 28 Sep 2006) | 2 lines

Put in missing \ns on the end of ast_logs (issue #7936 reported by wojtekka)

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@43934 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-09-28 18:09:01 +00:00
Joshua Colp 773e105d91 Merged revisions 43915 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r43915 | file | 2006-09-28 13:31:09 -0400 (Thu, 28 Sep 2006) | 2 lines

Make sure the pvt exists before accessing it again as it may have gone away (issue #7562 reported by Seb7 and issue #7939 reported by sorg)

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@43917 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-09-28 17:32:46 +00:00
Joshua Colp dad32d9d71 I *think* this is the last list in chan_iax2
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@43802 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-09-27 19:39:39 +00:00
Joshua Colp a5770f4e72 Merged revisions 43783 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r43783 | file | 2006-09-27 13:00:31 -0400 (Wed, 27 Sep 2006) | 2 lines

Get rid of two functions from a time now past (we THINK these are from pre-recursive lock time) that may be contributing to two open issues on the bug tracker (7562/7939) and that has the potential to just make bad things happen if the timing is right.

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@43792 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-09-27 17:02:28 +00:00
Joshua Colp 481265e347 Clean up code and convert last two things (firmware/dialplan cache) to linked list macros.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@43733 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-09-27 01:39:39 +00:00
Russell Bryant c8b90b75c9 Merged revisions 43553 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

................
r43553 | russell | 2006-09-24 09:53:35 -0400 (Sun, 24 Sep 2006) | 12 lines

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

........
r43552 | russell | 2006-09-24 09:50:30 -0400 (Sun, 24 Sep 2006) | 4 lines

Check to see if the channel that is activating the IAXPEER function is actually
an IAX2 channel before proceeding to process it to avoid crashing.
(issue #8017, reported by admott, fixed by myself)

........

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@43554 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-09-24 13:57:19 +00:00
Joshua Colp 323527b4f3 Oh look more changes, but these are my own! (Clean up module load functions)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@43461 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-09-21 22:53:17 +00:00
Tilghman Lesher 6ae8741518 Lots more removal of deprecated things
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@43452 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-09-21 21:59:12 +00:00
Tilghman Lesher 70af28270d Constify the result of a config retrieval function, to avoid mutilation (issue 7983).
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@43364 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-09-20 20:40:39 +00:00
Kevin P. Fleming fcb999c01c merge qwell's CLI verbification work
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@43212 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-09-18 19:54:18 +00:00
Kevin P. Fleming c2c4f86c72 merge markster's usersconf branch with some slight changes
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@43052 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-09-16 23:53:58 +00:00
Tilghman Lesher 72265ea79d Merged revisions 43019 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r43019 | tilghman | 2006-09-16 02:57:04 -0500 (Sat, 16 Sep 2006) | 2 lines

When a realtime peer expires, reset the ipaddress in the realtime database back to 0 (Issue 6656)

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@43024 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-09-16 08:10:55 +00:00
Joshua Colp e77c51f5c6 Merged revisions 42086 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r42086 | file | 2006-09-06 11:55:20 -0400 (Wed, 06 Sep 2006) | 2 lines

Make realtime regseconds work as people expected (0 on registration expiration or release, and actual on normal state) (issue #7684 reported by kshumard)

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@42087 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-09-06 15:58:21 +00:00
Matt O'Gorman 05a695af72 everything that loads a config that needs a config file to run
now reports AST_MODULE_LOAD_DECLINE when loading if config file
is not there, also fixed an error in res_config_pgsql where it 
had a non static function when it should.


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@41633 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-08-31 21:00:20 +00:00
Joshua Colp c6977b9983 Merge in VLDTMF support with Zaptel/Core done by the ever great Darumkilla Russell Bryant and the RTP portion done by myself, Muffinlicious Joshua Colp. This has gone through so many discussions/revisions it's not funny but we finally have it!
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@41507 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-08-31 01:59:02 +00:00
Joshua Colp 04bd8c54e8 Limit challenges to 9 digits in length
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@41280 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-08-29 20:53:27 +00:00
Russell Bryant f7e7161607 Merge team/russell/frame_caching
There are some situations in Asterisk where ast_frame and/or iax_frame
structures are rapidly allocatted and freed (at least 50 times per second
for one call).

This code significantly improves the performance of ast_frame_header_new(), 
ast_frdup(), ast_frfree(), iax_frame_new(), and iax_frame_free() by keeping
a thread-local cache of these structures and using frames from the cache 
whenever possible instead of calling malloc/free every time.

This commit also converts the ast_frame and iax_frame structures to use the
linked list macros.


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@41278 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-08-29 20:50:36 +00:00
Russell Bryant 9aabe41de3 don't seg fault when using dbsecret
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@41034 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-08-25 02:55:00 +00:00
Kevin P. Fleming 0a27d8bfe5 merge new_loader_completion branch, including (at least):
- restructured build tree and makefiles to eliminate recursion problems
  - support for embedded modules
  - support for static builds
  - simpler cross-compilation support
  - simpler module/loader interface (no exported symbols)



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@40722 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-08-21 02:11:39 +00:00
Russell Bryant 92bd7f19f7 Merge team/russell/ast_verbose_threadstorage
- instead of defining a free() wrapper in a bunch of files, define it as
  ast_free() in utils.h and remove the copies from all the files.

- centralize and abstract the code used for doing thread storage. The code
  lives in threadstorage.h, with one function being implemented in utils.c.
  This new API includes generic thread storage as well as special functions
  for handling thread local dynamic length string buffers.

- update ast_inet_ntoa() to use the new threadstorage API
- update ast_state2str() to use the new threadstorage API
- update ast_cli() to use the new threadstorage API

- Modify manager_event() to use thread storage. Instead of using a buffer of
  4096 characters as the workspace for building the manager event, use a thread
  local dynamic string.  Now there is no length limitation on the length of the
  body of a manager event.

- Significantly simplify the handling of ast_verbose() ...
  - Instead of using a static char buffer and a lock to make sure only one
    thread can be using ast_verbose() at a time, use a thread local dynamic
    string as the workspace for preparing the verbose message. Instead of
    locking around the entire function, the only locking done now is when the
    message has been built and is being deliviered to the list of registered
    verbose message handlers.
  - This function was doing a strdup() on every message passed to it and
    keeping a queue of the last 200 messages in memory. This has been
    completely removed. The only place this was used was that if there were
    any messages in the verbose queue when a verbose handler was registered,
    all of the messages in the queue would be fed to it.  So, I just made sure
    that the console verbose handler and the network verbose handler (for
    remote asterisk consoles) were registered before any verbose messages.
    pbx_gtkconsole and pbx_kdeconsole will now lose a few verbose messages at
    startup, but I didn't feel the performance hit of this message queue was
    worth saving the initial verbose output for these very rarely used modules.
  - I have removed the last three arguments to the verbose handlers, leaving
    only the string itself because they aren't needed anymore. For example,
    ast_verbose had some logic for telling the verbose handler to add
    a newline if the buffer was completely full. Now that the buffer can grow
    as needed, this doesn't matter anymore.
  - remove unused function, ast_verbose_dmesg() which was to dispatch the
    message queue
  - Convert the list of verbose handlers to use the linked list macros.

- add missing newline characters to a few ast_verbose() calls

- convert the list of log channels to use the linked list macros in logger.c

- fix close_logger() to close all of the files it opened for logging

- update ast_log() to use a thread local dynamic string for its workspace
  for preparing log messages instead of a buffer of size BUFSIZ (8kB on my
  system) allocated on the stack.  The dynamic string in this case is limited
  to only growing to a maximum size of BUFSIZ.


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@39272 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-08-08 06:32:04 +00:00
Steve Murphy 3042d0e046 This commit folds in changes to both stringfields (some enhancements to the ...field_set() macro, to optimize setting strings to empty, resetting strings to shorter contents, etc.) and to chan_iax2.c, to use stringfields in the user, peer, and pvt structs. Has been running stably on iaxtel, but while iaxtel has a large registration volume, it doesn't seem to have a high call volume. So far, it seems to reduce heap usage by over half. YMMV\! Please report any IAX bugs that might involve stringfields\!
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@39203 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-08-07 18:12:51 +00:00
Russell Bryant 663adb2b0e Merged revisions 38903-38904 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r38903 | russell | 2006-08-05 01:07:39 -0400 (Sat, 05 Aug 2006) | 2 lines

suppress a compiler warning about the usage of a potentially uninitialized variable

........
r38904 | russell | 2006-08-05 01:08:50 -0400 (Sat, 05 Aug 2006) | 10 lines

Fix an issue that would cause a NewCallerID manager event to be generated
before the channel's NewChannel event.  This was due to a somewhat recent
change that included using ast_set_callerid() where it wasn't before.  This
function should not be used in the channel driver "new" functions.
(issue #7654, fixed by me)

Also, fix a couple minor bugs in usecount handling.  chan_iax2 could have
increased the usecount but then returned an error.  The place where chan_sip
increased the usecount did not call ast_update_usecount()

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@38905 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-08-05 05:26:29 +00:00
Joshua Colp f41f7f8c93 It is better to hold a lock then not hold a lock when you are supposed to.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@38887 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-08-05 00:13:44 +00:00
Joshua Colp b64b636f7e Minor optimization but use a linkedlists.h macro that pops the head off the list instead of getting the first entry and then removing it.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@38871 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-08-04 23:17:40 +00:00
Russell Bryant 2842015aca Merged revisions 38328 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r38328 | russell | 2006-07-27 00:25:41 -0400 (Thu, 27 Jul 2006) | 4 lines

Fix crash when using the "regexten" option with MALLOC_DEBUG enabled.  This was
not reported in the bug tracker but the same bug has been demonstrated in other
places in the code.

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@38329 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-07-27 04:28:09 +00:00
Russell Bryant d897bd41c2 use ast_atomic_fetchadd_int in chan_zap, sip, and iax2 for usecount handling
and fix a couple little things in passing
 - usecnt was not initialized in chan_iax2
 - ast_update_use_count() was not called after incrementing the count in chan_sip


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@38077 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-07-22 00:33:56 +00:00
Russell Bryant ca9ba719b6 Merge a new implementation of ast_inet_ntoa, our thread safe replacement for
inet_ntoa, which uses thread specific data (aka thread local storage) instead
of stack allocatted buffers to store the result.


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@38042 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-07-21 17:31:28 +00:00
Kevin P. Fleming 6d0742fc16 merge Russell's 'hold_handling' branch, finally implementing music-on-hold handling the way it was decided at AstriDevCon Europe 2006 (and the way people really want it to be)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@37988 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-07-19 20:44:39 +00:00
Kevin P. Fleming 5aad4439e9 Merged revisions 37949 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r37949 | kpfleming | 2006-07-19 12:10:10 -0500 (Wed, 19 Jul 2006) | 2 lines

ensure that global 'maxauthreq' is reset to zero during 'reload'

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@37951 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-07-19 17:16:25 +00:00
North Antara 5df4228851 There was an issue with ADSI and iax2, where on an iaxy with a normal phone connected,
in vm_authenticate, it was try to start ADSI on the channel, and it WOULD because it
  was "supported", according to the iaxy.  There is now a config option (adsi=yes) for
  this, which defaults to no.  (config sample coming shortly)


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@37643 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-07-14 21:49:20 +00:00
Kevin P. Fleming ea1d0c4b33 G726-32 changes:
split support for G726-32 into RFC3551 and AAL2 packing orders, since both are in use
change "G726-32" to be RFC3551 packing order, in spite of devices that use AAL2 order with this MIME type
add ability to directly transcode between packing orders


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@37494 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-07-12 22:42:13 +00:00
Joshua Colp 5d9419304c Merged revisions 37439 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r37439 | file | 2006-07-12 11:23:59 -0400 (Wed, 12 Jul 2006) | 2 lines

Add support to have maxauthreq as a global option

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@37440 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-07-12 15:25:17 +00:00
Kevin P. Fleming 5b639e6135 Merged revisions 37419 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r37419 | kpfleming | 2006-07-12 08:54:10 -0500 (Wed, 12 Jul 2006) | 2 lines

remove some more bad examples of using printf

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@37433 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-07-12 14:04:16 +00:00
Joshua Colp ba092c1244 And now the trunk version! Add an option for IAX2 users that allows you to set how many outstanding AUTHREQs chan_iax2 will wait for replies on.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@37380 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-07-11 19:03:56 +00:00
Joshua Colp 022957ce03 Remove BRIDGE_OPTIMIZATION since it is deprecated or obsolete (take your pick)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@37346 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-07-10 19:39:47 +00:00
Russell Bryant 23a4d0be28 eliminate some pointer signedness warnings
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@37290 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-07-07 07:01:50 +00:00
Kevin P. Fleming f761d2f6f0 prepare Asterisk for new zaptel.h/tonezone.h installation locations
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@37027 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-07-05 16:44:41 +00:00
Russell Bryant 73e8e2ab1f Blocked revisions 36725 via svnmerge
........
r36725 | russell | 2006-07-03 00:19:09 -0400 (Mon, 03 Jul 2006) | 4 lines

use ast_set_callerid to be more consistent and to make sure that the
"callerid" option in the conf files is always handled the same way and sets ANI
(issue #7285, gkloepfer)

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@36726 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-07-03 04:25:21 +00:00
Kevin P. Fleming e61d3d91f3 The Eurostar Commit! (it's amazing how much work you can get done on a 150 minute train ride from Paris to London <G>)
support the new location for zaptel.h and tonezone.h
use the dependency information output by menuselect to build Makefile rules for each module for header files and libraries
combine the common rules into a top-level Makefile.rules file
remove all (now) unnecessary stuff from subdir Makefiles
change translator API so that the newpvt() callback returns an int instead of a pointer (it no longer allocates memory)
alphabetize --with-<foo> options in configure script
enhance Net-SNMP support in configure script to provide a --with-netsnmp option
fix support for --with-pq so that if pg-config is not found when --with-pq is specified, an error will be generated
add 'optional package' usage to modules now that menuselect can output it
allow res_snmp to build by default, since the new loader changes coming soon will solve the function naming problem (and users can disable it via menuselect anyway)


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@35832 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-06-24 19:43:31 +00:00
Russell Bryant 5e282fef07 reduce indentation
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@35628 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-06-23 02:03:21 +00:00
Russell Bryant 5941d4d819 - move the increase of the use count to be after the possible failures
- if the pbx fails to start, set the owner channel of the pvt strucutre
  to be NULL
- return immediately if the pbx fails to start so the loop to set all of
  the variables from the "setvar" options aren't set as a bunch of global
  variables instead


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@35554 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-06-22 17:10:16 +00:00
Joshua Colp 5ff818f995 Fix timing issue (race) with poke/pong for very close peers that can cause a peer to be declared unreachable (issue #7396 reported by stevedavies)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@35264 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-06-21 16:50:24 +00:00
Russell Bryant 035a8b4278 Merged revisions 34627 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r34627 | russell | 2006-06-18 16:15:15 -0400 (Sun, 18 Jun 2006) | 5 lines

don't store multiple secrets delimited with semicolons for peers because this
is only valid for users. Instead, only keep the last specified secret for a
peer entry. Also, document how multiple secrets are handled in the sample
config. (Reported by PCadach on #asterisk-bugs)

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@34628 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-06-18 20:18:41 +00:00
Joshua Colp 9ebb7c35a2 Merged revisions 34400 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r34400 | file | 2006-06-16 00:37:05 -0300 (Fri, 16 Jun 2006) | 2 lines

Zero out a declared structure so as to not crash if it contains invalid data (reported by Qwell on #asterisk-dev)

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@34401 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-06-16 03:38:24 +00:00
Kevin P. Fleming 11dac47877 Merged revisions 34159-34160 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r34159 | kpfleming | 2006-06-14 17:17:37 -0500 (Wed, 14 Jun 2006) | 2 lines

use existing dial string parser for strings supplied to iax2_devicestate, because they can be complete dial strings, not just device names

........
r34160 | kpfleming | 2006-06-14 17:22:21 -0500 (Wed, 14 Jun 2006) | 2 lines

coding style cleanups on queue interface handling code that was committed for the last release

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@34161 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-06-14 22:35:49 +00:00
Joshua Colp ce311227ac Change a bit of logic in peer expiry back to the way it used to be
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@33595 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-06-12 02:54:32 +00:00
Joshua Colp 6723184a62 Merged revisions 33297 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r33297 | file | 2006-06-09 15:26:42 -0300 (Fri, 09 Jun 2006) | 2 lines

Remove an unneeded double lock (issue #7310 reported by arkadia)

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@33298 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-06-09 18:29:58 +00:00
Joshua Colp 5349ae6f46 Wait until we have the lock before getting the pvt structure pointer (issue #7313 reported by arkadia)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@33296 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-06-09 18:20:28 +00:00
Kevin P. Fleming 472c1ca282 simplify autoconfig include mechanism (make tholo happy he can use lint again :-)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@32846 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-06-07 18:54:56 +00:00
Russell Bryant 66dca5e378 Merged revisions 32818 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r32818 | russell | 2006-06-07 13:53:21 -0400 (Wed, 07 Jun 2006) | 2 lines

fix some broken code with BRIDGE_OPTIMIZATION defined (issue #7292)

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@32819 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2006-06-07 17:54:26 +00:00