dect
/
asterisk
Archived
13
0
Fork 0
Commit Graph

2300 Commits

Author SHA1 Message Date
tilghman e2706a3e8a Fix DEBUG_THREADS build on Darwin.
(closes issue #16828)
 Reported by: oej
 Patches: 
       20100331__issue16828.diff.txt uploaded by tilghman (license 14)


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@255796 f38db490-d61c-443f-a65b-d21fe96a405b
2010-04-01 18:16:37 +00:00
kpfleming 498703b187 Remove no-longer-used (and unsafe) field in ast_channel for linked lists.
The ast_channel structure had a field used for linking a channel into a
linked list, but now that ast_channel structures are ao2 objects, this is
no longer needed, and could be harmful as ao2 objects really shouldn't
ever be placed into linked lists (since those lists don't assist with
reference count management on the objects).


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@254637 f38db490-d61c-443f-a65b-d21fe96a405b
2010-03-25 18:38:27 +00:00
mmichelson 8e882d50c9 Merged revisions 254552 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r254552 | mmichelson | 2010-03-25 12:33:35 -0500 (Thu, 25 Mar 2010) | 5 lines
  
  Add doxygen for acl.h
  
  Review: https://reviewboard.asterisk.org/r/528
........


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@254553 f38db490-d61c-443f-a65b-d21fe96a405b
2010-03-25 17:42:36 +00:00
kpfleming a37e15e1be Improve handling of T.38 re-INVITEs that arrive before a T.38-capable
application is executing on a channel.

This patch addresses an issue found during working with end-users
using res_fax. If an incoming call is answered in the dialplan, or
jumps to the 'fax' extension due to reception of a CNG tone (with
faxdetect enabled), and then the remote endpoint sends a T.38
re-INVITE, it is possible for the channel's T.38 state to be
'T38_STATE_NEGOTIATING' when the application starts up. Unfortunately,
even if the application wants to use T.38, it can't respond to the
peer's negotiation request, because the AST_CONTROL_T38_PARAMETERS
control frame that chan_sip sent originally has been lost, and the
application needs the content of that frame to be able to formulate a
reply.

This patch adds a new 'request' type to AST_CONTROL_T38_PARAMETERS,
AST_T38_REQUEST_PARMS. If the application sends this request, chan_sip
will re-send the original control frame (with
AST_T38_REQUEST_NEGOTIATE as the request type), and the application
can respond as normal. If this occurs within the five second timeout
in chan_sip, the automatic cancellation of the peer reinvite will be
stopped, and the application will 'own' the negotiation process from
that point onwards.

This also improves the code path in chan_sip to allow sip_indicate(),
when called for AST_CONTROL_T38_PARAMETERS, to be able to return a
non-zero response, which should have been in place before since the
control frame *can* fail to be processed properly. It also modifies
ast_indicate() to return whatever result the channel driver returned
for this control frame, rather than converting all non-zero results
into '-1'. Finally, the new request type intentionally returns a
positive value, so that an application that sends
AST_T38_REQUEST_PARMS can know for certain whether the channel driver
accepted it and will be replying with a control frame of its own, or
whether it was ignored (if the sip_indicate()/ast_indicate() path had
properly supported failure responses before, this would not be
necessary).

This patch also modifies res_fax to take advantage of the new request.

In addition, this patch makes sip_t38_abort() actually lock the
private structure before doing its work... bad programmer, no donut.

This patch also enhances chan_sip's 'faxdetect' support to allow
triggering on T.38 re-INVITEs received as well as CNG tone detection.

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



git-svn-id: http://svn.digium.com/svn/asterisk/trunk@254450 f38db490-d61c-443f-a65b-d21fe96a405b
2010-03-25 15:27:31 +00:00
kpfleming 4f7d300b2d Change per-file debug and verbose levels to be per-module, the way
users expect them to work.

'core set debug' and 'core set verbose' can optionally change the
level for a specific filename; however, this is actually for a
specific source file name, not the module that source file is included
in. With examples like chan_sip, chan_iax2, chan_misdn and others
consisting of multiple source files, this will not lead to the
behavior that users expect. If they want to set the debug level for
chan_sip, they want it set for all of chan_sip, and not to have to
also set it for reqresp_parser and other files that comprise the
chan_sip module.

This patch changes this functionality to be module-name based instead
of file-name based.

To make this work, some Makefile modifications were required to ensure
that the AST_MODULE definition is present in each object file produced
for each module as well.

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



git-svn-id: http://svn.digium.com/svn/asterisk/trunk@253917 f38db490-d61c-443f-a65b-d21fe96a405b
2010-03-23 14:22:27 +00:00
tilghman abbeaec6b3 Fix bamboo compile error by calculating an integer with the same size as a pointer.
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@252980 f38db490-d61c-443f-a65b-d21fe96a405b
2010-03-17 00:14:29 +00:00
tilghman e4085f9c75 Fix test_time on Mac OS X (and other platforms without inotify)
Reviewboard: https://reviewboard.asterisk.org/r/554/


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@252846 f38db490-d61c-443f-a65b-d21fe96a405b
2010-03-16 19:34:01 +00:00
twilson 88bfcb6713 Only change the RTP ssrc when we see that it has changed
This change basically reverts the change reviewed in
https://reviewboard.asterisk.org/r/374/ and instead limits the
updating of the RTP synchronization source to only those times when we
detect that the other side of the conversation has changed the ssrc.

The problem is that SRCUPDATE control frames are sent many times where
we don't want a new ssrc, including whenever Asterisk has to send DTMF
in a normal bridge. This is also not the first time that this mistake
has been made. The initial implementation of the ast_rtp_new_source
function also changed the ssrc--and then it was removed because of
this same issue. Then, we put it back in again to fix a different
issue. This patch attempts to only change the ssrc when we see that
the other side of the conversation has changed the ssrc.

It also renames some functions to make their purpose more clear.

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


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@252089 f38db490-d61c-443f-a65b-d21fe96a405b
2010-03-12 22:04:51 +00:00
tilghman a6afd6e648 Remove portions that weren't meant to be committed for the OS X compat fix
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@251263 f38db490-d61c-443f-a65b-d21fe96a405b
2010-03-08 05:15:01 +00:00
tilghman 87f076953c Change needed to make Mac OS X 10.6 happy
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@251262 f38db490-d61c-443f-a65b-d21fe96a405b
2010-03-08 05:12:55 +00:00
russell 26bbb798cb Remove pbx_gtkconsole and related gtk1 checks.
Review: https://reviewboard.asterisk.org/r/541/


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@251022 f38db490-d61c-443f-a65b-d21fe96a405b
2010-03-05 19:32:19 +00:00
russell a477714ebc Fix up the ast_rtp_property enum.
The mis-placement of the latest entry meant that when it was set, it was writing
one index past the end of the properties array in the ast_rtp_instance (which
happened to be the local_address field).


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@250871 f38db490-d61c-443f-a65b-d21fe96a405b
2010-03-05 02:07:33 +00:00
rmudgett 869624a523 Removed cdrflags from ast_channel structure.
Only chan_dahdi set a value in cdrflags.  Everyone else just copied it
around the system.  Noone cared about any value it may have contained.


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@250565 f38db490-d61c-443f-a65b-d21fe96a405b
2010-03-03 19:38:06 +00:00
mnicholson ee037a2f38 Merge missed files from res_fax/res_fax_spandsp merge.
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@250213 f38db490-d61c-443f-a65b-d21fe96a405b
2010-03-02 23:22:11 +00:00
mnicholson bc9bd7bb7c Merge res_fax and res_fax_spandsp.
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@250190 f38db490-d61c-443f-a65b-d21fe96a405b
2010-03-02 23:11:06 +00:00
dvossel 3b12e80473 fixes adaptive jitterbuffer configuration
When configuring the adaptive jitterbuffer, the target_extra
value not only could not be set from the configuration, but was
not even being set to its proper default.  This value is required
in order for the adaptive jitterbuffer to work correctly.  To resolve
this a config option has been added to expose this value to the conf
files, and a default value is provided when no config specific value
is present.



git-svn-id: http://svn.digium.com/svn/asterisk/trunk@249893 f38db490-d61c-443f-a65b-d21fe96a405b
2010-03-02 19:08:38 +00:00
tilghman 9d853ef8c0 Properly document voicemail API documents. Also fix a crash reported via the -dev list.
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@249405 f38db490-d61c-443f-a65b-d21fe96a405b
2010-02-28 07:10:22 +00:00
russell 95472f9b2b Trim trailing whitespace, convert lists of defines to enums
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@249050 f38db490-d61c-443f-a65b-d21fe96a405b
2010-02-26 08:26:10 +00:00
tilghman fe7b0eae7b Merged revisions 248582 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r248582 | tilghman | 2010-02-24 15:02:18 -0600 (Wed, 24 Feb 2010) | 7 lines
  
  Remove color code sequences from verbose messages that go to logfiles.
  (closes issue #16786)
   Reported by: dodo
   Patches: 
         logger2.patch uploaded by dodo (license 989)
   Tested by: tilghman
........


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@248584 f38db490-d61c-443f-a65b-d21fe96a405b
2010-02-24 21:17:26 +00:00
russell 13ede37bbd Minor tweaks to comment blocks and includes.
Fix the copyright lines, tweak doxygen formatting, and remove some unnecessary
includes.


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@248226 f38db490-d61c-443f-a65b-d21fe96a405b
2010-02-22 06:45:52 +00:00
mmichelson b6c8764285 Fix two problems in ast_str functions found while writing a unit test.
1. The documentation for ast_str_set and ast_str_append state that
the max_len parameter may be -1 in order to limit the size of the
ast_str to its current allocated size. The problem was that the max_len
parameter in all cases was a size_t, which is unsigned. Thus a -1 was
interpreted as UINT_MAX instead of -1. Changing the max_len parameter
to be ssize_t fixed this issue.

2. Once issue 1 was fixed, there was an off-by-one error in the case
where we attempted to write a string larger than the current allotted
size to a string when -1 was passed as the max_len parameter. When trying
to write more than the allotted size, the ast_str's __AST_STR_USED was
set to 1 higher than it should have been. Thanks to Tilghman for quickly
spotting the offending line of code.

Oh, and the unit test that I referenced in the top line of this commit
will be added to reviewboard shortly. Sit tight...



git-svn-id: http://svn.digium.com/svn/asterisk/trunk@247335 f38db490-d61c-443f-a65b-d21fe96a405b
2010-02-17 21:22:40 +00:00
mmichelson e0188cab26 Add some clarifying documentation to the ast_str_set and ast_str_append functions.
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@246985 f38db490-d61c-443f-a65b-d21fe96a405b
2010-02-16 21:15:38 +00:00
russell 1dea8c2fc1 Add a test module for the event API, test_event.c.
This module includes a single test so far that creates events using two
different methods and does some verification on the result to make sure
the correct data can be retrieved from the event that was created.

One bug was found in the event API while developing this test, which makes
me happy.  :-)

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


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@246260 f38db490-d61c-443f-a65b-d21fe96a405b
2010-02-10 23:19:16 +00:00
tilghman b65768d7bb Solaris doesn't like outputting a NULL to a %s in format strings.
Detect all platforms that don't like that, either, and ensure that when documentation is
missing, we pass a non-NULL pointer when outputting the corresponding documentation.

(closes issue #16689)
 Reported by: bklang
 Patches: 
       20100209__issue16689__with_tests.diff.txt uploaded by tilghman (license 14)
 
Review: https://reviewboard.asterisk.org/r/497/


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@246030 f38db490-d61c-443f-a65b-d21fe96a405b
2010-02-10 16:01:28 +00:00
russell d8d63de328 Various updates to the unit test API.
1) It occurred to me that the difference in usage between the error ast_str and
the ast_test_update_status() usage has turned out to be a bit ambiguous in
practice.  In a lot of cases, the same message was being sent to both.
In other cases, it was only sent to one or the other.  My opinion now is that
in every case, I think it makes sense to do both; we should output it to the
CLI as well as save it off for logging purposes.

This change results in most of the changes in this diff, since it required
changes to all existing unit tests.  It also allowed for some simplifications
of unit test API implementation code.

2) Update ast_test_status_update() to include the file, function, and line
number for the code providing the update.

