Commit Graph

2927 Commits

Author SHA1 Message Date
Richard Mudgett a5a0a5f867 Consolidate ast_channel.cid.cid_rdnis into ast_channel.redirecting.from.number.
SWP-1229
ABE-2161

* Ensure chan_local.c:local_call() will not leak cid.cid_dnid when
copying.


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@256104 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-04-03 02:12:33 +00:00
Russell Bryant 37797ddd52 Merged revisions 256009 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r256009 | russell | 2010-04-02 18:30:15 -0500 (Fri, 02 Apr 2010) | 2 lines
  
  Remove extremely verbose debug message.
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@256010 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-04-02 23:30:58 +00:00
Tilghman Lesher 3c6c879681 Pass the PID of the Asterisk process, not the PID of the canary.
(closes issue #17065)
 Reported by: globalnetinc
 Patches: 
       astcanary.patch uploaded by makoto (license 38)
 Tested by: frawd, globalnetinc


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@255952 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-04-02 20:19:01 +00:00
Kevin P. Fleming 2be88e05c0 Allow symbol export filtering to work properly on platforms that have symbol prefixes.
Some platforms prefix externally-visible symbols in object files generated
from C sources (most commonly, '_' is the prefix). On these platforms,
the existing symbol export filtering process ends up suppressing all the symbols
that are supposed to be left visible. This patch allows the prefix string
to be supplied to the top-level Makefile in the LINKER_SYMBOL_PREFIX variable,
and then generates the linker scripts as required to include the prefix
supplied.



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@255906 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-04-02 18:57:58 +00:00
Russell Bryant 899f995703 Remove a debugging log entry.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@255240 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-03-29 05:10:41 +00:00
Terry Wilson 408ba24fad Merged revisions 254451 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r254451 | twilson | 2010-03-25 10:57:29 -0500 (Thu, 25 Mar 2010) | 2 lines
  
  Handle new SRCCHANGE control message here too
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@254453 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-03-25 16:03:51 +00:00
Kevin P. Fleming 42577406fd 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: https://origsvn.digium.com/svn/asterisk/trunk@254450 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-03-25 15:27:31 +00:00
Mark Michelson 10d65ad6b1 Fix potential invalid reads that could occur in pbx.c
Here is a cut and paste of my review request for this change:
This past weekend, Russell ran our current suite of unit tests for Asterisk
under valgrind. The PBX pattern match test caused valgrind to spew forth two
invalid read errors. This patch contains two changes that shut valgrind up and
do not cause any new memory leaks.

Change 1: In ast_context_remove_extension_callerid2, valgrind reported an
invalid read in the for loop close to the function's end. Specifically, one of
the the strcmp calls in the loop control was reading invalid memory. This was
because the caller of ast_context_remove_extension_callerid2 (__ast_context
destroy in this case) passed as a parameter a shallow copy of an ast_exten's
exten field. This same ast_exten was what was destroyed inside the for loop,
thus any iterations of the for loop beyond the destruction of the ast_exten
would result in invalid reads. My fix for this is to make a copy of the
ast_exten's exten field and pass the copy to
ast_context_remove_extension_callerid2. In addition, I have also acted
similarly with the ast_exten's matchcid field. Since in this case a NULL is
handled quite differently than an empty string, I needed to be a bit more
careful with its handling.

Change 2: In __ast_context_destroy, we iterated over a hashtab and called
ast_context_remove_extension_callerid2 on each item. Specifically, the hashtab
over which we were iterating was an ast_exten's peer_table. Inside of
ast_context_remove_extension_callerid2, we could possibly destroy this
ast_exten, which also caused the hashtab to be freed. Attempting to call
ast_hashtab_end_traversal on the hashtab iterator caused an invalid read to
occur when trying to read the iterator->tab->do_locking field since
iterator->tab had already been freed. My handling of this problem is a bit less
straightforward. With each iteration over the hashtab's contents, we set a
variable called "end_traversal" based on the return of
ast_context_remove_extension_callerid2. If 0 is ever returned, then we know
that the extension was found and destroyed. Because of this, we cannot call
ast_hashtab_end_traversal because we will be guaranteeing a read of invalid
memory. In such a case, we forego calling ast_hashtab_end_traversal and instead
call ast_free on the hashtab iterator.

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



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@254362 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-03-24 21:10:38 +00:00
Tzafrir Cohen 5a5599a764 make 'core show settings' should show all settable directories
(closes issue #17086)
Reported by: tzafrir
Patches:
      asterisk_extra_settings_dirs.diff uploaded by tzafrir (license 46)


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@254162 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-03-23 22:48:03 +00:00
Russell Bryant d9b1ff23ba Put test output for a failure in a CDATA section in the XML results.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@254159 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-03-23 22:35:56 +00:00
Jeff Peeler 48edf2c78a Exit native bridging early for greater timing accuracy with warnings
This changes native bridging to break one millisecond early so that the more
accurate timeval calculations done in the generic bridge can be performed using
the bridge config. Currently the time between exiting native bridging slightly
late can sometimes cause a large enough discrepancy for warnings to be missed.
For the record, 1.4 does not attempt to native bridge at all when warnings are
enabled.

(closes issue #15815)
Reported by: adomjan

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@254050 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-03-23 21:17:23 +00:00
Terry Wilson 66053b8a58 Don't act like an http write failed when it didn't
fwrite returns the number of items written, not the number of bytes


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@253958 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-03-23 16:52:53 +00:00
Kevin P. Fleming ae6008ef3a 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: https://origsvn.digium.com/svn/asterisk/trunk@253917 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-03-23 14:22:27 +00:00
Mark Michelson f9e4d024c9 Initialize channels prior to loading "preload" modules.
We can have bad results when a module, upon being loaded, attempts
to reference the channels container if the container hasn't yet
been initialized. I saw this happen by trying to preload pbx_config.so
and having a hint defined which referenced a non-existent SIP peer.



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@253872 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-03-22 20:32:15 +00:00
Matthew Nicholson 8acef966ef Merged revisions 253799 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r253799 | mnicholson | 2010-03-22 14:50:00 -0500 (Mon, 22 Mar 2010) | 4 lines
  
  Unconditionally copy the caller's account code to the called party.
  
  (related to issue #16331)
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@253800 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-03-22 19:52:52 +00:00
Russell Bryant 3da9f8ed19 Resolve more compiler warnings on FreeBSD.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@253540 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-03-20 12:03:07 +00:00
Alec L Davis 743b168319 prevent segfault if bad magic number is encountered.
internal_ao2_ref uses INTERNAL_OBJ which mzy report 'bad magic number', but
internal_ao2_ref continues on, causing segfault.

Although AO2_MAGIC number is checked by INTERNAL_OBJ before internal_ao2_ref is
called, A02_MAGIC is being destroyed (or a wrong pointer) by the time
internal_ao2_ref uses INTERNAL_OBJ.

internal_ao2_ref now returns -1 if INTERNAL_OBJ encouters a bad magic number.

(issue #17037)
Reported by: alecdavis
Patches:
      bug17037.diff.txt uploaded by alecdavis (license 585)
Tested by: alecdavis




git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@253490 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-03-19 07:37:00 +00:00
Russell Bryant 32a649c3b9 Update comment to reflect new timeout value.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@253378 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-03-18 18:23:07 +00:00
Russell Bryant d6ca5ac86e Increase CLI command output timeout for asterisk -rx to 60 seconds.
(closes issue #17049)
Reported by: russell
Tested by: russell

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@253357 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-03-18 18:18:43 +00:00
Tilghman Lesher 0c0bf14d99 Just in case of a race, send the signal on interrupt.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@253255 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-03-18 15:45:26 +00:00
Leif Madsen 0c5fb8037c main/test.c reports erroneous CLI message.
(closes issue #17051)
Reported by: Nick_Lewis

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@253205 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-03-17 19:06:04 +00:00
Leif Madsen 6587f0941d Fix a typo.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@253032 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-03-17 00:40:51 +00:00
Tilghman Lesher 385a40226a Fix test_time on Mac OS X (and other platforms without inotify)
Reviewboard: https://reviewboard.asterisk.org/r/554/


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@252846 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-03-16 19:34:01 +00:00
Tilghman Lesher 4c8f14b7cf Merged revisions 252361 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@252362 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-03-15 01:37:04 +00:00
Russell Bryant f72c83684b Resolve unit test failure that occurred on Mac OSX.
On Linux (glibc), regcomp() does not return an error for an empty string.
However, the version on OSX will return an error.  The test for channel group
matching by regex now passes on the mac, as well.


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@252241 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-03-13 22:21:18 +00:00
Terry Wilson 68d1ded8dd 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: https://origsvn.digium.com/svn/asterisk/trunk@252089 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-03-12 22:04:51 +00:00
Jeff Peeler 2d26a2da1f Add new unit test for stringfields.
(Copied from reviewboard)
Tests the following:
1. Basic allocation and setting of string fields.
2. Shrinking a string field and re-expanding it.
3. Growing the last allocation in a string field pool.
4. Setting a string to a large value such that a new string field pool must be
allocated.
In each part, we make sure that the string field is accurate (has the correct
value in it), make sure that the 2 bytes before the string field has the correct
capacity for the field, and for tests 2-4, we make sure that the string field is
where we expect it to be in memory.

Also tested:
5. Shrinking a string field and partially re-expanding it.
6. Setting strings in such a way as to create three separate string field pools
and then removing the middle pool.

There is a bug fix in the init function, which ensures the embedded_pool is set
to NULL which is important for stack allocated structures.

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@251736 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-03-10 23:15:55 +00:00
Jeff Peeler 9620ccf057 Fix ParkAndAnnounce not respecting parking options.
The patch ensures that if a peer does not exist, parking settings are read from
the channel. A unit test has been written to ensure proper operation for both
standard parking and parking using masquerades.

(closes issue #16592)
Reported by: mwyres
Patches: 
      bug_16592.diff uploaded by snuffy (license 35)

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@251679 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-03-10 20:51:23 +00:00
Jeff Peeler 94c83acaf4 Fix jitterbuffer logging not creating logfiles.
Three changes made here:
1) Do not fail if a previous log does not exist (in fact, this is probably
expected).
2) Ensure that the file descriptor to write to gets assigned properly. I am at
a loss as to why assigning safe_fd outside the if fixes this, but it makes
the if statement slightly less complicated anyway.
3) Move up the failure message so that the errno of the failure is not
overwritten by fclose.

(closes issue #16917)
Reported by: Artem


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@251631 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-03-10 18:25:18 +00:00
Tilghman Lesher da6ba8e60e Remove portions that weren't meant to be committed for the OS X compat fix
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@251263 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-03-08 05:15:01 +00:00
Tilghman Lesher e58fc610ae Change needed to make Mac OS X 10.6 happy
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@251262 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-03-08 05:12:55 +00:00
Richard Mudgett 73ef4b8daf 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: https://origsvn.digium.com/svn/asterisk/trunk@250565 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-03-03 19:38:06 +00:00
David Vossel 59f615dbca Changes 0ms to <1ms in cli END results during 'test execute'
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@250478 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-03-03 19:02:13 +00:00
Tilghman Lesher de7dcfd5d3 One more fix to editline
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@250346 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-03-03 16:43:10 +00:00
Tilghman Lesher 6a90983ce6 Eliminate remaining libedit warnings (shown in bamboo)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@250303 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-03-03 15:54:28 +00:00
David Vossel 7b51d1d71d fixes assumption that test failed if it did not pass when generating results
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@250237 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-03-03 00:04:28 +00:00
Leif Madsen 78fdaa6865 Add missing description of the PARKINGLOT variable in XML documentation.
(closes issue #16743)
Reported by: snuffy
Patches: 
      parkingdoc.diff uploaded by snuffy (license 35)

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@249925 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-03-02 19:24:43 +00:00
David Vossel 862ebf4d00 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: https://origsvn.digium.com/svn/asterisk/trunk@249893 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-03-02 19:08:38 +00:00
David Vossel feae3dbbdf adds Time field to "test show results" cli command
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@249186 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-02-26 18:41:36 +00:00
Mark Michelson da96c84c67 Send a manager event when the manager BridgeAction command is used.
(closes issue #16769)
Reported by: syspert
Patches:
      bridgeaction.patch uploaded by syspert (license 938)



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@249105 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-02-26 17:13:36 +00:00
Russell Bryant b607585b07 Trim trailing whitespace (to help reduce diff against cdr-q branch)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@249056 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-02-26 08:35:42 +00:00
Mark Michelson a1af5f4f72 Fix incorrect ACL behavior when CIDR notation of "/0" is used.
AST-2010-003



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@248946 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-02-25 22:41:48 +00:00
Tilghman Lesher a0af2cff0e Merged revisions 248859 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@248861 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-02-25 21:22:39 +00:00
Tilghman Lesher 4e1e6820db 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: https://origsvn.digium.com/svn/asterisk/trunk@248584 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-02-24 21:17:26 +00:00
Russell Bryant 5665aa361f Minor tweaks to comment blocks and includes.
Fix the copyright lines, tweak doxygen formatting, and remove some unnecessary
includes.


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@248226 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-02-22 06:45:52 +00:00
Matthew Nicholson 469fed1cd3 Merged revisions 247651 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r247651 | mnicholson | 2010-02-18 13:38:09 -0600 (Thu, 18 Feb 2010) | 6 lines
  
  Copy the calling party's account code to the called party if they don't already have one.
  
  (closes issue #16331)
  Reported by: bluefox
  Tested by: mnicholson
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@247652 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-02-18 19:39:37 +00:00
Richard Mudgett efea9ad922 Fix placing ISDN calls on hold preventing native bridging from being reexamined after a transfer.
Consider the following scenario:

                 /-- B
A == * == Network
                 \-- C

Party B calls party A (EuroISDN BRI phone)
Party A puts B on hold using the HOLD/RETRIEVE messages.
Party A calls party C.
Party A puts C on hold to talk with party B again.
Party A transfers B to C by hanging up.

The call does not get the opportunity to get re-transferred into the ISDN
network by the native bridge because native bridging is not being
reexamined after the initial transfer.


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@247609 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-02-18 18:31:44 +00:00
Mark Michelson 23d1c9186d Fix a couple of bugs in test tab completion.
1. Add missing unlock of lists.
2. Swap order of arguments to test_cat_cmp in complete_test_name.



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@247381 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-02-17 22:44:53 +00:00
Mark Michelson dd975726fc Tab completion for test categories and names for "test show registered" and "test execute" CLI commands.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@247380 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-02-17 22:40:43 +00:00
Mark Michelson 2ce7eabb24 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: https://origsvn.digium.com/svn/asterisk/trunk@247335 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-02-17 21:22:40 +00:00
Jeff Peeler 27a4cda821 Add support for GROUP_MATCH_COUNT regex matching on category
Current support for regex matching was previously only available on the group.
Also, error reporting for regex failures has been added. In addition to this
feature enhancement a unit test has been written to check the regular expression
logic to ensure the count operation is working as expected.

(closes issue #16642)
Reported by: kobaz
Patches: 
      groupmatch2.patch uploaded by kobaz (license 834)

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@247295 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-02-17 19:51:53 +00:00
David Vossel 57c819fd5e addition of dynamic parkinglots feature
This feature allows for parkinglots to be created dynamically within
the dialplan.  Thanks to all who were involved with getting this patch
written and tested!

(closes issue #15135)
Reported by: IgorG
Patches:
      features.dynamic_park.v3.diff uploaded by IgorG (license 20)
      2009090400_dynamicpark.diff.txt uploaded by mvanbaak (license 7)
      dynamic_parkinglot.diff uploaded by dvossel (license 671)
Tested by: eliel, IgorG, acunningham, mvanbaak, zktech

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@247248 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-02-17 18:29:48 +00:00
Tilghman Lesher bbb5acc65e RTP documentation states that you can pass NULL as the module, so make sure that's really the case.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@247125 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-02-17 07:01:13 +00:00
Mark Michelson 68c6175f87 Add va_end calls to __ast_str_helper.
According to the man page for stdarg(3),
"Each invocation of va_copy() must be matched by a
corresponding invocation of va_end() in the same
function."

There were several cases in __ast_str_helper where
va_copy was not matched with a corresponding call
to va_end.



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@247076 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-02-16 23:44:33 +00:00
David Vossel 0f9e5ab557 swap openssl with OpenSSL in warning message.
(issue #16673)


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@246981 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-02-16 21:03:34 +00:00
David Vossel d693767226 warning message if openssl support is missing while attempting tls connection
(closes issue #16673)
Reported by: michaesc
Patches:
      tls_error_msg.diff uploaded by dvossel (license 671)



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@246980 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-02-16 20:54:48 +00:00
David Vossel 091f850a58 fixes sample rate conversion issue with Monitor application
When using ast_seekstream with the read/write streams of a monitor,
the number of samples we are seeking must be of the same rate as the
stream or the jump calculation will be incorrect.  This patch adds logic
to correctly convert the number of samples to jump to the sample rate
the read/write stream is using.

For example, if the call is G722 (16khz) and the read/write stream is
recording a 8khz wav, seeking 320 samples of 16khz audio is not the
same as seeking 320 samples of 8khz audio when performing the ast_seekstream
on the stream.

ABE-2044



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@246899 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-02-16 17:07:41 +00:00
Tilghman Lesher 22b144cef4 Change the blanket rules to delete .lastclean on all CFLAGS menuselect targets to be more particular.
This change builds upon the recent change to menuselect to add 'touch_on_change'
as an attribute of both categories and members.  This should allow only the most
invasive defines to cause a complete rebuild, while defines which only affect a
subset of modules will only cause a rebuild of that smaller set.


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@246789 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-02-16 00:52:45 +00:00
David Vossel 7d5d0311c1 Merged revisions 246545 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r246545 | dvossel | 2010-02-12 17:30:17 -0600 (Fri, 12 Feb 2010) | 16 lines
  
  lock channel during datastore removal
  
  On channel destruction the channel's datastores are removed and
  destroyed.  Since there are public API calls to find and remove
  datastores on a channel, a lock should be held whenever datastores are
  removed and destroyed.  This resolves a crash caused by a race
  condition in app_chanspy.c.
  
  (closes issue #16678)
  Reported by: tim_ringenbach
  Patches:
        datastore_destroy_race.diff uploaded by tim ringenbach (license 540)
  Tested by: dvossel
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@246546 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-02-12 23:32:33 +00:00
David Vossel 9478670527 astobj2 unit test and bug fix
A bug was discovered during the creation of the astobj2 unit test.
When OBJ_MULTIPLE | OBJ_UNLINK is used, the objects being returned
had a ref count issue.  This patch resolves that.

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@246299 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-02-11 18:42:25 +00:00
Russell Bryant 1321748c19 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: https://origsvn.digium.com/svn/asterisk/trunk@246260 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-02-10 23:19:16 +00:00
Russell Bryant bbed34f764 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: https://origsvn.digium.com/svn/asterisk/trunk@245864 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-02-09 23:32:14 +00:00
Russell Bryant f2282722dd Fix return value of get_ie_str() and get_ie_str_hash() for non-existent IE.
I found this bug while developing a unit test for event allocation.  Testing
is awesome.


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@245624 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-02-08 23:43:00 +00:00
Russell Bryant a0d74cef66 Use memmove() instead of memcpy() for a case where the buffers overlap.
Once again, valgrind is freaking awesome.  That is all.


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@245610 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-02-08 23:23:45 +00:00
Tilghman Lesher 2b01c7b185 Actually use _ASTLDFLAGS in the main/ and channels/ Makefiles.
They were previously passed correctly, but they simply weren't used.  This
caused issues with various platforms whose builds needed to pass special
linker flags via the configure script.

(closes issue #16596)
 Reported by: pprindeville
 Patches: 
       asterisk-1.6-astldflags.patch uploaded by pprindeville (license 347)
 Tested by: tilghman


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@245578 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-02-08 22:31:40 +00:00
Jason Parker e90a6b4646 Merged revisions 245496 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r245496 | qwell | 2010-02-08 14:39:50 -0600 (Mon, 08 Feb 2010) | 4 lines
  
  Remove reference of documentation in source directory.
  
  People don't always build Asterisk from source (distro packages, anybody?).
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@245497 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-02-08 20:41:05 +00:00
Russell Bryant 2191c94336 Remove an extra space.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@245268 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-02-07 20:56:57 +00:00
David Vossel bc16d44b73 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: https://origsvn.digium.com/svn/asterisk/trunk@245147 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-02-05 21:21:05 +00:00
Tilghman Lesher cf6592e58e Merge tests that verify the same thing. (Oops.)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@245046 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-02-05 19:07:18 +00:00
Sean Bright acdb1bd82f Merged revisions 244926 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@244927 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-02-05 17:05:32 +00:00
David Vossel a7123b5f4f fixes memory leak in astobj2 test
ao2_iterator_destroy was not being used on the
iterator during the test.  This resulted in the
container never actually being destroyed.


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@244887 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-02-05 04:22:15 +00:00
Tilghman Lesher 962b1a22fd Try to make ast_format_str_reduce fail...
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@244768 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-02-04 22:43:33 +00:00
David Vossel 6c0399452c fix truncated format string in 'test show registered'
When using the 'test show registered' cli command the 'Test Results'
category was truncating the last few characters making it look like 
'Test Resul'.  I also expanded other parts of the format to better
represent how long function names and categories will likely be.



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@244688 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-02-04 15:36:33 +00:00
Jeff Peeler b527525ffc Add some additional option support for non-default parking lots.
The options are: parkedcallparking, parkedcallhangup, parkedcallrecording, and
parkedcalltransfers. Previously these options were only available for the 
default parking lot.

(closes issue #16641)
Reported by: bluecrow76
Patches: 
      asterisk-1.6.2.1-features.c.diff uploaded by bluecrow76 (license 270)


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@244598 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-02-03 20:48:36 +00:00
Mark Michelson dbc3111652 Initialize counters in ast_sched_report so that resulting data is not bogus.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@244547 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-02-03 19:26:53 +00:00
David Vossel 36bbf8f902 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: https://origsvn.digium.com/svn/asterisk/trunk@244443 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-02-02 22:27:23 +00:00
Tilghman Lesher 72c1b76038 Merged revisions 244070 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r244070 | tilghman | 2010-02-01 11:46:31 -0600 (Mon, 01 Feb 2010) | 16 lines
  
  Revert previous chan_local fix (r236981) and fix instead by destroying expired frames in the queue.
  
  (closes issue #16525)
   Reported by: kobaz
   Patches: 
         20100126__issue16525.diff.txt uploaded by tilghman (license 14)
         20100129__issue16525__1.6.0.diff.txt uploaded by tilghman (license 14)
   Tested by: kobaz, atis
  
  (closes issue #16581)
   Reported by: ZX81
  
  (closes issue #16681)
   Reported by: alexr1
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@244071 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-02-01 17:53:39 +00:00
Jeff Peeler 80d3e91714 Optimization to manager events.
When potentially sending manager events, return immediately if there are no
sessions or hooks. Also, avoid locking the hooks list if it is empty.

(issue #16455)
Reported by: atis
Patches: 
      manager_hooks_trunk.patch uploaded by atis (license 242)


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@243986 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-01-28 22:37:15 +00:00
Jeff Peeler a170cd28e0 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: https://origsvn.digium.com/svn/asterisk/trunk@243551 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-01-27 18:29:49 +00:00
Mark Michelson 630b8027c3 Merged revisions 243486 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r243486 | mmichelson | 2010-01-27 12:06:43 -0600 (Wed, 27 Jan 2010) | 3 lines
  
  Use a safe list traversal while checking for duplicate vars in pbx_builtin_setvar_helper.
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@243487 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-01-27 18:08:02 +00:00
David Vossel 7662c7fed2 Merged revisions 243390 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r243390 | dvossel | 2010-01-26 17:55:49 -0600 (Tue, 26 Jan 2010) | 9 lines
  
  fixes bug with channel receiving wrong privileges after call parking 
  
  (closes issue #16429)
  Reported by: Yasuhiro Konishi
  Patches:
        features.c.diff uploaded by Yasuhiro Konishi (license 947)
  Tested by: dvossel
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@243391 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-01-26 23:56:57 +00:00
Jeff Peeler c277952cea Merged revisions 243258 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r243258 | jpeeler | 2010-01-26 12:19:10 -0600 (Tue, 26 Jan 2010) | 2 lines
  
  Remove unnecessary code in ast_read as issue 16058 has been fully solved now.
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@243266 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-01-26 18:20:55 +00:00
Jeff Peeler 1d293d0093 Fix crash resulting from frames with invalid data pointers.
In ast_frdup the frame data union does not get set to point to malloced memory 
if the datalen is zero, so make sure to handle the same case in ast_frisolate
appropriately.

(closes issue #16058)
Reported by: atis
Patches: 
      bug16058-fix.patch uploaded by jpeeler (license 325)
Tested by: atis


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@243244 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-01-26 18:07:57 +00:00
David Vossel adfa169e46 modify 'test show registered' cli output format
In order to improve readability, the output from 'test show
registered' has been modified to truncate fields to fit within
the format output if they are over a certain length.



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@243242 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-01-26 17:40:02 +00:00
David Vossel d16b89be17 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: https://origsvn.digium.com/svn/asterisk/trunk@243200 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-01-26 16:30:08 +00:00
Tilghman Lesher 1ffdf5c2ee Merged revisions 242969 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r242969 | tilghman | 2010-01-25 15:50:22 -0600 (Mon, 25 Jan 2010) | 2 lines
  
  Err, and use the new menuselect define, too.
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@242971 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-01-25 21:51:41 +00:00
Olle Johansson 7c61a7105f 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: https://origsvn.digium.com/svn/asterisk/trunk@242919 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-01-25 21:13:20 +00:00
Olle Johansson 52b0cb912b Merged revisions 242850 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r242850 | oej | 2010-01-25 21:03:38 +0100 (Mån, 25 Jan 2010) | 2 lines

Report error when writing to functions returns error in AMI setvar action

........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@242904 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-01-25 20:27:59 +00:00
Tilghman Lesher 245bd1861f Merged revisions 242852 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r242852 | tilghman | 2010-01-25 14:15:45 -0600 (Mon, 25 Jan 2010) | 2 lines
  
  Restore FreeBSD to able-to-compile-ish-mode
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@242857 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-01-25 20:18:15 +00:00
Tilghman Lesher afb9fab574 Merged revisions 242728 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r242728 | tilghman | 2010-01-24 23:42:22 -0600 (Sun, 24 Jan 2010) | 2 lines
  
  Buildbot pointed out an error (thanks, buildbot!)
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@242729 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-01-25 05:45:00 +00:00
Tilghman Lesher 2016dbb826 Merged revisions 242683 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r242683 | tilghman | 2010-01-24 23:13:28 -0600 (Sun, 24 Jan 2010) | 2 lines
  
  Make the build of the Asterisk expression parser match that of the AEL parser.
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@242719 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-01-25 05:30:33 +00:00
Russell Bryant d6ad0f30b4 Update the doxygenification of some comments.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@242186 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-01-22 04:57:03 +00:00
Mark Michelson c8c4ea9bf4 Add missing argument to ast_calloc calls.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@242092 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-01-21 22:37:55 +00:00
Olle Johansson fccf277864 Make sure we initialize the ast_ha structure with ast_calloc
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@242043 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-01-21 21:05:56 +00:00
Russell Bryant e718ef4d45 Point to a useful reference on the XML output format.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@241856 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-01-21 14:10:51 +00:00
Russell Bryant efdbde9c25 Modify test results XML format to match the JUnit format.
When this code was developed, we came up with our own XML format for the test
output.  I have since started looking at integration with other tools, namely
continuous integration frameworks, and this format seems to be supported
across a number of applications.  With these changes in place, I was able
to get Atlassian Bamboo to interpret the test results.


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@241855 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-01-21 13:59:41 +00:00
Alec L Davis 3a24f8ad06 Add Calling and Called Subaddress to CDR record
Requires 'callingsubaddr' and 'calledsubaddr' fields in backend cdr.

(closes issue #16600)
Reported by: alecdavis
Patches: 
      cdr_subaddr.diff.txt uploaded by alecdavis (license 585)
Tested by: alecdavis

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



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@241581 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-01-20 17:49:30 +00:00
Alec L Davis c7be027151 Update CDR variables as pbx starts
Allows CDR variables added in cdr.c:set_one_cid to become visable during the call,
by executing ast_cdr_update() early in __ast_pbx run.
Reverts sig_pri changes in trunk that are specific to isdn technology only.

(closes issue #16638)
Reported by: alecdavis
Patches: 
      cdr_update.diff3.txt uploaded by alecdavis (license 585)
Tested by: alecdavis



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@241416 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-01-20 08:18:45 +00:00
Jeff Peeler 8fd9401e3d Initialize data on the stack so that Park doesn't interpret random arguments.
passdata was only being set in pbx_substitue_variables when arguments were
passed.

(closes issue #16406)
(closes issue #16586)
Reported by: DLNoah
Patches: 
      bug16586v2.patch uploaded by jpeeler (license 325)
Tested by: DLNoah



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@241366 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-01-19 22:59:53 +00:00
Tilghman Lesher 49bf540c71 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: https://origsvn.digium.com/svn/asterisk/trunk@241188 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-01-19 00:28:49 +00:00
Jeff Peeler 568c057c4c 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: https://origsvn.digium.com/svn/asterisk/trunk@241143 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-01-18 22:31:25 +00:00
Jason Parker bbd290308f Fix an RTP instance allocation failure on Solaris.
(closes issue #16543)
Reported by: crjw
Patches:
      rtp_sin_family.patch uploaded by crjw (license 963)
Tested by: crjw, qwell


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@241098 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-01-18 22:03:49 +00:00
Sean Bright bb03a2f7d9 Merged revisions 241015 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r241015 | seanbright | 2010-01-18 14:54:19 -0500 (Mon, 18 Jan 2010) | 12 lines
  
  Plug a memory leak when reading configs with their comments.
  
  While reading through configuration files with the intent of returning their
  full contents (comments specifically) we allocated some memory and then forgot
  to free it.  This doesn't fix 16554 but clears up a leak I had in the lab.
  
  (issue #16554)
  Reported by: mav3rick
  Patches:
        issue16554_20100118.patch uploaded by seanbright (license 71)
  Tested by: seanbright
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@241016 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-01-18 19:57:52 +00:00
Sean Bright 9e02292e5c Avoid a crash on Solaris when running 'core show functions.'
(closes issue #16309)
Reported by: asgaroth


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@240717 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-01-17 19:45:48 +00:00
Tilghman Lesher 6c1e69370e Err, oops, it was already the way I intended.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@240629 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-01-15 23:50:47 +00:00
Tilghman Lesher 8037982fa6 The previous attempt at using a pipe to guarantee astcanary shutdown did not work.
We're revisiting the previous patch, albeit with a method that overcomes the
prior criticism that it was not POSIX-compliant.
(closes issue #16602)
 Reported by: frawd
 Patches: 
       20100114__issue16602.diff.txt uploaded by tilghman (license 14)
 Tested by: frawd


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@240499 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-01-15 21:40:14 +00:00
Tilghman Lesher e8a6d2995e 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: https://origsvn.digium.com/svn/asterisk/trunk@240421 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-01-15 21:04:34 +00:00
Mark Michelson fe72baf06b Make sure to set owner_line, ownder_func, and owner_file in ast_calloc_with_stringfields.
Asterisk would crash on startup if MALLOC_DEBUG were set in menuselect. This is because
the manager action UpdateConfig had to resize its string field allocation to set the
description. When the resize occurred, ast_copy_string would crash because we were
attempting to copy a string from a NULL pointer. Setting the strings initially makes
the code much less crashy.



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@240420 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-01-15 20:58:24 +00:00
Russell Bryant 86c57df84e Ensure payload type is properly checked when comparing against cached events.
(closes issue #16607)
Reported by: ddv2005
Patches:
      event.patch uploaded by ddv2005 (license 769)


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@240411 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-01-15 20:41:11 +00:00
Sean Bright e612d87695 Convert a few places to use ast_calloc_with_stringfields where applicable.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@240368 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-01-15 18:21:50 +00:00
Jeff Peeler 9228fba7d7 Fix broken call pickup
The problem was the OUTGOING flag was not getting set properly on the channel,
resulting in pickup failing as ast_read thought the call was inbound. Refer to
170393 for a more verbose description as this is the same exact change.

(closes issue #16539)
Reported by: syspert
Patches: 
      bug16539.patch uploaded by jpeeler (license 325)
Tested by: syspert


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@240179 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-01-14 18:03:31 +00:00
Tilghman Lesher 3eb8f0a8dc Similarly, ensure that matchcid is duplicated correctly when merging contexts.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@240175 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-01-14 17:34:53 +00:00
Tilghman Lesher 20e57b12e8 Ensure that the callerid is NULL when the parent is effectively NULL.
This applies only to pattern-match hints, which create exact-match
hints on the fly.


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@240129 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-01-14 16:52:22 +00:00
Matthew Nicholson ef0da09c74 This change fixes a few bugs in the way the far max IFP was calculated that were introduced in r231692.
(closes issue #16497)
Reported by: globalnetinc
Patches:
      udptl-max-ifp-fix1.diff uploaded by mnicholson (license 96)
Tested by: globalnetinc



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@240078 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-01-14 16:14:35 +00:00
Tilghman Lesher 87ea570ef1 Oops, another tag error
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@239997 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-01-13 23:22:56 +00:00
Tilghman Lesher b01df91513 Oops, missed a closing tag
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@239996 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-01-13 23:21:46 +00:00
Tilghman Lesher ecbe7eff7a 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: https://origsvn.digium.com/svn/asterisk/trunk@239957 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-01-13 21:27:34 +00:00
Tilghman Lesher 919437428e Flex uses fwrite incorrectly, which breaks the build. Providing a workaround.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@239920 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-01-13 20:38:42 +00:00
Jeff Peeler 495b701a85 Merged revisions 239838 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r239838 | jpeeler | 2010-01-13 13:43:33 -0600 (Wed, 13 Jan 2010) | 11 lines
  
  Fix regression for timed out parked call returning to caller
  
  This issue seems to have been exposed by the fix in 160390 whereby using a
  masquerade prevented a crash. The new channel used in the masquerade was
  not copying the macro information from the old channel.
  
  (closes issue #15459)
  Reported by: djrodman
  Patches: 
        patch_15459.txt uploaded by mnick (license )
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@239839 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-01-13 19:48:16 +00:00
Tilghman Lesher 6d1086ec86 Code previously added to ast_expr2f.c warranted a change in the source file ast_expr2.fl.
Also, made a Makefile change to ensure that the expression parser C source files get
regenerated correctly, when we need that to happen.


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@239797 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-01-13 18:16:13 +00:00
David Vossel 03529837cc add silence gen to wait apps
asterisk.conf's 'transmit_silence' option existed before
this patch, but was limited to only generating silence
while recording and sending DTMF.  Now enabling the
transmit_silence option generates silence during wait
times as well.

To achieve this, ast_safe_sleep has been modified to
generate silence anytime no other generators are present
and transmit_silence is enabled.  Wait apps not using
ast_safe_sleep now generate silence when transmit_silence
is enabled as well.

(closes issue #16524)
Reported by: kobaz

(closes issue #16523)
Reported by: kobaz
Tested by: dvossel

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



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@239712 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-01-13 16:31:14 +00:00
Olle Johansson c300b12b18 MAX() moved to utils.h
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@239665 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-01-13 10:45:19 +00:00
Tilghman Lesher d80a38310a Blank callerid and NULL callerid should not compare equal.
The second is the default state for matching CID in the dialplan (no matching)
while the first matches one particular CallerID.  This is a regression.
(fixes AST-314, SWP-611)


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@239571 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-01-12 19:58:00 +00:00
Alec L Davis 113ff66f7f add Dialed Number Identifier (DNID) field to cdr records.
reviewboard link: https://reviewboard.asterisk.org/r/455/

  Reported by: alecdavis
  Tested by: alecdavis
  Patch
	 cdr_dnid.diff2.txt uploaded by alecdavis (license 585)



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@239525 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-01-12 18:55:54 +00:00
Sean Bright ba6201cae6 Fix ao2_callback when both OBJ_MULTIPLE and OBJ_NODATA are passed.
There is an issue which only affects trunk and the new ao2_callback OBJ_MULTIPLE
implementation.  When both OBJ_MULTIPLE and OBJ_NODATA are passed, only the first
object is visited, regardless of what is returned by the specified callback. This
causes a problem when we are clearing a container, i.e.:

    ao2_callback(container, OBJ_UNLINK | OBJ_NODATA | OBJ_MULTIPLE, NULL, NULL);

Only unlinks the first object.  This patch resolves this.

(closes issue #16564)
Reported by: pj
Patches:
      issue16564_20100111.diff uploaded by seanbright (license 71)
Tested by: pj, seanbright

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@239113 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-01-11 16:40:23 +00:00
Sean Bright 1ad2999112 Fix spelling of 'category.'
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@239111 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-01-11 16:22:09 +00:00
Tilghman Lesher 9c1b53cab4 According to POSIX, the capital L modifier applies only to floating point types.
Fixes a crash on Solaris.
(closes issue #16572)
 Reported by: crjw
 Patches: 
       frame_changes.patch uploaded by crjw (license 963)
       Plus several others found and fixed by me


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@239074 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-01-10 19:37:30 +00:00
Tilghman Lesher 5e0762370c It's been long enough -- make the behavior introduced in 1.6 the default.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@239000 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-01-10 06:56:36 +00:00
Tilghman Lesher 31e93b2865 Merged revisions 238915 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r238915 | tilghman | 2010-01-08 18:57:58 -0600 (Fri, 08 Jan 2010) | 6 lines
  
  -1 is interpreted as an error, intead of the maximum mask.
  (closes issue #16241)
   Reported by: vnovy
   Patches: 
         manager.c.patch uploaded by vnovy (license 922)
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@238916 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-01-09 01:08:04 +00:00
Jeff Peeler cde1057ec3 Merged revisions 238834 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r238834 | jpeeler | 2010-01-08 17:28:37 -0600 (Fri, 08 Jan 2010) | 4 lines
  
  Stop a crash when no peer is passed to masq_park_call.
  
  (distantly related to issue #16406)
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@238835 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-01-08 23:30:55 +00:00
David Vossel bf06747778 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: https://origsvn.digium.com/svn/asterisk/trunk@238635 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-01-08 19:39:30 +00:00
Matthew Nicholson 98b69d84e1 Merged revisions 238629 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r238629 | mnicholson | 2010-01-08 13:20:44 -0600 (Fri, 08 Jan 2010) | 5 lines
  
  Properly calculate the remaining space in the output string when reducing format strings.
  
  (closes issue #16560)
  Reported by: goldwein
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@238630 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-01-08 19:32:11 +00:00
Jeff Peeler 7df5564a61 Stop trying to find a parking space after traversing the parkinglot one time.
(closes issue #16428)
Reported by: Yasuhiro Konishi


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@238583 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-01-08 17:18:41 +00:00
David Vossel a575a50cd5 fixes ast_transfer stall until hangup if called with a channel that doesn't support transfers
ast_transfer sets res to 0 if there is no technology transfer function,
but then tests for it to be negative before deciding to do an early exit.
As a result, it will will wait for an AST_CONTROL_TRANSFER message that
will never come.

(closes issue #16424)
Reported by: davidw
Patches:
      Issue_16424_trunk_234134.patch uploaded by davidw (license 780)



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@238492 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-01-07 20:42:27 +00:00
Jeff Peeler 0a4f80cbcf Fix channel name comparison for bridge application.
The channel name comparison was not comparing the whole string and therefore
if one channel name was a substring of the other, the bridge would fail.

(closes issue #16528)
Reported by: telecos82
Patches: 
      res_features_r236843.diff uploaded by telecos82 (license 687)


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@238134 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-01-06 19:05:06 +00:00
David Vossel bebe42f3a7 fixes subscriptions being lost after 'module reload'
During a module reload if multiple extension configs are present,
such as both extensions.conf and extensions.ael, watchers for one
config's hints will be lost during the merging of the other config.

This happens because hint watchers are only preserved for the
current config being merged.  The old context list is destroyed
after the merging takes place, meaning any watchers that were not
perserved will be removed.

Now all hints are preserved during merging regardless of what config
file is being merged.  These hints are only restored if they
are present within the new context list.

(closes issue #16093)
Reported by: jlaroff



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@237839 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-01-05 19:29:47 +00:00
Russell Bryant 3a6d247def Fix build of utility apps that include utils.c.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@237749 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-01-05 17:26:50 +00:00
Russell Bryant 630152f848 Merged revisions 237697 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r237697 | russell | 2010-01-05 11:13:28 -0600 (Tue, 05 Jan 2010) | 7 lines
  
  Change a NOTICE log message to DEBUG where it belongs.
  
  (closes issue #16479)
  Reported by: alexrecarey
  
  (closes SWP-577)
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@237699 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-01-05 17:16:01 +00:00
Tilghman Lesher 3f33c38c8a Merged revisions 237573 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r237573 | tilghman | 2010-01-04 15:45:46 -0600 (Mon, 04 Jan 2010) | 6 lines
  
  Bounds checking for input string
  (closes issue #16407)
   Reported by: qwell
   Patches: 
         20100104__issue16407.diff.txt uploaded by tilghman (license 14)
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@237574 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-01-04 21:48:20 +00:00
Tilghman Lesher 7acf8196d0 Merged revisions 237493 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r237493 | tilghman | 2010-01-04 14:57:35 -0600 (Mon, 04 Jan 2010) | 8 lines
  
  Regression in issue #15421 - Pattern matching
  (closes issue #16482)
   Reported by: wdoekes
   Patches: 
         astsvn-16482-betterfix.diff uploaded by wdoekes (license 717)
         20091223__issue16482.diff.txt uploaded by tilghman (license 14)
   Tested by: wdoekes, tilghman
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@237494 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-01-04 20:59:01 +00:00
Tilghman Lesher c0eb48380a Oops, didn't compile (thanks, kpfleming)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@237414 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-01-04 19:03:20 +00:00
Tilghman Lesher f2a282ce17 Further reduce the encoded blank values back to blank in the realtime API.
(closes issue #16533)
 Reported by: sergee
 Patches: 
       200100104__issue16533.diff.txt uploaded by tilghman (license 14)
 Tested by: sergee


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@237410 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-01-04 18:42:10 +00:00
Tilghman Lesher 386b847075 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: https://origsvn.digium.com/svn/asterisk/trunk@237406 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-01-04 18:28:28 +00:00
Jason Parker f93071483f Add app_voicemail and say.c support for Vietnamese.
Also add an XXX comment that I'm baffled nobody has ever complained about.  We
say "first message", and then we go into language-specific stuff where we
proceed to say..."first message".

(closes issue #15053)
Reported by: dinhtrung
Patches:
      vietnamese.ods uploaded by dinhtrung (license 776)
      app_voicemail.c.diff uploaded by dinhtrung (license 776)

(closes issue #15626)
Reported by: dinhtrung
Patches:
      say.c.diff uploaded by dinhtrung (license 776)


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@237050 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-12-30 22:30:21 +00:00
Jeff Peeler 1a219ad725 Fix compiling with LOW_MEMORY.
Modified handle_verbose to be LOW_MEMORY aware, removed old RTP related code
in chan_sip.

(closes issue #16381)
Reported by: michael_iedema
Patches: 
      ast_complete_source_filename.patch uploaded by michael iedema (license 942)
      modified by me


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@236893 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-12-30 20:34:41 +00:00
Jason Parker 21954cea7d Allow "REMAINDER" to function properly in expressions.
(closes issue #16427)
Reported by: wdoekes
Patches:
      ast16-reminder-remainder.patch uploaded by wdoekes (license 717)
Tested by: wdoekes


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@236713 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-12-28 22:09:40 +00:00
David Vossel 73cb2d507b 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: https://origsvn.digium.com/svn/asterisk/trunk@236027 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-12-22 16:09:11 +00:00
Kevin P. Fleming ef9be94b35 Change all refererences to 1.6.3 to be 1.8, since that will be the next feature release
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@235904 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-12-21 18:51:17 +00:00
Tilghman Lesher 128e4022d0 Merged revisions 235821 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r235821 | tilghman | 2009-12-21 10:45:03 -0600 (Mon, 21 Dec 2009) | 8 lines
  
  Send parking lot announcement to the channel which parked the call, not the park-ee.
  (closes issue #16234)
   Reported by: yeshuawatso
   Patches: 
         20091210__issue16234.diff.txt uploaded by tilghman (license 14)
         20091221__issue16234__1.4.diff.txt uploaded by tilghman (license 14)
   Tested by: yeshuawatso
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@235822 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-12-21 17:00:46 +00:00
Alec L Davis ec0581fef4 restarts busydetector (if enabled) when DTMF is received after call is bridged.
(closes issue 0016389)
  Reported by: alecdavis
  Tested by: alecdavis
  Patch
    dtmf_busydetector.diff2.txt uploaded by alecdavis (license 585)


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@235774 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-12-20 08:22:35 +00:00
Jeff Peeler cf7b67d9d3 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: https://origsvn.digium.com/svn/asterisk/trunk@235660 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-12-18 22:51:37 +00:00
Tilghman Lesher e4c1fc1e4a Merged revisions 235421 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r235421 | tilghman | 2009-12-17 11:17:51 -0600 (Thu, 17 Dec 2009) | 8 lines
  
  Use context from which Macro is executed, not macro context, if applicable.
  Also, ensure that the extension COULD match, not just that it won't match more.
  (closes issue #16113)
   Reported by: OrNix
   Patches: 
         20091216__issue16113.diff.txt uploaded by tilghman (license 14)
   Tested by: OrNix
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@235422 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-12-17 17:19:08 +00:00
Jeff Peeler 5b36dd59ea Enhance AMI redirect to allow channels to be redirected to different places.
New parameters ExtraContext, ExtraExtension, and ExtraPriority have been added
to redirect the second channel to a different location. Previously, it was only
possible to redirect both channels to the same place.

(closes issue #15853)
Reported by: haakon
Patches:
      trunk-manager.c.patch uploaded by haakon (license 880)
Tested by: jpeeler


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@235265 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-12-16 00:31:53 +00:00
Jeff Peeler 473837a4ab Change match criteria existence in ast_channel_cmp_cb to use ast_strlen_zero.
(closes issue #16161)
Reported by: may213
Patches: 
      core-show-channel.patch uploaded by may213 (license 454)


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@235226 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-12-15 23:41:20 +00:00
Alec L Davis 155931303b Whitespace.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@234940 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-12-15 03:26:49 +00:00
Alec L Davis 6c50fad99f restarts busydetector (if enabled) when DTMF is received.
(closes issue #16389)
  Reported by: alecdavis
  Tested by: alecdavis
  Patch
	dtmf_busydetector.diff.txt uploaded by alecdavis (license 585)



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@234897 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-12-15 03:04:59 +00:00
Sean Bright ecba877848 The default rate for 'timing test' is actually 50/sec, not 100/sec as advertised.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@234572 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-12-14 16:08:09 +00:00
Tilghman Lesher d32c333f7c Trim leading/trailing spaces from the filename, to deal with common user error.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@234458 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-12-13 09:41:43 +00:00
Jeff Peeler 2414bc8005 Add audio announcement option to app_page
As described in the CHANGES file:
* MeetMe has a new option 'G' to play an announcement before joining a
  conference.
* Page has a new option 'A(x)' which will playback an announcement 
  simultaneously to all paged phones (and optionally excluding the caller's one 
  using the new option 'n') before the call is bridged.

To add the new option to meetme, the conference flag options had to be extended 
to 64 bits.

(closes issue #14365)
Reported by: dferrer
Patches:
      page_announce.patch uploaded by dferrer (license 525)
      modified by me

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@234173 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-12-10 17:31:23 +00:00
David Vossel e44e6b33b3 fixes incorrect logic in ast_uri_encode
issue #16299


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@233611 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-12-07 23:28:51 +00:00
Tilghman Lesher cfd17ef0a6 Move implementation of closefrom(3) from app.c to strcompat.c
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@233358 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-12-06 07:01:06 +00:00
Tilghman Lesher fc7c2d917e Using the builtin function breaks OpenBSD 4.2
(closes issue #16395)
 Reported by: jtodd


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@233239 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-12-04 21:06:22 +00:00
Russell Bryant 97bb26bf75 Merged revisions 233092 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r233092 | russell | 2009-12-04 11:12:47 -0600 (Fri, 04 Dec 2009) | 7 lines
  
  Only do frame payload check for HOLD frames.
  
  This code was added for helping to debug the source of invalid HOLD frames.
  However, a side effect of this is that it will incorrectly report errors for
  frames that have an integer payload.  Make the check for this block specific
  to the HOLD frame case.
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@233100 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-12-04 17:18:22 +00:00
Matthias Nick 71ca1b54cb Merged revisions 233014 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r233014 | mnick | 2009-12-04 09:17:03 -0600 (Fri, 04 Dec 2009) | 11 lines
  
  Warning message gets displayed only once
  
  Added additional field 'int display_inband_dtmf_warning', which when set to '1' displays the warning ('Inband DTMF is not supported on codec %s. Use RFC2833'), and when set to '0' doesn't display the warning. Otherwise you would get hundreds of warnings every second.
  
  (closes issue #15769)
  Reported by: falves11
  Patches:
  	patch_15769_14.txt uploaded by mnick (license 874)
  Tested by: mnick, falves11
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@233046 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-12-04 15:38:33 +00:00
Jeff Peeler 51df77df8b Merged revisions 232581 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r232581 | jpeeler | 2009-12-02 15:57:42 -0600 (Wed, 02 Dec 2009) | 7 lines
  
  Send ack (response/message) after receiving manager action userevent
  
  (closes issue #16264)
  Reported by: dimas
  Patches: 
        event-ack.patch uploaded by dimas (license 88)
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@232582 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-12-02 22:02:43 +00:00
Jeff Peeler d01451c076 Make manager response to "Action: events" finish with empty line
(closes issue #16275)
Reported by: vnovy
Patches: 
      manager.c.diff uploaded by vnovy (license 922)



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@232576 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-12-02 21:32:50 +00:00
Joshua Colp d0e431ce3d Add an 'X' option to the asterisk application which enables #exec for configuration files.
This option can be used to enable #exec support in the asterisk.conf configuration file.

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@232510 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-12-02 20:10:07 +00:00
David Vossel edf6605ae7 Merged revisions 232350 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r232350 | dvossel | 2009-12-02 10:59:18 -0600 (Wed, 02 Dec 2009) | 6 lines
  
  ast_outaddrfor doesn't do htons() on port, looks odd in strace.
  
  (closes issue #16290)
  Reported by: wdoekes
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@232351 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-12-02 17:00:15 +00:00
Tilghman Lesher f46840c107 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: https://origsvn.digium.com/svn/asterisk/trunk@232164 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-12-02 03:26:16 +00:00
Russell Bryant 1ed9e34c0d Use __builtin_ffsll() from gcc instead of ffssll() to fix a FreeBSD build error.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@232017 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-12-01 23:56:14 +00:00
Russell Bryant 507e579dc9 Merged revisions 232007 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r232007 | russell | 2009-12-01 17:25:36 -0600 (Tue, 01 Dec 2009) | 2 lines
  
  Fix a warning pointed out by buildbot.
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@232008 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-12-01 23:27:53 +00:00
Jeff Peeler d9f37a67e1 Merged revisions 231911 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r231911 | jpeeler | 2009-12-01 15:29:31 -0600 (Tue, 01 Dec 2009) | 12 lines
  
  Fix crash with invalid frame data
  
  The crash was happening as a result of a frame containing an invalid data
  pointer, but was set with data length of zero. The few times the issue was
  reproduced it _seemed_ that the frame was queued properly, that is the data
  pointer was set to NULL. I never could reproduce the crash so as a last resort
  the crash has been fixed, but a check in __ast_read has been added to give as
  much information about the source of problematic frames in the future.
  
  (closes issue #16058)
  Reported by: atis
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@231927 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-12-01 21:54:21 +00:00
David Vossel 176c8a0185 Merged revisions 231853 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r231853 | dvossel | 2009-12-01 15:14:31 -0600 (Tue, 01 Dec 2009) | 3 lines
  
  WaitExten m option with no parameters generates frame with zero datalen but non-null data ptr
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@231867 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-12-01 21:20:19 +00:00
Tilghman Lesher f59fe83c56 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: https://origsvn.digium.com/svn/asterisk/trunk@231850 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-12-01 20:27:37 +00:00
Matthew Nicholson 65c9bfbead Merged revisions 231740 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r231740 | mnicholson | 2009-12-01 09:34:57 -0600 (Tue, 01 Dec 2009) | 2 lines
  
  Ignore unknown formats in ast_format_str_reduce() and return an error if no know formats are found.
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@231741 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-12-01 15:47:36 +00:00
Kevin P. Fleming 5ba2b689b2 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: https://origsvn.digium.com/svn/asterisk/trunk@231692 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-11-30 21:47:42 +00:00
Matthew Nicholson 31848bcdd1 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: https://origsvn.digium.com/svn/asterisk/trunk@231688 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-11-30 21:31:55 +00:00
Matthew Nicholson 936a2bd202 Reverted 231616
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@231637 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-11-30 21:21:29 +00:00
Matthew Nicholson 8d1f4fa5ea 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: https://origsvn.digium.com/svn/asterisk/trunk@231616 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-11-30 21:13:42 +00:00
Tilghman Lesher 6642c90029 Export dynamic (weak-linked) symbols correctly.
(closes issue #15193)
 Reported by: eliel
 Patches: 
       20091111__issue15193.diff.txt uploaded by tilghman (license 14)


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@231439 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-11-30 16:53:10 +00:00
Tilghman Lesher 23b4a700f4 Reorder option flags. Change guidelines so that example code is consistent with guidelines
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@231369 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-11-26 02:09:58 +00:00
Tilghman Lesher f98c12a57d Merged revisions 231298 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r231298 | tilghman | 2009-11-25 16:31:57 -0600 (Wed, 25 Nov 2009) | 2 lines
  
  After a frame duplication failure, unlock the channel before returning.
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@231299 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-11-25 22:33:02 +00:00
Jeff Peeler c10288ec01 Fix erroneous hangup extension execution
ast_spawn_extension behaves differently from 1.4 in that hangups and extensions
that do not exist do not return an error, whereas in 1.6 it does. This is now 
taken into account so that the AST_FLAG_BRIDGE_HANGUP_RUN flag gets set
properly.

(closes issue #16106)
Reported by: ajohnson
Tested by: ajohnson


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@231095 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-11-24 18:50:36 +00:00
Matthew Nicholson cab2253d34 Merged revisions 230627 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r230627 | mnicholson | 2009-11-20 14:53:06 -0600 (Fri, 20 Nov 2009) | 8 lines
  
  Copy the peer CDR's userfield to the bridge CDR if it exists.  This is necessary for the recordagentcalls option in chan_agent to store the recorded file name in the bridge CDR.
  
  (closes issue #14590)
  Reported by: msetim
  Patches:
        queue_agent_userfield.patch uploaded by Laureano (license 265)
  Tested by: Laureano, mnicholson
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@230628 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-11-20 21:01:10 +00:00
David Vossel 3595fbb70c audiohook signal trigger on every status change
(issue #14618)

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@230583 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-11-20 17:26:20 +00:00
Tilghman Lesher 5e2aa190fe Display a list of channel variables in each channel-oriented event.
(Closes AST-33)
Reviewboard:	https://reviewboard.asterisk.org/r/368/


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@230111 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-11-13 20:42:03 +00:00
Olle Johansson ebc3aff1c3 Fixing trunk in a way so that it compiles again.
Thanks, Philippe :-)


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@229871 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-11-13 10:53:14 +00:00
Olle Johansson 75c015bfff Add the capability to require a module to be loaded, or else Asterisk exits.
Review: https://reviewboard.asterisk.org/r/426/


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@229819 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-11-13 08:52:28 +00:00
David Brooks bac499e521 Merged revisions 229498 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r229498 | dbrooks | 2009-11-11 13:46:19 -0600 (Wed, 11 Nov 2009) | 8 lines
  
  Solaris doesn't like NULL going to ast_log
  
  Solaris will crash if NULL is passed to ast_log. This simple patch simply uses S_OR to
  get around this.
  
  (closes issue #15392)
  Reported by: yrashk
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@229499 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-11-11 19:48:18 +00:00
Tilghman Lesher 4c8319190b Merged revisions 229360 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r229360 | tilghman | 2009-11-10 16:09:16 -0600 (Tue, 10 Nov 2009) | 12 lines
  
  If two pattern classes start with the same digit and have the same number of characters, they will compare equal.
  The example given in the issue report is that of [234] and [246], which have
  these characteristics, yet they are clearly not equivalent.  The code still
  uses these two characteristics, yet when the two scores compare equal, an
  additional check will be done to compare all characters within the class to
  verify equality.
  (closes issue #15421)
   Reported by: jsmith
   Patches: 
         20091109__issue15421__2.diff.txt uploaded by tilghman (license 14)
   Tested by: jsmith, thedavidfactor
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@229361 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-11-10 22:14:22 +00:00
Leif Madsen fef304e641 Merged revisions 228896 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r228896 | lmadsen | 2009-11-09 09:37:43 -0600 (Mon, 09 Nov 2009) | 6 lines
  
  Update WARNING message.
  Update a WARNING message to give a suggested fix when encountered.
  
  (closes issue #16198)
  Reported by: atis
  Tested by: atis
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@228897 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-11-09 15:38:38 +00:00
Tilghman Lesher c0b3c923a4 Fix various problems detected with Valgrind.
* chan_console accessed pvts after deallocation.
 * cdr_mysql stored a pointer that was freed by realloc()
 * The module loader did not check usecount on shutdown, which led to chan_iax2
 reading a timer that was already unloaded.
 * The event subsystem sometimes creates an event with no IEs.  Due to a corner
 condition, the code would read beyond the memory boundary.
 * res_pktccops did not correctly check whether its monitor thread was started.
(closes issue #16062)
 Reported by: alexanderheinz
 Patches: 
       20091109__issue16062.diff.txt uploaded by tilghman (license 14)
 Tested by: tilghman


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@228798 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-11-09 07:37:52 +00:00
David Vossel 10fa8fe8d0 Merged revisions 228692 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r228692 | dvossel | 2009-11-06 16:33:27 -0600 (Fri, 06 Nov 2009) | 9 lines
  
  fixes audiohook write crash occuring in chan_spy whisper mode.
  
  After writing to the audiohook list in ast_write(), frames
  were being freed incorrectly.  Under certain conditions this
  resulted in a double free crash.
  
  (closes issue #16133)
  Reported by: wetwired

  (closes issue #16045)
  Reported by: bluecrow76
  Patches:
        issue16045.diff uploaded by dvossel (license 671)
  Tested by: bluecrow76, dvossel, habile
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@228693 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-11-06 22:35:44 +00:00
Richard Mudgett 97de30df8f Fix compiler warning gcc 4.2.4 found
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@228621 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-11-06 19:53:08 +00:00
Matthew Nicholson f44f8650cb Merged revisions 228378 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r228378 | mnicholson | 2009-11-06 10:26:59 -0600 (Fri, 06 Nov 2009) | 8 lines
  
  Properly handle '=' while decoding base64 messages and null terminate strings returned from BASE64_DECODE.
  
  (closes issue #15271)
  Reported by: chappell
  Patches:
        base64_fix.patch uploaded by chappell (license 8)
  Tested by: kobaz
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@228620 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-11-06 19:47:11 +00:00
Joshua Colp 3f4328ed04 Merged revisions 228409 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r228409 | file | 2009-11-06 12:41:20 -0400 (Fri, 06 Nov 2009) | 7 lines
  
  Fix a bug caused by a partially invalid frame (from the jitterbuffer) passing through the Asterisk core.
  
  (closes issue #15560)
  Reported by: jvandal
  (closes issue #15709)
  Reported by: covici
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@228410 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-11-06 16:42:23 +00:00
David Vossel 71a29c3ffc Merged revisions 228338 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r228338 | dvossel | 2009-11-06 09:41:41 -0600 (Fri, 06 Nov 2009) | 5 lines
  
  fixes crash in astfd.c
  
  (closes issue #15981)
  Reported by: slavon
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@228339 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-11-06 15:42:46 +00:00
Tilghman Lesher 2e4832734a Rework codecs command to comply with the 64-bit scheme
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@228049 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-11-05 17:26:55 +00:00
Mark Michelson 2f4b5c8bb5 Add a couple more casts so that code compiles correctly.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@227646 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-11-04 16:41:02 +00:00
Tilghman Lesher d8e0c58437 Expand codec bitfield from 32 bits to 64 bits.
Reviewboard: https://reviewboard.asterisk.org/r/416/


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@227580 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-11-04 14:05:12 +00:00
Olle Johansson 037a6d287b Add destruction of iterators to avoid problems with refcounters
(per Russell's review of another patch)


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@227545 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-11-04 08:22:00 +00:00
Russell Bryant b0778107c7 Resolve a warning from gcc 4.4.1.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@227463 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-11-03 22:08:46 +00:00
David Brooks d87006ca1c 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: https://origsvn.digium.com/svn/asterisk/trunk@227448 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-11-03 21:26:28 +00:00
Matthew Nicholson 7ed425ec80 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: https://origsvn.digium.com/svn/asterisk/trunk@227435 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-11-03 21:21:09 +00:00
Jason Parker 85e2c6d7fb Fix some build issues on Solaris.
(closes issue #14517)
(SWP-109)
Reported by: asgaroth
Patches:
      bug_14517.diff uploaded by snuffy (license 35)
Tested by: asgaroth, snuffy, dougm, qwell


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@227372 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-11-03 19:59:46 +00:00
Olle Johansson 8d64231c62 Adding external reference for doxygen
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@226970 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-11-02 20:43:52 +00:00
Russell Bryant 844a01b27e 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: https://origsvn.digium.com/svn/asterisk/trunk@226606 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-10-30 04:08:39 +00:00
Tilghman Lesher c6a34a201e Merged revisions 226138 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r226138 | tilghman | 2009-10-27 15:16:49 -0500 (Tue, 27 Oct 2009) | 7 lines
  
  Manager output is not always NULL-terminated, so force a NULL at the end of the filestream.
  (closes issue #15495)
   Reported by: pdf
   Patches: 
         20090916__issue15495.diff.txt uploaded by tilghman (license 14)
   Tested by: pdf
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@226159 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-10-27 20:22:07 +00:00
Kevin P. Fleming ad7a9fb8e8 Correct broken logic from revision 225405.
The code committed in revision 225405 was broken; instead of removing the unreference code,
the logic used to decide when to do it should have been reversed. This patch corrects the
situation, and makes reference counting work properly again.


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@225955 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-10-26 22:03:29 +00:00
David Vossel 776a14386a 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: https://origsvn.digium.com/svn/asterisk/trunk@225445 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-10-22 19:55:51 +00:00
Kevin P. Fleming be796e703a Fix a refcount error introduced by yesterday's OBJ_MULTIPLE commit.
When an object is being unlinked from its container *and* being returned to
the caller, we do not want to decrement the reference count after unlinking
it from the container, as the reference that the container held is what we
are returning to the caller... and if it was the only remaining reference to
the object, that could result in the object being destroyed.



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@225405 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-10-22 18:41:47 +00:00
Tilghman Lesher 496282194c 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: https://origsvn.digium.com/svn/asterisk/trunk@225360 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-10-22 17:11:23 +00:00
Richard Mudgett 1174a61612 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: https://origsvn.digium.com/svn/asterisk/trunk@225357 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-10-22 16:33:22 +00:00
Kevin P. Fleming cdd1f9e296 Finish implementaton of astobj2 OBJ_MULTIPLE, and convert ast_channel_iterator to use it.
This patch finishes the implementation of OBJ_MULTIPLE in astobj2 (the
case where multiple results need to be returned; OBJ_NODATA mode
already was supported). In addition, it converts ast_channel_iterators
(only the targeted versions, not the ones that iterate over all
channels) to use this method.

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

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



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@225244 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-10-21 21:08:47 +00:00
Russell Bryant 1ebf7767d0 Merged revisions 225171 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r225171 | russell | 2009-10-21 11:44:49 -0500 (Wed, 21 Oct 2009) | 2 lines
  
  Revert 225169, as this doesn't account for the possibility of a list of frames.
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@225172 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-10-21 16:46:22 +00:00
Russell Bryant 9fbb9d0b6c Merged revisions 225169 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r225169 | russell | 2009-10-21 11:39:20 -0500 (Wed, 21 Oct 2009) | 2 lines
  
  Isolate the frame returned from ast_translate().
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@225170 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-10-21 16:42:13 +00:00
Russell Bryant cd10bd931a 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: https://origsvn.digium.com/svn/asterisk/trunk@224932 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-10-21 03:09:04 +00:00
Tilghman Lesher 77031501a5 Merged revisions 224855 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r224855 | tilghman | 2009-10-20 17:07:11 -0500 (Tue, 20 Oct 2009) | 5 lines
  
  Pay attention to the return value of the manipulate function.
  While this looks like an optimization, it prevents a crash from occurring
  when used with certain audiohook callbacks (diagnosed with SVN trunk,
  backported to 1.4 to keep the source consistent across versions).
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@224856 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-10-20 22:09:07 +00:00
Joshua Colp b518c7b9a7 Merged revisions 224773 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r224773 | file | 2009-10-20 14:46:37 -0300 (Tue, 20 Oct 2009) | 5 lines
  
  Add support for relaying early media in the features attended transfer option.
  
  (closes issue #14828)
  Reported by: licedey
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@224774 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-10-20 17:47:34 +00:00
Tilghman Lesher c80715706e Remove unnecessary typedef
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@224403 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-10-17 16:39:37 +00:00
Tilghman Lesher c74a2d0b45 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: https://origsvn.digium.com/svn/asterisk/trunk@224225 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-10-15 22:33:30 +00:00
Russell Bryant 72934ead4b Merged revisions 223485-223486 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r223485 | russell | 2009-10-11 12:22:52 -0500 (Sun, 11 Oct 2009) | 6 lines
  
  Don't use data outside of its scope.
  
  The purpose of this code was to have a hangup frame put on the list of deferred
  frames.  However, the code that read the hangup frame was outside of the scope
  of where the hangup frame was declared.
........
  r223486 | russell | 2009-10-11 12:25:06 -0500 (Sun, 11 Oct 2009) | 2 lines
  
  Remove some unnecessary code.
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@223487 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-10-11 17:25:42 +00:00
Matthew Nicholson 0d4726b0a2 Merged revisions 223225 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r223225 | mnicholson | 2009-10-09 13:20:11 -0500 (Fri, 09 Oct 2009) | 8 lines
  
  Signal timeouts by returning AST_CONTROL_RINGING when originating calls.
  (closes issue #15104)
  Reported by: nblasgen
  Patches:
        manager-timeout1.diff uploaded by mnicholson (license 96)
  Tested by: nblasgen, mnicholson
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@223273 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-10-09 18:34:08 +00:00
Russell Bryant dd50b9e8b5 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: https://origsvn.digium.com/svn/asterisk/trunk@222880 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-10-08 19:52:03 +00:00
David Vossel db7b4ec65e fixes an ast_netsock_list memory leak.
ABE-1998
Review: https://reviewboard.asterisk.org/r/395/



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@222873 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-10-08 19:35:30 +00:00
David Vossel 9456ab2724 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: https://origsvn.digium.com/svn/asterisk/trunk@222761 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-10-07 22:58:38 +00:00
Kevin P. Fleming 1c9fe00920 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: https://origsvn.digium.com/svn/asterisk/trunk@222176 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-10-06 01:24:24 +00:00
Kevin P. Fleming 20743ec07d Allow non-compliant T.38 endpoints to be supportable via configuration option.
Many T.38 endpoints incorrectly send the maximum IFP frame size they can accept
as the T38FaxMaxDatagram value in their SDP, when in fact this value is
supposed to be the maximum UDPTL payload size (datagram size) they can accept.
If the value they supply is small enough (a commonly supplied value is '72'),
T.38 UDPTL transmissions will likely fail completely because the UDPTL packets
will not have enough room for a primary IFP frame and the redundancy used for
error correction. If this occurs, the Asterisk UDPTL stack will emit log messages
warning that data loss may occur, and that the value may need to be overridden.

This patch extends the 't38pt_udptl' configuration option in sip.conf to allow
the administrator to override the value supplied by the remote endpoint and
supply a value that allows T.38 FAX transmissions to be successful with that
endpoint. In addition, in any SIP call where the override takes effect, a debug
message will be printed to that effect. This patch also removes the
T38FaxMaxDatagram configuration option from udptl.conf.sample, since it has not
actually had any effect for a number of releases.

In addition, this patch cleans up the T.38 documentation in sip.conf.sample
(which incorrectly documented that T.38 support was passthrough only).

(issue #15586)
Reported by: globalnetinc


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@222110 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-10-05 19:45:00 +00:00
Tilghman Lesher c1c25181af Merged revisions 221970 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r221970 | tilghman | 2009-10-02 11:58:03 -0500 (Fri, 02 Oct 2009) | 2 lines
  
  Ensure the result of the hash function is positive.  Negative array offsets suck.
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@221971 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-10-02 16:59:57 +00:00
Tilghman Lesher ba10edfcac Initialize a variable that we check immediately upon startup.
(closes issue #15973)
 Reported by: atis


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@221920 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-10-02 03:04:34 +00:00
Tilghman Lesher bd7ca4b764 One more off-by-one in trunk
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@221781 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-10-02 00:08:21 +00:00
Tilghman Lesher 8c7b3cf738 Merged revisions 221776 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@221777 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-10-01 23:59:15 +00:00
Kevin P. Fleming 19ba91cd22 Remove ability to control T.38 FAX error correction from udptl.conf.
chan_sip has had the ability to control T.38 FAX error correction mode on a per-peer
(or global) basis for a couple of releases now, which is where it should have been
all along. This patch removes the ability to configure it in udptl.conf, but issues
a warning if the user tries to do, telling them to look at sip.conf.sample for how
to configure it now. For any SIP peers that are T.38 enabled in sip.conf, there is
already a default for FEC error correction even if the user does not specify any mode,
so this change will not turn off error correction by default, it will have the same
default value that has been in the udptl.conf sample file.



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@221592 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-10-01 16:16:09 +00:00
Terry Wilson 10ce6cd757 Use rtp properties instead of adding a callback
Thanks, Josh.


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@221278 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-09-30 18:21:03 +00:00
Terry Wilson 865daf4858 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: https://origsvn.digium.com/svn/asterisk/trunk@221266 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-09-30 17:52:30 +00:00
Tilghman Lesher a4ece92018 Merged revisions 221200 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r221200 | tilghman | 2009-09-30 11:55:21 -0500 (Wed, 30 Sep 2009) | 7 lines
  
  Avoid a potential NULL dereference.
  (closes issue #15865)
   Reported by: kobaz
   Patches: 
         20090915__issue15865.diff.txt uploaded by tilghman (license 14)
   Tested by: kobaz
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@221201 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-09-30 16:56:42 +00:00
Mark Michelson 01181a27a0 Fix channel reference leak.
ast_cel_report_event would geet a reference to the
bridged channel. However, certain return paths, such
as if CEL was not enabled, would result in a reference
leak. All return paths now properly unref the channel.

(closes issue #15991)
Reported by: mmichelson



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@220995 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-09-29 21:28:04 +00:00
Mark Michelson cee8c6cd47 Get rid of annoying and cryptic debug messages.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@220920 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-09-29 20:20:48 +00:00
Kevin P. Fleming d04158f5b1 Eliminate unnecessary include of version.h in manager.c.
Including version.h here causes this file to get recompiled after
every commit or update, which is not needed.



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@220496 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-09-25 14:50:29 +00:00
Kevin P. Fleming 8c30540269 Correct sense of logic test committed in revision 220494.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@220495 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-09-25 14:44:40 +00:00
Kevin P. Fleming aabdc575a5 Don't use hash-based lookups for ast_channel_get_by_name_prefix().
ast_channel_get_full() tries to use OBJ_POINTER to optimize name-based
channel lookups, but this will not work properly when the channel's full
name was not supplied; for name-prefix searches, there is no value in
doing a hash-based lookup, and in fact doing so could result in many
channels being skipped.



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@220494 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-09-25 14:38:41 +00:00
Tilghman Lesher 17180120bf Change the default behavior of Set, AGI, and pbx_realtime to 1.6 behavior by default (starting in 1.6.3).
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@220417 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-09-24 22:53:23 +00:00
David Vossel 90746d26f3 fixes tcptls_session memory leak caused by ref count error
(closes issue #15939)
Reported by: dvossel

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



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@220365 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-09-24 20:37:20 +00:00
Jeff Peeler f150b48bc0 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: https://origsvn.digium.com/svn/asterisk/trunk@220344 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-09-24 20:29:51 +00:00
Tilghman Lesher 1cf5422dc8 Merged revisions 220288 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r220288 | tilghman | 2009-09-24 14:39:41 -0500 (Thu, 24 Sep 2009) | 6 lines
  
  Implicitly sending a progress signal breaks some applications.
  Call Progress() in your dialplan if you explicitly want progress to be sent.
  (Reverts change 216430, closes issue #15957)
  Reported by: Pavel Troller on the Asterisk-Dev mailing list
  http://lists.digium.com/pipermail/asterisk-dev/2009-September/039897.html
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@220289 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-09-24 19:41:02 +00:00
Tilghman Lesher 07f9778f5b Merged revisions 219653 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r219653 | tilghman | 2009-09-20 12:52:05 -0500 (Sun, 20 Sep 2009) | 8 lines
  
  Really stop the stream, when ast_closestream() is called.
  (closes issue #15129)
   Reported by: bmh
   Patches: 
         20090918__issue15129.diff.txt uploaded by tilghman (license 14)
   Review:
         https://reviewboard.asterisk.org/r/372/
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@219654 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-09-20 17:55:49 +00:00
Matthew Nicholson b27a54b8de 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: https://origsvn.digium.com/svn/asterisk/trunk@219139 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-09-17 15:18:01 +00:00
Tilghman Lesher 3093ccb619 Merged revisions 219023 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r219023 | tilghman | 2009-09-16 18:21:53 -0500 (Wed, 16 Sep 2009) | 8 lines
  
  Properly deal with quotes in the arguments of '#exec' includes.
  (closes issue #15583)
   Reported by: pkempgen
   Patches: 
         20090726__issue15583.diff.txt uploaded by tilghman (license 14)
         20090726__issue15583-1.4-4.diff.txt uploaded by pkempgen (license 169)
   Tested by: pkempgen
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@219061 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-09-16 23:42:12 +00:00
David Brooks 077b44c43f Merged revisions 218867 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r218867 | dbrooks | 2009-09-16 13:00:45 -0500 (Wed, 16 Sep 2009) | 13 lines
  
  Fixes CID pattern matching behavior to mirror that of extension pattern matching.
  
  Pattern matching for extensions uses a type of scoring system, giving values for
  specificity to each character in the pattern. Unfortunately, this is done character
  by character, in order. This does lead to some less specific patterns being first
  in line for matching, but it will usually get the job done.
  
  This patch merely brings CID matching to the same level as extension matching.
  This patch does not attempt to tackle the problem shared by extension matching.
  
  (closes issue #14708)
  Reported by: klaus3000
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@218868 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-09-16 18:06:42 +00:00
Joshua Colp 3031ca468d Do not attempt to add a parking extension if an error occurred while reading the configuration.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@218295 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-09-14 18:16:39 +00:00