dect
/
asterisk
Archived
13
0
Fork 0
Commit Graph

270 Commits

Author SHA1 Message Date
jpeeler 287be71bb6 Add support for several platforms to obtain the real thread ID.
Already had the pthread ID which is not the same.  The most obvious enhancement
is in the "core show threads" output. As stated in the utils header, if the
platform isn't supported -1 is reported (instead of the process ID previously).


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@298137 f38db490-d61c-443f-a65b-d21fe96a405b
2010-12-12 03:58:33 +00:00
schmidts c6d866ff51 move devices from hints into an ao2_container
by splitting up devices from hints into an own ao2_container the callback to
get these devices for statechange handling is faster.
with this changes the length of a device used in a hint isnt longer restricted
to 80 characters.

Tests showed that calling handle_statechange is 40 times faster if no hints
are used and 25 times faster if there are any hints.

(closes issue #17928)
Reported by: mdu113
Tested by: schmidts

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



git-svn-id: http://svn.digium.com/svn/asterisk/trunk@296752 f38db490-d61c-443f-a65b-d21fe96a405b
2010-11-30 09:49:25 +00:00
tilghman 3fc049cf91 Merged revisions 296534 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.8

................
  r296534 | tilghman | 2010-11-29 01:28:44 -0600 (Mon, 29 Nov 2010) | 20 lines
  
  Merged revisions 296533 via svnmerge from 
  https://origsvn.digium.com/svn/asterisk/branches/1.6.2
  
  ........
    r296533 | tilghman | 2010-11-29 01:27:09 -0600 (Mon, 29 Nov 2010) | 13 lines
    
    I love standards.  There are so many to choose from.  Except when there isn't one.
    
    Linux and *BSD disagree on the elements within the ucred structure.  Detect
    which one is in use on the system.
    
    (closes issue #18384)
     Reported by: bjm
     Patches: 
           cred-diffs uploaded by bjm (license 473)
           20101127__issue18384__1.6.2.diff.txt uploaded by tilghman (license 14)
           20101127__issue18384__1.8.diff.txt uploaded by tilghman (license 14)
     Tested by: tilghman, bjm
  ........
................


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@296535 f38db490-d61c-443f-a65b-d21fe96a405b
2010-11-29 07:30:09 +00:00
jpeeler bccb73bf04 Merged revisions 290864 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.8

................
  r290864 | jpeeler | 2010-10-07 21:56:24 -0500 (Thu, 07 Oct 2010) | 23 lines
  
  Merged revisions 290863 via svnmerge from 
  https://origsvn.digium.com/svn/asterisk/branches/1.6.2
  
  ................
    r290863 | jpeeler | 2010-10-07 21:45:44 -0500 (Thu, 07 Oct 2010) | 16 lines
    
    Merged revisions 290862 via svnmerge from 
    https://origsvn.digium.com/svn/asterisk/branches/1.4
    
    ........
      r290862 | jpeeler | 2010-10-07 21:35:29 -0500 (Thu, 07 Oct 2010) | 9 lines
      
      Ensure editline cleanup occurs when Ctrl-C is pressed at control console.
      
      A recent change was made to avoid a race condition on shutdown which only called
      the end functions from the console thread. However, when pressing Ctrl-C the
      quit handler is called from the signal handler thread.
      
      (closes issue #17698)
      Reported by: jmls
    ........
  ................
................


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@290865 f38db490-d61c-443f-a65b-d21fe96a405b
2010-10-08 03:00:40 +00:00
russell e22a598bff Merged revisions 288341 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.8

................
  r288341 | russell | 2010-09-22 11:45:18 -0500 (Wed, 22 Sep 2010) | 25 lines
  
  Merged revisions 288340 via svnmerge from 
  https://origsvn.digium.com/svn/asterisk/branches/1.6.2
  
  ................
    r288340 | russell | 2010-09-22 11:44:13 -0500 (Wed, 22 Sep 2010) | 18 lines
    
    Merged revisions 288339 via svnmerge from 
    https://origsvn.digium.com/svn/asterisk/branches/1.4
    
    ........
      r288339 | russell | 2010-09-22 11:39:16 -0500 (Wed, 22 Sep 2010) | 11 lines
      
      Fix a 100% CPU consumption problem when setting console=yes in asterisk.conf.
      
      The handling of -c and console=yes should be the same, but they were not.
      When you specify -c, it sets both a flag for console module and for asterisk
      not to fork() off into the background.  The handling of console=yes only set
      console mode, so you would end up with a background process() trying to run
      the Asterisk console and freaking out since it didn't have anything to read
      input from.
      
      Thanks to beagles for reporting and helping debug the problem!
    ........
  ................
................


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@288342 f38db490-d61c-443f-a65b-d21fe96a405b
2010-09-22 16:46:20 +00:00
tilghman 38227225d4 Merged revisions 287935 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.8

................
  r287935 | tilghman | 2010-09-21 14:08:36 -0500 (Tue, 21 Sep 2010) | 16 lines
  
  Merged revisions 287934 via svnmerge from 
  https://origsvn.digium.com/svn/asterisk/branches/1.6.2
  
  ................
    r287934 | tilghman | 2010-09-21 14:07:53 -0500 (Tue, 21 Sep 2010) | 9 lines
    
    Merged revisions 287933 via svnmerge from 
    https://origsvn.digium.com/svn/asterisk/branches/1.4
    
    ........
      r287933 | tilghman | 2010-09-21 14:07:07 -0500 (Tue, 21 Sep 2010) | 2 lines
      
      Less than zero is an error, not any non-zero value.
    ........
  ................
................


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@287936 f38db490-d61c-443f-a65b-d21fe96a405b
2010-09-21 19:09:15 +00:00
tilghman c32f63c825 Merged revisions 284597 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.8

................
  r284597 | tilghman | 2010-09-02 00:00:34 -0500 (Thu, 02 Sep 2010) | 29 lines
  
  Merged revisions 284593,284595 via svnmerge from 
  https://origsvn.digium.com/svn/asterisk/branches/1.6.2
  
  ................
    r284593 | tilghman | 2010-09-01 17:59:50 -0500 (Wed, 01 Sep 2010) | 18 lines
    
    Merged revisions 284478 via svnmerge from 
    https://origsvn.digium.com/svn/asterisk/branches/1.4
    
    ........
      r284478 | tilghman | 2010-09-01 13:49:11 -0500 (Wed, 01 Sep 2010) | 11 lines
      
      Ensure that all areas that previously used select(2) now use poll(2), with implementations that need poll(2) implemented with select(2) safe against 1024-bit overflows.
      
      This is a followup to the fix for the pthread timer in 1.6.2 and beyond, fixing
      a potential crash bug in all supported releases.
      
      (closes issue #17678)
       Reported by: russell
      Branch: https://origsvn.digium.com/svn/asterisk/team/tilghman/ast_select 
      
      Review: https://reviewboard.asterisk.org/r/824/
    ........
  ................
    r284595 | tilghman | 2010-09-01 22:57:43 -0500 (Wed, 01 Sep 2010) | 2 lines
    
    Failed to rerun bootstrap.sh after last commit
  ................
................


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@284598 f38db490-d61c-443f-a65b-d21fe96a405b
2010-09-02 05:02:54 +00:00
tilghman 8c187a70f6 Merged revisions 278981 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r278981 | tilghman | 2010-07-23 11:42:25 -0500 (Fri, 23 Jul 2010) | 8 lines
  
  Avoid race with consolethread on shutdown (on parallel processors).
  
  (closes issue #17080)
   Reported by: sybasesql
   Patches: 
         20100721__issue17080.diff.txt uploaded by tilghman (license 14)
   Tested by: sybasesql
........


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@278982 f38db490-d61c-443f-a65b-d21fe96a405b
2010-07-23 16:43:34 +00:00
tilghman 771cdeecd1 Add load priority order, such that preload becomes unnecessary in most cases
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@278132 f38db490-d61c-443f-a65b-d21fe96a405b
2010-07-20 19:35:02 +00:00
tilghman db212ff911 Merged revisions 272925 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r272925 | tilghman | 2010-06-28 16:50:02 -0500 (Mon, 28 Jun 2010) | 8 lines
  
  Don't change ownership/group/permissions on run directory, if it already exists.
  
  (closes issue #17076)
   Reported by: stuarth
   Patches: 
         20100324__issue17076.diff.txt uploaded by tilghman (license 14)
   Tested by: stuarth
........


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@272926 f38db490-d61c-443f-a65b-d21fe96a405b
2010-06-28 21:50:57 +00:00
tilghman ec579b68ae Merged revisions 269635 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r269635 | tilghman | 2010-06-10 02:52:34 -0500 (Thu, 10 Jun 2010) | 9 lines
  
  Ensure restartable system calls can restart (BSD signal semantics).
  
  This eliminates the annoying <beep> on the console.
  
  (closes issue #17477)
   Reported by: jvandal
   Patches: 
         20100610__issue17477.diff.txt uploaded by tilghman (license 14)
........


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@269636 f38db490-d61c-443f-a65b-d21fe96a405b
2010-06-10 08:15:45 +00:00
rmudgett 245c5d9eb8 Generic Advice of Charge.
Asterisk Generic AOC Representation
- Generic AOC encode/decode routines.
  (Generic AOC must be encoded to be passed on the wire in the AST_CONTROL_AOC frame)
- AST_CONTROL_AOC frame type to represent generic encoded AOC data
- Manager events for AOC-S, AOC-D, and AOC-E messages

Asterisk App Support
- app_dial AOC-S pass-through support on call setup
- app_queue AOC-S pass-through support on call setup

AOC Unit Tests
- AOC Unit Tests for encode/decode routines
- AOC Unit Test for manager event representation.

SIP AOC Support
- Pass-through of generic AOC-D and AOC-E messages to snom phones via the
  snom AOC specification.
- Creation of chan_sip page3 flags for the addition of the new
  'snom_aoc_enabled' sip.conf option.

IAX AOC Support
- Natively supports AOC pass-through through the use of the new
  AST_CONTROL_AOC frame type

DAHDI AOC Support
- ETSI PRI full AOC Pass-through support
- 'aoc_enable' chan_dahdi.conf option for independently enabling
  pass-through of AOC-S, AOC-D, AOC-E.
- 'aoce_delayhangup' option for retrieving AOC-E on disconnect.
- DAHDI A() dial string option for requesting AOC services.
  example usage:
  ;requests AOC-S, AOC-D, and AOC-E on call setup
  exten=>1111,1,Dial(DAHDI/g1/1112/A(s,d,e))

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


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@267096 f38db490-d61c-443f-a65b-d21fe96a405b
2010-06-02 18:10:15 +00:00
tilghman f4d2dfe4e2 Merged revisions 266585 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r266585 | tilghman | 2010-06-01 10:17:46 -0500 (Tue, 01 Jun 2010) | 11 lines
  
  Prevent CLI prompt from distorting output of lines shorter than the prompt.
  
  Uses the VT100 method of clearing the line from the cursor position to the
  end of the line:  Esc-0K
  
  (closes issue #17160)
   Reported by: coolmig
   Patches: 
         20100531__issue17160.diff.txt uploaded by tilghman (license 14)
   Tested by: coolmig
........


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@266592 f38db490-d61c-443f-a65b-d21fe96a405b
2010-06-01 15:18:59 +00:00
tilghman 5696c84027 Setup environment variables for the benefit of child processes and disallow changing them.
(closes issue #14899)
 Reported by: jmls
 Patches: 
       20090916__issue14899.diff.txt uploaded by tilghman (license 14)
 Tested by: jmls


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@266385 f38db490-d61c-443f-a65b-d21fe96a405b
2010-05-28 22:50:06 +00:00
tilghman 1297a59878 Only report swap on platforms which can examine those statistics
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@266337 f38db490-d61c-443f-a65b-d21fe96a405b
2010-05-28 20:53:04 +00:00
tilghman 01e42965e9 Merged revisions 266142 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r266142 | tilghman | 2010-05-26 16:11:44 -0500 (Wed, 26 May 2010) | 14 lines
  
  Use sigaction for signals which should persist past the initial trigger, not signal.
  
  If you call signal() in a Solaris signal handler, instead of just resetting
  the signal handler, it causes the signal to refire, because the signal is not
  marked as handled prior to the signal handler being called.  This effectively
  causes Solaris to immediately exceed the threadstack in recursive signal
  handlers and crash.
  
  (closes issue #17000)
   Reported by: rmcgilvr
   Patches: 
         20100526__issue17000.diff.txt uploaded by tilghman (license 14)
   Tested by: rmcgilvr
........


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@266146 f38db490-d61c-443f-a65b-d21fe96a405b
2010-05-26 21:17:46 +00:00
twilson 0c7add2a03 Merge the rest of the FullyBooted patch
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@265467 f38db490-d61c-443f-a65b-d21fe96a405b
2010-05-24 22:21:58 +00:00
tilghman e6aec778a5 On systems with a LOT of RAM, a signed integer sometimes printed negative.
(closes issue #16837)
 Reported by: jlpedrosa
 Patches: 
       20100504__issue16837.diff.txt uploaded by tilghman (license 14)


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@265316 f38db490-d61c-443f-a65b-d21fe96a405b
2010-05-24 18:19:08 +00:00
mmichelson db41c6c80b Fix transcode_via_sln option with SIP calls and improve PLC usage.
From reviewboard:
The problem here is a bit complex, so try to bear with me...

It was noticed by a Digium customer that generic PLC (as configured in
codecs.conf) did not appear to actually be having any sort of benefit when
packet loss was introduced on an RTP stream. I reproduced this issue myself
by streaming a file across an RTP stream and dropping approx. 5% of the
RTP packets. I saw no real difference between when PLC was enabled or disabled
when using wireshark to analyze the RTP streams.

After analyzing what was going on, it became clear that one of the problems
faced was that when running my tests, the translation paths were being set
up in such a way that PLC could not possibly work as expected. To illustrate,
if packets are lost on channel A's read stream, then we expect that PLC will
be applied to channel B's write stream. The problem is that generic PLC can
only be done when there is a translation path that moves from some codec to
SLINEAR. When I would run my tests, I found that every single time, read
and write translation paths would be set up on channel A instead of channel
B. There appeared to be no real way to predict which channel the translation
paths would be set up on.

This is where Kevin swooped in to let me know about the transcode_via_sln
option in asterisk.conf. It is supposed to work by placing a read translation
path on both channels from the channel's rawreadformat to SLINEAR. It also
will place a write translation path on both channels from SLINEAR to the
channel's rawwriteformat. Using this option allows one to predictably set up
translation paths on all channels. There are two problems with this, though.
First and foremost, the transcode_via_sln option did not appear to be working
properly when I was placing a SIP call between two endpoints which did not
share any common formats. Second, even if this option were to work, for PLC
to be applied, there had to be a write translation path that would go from
some format to SLINEAR. It would not work properly if the starting format
of translation was SLINEAR.

The one-line change presented in this review request in chan_sip.c fixed the
first issue for me. The problem was that in sip_request_call, the
jointcapability of the outbound channel was being set to the format passed to
sip_request_call. This is nativeformats of the inbound channel. Because of this,
when ast_channel_make_compatible was called by app_dial, both channels already
had compatibly read and write formats. Thus, no translation path was set up at
the time. My change is to set the jointcapability of the sip_pvt created during
sip_request_call to the intersection of the inbound channel's nativeformats and
the configured peer capability that we determined during the earlier call to
create_addr. Doing this got the translation paths set up as expected when using
transcode_via_sln.

The changes presented in channel.c fixed the second issue for me. First and
foremost, when Asterisk is started, we'll read codecs.conf to see the value of
the genericplc option. If this option is set, and ast_write is called for a
frame with no data, then we will attempt to fill in the missing samples for
the frame. The implementation uses a channel datastore for maintaining the
PLC state and for creating a buffer to store PLC samples in. Even when we
receive a frame with data, we'll call plc_rx so that the PLC state will have
knowledge of the previous voice frame, which it can use as a basis for when
it comes time to actually do a PLC fill-in.

So, reviewers, now I ask for your help. First off, there's the one line change
in chan_sip that I have put in. Is it right? By my logic it seems correct, but
I'm sure someone can tell me why it is not going to work. This is probably the
change I'm least concerned about, though. What concerns me much more is the
set of changes in channel.c. First off, am I even doing it right? When I run
tests, I can clearly see that when PLC is activated, I see a significant increase
in RTP traffic where I would expect it to be. However, in my humble opinion, the
audio sounds kind of crappy whenever the PLC fill-in is done. It sounds worse to
me than when no PLC is used at all. I need someone to review the logic I have used
to be sure that I'm not misusing anything. As far as I can see my pointer arithmetic
is correct, and my use of AST_FRIENDLY_OFFSET should be correct as well, but I'm
sure someone can point out somewhere where I've done something incorrectly.

As I was writing this review request up, I decided to give the code a test run under
valgrind, and I find that for some reason, calls to plc_rx are causing some invalid
reads. Apparently I'm reading past the end of a buffer somehow. I'll have to dig around
a bit to see why that is the case. If it's obvious to someone reviewing, speak up!

Finally, I have one other proposal that is not reflected in my code review. Since
without transcode_via_sln set, one cannot predict or control where a translation
path will be up, it seems to me that the current practice of using PLC only when
transcoding to SLINEAR is not useful. I recommend that once it has been determined
that the method used in this code review is correct and works as expected, then
the code in translate.c that invokes PLC should be removed.

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



git-svn-id: http://svn.digium.com/svn/asterisk/trunk@264452 f38db490-d61c-443f-a65b-d21fe96a405b
2010-05-19 21:29:08 +00:00
eliel 2b551e72e4 Asterisk data retrieval API.
This module implements an abstraction for retrieving and exporting
asterisk data.
Developed by:
	Brett Bryant <brettbryant@gmail.com>
	Eliel C. Sardanons (LU1ALY) <eliels@gmail.com>
For the Google Summer of code 2009 Project.
Documentation can be found in doxygen format and inside the
header include/asterisk/data.h

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



git-svn-id: http://svn.digium.com/svn/asterisk/trunk@258517 f38db490-d61c-443f-a65b-d21fe96a405b
2010-04-22 18:07:02 +00:00
mmichelson 0eb1e5407a Merge Call completion support into trunk.
From Reviewboard:
CCSS stands for Call Completion Supplementary Services. An admittedly out-of-date
overview of the architecture can be found in the file doc/CCSS_architecture.pdf
in the CCSS branch. Off the top of my head, the big differences between what is
implemented and what is in the document are as follows:

1. We did not end up modifying the Hangup application at all.
2. The document states that a single call completion monitor may be used across
   multiple calls to the same device. This proved to not be such a good idea
   when implementing protocol-specific monitors, and so we ended up using one
   monitor per-device per-call.
3. There are some configuration options which were conceived after the document
   was written. These are documented in the ccss.conf.sample that is on this
   review request.
		      
For some basic understanding of terminology used throughout this code, see the
ccss.tex document that is on this review.

This implements CCBS and CCNR in several flavors.

First up is a "generic" implementation, which can work over any channel technology
provided that the channel technology can accurately report device state. Call
completion is requested using the dialplan application CallCompletionRequest and can
be canceled using CallCompletionCancel. Device state subscriptions are used in order
to monitor the state of called parties.

Next, there is a SIP-specific implementation of call completion. This method uses the
methods outlined in draft-ietf-bliss-call-completion-06 to implement call completion
using SIP signaling. There are a few things to note here:

* The agent/monitor terminology used throughout Asterisk sometimes is the reverse of
  what is defined in the referenced draft.

* Implementation of the draft required support for SIP PUBLISH. I attempted to write
  this in a generic-enough fashion such that if someone were to want to write PUBLISH
  support for other event packages, such as dialog-state or presence, most of the effort
  would be in writing callbacks specific to the event package.

* A subportion of supporting PUBLISH reception was that we had to implement a PIDF
  parser. The PIDF support added is a bit minimal. I first wrote a validation
  routine to ensure that the PIDF document is formatted properly. The rest of the
  PIDF reading is done in-line in the call-completion-specific PUBLISH-handling
  code. In other words, while there is PIDF support here, it is not in any state
  where it could easily be applied to other event packages as is.

Finally, there are a variety of ISDN-related call completion protocols supported. These
were written by Richard Mudgett, and as such I can't really say much about their
implementation. There are notes in the CHANGES file that indicate the ISDN protocols
over which call completion is supported.

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


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@256528 f38db490-d61c-443f-a65b-d21fe96a405b
2010-04-09 15:31:32 +00:00
tilghman 296f7c46ea Pass the PID of the Asterisk process, not the PID of the canary.
(closes issue #17065)
 Reported by: globalnetinc
 Patches: 
       astcanary.patch uploaded by makoto (license 38)
 Tested by: frawd, globalnetinc


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@255952 f38db490-d61c-443f-a65b-d21fe96a405b
2010-04-02 20:19:01 +00:00
tzafrir d110bd89b6 make 'core show settings' should show all settable directories
(closes issue #17086)
Reported by: tzafrir
Patches:
      asterisk_extra_settings_dirs.diff uploaded by tzafrir (license 46)


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@254162 f38db490-d61c-443f-a65b-d21fe96a405b
2010-03-23 22:48:03 +00:00
mmichelson 4b1ca40f36 Initialize channels prior to loading "preload" modules.
We can have bad results when a module, upon being loaded, attempts
to reference the channels container if the container hasn't yet
been initialized. I saw this happen by trying to preload pbx_config.so
and having a hint defined which referenced a non-existent SIP peer.



git-svn-id: http://svn.digium.com/svn/asterisk/trunk@253872 f38db490-d61c-443f-a65b-d21fe96a405b
2010-03-22 20:32:15 +00:00
russell b8db65d578 Update comment to reflect new timeout value.
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@253378 f38db490-d61c-443f-a65b-d21fe96a405b
2010-03-18 18:23:07 +00:00
russell 5a8fa60ea8 Increase CLI command output timeout for asterisk -rx to 60 seconds.
(closes issue #17049)
Reported by: russell
Tested by: russell

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


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@253357 f38db490-d61c-443f-a65b-d21fe96a405b
2010-03-18 18:18:43 +00:00
tilghman ecfc5f5016 Merged revisions 252361 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r252361 | tilghman | 2010-03-14 20:33:50 -0500 (Sun, 14 Mar 2010) | 4 lines
  
  Launch Asterisk on Mac OS X with launchd.
  
  Reviewboard: https://reviewboard.asterisk.org/r/551/
........


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@252362 f38db490-d61c-443f-a65b-d21fe96a405b
2010-03-15 01:37:04 +00:00
tilghman b117a7de89 Merged revisions 248859 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r248859 | tilghman | 2010-02-25 15:21:05 -0600 (Thu, 25 Feb 2010) | 15 lines
  
  Some platforms clear /var/run at boot, which makes connecting a remote console... difficult.
  
  Previously, we only created the default /var/run/asterisk directory at install
  time.  While we could create it in the init script, that would not work for
  those who start asterisk manually from the command line.  So the safest thing
  to do is to create it as part of the Asterisk boot process.  This also changes
  the ownership of the directory, because the pid and ctl files are created after
  we setuid/setgid.
  
  (closes issue #16802)
   Reported by: Brian
   Patches: 
         20100224__issue16802.diff.txt uploaded by tilghman (license 14)
   Tested by: tzafrir
........


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@248861 f38db490-d61c-443f-a65b-d21fe96a405b
2010-02-25 21:22:39 +00:00
seanbright 86c24efbe0 Merged revisions 244926 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r244926 | seanbright | 2010-02-05 12:03:35 -0500 (Fri, 05 Feb 2010) | 1 line
  
  Update main copyright date.
........


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@244927 f38db490-d61c-443f-a65b-d21fe96a405b
2010-02-05 17:05:32 +00:00
jpeeler dd43b1905e Add new option to asterisk.conf (lockconfdir) to protect conf dir during reloads
(closes issue #16358)
Reported by: raarts
Patches: 
      lockconfdir.diff uploaded by raarts (license 937)
      modified by me


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@243551 f38db490-d61c-443f-a65b-d21fe96a405b
2010-01-27 18:29:49 +00:00
tilghman 21520f22c0 Err, oops, it was already the way I intended.
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@240629 f38db490-d61c-443f-a65b-d21fe96a405b
2010-01-15 23:50:47 +00:00
tilghman 5e7b7fb65f The previous attempt at using a pipe to guarantee astcanary shutdown did not work.
We're revisiting the previous patch, albeit with a method that overcomes the
prior criticism that it was not POSIX-compliant.
(closes issue #16602)
 Reported by: frawd
 Patches: 
       20100114__issue16602.diff.txt uploaded by tilghman (license 14)
 Tested by: frawd


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@240499 f38db490-d61c-443f-a65b-d21fe96a405b
2010-01-15 21:40:14 +00:00
tilghman b7ec076367 It's been long enough -- make the behavior introduced in 1.6 the default.
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@239000 f38db490-d61c-443f-a65b-d21fe96a405b
2010-01-10 06:56:36 +00:00
dvossel 5d1bac896e Unit Test Framework API
The Unit Test Framework is a new API that manages registration and
execution of unit tests in Asterisk with the purpose of verifying the
operation of C functions.  The Framework consists of a single test
manager accompanied by a list of registered test functions defined
within the code.  A test is defined, registered, and unregistered
from the framework using a set of macros which allow the test code
to only be compiled within asterisk when the TEST_FRAMEWORK flag is
enabled in menuselect.  This allows the test code to exist in the
same file as the C functions it intends to verify.  Registered tests
may be viewed and executed via a set of new CLI commands.  CLI commands
are also present for generating and exporting test results into xml
and txt formats.

For more information and use cases please refer to the documentation
provided at the beginning of the test.h file.

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


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@236027 f38db490-d61c-443f-a65b-d21fe96a405b
2009-12-22 16:09:11 +00:00
file 466ea98f2a Add an 'X' option to the asterisk application which enables #exec for configuration files.
This option can be used to enable #exec support in the asterisk.conf configuration file.

(closes issue #16260)
Reported by: atis
Patches:
      exec_includes.patch uploaded by atis (license 242)


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@232510 f38db490-d61c-443f-a65b-d21fe96a405b
2009-12-02 20:10:07 +00:00
tilghman 7326fe3151 Reorder option flags. Change guidelines so that example code is consistent with guidelines
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@231369 f38db490-d61c-443f-a65b-d21fe96a405b
2009-11-26 02:09:58 +00:00
oej 47269d650e Add the capability to require a module to be loaded, or else Asterisk exits.
Review: https://reviewboard.asterisk.org/r/426/


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@229819 f38db490-d61c-443f-a65b-d21fe96a405b
2009-11-13 08:52:28 +00:00
russell a0a2975952 Add an "Asterisk Architecture Overview" section to the doxygen documentation.
This is a side project I've been poking at this week.  The intent is to discuss
Asterisk architecture in a top down fashion to help new developers understand how
Asterisk is put together.  There is a ton of stuff to write about, so this will
just continue to evolve over time.


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@226606 f38db490-d61c-443f-a65b-d21fe96a405b
2009-10-30 04:08:39 +00:00
tilghman 5081871fa4 Merged revisions 221776 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r221776 | tilghman | 2009-10-01 18:53:12 -0500 (Thu, 01 Oct 2009) | 2 lines
  
  Fix a bunch of off-by-one errors
........


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@221777 f38db490-d61c-443f-a65b-d21fe96a405b
2009-10-01 23:59:15 +00:00
tilghman d170b913b9 Change the default behavior of Set, AGI, and pbx_realtime to 1.6 behavior by default (starting in 1.6.3).
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@220417 f38db490-d61c-443f-a65b-d21fe96a405b
2009-09-24 22:53:23 +00:00
tilghman d1ec1aa57d AST-2009-005
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@211539 f38db490-d61c-443f-a65b-d21fe96a405b
2009-08-10 19:20:57 +00:00
russell aa0e8f1b3c Move OpenSSL initialization to a single place, make library usage thread-safe.
While doing some reading about OpenSSL, I noticed a couple of things that
needed to be improved with our usage of OpenSSL.

1) We had initialization of the library done in multiple modules.  This has now
   been moved to a core function that gets executed during Asterisk startup.
   We already link OpenSSL into the core for TCP/TLS functionality, so this
   was the most logical place to do it.

2) OpenSSL is not thread-safe by default.  However, making it thread safe is
   very easy.  We just have to provide a couple of callbacks.  One callback
   returns a thread ID.  The other handles locking.  For more information,
   start with the "Is OpenSSL thread-safe?" question on the FAQ page of
   openssl.org.


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@205120 f38db490-d61c-443f-a65b-d21fe96a405b
2009-07-08 15:17:19 +00:00
russell ac3b35dcc7 Merge the new Channel Event Logging (CEL) subsystem.
CEL is the new system for logging channel events.  This was inspired after
facing many problems trying to represent what is possible to happen to a call
in Asterisk using CDR records.  For more information on CEL, see the built in
HTML or PDF documentation generated from the files in doc/tex/.

Many thanks to Steve Murphy (murf) and Brian Degenhardt (bmd) for their hard
work developing this code.  Also, thanks to Matt Nicholson (mnicholson) and
Sean Bright (seanbright) for their assistance in the final push to get this
code ready for Asterisk trunk.

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


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@203638 f38db490-d61c-443f-a65b-d21fe96a405b
2009-06-26 15:28:53 +00:00
dvossel 7803be8ee4 fixes some memory leaks and redundant conditions
(closes issue #15269)
Reported by: contactmayankjain
Patches:
      patch.txt uploaded by contactmayankjain (license 740)
      memory_leak_stuff.trunk.diff uploaded by dvossel (license 671)
Tested by: contactmayankjain, dvossel




git-svn-id: http://svn.digium.com/svn/asterisk/trunk@201678 f38db490-d61c-443f-a65b-d21fe96a405b
2009-06-18 16:37:42 +00:00
seanbright 6684175242 Merged revisions 199022 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r199022 | seanbright | 2009-06-04 10:14:57 -0400 (Thu, 04 Jun 2009) | 40 lines
  
  Safely handle AMI connections/reload requests that occur during startup.
  
  During asterisk startup, a lock on the list of modules is obtained by the
  primary thread while each module is initialized.  Issue 13778 pointed out a
  problem with this approach, however.  Because the AMI is loaded before other
  modules, it is possible for a module reload to be issued by a connected client
  (via Action: Command), causing a deadlock.
  
  The resolution for 13778 was to move initialization of the manager to happen
  after the other modules had already been lodaded.  While this fixed this
  particular issue, it caused a problem for users (like FreePBX) who call AMI
  scripts via an #exec in a configuration file (See issue 15189).
  
  The solution I have come up with is to defer any reload requests that come in
  until after the server is fully booted.  When a call comes in to
  ast_module_reload (from wherever) before we are fully booted, the request is
  added to a queue of pending requests.  Once we are done booting up, we then
  execute these deferred requests in turn.
  
  Note that I have tried to make this a bit more intelligent in that it will not
  queue up more than 1 request for the same module to be reloaded, and if a
  general reload request comes in ('module reload') the queue is flushed and we
  only issue a single deferred reload for the entire system.
  
  As for how this will impact existing installations - Before 13778, a reload
  issued before module initialization was completed would result in a deadlock.
  After 13778, you simply couldn't connect to the manager during startup (which
  causes problems with #exec-that-calls-AMI configuration files).  I believe this
  is a good general purpose solution that won't negatively impact existing
  installations.
  
  (closes issue #15189)
  (closes issue #13778)
  Reported by: p_lindheimer
  Patches:
        06032009_15189_deferred_reloads.diff uploaded by seanbright (license 71)
  Tested by: p_lindheimer, seanbright
  
  Review: https://reviewboard.asterisk.org/r/272/
........


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@199051 f38db490-d61c-443f-a65b-d21fe96a405b
2009-06-04 14:31:24 +00:00
seanbright 063174ec54 Call ast_stun_init() when we're initializing to get the 'stun debug set'
commands.


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@196417 f38db490-d61c-443f-a65b-d21fe96a405b
2009-05-22 21:11:03 +00:00
kpfleming 230a66da7d 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: http://svn.digium.com/svn/asterisk/trunk@196072 f38db490-d61c-443f-a65b-d21fe96a405b
2009-05-21 21:13:09 +00:00
tilghman 1bfdea3a54 Move the spawn of astcanary down, until after the call to daemon(3).
This avoids possible conflicts with the internal implementation of
daemon(3).
(closes issue #15093)
 Reported by: tzafrir
 Patches: 
       20090513__issue15093__2.diff.txt uploaded by tilghman (license 14)
 Tested by: tzafrir


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@195320 f38db490-d61c-443f-a65b-d21fe96a405b
2009-05-18 19:17:15 +00:00
seanbright e9bae8401b Update copyright year to 2009
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@191700 f38db490-d61c-443f-a65b-d21fe96a405b
2009-05-02 15:45:07 +00:00
tilghman 8c68287e96 Detect eaccess (or euidaccess) before using it.
Reported by Andrew Lindh via the -dev list.


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@191367 f38db490-d61c-443f-a65b-d21fe96a405b
2009-04-30 17:40:58 +00:00