3) There are some formatting tweaks here and there.  Hopefully they aren't too
distracting for code review purposes.  Reviewboard's diff viewer seems to do a
pretty good job of pointing out when something is a whitespace change.

4) I moved the md5_test and sha1_test into the test_utils module.  It seemed
like a better approach since these tests are so tiny.

5) I changed the number of nodes used in heap_test_2 from 1 million to
100 thousand.  The only reason for this was to reduce the time it took
for this test to run.

6) Remove an unused function prototype that was at the bottom of utils.h.

7) Simplify test_insert() using the LIST_INSERT_SORTALPHA() macro.  The one
minor difference in behavior is that it no longer checks for a test registered
with the same name.

8) Expand the code in test_alloc() to provide specific error messages for each
failure case, to clearly inform developers if they forget to set the name,
summary, description, etc.

9) Tweak the output of the "test show registered" CLI command.  I swapped the
name and category to have the category first.  It seemed more natural since
that is the sort key.

10) Don't output the status ast_str in the "test show results" CLI command.
This is going to tend to be pretty verbose, so just leave that for the
detailed test logs (test generate results).

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


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@245864 f38db490-d61c-443f-a65b-d21fe96a405b
2010-02-09 23:32:14 +00:00
dvossel 637d35675d fixes astobj2 unlinking of multiple objects when OBJ_MULTIPLE was disabled
When OBJ_MULTIPLE was off but OBJ_UNLINK was on, all the items in a bucket
were being unlinked instead of just the first match.  This fixes that.

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



git-svn-id: http://svn.digium.com/svn/asterisk/trunk@245147 f38db490-d61c-443f-a65b-d21fe96a405b
2010-02-05 21:21:05 +00:00
tilghman 0880c79926 Oops
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@244729 f38db490-d61c-443f-a65b-d21fe96a405b
2010-02-04 18:47:21 +00:00
tilghman b33c69859b Define a small set of constant return values
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@244728 f38db490-d61c-443f-a65b-d21fe96a405b
2010-02-04 18:46:12 +00:00
dvossel 58fe88b0cc fixes crash during T.38 negotiation caused by invalid or missing FaxMaxDatagram field
AST-2010-001

