dect
/
asterisk
Archived
13
0
Fork 0
Commit Graph

811 Commits

Author SHA1 Message Date
jpeeler 62c01ac2d8 This adds DNS SRV record support to DNS manager. If there is a SRV record for a given domain, the hostname and port listed in the SRV record will be used. If no SRV record exists or a SRV lookup is not attempted, the DNS lookup on the specified domain will be performed as normal. Chan_sip has been modified to take advantage of the new SRV support.
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@112207 f38db490-d61c-443f-a65b-d21fe96a405b
2008-04-01 17:53:08 +00:00
file bd563876e1 Merged revisions 110628 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r110628 | file | 2008-03-25 11:37:35 -0300 (Tue, 25 Mar 2008) | 4 lines

Add an option (transmit_silence) which transmits silence during both Record() and DTMF generation. The reason this is an option is that in order to transmit silence we have to setup a translation path. This may not be needed/wanted in all cases.
(closes issue #10058)
Reported by: tracinet

........


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@111017 f38db490-d61c-443f-a65b-d21fe96a405b
2008-03-26 18:42:52 +00:00
russell d99cd74c61 Merged revisions 110614 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r110614 | russell | 2008-03-24 12:34:56 -0500 (Mon, 24 Mar 2008) | 2 lines

Turn a NOTICE into a DEBUG message.

........


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@110615 f38db490-d61c-443f-a65b-d21fe96a405b
2008-03-24 17:36:04 +00:00
russell 524e369bd5 Merged revisions 110336 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

................
r110336 | russell | 2008-03-20 16:54:58 -0500 (Thu, 20 Mar 2008) | 14 lines

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

........
r110335 | russell | 2008-03-20 16:53:27 -0500 (Thu, 20 Mar 2008) | 6 lines

Fix some very broken code that was introduced in 1.2.26 as a part of the security
fix.  The dnsmgr is not appropriate here.  The dnsmgr takes a pointer to an address
structure that a background thread continuously updates.  However, in these cases,
a stack variable was passed.  That means that the dnsmgr thread would be continuously
writing to bogus memory.

........

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


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@110337 f38db490-d61c-443f-a65b-d21fe96a405b
2008-03-20 21:55:50 +00:00
twilson 9e8ebe6a94 Go through and fix a bunch of places where character strings were being interpreted as format strings. Most of these changes are solely to make compiling with -Wsecurity and -Wformat=2 happy, and were not
actual problems, per se.  I also added format attributes to any printf wrapper functions I found that didn't have them.  -Wsecurity and -Wmissing-format-attribute added to --enable-dev-mode.


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@109447 f38db490-d61c-443f-a65b-d21fe96a405b
2008-03-18 15:43:34 +00:00
murf 2be361fbb9 (closes issue #6002)
Reported by: rizzo
Tested by: murf

Proposal of the changes to be made, and then an announcement of how they were accomplished:

http://lists.digium.com/pipermail/asterisk-dev/2008-February/032065.html

and:

http://lists.digium.com/pipermail/asterisk-dev/2008-March/032124.html

Here is a recap, file by file, of what I have done:

pbx/pbx_config.c
pbx/pbx_ael.c

All funcs that were passed a ptr to the context list, now will ALSO be passed a hashtab ptr to the same set.
Why? because (for the time being), the dialplan is stored in both, to facilitate a quick, low-cost move to
hash-tables to speed up dialplan processing. If it was deemed necessary to pass the context LIST, well, it
is just as necessary to have the TABLE available. This is because the list/table in question might not be
the global one, but temporary ones we would use to stage the dialplan on, and then swap into the global
position when things are ready.

We now have one external function for apps to use, "ast_context_find_or_create()" instead of the pre-existing
"find" and "create", as all existing usages used both in tandem anyway.

pbx_config, and pbx_ael, will stage the reloaded dialplan into local lists and tables, and 
then call merge_contexts_and_delete, which will merge (now) existing contexts and 
priorities from other registrars into this local set by copying them. Then, merge_contexts_and_delete will
lock down the contexts, swap the lists and tables, and unlock (real quick), and then 
destroy the old dialplan.



chan_sip.c
chan_iax.c
chan_skinny.c

All the channel drivers that would add regcontexts now use the ast_context_find_or_create now.

chan_sip also includes a small fix to get rid of warnings about removing priorities that never got entered.


apps/app_meetme.c
apps/app_dial.c
apps/app_queue.c

All the apps that added a context/exten/priority were also modified to use ast_context_find_or_create instead.


include/asterisk/pbx.h

ast_context_create() is removed. Find_or_create_ is the new method.
ast_context_find_or_create()  interface gets the hashtab added.
ast_merge_contexts_and_delete() gets the local hashtab arg added.
ast_wrlock_contexts_version() is added so you can detect if someone else got a writelock between your readlocking and writelocking.
ast_hashtab_compare_contexts was made public for use in pbx_config/pbx_ael
ast_hashtab_hash_contexts was in like fashion make public.


include/asterisk/pval.h

ast_compile_ael2() interface changed to include the local hashtab table ptr.


main/features.c

For the sake of the parking context, we use ast_context_find_or_create().



main/pbx.c

I changed all the "tree" names to "table" instead. That's because the original
implementation was based on binary trees. (had a free library). Then I moved
to hashtabs. Now, the names move forward too.

refcount field added to contexts, so you can keep track of how many modules
wanted this context to exist.

Some log messages that are warnings were inflated from LOG_NOTICE to LOG_WARNING.

Added some calls to ast_verb(3,...) for debug messages

Lots of little mods to ast_context_remove_extension2, which is now excersized in ways
it was not previously; one definite bug fixed.

find_or_create was upgraded to handle both local lists/tables as well as the globals.

context_merge() was added to do the per-context merging of the old/present contexts/extens/prios into the new/proposed local list/tables

ast_merge_contexts_and_delete() was heavily modified.

ast_add_extension2() was also upgraded to handle changes. 

the context_destroy() code was re-engineered to handle the new way of doing things,
by exten/prio instead of by context.



res/ael/pval.c
res/ael/ael.tab.c
res/ael/ael.tab.h
res/ael/ael.y
res/ael/ael_lex.c
res/ael/ael.flex
utils/ael_main.c
utils/extconf.c
utils/conf2ael.c
utils/Makefile

Had to change the interface to ast_compile_ael2(), to include the hashtab ptr.
This ended up involving several external apps.  The main gotcha was I had to 
include lock.h and hashtab.h in several places.


As a side note, I tested this stuff pretty thoroughly, I replicated the problems
originally reported by Luigi, and made triply sure that reloads worked, and everything
worked thru "stop gracefully". I found a and fixed a few bugs as I was merging into
trunk, that did not appear in my tests of bug6002.

How's this for verbose commit messages?




git-svn-id: http://svn.digium.com/svn/asterisk/trunk@106757 f38db490-d61c-443f-a65b-d21fe96a405b
2008-03-07 18:57:57 +00:00
russell 24c93cfe56 Merged revisions 106237 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r106237 | russell | 2008-03-05 16:37:09 -0600 (Wed, 05 Mar 2008) | 3 lines

Fix a potential deadlock and a few different potential crashes.
(closes issue #12145, reported by thiagarcia, patched by me)

........


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@106238 f38db490-d61c-443f-a65b-d21fe96a405b
2008-03-05 22:40:58 +00:00
file 24d57f9eb0 Instead of outputting a verbose message every so often let's make it a debug message.
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@104089 f38db490-d61c-443f-a65b-d21fe96a405b
2008-02-25 19:02:33 +00:00
oej e0fe5f0b64 - No space in manager event names, please
- Add new event to CHANGES


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@103755 f38db490-d61c-443f-a65b-d21fe96a405b
2008-02-18 10:10:35 +00:00
russell 527da29a25 Merged revisions 103741 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r103741 | russell | 2008-02-15 17:31:39 -0600 (Fri, 15 Feb 2008) | 8 lines

Fix a crash in chan_iax2 due to a race condition

(closes issue #11780)
Reported by: guillecabeza
Patches: 
      bug_iax2_jb_1.4.patch uploaded by guillecabeza (license 380)
      bug_iax2_jb_trunk.patch uploaded by guillecabeza (license 380)

........


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@103742 f38db490-d61c-443f-a65b-d21fe96a405b
2008-02-15 23:32:18 +00:00
qwell 339bee10d3 Add periodic jitter stats to CLI and manager.
(closes issue #8188)
Reported by: stevedavies
Patches:
      jblogging-trunk.patch uploaded by stevedavies
      jblogging-trunk_wmgrevent.patch uploaded by johann8384
      updated_jbloggin-trunk_mgrevent.patch uploaded by johann8384 (license 190)
      (with additional changes by me)
Tested by: stevedavies, johann8384


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@103677 f38db490-d61c-443f-a65b-d21fe96a405b
2008-02-14 18:39:51 +00:00
file 5dfa4987a0 Add support for allowing a native bridge to happen when the L option is enabled. The RTP bridging could already handle this, it just needed to be enabled in the main bridging code.
(issue #10647)
Reported by: samdell3


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@103314 f38db490-d61c-443f-a65b-d21fe96a405b
2008-02-11 16:17:15 +00:00
russell e9d6c2ff9b Merge changes from team/mvanbaak/cli-command-audit
(closes issue #8925)

About a year ago, as Leif Madsen and Jim van Meggelen were going over the CLI
commands in Asterisk 1.4 for the next version of their book, they documented
a lot of inconsistencies.  This set of changes addresses all of these issues
and has been reviewed by Leif.

While this does introduce even more changes to the CLI command structure, it
makes everything consistent, which is the most important thing.

Thanks to all that helped with this one!


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@103171 f38db490-d61c-443f-a65b-d21fe96a405b
2008-02-08 21:26:32 +00:00
mmichelson bbdabecaff Merged revisions 103070 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r103070 | mmichelson | 2008-02-08 12:00:38 -0600 (Fri, 08 Feb 2008) | 6 lines

Yield the thread and return -1 if the ioctl fails for Zaptel timing device.

(closes issue #11891)
Reported by: tzafrir


........


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@103071 f38db490-d61c-443f-a65b-d21fe96a405b
2008-02-08 18:02:48 +00:00
file 0f0be1e000 Merged revisions 102968 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r102968 | file | 2008-02-08 11:08:20 -0400 (Fri, 08 Feb 2008) | 4 lines

Make sure the presence of dbsecret is factored into user scoring.
(closes issue #11952)
Reported by: bbhoss

........


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@102969 f38db490-d61c-443f-a65b-d21fe96a405b
2008-02-08 15:09:47 +00:00
russell d85ca9b20a Merged revisions 101693 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r101693 | russell | 2008-01-31 18:32:49 -0600 (Thu, 31 Jan 2008) | 8 lines

Add some more sanity checking on IAX2 dial strings for the case that no peer
or hostname was provided, which is the one part of the dial string that is
absolutely required.  If it's not there, bail out.

(closes issue #11897)
Reported by sokhapkin
Patch by me

........


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@101694 f38db490-d61c-443f-a65b-d21fe96a405b
2008-02-01 00:34:11 +00:00
qwell 427a0d5d52 Merged revisions 101482 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r101482 | qwell | 2008-01-31 13:52:49 -0600 (Thu, 31 Jan 2008) | 4 lines

Solaris compat fixes for struct in_addr funkiness.

Issue #11885, patch by snuffy.

........


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@101483 f38db490-d61c-443f-a65b-d21fe96a405b
2008-01-31 19:54:46 +00:00
tilghman 7080e02848 With the switch to the ast_sched_replace* API in trunk, we lose the correction
that was just merged from 1.4, so this is a changeover to those APIs to use the
macro versions, so that we properly detect errors from ast_sched_del, instead
of simply ignoring the return values.


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@100497 f38db490-d61c-443f-a65b-d21fe96a405b
2008-01-27 23:14:48 +00:00
tilghman c83caa1ae0 Merged revisions 100465 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r100465 | tilghman | 2008-01-27 15:59:53 -0600 (Sun, 27 Jan 2008) | 11 lines

When deleting a task from the scheduler, ignoring the return value could
possibly cause memory to be accessed after it is freed, which causes all
sorts of random memory corruption.  Instead, if a deletion fails, wait a
bit and try again (noting that another thread could change our taskid
value).
(closes issue #11386)
 Reported by: flujan
 Patches: 
       20080124__bug11386.diff.txt uploaded by Corydon76 (license 14)
 Tested by: Corydon76, flujan, stuarth`

........


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@100488 f38db490-d61c-443f-a65b-d21fe96a405b
2008-01-27 22:35:29 +00:00
file c73a78b57a Remove dependency on res_features from some channel drivers. It is now part of the core and no longer exists as a module.
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@100112 f38db490-d61c-443f-a65b-d21fe96a405b
2008-01-24 15:54:32 +00:00
russell 00e3ed0886 Merged revisions 99004 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r99004 | russell | 2008-01-17 16:37:22 -0600 (Thu, 17 Jan 2008) | 10 lines

Have IAX2 optimize the codec translation path just like chan_sip does it.  If
the caller's codec is in our codec list, move it to the top to avoid transcoding.

(closes issue #10500)
Reported by: stevedavies
Patches:
      iax-prefer-current-codec.patch uploaded by stevedavies (license 184)
      iax-prefer-current-codec.1.4.patch uploaded by stevedavies (license 184)
Tested by: stevedavies, pj, sheldonh

........


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@99006 f38db490-d61c-443f-a65b-d21fe96a405b
2008-01-17 22:50:13 +00:00
file 42fd1fbde6 Merged revisions 98966 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r98966 | file | 2008-01-16 13:50:10 -0400 (Wed, 16 Jan 2008) | 6 lines

Add missing NULLs at end of two ast_load_realtimes.
(closes issue #11769)
Reported by: tequ
Patches:
      chaniax.patch uploaded by dimas (license 88)

........


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@98967 f38db490-d61c-443f-a65b-d21fe96a405b
2008-01-16 17:51:52 +00:00
russell b61a98675c Merged revisions 98943 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r98943 | russell | 2008-01-15 17:26:52 -0600 (Tue, 15 Jan 2008) | 25 lines

Commit a fix for some memory access errors pointed out by the valgrind2.txt
output on issue #11698.

The issue here is that it is possible for an instance of a translator to get
destroyed while the frame allocated as a part of the translator is still being
processed.  Specifically, this is possible anywhere between a call to ast_read()
and ast_frame_free(), which is _a lot_ of places in the code.  The reason this
happens is that the channel might get masqueraded during this time.  During a
masquerade, existing translation paths get destroyed.

So, this patch fixes the issue in an API and ABI compatible way.  (This one is
 for you, paravoid!)

It changes an int in ast_frame to be used as flag bits.  The 1 bit is still used
to indicate that the frame contains timing information.  Also, a second flag has
been added to indicate that the frame came from a translator.  When a frame with
this flag gets released and has this flag, a function is called in translate.c to
let it know that this frame is doing being processed.  At this point, the flag gets
cleared.  Also, if the translator was requested to be destroyed while its internal
frame still had this flag set, its destruction has been deffered until it finds out
that the frame is no longer being processed.

Admittedly, this feels like a hack.  But, it does fix the issue, and I was not able 
to think of a better solution ...

........


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@98944 f38db490-d61c-443f-a65b-d21fe96a405b
2008-01-15 23:31:53 +00:00
tilghman 40a3aabbf1 Several manager changes:
1) Add the Dialplan class, for NewExten and VarSet events, which should cut
down on the volume of traffic in the Call class.
2) Permit some commands to be run from multiple classes, such as allowing
DBGet to be run from either the System or the Reporting class.
3) Heavily document each class in the sample config, as there were several
that made no sense to be in the write= line, and two that made no sense to be
in the read= line (since they controlled no permissions there).

(Closes issue #10386)


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@97651 f38db490-d61c-443f-a65b-d21fe96a405b
2008-01-10 00:12:35 +00:00
russell ae4bf302a4 Merged revisions 96394 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r96394 | russell | 2008-01-03 16:44:22 -0600 (Thu, 03 Jan 2008) | 3 lines

Don't crash if the iax2 pvt structure has been destroyed before we get to this point
(closes issue #11672, reported by snuffy, patched by me)

........


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@96395 f38db490-d61c-443f-a65b-d21fe96a405b
2008-01-03 22:46:37 +00:00
russell 2476ab62b5 Fix a bug in peer handling that caused multiple instances of a peer to end up
in the peers container after a reload.  Somehow, this bug doesn't exist in 1.4 ...
(closes issue #11626)
(reported by pnlarsson, additional info from mvanbaak, fixed by me)


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@94788 f38db490-d61c-443f-a65b-d21fe96a405b
2007-12-26 16:51:16 +00:00
russell 6ac2823852 Merged revisions 94256 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

................
r94256 | russell | 2007-12-20 14:22:22 -0600 (Thu, 20 Dec 2007) | 13 lines

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

........
r94255 | russell | 2007-12-20 14:21:41 -0600 (Thu, 20 Dec 2007) | 5 lines

Fix another potential seg fault ...

(closes issue #11606)
Reported by: dimas

........

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


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@94257 f38db490-d61c-443f-a65b-d21fe96a405b
2007-12-20 20:25:05 +00:00
tilghman a64536a800 Merged revisions 93949 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r93949 | tilghman | 2007-12-19 11:04:13 -0600 (Wed, 19 Dec 2007) | 3 lines

Avoid segfault in chan_iax when peer isn't defined
(Closes issue #11602)

........


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@93952 f38db490-d61c-443f-a65b-d21fe96a405b
2007-12-19 17:13:06 +00:00
tilghman 829520df6b Merged revisions 93668 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

................
r93668 | tilghman | 2007-12-18 12:29:39 -0600 (Tue, 18 Dec 2007) | 10 lines

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

........
r93667 | tilghman | 2007-12-18 12:23:06 -0600 (Tue, 18 Dec 2007) | 2 lines

Fixing AST-2007-027 (Closes issue #11119)

........

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


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@93672 f38db490-d61c-443f-a65b-d21fe96a405b
2007-12-18 18:39:25 +00:00
rizzo 659205253c remove unnecessary (char *) casts for ast_config_AST_* variables.
There are some left in the .flex files, left to the maintainer...



git-svn-id: http://svn.digium.com/svn/asterisk/trunk@93582 f38db490-d61c-443f-a65b-d21fe96a405b
2007-12-18 09:46:18 +00:00
oej 005b4c4aa2 Merged revisions 93182 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r93182 | oej | 2007-12-17 08:15:13 +0100 (MÃ¥n, 17 Dec 2007) | 8 lines

Issue 11574: Add dependencies on res_monitor and res_features. 

I wonder if Asterisk can run at all without res_features. My guess is that 
there's propably a lot of more modules and the core that depends on it.

Reported by: caio1982
(closes issue #11574)

........


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@93335 f38db490-d61c-443f-a65b-d21fe96a405b
2007-12-17 21:12:24 +00:00
oej b9b03966fb HUGE improvements to QoS/CoS handling by IgorG
- Refer to the proper documentation
- Implement separate signalling/media QoS/CoS in many channels using RTP
- Improve warnings and verbose messages
- Deprecate some old settings

Minor modifications by me, a big effort from IgorG.
Thanks!


Reported by: IgorG
Patches: 
      qoscleanup-89394-4-trunk.patch uploaded by IgorG (license 20)
Tested by: IgorG
(closes issue #11145)


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@93163 f38db490-d61c-443f-a65b-d21fe96a405b
2007-12-16 10:51:53 +00:00
russell 6132c7f541 Revert an "optimization" that I added in revision 89887, as the user who reported
issue #11449 has demonstrated that it actually was a performance hit on his
machine.  I think that it is possible that it could still be a benefit on systems
under higher load, especially SMP systems, but I don't have enough time or interest
to find out at the moment.
(closes issue #11449)


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@92676 f38db490-d61c-443f-a65b-d21fe96a405b
2007-12-12 23:44:26 +00:00
russell 7cfa10f05b Merged revisions 90348 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r90348 | russell | 2007-11-30 13:26:04 -0600 (Fri, 30 Nov 2007) | 8 lines

Change the behavior of ao2_link().  Previously, in inherited a reference.
Now, it automatically increases the reference count to reflect the reference
that is now held by the container.

This was done to be more consistent with ao2_unlink(), which automatically
releases the reference held by the container.  It also makes it so it is
no longer possible for a pointer to be invalid after ao2_link() returns.

........


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@90351 f38db490-d61c-443f-a65b-d21fe96a405b
2007-11-30 19:34:47 +00:00
russell f296356f7c Merge changes from team/russell/iax2_frame_queue
This patch is an optimization for chan_iax2.  This module is now heavily
multi-threaded.  However, there is still a good number of globally shared
resources that prevent things from happen asynchronously.  One of those things
was the global IAX frame queue.  This queue was used to hold frames that have
been deferred for transmitting by another thread, and frames that may need to
get retransmitted.

I changed the frame queue to be per-call, since almost all of the frame queue
handling only cares about frames specific to a call number.


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@89887 f38db490-d61c-443f-a65b-d21fe96a405b
2007-11-27 23:50:25 +00:00
oej 0e7bb9934a More additions from the "moremanager" branch, this time for IAX2.
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@89769 f38db490-d61c-443f-a65b-d21fe96a405b
2007-11-27 20:36:59 +00:00
murf b6e2980dd6 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: http://svn.digium.com/svn/asterisk/trunk@89513 f38db490-d61c-443f-a65b-d21fe96a405b
2007-11-21 23:54:12 +00:00
rizzo 150b2c22ef remove another set of redundant #include "asterisk/options.h"
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@89512 f38db490-d61c-443f-a65b-d21fe96a405b
2007-11-21 23:24:55 +00:00
russell ef4c533d63 fix a small gramatical error in a comment
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@89488 f38db490-d61c-443f-a65b-d21fe96a405b
2007-11-21 18:24:23 +00:00
rizzo 89d8d78652 move asterisk/paths.h outside asterisk.h and into those files
who really need it.



git-svn-id: http://svn.digium.com/svn/asterisk/trunk@89466 f38db490-d61c-443f-a65b-d21fe96a405b
2007-11-20 23:16:15 +00:00
rizzo 9cf442d7f7 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: http://svn.digium.com/svn/asterisk/trunk@89424 f38db490-d61c-443f-a65b-d21fe96a405b
2007-11-19 18:52:04 +00:00
rizzo 883346d64a 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: http://svn.digium.com/svn/asterisk/trunk@89333 f38db490-d61c-443f-a65b-d21fe96a405b
2007-11-16 20:04:58 +00:00
tilghman 39031cce82 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: http://svn.digium.com/svn/asterisk/trunk@89299 f38db490-d61c-443f-a65b-d21fe96a405b
2007-11-15 18:11:36 +00:00
rizzo ea0d4674a6 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: http://svn.digium.com/svn/asterisk/trunk@89268 f38db490-d61c-443f-a65b-d21fe96a405b
2007-11-14 13:18:40 +00:00
kpfleming a45a413db3 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: http://svn.digium.com/svn/asterisk/trunk@89106 f38db490-d61c-443f-a65b-d21fe96a405b
2007-11-08 05:28:47 +00:00
rizzo 5c6adf7951 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: http://svn.digium.com/svn/asterisk/trunk@88454 f38db490-d61c-443f-a65b-d21fe96a405b
2007-11-04 19:44:31 +00:00
tilghman 97e8364d35 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: http://svn.digium.com/svn/asterisk/trunk@88008 f38db490-d61c-443f-a65b-d21fe96a405b
2007-11-01 06:07:18 +00:00
russell caf1740be6 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: http://svn.digium.com/svn/asterisk/trunk@87687 f38db490-d61c-443f-a65b-d21fe96a405b
2007-10-30 21:22:48 +00:00
qwell 7756b987a0 Switch from AST_CLI (formerly NEW_CLI) to AST_CLI_DEFINE, since the former didn't make much sense
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@86820 f38db490-d61c-443f-a65b-d21fe96a405b
2007-10-22 20:05:18 +00:00
qwell d542122e6a Convert NEW_CLI to AST_CLI.
Closes issue #11039, as suggested by seanbright.


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@86536 f38db490-d61c-443f-a65b-d21fe96a405b
2007-10-19 18:29:40 +00:00
qwell 4723d35127 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: http://svn.digium.com/svn/asterisk/trunk@86534 f38db490-d61c-443f-a65b-d21fe96a405b
2007-10-19 18:01:00 +00:00
qwell 1fa7b3672e Switch dundi to new tos config format.
Remove old unused defines for old style.

Closes issue 10860, patch by IgorG.


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@85764 f38db490-d61c-443f-a65b-d21fe96a405b
2007-10-15 23:20:40 +00:00
russell dac373f539 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: http://svn.digium.com/svn/asterisk/trunk@84173 f38db490-d61c-443f-a65b-d21fe96a405b
2007-10-01 15:23:19 +00:00
russell 16927b7f7a 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: http://svn.digium.com/svn/asterisk/trunk@83433 f38db490-d61c-443f-a65b-d21fe96a405b
2007-09-21 14:40:10 +00:00
russell 2085f312d9 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: http://svn.digium.com/svn/asterisk/trunk@83176 f38db490-d61c-443f-a65b-d21fe96a405b
2007-09-19 19:14:58 +00:00
russell b9f37c0e99 convert various places that access the channel lock directly to use the channel lock wrappers
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@82728 f38db490-d61c-443f-a65b-d21fe96a405b
2007-09-17 22:59:36 +00:00
russell eb015e768e 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: http://svn.digium.com/svn/asterisk/trunk@82628 f38db490-d61c-443f-a65b-d21fe96a405b
2007-09-17 18:57:56 +00:00
qwell 8dc057da35 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: http://svn.digium.com/svn/asterisk/trunk@82294 f38db490-d61c-443f-a65b-d21fe96a405b
2007-09-12 21:55:32 +00:00
tilghman 73f2a87637 Change the IAXPeers command to have manager-style output, instead of CLI-style output (closes issue #8254)
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@82200 f38db490-d61c-443f-a65b-d21fe96a405b
2007-09-10 20:03:51 +00:00
russell 3ed525cd1d 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: http://svn.digium.com/svn/asterisk/trunk@81449 f38db490-d61c-443f-a65b-d21fe96a405b
2007-09-04 18:40:07 +00:00
file 441c634d0e 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: http://svn.digium.com/svn/asterisk/trunk@81440 f38db490-d61c-443f-a65b-d21fe96a405b
2007-09-04 14:25:21 +00:00
russell 94c9b774b9 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: http://svn.digium.com/svn/asterisk/trunk@81434 f38db490-d61c-443f-a65b-d21fe96a405b
2007-09-03 18:59:08 +00:00
murf 88e10708c5 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: http://svn.digium.com/svn/asterisk/trunk@81361 f38db490-d61c-443f-a65b-d21fe96a405b
2007-08-29 20:55:40 +00:00
tilghman 5e59de4853 Changed one too many variable settings in issue #9315 (closes issue #10592)
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@81335 f38db490-d61c-443f-a65b-d21fe96a405b
2007-08-29 15:21:10 +00:00
russell 9a0a44d4b0 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: http://svn.digium.com/svn/asterisk/trunk@81292 f38db490-d61c-443f-a65b-d21fe96a405b
2007-08-28 21:39:36 +00:00
russell 2397e363d1 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: http://svn.digium.com/svn/asterisk/trunk@80933 f38db490-d61c-443f-a65b-d21fe96a405b
2007-08-26 18:12:58 +00:00
russell 2183a8268c 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: http://svn.digium.com/svn/asterisk/trunk@80898 f38db490-d61c-443f-a65b-d21fe96a405b
2007-08-25 17:55:45 +00:00
russell a0f7d738db 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: http://svn.digium.com/svn/asterisk/trunk@80850 f38db490-d61c-443f-a65b-d21fe96a405b
2007-08-24 21:23:14 +00:00
russell 96b0dde6d9 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: http://svn.digium.com/svn/asterisk/trunk@80500 f38db490-d61c-443f-a65b-d21fe96a405b
2007-08-23 17:04:04 +00:00
russell c5747a3589 allow peers and users to go into a hash table
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@80408 f38db490-d61c-443f-a65b-d21fe96a405b
2007-08-22 21:35:08 +00:00
russell 4a6f77fa79 Unsubscribe from MWI events in the peer destructor
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@80388 f38db490-d61c-443f-a65b-d21fe96a405b
2007-08-22 20:46:16 +00:00
russell 72b013760e 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: http://svn.digium.com/svn/asterisk/trunk@80387 f38db490-d61c-443f-a65b-d21fe96a405b
2007-08-22 20:44:23 +00:00
file 4e358ef926 (closes issue #10495)
Reported by: stevedavies
Make sure context pointer is valid or else chan_iax2 will go kaboom.


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@79990 f38db490-d61c-443f-a65b-d21fe96a405b
2007-08-20 00:54:19 +00:00
tilghman 9d218d354a We weren't properly encapsulating the mtime ignores of config files (closes issue #10488)
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@79940 f38db490-d61c-443f-a65b-d21fe96a405b
2007-08-18 13:52:44 +00:00
russell 907112a201 Make use of ast_sched_replace() in some places in chan_iax2
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@79862 f38db490-d61c-443f-a65b-d21fe96a405b
2007-08-17 14:14:59 +00:00
russell b23ebc68ce 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: http://svn.digium.com/svn/asterisk/trunk@79764 f38db490-d61c-443f-a65b-d21fe96a405b
2007-08-16 21:33:38 +00:00
tilghman dbec3d56c1 Don't reload a configuration file if nothing has changed.
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@79747 f38db490-d61c-443f-a65b-d21fe96a405b
2007-08-16 21:09:46 +00:00
dhubbard f31085f99c added counter for iax2 show registry CLI output, closes issue 10461, thanks junky
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@79725 f38db490-d61c-443f-a65b-d21fe96a405b
2007-08-16 18:23:39 +00:00
russell 600ef2b1ef 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: http://svn.digium.com/svn/asterisk/trunk@79471 f38db490-d61c-443f-a65b-d21fe96a405b
2007-08-14 18:50:12 +00:00
russell 6805b4f295 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: http://svn.digium.com/svn/asterisk/trunk@79437 f38db490-d61c-443f-a65b-d21fe96a405b
2007-08-14 17:33:12 +00:00
russell f8f162f4c7 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: http://svn.digium.com/svn/asterisk/trunk@79306 f38db490-d61c-443f-a65b-d21fe96a405b
2007-08-13 20:40:47 +00:00
russell 791fc1faf7 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: http://svn.digium.com/svn/asterisk/trunk@79277 f38db490-d61c-443f-a65b-d21fe96a405b
2007-08-13 20:20:43 +00:00
russell d2622ed6e6 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: http://svn.digium.com/svn/asterisk/trunk@79275 f38db490-d61c-443f-a65b-d21fe96a405b
2007-08-13 20:06:19 +00:00
russell 633a42b7b5 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: http://svn.digium.com/svn/asterisk/trunk@79273 f38db490-d61c-443f-a65b-d21fe96a405b
2007-08-13 19:29:30 +00:00
russell 67e6033b80 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: http://svn.digium.com/svn/asterisk/trunk@79222 f38db490-d61c-443f-a65b-d21fe96a405b
2007-08-13 15:32:05 +00:00
file 2ca342ce99 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: http://svn.digium.com/svn/asterisk/trunk@79175 f38db490-d61c-443f-a65b-d21fe96a405b
2007-08-13 14:22:46 +00:00
russell 5448fa9f9e 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: http://svn.digium.com/svn/asterisk/trunk@78747 f38db490-d61c-443f-a65b-d21fe96a405b
2007-08-09 17:07:36 +00:00
file ef6eae917d Correct spelling. s/threaads/threads/
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@78637 f38db490-d61c-443f-a65b-d21fe96a405b
2007-08-08 19:03:46 +00:00
russell 858fd60436 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: http://svn.digium.com/svn/asterisk/trunk@78243 f38db490-d61c-443f-a65b-d21fe96a405b
2007-08-06 20:45:09 +00:00
russell dbb9124503 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: http://svn.digium.com/svn/asterisk/trunk@78064 f38db490-d61c-443f-a65b-d21fe96a405b
2007-08-03 17:02:00 +00:00
russell 997720dcb5 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: http://svn.digium.com/svn/asterisk/trunk@78029 f38db490-d61c-443f-a65b-d21fe96a405b
2007-08-03 02:05:02 +00:00
russell ec5c90ad63 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: http://svn.digium.com/svn/asterisk/trunk@77950 f38db490-d61c-443f-a65b-d21fe96a405b
2007-08-02 19:26:12 +00:00
russell 4c19db0577 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: http://svn.digium.com/svn/asterisk/trunk@77944 f38db490-d61c-443f-a65b-d21fe96a405b
2007-08-02 18:05:23 +00:00
russell 0a070184a3 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: http://svn.digium.com/svn/asterisk/trunk@77941 f38db490-d61c-443f-a65b-d21fe96a405b
2007-08-02 17:09:42 +00:00
russell 593e2c31da 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: http://svn.digium.com/svn/asterisk/trunk@77940 f38db490-d61c-443f-a65b-d21fe96a405b
2007-08-02 16:58:26 +00:00
russell 37f2a147df 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: http://svn.digium.com/svn/asterisk/trunk@77889 f38db490-d61c-443f-a65b-d21fe96a405b
2007-08-01 22:24:23 +00:00
file b758097d02 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: http://svn.digium.com/svn/asterisk/trunk@77870 f38db490-d61c-443f-a65b-d21fe96a405b
2007-08-01 18:01:33 +00:00
russell b6354a43bb Change another unnecessary use of the increment operator to explicitly set the var to 1
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@77800 f38db490-d61c-443f-a65b-d21fe96a405b
2007-07-30 20:36:18 +00:00
russell c3341e57b8 Explicitly set a variable to 1 instead of using the increment operator.
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@77799 f38db490-d61c-443f-a65b-d21fe96a405b
2007-07-30 20:33:44 +00:00
russell 9a90df4ba7 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: http://svn.digium.com/svn/asterisk/trunk@77797 f38db490-d61c-443f-a65b-d21fe96a405b
2007-07-30 20:21:05 +00:00