Commit Graph

2127 Commits

Author SHA1 Message Date
Richard Mudgett 28ad5ced1a Initial minimum ast_party_caller support.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@210354 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-08-04 16:36:41 +00:00
David Brooks 48363c16e1 Fixes numerous spelling errors. Patch submitted by alecdavis.
(closes issue #15595)
Reported by: alecdavis



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@209554 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-07-30 16:07:05 +00:00
Kevin P. Fleming ba020fc390 Define side-effect-safe MIN and MAX macros and remove duplicate definitions from various files.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@209400 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-07-28 13:49:46 +00:00
David Brooks d81d6d3415 Fixing typos. Replaces "recieved" with "received" and "initilize" with "initialize"
(closes issue #15571)
Reported by: alecdavis



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@209098 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-07-27 16:33:50 +00:00
Kevin P. Fleming 17e2d9fdbc Resolve a T.38 negotiation issue left over from the udptl-updates merge.
The udptl-updates branch that was merged yesterday failed to properly send back
T.38 SDP responses with the correct error correction mode, if the incoming SDP
from the other end caused us to change error correction modes. This patch
corrects that situation.



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@208548 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-07-24 15:02:53 +00:00
Kevin P. Fleming 0a6e06c7ff Rework of T.38 negotiation and UDPTL API to address interoperability problems
Over the past couple of months, a number of issues with Asterisk
negotiating (and successfully completing) T.38 sessions with various
endpoints have been found. This patch attempts to address many of
them, primarily focused around ensuring that the endpoints'
MaxDatagram size is honored, and in addition by ensuring that T.38
session parameter negotiation is performed correctly according to the
ITU T.38 Recommendation.

The major changes here are:

1) T.38 applications in Asterisk (app_fax) only generate/receive IFP
packets, they do not ever work with UDPTL packets. As a result of
this, they cannot be allowed to generate packets that would overflow
the other endpoints' MaxDatagram size after the UDPTL stack adds any
error correction information. With this patch, the application is told
the maximum *IFP* size it can generate, based on a calculation using
the far end MaxDatagram size and the active error correction mode on
the T.38 session. The same is true for sending *our* MaxDatagram size
to the remote endpoint; it is computed from the value that the
application says it can accept (for a single IFP packet) combined with
the active error correction mode.

2) All treatment of T.38 session parameters as 'capabilities' in
chan_sip has been removed; these parameters are not at all like
audio/video stream capabilities. There are strict rules to follow for
computing an answer to a T.38 offer, and chan_sip now follows those
rules, using the desired parameters from the application (or channel)
that wants to accept the T.38 negotiation.

3) chan_sip now stores and forwards ast_control_t38_parameters
structures for tracking 'our' and 'their' T.38 session parameters;
this greatly simplifies negotiation, especially for pass-through
calls.

