Commit Graph

169 Commits

Author SHA1 Message Date
Terry Wilson 34c55e8e7c Opaquify char * and char[] in ast_channel
Review: https://reviewboard.asterisk.org/r/1733/


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@354968 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-02-13 17:27:06 +00:00
Walter Doekes db24fc2523 Avoid cppcheck warnings; removing unused vars and a bit of cleanup.
Patch by: Clod Patry
Review: https://reviewboard.asterisk.org/r/1651


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@354429 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-02-08 20:49:48 +00:00
Richard Mudgett 27b69e7d29 Audit of ao2_iterator_init() usage for v1.8.
Fixes numerous reference leaks and missing ao2_iterator_destroy() calls as
a result.

Review: https://reviewboard.asterisk.org/r/1697/
........

Merged revisions 352955 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........

Merged revisions 352956 from http://svn.asterisk.org/svn/asterisk/branches/10


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@352957 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-01-27 18:47:16 +00:00
Terry Wilson 99cae5b750 Opaquify channel stringfields
Continue channel opaque-ification by wrapping all of the stringfields.
Eventually, we will restrict what can actually set these variables, but
the purpose for now is to hide the implementation and keep people from
adding code that directly accesses the channel structure. Semantic
changes will follow afterward.

Review: https://reviewboard.asterisk.org/r/1661/


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@352348 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-01-24 20:12:09 +00:00
Terry Wilson 04da92c379 Replace direct access to channel name with accessor functions
There are many benefits to making the ast_channel an opaque handle, from
increasing maintainability to presenting ways to kill masquerades. This patch
kicks things off by taking things a field at a time, renaming the field to
'__do_not_use_${fieldname}' and then writing setters/getters and converting the
existing code to using them. When all fields are done, we can move ast_channel
to a C file from channel.h and lop off the '__do_not_use_'.

This patch sets up main/channel_interal_api.c to be the only file that actually
accesses the ast_channel's fields directly. The intent would be for any API
functions in channel.c to use the accessor functions. No more monkeying around
with channel internals. We should use our own APIs.

The interesting changes in this patch are the addition of
channel_internal_api.c, the moving of the AST_DATA stuff from channel.c to
channel_internal_api.c (note: the AST_DATA stuff will have to be reworked to
use accessor functions when ast_channel is really opaque), and some re-working
of the way channel iterators/callbacks are handled so as to avoid creating fake
ast_channels on the stack to pass in matching data by directly accessing fields
(since "name" is a stringfield and the fake channel doesn't init the
stringfields, you can't use the ast_channel_name_set() function). I went with
ast_channel_name(chan) for a getter, and ast_channel_name_set(chan, name) for a
setter.

The majority of the grunt-work for this change was done by writing a semantic
patch using Coccinelle ( http://coccinelle.lip6.fr/ ).

Review: https://reviewboard.asterisk.org/r/1655/


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@350223 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-01-09 22:15:50 +00:00
Sean Bright 35a64c2e61 Merged revisions 349045 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/10

................
  r349045 | seanbright | 2011-12-23 12:32:33 -0500 (Fri, 23 Dec 2011) | 25 lines
  
  Merged revisions 349044 via svnmerge from 
  https://origsvn.digium.com/svn/asterisk/branches/1.8
  
  ........
    r349044 | seanbright | 2011-12-23 12:25:01 -0500 (Fri, 23 Dec 2011) | 18 lines
    
    In ChanSpy, don't create audiohooks that will never be used.
    
    When ChanSpy is initialized it creates and attaches 3 audiohooks:
    
      1) Read audio off of the channel that we are spying on
      2) Write audio to the channel that we are spying on
      3) Write audio to the channel that is bridged to the channel that we are
         spying on.
    
    The first is always necessary, but the others are used only when specific
    options are passed to the ChanSpy application (B, d, w, and W to be specific).
    
    When those flags are not passed, neither of those audiohooks are ever sent
    frames, but we still try to process the hooks for each voice frame that we
    recieve on the channel.
    
    So in short - only create and attach audiohooks that we actually need.
  ........
................


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@349046 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-12-23 17:36:14 +00:00
Leif Madsen a525edea59 Merged revisions 328247 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.10