(closes issue #16634)
Reported by: krn

(closes issue #16724)
Reported by: barthpbx

(closes issue #16517)
Reported by: bklang

(closes issue #16485)
Reported by: elsto




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


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@243551 f38db490-d61c-443f-a65b-d21fe96a405b
2010-01-27 18:29:49 +00:00
dvossel 1bc7ad599c RFC compliant uri and display-name encode/decode
1.  URI Encoding
This patch changes ast_uri_encode()'s behavior when doreserved is enabled.
Previously when doreserved was enabled only a small set of reserved
characters were encoded.  This set was comprised primarily of the reserved
characters defined in RFC3261 section 25.1, but contained other characters as
well.  Rather than only escaping the reserved set, doreserved now escapes
all characters not within the unreserved set as defined by RFC 3261 and
RFC 2396.  Also, the 'doreserved' variable has been renamed to 'do_special_char'
in attempts to avoid confusion.

When doreserve is not enabled, the previous logic of only encoding the
characters <= 0X1F and > 0X7f remains, except for the '%' character, which
must always be encoded as it signifies a HEX escaped character during the decode
process.

2. URI Decoding: Break up URI before decode.
In chan_sip.c ast_uri_decode is called on the entire URI instead of it's
individual parts after it is parsed.  This is not good as ast_uri_decode
can introduce special characters back into the URI which can mess up parsing.
This patch resolves this by not decoding a URI until parsing is completely
done.  There are many instances where we check to see if pedantic checking
is enabled before we decode a URI.  In these cases a new macro,
SIP_PEDANTIC_DECODE, is used on the individual parsed segments of the URI
rather than constantly putting if (pedantic) { decode() } checks everywhere
in the code.  In the areas where ast_uri_decode is not dependent upon
pedantic checking this macro is not used, but decoding is still moved to
each individual part of the URI.  The only behavior that should change from
this patch is the time at which decoding occurs.

Since I had to look over every place URI parsing occurs to create this
patch, I found several places where we use duplicate code for parsing.
To consolidate the code, those areas have updated to use the parse_uri()
function where possible.

3. SIP display-name decoding according to RFC3261 section 25.
To properly decode the display-name portion of a FROM header, chan_sip's
get_calleridname() function required a complete re-write.  More information
about this change can be found in the comments at the beginning of this function.

4. Unit Tests.
Unit tests for ast_uri_encode, ast_uri_decode, and get_calleridname() have been
written.  This involved the addition of the test_utils.c file for testing the
utils api.

(closes issue #16299)
Reported by: wdoekes
Patches:
      astsvn-16299-get_calleridname.diff uploaded by wdoekes (license 717)
      get_calleridname_rewrite.diff uploaded by dvossel (license 671)
Tested by: wdoekes, dvossel, Nick_Lewis

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



git-svn-id: http://svn.digium.com/svn/asterisk/trunk@243200 f38db490-d61c-443f-a65b-d21fe96a405b
2010-01-26 16:30:08 +00:00
oej 52cccf6084 Change api for pbx_builtin_setvar to actually return error code if a function can't be written to.
This patch removes code that was duplicated from pbx.c to manager.c
in order to prevent API change in released versions of Asterisk.

There are propably also other places that would benefit from reading the
return code and react if a function returns error codes on writing a value into it.


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@242919 f38db490-d61c-443f-a65b-d21fe96a405b
2010-01-25 21:13:20 +00:00
tilghman 8b4dc27865 Merged revisions 242520 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r242520 | tilghman | 2010-01-24 00:33:01 -0600 (Sun, 24 Jan 2010) | 8 lines
  
  Only rebuild bison and flex source files on demand, if bison and flex are detected by the configure script.
  
  Changed after discussion on the -dev list about possible unnecessary build
  failures, due to checkouts/untars causing these special source files to
  possibly be newer than their resulting C files.  This should additionally
  ensure that nobody need learn about extra Makefile arguments to ensure the
  proper files get rebuilt when changes are made to these special source files.
........


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@242521 f38db490-d61c-443f-a65b-d21fe96a405b
2010-01-24 06:40:31 +00:00
tilghman fb0c85edeb Create iterative method for querying SRV results, and use that for finding AGI servers.
(closes issue #14775)
 Reported by: _brent_
 Patches: 
       20091215__issue14775.diff.txt uploaded by tilghman (license 14)
       hagi-5.patch uploaded by brent (license 388)
 Tested by: _brent_
 Reviewboard: https://reviewboard.asterisk.org/r/378/


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@241188 f38db490-d61c-443f-a65b-d21fe96a405b
2010-01-19 00:28:49 +00:00
jpeeler 93d7808948 Extend max call limit duration from 24.8 days to 292+ million years.
If the limit was set past MAX_INT upon answering, the call was immediately
hung up due to overflow from the return of ast_tvdiff_ms (in ast_check_hangup).
The time calculation functions ast_tvdiff_sec and ast_tvdiff_ms have been
changed to return an int64_t to prevent overflow. Also the reporter suggested
adding a message indicating the reason for the call hanging up. Given that the
new limit is so much higher, the message (which would only really be useful in
the overflow scenario) has been made a debug message only.

(closes issue #16006)
Reported by: viraptor


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@241143 f38db490-d61c-443f-a65b-d21fe96a405b
2010-01-18 22:31:25 +00:00
russell 0716d7b553 Note where empty lines should reside in commit messages.
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@240552 f38db490-d61c-443f-a65b-d21fe96a405b
2010-01-15 23:09:09 +00:00
tilghman 602a8e74b2 Add pickup event to AMI. Also, fix AMI documentation.
(closes issue #16431)
 Reported by: syspert
 Patches: 
       20100112__issue16431.diff.txt uploaded by tilghman (license 14)


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@240421 f38db490-d61c-443f-a65b-d21fe96a405b
2010-01-15 21:04:34 +00:00
tilghman 0183b31199 Add the TESTTIME() dialplan function, which permits testing GotoIfTime.
Specifically, by setting TESTTIME() to a particular date and time, you
can test whether a dialplan correctly branches as was intended.  This was
developed after recent questions on the -users list on how to test their
holiday dialplan logic.
(closes issue #16464)
 Reported by: tilghman
 Patches: 
       20100112__issue16464.diff.txt uploaded by tilghman (license 14)
 
Review: https://reviewboard.asterisk.org/r/458/


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@239957 f38db490-d61c-443f-a65b-d21fe96a405b
2010-01-13 21:27:34 +00:00
oej 0ec8b96fab Adding Tilghman's documentation from asterisk-dev to the actual file.
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@239389 f38db490-d61c-443f-a65b-d21fe96a405b
2010-01-12 07:48:16 +00:00
dvossel a97f411189 fixes AUDIOHOOK_INHERIT regression
During the process of removing an audiohook from one channel
and attaching it to another the audiohook's status is updated
to DONE and then back to whatever it was previously.  Typically
updating the status after setting it to DONE is not a good idea
because DONE can trigger unrecoverable audiohook destruction
events... because of this a conditional check was added to
audiohook_update_status to explicitly prevent the audiohook
from ever changing after being set to DONE.  It was this check
that prevented audiohook inherit from work properly though.

Now ast_audiohook_move_by_source is treated as a special exception,
as the audiohook must be returned to its previous status after
attaching it to the new channel.  This is only a safe operation
because the audiohook's lock is held the entire time, otherwise
this could cause trouble.

(closes issue #16522)
Reported by: corruptor



git-svn-id: http://svn.digium.com/svn/asterisk/trunk@238635 f38db490-d61c-443f-a65b-d21fe96a405b
2010-01-08 19:39:30 +00:00
dvossel 6f136ab178 fixes test.c compile issue when TEST_FRAMEWORK is not enabled
The ast_test_status_update() function is defined in test.h.
When TEST_FRAMEWORK is not enabled a macro is defined as a no-op
place holder for this function.  The macro did not contain
the correct number of arguments.  This caused a compile error.

Much thanks to wdoekes for reporting the issue and supplying the
patch!



git-svn-id: http://svn.digium.com/svn/asterisk/trunk@238091 f38db490-d61c-443f-a65b-d21fe96a405b
2010-01-06 16:36:02 +00:00
tilghman fda6c101b6 Merged revisions 237405 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r237405 | tilghman | 2010-01-04 12:19:00 -0600 (Mon, 04 Jan 2010) | 16 lines
  
  Add a flag to disable the Background behavior, for AGI users.
  This is in a section of code that relates to two other issues, namely
  issue #14011 and issue #14940), one of which was the behavior of
  Background when called with a context argument that matched the current
  context.  This fix broke FreePBX, however, in a post-Dial situation.
  Needless to say, this is an extremely difficult collision of several
  different issues.  While the use of an exception flag is ugly, fixing all
  of the issues linked is rather difficult (although if someone would like
  to propose a better solution, we're happy to entertain that suggestion).
  (closes issue #16434)
   Reported by: rickead2000
   Patches: 
         20091217__issue16434.diff.txt uploaded by tilghman (license 14)
         20091222__issue16434__1.6.1.diff.txt uploaded by tilghman (license 14)
   Tested by: rickead2000
........


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@237406 f38db490-d61c-443f-a65b-d21fe96a405b
2010-01-04 18:28:28 +00:00
seanbright ac6c802dd9 Merged revisions 236585 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r236585 | seanbright | 2009-12-28 10:12:08 -0500 (Mon, 28 Dec 2009) | 7 lines
  
  Try a test compile to see if PTHREAD_ONCE_INIT requires extra braces.
  
  There was conditional code (based on build platform) to optioinally wrap
  PTHREAD_ONCE_INIT in braces that was removed since it is fixed in newer versions
  of Solaris/OpenSolaris, but I am still running into it on Solaris 10 x86 so add
  a configure-time check for it.
........


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@236613 f38db490-d61c-443f-a65b-d21fe96a405b
2009-12-28 15:22:54 +00:00
tilghman 27288e6072 Allow test_heap.c to compile when AST_DEVMODE is true, but TEST_FRAMEWORK is false
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@236185 f38db490-d61c-443f-a65b-d21fe96a405b
2009-12-23 03:03:47 +00:00
dvossel 5d1bac896e Unit Test Framework API
The Unit Test Framework is a new API that manages registration and
execution of unit tests in Asterisk with the purpose of verifying the
operation of C functions.  The Framework consists of a single test
manager accompanied by a list of registered test functions defined
within the code.  A test is defined, registered, and unregistered
from the framework using a set of macros which allow the test code
to only be compiled within asterisk when the TEST_FRAMEWORK flag is
enabled in menuselect.  This allows the test code to exist in the
same file as the C functions it intends to verify.  Registered tests
may be viewed and executed via a set of new CLI commands.  CLI commands
are also present for generating and exporting test results into xml
and txt formats.

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

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


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@236027 f38db490-d61c-443f-a65b-d21fe96a405b
2009-12-22 16:09:11 +00:00
kpfleming 09a7be92ae Change all refererences to 1.6.3 to be 1.8, since that will be the next feature release
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@235904 f38db490-d61c-443f-a65b-d21fe96a405b
2009-12-21 18:51:17 +00:00
jpeeler 9e662bbfaa Merged revisions 235635 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r235635 | jpeeler | 2009-12-18 16:29:51 -0600 (Fri, 18 Dec 2009) | 48 lines
  
  Correct CDR dispositions for BUSY/FAILED
  
  This patch is simple in that it reorders the disposition defines so that the fix
  for issue 12946 works properly (the default CDR disposition was changed to
  AST_CDR_NOANSWER). Also, the AST_CDR_FLAG_ORIGINATED flag was set in ast_call to
  ensure all CDR records are written.
  
  The side effects of CDR changes are scary, so I'm documenting the test cases
  performed to attempt to catch any regressions. The following tests were all
  performed using 1.4 rev 195881 vs head (235571) + patch:
  
  A calls B
  C calls B (busy)
  Hangup C
  Hangup A
  
  (Both SIP and features)
  A calls B
  A blind transfers to C
  Hangup C
  
  (Both SIP and features)
  A calls B
  A attended transfers to C
  Hangup C
  
  A calls B
  A attended transfers to C (SIP)
  C blind transfers to A (features)
  Hangup A
  
  All of the test scenario CDRs matched.
  
  The following tests were performed just with the patch to ensure proper operation
  (with unanswered=yes):
  
  exten =>s,1,Answer
  exten =>s,n,ResetCDR(w)
  exten =>s,n,ResetCDR(w)
  
  exten =>s,1,ResetCDR(w)
  exten =>s,n,ResetCDR(w)
  
  (closes issue #16180)
  Reported by: aatef
  Patches: 
        bug16180.patch uploaded by jpeeler (license 325)
........


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@235660 f38db490-d61c-443f-a65b-d21fe96a405b
2009-12-18 22:51:37 +00:00
jpeeler 3c23a5b71c Add auth_policy option to jabber.conf for auto user registration.
The option is global and currently the acceptable values as noted in the sample
config are accept or deny.

(closes issue #15228)
Reported by: lp0


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@235342 f38db490-d61c-443f-a65b-d21fe96a405b
2009-12-16 20:25:27 +00:00
tilghman a7ea4800e3 Is it Friday yet?
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@235229 f38db490-d61c-443f-a65b-d21fe96a405b
2009-12-15 23:51:05 +00:00
jpeeler a365e23dbc Add applications JabberJoin, JabberLeave, JabberSendGroup for XMPP groupchat
(closes issue #14352)
Reported by: fiddur
Patches: 
      trunk-14352-2.diff uploaded by phsultan (license 73)
Tested by: fiddur


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@233468 f38db490-d61c-443f-a65b-d21fe96a405b
2009-12-07 17:59:46 +00:00
tilghman 7c77f7803f Move implementation of closefrom(3) from app.c to strcompat.c
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@233358 f38db490-d61c-443f-a65b-d21fe96a405b
2009-12-06 07:01:06 +00:00
tilghman e3cfc784dd OS X does not define MSG_NOSIGNAL, but it does have a socket option SO_NOSIGPIPE.
(closes issue #16178)
 Reported by: oej


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@232950 f38db490-d61c-443f-a65b-d21fe96a405b
2009-12-04 04:52:24 +00:00
tilghman 5713766b01 Fix multiple issues with musiconhold, which led to classes not getting destroyed properly.
* Classes are now tracked past removal from the core container, and module
   removal is actively prevented until all references are freed.
 * A hanging reference stored in the channel has been removed.  This could have
   caused a mismatch and the music state not properly cleared, if two or more
   reloads occurred between MOH being stopped and MOH being restarted.
 * In certain circumstances, duplicate classes were possible.
 * A race existed at reload time between a process being killed and the thread
   responsible for reading from the related pipe respawning that process.
 * Several reference counts have also been corrected.  At least one could have
   caused deleted classes to stick around forever, consuming resources.  This
   originally manifested as MOH external processes that were not killed at
   reload time.
(closes issue #16279, closes issue #16207)
 Reported by: parisioa, dcabot
 Patches: 
       20091202__issue16279__2.diff.txt uploaded by tilghman (license 14)
 Tested by: parisioa, tilghman


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@232660 f38db490-d61c-443f-a65b-d21fe96a405b
2009-12-03 00:08:55 +00:00
tilghman 9b24e69df6 So apparently, some platforms don't have ffsll(3).
The manpage lies; it says that the function is in POSIX, but that's only for
ffs(3), not ffsll(3).


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@232164 f38db490-d61c-443f-a65b-d21fe96a405b
2009-12-02 03:26:16 +00:00
tilghman f4d89e410a More 32->64 bit codec conversions.
In the process of swapping ULAW to a place in the extended codec space, we
found several unhandled cases, where a 32-bit integer was still being used to
handle a codec field.  Most of these have been fixed with this commit, although
there is at least one case (codec_dahdi) which depends upon outside headers to
be altered before a conversion can be made.
(Fixes AST-278, SWP-459)


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@231850 f38db490-d61c-443f-a65b-d21fe96a405b
2009-12-01 20:27:37 +00:00
tilghman f925470a1b Formats need to be able to represent all 64 codec bits.
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@231814 f38db490-d61c-443f-a65b-d21fe96a405b
2009-12-01 17:48:54 +00:00
kpfleming 9b2fe661f9 Another round of UDPTL stack fixes/improvements:
1) Allow users of UDPTL stack to associate a character-string tag with a UDPTL
   session, so that log/error/debug messages generated by the UDPTL stack can
   be 'connected' to the endpoint that caused them to be generated.

2) Improve comments (and process) of calculating the far end's maximum IFP size
   when redundancy mode is in use for error correction.

3) When an IFP larger than the calculated 'far max IFP' size is presented for
   writing, truncate it rather than putting in the buffer and allowing the buffer
   to overflow; this will cause the ends to retrain to a lower bit rate that
   produces IFPs of an appropriate size if possible, and if not possible, the
   FAX transfer will fail completely. In these cases, it is due to the one endpoint
   supplying a T38FaxMaxDatagram value that is improperly calculated and is
   too low to be of use; we have configuration options available to override
   this behavior.

4) Eliminate use of T38FaxMaxDatagram value in udptl.conf; it is no longer
   needed.



git-svn-id: http://svn.digium.com/svn/asterisk/trunk@231692 f38db490-d61c-443f-a65b-d21fe96a405b
2009-11-30 21:47:42 +00:00
mnicholson 60d1d4196a Merged revisions 231614 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r231614 | mnicholson | 2009-11-30 15:11:44 -0600 (Mon, 30 Nov 2009) | 8 lines
  
  Remove duplicate entries from voicemail format lists. This prevents app_voicemail from entering an infinite loop when the same format is specified twice in the format list.
  
  (closes issue #15625)
  Reported by: Shagg63
  Tested by: mnicholson
  
  Review: https://reviewboard.asterisk.org/r/429/
........


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@231688 f38db490-d61c-443f-a65b-d21fe96a405b
2009-11-30 21:31:55 +00:00
mnicholson 8531434222 Reverted 231616
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@231637 f38db490-d61c-443f-a65b-d21fe96a405b
2009-11-30 21:21:29 +00:00
mnicholson 7b0b50b4da Merged revisions 231614 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r231614 | mnicholson | 2009-11-30 15:11:44 -0600 (Mon, 30 Nov 2009) | 8 lines
  
  Remove duplicate entries from voicemail format lists. This prevents app_voicemail from entering an infinite loop when the same format is specified twice in the format list.
  
  (closes issue #15625)
  Reported by: Shagg63
  Tested by: mnicholson
  
  Review: https://reviewboard.asterisk.org/r/429/
........


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@231616 f38db490-d61c-443f-a65b-d21fe96a405b
2009-11-30 21:13:42 +00:00
tilghman 2b686b20ab Add REPLACE & PASSTHRU functions, overhaul of func_strings, fix API docs for the ast_get_encoded_* functions.
* Add REPLACE function, which searches a given variable for a set of
   characters and replaces each with a given character.
 * Add PASSTHRU function, which passes a literal string back, like a NoOp for
   functions.  Intent is to be able to specify a literal string to another
   function that takes a variable name as an argument.
 * Let the array manipulation functions work with dialplan functions, in
   addition to variables.  This allows the array manipulation functions to
   modify ASTDB and ODBC backends, assuming the func_odbc configuration has
   both read and write functions.
(closes issue #15223)
 Reported by: ajohnson
Patches: 
       20091112__issue15223.diff.txt uploaded by tilghman (license 14)
 Tested by: lmadsen, tilghman


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@230994 f38db490-d61c-443f-a65b-d21fe96a405b
2009-11-24 04:58:44 +00:00
tilghman f6a062de82 Revert code in error and include the gcc suggested workaround for the original problem, while gcc investigates.
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@230697 f38db490-d61c-443f-a65b-d21fe96a405b
2009-11-20 21:47:39 +00:00
dvossel 56608fa6db audiohook signal trigger on every status change
(issue #14618)

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


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@230583 f38db490-d61c-443f-a65b-d21fe96a405b
2009-11-20 17:26:20 +00:00
tilghman 97d8d90ef9 Increase maximum length of language buffers
(closes issue #16217)
 Reported by: dsessions


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@230217 f38db490-d61c-443f-a65b-d21fe96a405b
2009-11-15 07:53:16 +00:00
tilghman 317ea2e45d Display a list of channel variables in each channel-oriented event.
(Closes AST-33)
Reviewboard:	https://reviewboard.asterisk.org/r/368/


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@230111 f38db490-d61c-443f-a65b-d21fe96a405b
2009-11-13 20:42:03 +00:00
mnicholson 58cae9b825 Merged revisions 228827 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r228827 | mnicholson | 2009-11-09 08:16:03 -0600 (Mon, 09 Nov 2009) | 8 lines
  
  Perform limited bounds checking when destroying ast_mutex_t structures to make sure we don't try to use negative indices.
  
  (closes issue #15588)
  Reported by: zerohalo
  Patches:
        20090820__issue15588.diff.txt uploaded by tilghman (license 14)
  Tested by: zerohalo
........


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@228858 f38db490-d61c-443f-a65b-d21fe96a405b
2009-11-09 14:37:07 +00:00
tilghman 874e8f65a9 Fixes for gcc 4.4
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@227824 f38db490-d61c-443f-a65b-d21fe96a405b
2009-11-04 20:35:24 +00:00
tilghman 23364993b6 mmichelson reported a compilation error related to codec bit expansion that should be resolved with a simple include of frame_defs.h
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@227645 f38db490-d61c-443f-a65b-d21fe96a405b
2009-11-04 16:35:27 +00:00
tilghman 3bacd4082e Expand codec bitfield from 32 bits to 64 bits.
Reviewboard: https://reviewboard.asterisk.org/r/416/


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@227580 f38db490-d61c-443f-a65b-d21fe96a405b
2009-11-04 14:05:12 +00:00
tilghman 1d3ce2ae5f chan_misdn will fail to compile if the redirect_dn member is missing
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@227579 f38db490-d61c-443f-a65b-d21fe96a405b
2009-11-04 13:57:09 +00:00
dbrooks 741c3d606f AMI hook interface
This patch, originally submitted by jozza, enables custom modules to send actions to AMI
and receive messages from AMI via a hook interface. Included is a simple test module to
illustrate the interface.

(closes issue #14635)
Reported by: jozza

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


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@227448 f38db490-d61c-443f-a65b-d21fe96a405b
2009-11-03 21:26:28 +00:00
mnicholson 899c3fed76 This patch adds a sequence field to CDRs that can be combined with the linkedid or uniqueid field to uniquely identify a CDR.
(closes issue #15180)
Reported by: Nick_Lewis
Patches:
      cdr-sequence10.diff uploaded by mnicholson (license 96)
Tested by: mnicholson


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@227435 f38db490-d61c-443f-a65b-d21fe96a405b
2009-11-03 21:21:09 +00:00
tilghman 21f12d5255 Add PacketCable NCS 1.0 support for Docsis/Eurodocsis networks
(closes issue #12950)
 Reported by: alea-soluciones
 Patches: 
       ncs-pktccops-12950-r206803.patch uploaded by alea-soluciones (license 514)
 Tested by: alea-soluciones, adomjan, urtho, nahuelgreco


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


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

........
  r226304 | tilghman | 2009-10-28 13:02:25 -0500 (Wed, 28 Oct 2009) | 2 lines
  
  Fix documentation (pointed out by TheDavidFactor on #-dev)
........


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@226305 f38db490-d61c-443f-a65b-d21fe96a405b
2009-10-28 18:04:05 +00:00
rmudgett 4ad439617d Add to chan_dahdi ISDN HOLD, Call deflection, and keypad facility support.
* Added handling of received HOLD/RETRIEVE messages and the optional ability
  to transfer a held call on disconnect similar to an analog phone.
* Added CallRerouting/CallDeflection support for Q.SIG, ETSI PTP, ETSI PTMP.
  Will reroute/deflect an outgoing call when receive the message.
  Can use the DAHDISendCallreroutingFacility to send the message for the
  supported switches.
* Added ability to send/receive keypad digits in the SETUP message.
  Send keypad digits in SETUP message: Dial(DAHDI/g1[/K<keypad_digits>][/extension])
  Access any received keypad digits in SETUP message by: ${CHANNEL(keypad_digits)}
* Added support for BRI PTMP NT mode.


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@225692 f38db490-d61c-443f-a65b-d21fe96a405b
2009-10-23 16:57:33 +00:00
lmadsen dbdff8732f Add Asterisk Git HowTo documentation.
Added documentation on how to create a local git repository from
SVN. This documentation was added via doxygen.


(closes issue #15814)
Reported by: tzafrir
Patches:
      git-asterisk-howto uploaded by tzafrir (license 46)

git-svn-id: http://svn.digium.com/svn/asterisk/trunk@225483 f38db490-d61c-443f-a65b-d21fe96a405b
2009-10-22 21:28:44 +00:00
dvossel 226347511b SIP TCP/TLS: move client connection setup/write into tcp helper thread, various related locking/memory fixes.
What this patch fixes
1.Moves sip TCP/TLS connection setup into the TCP helper thread:
  Connection setup takes awhile and before this it was being
  done while holding the monitor lock.
2.Moves TCP/TLS writing to the TCP helper thread:  Through the
  use of a packet queue and an alert pipe, the TCP helper thread
  can now be woken up to write data as well as read data.
3.Locking error: sip_xmit returned an XMIT_ERROR without giving
  up the tcptls_session lock.  This lock has been completely removed
  from sip_xmit and placed in the new sip_tcptls_write() function.
4.Memory leak:  When creating a tcptls_client the tls_cfg was alloced
  but never freed unless the tcptls_session failed to start.  Now the
  session_args for a sip client are an ao2 object which frees the
  tls_cfg on destruction.
5.Pointer to stack variable: During sip_prepare_socket the creation
  of a client's ast_tcptls_session_args was done on the stack and
  stored as a pointer in the newly created tcptls_session.  Depending
  on the events that followed, there was a slight possibility that
  pointer could have been accessed after the stack returned.  Given
  the new changes, it is always accessed after the stack returns
  which is why I found it.

Notable code changes
1.I broke tcptls.c's ast_tcptls_client_start() function into two
  functions.  One for creating and allocating the new tcptls_session,
  and a separate one for starting and handling the new connection.
  This allowed me to create the tcptls_session, launch the helper
  thread, and then establish the connection within the helper thread.
2.Writes to a tcptls_session are now done within the helper thread.
  This is done by using an alert pipe to wake up the thread if new
  data needs to be sent.  The thread's sip_threadinfo object contains
  the alert pipe as well as the packet queue.
3.Since the threadinfo object contains the alert pipe, it must now be
  accessed outside of the helper thread for every write (queuing of a
  packet).  For easy lookup, I moved the threadinfo objects from a
  linked list to an ao2_container.

(closes issue #13136)
Reported by: pabelanger
Tested by: dvossel, whys

(closes issue #15894)
Reported by: dvossel
Tested by: dvossel

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



git-svn-id: http://svn.digium.com/svn/asterisk/trunk@225445 f38db490-d61c-443f-a65b-d21fe96a405b
2009-10-22 19:55:51 +00:00
tilghman 3c27a56e3e Merged revisions 225105 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r225105 | tilghman | 2009-10-21 11:02:12 -0500 (Wed, 21 Oct 2009) | 4 lines
  
  Fix documentation for ast_softhangup() and correct the misuse thereof.
  (closes issue #16103)
   Reported by: majorbloodnok
........


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@225360 f38db490-d61c-443f-a65b-d21fe96a405b
2009-10-22 17:11:23 +00:00
rmudgett d7a3a1035d Add support for calling and called subaddress. Partial support for COLP subaddress.
The Telecom Specs in NZ suggests that SUB ADDRESS is always on, so doing
"desk to desk" between offices each with an asterisk box over the ISDN
should then be possible, without a whole load of DDI numbers required.

(closes issue #15604)
Reported by: alecdavis
Patches:
      asterisk_subaddr_trunk.diff11.txt uploaded by alecdavis (license 585)
      Some minor modificatons were made.
Tested by: alecdavis, rmudgett

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


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@225357 f38db490-d61c-443f-a65b-d21fe96a405b
2009-10-22 16:33:22 +00:00
kpfleming 4f428997ca Finish implementaton of astobj2 OBJ_MULTIPLE, and convert ast_channel_iterator to use it.
This patch finishes the implementation of OBJ_MULTIPLE in astobj2 (the
case where multiple results need to be returned; OBJ_NODATA mode
already was supported). In addition, it converts ast_channel_iterators
(only the targeted versions, not the ones that iterate over all
channels) to use this method.

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

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



git-svn-id: http://svn.digium.com/svn/asterisk/trunk@225244 f38db490-d61c-443f-a65b-d21fe96a405b
2009-10-21 21:08:47 +00:00
russell 039146041a Merged revisions 224931 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r224931 | russell | 2009-10-20 21:59:54 -0500 (Tue, 20 Oct 2009) | 5 lines
  
  Isolate frames returned from a DSP instance or codec translator.
  
  The reasoning for these changes are the same as what I wrote in the commit
  message for rev 222878.
........


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@224932 f38db490-d61c-443f-a65b-d21fe96a405b
2009-10-21 03:09:04 +00:00
tilghman 0ff900410d Remove unnecessary typedef
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@224403 f38db490-d61c-443f-a65b-d21fe96a405b
2009-10-17 16:39:37 +00:00
tilghman 0c997b3fd1 Create an API for adding an optional time unit onto the ends of time periods.
Two examples of its use are included, and the usage could be expanded in some
cases into certain configuration options where time periods are specified.


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@224225 f38db490-d61c-443f-a65b-d21fe96a405b
2009-10-15 22:33:30 +00:00
rmudgett 378d8e4bff Fix some doxygen format problems and trim trailing whitespace.
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@223912 f38db490-d61c-443f-a65b-d21fe96a405b
2009-10-13 17:11:46 +00:00
twilson 0e46ff9d32 Fix handling of notification calls w/ the dialing api
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@223874 f38db490-d61c-443f-a65b-d21fe96a405b
2009-10-13 01:51:46 +00:00
twilson a596e54d5b Remove global variable that makes dlopen unhappy
This isn't the best way to do this, but it is the easiest. There are some
limitations that are going to need to be addressed at some point with reloads
and when I (or someone else) work on that, then the API can be updated to
handle passing the private config data that the calendar tech modules need in
a better way as well.


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@223016 f38db490-d61c-443f-a65b-d21fe96a405b
2009-10-08 23:11:23 +00:00
russell 5b989dda45 Merged revisions 222878 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r222878 | russell | 2009-10-08 14:45:47 -0500 (Thu, 08 Oct 2009) | 44 lines
  
  Make filestream frame handling safer by isolating frames before returning them.
  
  This patch is related to a number of issues on the bug tracker that show
  crashes related to freeing frames that came from a filestream.  A number of
  fixes have been made over time while trying to figure out these problems, but
  there re still people seeing the crash.  (Note that some of these bug reports
  include information about other problems.  I am specifically addressing
  the filestream frame crash here.)
  
  I'm still not clear on what the exact problem is.  However, what is _very_
  clear is that we have seen quite a few problems over time related to unexpected
  behavior when we try to use embedded frames as an optimization.  In some cases,
  this optimization doesn't really provide much due to improvements made in other
  areas.
  
  In this case, the patch modifies filestream handling such that the embedded frame
  will not be returned.  ast_frisolate() is used to ensure that we end up with a
  completely mallocd frame.  In reality, though, we will not actually have to malloc
  every time.  For filestreams, the frame will almost always be allocated and freed
  in the same thread.  That means that the thread local frame cache will be used.
  So, going this route doesn't hurt.
  
  With this patch in place, some people have reported success in not seeing the
  crash anymore.
  
  (SWP-150)
  (AST-208)
  (ABE-1834)
  
  (issue #15609)
  Reported by: aragon
  Patches:
        filestream_frisolate-1.4.diff2.txt uploaded by russell (license 2)
  Tested by: aragon, russell
  
  (closes issue #15817)
  Reported by: zerohalo
  Tested by: zerohalo
  
  (closes issue #15845)
  Reported by: marhbere
  
  Review: https://reviewboard.asterisk.org/r/386/
........


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@222880 f38db490-d61c-443f-a65b-d21fe96a405b
2009-10-08 19:52:03 +00:00
dvossel 21cc1ec955 fixes an ast_netsock_list memory leak.
ABE-1998
Review: https://reviewboard.asterisk.org/r/395/



git-svn-id: http://svn.digium.com/svn/asterisk/trunk@222873 f38db490-d61c-443f-a65b-d21fe96a405b
2009-10-08 19:35:30 +00:00
dvossel 41a7e60c45 Deadlock in channel masquerade handling
Channels are stored in an ao2_container.  When accessing an item within
an ao2_container the proper locking order is to first lock the container,
and then the items within it.

In ast_do_masquerade both the clone and original channel must be locked
for the entire duration of the function.  The problem with this is that
it attemptes to unlink and link these channels back into the ao2_container
when one of the channel's name changes.  This is invalid locking order as
the process of unlinking and linking will lock the ao2_container while
the channels are locked!!! Now, both the channels in do_masquerade are
unlinked from the ao2_container and then locked for the entire function.
At the end of the function both channels are unlocked and linked back
into the container with their new names as hash values.

This new method of requiring all channels and tech pvts to be unlocked
before ast_do_masquerade() or ast_change_name() required several
changes throughout the code base.

(closes issue #15911)
Reported by: russell
Patches:
      masq_deadlock_trunk.diff uploaded by dvossel (license 671)
Tested by: dvossel, atis

(closes issue #15618)
Reported by: lmsteffan
Patches:
      deadlock_local_attended_transfers_trunk.diff uploaded by dvossel (license 671)
Tested by: lmsteffan, dvossel

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



git-svn-id: http://svn.digium.com/svn/asterisk/trunk@222761 f38db490-d61c-443f-a65b-d21fe96a405b
2009-10-07 22:58:38 +00:00
kpfleming e299cf0653 Recorded merge of revisions 222152 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r222152 | kpfleming | 2009-10-05 20:16:36 -0500 (Mon, 05 Oct 2009) | 20 lines
  
  Fix ao2_iterator API to hold references to containers being iterated.
  
  See Mantis issue for details of what prompted this change.
  
  Additional notes:
  
  This patch changes the ao2_iterator API in two ways: F_AO2I_DONTLOCK
  has become an enum instead of a macro, with a name that fits our
  naming policy; also, it is now necessary to call
  ao2_iterator_destroy() on any iterator that has been
  created. Currently this only releases the reference to the container
  being iterated, but in the future this could also release other
  resources used by the iterator, if the iterator implementation changes
  to use additional resources.
  
  (closes issue #15987)
  Reported by: kpfleming
  
  Review: https://reviewboard.asterisk.org/r/383/
........


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@222176 f38db490-d61c-443f-a65b-d21fe96a405b
2009-10-06 01:24:24 +00:00
twilson b8e1d3fe36 Use rtp properties instead of adding a callback
Thanks, Josh.


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@221278 f38db490-d61c-443f-a65b-d21fe96a405b
2009-09-30 18:21:03 +00:00
twilson bc354c76f4 Merged revisions 221086 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r221086 | twilson | 2009-09-30 09:49:11 -0500 (Wed, 30 Sep 2009) | 25 lines
  
  Change the SSRC by default when our media stream changes
  
  Be default, change SSRC when doing an audio stream changes Asterisk doesn't
  honor marker bit when reinvited to already-bridged RTP streams,resulting in
  far-end stack discarding packets with "old" timestamps that areactually part of
  a new stream.  This patch sends AST_CONTROL_SRCUPDATE whenever there is a
  reinvite, unless the 'constantssrc' is set to true in sip.conf.
  
  The original issue reported to Digium support detailed the following situation:
  ITSP <-> Asterisk 1.4.26.2 <-> SIP-based Application Server Call comes in
  fromITSP, Asterisk dials the app server which sends a re-invite back
  toAsterisk--not to negotiate to send media directly to the ITSP, but to
  indicatethat it's changing the stream it's sending to Asterisk.  The app
  servergenerates a new SSRC, sequence numbers, timestamps, and sets the marker
  bit on the new stream.  Asterisk passes through the teimstamp of the new stream,
  butdoes not reset the SSRC, sequence numbers, or set the marker bit.
  
  When the timestamp on the new stream is older than the timestamp on the
  originalstream, the ITSP (which doesn't know there has been any change) discards
  the newframes because it thinks they are too old.  This patch addresses this by
  changing the SSRC on a stream update unless constantssrc=true is set in
  sip.conf.
  
  Review: https://reviewboard.asterisk.org/r/374/
........


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@221266 f38db490-d61c-443f-a65b-d21fe96a405b
2009-09-30 17:52:30 +00:00
tilghman 0dd18fb058 Allow AES to compile, when OpenSSL is not present.
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@220586 f38db490-d61c-443f-a65b-d21fe96a405b
2009-09-26 15:10:28 +00:00
phsultan 5bec5836a0 Add JABBER_RECEIVE as a dialplan function, implement SendText in Jingle channels
JABBER_RECEIVE (along with JabberSend) makes Asterisk interact with users over
XMPP to process calls.
SendText can be used instead of JabberSend in the context of XMPP based voice
channels (chan_gtalk and chan_jingle).

(closes issue #12569)
Reported by: eech55
Tested by: phsultan, asannucci, lmadsen, jtodd, maxgo

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


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@220457 f38db490-d61c-443f-a65b-d21fe96a405b
2009-09-25 10:54:42 +00:00
jpeeler 4e9238c881 Add bridge related dial flags to the bridge app
Most of the functionality here is gained simply by setting the feature flag
on the bridge config. However, the dial limit functionality has been moved from
app_dial to the features code and has been made public so both app_dial and
the bridge app can use it.

(closes issue #13165)
Reported by: tim_ringenbach
Patches:
      app_bridge_options_r138998.diff uploaded by tim ringenbach (license 540),
      modified by me


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@220344 f38db490-d61c-443f-a65b-d21fe96a405b
2009-09-24 20:29:51 +00:00
lmadsen 994d1dfb80 Add Mantis work flow documention.
This commit adds the doxygen changes that I've made to describe the Mantis
work flow documentation for the open source issue tracker. This should make
it easier to determine the flow of issues through the issue tracker, and what
those statuses mean.

(closes issue #15902)
Reported by: lmadsen
Patches:
      mantisworkflow.h uploaded by lmadsen (license 10)

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

git-svn-id: http://svn.digium.com/svn/asterisk/trunk@219895 f38db490-d61c-443f-a65b-d21fe96a405b
2009-09-23 17:46:46 +00:00
mnicholson 667d2ffb9d Merged revisions 219136 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r219136 | mnicholson | 2009-09-17 09:58:39 -0500 (Thu, 17 Sep 2009) | 10 lines
  
  Prevent a potential race condition and crash when hanging up a channel by removing the channel from the channel list before begining channel tear down.
  
  This fix may potentially cause problems with CDR backends that access the channel a CDR is associated with via the channel list.  This fix makes the channel unavabile at the time when the CDR backend is invoked.  This has been documented in include/asterisk/cdr.h.
  
  (closes issue #15316)
  Reported by: vmarrone
  Tested by: mnicholson
  
  Review: https://reviewboard.asterisk.org/r/362/
........


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@219139 f38db490-d61c-443f-a65b-d21fe96a405b
2009-09-17 15:18:01 +00:00
tilghman 6ade0b7d2a Detect whether we actually have the long double type, before looking for those functions.
(closes issue #15017)
 Reported by: tzafrir
 Patches: 
       20090916__issue15017.diff.txt uploaded by tilghman (license 14)
 Tested by: tzafrir


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@219007 f38db490-d61c-443f-a65b-d21fe96a405b
2009-09-16 23:15:43 +00:00
tilghman da7e05ef35 Verify support for wide ODBC character types before using them.
(closes issue #15870)
 Reported by: nic_bellamy


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@217638 f38db490-d61c-443f-a65b-d21fe96a405b
2009-09-10 18:17:14 +00:00
mmichelson 8bae7986e2 Add doxygen to ast_event_subscribe for the description.
Most importantly, note that a NULL description will cause a
crash, as I just experienced that firsthand.



git-svn-id: http://svn.digium.com/svn/asterisk/trunk@217158 f38db490-d61c-443f-a65b-d21fe96a405b
2009-09-08 20:06:15 +00:00
kpfleming a6dbb79076 Ensure that the default autoconf CFLAGS are not used.
A recent change to the configure script that allows the user to specify
CFLAGS and/or LDFLAGS to the script had the unfortunate side effect of
letting autoconf's default CFLAGS (-g -O2) feed in to the rest of the build
system, thereby overriding the DONT_OPTIMIZE setting in menuselect. That
problem is now corrected.



git-svn-id: http://svn.digium.com/svn/asterisk/trunk@217074 f38db490-d61c-443f-a65b-d21fe96a405b
2009-09-08 16:37:28 +00:00
tilghman cda53172f4 Fix trunk breakage.
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@216551 f38db490-d61c-443f-a65b-d21fe96a405b
2009-09-04 17:50:21 +00:00
mvanbaak 0e511a12ba make sure canlog is set so we can compile with DEBUG_THREADS enabled on OpenBSD
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@216437 f38db490-d61c-443f-a65b-d21fe96a405b
2009-09-04 14:00:38 +00:00
dbailey ab91083f55 Added detection DTMF CID without polarity change alert.
Added detection of DTMF tone energy levels on FXO channels in chan_dahdi
monitoring loop so DTMF CID can be detected without the need of a polarity
change precursor.  

(closes issue #9096)
Reported by: fleed
Patches:
      9096-chan_dahdi-trunk.diff uploaded by dbailey (license 819)
Tested by: cyberplant, sum, maturs


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@216094 f38db490-d61c-443f-a65b-d21fe96a405b
2009-09-03 19:40:37 +00:00
dvossel 39acf19959 Merge code associated with AST-2009-006
(closes issue #12912)
Reported by: rathaus
Tested by: tilghman, russell, dvossel, dbrooks


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@215955 f38db490-d61c-443f-a65b-d21fe96a405b
2009-09-03 16:31:54 +00:00
tilghman f57de52c60 Revert attempt to standardize with _POSIX_C_SOURCE.
This did not function in the way that was intended, causing more compatibility
issues than it solved.  It is best, therefore, that it be simply removed.
(Discussed with kpfleming; agreement to remove was reached.)


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@215800 f38db490-d61c-443f-a65b-d21fe96a405b
2009-09-03 03:30:42 +00:00
mvanbaak 77591aa7e3 Let's compile again on OpenBSD
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@215419 f38db490-d61c-443f-a65b-d21fe96a405b
2009-09-02 10:50:49 +00:00
tilghman 336a05fe3a Various patches, to enable Asterisk to once again compile on Mac OS X.
One note on defining _POSIX_C_SOURCE:  while this feature test macro
works to require certain behaviors on Linux, it works differently on *BSD
platforms to REMOVE certain API calls that are not in the POSIX specification,
such as vasprintf(3).  Thus, defining it while depending upon vasprintf (and
other extensions to the POSIX standard) to be defined is a recipe to ensure
that Asterisk is only buildable on Linux.

Hence, this define which was meant to INCREASE portability, effectively
ensures the opposite.


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@214863 f38db490-d61c-443f-a65b-d21fe96a405b
2009-08-30 18:37:17 +00:00
tilghman 3471143394 If lua is detected with the lua5.1 prefix (or not), adjust the include path accordingly.
Based upon feedback to a release announcement on the -users list.  See
http://lists.digium.com/pipermail/asterisk-users/2009-August/236954.html


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@214819 f38db490-d61c-443f-a65b-d21fe96a405b
2009-08-30 06:43:04 +00:00
kpfleming 63cc27ace8 Ensure that CFLAGS and/or LDFLAGS provided to configure script are preserved.
Cross-compilation environments want to provide 'defaults' for compiler and
linker options, and frequently do this by specifying CFLAGS and LDFLAGS in the
environment or as command-line arguments to the configure script. This patch
modifies the configure script and Makefile to preserve these settings and
ensure they are used in the build process.



git-svn-id: http://svn.digium.com/svn/asterisk/trunk@214696 f38db490-d61c-443f-a65b-d21fe96a405b
2009-08-28 20:01:21 +00:00
mmichelson fd1fa0983f Fix some incorrect documentation of sched_thread functions.
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@214650 f38db490-d61c-443f-a65b-d21fe96a405b
2009-08-28 18:41:23 +00:00
tilghman bef44b870d Merged revisions 214517 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r214517 | tilghman | 2009-08-27 16:45:34 -0500 (Thu, 27 Aug 2009) | 7 lines
  
  Use autoconf to detect libcurl, as this enables cross-compilation checks, something we didn't allow before.
  (closes issue #15714)
   Reported by: pprindeville
   Patches: 
         20090813__issue15714.diff.txt uploaded by tilghman (license 14)
   Tested by: pprindeville
........


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@214518 f38db490-d61c-443f-a65b-d21fe96a405b
2009-08-27 21:46:46 +00:00
tilghman 67bcbd448a Merged revisions 214436 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r214436 | tilghman | 2009-08-27 11:53:58 -0500 (Thu, 27 Aug 2009) | 2 lines
  
  One more build system change, to make the descriptions look better, if we have better information.
........


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@214466 f38db490-d61c-443f-a65b-d21fe96a405b
2009-08-27 17:28:01 +00:00
tilghman c3cc6785d7 Merged revisions 214357 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r214357 | tilghman | 2009-08-27 11:03:50 -0500 (Thu, 27 Aug 2009) | 3 lines
  
  Make autoheader descriptions render correctly in our autoconfig.h file.
  (Figured out while working with issue #14906)
........


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@214360 f38db490-d61c-443f-a65b-d21fe96a405b
2009-08-27 16:12:03 +00:00
tilghman ffb4ff7468 Not all versions of gnu-linux use glibc, which contains iconv. Some (especially embedded systems) don't have iconv at all.
(closes issue #15169)
 Reported by: pprindeville


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@214152 f38db490-d61c-443f-a65b-d21fe96a405b
2009-08-25 22:39:51 +00:00
tilghman 5369d24f01 Merged revisions 213559 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r213559 | tilghman | 2009-08-21 11:52:53 -0500 (Fri, 21 Aug 2009) | 7 lines
  
  Permit DEBUG_FD_LEAKS to be used with C++ source files.
  (closes issue #15698)
   Reported by: slavon
   Patches: 
         20090817__issue15698.diff.txt uploaded by tilghman (license 14)
   Tested by: slavon, tilghman
........


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@213560 f38db490-d61c-443f-a65b-d21fe96a405b
2009-08-21 16:53:52 +00:00
kpfleming 99b05e8bf4 Relax check for XOPEN_VERSION.
It's not clear that we actually require XOPEN_VERSION to be 600 or greater
at this time, so skip the check for now.



git-svn-id: http://svn.digium.com/svn/asterisk/trunk@212672 f38db490-d61c-443f-a65b-d21fe96a405b
2009-08-17 20:40:24 +00:00
kpfleming d32b7ae7b1 Define our desires for POSIX and X/OPEN API features properly.
Based on a post on the gcc-help mailing list and some subsequent reading,
we can increase our portability to various platforms by directly defining
the POSIX and X/OPEN API feature sets we wish to have available. This patch
does that, and also includes a double-check to ensure that the system
we are compiling on can actually provide the requested feature sets.



git-svn-id: http://svn.digium.com/svn/asterisk/trunk@212463 f38db490-d61c-443f-a65b-d21fe96a405b
2009-08-17 16:25:10 +00:00
file 5a6957c04a Add two more API calls for getting the current glue and channel in bridging code.
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@212390 f38db490-d61c-443f-a65b-d21fe96a405b
2009-08-16 19:27:39 +00:00
file 3b081ef0ff Add an API call for retrieving the engine in use by an RTP instance.
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@212161 f38db490-d61c-443f-a65b-d21fe96a405b
2009-08-13 16:44:54 +00:00
tilghman e32af8f0cf Allow Gosub to recognize quote delimiters without consuming them.
(closes issue #15557)
 Reported by: rain
 Patches: 
       20090723__issue15557.diff.txt uploaded by tilghman (license 14)
 Tested by: rain
 
Review: https://reviewboard.asterisk.org/r/316/


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@210908 f38db490-d61c-443f-a65b-d21fe96a405b
2009-08-06 21:29:26 +00:00
kpfleming 48e7babc54 Minor improvements to app_fax.
This patch makes some small changes to handle watchdog timeouts in a better way,
and also uses a 'cleaner' method of including the spandsp header files.

(closes issue #14769)
Reported by: andrew
Patches:
      app_fax-20090406.diff uploaded by andrew (license 240)
      v1-14769.patch uploaded by dimas (license 88)
Tested by: freh, deti, caspy, dimas, sgimeno, Dovid


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@210777 f38db490-d61c-443f-a65b-d21fe96a405b
2009-08-06 16:07:15 +00:00
rmudgett 09b65c6596 Initial minimum ast_party_caller support.
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@210354 f38db490-d61c-443f-a65b-d21fe96a405b
2009-08-04 16:36:41 +00:00
dbrooks 041c6da20c Fixes numerous spelling errors. Patch submitted by alecdavis.
(closes issue #15595)
Reported by: alecdavis



git-svn-id: http://svn.digium.com/svn/asterisk/trunk@209554 f38db490-d61c-443f-a65b-d21fe96a405b
2009-07-30 16:07:05 +00:00
kpfleming c268ce9100 Define side-effect-safe MIN and MAX macros and remove duplicate definitions from various files.
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@209400 f38db490-d61c-443f-a65b-d21fe96a405b
2009-07-28 13:49:46 +00:00
dbrooks 3a578de20c Fixing typos. Replaces "recieved" with "received" and "initilize" with "initialize"
(closes issue #15571)
Reported by: alecdavis



git-svn-id: http://svn.digium.com/svn/asterisk/trunk@209098 f38db490-d61c-443f-a65b-d21fe96a405b
2009-07-27 16:33:50 +00:00
kpfleming b4baa21fbf 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: http://svn.digium.com/svn/asterisk/trunk@208548 f38db490-d61c-443f-a65b-d21fe96a405b
2009-07-24 15:02:53 +00:00
kpfleming aa4f4e142d 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: http://svn.digium.com/svn/asterisk/trunk@208464 f38db490-d61c-443f-a65b-d21fe96a405b
2009-07-23 21:57:24 +00:00
tilghman 2546725dee 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: http://svn.digium.com/svn/asterisk/trunk@208151 f38db490-d61c-443f-a65b-d21fe96a405b
2009-07-22 22:35:57 +00:00
russell afc6fa6ba0 Remove trailing whitespace.
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@208018 f38db490-d61c-443f-a65b-d21fe96a405b
2009-07-22 14:35:49 +00:00
russell ef09b20743 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: http://svn.digium.com/svn/asterisk/trunk@206021 f38db490-d61c-443f-a65b-d21fe96a405b
2009-07-11 19:15:03 +00:00
kpfleming 358f6c409e 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: http://svn.digium.com/svn/asterisk/trunk@205696 f38db490-d61c-443f-a65b-d21fe96a405b
2009-07-09 21:20:23 +00:00
dvossel 6178efe4e2 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: http://svn.digium.com/svn/asterisk/trunk@205600 f38db490-d61c-443f-a65b-d21fe96a405b
2009-07-09 16:19:09 +00:00
dvossel 4fc4098a76 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: http://svn.digium.com/svn/asterisk/trunk@205479 f38db490-d61c-443f-a65b-d21fe96a405b
2009-07-08 23:19:09 +00:00
dvossel 8d6e8908f4 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: http://svn.digium.com/svn/asterisk/trunk@205412 f38db490-d61c-443f-a65b-d21fe96a405b
2009-07-08 22:15:06 +00:00
dvossel a070201431 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: http://svn.digium.com/svn/asterisk/trunk@205216 f38db490-d61c-443f-a65b-d21fe96a405b
2009-07-08 16:54:24 +00:00
seanbright 5b4529e89e Fix a few compilation problems found when building Asterisk against uClibc.
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@205214 f38db490-d61c-443f-a65b-d21fe96a405b
2009-07-08 16:43:12 +00:00
russell aa0e8f1b3c Move OpenSSL initialization to a single place, make library usage thread-safe.
While doing some reading about OpenSSL, I noticed a couple of things that
needed to be improved with our usage of OpenSSL.

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

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


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@205120 f38db490-d61c-443f-a65b-d21fe96a405b
2009-07-08 15:17:19 +00:00
seanbright 7bf1f07142 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: http://svn.digium.com/svn/asterisk/trunk@204919 f38db490-d61c-443f-a65b-d21fe96a405b
2009-07-03 15:44:01 +00:00
seanbright f5aa5e6ba2 Wrap rtp_engine.h header comments to 80 characters.
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@204893 f38db490-d61c-443f-a65b-d21fe96a405b
2009-07-03 02:02:50 +00:00
dvossel 63c792a413 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: http://svn.digium.com/svn/asterisk/trunk@204710 f38db490-d61c-443f-a65b-d21fe96a405b
2009-07-02 16:03:44 +00:00
russell e9d15cbea7 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: http://svn.digium.com/svn/asterisk/trunk@204413 f38db490-d61c-443f-a65b-d21fe96a405b
2009-06-30 16:40:38 +00:00
tilghman 58a041b7b1 Allow trunk to once again compile under MALLOC_DEBUG
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@204118 f38db490-d61c-443f-a65b-d21fe96a405b
2009-06-29 17:56:29 +00:00
russell e93329b1c8 Make invalid hints report Unavailable instead of Idle.
(closes issue #14413)
Reported by: pj


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@203702 f38db490-d61c-443f-a65b-d21fe96a405b
2009-06-26 19:31:14 +00:00
file c26b86e763 Improve T.38 negotiation by exchanging session parameters between application and channel.
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@203699 f38db490-d61c-443f-a65b-d21fe96a405b
2009-06-26 19:27:24 +00:00
russell f9c8b2ca9b Note a new API call, and one that changed in doxygen.
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@203640 f38db490-d61c-443f-a65b-d21fe96a405b
2009-06-26 15:42:26 +00:00
russell ac3b35dcc7 Merge the new Channel Event Logging (CEL) subsystem.
CEL is the new system for logging channel events.  This was inspired after
facing many problems trying to represent what is possible to happen to a call
in Asterisk using CDR records.  For more information on CEL, see the built in
HTML or PDF documentation generated from the files in doc/tex/.

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

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


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@203638 f38db490-d61c-443f-a65b-d21fe96a405b
2009-06-26 15:28:53 +00:00
seanbright d13a40e1cf 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: http://svn.digium.com/svn/asterisk/trunk@203605 f38db490-d61c-443f-a65b-d21fe96a405b
2009-06-26 13:00:35 +00:00
seanbright db7fdc1f08 Add checks in configure for non-POSIX syslog facilities.
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@203569 f38db490-d61c-443f-a65b-d21fe96a405b
2009-06-26 03:06:06 +00:00
seanbright a83bcff2d6 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: http://svn.digium.com/svn/asterisk/trunk@203508 f38db490-d61c-443f-a65b-d21fe96a405b
2009-06-25 23:54:03 +00:00
dvossel 6e2c9a0ada 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: http://svn.digium.com/svn/asterisk/trunk@202410 f38db490-d61c-443f-a65b-d21fe96a405b
2009-06-22 15:33:35 +00:00
file 6271d5fe30 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: http://svn.digium.com/svn/asterisk/trunk@201902 f38db490-d61c-443f-a65b-d21fe96a405b
2009-06-19 15:41:24 +00:00
mmichelson 90de52f0b7 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: http://svn.digium.com/svn/asterisk/trunk@201583 f38db490-d61c-443f-a65b-d21fe96a405b
2009-06-18 15:20:17 +00:00
kpfleming eb55562094 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: http://svn.digium.com/svn/asterisk/trunk@201262 f38db490-d61c-443f-a65b-d21fe96a405b
2009-06-17 12:04:17 +00:00
kpfleming 0d442a7c2c 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: http://svn.digium.com/svn/asterisk/trunk@201139 f38db490-d61c-443f-a65b-d21fe96a405b
2009-06-16 21:10:15 +00:00
kpfleming ea5a74f18b 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: http://svn.digium.com/svn/asterisk/trunk@201056 f38db490-d61c-443f-a65b-d21fe96a405b
2009-06-16 18:54:30 +00:00
kpfleming a2c426f29f 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: http://svn.digium.com/svn/asterisk/trunk@200656 f38db490-d61c-443f-a65b-d21fe96a405b
2009-06-15 19:10:10 +00:00
kpfleming 5fa0b7c277 More 'static' qualifiers on module global variables.
The 'pglobal' tool is quite handy indeed :-)



git-svn-id: http://svn.digium.com/svn/asterisk/trunk@200620 f38db490-d61c-443f-a65b-d21fe96a405b
2009-06-15 17:34:30 +00:00
kpfleming 12ab0bbe15 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: http://svn.digium.com/svn/asterisk/trunk@200519 f38db490-d61c-443f-a65b-d21fe96a405b
2009-06-15 16:07:23 +00:00
seanbright 9684fe2b2e 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: http://svn.digium.com/svn/asterisk/trunk@199857 f38db490-d61c-443f-a65b-d21fe96a405b
2009-06-10 16:10:23 +00:00
dvossel 114afd3010 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: http://svn.digium.com/svn/asterisk/trunk@199743 f38db490-d61c-443f-a65b-d21fe96a405b
2009-06-09 16:22:04 +00:00
seanbright ac345f47db 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: http://svn.digium.com/svn/asterisk/trunk@199630 f38db490-d61c-443f-a65b-d21fe96a405b
2009-06-08 19:33:09 +00:00
dvossel 5a040f5e5d 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: http://svn.digium.com/svn/asterisk/trunk@199298 f38db490-d61c-443f-a65b-d21fe96a405b
2009-06-05 21:21:22 +00:00
seanbright 6684175242 Merged revisions 199022 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

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


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@199051 f38db490-d61c-443f-a65b-d21fe96a405b
2009-06-04 14:31:24 +00:00
dvossel fcf177a257 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: http://svn.digium.com/svn/asterisk/trunk@198856 f38db490-d61c-443f-a65b-d21fe96a405b
2009-06-02 21:17:49 +00:00
mmichelson ce47d41510 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: http://svn.digium.com/svn/asterisk/trunk@198727 f38db490-d61c-443f-a65b-d21fe96a405b
2009-06-01 20:57:31 +00:00
russell aa2ac6ca98 Minor whitespace fix.
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@198670 f38db490-d61c-443f-a65b-d21fe96a405b
2009-06-01 20:17:50 +00:00
russell 980e2bbd53 Constify the ast_frame arg to ast_queue_frame().
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@198434 f38db490-d61c-443f-a65b-d21fe96a405b
2009-05-31 01:19:30 +00:00
mnicholson 84f28a2c1c 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: http://svn.digium.com/svn/asterisk/trunk@198072 f38db490-d61c-443f-a65b-d21fe96a405b
2009-05-29 19:04:24 +00:00
seanbright 133af6817e Update references to downloads.digium.com to its new URL.
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@197861 f38db490-d61c-443f-a65b-d21fe96a405b
2009-05-28 22:42:27 +00:00
seanbright 8be2e20ea4 Update references to bugs.digium.com and reviewboard.digium.com to the new URLs.
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@197824 f38db490-d61c-443f-a65b-d21fe96a405b
2009-05-28 21:50:27 +00:00
twilson aec81d8f10 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: http://svn.digium.com/svn/asterisk/trunk@197738 f38db490-d61c-443f-a65b-d21fe96a405b
2009-05-28 19:57:18 +00:00
mmichelson 6553d7e59e 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: http://svn.digium.com/svn/asterisk/trunk@197543 f38db490-d61c-443f-a65b-d21fe96a405b
2009-05-28 14:58:06 +00:00
kpfleming 49e31e4167 Ensure that this header includes xmldoc.h, since it depends on it.
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@197335 f38db490-d61c-443f-a65b-d21fe96a405b
2009-05-27 22:21:53 +00:00
russell c0f405a0ef 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: http://svn.digium.com/svn/asterisk/trunk@196946 f38db490-d61c-443f-a65b-d21fe96a405b
2009-05-26 22:40:34 +00:00
seanbright f595115292 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: http://svn.digium.com/svn/asterisk/trunk@196758 f38db490-d61c-443f-a65b-d21fe96a405b
2009-05-26 14:36:11 +00:00
kpfleming 5e450bcbaf Correct example for CLI autocompletion (generation)
Reported by Atis on #asterisk-dev



git-svn-id: http://svn.digium.com/svn/asterisk/trunk@196488 f38db490-d61c-443f-a65b-d21fe96a405b
2009-05-23 13:31:56 +00:00
eliel cbbfdc573c 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: http://svn.digium.com/svn/asterisk/trunk@196308 f38db490-d61c-443f-a65b-d21fe96a405b
2009-05-22 17:52:35 +00:00
kpfleming 230a66da7d Const-ify the world (or at least a good part of it)
This patch adds 'const' tags to a number of Asterisk APIs where they are appropriate (where the API already demanded that the function argument not be modified, but the compiler was not informed of that fact). The list includes:

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

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

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



git-svn-id: http://svn.digium.com/svn/asterisk/trunk@196072 f38db490-d61c-443f-a65b-d21fe96a405b
2009-05-21 21:13:09 +00:00
mnicholson 147e027226 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: http://svn.digium.com/svn/asterisk/trunk@195882 f38db490-d61c-443f-a65b-d21fe96a405b
2009-05-21 15:33:55 +00:00
tilghman cd27c61b1f 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: http://svn.digium.com/svn/asterisk/trunk@195370 f38db490-d61c-443f-a65b-d21fe96a405b
2009-05-18 20:52:33 +00:00
kpfleming 45f9cd17df 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: http://svn.digium.com/svn/asterisk/trunk@194610 f38db490-d61c-443f-a65b-d21fe96a405b
2009-05-15 13:13:47 +00:00
russell 2c42c3c815 Minor documentation update for ast_event_queue().
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@193461 f38db490-d61c-443f-a65b-d21fe96a405b
2009-05-09 11:33:09 +00:00
kpfleming 4437971545 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: http://svn.digium.com/svn/asterisk/trunk@192362 f38db490-d61c-443f-a65b-d21fe96a405b
2009-05-05 14:17:18 +00:00
kpfleming 1188fb17fc 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: http://svn.digium.com/svn/asterisk/trunk@192357 f38db490-d61c-443f-a65b-d21fe96a405b
2009-05-05 13:18:21 +00:00
kpfleming 58a6c47655 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: http://svn.digium.com/svn/asterisk/trunk@192318 f38db490-d61c-443f-a65b-d21fe96a405b
2009-05-05 10:34:19 +00:00
kpfleming 23b19461f0 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: http://svn.digium.com/svn/asterisk/trunk@192279 f38db490-d61c-443f-a65b-d21fe96a405b
2009-05-05 08:51:06 +00:00
tilghman 0b5da784d0 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: http://svn.digium.com/svn/asterisk/trunk@192171 f38db490-d61c-443f-a65b-d21fe96a405b
2009-05-04 19:29:13 +00:00
kpfleming fc3f02bbbe 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: http://svn.digium.com/svn/asterisk/trunk@192059 f38db490-d61c-443f-a65b-d21fe96a405b
2009-05-04 16:24:16 +00:00
kpfleming df4e87f651 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: http://svn.digium.com/svn/asterisk/trunk@191919 f38db490-d61c-443f-a65b-d21fe96a405b
2009-05-03 14:28:59 +00:00
kpfleming 546cc0e698 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: http://svn.digium.com/svn/asterisk/trunk@191785 f38db490-d61c-443f-a65b-d21fe96a405b
2009-05-02 19:02:22 +00:00
kpfleming 62b79d3e26 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: http://svn.digium.com/svn/asterisk/trunk@191411 f38db490-d61c-443f-a65b-d21fe96a405b
2009-04-30 21:42:35 +00:00
tilghman 8c68287e96 Detect eaccess (or euidaccess) before using it.
Reported by Andrew Lindh via the -dev list.


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@191367 f38db490-d61c-443f-a65b-d21fe96a405b
2009-04-30 17:40:58 +00:00
dvossel 0f6a1e66b9 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: http://svn.digium.com/svn/asterisk/trunk@191177 f38db490-d61c-443f-a65b-d21fe96a405b
2009-04-29 21:13:43 +00:00
tilghman 8fc2c0f724 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: http://svn.digium.com/svn/asterisk/trunk@191140 f38db490-d61c-443f-a65b-d21fe96a405b
2009-04-29 18:53:01 +00:00
dvossel cfa021cb17 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: http://svn.digium.com/svn/asterisk/trunk@191028 f38db490-d61c-443f-a65b-d21fe96a405b
2009-04-29 14:39:48 +00:00
russell 336c0408ef Resolve Solaris build issues and add some API documentation.
(issue #14981)
Reported by: snuffy


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@190989 f38db490-d61c-443f-a65b-d21fe96a405b
2009-04-29 08:51:21 +00:00
kpfleming 1434971f7b 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: http://svn.digium.com/svn/asterisk/trunk@190725 f38db490-d61c-443f-a65b-d21fe96a405b
2009-04-27 19:30:54 +00:00
dvossel 1d52218463 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: http://svn.digium.com/svn/asterisk/trunk@190545 f38db490-d61c-443f-a65b-d21fe96a405b
2009-04-24 21:22:31 +00:00
rmudgett a642a591e7 Update comment.
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@190516 f38db490-d61c-443f-a65b-d21fe96a405b
2009-04-24 17:33:08 +00:00
russell 4170741e19 Add \since tag for new API calls.
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@190484 f38db490-d61c-443f-a65b-d21fe96a405b
2009-04-24 15:26:10 +00:00
russell 89175b7e04 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: http://svn.digium.com/svn/asterisk/trunk@190423 f38db490-d61c-443f-a65b-d21fe96a405b
2009-04-24 14:04:26 +00:00
tilghman 23d5f93d74 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: http://svn.digium.com/svn/asterisk/trunk@190349 f38db490-d61c-443f-a65b-d21fe96a405b
2009-04-23 20:36:35 +00:00
tilghman d2970d26d0 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: http://svn.digium.com/svn/asterisk/trunk@190093 f38db490-d61c-443f-a65b-d21fe96a405b
2009-04-22 21:38:15 +00:00
jpeeler f3943d3662 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: http://svn.digium.com/svn/asterisk/trunk@190057 f38db490-d61c-443f-a65b-d21fe96a405b
2009-04-22 21:15:55 +00:00
dbailey 7c52f63824 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: http://svn.digium.com/svn/asterisk/trunk@189629 f38db490-d61c-443f-a65b-d21fe96a405b
2009-04-21 14:28:04 +00:00
jpeeler 24045a66ea 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: http://svn.digium.com/svn/asterisk/trunk@188342 f38db490-d61c-443f-a65b-d21fe96a405b
2009-04-14 15:54:16 +00:00
kpfleming d011662b17 revert addition of LOG_SECURITY log channel; after further discussion, a much better solution will be used
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@187636 f38db490-d61c-443f-a65b-d21fe96a405b
2009-04-10 15:11:16 +00:00
tilghman ab22019265 Modify headers and macros, according to Russell's suggestions on the -dev list
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@187599 f38db490-d61c-443f-a65b-d21fe96a405b
2009-04-10 03:55:27 +00:00
jpeeler 0553909c65 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: http://svn.digium.com/svn/asterisk/trunk@187491 f38db490-d61c-443f-a65b-d21fe96a405b
2009-04-09 19:10:02 +00:00
tilghman fefac6b6c0 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: http://svn.digium.com/svn/asterisk/trunk@187483 f38db490-d61c-443f-a65b-d21fe96a405b
2009-04-09 18:40:01 +00:00
file 0728169c6a 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: http://svn.digium.com/svn/asterisk/trunk@187360 f38db490-d61c-443f-a65b-d21fe96a405b
2009-04-09 16:19:35 +00:00
tilghman 4dd6e6e2f7 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: http://svn.digium.com/svn/asterisk/trunk@187302 f38db490-d61c-443f-a65b-d21fe96a405b
2009-04-09 04:59:05 +00:00
kpfleming ad6c07010d 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: http://svn.digium.com/svn/asterisk/trunk@187269 f38db490-d61c-443f-a65b-d21fe96a405b
2009-04-09 02:44:27 +00:00
jpeeler 91ed7a2ff8 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: http://svn.digium.com/svn/asterisk/trunk@187211 f38db490-d61c-443f-a65b-d21fe96a405b
2009-04-08 21:00:39 +00:00
russell 9569e1c86e Add documentation for reviewboard usage and guidelines.
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@187179 f38db490-d61c-443f-a65b-d21fe96a405b
2009-04-08 19:59:21 +00:00
russell 918ce55209 Add some additional notes on release numbering.
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@186957 f38db490-d61c-443f-a65b-d21fe96a405b
2009-04-08 13:38:27 +00:00
russell 96781f975f 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: http://svn.digium.com/svn/asterisk/trunk@186953 f38db490-d61c-443f-a65b-d21fe96a405b
2009-04-08 13:24:48 +00:00
mmichelson f00656db9e 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: http://svn.digium.com/svn/asterisk/trunk@186525 f38db490-d61c-443f-a65b-d21fe96a405b
2009-04-03 22:41:46 +00:00
file 27b4657d60 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: http://svn.digium.com/svn/asterisk/trunk@186382 f38db490-d61c-443f-a65b-d21fe96a405b
2009-04-03 16:47:27 +00:00
file 31ba4d6e44 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: http://svn.digium.com/svn/asterisk/trunk@186321 f38db490-d61c-443f-a65b-d21fe96a405b
2009-04-03 15:52:50 +00:00
file 0eb1480fe0 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: http://svn.digium.com/svn/asterisk/trunk@186078 f38db490-d61c-443f-a65b-d21fe96a405b
2009-04-02 17:20:52 +00:00
tilghman 2dfad9bd0e 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: http://svn.digium.com/svn/asterisk/trunk@185912 f38db490-d61c-443f-a65b-d21fe96a405b
2009-04-01 20:13:28 +00:00
russell 48da67313b Fix dev-mode build on my box.
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@185741 f38db490-d61c-443f-a65b-d21fe96a405b
2009-04-01 12:13:16 +00:00
kpfleming 44a7c6c6f0 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: http://svn.digium.com/svn/asterisk/trunk@185581 f38db490-d61c-443f-a65b-d21fe96a405b
2009-03-31 21:29:50 +00:00
lmadsen 9b54cd8ad7 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: http://svn.digium.com/svn/asterisk/trunk@184798 f38db490-d61c-443f-a65b-d21fe96a405b
2009-03-27 19:31:04 +00:00
kpfleming 4a40e0ec6f 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: http://svn.digium.com/svn/asterisk/trunk@184762 f38db490-d61c-443f-a65b-d21fe96a405b
2009-03-27 19:10:32 +00:00
russell 4bc54633d7 Change global_app_buf to ast_str_thread_global_buf.
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@184693 f38db490-d61c-443f-a65b-d21fe96a405b
2009-03-27 16:21:10 +00:00
russell 1ae3284012 Change g_eid to ast_eid_default.
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@184630 f38db490-d61c-443f-a65b-d21fe96a405b
2009-03-27 14:00:18 +00:00
russell f7ab36aef7 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: http://svn.digium.com/svn/asterisk/trunk@184531 f38db490-d61c-443f-a65b-d21fe96a405b
2009-03-27 02:20:23 +00:00
russell d8dbfb1cb1 Pass more useful information through to lock tracking when DEBUG_THREADS is on.
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@184512 f38db490-d61c-443f-a65b-d21fe96a405b
2009-03-27 01:35:56 +00:00
russell f89c5f7e6c 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: http://svn.digium.com/svn/asterisk/trunk@184339 f38db490-d61c-443f-a65b-d21fe96a405b
2009-03-25 21:57:19 +00:00
russell 4d91abde1f Fix build issues on Mac OSX.
(closes issue #14714)
Reported by: ygor


git-svn-id: http://svn.digium.com/svn/asterisk/trunk@184147 f38db490-d61c-443f-a65b-d21fe96a405b
2009-03-25 01:42:10 +00:00
mmichelson 05cd25cfcf Remove symbols I just added to main/asterisk.exports and instead rename the functions.
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@183554 f38db490-d61c-443f-a65b-d21fe96a405b
2009-03-20 16:24:20 +00:00
dvossel 00a31b1c96 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: http://svn.digium.com/svn/asterisk/trunk@183436 f38db490-d61c-443f-a65b-d21fe96a405b
2009-03-19 20:30:39 +00:00
russell ed49842057 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: http://svn.digium.com/svn/asterisk/trunk@183242 f38db490-d61c-443f-a65b-d21fe96a405b
2009-03-19 18:00:15 +00:00
dvossel 92a2f9411f 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: http://svn.digium.com/svn/asterisk/trunk@183172 f38db490-d61c-443f-a65b-d21fe96a405b
2009-03-19 16:28:33 +00:00
kpfleming 1af379d0ec 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: http://svn.digium.com/svn/asterisk/trunk@182883 f38db490-d61c-443f-a65b-d21fe96a405b
2009-03-18 11:40:11 +00:00
russell b48669aa8f 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: http://svn.digium.com/svn/asterisk/trunk@182847 f38db490-d61c-443f-a65b-d21fe96a405b
2009-03-18 02:28:55 +00:00
kpfleming 870bfecfe6 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: http://svn.digium.com/svn/asterisk/trunk@182826 f38db490-d61c-443f-a65b-d21fe96a405b
2009-03-18 02:21:23 +00:00
kpfleming 5b52c7bb4d 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: http://svn.digium.com/svn/asterisk/trunk@182525 f38db490-d61c-443f-a65b-d21fe96a405b
2009-03-17 14:38:11 +00:00
russell da10000f37 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: http://svn.digium.com/svn/asterisk/trunk@182355 f38db490-d61c-443f-a65b-d21fe96a405b
2009-03-16 20:35:58 +00:00
tilghman c6fbda10d4 Turn off malloc debugging of astobj2, since it apparently doesn't work too well during startup.
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@181301 f38db490-d61c-443f-a65b-d21fe96a405b
2009-03-11 17:04:46 +00:00
jpeeler 7e7a32a4ed 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: http://svn.digium.com/svn/asterisk/trunk@181135 f38db490-d61c-443f-a65b-d21fe96a405b
2009-03-11 04:06:44 +00:00
tilghman a914fe0511 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: http://svn.digium.com/svn/asterisk/trunk@181028 f38db490-d61c-443f-a65b-d21fe96a405b
2009-03-11 00:29:59 +00:00
jpeeler 5a0a55b7a4 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: http://svn.digium.com/svn/asterisk/trunk@180719 f38db490-d61c-443f-a65b-d21fe96a405b
2009-03-09 20:58:17 +00:00
kpfleming 5d5eb54ba7 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: http://svn.digium.com/svn/asterisk/trunk@180373 f38db490-d61c-443f-a65b-d21fe96a405b
2009-03-05 18:29:38 +00:00
file 78d18e52a4 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: http://svn.digium.com/svn/asterisk/trunk@180369 f38db490-d61c-443f-a65b-d21fe96a405b
2009-03-05 18:18:27 +00:00
dvossel 58c677376b 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: http://svn.digium.com/svn/asterisk/trunk@180032 f38db490-d61c-443f-a65b-d21fe96a405b
2009-03-03 23:21:18 +00:00