4) Since T.38 negotiation without specifying parameters or receiving
the final negotiated parameters is not very worthwhile, the
AST_CONTROL_T38 control frame has been removed. A note has been added
to UPGRADE.txt about this removal, since any out-of-tree applications
that use it will no longer function properly until they are upgraded
to use AST_CONTROL_T38_PARAMETERS.

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



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@208464 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-07-23 21:57:24 +00:00
Tilghman Lesher d223e3636f Merged revisions 208083 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r208083 | tilghman | 2009-07-22 15:23:53 -0500 (Wed, 22 Jul 2009) | 4 lines
  
  Export symbols for functions included in our compatibility headers.
  (closes issue #15556)
   Reported by: smw1218
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@208151 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-07-22 22:35:57 +00:00
Russell Bryant 299a9ff3fa Remove trailing whitespace.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@208018 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-07-22 14:35:49 +00:00
Russell Bryant 4cf8a968fd Add an API for reporting security events, and a security event logging module.
This commit introduces the security events API.  This API is to be used by
Asterisk components to report events that have security implications.
A simple example is when a connection is made but fails authentication.  These
events can be used by external tools manipulate firewall rules or something
similar after detecting unusual activity based on security events.

Inside of Asterisk, the events go through the ast_event API.  This means that
they have a binary encoding, and it is easy to write code to subscribe to these
events and do something with them.

One module is provided that is a subscriber to these events - res_security_log.
This module turns security events into a parseable text format and sends them
to the "security" logger level.  Using logger.conf, these log entries may be
sent to a file, or to syslog.

One service, AMI, has been fully updated for reporting security events.
AMI was chosen as it was a fairly straight forward service to convert.
The next target will be chan_sip.  That will be more complicated and will
be done as its own project as the next phase of security events work.

For more information on the security events framework, see the documentation
generated from doc/tex/.  "make asterisk.pdf"

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@206021 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-07-11 19:15:03 +00:00
Kevin P. Fleming 67d1957e60 Repair ability of SendFAX/ReceiveFAX to respond to T.38 switchover.
Recent changes in T.38 negotiation in Asterisk caused these applications to
not respond when the other endpoint initiated a switchover to T.38; this
resulted in the T.38 switchover failing, and the FAX attempt to be made
using an audio connection, instead of T.38 (which would usually cause the
FAX to fail completely).

This patch corrects this problem, and the applications will now correctly
respond to the T.38 switchover request. In addition, the response will include
the appopriate T.38 session parameters based on what the other end offered
and what our end is capable of.

(closes issue #14849)
Reported by: afosorio


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@205696 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-07-09 21:20:23 +00:00
David Vossel f3560397be Merged revisions 205599 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r205599 | dvossel | 2009-07-09 11:18:09 -0500 (Thu, 09 Jul 2009) | 2 lines
  
  Changing ast_samp2tv to not use floating point.
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@205600 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-07-09 16:19:09 +00:00
David Vossel ba2a8457b8 Merged revisions 205471 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r205471 | dvossel | 2009-07-08 18:15:54 -0500 (Wed, 08 Jul 2009) | 10 lines
  
  Fixes 8khz assumptions
  
  Many calculations assume 8khz is the codec rate. This
  is not always the case.  This patch only addresses chan_iax.c
  and res_rtp_asterisk.c, but I am sure there are other areas
  that make this assumption as well.
  
  Review: https://reviewboard.asterisk.org/r/306/
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@205479 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-07-08 23:19:09 +00:00
David Vossel e39a252b1e Merged revisions 205409 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r205409 | dvossel | 2009-07-08 16:35:12 -0500 (Wed, 08 Jul 2009) | 6 lines
  
  moving ast_devstate_to_extenstate to pbx.c from devicestate.c
  
  ast_devstate_to_extenstate belongs in pbx.c.  This change
  fixes a compile time error with chan_vpb as well.
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@205412 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-07-08 22:15:06 +00:00
David Vossel 15b94d1182 Merged revisions 205215 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r205215 | dvossel | 2009-07-08 11:53:40 -0500 (Wed, 08 Jul 2009) | 10 lines
  
  ast_samp2tv needs floating point for 16khz audio
  
  In ast_samp2tv(), (1000000 / _rate) = 62.5 when _rate is 16000.
  The .5 is currently stripped off because we don't calculate
  using floating points.  This causes madness with 16khz audio.
  
  (issue ABE-1899)
  
  Review: https://reviewboard.asterisk.org/r/305/
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@205216 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-07-08 16:54:24 +00:00
Sean Bright e75ae63ac2 Fix a few compilation problems found when building Asterisk against uClibc.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@205214 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-07-08 16:43:12 +00:00
Russell Bryant 0e8c630224 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: https://origsvn.digium.com/svn/asterisk/trunk@205120 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-07-08 15:17:19 +00:00
Sean Bright ee0cd5a32c Add a configure check for Reverse Charging Indication support in LibPRI.
Also go back and wrap all of the places that use the specific reverse charge
APIs with preprocessor conditionals.


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@204919 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-07-03 15:44:01 +00:00
Sean Bright c381cf82e7 Wrap rtp_engine.h header comments to 80 characters.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@204893 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-07-03 02:02:50 +00:00
David Vossel 48c9a85d91 Merged revisions 204681 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r204681 | dvossel | 2009-07-02 10:05:57 -0500 (Thu, 02 Jul 2009) | 14 lines
  
  Improved mapping of extension states from combined device states.
  
  This fixes a few issues with incorrect extension states and adds
  a cli command, core show device2extenstate, to display all possible
  state mappings.
  
  (closes issue #15413)
  Reported by: legart
  Patches:
        exten_helper.diff uploaded by dvossel (license 671)
  Tested by: dvossel, legart, amilcar
  
  Review: https://reviewboard.asterisk.org/r/301/
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@204710 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-07-02 16:03:44 +00:00
Russell Bryant c511a26749 Move Asterisk-addons modules into the main Asterisk source tree.
Someone asked yesterday, "is there a good reason why we can't just put these
modules in Asterisk?".  After a brief discussion, as long as the modules are
clearly set aside in their own directory and not enabled by default, it is
perfectly fine.

For more information about why a module goes in addons, see README-addons.txt.

chan_ooh323 does not currently compile as it is behind some trunk API updates.
However, it will not build by default, so it should be okay for now.


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@204413 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-06-30 16:40:38 +00:00
Tilghman Lesher b5f6eac49e Allow trunk to once again compile under MALLOC_DEBUG
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@204118 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-06-29 17:56:29 +00:00
Russell Bryant cce4fad522 Make invalid hints report Unavailable instead of Idle.
(closes issue #14413)
Reported by: pj


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@203702 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-06-26 19:31:14 +00:00
Joshua Colp 59c1998d67 Improve T.38 negotiation by exchanging session parameters between application and channel.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@203699 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-06-26 19:27:24 +00:00
Russell Bryant 27e1708eed Note a new API call, and one that changed in doxygen.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@203640 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-06-26 15:42:26 +00:00
Russell Bryant 0264eef115 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: https://origsvn.digium.com/svn/asterisk/trunk@203638 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-06-26 15:28:53 +00:00
Sean Bright e06c6f97c4 Add functions to map syslog facilities and priorities constants to strings.
Also change the default casing of the string contants to lowercase.  This really
just saves us from have to lowercase them later when displaying them.


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@203605 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-06-26 13:00:35 +00:00
Sean Bright 2f88262abb Add checks in configure for non-POSIX syslog facilities.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@203569 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-06-26 03:06:06 +00:00
Sean Bright 4535305772 Move syslog utility functions into a separate file so they can be re-used.
This has the pleasant side effect of cleaning up the header inclusion process
in logger.c.


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@203508 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-06-25 23:54:03 +00:00
David Vossel 87c8658912 attempting to load running modules
Modules placed in the priority heap for loading were not properly removed from the linked list.  This resulted in some modules attempting to load twice.



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@202410 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-06-22 15:33:35 +00:00
Joshua Colp e85296e244 Add support for allowing an RTP engine to decide on whether it is possible for specific formats to be transcoded for an RTP instance.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@201902 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-06-19 15:41:24 +00:00
Mark Michelson dce6a54a4a Trunk implementation of setting an alternate RTP source.
This contains the interface by which we can let an rtp instance know
that it might start receiving audio from a new source. This is similar
in nature to revision 197588 of Asterisk 1.4.

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



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@201583 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-06-18 15:20:17 +00:00
Kevin P. Fleming 962bd7ab26 Merged revisions 201261 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r201261 | kpfleming | 2009-06-17 07:03:25 -0500 (Wed, 17 Jun 2009) | 9 lines
  
  Correct AST_LIST_APPEND_LIST behavior when list to be appended is empty.
  
  When the list to be appended is empty, and the list to be appended to is *not*,
  AST_LIST_APPEND_LIST would actually cause the target list to become broken,
  and no longer have a pointer to its last entry. This patch fixes the problem.
  
  (reported by Stanislaw Pitucha on the asterisk-dev mailing list)
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@201262 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-06-17 12:04:17 +00:00
Kevin P. Fleming f1dc620467 Enable applications to enable/disable digit and tone detection.
Some applications (notably app_fax) do not need digit detection nor FAX tone
detection while they are running, and if Asterisk is using software DSPs to provide
the detection, this consumes extra CPU cycles that could be better spent on the
actual application. This patch allows applications to query and control the state
of digit and tone detection on a channel, and modifies app_fax to disable them
while the FAX operations are occurring (and re-enable digit detection afterwards).



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@201139 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-06-16 21:10:15 +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
Kevin P. Fleming aaeec3b40f Last batch of 'static' qualifiers for module-level global variables.
Fix up modules in the 'apps' directory, and also correct the bad example of
enum definitions in include/asterisk/app.h, which many developers followed
(thanks for reading the documentation!). In addition, add some basic usage
examples of the 'pahole' and 'pglobal' tools to the coding guidelines.



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@200656 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-06-15 19:10:10 +00:00
Kevin P. Fleming 82fb56886e More 'static' qualifiers on module global variables.
The 'pglobal' tool is quite handy indeed :-)



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@200620 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-06-15 17:34:30 +00:00
Kevin P. Fleming 6c5987811c Redesigned 'optional API' support.
This patch provides a new implementation of the optional API support defined
in asterisk/optional_api.h; this new version provides solves compatibility
issues with the use of linker version scripts for suppressing global symbols.
In addition, there is now a functional (and tested!) implementation for Mac OS/X,
so module writers no longer need to use special tests before calling optional
API functions. All future implementations must provide these same semantics,
so that module writers can rely on them.



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@200519 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-06-15 16:07:23 +00:00
Sean Bright 2cec55f038 Merged revisions 199856 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r199856 | seanbright | 2009-06-10 12:08:35 -0400 (Wed, 10 Jun 2009) | 2 lines
  
  __WORDSIZE is not available on all platforms, so use sizeof(void *) instead.
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@199857 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-06-10 16:10:23 +00:00
David Vossel d532cbcd8a module load priority
This patch adds the option to give a module a load priority. The value represents the order in which a module's load() function is initialized.  The lower the value, the higher the priority.  The value is only checked if the AST_MODFLAG_LOAD_ORDER flag is set.  If the AST_MODFLAG_LOAD_ORDER flag is not set, the value will never be read and the module will be given the lowest possible priority
on load.  Since some modules are reliant on a timing interface, the timing modules have been given a high load priorty.

(closes issue #15191)
Reported by: alecdavis
Tested by: dvossel

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@199743 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-06-09 16:22:04 +00:00
Sean Bright 8ceb6c5d20 Merged revisions 199626,199628 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r199626 | seanbright | 2009-06-08 15:24:32 -0400 (Mon, 08 Jun 2009) | 21 lines
  
  Increase the size of our thread stack on 64 bit processors.
  
  We were setting the stack size for each thread to 240KB regardless of
  architecture, which meant that in some scenarios we actually had less available
  stack space on 64 bit processors (pointers use 8 bytes instead of 4).  So now we
  calculate the stack size we reserve based on the platform's __WORDSIZE, which
  gives us:
  
       32 bit -> 240KB
       64 bit -> 496KB
      128 bit -> 1008KB (that's right, we're ready for 128 bit processors)
  
  Patch typed by me but written by several members of #asterisk-dev, including
  Kevin, Tilghman, and Qwell.
  
  (closes issue #14932)
  Reported by: jpiszcz
  Patches:
        06052009_issue14932.patch uploaded by seanbright (license 71)
  Tested by: seanbright
........
  r199628 | seanbright | 2009-06-08 15:28:33 -0400 (Mon, 08 Jun 2009) | 2 lines
  
  Fix a typo in the stack size calculation just introduced.
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@199630 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-06-08 19:33:09 +00:00
David Vossel d1d9beadc9 Merged revisions 199297 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r199297 | dvossel | 2009-06-05 16:19:56 -0500 (Fri, 05 Jun 2009) | 14 lines
  
  Fixes issue with hints giving unexpected results.
  
  Hints with two or more devices that include ONHOLD gave unexpected results.
  
  (closes issue #15057)
  Reported by: p_lindheimer
  Patches:
        onhold_trunk.diff uploaded by dvossel (license 671)
        pbx.c.1.4.patch uploaded by p (license 558)
        devicestate.c.trunk.patch uploaded by p (license 671)
  Tested by: p_lindheimer, dvossel
  
  Review: https://reviewboard.asterisk.org/r/254/
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@199298 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-06-05 21:21:22 +00:00
Sean Bright befad10893 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: https://origsvn.digium.com/svn/asterisk/trunk@199051 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-06-04 14:31:24 +00:00
David Vossel 3830c415c7 Generic call forward api, ast_call_forward()
The function ast_call_forward() forwards a call to an extension specified in an ast_channel's call_forward string.  After an ast_channel is called, if the channel's call_forward string is set this function can be used to forward the call to a new channel and terminate the original one.  I have included this api call in both channel.c's ast_request_and_dial() and feature.c's feature_request_and_dial().  App_dial and app_queue already contain call forward logic specific for their application and options.

(closes issue #13630)
Reported by: festr

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



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@198856 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-06-02 21:17:49 +00:00
Mark Michelson 298d745fb4 Add the ability to execute connected line interception macros.
When connected line updates are received or generated in the middle
of an application call, it is now possible to execute a macro to
manipulate the connected line data. This way, phone numbers may be
manipulated to be more presentable to users, names may be changed 
for...whatever reason, or whatever else needs to be done may be.

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

AST-165



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@198727 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-06-01 20:57:31 +00:00
Russell Bryant 8da5e991ee Minor whitespace fix.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@198670 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-06-01 20:17:50 +00:00
Russell Bryant 8580871fd4 Constify the ast_frame arg to ast_queue_frame().
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@198434 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-05-31 01:19:30 +00:00
Matthew Nicholson c8b0c41ed8 Merged revisions 198068 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r198068 | mnicholson | 2009-05-29 13:53:01 -0500 (Fri, 29 May 2009) | 15 lines
  
  Use AST_CDR_NOANSWER instead of AST_CDR_NULL as the default CDR disposition.
  
  This change also involves the addition of an AST_CDR_FLAG_ORIGINATED flag that is used on originated channels to distinguish: them from dialed channels.
  
  (closes issue #12946)
  Reported by: meral
  Patches:
        null-cdr2.diff uploaded by mnicholson (license 96)
  Tested by: mnicholson, dbrooks
  
  (closes issue #15122)
  Reported by: sum
  Tested by: sum
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@198072 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-05-29 19:04:24 +00:00
Sean Bright c772d5a0e6 Update references to downloads.digium.com to its new URL.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@197861 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-05-28 22:42:27 +00:00
Sean Bright f51bb019bb Update references to bugs.digium.com and reviewboard.digium.com to the new URLs.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@197824 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-05-28 21:50:27 +00:00
Terry Wilson 71a3a2ebf6 Add Calendaring support for Asterisk
This commit add Calendaring support to Asterisk for iCalendar, CalDAV, and MS
Exchange calendars. Exchange support has only been tested on Exchange Server 2k3
and does not support forms-based authentication at this time (patches *very*
welcome). Exchange support is also currently missing the ability to return a
list of a meting's attendees (again, patches are very, very welcome).

Features include:
  Querying a calendar for events over a specific time range
  Checking a calendar's busy status via the dialplan
  Writing calendar events via the dialplan (CalDAV and Exchange only)
  Handling calendar event notifications through the dialplan

(closes issue #14771)
Tested by: lmadsen, twilson, Shivaprakash

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@197738 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-05-28 19:57:18 +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 1a02e34ccf Ensure that this header includes xmldoc.h, since it depends on it.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@197335 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-05-27 22:21:53 +00:00
Russell Bryant 0e62eddb93 Update configure script to check for OSP toolkit 3.5.0.
(closes issue #14988)
Reported by: tzafrir
Patches:
      configure.ac.diff uploaded by homesick (license 91)
      new_ast_check_osptk.m4 uploaded by homesick (license 91)


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@196946 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-05-26 22:40:34 +00:00
Sean Bright 3abe8a963e Add new ast_complete_applications function so that we can use it with the
'channel originate ... application <app>' CLI command.

(And yeah, I cleaned up some whitespace in res_clioriginate.c... big whoop,
wanna fight about it!?)


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@196758 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-05-26 14:36:11 +00:00
Kevin P. Fleming 57eedf97d0 Correct example for CLI autocompletion (generation)
Reported by Atis on #asterisk-dev



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@196488 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-05-23 13:31:56 +00:00
Eliel C. Sardanons 2c882626a0 Implement a new element in AstXML for AMI actions documentation.
A new xml element was created to manage the AMI actions documentation,
using AstXML.
To register a manager action using XML documentation it is now possible
using ast_manager_register_xml().
The CLI command 'manager show command' can be used to show the parsed
documentation.

Example manager xml documentation:
<manager name="ami action name" language="en_US">
    <synopsis>
        AMI action synopsis.
    </synopsis>
    <syntax>
        <xi:include xpointer="xpointer(...)" /> <-- for ActionID
        <parameter name="header1" required="true">
	    <para>Description</para>
	</parameter>
	...
    </syntax>
    <description>
        <para>AMI action description</para>
    </description>
    <see-also>
    	...
    </see-also>
</manager>



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@196308 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-05-22 17:52:35 +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
Matthew Nicholson d02ad6b5f7 Merged revisions 195881 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r195881 | mnicholson | 2009-05-21 10:25:50 -0500 (Thu, 21 May 2009) | 13 lines
  
  This commit prevents cdr records with AST_CDR_FLAG_ANSLOCKED and AST_CDR_FLAG_LOCKED from being updated in certain cases.
  
  This is accomplished by adding two functions to update the answer time and disposition of calls that checks for the proper lock flags.  These functions are used in the ast_bridge_call() function so that ForkCDR(A) calls are respected.
  
  This patch also modifies the way ast_bridge_call() chooses the cdr record to base the bridged_cdr on.  Previously the first unlocked cdr record would be chosen, now instead the first cdr record is chosen and forked cdr records are moved to the bridge_cdr.  This allows the original cdr record and any forked cdr records to be properly updated with answer and end times.
  
  (closes issue #13797)
  Reported by: sh0t
  Tested by: sh0t
  
  (closes issue #14744)
  Reported by: deepesh
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@195882 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-05-21 15:33:55 +00:00
Tilghman Lesher bdcafc1ab4 Recorded merge of revisions 195366 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r195366 | tilghman | 2009-05-18 15:24:13 -0500 (Mon, 18 May 2009) | 8 lines
  
  Add a similar dependency on SMDI for voicemail as already exists for ADSI.
  (closes issue #14846)
   Reported by: pj
   Patches: 
         20090413__bug14846__1.4.diff.txt uploaded by tilghman (license 14)
         20090507__issue14846__1.6.0.diff.txt uploaded by tilghman (license 14)
         20090507__issue14846__1.6.1.diff.txt uploaded by tilghman (license 14)
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@195370 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-05-18 20:52:33 +00:00
Kevin P. Fleming d1e0b11343 Add ability for modules to dynamically register logger levels
This patch adds the ability for modules to dynamically create logger levels for their own use; these are named levels just like the built-in levels, and can be directed to any destination that the logger can send any level to, by including their names in logger.conf.

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



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@194610 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-05-15 13:13:47 +00:00
Russell Bryant 9c16774cc2 Minor documentation update for ast_event_queue().
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@193461 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-05-09 11:33:09 +00:00
Kevin P. Fleming 2746f589b7 Add a more efficient way of allocating structures that use stringfields
This commit adds an API call that can be used to allocate a structure along with this stringfield storage in a single allocation.



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@192362 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-05-05 14:17:18 +00:00
Kevin P. Fleming 1f49e675bb Correct some flaws in the memory accounting code for stringfields and ao2 objects
Under some conditions, the memory allocation for stringfields and ao2 objects would not have supplied valid file/function names for MALLOC_DEBUG tracking, so this commit corrects that.



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@192357 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-05-05 13:18:21 +00:00
Kevin P. Fleming ec5116f80c Properly account for memory allocated for channels and datastores
As in previous commits, when channels are allocated (with ast_channel_alloc) or datastores are allocated (with ast_datastore_alloc) properly account for the memory being owned by the caller, instead of the allocator function itself.



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@192318 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-05-05 10:34:19 +00:00
Kevin P. Fleming d8182202ef Ensure that string pools allocated to hold stringfields are properly accounted in MALLOC_DEBUG mode
This commit modifies the stringfield pool allocator to remember the 'owner' of the stringfield manager the pool is being allocated for, and ensures that pools allocated in the future when fields are populated are owned by that file/function.



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@192279 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-05-05 08:51:06 +00:00
Tilghman Lesher e0aba74fa9 Restore 'asyncagi break' command to 1.6.1 and higher.
(closes issue #14985)
 Reported by: nikkk
 Patches: 
       20090428__bug14985.diff.txt uploaded by tilghman (license 14)
       20090429__bug14985__1.6.1.diff.txt uploaded by tilghman (license 14)
 Tested by: nikkk


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@192171 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-05-04 19:29:13 +00:00
Kevin P. Fleming 1726475a54 Ensure that astobj2 memory allocations are properly accounted for when MALLOC_DEBUG is used
This commit ensures that all astobj2 allocated objects are properly accounted for in MALLOC_DEBUG mode by passing down the file/function/line information from the module/function that actually called the astobj2 allocation function.



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@192059 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-05-04 16:24:16 +00:00
Kevin P. Fleming 73743b77b0 Add 'bitflags'-style information elements to event framework
This patch add a new payload type for information elements, a set
of bit flags. The payload is transported as a 32-bit unsigned integer
but when matching is performed between events and subscribers,
the matching is done by using a bitwise AND instead of numeric value
comparison.

Review: http://reviewboard.asterisk.org/r/242/



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@191919 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-05-03 14:28:59 +00:00
Kevin P. Fleming a3af213506 Remove rarely-used event_log/LOG_EVENT support
In discussions today at the Europe Asterisk Developer Meet-Up, we determined that
the event_log was used in only 9 places in the entire tree, and really was not needed
at all. The users have been converted to use LOG_NOTICE, or the messages have been
removed since other messages were already in place that provided the same information.



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@191785 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-05-02 19:02:22 +00:00
Kevin P. Fleming d9d2779008 Add buffer and echo canceller control to CHANNEL() dialplan function for DAHDI channels
Adds ability for CHANNEL() dialplan function, when used on DAHDI channels,
to temporarily change the number of buffers and/or the buffer policy, and also
to enable, disable, or switch the echo canceller between FAX/data and voice
modes.



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@191411 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-04-30 21:42:35 +00:00
Tilghman Lesher 91dde03ba8 Detect eaccess (or euidaccess) before using it.
Reported by Andrew Lindh via the -dev list.


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@191367 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-04-30 17:40:58 +00:00
David Vossel a6adc84e69 SIP option to specify outbound TLS/SSL client protocol.
chan_sip allows for outbound TLS connections, but does not allow the user to specify what protocol to use (default was SSLv2, and still is if this new option is not specified).  This patch lets the user pick the SSL/TLS client method for outbound connections in sip.

(closes issue #14770)
Reported by: TheOldSaint

(closes issue #14768)
Reported by: TheOldSaint

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



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@191177 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-04-29 21:13:43 +00:00
Tilghman Lesher a866a75900 Merge str_substitution branch.
This branch adds additional methods to dialplan functions, whereby the result
buffers are now dynamic buffers, which can be expanded to the size of any
result.  No longer are variable substitutions limited to 4095 bytes of data.
In addition, the common case of needing buffers much smaller than that will
enable substitution to only take up the amount of memory actually needed.
The existing variable substitution routines are still available, but users
of those API calls should transition to using the dynamic-buffer APIs.
Reviewboard: http://reviewboard.digium.com/r/174/


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@191140 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-04-29 18:53:01 +00:00
David Vossel ca138fc807 Consistent SSL/TLS options across conf files
ast_tls_read_conf() is a new api call for handling SSL/TLS options across all conf files.  Before this change, SSL/TLS options were not consistent.  http.conf and manager.conf required the 'ssl' prefix while sip.conf used options with the 'tls' prefix.  While the options had different names in different conf files, they all did the exact same thing.  Now, instead of mixing 'ssl' or 'tls' prefixes to do the same thing depending on what conf file you're in, all SSL/TLS options use the 'tls' prefix.  For example.  'sslenable' in http.conf and manager.conf is now 'tlsenable' which matches what already existed in sip.conf. Since this has the potential to break backwards compatibility, previous options containing the 'ssl' prefix still work, but they are no longer documented in the sample.conf files.  The change is noted in the CHANGES file though.

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



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@191028 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-04-29 14:39:48 +00:00
Russell Bryant 2c1ffef923 Resolve Solaris build issues and add some API documentation.
(issue #14981)
Reported by: snuffy


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@190989 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-04-29 08:51:21 +00:00
Kevin P. Fleming a9657a86bf Merged revisions 190721 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r190721 | kpfleming | 2009-04-27 14:29:46 -0500 (Mon, 27 Apr 2009) | 7 lines
  
  Fix 'inconsistent line endings' when autoconf 2.63 is used
  
  Attempt to make configure script regeneration 'safe' using autoconf 2.63, which embeds a bare CR into the script, thus making Subversion complain about inconsistent line endings
  
  This commit changes the MIME type of the configure script to be 'binary' thus making Subversion no longer inspect line endings, and as a bonus 'svn diff' will no longer try to generate diff output for it, which is not generally useful anyway.
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@190725 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-04-27 19:30:54 +00:00
David Vossel 8f0b88c8c8 TLS/SSL private key option
Adds option to specify a private key .pem file when configuring TLS or SSL in AMI, HTTP, and SIP.  Before this, the certificate file was used for both the public and private key.  It is possible for this file to hold both, but most configurations allow for a separate private key file to be specified.  Clarified in .conf files how these options are to be used.  The current conf files do not explain how the private key is handled at all, so without knowledge of Asterisk's TLS implementation, it would be hard to know for sure what was going on or how to set it up.

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@190545 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-04-24 21:22:31 +00:00
Richard Mudgett 014aa91b84 Update comment.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@190516 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-04-24 17:33:08 +00:00
Russell Bryant f052718a80 Add \since tag for new API calls.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@190484 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-04-24 15:26:10 +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
Tilghman Lesher ce6ebaef97 Support HTTP digest authentication for the http manager interface.
(closes issue #10961)
 Reported by: ys
 Patches: 
       digest_auth_r148468_v5.diff uploaded by ys (license 281)
       SVN branch http://svn.digium.com/svn/asterisk/team/group/manager_http_auth
 Tested by: ys, twilson, tilghman
 Review: http://reviewboard.digium.com/r/223/
 Reviewed by: tilghman,russellb,mmichelson


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@190349 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-04-23 20:36:35 +00:00
Tilghman Lesher 25cea89d90 Merged revisions 190092 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r190092 | tilghman | 2009-04-22 16:35:03 -0500 (Wed, 22 Apr 2009) | 7 lines
  
  Detect availability of pthread_rwlock_timedwrlock() before using it.
  (closes issue #14930)
   Reported by: tilghman
   Patches: 
         20090420__bug14930.diff.txt uploaded by tilghman (license 14)
   Tested by: mvanbaak, tilghman
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@190093 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-04-22 21:38:15 +00:00
Jeff Peeler 11ac1f7e11 Fix building of chan_h323 with gcc-3.3
There seems to be a bug with old versions of g++ that doesn't allow a structure
member to use the name list. Rename list member to group_list in ast_group_info
and change the few places it is used.

(closes issue #14790)
Reported by: stuarth


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@190057 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-04-22 21:15:55 +00:00
Doug Bailey f431c867dd Merged revisions 189601 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r189601 | dbailey | 2009-04-21 09:00:55 -0500 (Tue, 21 Apr 2009) | 3 lines
  
  Add check in configure script to check for GLOB_NOMAGIC and GLOB_BRACE in glob.h 
  This allows config.c to compile when linked against uclibc that does not support these parameters
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@189629 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-04-21 14:28:04 +00:00
Jeff Peeler 1172c38647 Add service maintenance message support
This is the companion commit to libpri r732. Service messages are now supported
for switch types 4ess/5ess. A new option service_message_support has been added
to chan_dahdi.conf and is noted in the sample config file. The service message
support is turned off by default. The current implementation relies on AstDB
to keep track of channel state, which allows the statuses to be preserved
across Asterisk restarts. Below is a description of the storage format.

The state and reason for the service state are in the form <state>:<reason>,
where:
<state> ::= { 'O' }  // 'O' – Out Of Service
<reason> ::= { '0' | '1' | '2' | '3' }, where:
'0' – No reason (backwards compatibility)
'1' – NEAR END
'2' – FAR END
'3' – both NEAR and FAR END

The new CLI commands to handle channel service state are:
pri service disable channel <chan>
pri service enable channel <chan>

Many people contributed to the development of this functionality. Because I
entered at the very end I do not know the exact history. Special thanks to 
all who moved the bug forward one way or another:
cmaj, PCadach, markster, mattf, drmac, MikeJ, serge-v, murf, kanelbullar, Seb7,
tilghman, lmadsen, and especially dhubbard (he answered lots of my questions
and did a large portion of the work)

(closes issue #3450)
Reported by: cmaj



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@188342 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-04-14 15:54:16 +00:00
Kevin P. Fleming 2f048030bd revert addition of LOG_SECURITY log channel; after further discussion, a much better solution will be used
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@187636 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-04-10 15:11:16 +00:00
Tilghman Lesher 1030a25ac9 Modify headers and macros, according to Russell's suggestions on the -dev list
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@187599 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-04-10 03:55:27 +00:00
Jeff Peeler de4af72f9f Add ability for dialplan execution to continue when caller hangs up.
The F option to app_dial has been modified to accept no parameters and perform
the above functionality. I don't see anywhere else that is doing function
overloading, but this really is the best place for this operation because:

- It makes it close to the 'g' option in the argument list which provides
similar functionality.
- The existing code to support the current F option provides a very
convienient location to add this new feature.

(closes issue #12381)
Reported by: michael-fig



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@187491 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-04-09 19:10:02 +00:00
Tilghman Lesher 39808fa953 Merged revisions 187428 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r187428 | tilghman | 2009-04-09 13:08:20 -0500 (Thu, 09 Apr 2009) | 8 lines
  
  Race condition between ast_cli_command() and 'module unload' could cause a deadlock.
  Add lock timeouts to avoid this potential deadlock.
  (closes issue #14705)
   Reported by: jamessan
   Patches: 
         20090320__bug14705.diff.txt uploaded by tilghman (license 14)
   Tested by: jamessan
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@187483 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-04-09 18:40:01 +00:00
Joshua Colp abcc0b9397 Add support for allowing the channel driver to handle transcoding.
This was accomplished using a set of options and the setoption channel callback.
The core calls into the channel driver using these options and the channel driver
either returns success or failure.


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@187360 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-04-09 16:19:35 +00:00
Tilghman Lesher 8f28bfc63e Merged revisions 187300-187301 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r187300 | tilghman | 2009-04-08 23:31:38 -0500 (Wed, 08 Apr 2009) | 3 lines
  
  Add debugging mode for diagnosing file descriptor leaks.
  (Related to issue #14625)
........
  r187301 | tilghman | 2009-04-08 23:32:40 -0500 (Wed, 08 Apr 2009) | 2 lines
  
  Oops, missed this file in the last commit.
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@187302 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-04-09 04:59:05 +00:00
Kevin P. Fleming b5f8c632df add a dedicated log channel for modules to be able report security-related events, so that they can be fed into external processes for analysis and possible mitigation efforts
(inspired by this evening's Toronto Asterisk Users Group meeting and previous dicussions amongst various community members)



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@187269 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-04-09 02:44:27 +00:00
Jeff Peeler f57fddb5bb Add timer for features so that backup bridge config can go away
The biggest change done here was elimination of the backup_config for use with
features. Previously, the bridging code upon detecting a feature would set the
start time of the bridge to the start time of the feature. Then after the 
feature had either expired or timed out the start time would be reset to the
true bridge start time from the backup_config. Now, the time differences are
calculated with respect to the newly added feature_start_time timeval instead.

There should be no behavior changes from the previous functionality aside from
the bridge timing being unaffected by either valid or partial feature matches.
Previously the timing would be increased by the length of time configured for
featuredigittimeout, which was probably never noticed.

(closes issue #14503)
Reported by: KNK
Tested by: jpeeler

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@187211 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-04-08 21:00:39 +00:00
Russell Bryant 97209bfe3f Add documentation for reviewboard usage and guidelines.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@187179 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-04-08 19:59:21 +00:00
Russell Bryant 791b82b836 Add some additional notes on release numbering.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@186957 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-04-08 13:38:27 +00:00
Russell Bryant 2cb0018fa1 Start splitting up miscellaneous doxygen documentation into separate files.
doxyref.h was created to hold miscellaneous documentation that was not specific
to a part of the code.  This file has grown quite a bit so I decided to start
splitting parts of it out into new files.  Now, you can drop a new file into
include/asterisk/doxygen/ and it will be processed by doxygen.


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@186953 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-04-08 13:24:48 +00:00
Mark Michelson 6f53ed4c67 This commit introduces COLP/CONP and Redirecting party information into Asterisk.
The channel drivers which have been most heavily tested with these enhancements are
chan_sip and chan_misdn. Further work is being done to add Q.SIG support and will be
introduced in a later commit. chan_skinny has code added to it here, but according
to user pj, the support on chan_skinny is not working as of now. This will be fixed in
a later commit.

A special thanks goes out to bugtracker user gareth for getting the ball rolling and
providing the initial support for this work. Without his initial work on this, this would
not have been nearly as painless as it was.

This functionality has been tested by Digium's product quality department, as well as a
customer site running thousands of calls every day. In addition, many many many many bugtracker
users have tested this, too.

(closes issue #8824)
Reported by: gareth

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



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@186525 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-04-03 22:41:46 +00:00
Joshua Colp 2d9c6ef3d5 Add better support for relaying success or failure of the ast_transfer() API call.
This API call now waits for a special frame from the underlying channel driver to
indicate success or failure. This allows the return value to truly convey whether
the transfer worked or not. In the case of the Transfer() dialplan application this
means the value of the TRANSFERSTATUS dialplan variable is actually true.

(closes issue #12713)
Reported by: davidw
Tested by: file


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@186382 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-04-03 16:47:27 +00:00
Joshua Colp 954237b2a5 Merged revisions 186320 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r186320 | file | 2009-04-03 12:48:56 -0300 (Fri, 03 Apr 2009) | 5 lines
  
  Fix a problem with the crypto variable definitions not actually being defined properly.
  
  (closes issue #14804)
  Reported by: jvandal
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@186321 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-04-03 15:52:50 +00:00
Joshua Colp 63de834395 Merge in the RTP engine API.
This API provides a generic way for multiple RTP stacks to be
integrated into Asterisk. Right now there is only one present, res_rtp_asterisk,
which is the existing Asterisk RTP stack. Functionality wise this commit
performs the same as previously. API documentation can be viewed in the
rtp_engine.h header file.

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@186078 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-04-02 17:20:52 +00:00
Tilghman Lesher be40f3a33c Merge changes from str_substitution that are unrelated to that branch.
Included is a small bugfix to an ast_str helper, but most of these changes
are simply doxygen fixes.


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@185912 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-04-01 20:13:28 +00:00
Russell Bryant 1dda5f7c80 Fix dev-mode build on my box.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@185741 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-04-01 12:13:16 +00:00
Kevin P. Fleming a009068110 Optimizations to the stringfields API
This patch provides a number of optimizations to the stringfields API, focused around saving (not wasting) memory whenever possible. Thanks to Mark Michelson for inspiring this work and coming up with the first two optimizations that are represented here:

Changes:

- Cleanup of some code, fix incorrect doxygen comments

- When a field is emptied or replaced with a new allocation, decrease the amount of 'active' space in the pool it was held in; if that pool reaches zero active space, and is not the current pool, then free it as it is no longer in use

- When allocating a pool, try to allocate a size that will fit in a 'standard' malloc() allocation without wasting space

- When allocating space for a field, store the amount of space in the two bytes immediately preceding the field; this eliminates the need to call strlen() on the field when overwriting it, and more importantly it 'remembers' the amount of space the field has available, even if a shorter string has been stored in it since it was allocated

- Don't automatically double the size of each successive pool allocated; it's wasteful

http://reviewboard.digium.com/r/165/



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@185581 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-03-31 21:29:50 +00:00
Leif Madsen d000310a2a Update commit message guidelines in re: to punctuation.
The doxygen documentation has now been updated to state explicitly that I want
punctuation atthe end of the first sentence in a commit message. :).


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@184798 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-03-27 19:31:04 +00:00
Kevin P. Fleming 9381bff79d Improve timing interface to remember which provider provided a timer
The ability to load/unload timing interfaces is nice, but it means that when a timer is allocated, it may come from provider A, but later provider B becomes the 'preferred' provider. If this happens, all timer API calls on the timer that was provided by provider A will actually be handed to provider B, which will say WTF and return an error.

This patch changes the timer API to include a pointer to the provider of the timer handle so that future operations on the timer will be forwarded to the proper provider.

(closes issue #14697)
Reported by: moy

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



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@184762 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-03-27 19:10:32 +00:00
Russell Bryant 2a4f9f7181 Change global_app_buf to ast_str_thread_global_buf.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@184693 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-03-27 16:21:10 +00:00
Russell Bryant b564b2105f Change g_eid to ast_eid_default.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@184630 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-03-27 14:00:18 +00:00
Russell Bryant 5e80b9d09a Fix some issues with rwlock corruption that caused deadlock like symptoms.
When dvossel and I were doing some load testing last week, we noticed that we
could make Asterisk trunk lock up instantly when we started generating a bunch
of calls.  The backtraces of locked threads were bizarre, and many were stuck
on an _unlock_ of an rwlock.

The changes are:

1) Fix a number of places where a backtrace would be loaded into an invalid
   index of the backtrace array.  It's an off by one error, which ends up
   writing over the rwlock itself.

2) Ensure that in the array of held locks, we NULL out an index once it is
   not being used so that it's not confusing when analyzing its contents.

3) Remove a bunch of logging referring to an rwlock operating being done
   with "deep reentrancy".  It is normal for _many_ threads to hold a
   read lock on an rwlock.


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@184531 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-03-27 02:20:23 +00:00
Russell Bryant 37b5a29dc7 Pass more useful information through to lock tracking when DEBUG_THREADS is on.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@184512 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-03-27 01:35:56 +00:00
Russell Bryant ee77b475f2 Improve performance of the ast_event cache functionality.
This code comes from svn/asterisk/team/russell/event_performance/.

Here is a summary of the changes that have been made, in order of both
invasiveness and performance impact, from smallest to largest.

1) Asterisk 1.6.1 introduces some additional logic to be able to handle
   distributed device state.  This functionality comes at a cost.
   One relatively minor change in this patch is that the extra processing
   required for distributed device state is now completely bypassed if
   it's not needed.

2) One of the things that I noticed when profiling this code was that a
   _lot_ of time was spent doing string comparisons.  I changed the way
   strings are represented in an event to include a hash value at the front.
   So, before doing a string comparison, we do an integer comparison on the
   hash.

3) Finally, the code that handles the event cache has been re-written.
   I tried to do this in a such a way that it had minimal impact on the API.
   I did have to change one API call, though - ast_event_queue_and_cache().
   However, the way it works now is nicer, IMO.  Each type of event that
   can be cached (MWI, device state) has its own hash table and rules for
   hashing and comparing objects.  This by far made the biggest impact on
   performance.

For additional details regarding this code and how it was tested, please see the
review request.

(closes issue #14738)
Reported by: russell

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@184339 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-03-25 21:57:19 +00:00
Russell Bryant 08f561f196 Fix build issues on Mac OSX.
(closes issue #14714)
Reported by: ygor


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@184147 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-03-25 01:42:10 +00:00
Mark Michelson 33c3fce71a Remove symbols I just added to main/asterisk.exports and instead rename the functions.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@183554 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-03-20 16:24:20 +00:00
David Vossel 9d3527bddf Merged revisions 183386 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r183386 | dvossel | 2009-03-19 14:40:07 -0500 (Thu, 19 Mar 2009) | 6 lines
  
  Cleaning up a few things in detect disconnect patch
  
  Initialized ast_call_feature in detect_disconnect to avoid accessing uninitialized memory.  Cleaned up /param tags in features.h.  No longer send dynamic features in ast_feature_detect. 
  
  issue #11583
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@183436 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-03-19 20:30:39 +00:00
Russell Bryant 4210f17abb Merged revisions 183241 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r183241 | russell | 2009-03-19 12:52:52 -0500 (Thu, 19 Mar 2009) | 2 lines

Remove the use of RTLD_NOLOAD, as it is not behaving like expected.

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@183242 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-03-19 18:00:15 +00:00
David Vossel 2764c2821f Merged revisions 183126 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r183126 | dvossel | 2009-03-19 11:15:16 -0500 (Thu, 19 Mar 2009) | 17 lines
  
  Allow disconnect feature before a call is bridged
  
  feature.conf has a disconnect option.  By default this option is set to '*', but it could be anything.  If a user wishes to disconnect a call before the other side answers, only '*' will work, regardless if the disconnect option is set to something else.  This is because features are unavailable until bridging takes place.  The default disconnect option, '*', was hardcoded in app_dial, which doesn't make any sense from a user perspective since they may expect it to be something different.  This patch allows features to be detected from outside of the bridge, but not operated on.  In this case, the disconnect feature can be detected before briding and handled outside of features.c.
  
  (closes issue #11583)
  Reported by: sobomax
  Patches:
  	patch-apps__app_dial.c uploaded by sobomax (license 359)
  	11583.latest-patch uploaded by murf (license 17)
  	detect_disconnect.diff uploaded by dvossel (license 671)
  Tested by: sobomax, dvossel
  Review: http://reviewboard.digium.com/r/195/
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@183172 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-03-19 16:28:33 +00:00
Kevin P. Fleming 4f390ec024 Merged revisions 182882 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r182882 | kpfleming | 2009-03-18 06:31:41 -0500 (Wed, 18 Mar 2009) | 3 lines
  
  fix another symbol namespace issue (reported by Andrew on asterisk-dev)
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@182883 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-03-18 11:40:11 +00:00
Russell Bryant 0bdd99ad64 Merged revisions 182810 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r182810 | russell | 2009-03-17 21:09:13 -0500 (Tue, 17 Mar 2009) | 44 lines

Fix cases where the internal poll() was not being used when it needed to be.

We have seen a number of problems caused by poll() not working properly on 
Mac OSX.  If you search around, you'll find a number of references to using 
select() instead of poll() to work around these issues.  In Asterisk, we've 
had poll.c which implements poll() using select() internally.  However, we 
were still getting reports of problems.

vadim investigated a bit and realized that at least on his system, even 
though we were compiling in poll.o, the system poll() was still being used.  
So, the primary purpose of this patch is to ensure that we're using the 
internal poll() when we want it to be used.

The changes are:

1) Remove logic for when internal poll should be used from the Makefile.  
   Instead, put it in the configure script.  The logic in the configure 
   script is the same as it was in the Makefile.  Ideally, we would have 
   a functionality test for the problem, but that's not actually possible, 
   since we would have to be able to run an application on the _target_ 
   system to test poll() behavior.

2) Always include poll.o in the build, but it will be empty if AST_POLL_COMPAT
   is not defined.

3) Change uses of poll() throughout the source tree to ast_poll().  I feel 
   that it is good practice to give the API call a new name when we are 
   changing its behavior and not using the system version directly in all cases.
   So, normally, ast_poll() is just redefined to poll().  On systems where 
   AST_POLL_COMPAT is defined, ast_poll() is redefined to ast_internal_poll().

4) Change poll() in main/poll.c to be ast_internal_poll().

It's worth noting that any code that still uses poll() directly will work fine 
(if they worked fine before).  So, for example, out of tree modules that are 
using poll() will not stop working or anything.  However, for modules to work 
properly on Mac OSX, ast_poll() needs to be used.

(closes issue #13404)
Reported by: agalbraith
Tested by: russell, vadim

http://reviewboard.digium.com/r/198/

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@182847 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-03-18 02:28:55 +00:00
Kevin P. Fleming ab3e9ddad1 Merged revisions 182808 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r182808 | kpfleming | 2009-03-17 20:55:22 -0500 (Tue, 17 Mar 2009) | 5 lines
  
  Improve the build system to *properly* remove unnecessary symbols from the runtime global namespace. Along the way, change the prefixes on some internal-only API calls to use a common prefix.
  
  With these changes, for a module to export symbols into the global namespace, it must have *both* the AST_MODFLAG_GLOBAL_SYMBOLS flag and a linker script that allows the linker to leave the symbols exposed in the module's .so file (see res_odbc.exports for an example).
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@182826 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-03-18 02:21:23 +00:00
Kevin P. Fleming d11b6386a5 Improve behavior of ast_answer() to not lose incoming frames
ast_answer(), when supplied a delay before returning to the caller, use ast_safe_sleep() to implement the delay. Unfortunately during this time any incoming frames are discarded, which is problematic for T.38 re-INVITES and other sorts of channel operations.

When a delay is not passed to ast_answer(), it still delays for up to 500 milliseconds, waiting for media to arrive. Again, though, it discards any control frames, or non-voice media frames.

This patch rectifies this situation, by storing all incoming frames during the delay period on a list, and then requeuing them onto the channel before returning to the caller.

http://reviewboard.digium.com/r/196/



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@182525 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-03-17 14:38:11 +00:00
Russell Bryant 77a6840fd3 Add MFC/R2 support for chan_dahdi.
This commit introduces official support for R2 signaling in chan_dahdi.  The
modifications to chan_dahdi, and the supporting library, LibOpenR2, were both
written by Moises Silva.

Many users are using this code, or a variant of it, in Asterisk 1.2, 1.4 and 1.6
in Brazil, México and Argentina. An unknown number of users (but at least 1) 
are using it in each of the following countries: Colombia, Nepal, Thailand, 
Venezuela, Perú, and probably others.

To use this code, LibOpenR2 must be installed from http://www.libopenr2.org/.
Information about configuration can be found in configs/chan_dahdi.conf.sample.

The code committed is the most up to date version, which was being maintained
in svn/asterisk/team/moy/mfcr2/.

I would also like to include a Thank You to the many others that tested this
code beyond those listed in this commit message.  These are the names that I
could find in the mantis issue.

(closes issue #12509)
Reported by: moy
Patches:
      chan_zap-mfr2.patch uploaded by moy (license 222)
Tested by: moy, korihor, viniciusfontes, Skarmeth, loloski, asbestoshead, titogarrido, heliocoelhojr, konsultex, ncorrare, ecarruda, rtorresduque, PTorres, ychen

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@182355 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-03-16 20:35:58 +00:00
Tilghman Lesher 15a12635e6 Turn off malloc debugging of astobj2, since it apparently doesn't work too well during startup.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@181301 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-03-11 17:04:46 +00:00
Jeff Peeler 58cf8b69da Fix malloc debug macros to work properly with h323.
The main problem here was that cstdlib was undefining free thereby causing the
proper debug macros to not be used. ast_h323.cxx has been changed to call
ast_free instead to avoid the issue. 

A few other issues were addressed:
- There were a few instances of functions improperly passing ast_free instead
of ast_free_ptr.
- Some clean up was done to avoid the debug macros intentionally being redefined.
(copied below from Kevin's commit, appreciate the help)
- disable astmm.h from doing anything when STANDALONE is defined, which is used
by the tools in the utils/ directory that use parts of Asterisk header files in
hackish ways; also ensure that utils/extconf.c and utils/conf2ael.c are
compiled with STANDALONE defined.

(closes issue #13593)
Reported by: pj



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@181135 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-03-11 04:06:44 +00:00
Tilghman Lesher bfc0d3b795 Add MALLOC_DEBUG to various utility APIs, so that memory leaks can be tracked back to their source.
(related to issue #14636)


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@181028 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-03-11 00:29:59 +00:00
Jeff Peeler bf0bb7b385 Add Doxygen documentation for API changes from 1.6.0 to 1.6.1
Copied from my review board description:
This is a continuation of the API changes documentation started for describing
changes between releases. Most of the API changes were pretty simple needing
only to be brought to attention via the new "Asterisk API Changes" list.
However, if you see anything that needs further explanation feel free to
supplement what is there. The current method of documenting is to add (in the
header file): \version <ver number> <description of changes> and then to add
the function to the change list in doxyref.h on the AstAPIChanges page. I also
made sure all the functions that were newly added were tagged with \since
1.6.1. I think this is a good habit to start both for the historical aspect as
well as for the future ability to easily add a "New Asterisk API" page.

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@180719 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-03-09 20:58:17 +00:00
Kevin P. Fleming 2f24689b49 Merged revisions 180372 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r180372 | kpfleming | 2009-03-05 12:22:16 -0600 (Thu, 05 Mar 2009) | 9 lines
  
  Fix problems when RTP packet frame size is changed
  
  During some code analysis, I found that calling ast_rtp_codec_setpref() on an ast_rtp session does not work as expected; it does not adjust the smoother that may on the RTP session, in fact it summarily drops it, even if it has data in it, even if the current format's framing size has not changed. This is not good.
  
  This patch changes this behavior, so that if the packetization size for the current format changes, any existing smoother is safely updated to use the new size, and if no smoother was present, one is created. A new API call for smoothers, ast_smoother_reconfigure(), was required to implement these changes.
  
  Review: http://reviewboard.digium.com/r/184/
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@180373 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-03-05 18:29:38 +00:00
Joshua Colp 4c9ab0df8c Merge phase 1 support for the new bridging architecture.
This commit brings in the bridging core, bridging technologies,
and the ConfBridge application.

For usage information on the ConfBridge application please see
the output of "core show application ConfBridge" from the CLI.

For API documentation please see the doxygen page describing the
architecture and the documentation for each API call.

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@180369 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-03-05 18:18:27 +00:00
David Vossel 979eb709ae app_read does not break from prompt loop with user terminated empty string
In app.c, ast_app_getdata is called to stream the prompts and receive DTMF input.  If ast_app_getdata() receives an empty string caused by the user inputing the end of string character, in this case '#', it should break from the prompt loop and return to app_read, but instead it cycles through all the prompts.  I've added a return value for this special case in ast_readstring() which uses an enum I've delcared in apps.h.  This enum is now used as a return value for ast_app_getdata().

(closes issue #14279)
Reported by: Marquis
Patches:
	fix_app_read.patch uploaded by Marquis (license 32)
	read-ampersanmd.patch2 uploaded by dvossel (license 671)
Tested by: Marquis, dvossel
Review: http://reviewboard.digium.com/r/177/




git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@180032 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-03-03 23:21:18 +00:00
Tilghman Lesher 4ac2fd4cde Use notification when timezone files change and re-scan then.
(closes issue #14300)
 Reported by: jamessan
 Patches: 
       20090127__bug14300.diff.txt uploaded by tilghman (license 14)
       20090224__bug14300.diff uploaded by jamessan (license 246)
 Tested by: jamessan
 Review: http://reviewboard.digium.com/r/136/


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@178605 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-02-25 19:24:44 +00:00
Sean Bright 935185ce8a Trailing whitespace, minor coding guideline fixes, and start beefing up the
hashtab documentation a bit.


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@177884 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-02-21 14:16:44 +00:00
Russell Bryant 7dc56a0c27 Fix build issues on Solaris and OpenBSD.
(closes issue #14512)
Reported by: snuffy


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@177855 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-02-21 13:17:47 +00:00
Tilghman Lesher 9967ef01df Merged revisions 177701 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r177701 | tilghman | 2009-02-20 15:15:01 -0600 (Fri, 20 Feb 2009) | 3 lines
  
  This exception does not appear to still be true for Solaris 10, and OpenSolaris definitely needs it to be removed.
  Fixed for snuff-home on -dev channel.
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@177732 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-02-20 21:25:37 +00:00
Tilghman Lesher 3af1c558df Allow semicolons to be escaped, when passing arguments to the System command.
(closes issue #14231)
 Reported by: jcovert
 Patches: 
       20090113__bug14231__2.diff.txt uploaded by Corydon76 (license 14)
       corrected_20090113__bug14231__2.diff.txt uploaded by jcovert (license 551)
 Tested by: jcovert


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@177664 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-02-20 17:29:51 +00:00
Jeff Peeler ef84acf002 Fix another merge error from 176708
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@177387 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-02-19 16:45:02 +00:00
Tilghman Lesher a1f583177e ODBC transaction support
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@177320 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-02-19 00:26:01 +00:00
Tilghman Lesher 39d573920f Merged revisions 177096 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r177096 | tilghman | 2009-02-18 12:30:38 -0600 (Wed, 18 Feb 2009) | 2 lines
  
  Document the return value of the update method (as requested on -dev list)
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@177098 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-02-18 19:05:15 +00:00
Russell Bryant b5410fad00 Add example code for a heap traversal.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@176904 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-02-18 06:14:47 +00:00
Jeff Peeler f40edf2793 Merged revisions 176701 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r176701 | jpeeler | 2009-02-17 15:54:34 -0600 (Tue, 17 Feb 2009) | 17 lines
  
  Modify bridging to properly evaluate DTMF after first warning is played
  
  The main problem is currently if the Dial flag L is used with a warning sound,
  DTMF is not evaluated after the first warning sound. To fix this, a flag has 
  been added in ast_generic_bridge for playing the warning which ensures that if
  a scheduled warning is missed, multiple warrnings are not played back (due to a
  feature evaluation or waiting for digits). ast_channel_bridge was modified to
  store the nexteventts in the ast_bridge_config structure as that information
  was lost every time ast_channel_bridge was reentered, causing a hangup due to
  incorrect time calculations.
  
  (closes issue #14315)
  Reported by: tim_ringenbach
 
  Reviewed on reviewboard:
  http://reviewboard.digium.com/r/163/
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@176708 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-02-17 22:08:00 +00:00
Mark Michelson 6d60de7efa Clear up documentation of AST_FRIENDLY_OFFSET in frame.h
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@176697 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-02-17 21:40:09 +00:00
Russell Bryant c461d29b0b Update the timing API to have better support for multiple timing interfaces.
1) Add module use count handling so that timing modules can be unloaded.

2) Implement unload_module() functions for the timing interface modules.

3) Allow multiple timing modules to be loaded, and use the one with the
   highest priority value.

4) Report which timing module is being use in the "timing test" CLI command.

(closes issue #14489)
Reported by: russell

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@176666 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-02-17 21:22:40 +00:00
Russell Bryant bb03ef8d47 Add an implementation of the heap data structure.
A heap is a convenient data structure for implementing a priority queue.

Code from svn/asterisk/team/russell/heap/.

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@176632 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-02-17 20:51:10 +00:00
Olle Johansson 47913cab6d Typo
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@176631 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-02-17 20:50:03 +00:00
Russell Bryant 4ec301360c Merge a large set of updates to the Asterisk indications API.
This patch includes a number of changes to the indications API.  The primary
motivation for this work was to improve stability.  The object management
in this API was significantly flawed, and a number of trivial situations could
cause crashes.

The changes included are:

1) Remove the module res_indications.  This included the critical functionality
   that actually loaded the indications configuration.  I have seen many people
   have Asterisk problems because they accidentally did not have an
   indications.conf present and loaded.  Now, this code is in the core,
   and Asterisk will fail to start without indications configuration.

   There was one part of res_indications, the dialplan applications, which did
   belong in a module, and have been moved to a new module, app_playtones.

2) Object management has been significantly changed.  Tone zones are now
   managed using astobj2, and it is no longer possible to crash Asterisk by
   issuing a reload that destroys tone zones while they are in use.

3) The API documentation has been filled out.

4) The API has been updated to follow our naming conventions.

5) Various bits of code throughout the tree have been updated to account
   for the API update.

6) Configuration parsing has been mostly re-written.

7) "Code cleanup"

The code is from svn/asterisk/team/russell/indications/.

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@176627 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-02-17 20:41:24 +00:00
Kevin P. Fleming 0381d94d14 Merged revisions 176216 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r176216 | kpfleming | 2009-02-16 15:10:38 -0600 (Mon, 16 Feb 2009) | 3 lines
  
  fix a flaw in the ast_string_field_build() family of API calls; these functions made no attempt to reuse the space already allocated to a field, so every time the field was written it would allocate new space, leading to what appeared to be a memory leak.
........
  r176254 | kpfleming | 2009-02-16 15:41:46 -0600 (Mon, 16 Feb 2009) | 3 lines

  correct a logic error in the last stringfields commit... don't mark additional space as allocated if the string was built using already-allocated space
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@176255 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-02-16 21:45:54 +00:00
Michiel van Baak 115c6abef4 Merged revisions 175921 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r175921 | mvanbaak | 2009-02-16 00:37:03 +0100 (Mon, 16 Feb 2009) | 3 lines
  
  fix mis-spelling of the word registered.
  Reported by De_Mon on #asterisk-dev.
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@175952 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-02-16 00:26:59 +00:00
Russell Bryant 8c75380f52 Make ast_sched_report() and ast_sched_dump() thread safe.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@175882 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-02-15 21:27:33 +00:00
Russell Bryant ca9d3b8ac9 Fix a number of problems with ast_sched_report().
1) It had numerous coding guidelines violations with regards to formatting.

2) It allocated memory using ast_calloc() that was never freed.

3) It didn't check for failure from the allocation.

4) It used sprintf() and strcat() to build the result, doing zero checking to
   prevent writing past the end of the provided buffer.

The function also lacks API documentation, but that has not been addressed in
this commit.


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@175829 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-02-15 20:56:27 +00:00
Kevin P. Fleming 2a53f2ec98 Add basic (passthrough, playback, record) support for ITU G.722.1 and G.722.1C (also known as Siren7 and Siren14)
This patch adds passthrough, file recording and file playback support for the codecs listed above, with negotiation over SIP/SDP supported. Due to Asterisk's current limitation of treating a codec/bitrate combination as a unique codec, only G.722.1 at 32 kbps and G.722.1C at 48 kbps are supported.

Along the way, some related work was done:

1) The rtpPayloadType structure definition, used as a return result for an API call in rtp.h, was moved from rtp.c to rtp.h so that the API call was actually usable. The only previous used of the API all was chan_h323.c, which had a duplicate of the structure definition instead of doing it the right way.

2) The hardcoded SDP sample rates for various codecs in chan_sip.c were removed, in favor of storing these sample rates in rtp.c along with the codec definitions there. A new API call was added to allow retrieval of the sample rate for a given codec.

3) Some basic 'a=fmtp' parsing for SDP was added to chan_sip, because chan_sip *must* decline any media streams offered for these codecs that are not at the bitrates that we support (otherwise Bad Things (TM) would result).

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



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@175508 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-02-13 13:35:24 +00:00
Mark Michelson 3a9d79f056 Make lock information for ao2_trylock be more useful and gnarly
Core show locks information involving an ao2_trylock did not
show the function that called ao2_trylock, but would instead
show ao2_trylock as the source of the lock. This is not useful
when trying to debug locking issues.

One bizarre note is that this logic is already in 1.4 but somehow
did not get merged to trunk or the 1.6.X branches.



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@175121 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-02-12 16:28:06 +00:00
Mark Michelson 47ebea6a8d Fix 'd' option for app_dial and add new option to Answer application
The 'd' option would not work for channel types which use RTP to transport
DTMF digits. The only way to allow for this to work was to answer the channel
if we saw that this option was enabled.

I realized that this may cause issues with CDRs, specifically with giving false
dispositions and answer times. I therefore modified ast_answer to take another
parameter which would tell if the CDR should be marked answered.

I also extended this to the Answer application so that the channel may be answered
but not CDRified if desired.

I also modified app_dictate and app_waitforsilence to only answer the channel if it
is not already up, to help not allow for faulty CDR answer times.

All of these changes are going into Asterisk trunk. For 1.6.0 and 1.6.1, however, all
the changes except for the change to the Answer application will go in since we do
not introduce new features into stable branches

(closes issue #14164)
Reported by: DennisD
Patches:
      14164.patch uploaded by putnopvut (license 60)
Tested by: putnopvut

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



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@174945 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-02-11 22:41:01 +00:00
Kevin P. Fleming 23939e54f3 improve slinfactory API to remove implicit sample rate and require explicit sample rate selection by creator of the slinfactory
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@174705 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-02-10 19:38:26 +00:00
Russell Bryant 0cbada4f96 Add a common implementation of a scheduler context with a dedicated thread.
This commit expands the Asterisk scheduler API to include a common implementation
of a scheduler context being processed by a dedicated thread.  chan_iax2 has been
updated to use this new code.  Also, as a result, this resolves some race
conditions related to the previous chan_iax2 scheduler handling.

Related to rev 171452 which resolved the same issues in 1.4.

Code from team/russell/sched_thread2

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@173858 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-02-06 10:55:35 +00:00
Jeff Peeler 39ec5d1576 Merged revisions 173211 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r173211 | jpeeler | 2009-02-03 15:57:01 -0600 (Tue, 03 Feb 2009) | 17 lines
  
  Parking attempts made to one end of a bridge no longer will hang up due to a
  parking failure.
  
  Parking attempts made using either one-touch, or doing either a blind or 
  assisted transfer to the parking extension now keep up the bridge instead of
  hanging up the attempted parked party. Normal causes for the parking attempt
  to fail includes the specific specified extension (via PARKINGEXTEN) not being 
  available or if all the parking spaces are currently in use. To avoid having
  to reverse a masquerade park_space_reserve was made to provide foresight if
  a parking attempt will succeed and if so reserve the parking space.
  
  (closes issue #13494)
  Reported by: mdu113
  
  Reviewed by Russell: http://reviewboard.digium.com/r/133/
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@173500 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-02-04 21:17:53 +00:00
Tilghman Lesher e179e613f7 1. Make OS X compile cleanly with app_stack.
2. Use curl to download sound files, as curl is installed natively on OS X,
whereas wget and fetch are not.
(closes issue #14332)
 Reported by: oej
 Tested by: Corydon76


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@173130 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-02-03 00:29:49 +00:00
Steve Murphy 53d9b77898 This reverts the changes I made for 11583; will
reviewboard this before committing again...
reopened 11583 until all Russell's issues are
resolved.



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@172929 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-02-02 19:02:24 +00:00
Steve Murphy c61e8a7865 This change allows the disconnect feature (as in "one-touch" in features.c)
to be used within the dial app, before a call is bridged.

Many thanks to sobomax for submitting this patch. 

Quoting from bug 11582:

  "So the goal of the patch was to use the user configured feature code during the 
   call setup phase. The original ast_feature_interpret() function is not well suited 
   for this purpose as it uses much call bridge specific data and doesn't separate a 
   detection of feature from a feature handler call. So a new function ast_feature_detect() 
   has been extracted off the ast_feature_interpret() function but keeping the original 
   logic intact except some insignificant changes to locking.

  "Having created the ast_feature_detect() function the possibility to use feature detection 
   in almost any place of the asterisk code. So a call to this function has been added to 
   wait_for_answer() function of app_dial.so module. This code doesn't call the feature handler 
   however and uses old call leg disconnect logic to make the changes as small and simple as 
   possible to prevent unexpected problems. A disconnect feature currently is the only one 
   supported during call setup as other features as call parking and call transfer don't make much 
   sense during call setup. However if need in some of the features would arise it is much easier to 
   implement as the infrastructure changes are already in place with this patch."

I have cleaned up the patch somewhat, and verified that the existing functionality is not
harmed, and that the new functionality works. Terry has committed his stuff, and there were
no conflicts (see 14274).

(closes issue #11583)
Reported by: sobomax
Patches:
      patch-apps__app_dial.c uploaded by sobomax (license 359)
      patch-include__asterisk__features.h uploaded by sobomax (license 359)
      patch-res__res_features.c uploaded by sobomax (license 359)
      enable-features-during-call-setup.diff uploaded by sobomax (license 359)
      11583.newdiff uploaded by murf (license 17)
      enable-features-during-call-setup-1.diff uploaded by sobomax (license 359)
      11583.latest-patch uploaded by murf (license 17)
Tested by: sobomax, murf




git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@172890 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-02-02 17:37:15 +00:00
Mark Michelson 458dfe4748 Fix redefinition of flag in channel.h
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@172598 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-01-30 22:22:04 +00:00
Terry Wilson 8d782f96b8 Merged revisions 172517 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r172517 | twilson | 2009-01-30 11:47:41 -0600 (Fri, 30 Jan 2009) | 37 lines
  
  Fix feature inheritance with builtin features
  
  When using builtin features like parking and transfers, the AST_FEATURE_* flags
  would not be set correctly for all instances when either performing a builtin
  attended transfer, or parking a call and getting the timeout callback.  Also,
  there was no way on a per-call basis to specify what features someone should
  have on picking up a parked call (since that doesn't involve the Dial() command).
  There was a global option for setting whether or not all users who pickup a
  parked call should have AST_FEATURE_REDIRECT set, but nothing for DISCONNECT,
  AUTOMON, or PARKCALL.
  
  This patch:
  1) adds the BRIDGE_FEATURES dialplan variable which can be set either in the
  dialplan or with setvar in channels that support it.  This variable can be set
  to any combination of 't', 'k', 'w', and 'h' (case insensitive matching of the
  equivalent dial options), to set what features should be activated on this
  channel.  The patch moves the setting of the features datastores into the
  bridging code instead of app_dial to help facilitate this.
  
  2) adds global options parkedcallparking, parkedcallhangup, and
  parkedcallrecording to be similar to the parkedcalltransfers option for
  globally setting features.
  
  3) has builtin_atxfer call builtin_parkcall if being transfered to the parking
  extension since tracking everything through multiple masquerades, etc. is
  difficult and error-prone
  
  4) attempts to fix all cases of return calls from parking and completed builtin
  transfers not having the correct permissions
  (closes issue #14274)
  Reported by: aragon
  Patches: 
        fix_feature_inheritence.diff.txt uploaded by otherwiseguy (license 396)
  Tested by: aragon, otherwiseguy
  
  Review http://reviewboard.digium.com/r/138/
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@172580 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-01-30 21:29:12 +00:00
Richard Mudgett 14cebb2c38 Fixed some doxygen comments
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@172370 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-01-29 19:34:09 +00:00
Olle Johansson 7ecda45482 Fix "cancel answered elsewhere" through app_queue with members in chan_local.
Also, implement a private cause code (as suggested by Tilghman). This works with
chan_sip, but doesn't propagate through chan_local.



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@172318 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-01-29 17:08:22 +00:00
Olle Johansson b79a12e929 - Make sure we set setvar= variables on outbound calls too, not only inbound calls.
- Also, change a function in app.c to return a userful value instead of always returning 0.

Patch by fnordian, changed by Corydon76 and myself.

This does not close the bug report, as fnordian had an additional change we're still discussing.

(related to issue #14059)
Reported by: fnordian
Patches: 
      chan_sip_hfield.patch uploaded by fnordian (license 110)
      20090116__bug14059.diff.txt uploaded by Corydon76 (license 14)
Tested by: fnordian, Corydon76, oej



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@172268 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-01-29 13:21:31 +00:00
Steve Murphy 268ac221a2 Merged revisions 172030 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r172030 | murf | 2009-01-28 11:51:16 -0700 (Wed, 28 Jan 2009) | 46 lines
  
  This patch fixes h-exten running misbehavior in manager-redirected 
  situations.
  
  What it does:
  1. A new Flag value is defined in include/asterisk/channel.h,
   AST_FLAG_BRIDGE_HANGUP_DONT, which used as a messenge to the
   bridge hangup exten code not to run the h-exten there (nor
   publish the bridge cdr there). It will done at the pbx-loop
   level instead.
  2. In the manager Redirect code, I set this flag on the channel
   if the channel has a non-null pbx pointer. I did the same for the
   second (chan2) channel, which gets run if name2 is set...
   and the first succeeds.
  3. I restored the ending of the cdr for the pbx loop h-exten
   running code. Don't know why it was removed in the first place.
  4. The first attempt at the fix for this bug was to place code
     directly in the async_goto routine, which was called from a
     large number of places, and could affect a large number of
     cases, so I tested that fix against a fair number of transfer
     scenarios, both with and without the patch. In the process,
     I saw that putting the fix in async_goto seemed not to affect
     any of the blind or attended scenarios, but still, I was
     was highly concerned that some other scenarios I had not tested
     might be negatively impacted, so I refined the patch to 
     its current scope, and jmls tested both. In the process, tho,
     I saw that blind xfers in one situation, when the one-touch
     blind-xfer feature is used by the peer, we got strange 
     h-exten behavior.  So, I  inserted code to swap CDRs and
     to set the HANGUP_DONT field, to get uniform behavior.
  5. I added code to the bridge to obey the HANGUP_DONT flag,
     skipping both publishing the bridge CDR, and running
     the h-exten; they will be done at the pbx-loop (higher)
     level instead.
  6. I removed all the debug logs from the patch before committing.
  7. I moved the AUTOLOOP set/reset in the h-exten code in res_features
     so it's only done if the h-exten is going to be run. A very
     minor performance improvement, but technically correct.
  
  
  (closes issue #14241)
  Reported by: jmls
  Patches:
        14241_redirect_no_bridgeCDR_or_h_exten_via_transfer uploaded by murf (license 17)
  Tested by: murf, jmls
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@172063 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-01-28 20:31:06 +00:00
Russell Bryant 6101eccc9f Change ARRAY_LEN() to be more C++ safe.
When the second part of this macro is written as 0[a] instead of a[0], it will
force a failure if the macro is used on a C++ object that overloads the []
operator.


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@170943 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-01-25 02:49:30 +00:00
Doug Bailey 9a28a07739 change VMWI to use new DAHDI_VMWI ioctl call.
Change configure script to detect the new ioctl call data structure.    
(issue #14104)
Reported by: alecdavis
Patches:
      mwiioctl_structure_asterisk.diff4.txt uploaded by dbailey (license )
Tested by: alecdavis, dbailey


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@170112 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-01-22 15:49:24 +00:00
Tilghman Lesher e3b431ebcb Merged revisions 169943 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r169943 | tilghman | 2009-01-21 18:43:31 -0600 (Wed, 21 Jan 2009) | 9 lines
  
  AST_RWLOCK_INIT_VALUE is always defined.  What we really wanted to ask is
  whether autoconf detected a static initializer value.  This fixes rwlocks
  on all such platforms (mainly, Mac OS X).
  (closes issue #13767)
   Reported by: jcovert
   Patches: 
         20090121__bug13767.diff.txt uploaded by Corydon76 (license 14)
   Tested by: jcovert, Corydon76
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@169944 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-01-22 00:44:52 +00:00
Kevin P. Fleming 1c2911f5a1 ast_str_SQLGetData is *not* part of the ast_str API, it's part of the ast_odbc API and just happens to use an ast_str as the buffer; move all of it to res_odbc.c and res_odbc.h, renaming appropriately
along the way fix some minor coding style issues in strings.h and add some attribute_pure annotations to functions in the ast_str API



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@169438 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-01-19 21:42:46 +00:00
Terry Wilson e0b40036e1 Fix qualify for TCP peer
(closes issue #14192)
Reported by: pabelanger
Patches: 
      asterisk-bug14192.diff.txt uploaded by jamesgolovich (license 176)
Tested by: jamesgolovich


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@169080 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-01-17 01:56:36 +00:00
Tilghman Lesher 3728c3aa92 Merged revisions 168828 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r168828 | tilghman | 2009-01-16 12:41:35 -0600 (Fri, 16 Jan 2009) | 6 lines
  
  Fix the conjugation of Russian and Ukrainian languages.
  (related to issue #12475)
   Reported by: chappell
   Patches: 
         vm_multilang.patch uploaded by chappell (license 8)
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@168832 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-01-16 18:49:09 +00:00
Tilghman Lesher c6cb67b941 Resolve issue with negative vs non-negative length parameters.
(closes issue #14245)
 Reported by: dveiga


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@168719 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-01-15 18:39:56 +00:00
Terry Wilson 7c6d9c7235 Add option to hide console connect messages
(closes issue #14222)
Reported by: jamesgolovich
Patches: 
      asterisk-hideconnect.diff.txt uploaded by jamesgolovich (license 176)
Tested by: otherwiseguy


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@168585 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-01-13 23:00:27 +00:00
Russell Bryant ef6ad2b53c Merged revisions 168561 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r168561 | russell | 2009-01-13 13:13:05 -0600 (Tue, 13 Jan 2009) | 2 lines

Revert unnecessary indications API change from rev 122314

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@168562 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-01-13 19:22:13 +00:00
Tilghman Lesher fd3cb90841 Some platforms (notably, the BSDs) have a more efficient implementation called
closefrom(3).


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@168522 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-01-12 23:06:12 +00:00
Tilghman Lesher 4a9e8078b9 When using ast_str with a non-ast_str-enabled API, we need to update the buffer
or otherwise, we cannot use ast_str_strlen().


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@168090 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-01-09 18:30:55 +00:00
Sean Bright e1f941d7f6 Mostly just whitespace, but also convert 'CVS' to 'SVN' in a couple
places and fix a few typos I found in the CODING_GUIDELINES.


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@167061 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-12-31 23:07:14 +00:00
Steve Murphy aa905e347e Merged revisions 166093 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

In order to merge this 1.4 patch into trunk,
I had to resolve some conflicts and wait for
Russell to make some changes to res_agi.
I re-ran all the tests; 39 calls in all, and
made fairly careful notes and comparisons: I
don't want this to blow up some aspect of 
asterisk; I completely removed the KEEPALIVE
from the pbx.h decls. The first 3 scenarios
involving feature park; feature xfer to 700;
hookflash park to Park() app call all behave
the same, don't appear to leave hung channels,
and no crashes.

........
  r166093 | murf | 2008-12-19 15:30:32 -0700 (Fri, 19 Dec 2008) | 131 lines
  
  This merges the masqpark branch into 1.4
  
  These changes eliminate the need for (and use of)
  the KEEPALIVE return code in res_features.c;
  There are other places that use this result code
  for similar purposes at a higher level, these appear
  to be left alone in 1.4, but attacked in trunk.
  
  The reason these changes are being made in 1.4, is
  that parking ends a channel's life, in some situations,
  and the code in the bridge (and some other places),
  was not checking the result code properly, and dereferencing
  the channel pointer, which could lead to memory corruption
  and crashes.
  
  Calling the masq_park function eliminates this danger 
  in higher levels.
  
  A series of previous commits have replaced some parking calls
  with masq_park, but this patch puts them ALL to rest,
  (except one, purposely left alone because a masquerade
  is done anyway), and gets rid of the code that tests
  the KEEPALIVE result, and the NOHANGUP_PEER result codes.
  
  While bug 13820 inspired this work, this patch does
  not solve all the problems mentioned there.
  
  I have tested this patch (again) to make sure I have
  not introduced regressions. 
  
  Crashes that occurred when a parked party hung up
  while the parking party was listening to the numbers
  of the parking stall being assigned, is eliminated.
  
  These are the cases where parking code may be activated:
  
  1. Feature one touch (eg. *3)
  2. Feature blind xfer to parking lot (eg ##700)
  3. Run Park() app from dialplan (eg sip xfer to 700)
     (eg. dahdi hookflash xfer to 700)
  4. Run Park via manager.
  
  The interesting testing cases for parking are:
  I. A calls B, A parks B
      a. B hangs up while A is getting the numbers announced.
      b. B hangs up after A gets the announcement, but 
         before the parking time expires
      c. B waits, time expires, A is redialed,
         A answers, B and A are connected, after
         which, B hangs up.
      d. C picks up B while still in parking lot.
  
  II. A calls B, B parks A
      a. A hangs up while B is getting the numbers announced.
      b. A hangs up after B gets the announcement, but 
         before the parking time expires
      c. A waits, time expires, B is redialed,
         B answers, A and B are connected, after
         which, A hangs up.
      d. C picks up A while still in parking lot.
  
  Testing this throroughly involves acting all the permutations
  of I and II, in situations 1,2,3, and 4.
  
  Since I added a few more changes (ALL references to KEEPALIVE in the bridge
  code eliimated (I missed one earlier), I retested
  most of the above cases, and no crashes.
  
  H-extension weirdness.
  
  Current h-extension execution is not completely
  correct for several of the cases.
  
  For the case where A calls B, and A parks B, the
  'h' exten is run on A's channel as soon as the park
  is accomplished. This is expected behavior.
  
  But when A calls B, and B parks A, this will be
  current behavior:
  
  After B parks A, B is hung up by the system, and
  the 'h' (hangup) exten gets run, but the channel
  mentioned will be a derivative of A's...
  
  Thus, if A is DAHDI/1, and B is DAHDI/2,
  the h-extension will be run on channel
  Parked/DAHDI/1-1<ZOMBIE>, and the 
  start/answer/end info will be those 
  relating to Channel A.
  
  And, in the case where A is reconnected to
  B after the park time expires, when both parties
  hang up after the joyful reunion, no h-exten
  will be run at all.
  
  In the case where C picks up A from the 
  parking lot, when either A or C hang up,
  the h-exten will be run for the C channel.
  
  CDR's are a separate issue, and not addressed
  here.
  
  As to WHY this strange behavior occurs, 
  the answer lies in the procedure followed
  to accomplish handing over the channel
  to the parking manager thread. This procedure
  is called masquerading. In the process,
  a duplicate copy of the channel is created,
  and most of the active data is given to the
  new copy. The original channel gets its name
  changed to XXX<ZOMBIE> and keeps the PBX
  information for the sake of the original
  thread (preserving its role as a call 
  originator, if it had this role to begin
  with), while the new channel is without
  this info and becomes a call target (a
  "peer").
  
  In this case, the parking lot manager
  thread is handed the new (masqueraded)
  channel. It will not run an h-exten
  on the channel if it hangs up while
  in the parking lot. The h exten will
  be run on the original channel instead,
  in the original thread, after the bridge
  completes.
  
  See bug 13820 for our intentions as
  to how to clean up the h exten behavior.

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

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@166665 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-12-23 18:13:49 +00:00
Russell Bryant c2999a8366 Introduce ast_careful_fwrite() and use in AMI to prevent partial writes.
This patch introduces a function to do careful writes on a file stream which
will handle timeouts and partial writes.  It is currently used in AMI to
address the issue that has been reported.  However, there are probably a few
other places where this could be used.

(closes issue #13546)
Reported by: srt
Tested by: russell
http://reviewboard.digium.com/r/104/


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@166282 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-12-22 17:09:36 +00:00
Russell Bryant 894c91afe0 Make a note about formatting the review URL in commit messages
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@166219 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-12-20 01:37:23 +00:00
Mark Michelson 9733b30ff0 Adding a new dialplan function AUDIOHOOK_INHERIT
This function is being added as a method to allow for
an audiohook to move to a new channel during a channel
masquerade. The most obvious use for such a facility is
for MixMonitor when a transfer is performed. Prior to
the addition of this functionality, if a channel 
running MixMonitor was transferred by another party, then
the recording would stop once the transfer had completed.
By using AUDIOHOOK_INHERIT, you can make MixMonitor 
continue recording the call even after the transfer
has completed.

It has also been determined that since this is seen
by most as a bug fix and is not an invasive change,
this functionality will also be backported to 1.4 and
merged into the 1.6.0 branches, even though they are
feature-frozen.

(closes issue #13538)
Reported by: mbit
Patches:
      13538.patch uploaded by putnopvut (license 60)
	  Tested by: putnopvut

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



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@166092 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-12-19 22:26:16 +00:00
Matthew Fredrickson 775033301a Add configuration support for half_full DAHDI buffer policy
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@166058 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-12-19 21:44:18 +00:00
Russell Bryant 79fe1aa0c6 Disable some automatic links generated by doxygen.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@165886 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-12-19 14:48:35 +00:00
Russell Bryant 2450098785 Introduce commit message formatting guidelines.
This documents the recommended outline to use for commit message.  It also
covers information on special tags that can be used in commit messages, as well
as the template functionality that is available on bugs.digium.com.

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@165883 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-12-19 14:42:51 +00:00
Russell Bryant 50a25ac847 Remove the need for AST_PBX_KEEPALIVE with the GoSub option from Dial.
This is part of an effort to completely remove AST_PBX_KEEPALIVE and other
similar return codes from the source.  While this usage was perfectly safe,
there are others that are problematic.  Since we know ahead of time that
we do not want to PBX to destroy the channel, the PBX API has been changed
so that information can be provided as an argument, instead, thus removing
the need for the KEEPALIVE return value.

Further changes to get rid of KEEPALIVE and related code is being done by
murf.  There is a patch up for that on review 29.

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@165723 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-12-18 19:33:42 +00:00
Eliel C. Sardanons 344a37f2a7 Remove duplicate code from the ast_str API. We now use __AST_STR_* to
access 'struct ast_str' members, but this must only be used inside the API implementation.

(closes issue #14098)
Reported by: eliel
Patches:
      ast_str.patch uploaded by eliel (license 64)



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@165502 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-12-18 15:25:15 +00:00
Tilghman Lesher 27cbfc1bd5 Add timezone to the possible fields in a timespec.
(closes issue #14028)
 Reported by: mostyn
 Patches: 
       timezone-v2.patch uploaded by mostyn (license 398)
       (with additional code guideline fixes and a memory leak fix by me - license 14)


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@164976 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-12-16 22:57:17 +00:00
Michiel van Baak d2d96b10ac introduce 'core show sysinfo' for systems that dont have the Linux-ish sysinfo stuff but do have sysctl.
(closes issue #13433)
Reported by: mvanbaak
Patches:
      2008121300_sysinfosysctl.diff.txt uploaded by mvanbaak (license 7)
	  with two free calls replaced with ast_free based on feedback on reviewboard
Review:
      http://reviewboard.digium.com/r/91/


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@164802 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-12-16 20:08:34 +00:00
Russell Bryant 556b082522 Merged revisions 164736 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r164736 | russell | 2008-12-16 11:06:29 -0600 (Tue, 16 Dec 2008) | 14 lines

Fix memory leak and invalid reporting issues with DEBUG_THREADLOCALS.

One issue was that the ast_mutex_* API was being used within the context of the
thread local data destructors.  We would go off and allocate more thread local data
while the pthread lib was in the middle of destroying it all.  This led to a memory 
leak.

Another issue was an invalid argument being provided to the the object_add
API call.

(closes issue #13678)
Reported by: ys
Tested by: Russell

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@164737 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-12-16 17:14:01 +00:00
Mark Michelson 225b056239 Merged revisions 164422 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r164422 | mmichelson | 2008-12-15 13:53:08 -0600 (Mon, 15 Dec 2008) | 3 lines

Add the deadlock note to ast_spawn_extension as well


........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@164423 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-12-15 19:53:29 +00:00
Mark Michelson c855c2c381 Merged revisions 164416 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r164416 | mmichelson | 2008-12-15 13:45:07 -0600 (Mon, 15 Dec 2008) | 4 lines

Add notes to autoservice and pbx doxygen regarding a potential
deadlock scenario so that it is avoided in the future


........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@164419 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-12-15 19:51:24 +00:00
Tilghman Lesher 42e26ee700 Revert ast_str opacity in chan_sip for now, since something wasn't quite right
in the merge.


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@164417 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-12-15 19:48:02 +00:00
Steve Murphy 203e224bcb I was getting this warning during a compile
on a 64-bit machine running ubuntu server 8.10, 
and gcc-4.3.2:

   [CXXi] chan_vpb.ii -> chan_vpb.oo
cc1plus: warnings being treated as errors
In file included from /home/murf/asterisk/trunk/include/asterisk/utils.h:671,
                 from chan_vpb.cc:46:
/home/murf/asterisk/trunk/include/asterisk/strings.h: In function ‘char* ast_str_truncate(ast_str*, ssize_t)’:
/home/murf/asterisk/trunk/include/asterisk/strings.h:479: error: comparison between signed and unsigned integer expressions
make[1]: *** [chan_vpb.oo] Error 1
make: *** [channels] Error 2

which this fix silences



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@164415 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-12-15 19:42:05 +00:00
Russell Bryant 808a5fda59 Fix a couple more build issues related to ast_str_opaque
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@164309 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-12-15 17:21:38 +00:00
Joshua Colp 8be6bc5f67 Make app_fax compatible with newer versions of spandsp. This remains backwards compatible with earlier versions though so do not fret.
(closes issue #14073)
Reported by: seandarcy


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@164257 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-12-15 15:41:22 +00:00
Tilghman Lesher c31cbd7f1a Don't pass a negative to an unsigned type and expect things to work correctly.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@164168 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-12-14 18:16:28 +00:00
Tilghman Lesher c8223fc957 Merge ast_str_opaque branch (discontinue usage of ast_str internals)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@163991 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-12-13 08:36:35 +00:00
Russell Bryant 7fcac067b2 Merged revisions 163448 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r163448 | russell | 2008-12-12 07:44:08 -0600 (Fri, 12 Dec 2008) | 26 lines

Resolve issues that could cause DTMF to be processed out of order.

These changes come from team/russell/issue_12658

1) Change autoservice to put digits on the head of the channel's frame readq 
   instead of the tail.  If there were frames on the readq that autoservice 
   had not yet read, the previous code would have resulted in out of order 
   processing.  This required a new API call to queue a frame to the head 
   of the queue instead of the tail.

2) Change up the processing of DTMF in ast_read().  Some of the problems 
   were the result of having two sources of pending DTMF frames.  There 
   was the dtmfq and the more generic readq.  Both were used for pending 
   DTMF in various scenarios.  Simplifying things to only use the frame 
   readq avoids some of the problems.

3) Fix a bug where a DTMF END frame could get passed through when it 
   shouldn't have.  If code set END_DTMF_ONLY in the middle of digit emulation,
   and a digit arrived before emulation was complete, digits would get 
   processed out of order.

(closes issue #12658)
Reported by: dimas
Tested by: russell, file
Review: http://reviewboard.digium.com/r/85/

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@163449 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-12-12 13:55:30 +00:00
Michiel van Baak c8c8995b70 add tab completion for 'core set debug X filename.c'
(closes issue #13969)
Reported by: jtodd
Patches:
      20081205__bug13969.diff.txt uploaded by Corydon76 (license 14)
Tested by: mvanbaak, eliel


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@162687 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-12-10 17:09:15 +00:00
Kevin P. Fleming 96ae957f35 it does help if the compiler attribute syntax is correct
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@162488 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-12-09 23:41:02 +00:00
Russell Bryant d0bc22b3e8 Add some additional Asterisk project developer documentation.
After the nightly update of the documentation on asterisk.org, I'll post 
an update to asterisk-dev with a pointer to the changes.  This covers some
release branch and commit policy information.  None of this should be a
surprise, since it's just documenting what we have already been doing.


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@162418 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-12-09 22:38:41 +00:00
Russell Bryant 179667088b Merged revisions 162413 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r162413 | russell | 2008-12-09 16:17:39 -0600 (Tue, 09 Dec 2008) | 8 lines

Remove the test_for_thread_safety() function completely.

The test is not valid.  Besides, if we actually suspected that recursive
mutexes were not working, we would get a ton of LOG_ERROR messages when
DEBUG_THREADS is turned on.

(inspired by a discussion on the asterisk-dev list)

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@162414 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-12-09 22:25:06 +00:00
Steve Murphy 67cb0526b7 Merged revisions 162013 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r162013 | murf | 2008-12-09 09:31:55 -0700 (Tue, 09 Dec 2008) | 45 lines

(closes issue #14019)
Reported by: ckjohnsonme
Patches:
      14019.diff uploaded by murf (license 17)
Tested by: ckjohnsonme, murf

This crash was the result of a few small errors that
would combine in 64-bit land to result in a crash.

32-bit land might have seen these combine to mysteriously
drop the args to an application call, in certain
circumstances.

Also, in trying to find this bug, I spotted
a situation in the flex input, where, in passing
back a 'word' to the parser, it would allocate
a buffer larger than necessary. I changed the
usage in such situations, so that strdup was
not used, but rather, an ast_malloc, followed
by ast_copy_string.

I removed a field from the pval struct, in
u2, that was never getting used, and set in
one spot in the code. I believe it was an
artifact of a previous fix to make switch
cases work invisibly with extens.

And, for goto's I removed a '!' from
before a strcmp, that has been there
since the initial merging of AEL2, that
might prevent the proper target of a 
goto from being found. This was pretty
harmless on its own, as it would just
louse up a consistency check for users.

Many thanks to ckjohnsonme for providing
a simplified and complete set of information
about the bug, that helped considerably in
finding and fixing the problem.

Now, to get aelparse up and running again
in trunk, and out of its "horribly broken" state,
so I can run the regression suite!


........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@162079 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-12-09 17:18:03 +00:00
Sean Bright fbb542055f Merged revisions 161426 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

................
  r161426 | seanbright | 2008-12-05 16:02:20 -0500 (Fri, 05 Dec 2008) | 15 lines
  
  Merged revisions 161421 via svnmerge from 
  https://origsvn.digium.com/svn/asterisk/branches/1.2
  
  ........
    r161421 | seanbright | 2008-12-05 15:50:23 -0500 (Fri, 05 Dec 2008) | 8 lines
    
    Fix build errors on FreeBSD (uint -> unsigned int).
    
    (closes issue #14006)
    Reported by: alphaque
    Patches:
          astobj2.h-patch uploaded by alphaque (license 259)
          (Slightly modified by seanbright)
  ........
................


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@161427 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-12-05 21:08:43 +00:00