................
  r328247 | lmadsen | 2011-07-14 16:25:31 -0400 (Thu, 14 Jul 2011) | 14 lines
  
  Merged revisions 328209 via svnmerge from 
  https://origsvn.digium.com/svn/asterisk/branches/1.8
  
  ........
    r328209 | lmadsen | 2011-07-14 16:13:06 -0400 (Thu, 14 Jul 2011) | 6 lines
    
    Introduce <support_level> tags in MODULEINFO.
    This change introduces MODULEINFO into many modules in Asterisk in order to show
    the community support level for those modules. This is used by changes committed
    to menuselect by Russell Bryant recently (r917 in menuselect). More information about
    the support level types and what they mean is available on the wiki at
    https://wiki.asterisk.org/wiki/display/AST/Asterisk+Module+Support+States
  ........
................


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@328259 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-07-14 20:28:54 +00:00
David Vossel a3fd2b77b6 Merged revisions 316650 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.8

................
  r316650 | dvossel | 2011-05-04 09:25:03 -0500 (Wed, 04 May 2011) | 15 lines
  
  Merged revisions 316644 via svnmerge from 
  https://origsvn.digium.com/svn/asterisk/branches/1.6.2
  
  ........
    r316644 | dvossel | 2011-05-04 09:23:39 -0500 (Wed, 04 May 2011) | 9 lines
    
    Fixes one-way-audio when chanspy activated with the 'o' option
    
    (closes issue #18382)
    Reported by: jkister
    Patches: 
          0001-Bugfix-18382-one-way-audio-when-chanspy-activated.patch.txt uploaded by malin (license )
    Tested by: firstsip, Greenlightcrm, malin, wdoekes, boroda, dvossel
  ........
................


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@316657 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-05-04 14:26:33 +00:00
Jonathan Rose d956ecb96e Merged revisions 311197 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.8

........
  r311197 | jrose | 2011-03-17 14:03:34 -0500 (Thu, 17 Mar 2011) | 11 lines
  
  This fixes a nasty chanspy bug which was causing a channel leak every time a spied on channel made a call.
  
  In addition to the above, it makes certain channel destruction occurs so that applications don't get stuck waiting for datastore destruction while monitored by chanspy.
  
  (closes issue #18742)
  Reported by: jkister
  Tested by: jkister, jcovert, jrose
  
  Review: http://reviewboard.digium.internal/r/106/
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@311198 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-03-17 19:05:42 +00:00
David Vossel d760e81f37 Media Project Phase2: SILK 8khz-24khz, SLINEAR 8khz-192khz, SPEEX 32khz, hd audio ConfBridge, and other stuff
-Functional changes
1. Dynamic global format list build by codecs defined in codecs.conf
2. SILK 8khz, 12khz, 16khz, and 24khz with custom attributes defined in codecs.conf
3. Negotiation of SILK attributes in chan_sip.
4. SPEEX 32khz with translation
5. SLINEAR 8khz, 12khz, 24khz, 32khz, 44.1khz, 48khz, 96khz, 192khz with translation
   using codec_resample.c
6. Various changes to RTP code required to properly handle the dynamic format list
   and formats with attributes.
7. ConfBridge now dynamically jumps to the best possible sample rate.  This allows
   for conferences to take advantage of HD audio (Which sounds awesome)
8. Audiohooks are no longer limited to 8khz audio, and most effects have been
   updated to take advantage of this such as Volume, DENOISE, PITCH_SHIFT.
9. codec_resample now uses its own code rather than depending on libresample.

-Organizational changes
Global format list is moved from frame.c to format.c
Various format specific functions moved from frame.c to format.c

Review: https://reviewboard.asterisk.org/r/1104/


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@308582 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-02-22 23:04:49 +00:00
David Vossel c26c190711 Asterisk media architecture conversion - no more format bitfields
This patch is the foundation of an entire new way of looking at media in Asterisk.
The code present in this patch is everything required to complete phase1 of my
Media Architecture proposal.  For more information about this project visit the link below.
https://wiki.asterisk.org/wiki/display/AST/Media+Architecture+Proposal

The primary function of this patch is to convert all the usages of format
bitfields in Asterisk to use the new format and format_cap APIs.  Functionally
no change in behavior should be present in this patch.  Thanks to twilson
and russell for all the time they spent reviewing these changes.

Review: https://reviewboard.asterisk.org/r/1083/



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@306010 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-02-03 16:22:10 +00:00
Paul Belanger addc30d3f1 Merged revisions 299865 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.8

................
  r299865 | pabelanger | 2010-12-28 13:53:37 -0500 (Tue, 28 Dec 2010) | 9 lines
  
  Merged revisions 299864 via svnmerge from 
  https://origsvn.digium.com/svn/asterisk/branches/1.6.2
  
  ........
    r299864 | pabelanger | 2010-12-28 13:51:13 -0500 (Tue, 28 Dec 2010) | 2 lines
    
    Documentation typo
  ........
................


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@299866 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-12-28 19:00:04 +00:00
Terry Wilson 01aef13e0c Merged revisions 284921 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.8

................
  r284921 | twilson | 2010-09-03 11:28:18 -0500 (Fri, 03 Sep 2010) | 19 lines
  
  Merged revisions 284897 via svnmerge from 
  https://origsvn.digium.com/svn/asterisk/branches/1.6.2
  
  ................
    r284897 | twilson | 2010-09-03 11:20:45 -0500 (Fri, 03 Sep 2010) | 12 lines
    
    Merged revisions 284881 via svnmerge from 
    https://origsvn.digium.com/svn/asterisk/branches/1.4
    
    ........
      r284881 | twilson | 2010-09-03 11:10:23 -0500 (Fri, 03 Sep 2010) | 5 lines
      
      Properly detect when a sound file doesn't exist
      
      ast_fileexists returns -1 for error and 0 for a non-existant file. The existing
      code treated missing files as though they existed.
    ........
  ................
................


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@284922 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-09-03 16:42:53 +00:00
Tilghman Lesher 5e2aa190fe Display a list of channel variables in each channel-oriented event.
(Closes AST-33)
Reviewboard:	https://reviewboard.asterisk.org/r/368/


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@230111 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-11-13 20:42:03 +00:00
Jeff Peeler 6aaa119e84 Fix the fix for chanspy option o
In 224178, I assumed the uploaded patch was correct as it had received positive
feedback. The flags were being checked in the incorrect location. Upon testing
the fix this time it was also found that the flags from the dialplan weren't
being copied to the chanspy_translation_helper.

(closes issue #16167)
Reported by: marhbere



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@228189 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-11-05 21:23:06 +00:00
Tilghman Lesher d8e0c58437 Expand codec bitfield from 32 bits to 64 bits.
Reviewboard: https://reviewboard.asterisk.org/r/416/


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@227580 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-11-04 14:05:12 +00:00
Kevin P. Fleming cdd1f9e296 Finish implementaton of astobj2 OBJ_MULTIPLE, and convert ast_channel_iterator to use it.
This patch finishes the implementation of OBJ_MULTIPLE in astobj2 (the
case where multiple results need to be returned; OBJ_NODATA mode
already was supported). In addition, it converts ast_channel_iterators
(only the targeted versions, not the ones that iterate over all
channels) to use this method.

During this work, I removed the 'ao2_flags' arguments to the
ast_channel_iterator constructor functions; there were no uses of that
argument yet, there is only one possible flag to pass, and it made the
iterators less 'opaque'. If at some point in the future someone really
needs an ast_channel_iterator that does not lock the container, we can
provide constructor(s) for that purpose.

Review: https://reviewboard.asterisk.org/r/379/



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@225244 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-10-21 21:08:47 +00:00
Jeff Peeler a39f3a7521 Readd removed ability to allow listening to one side of the call in app_chanspy
(Option o)

(closes issue #15675)
Reported by: john8675309
Patches:
      issue15675patchtrunk.txt uploaded by dbrooks (license 790)
Tested by: jgutierrez on users list:
 http://lists.digium.com/pipermail/asterisk-users/2009-October/239155.html


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@224178 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-10-15 15:57:14 +00:00
Sean Bright a48d489568 Get this compiling under dev-mode.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@219230 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-09-17 16:25:38 +00:00
Tilghman Lesher cd88adfc6a Add the 'E' option to exit ChanSpy, once the single channel it spied upon hangs up.
In addition, there's a bit of cleanup to the arguments and documentation, in which
I discovered that the last feature added to this application duplicated an option
(oops!) and changed that option so that it now works.
(closes issue #14909)
 Reported by: junky
 Patches: 
       __20090901-spy_hangup_trunk.diff uploaded by lmadsen (license 10)
 Tested by: amilcar, junky, flujan, lmadsen


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@219105 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-09-17 00:58:10 +00:00
Tilghman Lesher 642bec4d6f AST-2009-005
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@211539 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-08-10 19:20:57 +00:00
Russell Bryant bb1fc3e12f Add 's' option to ChanSpy, which makes the app exit when no channels are left to spy on.
(closes issue #14594)
Reported by: JimDickenson
Patches:
      chanspy.diff uploaded by JimDickenson (license 710)


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@203842 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-06-26 21:48:41 +00:00
Kevin P. Fleming 4c0265664e Merged revisions 200991 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r200991 | kpfleming | 2009-06-16 12:05:38 -0500 (Tue, 16 Jun 2009) | 11 lines
  
  Improve support for media paths that can generate multiple frames at once.
  
  There are various media paths in Asterisk (codec translators and UDPTL, primarily)
  that can generate more than one frame to be generated when the application calling
  them expects only a single frame. This patch addresses a number of those cases,
  at least the primary ones to solve the known problems. In addition it removes the
  broken TRACE_FRAMES support, fixes a number of bugs in various frame-related API
  functions, and cleans up various code paths affected by these changes.
  
  https://reviewboard.asterisk.org/r/175/
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@201056 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-06-16 18:54:30 +00:00
Russell Bryant 12ff77f975 Global var cleanup - constification and removing unused vars.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@199479 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-06-07 14:55:51 +00:00
Mark Michelson a7fd763ecc Merged revisions 197537 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r197537 | mmichelson | 2009-05-28 09:49:13 -0500 (Thu, 28 May 2009) | 21 lines
  
  Add flags to chanspy audiohook so that audio stays in sync.
  
  There are two flags being added to the chanspy audiohook here. One
  is the pre-existing AST_AUDIOHOOK_TRIGGER_SYNC flag. With this set,
  we ensure that the read and write slinfactories on the audiohook do
  not skew beyond a certain tolerance.
  
  In addition, there is a new audiohook flag added here,
  AST_AUDIOHOOK_SMALL_QUEUE. With this flag set, we do not allow for
  a slinfactory to build up a substantial amount of audio before 
  flushing it. For this particular issue, this means that the person 
  spying on the call will hear the conversations in real time with very 
  little delay in the audio.
  
  (closes issue #13745)
  Reported by: geoffs
  Patches:
        13745.patch uploaded by mmichelson (license 60)
  Tested by: snblitz
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@197543 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-05-28 14:58:06 +00:00
Kevin P. Fleming e6b2e9a750 Const-ify the world (or at least a good part of it)
This patch adds 'const' tags to a number of Asterisk APIs where they are appropriate (where the API already demanded that the function argument not be modified, but the compiler was not informed of that fact). The list includes:

- CLI command handlers
- CLI command handler arguments
- AGI command handlers
- AGI command handler arguments
- Dialplan application handler arguments
- Speech engine API function arguments

In addition, various file-scope and function-scope constant arrays got 'const' and/or 'static' qualifiers where they were missing.

Review: https://reviewboard.asterisk.org/r/251/



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@196072 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-05-21 21:13:09 +00:00
Kevin P. Fleming 1c988d8996 add 'const' qualifiers in various places where they should have been
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@193832 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-05-12 13:59:35 +00:00
Russell Bryant cba19c8a67 Convert the ast_channel data structure over to the astobj2 framework.
There is a lot that could be said about this, but the patch is a big 
improvement for performance, stability, code maintainability, 
and ease of future code development.

The channel list is no longer an unsorted linked list.  The main container 
for channels is an astobj2 hash table.  All of the code related to searching 
for channels or iterating active channels has been rewritten.  Let n be 
the number of active channels.  Iterating the channel list has gone from 
O(n^2) to O(n).  Searching for a channel by name went from O(n) to O(1).  
Searching for a channel by extension is still O(n), but uses a new method 
for doing so, which is more efficient.

The ast_channel object is now a reference counted object.  The benefits 
here are plentiful.  Some benefits directly related to issues in the 
previous code include:

1) When threads other than the channel thread owning a channel wanted 
   access to a channel, it had to hold the lock on it to ensure that it didn't 
   go away.  This is no longer a requirement.  Holding a reference is 
   sufficient.

2) There are places that now require less dealing with channel locks.

3) There are places where channel locks are held for much shorter periods 
   of time.

4) There are places where dealing with more than one channel at a time becomes 
   _MUCH_ easier.  ChanSpy is a great example of this.  Writing code in the 
   future that deals with multiple channels will be much easier.

Some additional information regarding channel locking and reference count 
handling can be found in channel.h, where a new section has been added that 
discusses some of the rules associated with it.

Mark Michelson also assisted with the development of this patch.  He did the 
conversion of ChanSpy and introduced a new API, ast_autochan, which makes it 
much easier to deal with holding on to a channel pointer for an extended period 
of time and having it get automatically updated if the channel gets masqueraded.
Mark was also a huge help in the code review process.

Thanks to David Vossel for his assistance with this branch, as well.  David 
did the conversion of the DAHDIScan application by making it become a wrapper 
for ChanSpy internally.

The changes come from the svn/asterisk/team/russell/ast_channel_ao2 branch.

Review: http://reviewboard.digium.com/r/203/


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@190423 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-04-24 14:04:26 +00:00
Mark Michelson b5bde28d9f Add manager events for chanspy starting or stopping
(closes issue #14469)
Reported by: caio1982
Patches:
      chanspy_events2.diff uploaded by caio1982 (license 22)



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@175655 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-02-13 20:35:26 +00:00
Mark Michelson c9670b24a4 Fix potential for stack overflows in app_chanspy.c
When using the 'g' or 'e' options, the stack allocations that
were used could cause a stack overflow if a spyer stayed on the
line long enough without actually successfully spying on anyone.

The problem has been corrected by using static buffers and copying
the contents of the appropriate strings into them instead of using
functions like alloca or ast_strdupa



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@174805 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-02-10 23:17:03 +00:00
Joshua Colp b2484d7db9 Always detach and destroy the whisper and barge audiohooks. Additionally also allow an audiohook to be detached if it has not been attached.
(closes issue #14414)
Reported by: bluecrow76


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@173902 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-02-06 15:59:17 +00:00
Mark Michelson e04e940a71 Merged revisions 173396 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r173396 | mmichelson | 2009-02-04 11:44:48 -0600 (Wed, 04 Feb 2009) | 3 lines

Revert my previous change because it was stupid


........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@173397 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-02-04 17:45:14 +00:00
Mark Michelson 668f9f4e31 Merged revisions 173392 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r173392 | mmichelson | 2009-02-04 11:40:29 -0600 (Wed, 04 Feb 2009) | 3 lines

Add a missing unlock. Extremely unlikely to ever matter, but it's needed.


........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@173393 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-02-04 17:41:02 +00:00
Russell Bryant 37d8f255e4 Merged revisions 165889 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r165889 | russell | 2008-12-19 09:03:02 -0600 (Fri, 19 Dec 2008) | 9 lines

Ensure that the chanspy datastore is fully initialized.

This patch resolved some random crash issues observed by a user on a BSD system

(closes issue #14111)
Reported by: ys
Patches:
      app_chanspy.c.diff uploaded by ys (license 281)

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@165890 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-12-19 15:05:09 +00:00
Joshua Colp d6b70deee5 Only detach and destroy the whisper audiohooks if they are actually in use.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@163912 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-12-13 00:59:24 +00:00
Eliel C. Sardanons f18699be24 - Add more <see-also> based on TFOT.
- Add the 'filename' type to the see-also ref. To be able to reference a filename.


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@154578 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-11-05 13:07:29 +00:00
Kevin P. Fleming bd4eb070f3 bring over all the fixes for the warnings found by gcc 4.3.x from the 1.4 branch, and add the ones needed for all the new code here too
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@153616 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-11-02 18:52:13 +00:00
Russell Bryant 6f314f4d42 Fix various spelling and grammatical issues in documentation
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@153468 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-11-02 02:50:33 +00:00
Russell Bryant 5b168ee34b Merge changes from team/group/appdocsxml
This commit introduces the first phase of an effort to manage documentation of the
interfaces in Asterisk in an XML format.  Currently, a new format is available for
applications and dialplan functions.  A good number of conversions to the new format
are also included.

For more information, see the following message to asterisk-dev:

http://lists.digium.com/pipermail/asterisk-dev/2008-October/034968.html


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@153365 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-11-01 21:10:07 +00:00
Russell Bryant 89eaa39a6a Merged revisions 139213 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r139213 | russell | 2008-08-20 17:14:35 -0500 (Wed, 20 Aug 2008) | 11 lines

Fix a crash in the ChanSpy application.  The issue here is that if you call
ChanSpy and specify a spy group, and sit in the application long enough looping
through the channel list, you will eventually run out of stack space and the
application with exit with a seg fault.  The backtrace was always inside of
a harmless snprintf() call, so it was tricky to track down.  However, it turned
out that the call to snprintf() was just the biggest stack consumer in this
code path, so it would always be the first one to hit the boundary.

(closes issue #13338)
Reported by: ruddy

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@139215 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-08-20 22:16:36 +00:00
Mark Michelson b949d5347e Merged revisions 138886 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r138886 | mmichelson | 2008-08-19 13:50:53 -0500 (Tue, 19 Aug 2008) | 23 lines

Add a lock and unlock prior to the destruction of the chanspy_ds
lock to ensure that no other threads still have it locked. While
this should not happen under normal circumstances, it appears that
if the spyer and spyee hang up at nearly the same time, the following
may occur.

1. ast_channel_free is called on the spyee's channel.
2. The chanspy datastore is removed from the spyee's channel in 
   ast_channel_free.
3. In the spyer's thread, the spyer attempts to remove and destroy the datastore
   from the spyee channel, but the datastore has already been removed in step 2, 
   so the spyer continues in the code.
4. The spyee's thread continues and calls the datastore's destroy callback, 
   chanspy_ds_destroy. This involves locking the chanspy_ds.
5. Now the spyer attempts to destroy the chanspy_ds lock. The problem is that in step 4, 
   the spyee has locked this lock, meaning that the spyer is attempting to destroy a lock 
   which is currently locked by another thread.

The backtrace provided in issue #12969 supports the idea that this is possible
(and has even occurred). This commit does not close the issue, but should help
in preventing one type of crash associated with the use of app_chanspy.


........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@138887 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-08-19 18:52:04 +00:00
Kevin P. Fleming 7df8b8b848 make datastore creation and destruction a generic API since it is not really channel related, and add the ability to add/find/remove datastores to manager sessions
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@135680 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-08-05 16:56:11 +00:00
Mark Michelson 06d951f585 merging the zap_and_dahdi_trunk branch up to trunk
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@134050 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-07-28 16:00:19 +00:00
Mark Michelson ed6323cb73 Merged revisions 133169 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r133169 | mmichelson | 2008-07-23 14:39:47 -0500 (Wed, 23 Jul 2008) | 12 lines

As suggested by seanbright, the PSEUDO_CHAN_LEN in 
app_chanspy should be set at load time, not at compile
time, since dahdi_chan_name is determined at load time.

Also changed the next_unique_id_to_use to have the 
static qualifier.

Also added the dahdi_chan_name_len variable so that
strlen(dahdi_chan_name) isn't necessary. Thanks to
seanbright for the suggestion.


........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@133171 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-07-23 19:48:03 +00:00
Mark Michelson cca455b0f3 Merged revisions 133104 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r133104 | mmichelson | 2008-07-23 14:06:16 -0500 (Wed, 23 Jul 2008) | 5 lines

Zap/pseudo is ten characters, but DAHDI/pseudo is
twelve. The strncmp call in next_channel should
account for this.


........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@133106 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-07-23 19:07:56 +00:00
Mark Michelson 1908413bd6 Merged revisions 133101 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r133101 | mmichelson | 2008-07-23 13:57:17 -0500 (Wed, 23 Jul 2008) | 6 lines

Update the "last" channel in next_channel in app_chanspy so
that the same pseudo channel isn't constantly returned.

related to issue #13124


........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@133102 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-07-23 18:58:37 +00:00
Brett Bryant 5b7933fe5e Janitor patch to change uses of sizeof to ARRAY_LEN
(closes issue #13054)
Reported by: pabelanger
Patches:
      ARRAY_LEN.patch2 uploaded by pabelanger (license 224)
Tested by: seanbright


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@130129 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-07-11 18:09:35 +00:00
Mark Michelson 6cfe27089c Make change proposed by andrew53 on bugtracker
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@127857 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-07-03 20:59:51 +00:00
Mark Michelson 5a8a23f9ba Thanks to a suggestion from seanbright, print a warning if the attachment
of the whisper or barge audiohooks fails.



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@127856 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-07-03 20:37:21 +00:00
Mark Michelson bb9a355ff0 Fix build
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@127852 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-07-03 20:23:57 +00:00