Commit Graph

550 Commits

Author SHA1 Message Date
Kevin P. Fleming 166b4e2b30 Multiple revisions 369001-369002
........
  r369001 | kpfleming | 2012-06-15 10:56:08 -0500 (Fri, 15 Jun 2012) | 11 lines
  
  Add support-level indications to many more source files.
  
  Since we now have tools that scan through the source tree looking for files
  with specific support levels, we need to ensure that every file that is
  a component of a 'core' or 'extended' module (or the main Asterisk binary)
  is explicitly marked with its support level. This patch adds support-level
  indications to many more source files in tree, but avoids adding them to
  third-party libraries that are included in the tree and to source files
  that don't end up involved in Asterisk itself.
........
  r369002 | kpfleming | 2012-06-15 10:57:14 -0500 (Fri, 15 Jun 2012) | 3 lines
  
  Add a script to enable finding source files without support-levels defined.
........

Merged revisions 369001-369002 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@369013 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-06-15 16:20:16 +00:00
Richard Mudgett f8746d0009 Allow non-normal execution routines to be able to run on hungup channels.
* Make non-normal dialplan execution routines be able to run on a hung up
channel.  This is preparation work for hangup handler routines.

* Fixed ability to support relative non-normal dialplan execution
routines.  (i.e., The context and exten are optional for the specified
dialplan location.) Predial routines are the only non-normal routines that
it makes sense to optionally omit the context and exten.  Setting a hangup
handler also needs this ability.

* Fix Return application being able to restore a dialplan location
exactly.  Channels without a PBX may not have context or exten set.

* Fixes non-normal execution routines like connected line interception and
predial leaving the dialplan execution stack unbalanced.  Errors like
missing Return statements, popping too many stack frames using StackPop,
or an application returning non-zero could leave the dialplan stack
unbalanced.

* Fixed the AGI gosub application so it cleans up the dialplan execution
stack and handles the autoloop priority increments correctly.

* Eliminated the need for the gosub_virtual_context return location.

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@368985 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-06-14 23:22:53 +00:00
Richard Mudgett 72eb8eb1e7 Fix deadlock potential with ast_set_hangupsource() calls.
Calling ast_set_hangupsource() with the channel lock held can result in a
deadlock because the function also locks the bridged channel.

(issue ASTERISK-19537)

(closes issue AST-891)
Reported by: Guenther Kelleter
Tested by: Guenther Kelleter

(closes issue ASTERISK-19801)
Reported by: Alec Davis
........

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@368772 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-06-11 17:34:08 +00:00
Richard Mudgett 8b2412db28 Tweak ast_channel_softhangup_withcause_locked() to take a typed parameter.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@368712 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-06-08 20:49:00 +00:00
Mark Michelson c6a2cbab19 Remove some extra debugging I forgot to remove in the merge of Digium phone support.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@368455 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-06-04 20:40:12 +00:00
Mark Michelson 14a985560e Merge changes dealing with support for Digium phones.
Presence support has been added. This is accomplished by
allowing for presence hints in addition to device state
hints. A dialplan function called PRESENCE_STATE has been
added to allow for setting and reading presence. Presence
can be transmitted to Digium phones using custom XML
elements in a PIDF presence document.

Voicemail has new APIs that allow for moving, removing,
forwarding, and playing messages. Messages have had a new
unique message ID added to them so that the APIs will work
reliably. The state of a voicemail mailbox can be obtained
using an API that allows one to get a snapshot of the mailbox.
A voicemail Dialplan App called VoiceMailPlayMsg has been
added to be able to play back a specific message.

Configuration hooks have been added. Configuration hooks
allow for a piece of code to be executed when a specific
configuration file is loaded by a specific module. This is
useful for modules that are dependent on the configuration
of other modules.

chan_sip now has a public method that allows for a custom
SIP INFO request to be sent mid-dialog. Digium phones use
this in order to display progress bars when files are played.

Messaging support has been expanded a bit. The main
visible difference is the addition of an AMI action
MessageSend.

Finally, a ParkingLots manager action has been added in order
to get a list of parking lots.



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@368435 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-06-04 20:26:12 +00:00
Richard Mudgett c1bbe79748 Fix potential deadlock between masquerade and chan_local.
* Restructure ast_do_masquerade() to not hold channel locks while it calls
ast_indicate().

* Simplify many calls to ast_do_masquerade() since it will never return a
failure now.  If it does fail internally because a channel driver callback
operation failed, the only thing ast_do_masquerade() can do is generate a
warning message about strange things may happen and press on.

* Fixed the call to ast_bridged_channel() in ast_do_masquerade().  This
change fixes half of the deadlock reported in ASTERISK-19801 between
masquerades and chan_iax.

(closes issue ASTERISK-19537)
Reported by: rmudgett
Tested by: rmudgett

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

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@368421 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-06-04 19:46:33 +00:00
Terry Wilson c7f2d02ef1 Fix race condition for CEL LINKEDID_END event
This patch fixes to situations that could cause the CEL LINKEDID_END event to
be missed.

1) During a core stop gracefully, modules are unloaded when ast_active_channels
== 0. The LINKDEDID_END event fires during the channel destructor. This means
that occasionally, the cel_* module will be unloaded before the channel is
destroyed. It seemed generally useful to wait until the refcount of all
channels == 0 before unloading, so I added a channel counter and used it in the
shutdown code.

2) During a masquerade, ast_channel_change_linkedid is called. It calls
ast_cel_check_retire_linkedid which unrefs the linkedid in the linkedids
container in cel.c. It didn't ref the new linkedid. Now it does. 

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

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@367309 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-05-22 17:29:12 +00:00
Richard Mudgett c857131945 Made ast_queue_hangup() and ast_queue_hangup_with_cause() lock instead of trylock.
It made no sense to trylock the channel and then unconditionally lock the
channel right after.


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@367227 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-05-21 22:45:41 +00:00
Kinsey Moore 8e875bf298 Make the new SIP_CAUSE backend behave more like the original SIP_CAUSE
There was a slight discrepancy in the behaviors of the old SIP_CAUSE and the
new SIP_CAUSE/HANGUPCAUSE when a channel had been originated and had not yet
been answered. This caused the noload_res_srtp_attempt_srtp test to fail since
the SIP_CAUSE variable was never actually set. This behavior has been restored.


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@366843 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-05-17 16:30:50 +00:00
Jonathan Rose cd37bec058 logger: Adds additional support for call id logging and chan_sip specific stuff
This patch improves the handling of call id logging significantly with regard
to transfers and adding APIs to better handle specific aspects of logging.
Also, changes have been made to chan_sip in order to better handle the creation
of callids and to enable the monitor thread to bind itself to a particular
call id when a dialog is determined to be related to a callid. It then unbinds
itself before returning to normal monitoring.

review: https://reviewboard.asterisk.org/r/1886/


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@366842 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-05-17 16:28:20 +00:00
Kinsey Moore b5a6de76fc Commit framework for HANGUPCAUSE (replacement for SIP_CAUSE)
This is the starting point for the Asterisk 11: Who Hung Up work and provides
a framework which will allow channel drivers to report the types of hangup
cause information available in SIP_CAUSE without incurring the overhead of the
MASTER_CHANNEL dialplan function. The initial implementation only includes
cause generation for chan_sip and does not include cause code translation
utilities.

This change deprecates SIP_CAUSE and replaces its method of reporting cause
codes with the new framework. This change also deprecates the 'storesipcause'
option in sip.conf.

Review: https://reviewboard.asterisk.org/r/1822/
(Closes issue SWP-4221)


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@366408 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-05-14 19:44:27 +00:00
Richard Mudgett 2161d6870c * Made ast_change_name() hold the channels container lock while changing the channel name.
* Eliminate redundant list not empty check in clone_variables().
........

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@366242 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-05-10 23:49:07 +00:00
Richard Mudgett 4ea636c776 Run predial routine on local;2 channel where you would expect.
Before this patch, the predial routine executes on the ;1 channel of a
local channel pair.  Executing predial on the ;1 channel of a local
channel pair is of limited utility.  Any channel variables set by the
predial routine executing on the ;1 channel will not be available when the
local channel executes dialplan on the ;2 channel.

* Create ast_pre_call() and an associated pre_call() technology callback
to handle running the predial routine.  If a channel technology does not
provide the callback, the predial routine is simply run on the channel.

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@366183 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-05-10 21:29:41 +00:00
Kinsey Moore dd81b047db Resolve FORWARD_NULL static analysis warnings
This resolves core findings from ASTERISK-19650 numbers 0-2, 6, 7, 9-11, 14-20,
22-24, 28, 30-32, 34-36, 42-56, 82-84, 87, 89-90, 93-102, 104, 105, 109-111,
and 115. Finding numbers 26, 33, and 29 were already resolved.  Those skipped
were either extended/deprecated or in areas of code that shouldn't be
disturbed.

(Closes issue ASTERISK-19650)
........

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@366169 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-05-10 20:56:09 +00:00
Olle Johansson 7aa0c3c64b Make it possible to change the minimum DTMF duration in asterisk.conf
Asterisk has a setting for the minimum allowed DTMF. If we get shorter
DTMF tones, these will be changed to the minimum on the outbound call
leg. 

(closes issue ASTERISK-19772)

Review: https://reviewboard.asterisk.org/r/1882/
Reported by: oej
Tested by: oej
Patches by: oej

Thanks to the reviewers.

1.8 branch for this patch: agave-dtmf-duration-asterisk-conf-1.8



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@363558 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-04-25 09:32:21 +00:00
Olle Johansson db2b162e8c Formatting fixes
Found a small amount of curly brackets in my hotel room here in Denmark.
I hereby donate them to the Asterisk project.


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@363480 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-04-25 08:02:52 +00:00
Richard Mudgett 73f48997f9 Add original party id and reason support.
ISDN ETSI PTP and Q.SIG (And SS7 in future) have support for reporting who
was the original redirecting party of a call.

* Added support for the original redirecting party and reason to the
REDIRECTING function and the system core as well as to the stubbed
locations in sig_pri.c.

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@362779 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-04-20 00:57:13 +00:00
Jonathan Rose e96a59acfd Replace GNU old-style field designator extensions to fix clang warnings
(issue ASTERISK-19540)
Reported by: Makoto Dei
Patches:
	clang-gnu-designator.patch uploaded by Makoto Dei (license 5027)
........
Also add from the patch the portion in res_fax_spandsp that didn't apply to 1.8

Merged revisions 361142 from http://svn.asterisk.org/svn/asterisk/branches/1.8
(closes issue ASTERISK-19540)
........

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@361155 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-04-04 18:08:28 +00:00
Mark Murawki e4252eac10 Allow the Hangup manager action to match channels by regex
* Hangup now can take a regular expression as the Channel option.  If you want
  to hangup multiple channels, use /regex/ as the Channel option.  Existing
  behavior to hanging up a single channel is unchanged, but if you pass a regex,
  the manager will send you a list of channels back that were hung up.

(closes issue ASTERISK-19575)
Reported by: Mark Murawski
Tested by: Mark Murawski



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@361038 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-04-03 19:31:25 +00:00
Richard Mudgett 721f92058f Make number not available presentation also set screening to network provided.
Q.951 indicates that when the presentation indicator is "Number not
available due to interworking" for a number then the screening indicator
field should be "Network provided".

* Made ast_party_id_presentation() return AST_PRES_NUMBER_NOT_AVAILABLE
when the presentation is "Number not available due to interworking".  This
fix makes Asterisk consistent and it also makes it consistent with earlier
branches as far as this presentation value is concerned.

* Made pri_to_ast_presentation() and ast_to_pri_presentation() conversions
handle the "Number not available due to interworking" case better in
sig_pri.c.  This change is possible because the minimum required libpri
version (v1.4.11) has the necessary defines in libpri.h.
........

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@360311 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-03-24 00:40:51 +00:00
Kinsey Moore c5b3db1956 Kill off red blobs in most of main/*
Everything still compiled after making these changes, so I assume these
whitespace-only changes didn't break anything (and shouldn't have).


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@360190 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-03-22 19:51:16 +00:00
Richard Mudgett 9b31bd3cd8 Fix deadlock potential with some ast_indicate/ast_indicate_data calls.
Calling ast_indicate()/ast_indicate_data() with the channel lock held can
result in a deadlock with a local channel because of how local channels
need to avoid deadlock.
........

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@359455 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-03-14 22:38:29 +00:00
Richard Mudgett 2019a7e6b9 Fix Dial m and r options and forked calls generating warnings for voice frames.
When connected line support was added, the wait_for_answer() variable
single changed its meaning slightly.  Unfortunately, the places where
single was used did not necessarily get updated to reflect that change.
Also audio/video frames were sent to all forked calls when the endpoints
were never made compatible.

* Don't pass audio/video media frames when the channels have not been made
compatible.

* Added handling of AST_CONTROL_SRCCHANGE to app_dial.c.

* Fixed app_dial.c passing on AST_CONTROL_HOLD because that frame can also
pass a requested MOH class.

(closes issue ASTERISK-16901)
Reported by: Chris Gentle

(closes issue ASTERISK-17541)
Reported by: clint

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

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@359357 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-03-14 17:39:45 +00:00
Terry Wilson 786f5898d1 Finalize ast_channel opaquification
Review: https://reviewboard.asterisk.org/r/1786/


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@358907 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-03-13 18:20:34 +00:00
Richard Mudgett 73ec67e008 Fix crash caused by opaquification change -r356042.
The set_format() function was more subtle in how it modified the
struct ast_channel readtrans/writetrans values.

* Fixed ast_activate_generator() conversion correctly.

(closes issue ASTERISK-19434)
Reported by: Birger Harzenetter
Tested by: rmudgett


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@358861 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-03-13 17:01:55 +00:00
Richard Mudgett 9926662aba Remove ISDN hold restriction for non-bridged calls.
The check if an ISDN call is bridged before it could be placed on hold is
not necessary and is overly restrictive.  The check was originally done to
prevent problems with call transfers in case a user tried to transfer a
call connected to an application to another call connected to an
application.  The ISDN transfer code has not required this restriction for
quite some time because ECT could transfer any two active calls to each
other.

* Remove ISDN hold restriction for calls connected to applications.

* Made ast_waitfordigit_full() ignore AST_CONTROL_HOLD and
AST_CONTROL_UNHOLD instead of generating a warning message.

(closes issue ASTERISK-19388)
Reported by: Birger Harzenetter
Tested by: rmudgett
........

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@357896 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-03-02 18:38:49 +00:00
Mark Michelson fc558d28f2 Fix race condition that can cause important control frames (such as a hangup) to be missed.
This takes two actions.

1. Move the reading of the alertpipe in __ast_read() to immediately before the
removal of frames from the readq. This means we won't do something silly like
read from the alertpipe, then ignore the fact that there's a frame to get from
the readq since channel's fdno is the AST_TIMING_FD.

2. When ast_settimeout() sets the rate to 0 and the timingfunc to NULL, if the
channel's fdno is the AST_TIMING_FD, then set the fdno to -1. This is because
if the rate is 0 and the timingfunc is NULL, it means that the channel's timing
fd is being invalidated, so any pending reads should not occur.

This may actually solve more issues than the referenced one below, but it's not
known at this time for sure.

(closes issue ASTERISK-19223)
reported by Frank-Michael Wittig

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

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@357775 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-03-02 01:33:06 +00:00
Terry Wilson 0e5c761c28 Opaquify ast_channel typedefs, fd arrays, and softhangup flag
Review: https://reviewboard.asterisk.org/r/1784/


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@357721 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-03-01 22:09:18 +00:00
Terry Wilson a9d607a357 Opaquify ast_channel structs and lists
Review: https://reviewboard.asterisk.org/r/1773/


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@357542 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-02-29 16:52:47 +00:00
Richard Mudgett e063fa6b3f Fix REF_DEBUG compile errors.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@357404 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-02-28 20:34:11 +00:00
Richard Mudgett ae07610d73 Fix ast_channel allocation init setting priority to -1 instead of 1.
* Fix opaquification conversion error.

(closes issue ASTERISK-19424)
Reported by: Jeremy Pepper
Patches:
      asterisk-19424-initialize_priority_regression.diff (license #5026) patch uploaded by Michael L. Young


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@357101 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-02-28 00:17:19 +00:00
Richard Mudgett 890717f305 Fix callerid of Originated calls.
Thanks to Matt Riddell for tracking this down.

(closes issue ASTERISK-19385)
Reported by: ornix
........

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@357096 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-02-27 23:42:12 +00:00
Kinsey Moore 1fac2fba4b Deprecated macro usage for connected line, redirecting, and CCSS
This commit adds GoSub alternatives to connected line, redirecting, and CCSS
macro hooks so that macro can finally be deprecated.  This also adds
deprecation warnings for those features when used and in documentation.

Review: https://reviewboard.asterisk.org/r/1760/
(closes issue SWP-4256)


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@357013 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-02-27 16:50:19 +00:00
Terry Wilson ebaf59a656 Opaquification for ast_format structs in struct ast_channel
Review: https://reviewboard.asterisk.org/r/1770/


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@356573 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-02-24 00:32:20 +00:00
Terry Wilson 3a9ac7c10c Rename ast_channel_emulate_dtmf_digit* funcs
The accessors names for the "emulate_dtmf_digit" field on the ast_channel
are misleading. Change them to ast_channel_dtmf_digit_to_emulate*.


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@356183 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-02-22 00:35:54 +00:00
Terry Wilson c25a442dfb Fix some opaquification-related compiler warnings
(closes issue ASTERISK-19419)
PseudoReview - seanbright on IRC


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@356152 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-02-21 20:17:52 +00:00
Terry Wilson 57f42bd74f ast_channel opaquification of pointers and integral types
Review: https://reviewboard.asterisk.org/r/1753/


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@356042 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-02-20 23:43:27 +00:00
Terry Wilson 34c55e8e7c Opaquify char * and char[] in ast_channel
Review: https://reviewboard.asterisk.org/r/1733/


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@354968 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-02-13 17:27:06 +00:00
Russell Bryant 747cd61edf Remove some unnecessary locking from ast_hangup().
This patch removes some unnecessary locking of the channels container in
ast_hangup().  The reason this came up is that this lock can very quickly block
the entire system.  If any of the channel cleanup code decides to block, it
causes a problem for the whole system.  For example, when audiohooks get
destroyed, if that blocks for a while waiting on the mixmonitor thread to exit
because it's busy blocking on some I/O, it causes a problem for many other
threads in the meantime.

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

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@354494 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-02-09 02:28:18 +00:00
Richard Mudgett 23bc964e1c Constify some more channel driver technology callback parameters.
Review: https://reviewboard.asterisk.org/r/1707/


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@353685 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-02-01 19:53:38 +00:00
Richard Mudgett a99b3c817b Fix ExtenSpy and simplify the channel search functions.
When ast_channel name was opaquified, the channel search functions did not
get converted correctly.  As a result ExtenSpy which uses a channel
iterator search by exten@context could never find anything.

* Updated the doxygen documentation for the search functions in channel.h.

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


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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@352348 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-01-24 20:12:09 +00:00
Terry Wilson 9748f19e96 Always treat arguments to get_by_name_cb as strings
Initially, support was left in for the old style of searching, even
though it wasn't actually used. In the case of name_len != 0, the
OBJ_KEY flag isn't passed because we aren't matching on a full key
and therefor can't use the hash function to optimize. The code left
in to support the old way of searching unfortunately treated a prefix
search like this as though an ast_channel struct was passed as an arg
and caused a crash.

This patch also adds needed parentheses around some matching conditions.

(closes issue ASTERISK-19182)


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

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

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

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@350223 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-01-09 22:15:50 +00:00
Richard Mudgett be74e6f16e Clean-up on isle five for __ast_request_and_dial() and ast_call_forward().
* Add locking when a channel inherits variables and datastores in
__ast_request_and_dial() and ast_call_forward().  Note: The involved
channels are not active so there was minimal potential for problems.

* Remove calls to ast_set_callerid() in __ast_request_and_dial() and
ast_call_forward() because the set information is for the wrong direction.

* Don't use C++ keywords for variable names in ast_call_forward().

* Run the redirecting interception macro if defined when forwarding a call
in ast_call_forward().  Note: Currently will never execute because the
only callers that supply a calling channel supply a hungup or zombie
channel.

* Make feature_request_and_dial() put the transferee into autoservice when
it calls ast_call_forward() in case a redirection interception macro is
run.  Note: Currently will never happen because the caller channel (Party
B) is always hungup at this time.

* Make feature_request_and_dial() ignore the AST_CONTROL_PROCEEDING frame
to silence a log message.
........

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@348466 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-12-16 23:58:44 +00:00
Richard Mudgett e71bad4958 Fix cut and past error in ast_call_forward().
(issue ASTERISK-18836)
........

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@348408 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-12-16 21:30:35 +00:00
Richard Mudgett b05d4603c4 Fix crash during CDR update.
The ast_cdr_setcid() and ast_cdr_update() were shown in ASTERISK-18836 to
be called by different threads for the same channel.  The channel driver
thread and the PBX thread running dialplan.

* Add lock protection around CDR API calls that access an ast_channel
pointer.

(closes issue ASTERISK-18836)
Reported by: gpluser

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

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@348364 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-12-16 21:10:19 +00:00
Terry Wilson 59d6db63bd Don't read past end of input when calling write()
int blah = 1;
...
write(chan->alertpipe[1], &blah, new_frames * sizeof(blah)) !=
(new_frames * sizeof(blah)))

is only valid when new_frames == 1. Otherwise we start reading into adjacent
variables declared on the stack. The read end discards what is read, so the
values don't matter but it's not a good idea to read past where we want even
though new_frames is almost always 1 and should never be large. This patch is
basically taken out of kpfleming's eventfd branch, as he mentioned that he
remembered fixing it there when I talked to him about this issue.

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

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@345165 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-11-14 19:12:49 +00:00
Terry Wilson 19d3e269f6 Avoid unnecessary WARNING message
Add AST_CONTROL_UPDATE_RTP_PEER frame to be ignored here to avoid
displaying a WARNING message.

(closes issue ASTERISK-18610)
 Patch by: Kristijan_Vrban
........

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@340880 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-10-14 16:45:19 +00:00
Tzafrir Cohen 1ec8a9d896 Update SHA1 code to RFC 6234
RFC 6234 is an update to RFC 3174 from which the code was originally taken.
It has a slightly better code, and a better phrased license (simple 3-clause
BSD).

* main/sha1.c is sha1.c from RFC 6234 with formatting changes only.
* include/asterisk/sha1.h merges sha.h and sha-private.h from RFC 6234.
* Removed unused include of asterisk/sha1.h from main/channels.c

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

Merge-From: http://svn.asterisk.org/svn/asterisk/branches/1.8@340263

Merge-From: http://svn.asterisk.org/svn/asterisk/branches/10@340280


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@340283 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-10-11 19:06:29 +00:00
Gregory Nietsky 3935595e43 Merged revisions 337431 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/10

................
  r337431 | irroot | 2011-09-22 08:29:09 +0200 (Thu, 22 Sep 2011) | 25 lines
  
  Merged revisions 337430 via svnmerge from 
  https://origsvn.digium.com/svn/asterisk/branches/1.8
  
  ........
    r337430 | irroot | 2011-09-22 08:18:33 +0200 (Thu, 22 Sep 2011) | 19 lines
    
    Its possible to loose audio on ast_write when the channel is not transcoded correctly.
    in the case of DAHDI the channel is hungup.
    
    This patch tries to "fix" the problem and make the channel compatiable and warn the user of
    this problem.
    
    Please note there is a underlying problem with codec negotion this does not fix the problem
    it does try to rectify it and prevent loss of service.
    
    Review: https://reviewboard.asterisk.org/r/1442/
    
    (closes issue ASTERISK-17541)
    (closes issue ASTERISK-18063)
    (issue ASTERISK-14384)
    (issue ASTERISK-17502)
    (issue ASTERISK-18325)
    (issue ASTERISK-18422)
  ........
................


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@337432 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-09-22 06:39:01 +00:00
Jonathan Rose beae2df26e Merged revisions 336307 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/10

................
  r336307 | jrose | 2011-09-16 16:09:20 -0500 (Fri, 16 Sep 2011) | 20 lines
  
  Merged revisions 336294 via svnmerge from 
  https://origsvn.digium.com/svn/asterisk/branches/1.8
  
  ........
    r336294 | jrose | 2011-09-16 14:53:40 -0500 (Fri, 16 Sep 2011) | 13 lines
    
    Fix bad RTP media bridges in directmedia calls on peers separated by multiple Asterisk nodes.
    
    In a situation involving devices on separate Asterisk trunks, the remote RTP bridge would
    break when starting a call with directmedia. This patch queues a new type of control frame
    so that our RTP bridge loop can properly detect when these situations occur and check to see
    if peers need to be updated in order to send their media to the proper location.
    
    (Closes issue ASTERISK-18340)
    Reported by: Thomas Arimont
    (Closes issue ASTERISK-17725)
    Reported by: kwk
    Tested by: twilson, jrose
  ........
................


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@336311 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-09-16 21:20:02 +00:00
Matthew Nicholson 638f34df7f Merged revisions 335434 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/10

................
  r335434 | mnicholson | 2011-09-12 10:55:48 -0500 (Mon, 12 Sep 2011) | 13 lines
  
  Merged revisions 335433 via svnmerge from 
  https://origsvn.digium.com/svn/asterisk/branches/1.8
  
  ........
    r335433 | mnicholson | 2011-09-12 10:54:41 -0500 (Mon, 12 Sep 2011) | 6 lines
    
    Properly set caller_warning and callee_warning before we try to use them.
    
    ASTERISK-18199
    Patch by: elguero
    Testing by: rtang
  ........
................


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@335435 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-09-12 15:56:27 +00:00
Matthew Jordan 8b5ba33fe0 Merged revisions 335078 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/10

................
  r335078 | mjordan | 2011-09-09 11:27:01 -0500 (Fri, 09 Sep 2011) | 29 lines
  
  Merged revisions 335064 via svnmerge from 
  https://origsvn.digium.com/svn/asterisk/branches/1.8
  
  ........
    r335064 | mjordan | 2011-09-09 11:09:09 -0500 (Fri, 09 Sep 2011) | 23 lines
    
    Updated SIP 484 handling; added Incomplete control frame
    
    When a SIP phone uses the dial application and receives a 484 Address 
    Incomplete response, if overlapped dialing is enabled for SIP, then
    the 484 Address Incomplete is forwarded back to the SIP phone and the
    HANGUPCAUSE channel variable is set to 28.  Previously, the Incomplete
    application dialplan logic was automatically triggered; now, explicit
    dialplan usage of the application is required.
    
    Additionally, this patch adds a new AST_CONTOL_FRAME type called
    AST_CONTROL_INCOMPLETE.  If a channel driver receives this control frame,
    it is an indication that the dialplan expects more digits back from the
    device.  If the device supports overlap dialing it should attempt to 
    notify the device that the dialplan is waiting for more digits; otherwise,
    it can handle the frame in a manner appropriate to the channel driver.
    
    (closes issue ASTERISK-17288)
    Reported by: Mikael Carlsson
    Tested by: Matthew Jordan
    
    Review: https://reviewboard.asterisk.org/r/1416/
  ........
................


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@335079 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-09-09 16:28:23 +00:00
Richard Mudgett ab17a27f97 Merged revisions 334010 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/10

................
  r334010 | rmudgett | 2011-08-31 10:23:11 -0500 (Wed, 31 Aug 2011) | 50 lines
  
  Merged revisions 334009 via svnmerge from 
  https://origsvn.digium.com/svn/asterisk/branches/1.8
  
  ........
    r334009 | rmudgett | 2011-08-31 10:20:31 -0500 (Wed, 31 Aug 2011) | 43 lines
    
    Call pickup race leaves orphaned channels or crashes.
    
    Multiple users attempting to pickup a call that has been forked to
    multiple extensions either crashes or fails a masquerade with a "bad
    things may happen" message.
    
    This is the scenario that is causing all the grief:
    1) Pickup target is selected
    2) target is marked as being picked up in ast_do_pickup()
    3) target is unlocked by ast_do_pickup()
    4) app dial or queue gets a chance to hang up losing calls and calls
    ast_hangup() on target
    5) SINCE A MASQUERADE HAS NOT BEEN SETUP YET BY ast_do_pickup() with
    ast_channel_masquerade(), ast_hangup() completes successfully and the
    channel is no longer in the channels container.
    6) ast_do_pickup() then calls ast_channel_masquerade() to schedule the
    masquerade on the dead channel.
    7) ast_do_pickup() then calls ast_do_masquerade() on the dead channel
    8) bad things happen while doing the masquerade and in the process
    ast_do_masquerade() puts the dead channel back into the channels container
    9) The "orphaned" channel is visible in the channels list if a crash does
    not happen.
    
    This patch does the following:
    
    * Made ast_hangup() set AST_FLAG_ZOMBIE on a successfully hung-up channel
    and not release the channel lock until that has happened.
    
    * Made __ast_channel_masquerade() not setup a masquerade if either channel
    has AST_FLAG_ZOMBIE set.
    
    * Fix chan_agent misuse of AST_FLAG_ZOMBIE since it would no longer work.
    
    (closes issue ASTERISK-18222)
    Reported by: Alec Davis
    Tested by: rmudgett, Alec Davis, irroot, Karsten Wemheuer
    
    (closes issue ASTERISK-18273)
    Reported by: Karsten Wemheuer
    Tested by: rmudgett, Alec Davis, irroot, Karsten Wemheuer
    
    Review: https://reviewboard.asterisk.org/r/1400/
  ........
................


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@334011 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-08-31 15:25:35 +00:00
Terry Wilson 9d2af5071b Merged revisions 333681 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/10

........
  r333681 | twilson | 2011-08-29 12:28:59 -0500 (Mon, 29 Aug 2011) | 7 lines
  
  Use realtime text when it is negotiated
  
  This patch make use of wirte_text() realtime text instead of
  send_text() if T.140 is in native formats. ASTERISK-17937
  
  Review: https://reviewboard.asterisk.org/r/1356/
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@333689 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-08-29 17:31:40 +00:00
Terry Wilson 5901f2d0b1 Merged revisions 331041 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/10

........
  r331041 | twilson | 2011-08-08 16:12:51 -0500 (Mon, 08 Aug 2011) | 6 lines
  
  Replace AMI Unlink events with Bridge events
  
  A previous update converted some of the Link and Unlink events to
  Bridge events, but a couple of Unlink events were missed. This patch
  rectifies the situation.

  (closes issues ASTERISK-17455)
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@331042 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-08-08 21:16:25 +00:00
Richard Mudgett a5be6a0f85 Merged revisions 330369 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/10

................
  r330369 | rmudgett | 2011-07-30 18:57:56 -0500 (Sat, 30 Jul 2011) | 11 lines
  
  Merged revisions 330368 via svnmerge from 
  https://origsvn.digium.com/svn/asterisk/branches/1.8
  
  ........
    r330368 | rmudgett | 2011-07-30 18:56:29 -0500 (Sat, 30 Jul 2011) | 4 lines
    
    Remove some redundant locking code in ast_do_masquerade().
    
    Also updated some comments.
  ........
................


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@330370 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-07-31 00:05:55 +00:00
Gregory Nietsky 1c0078286e Merged revisions 330312 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/10

................
  r330312 | irroot | 2011-07-30 17:34:41 +0200 (Sat, 30 Jul 2011) | 15 lines
  
  Merged revisions 330311 via svnmerge from 
  https://origsvn.digium.com/svn/asterisk/branches/1.8
  
  ........
    r330311 | irroot | 2011-07-30 17:25:16 +0200 (Sat, 30 Jul 2011) | 9 lines
    
    prevent double masqurading channels when one is been hung up and deadlock avoidance is used.
    
    There is a race condition in ast_do_masquerade / ast_hangup (at least)
    
    Reported by me signed off by schmidts with input from David Vossel
    
    Review: https://reviewboard.asterisk.org/r/1323/
  ........
................


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@330313 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-07-30 15:54:23 +00:00
David Vossel 513c680b8c Adds pass-through support for codec CELT.
This patch adds pass-through support for CELT.  CELT
formats are defined in codecs.conf and can be configured
to any sample rate a CELT endpoint supports.  This patch also
addresses a crash in channel.c resulting from a frame list being
freed incorrectly.  This crash was discovered while testing a CELT
translator which had to split encoded audio into multiple frames.
The codec translator is not a part of this patch, but may be
contributed in the future.

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@326855 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-07-07 19:39:17 +00:00
Matthew Nicholson 1da3304813 Merged revisions 325545 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.8

........
  r325545 | mnicholson | 2011-06-29 11:18:39 -0500 (Wed, 29 Jun 2011) | 2 lines
  
  make framehooks prevent native bridging (for real this time)
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@325547 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-06-29 16:19:01 +00:00
Terry Wilson 34e2305ae7 Merged revisions 324048 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.8

........
  r324048 | twilson | 2011-06-16 17:35:41 -0500 (Thu, 16 Jun 2011) | 8 lines
  
  Lock the channel before calling the setoption callback
  
  The channel needs to be locked before calling these callback functions. Also,
  sip_setoption needs to lock the pvt and a check p->rtp is non-null before using
  it.
  
  Review: https://reviewboard.asterisk.org/r/1220/
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@324050 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-06-16 22:49:49 +00:00
Leif Madsen dafa8a659b Merged revisions 323213 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.8

........
  r323213 | lmadsen | 2011-06-13 15:51:52 -0400 (Mon, 13 Jun 2011) | 6 lines
  
  Avoid dividing by zero with L() option to Dial()
  
  Reported by: nicolasom
  Patches:
      
  issue-17995.patch - nicolasom (License #5994)
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@323214 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-06-13 19:54:27 +00:00
Russell Bryant 3f4d0e8743 Support routing text messages outside of a call.
Asterisk now has protocol independent support for processing text messages
outside of a call.  Messages are routed through the Asterisk dialplan.
SIP MESSAGE and XMPP are currently supported.  There are options in sip.conf
and jabber.conf that enable these features.

There is a new application, MessageSend().  There are two new functions,
MESSAGE() and MESSAGE_DATA().  Documentation will be available on
the project wiki, wiki.asterisk.org.

Thanks to Terry Wilson for the assistance with development and to David Vossel
for helping with some additional testing.

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@321546 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-06-01 21:31:40 +00:00
Terry Wilson fc8d4e823c Use va_copy for stringfields
The ast_string_field_build_va functions were written to take to separate
va_lists to work around FreeBSD 4 not having va_copy defined.

In the end, we don't support anything using gcc < 3 anyway because we use
va_copy all over the place anyway. This patch just simplifies things by
removing the second va_list function arguments in favor of va_copy.

Review: https://reviewboard.asterisk.org/r/1233/
--This line, and those below, will be ignored--

M    include/asterisk/stringfields.h
M    main/utils.c
M    main/channel.c


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@320946 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-05-26 15:55:22 +00:00
Richard Mudgett 0096238b52 Merged revisions 320823 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.8

........
  r320823 | rmudgett | 2011-05-25 12:06:38 -0500 (Wed, 25 May 2011) | 18 lines
  
  The AMI Newstate event contains different information between v1.4 and v1.8.
  
  The addition of connected line support in v1.8 changes the behavior of the
  channel caller ID somewhat.  The channel caller ID value no longer time
  shares with the connected line ID on outgoing call legs.  The timing of
  some AMI events/responses output the connected line ID as caller ID.
  These party ID's are now separate.
  
  * The ConnectedLineNum and ConnectedLineName headers were added to many
  AMI events/responses if the CallerIDNum/CallerIDName headers were also
  present.
  
  (closes issue #18252)
  Reported by: gje
  Tested by: rmudgett
  
  Review: https://reviewboard.asterisk.org/r/1227/
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@320825 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-05-25 17:14:11 +00:00
Richard Mudgett a42bf8cc92 Merged revisions 320796 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.8

........
  r320796 | rmudgett | 2011-05-25 11:23:11 -0500 (Wed, 25 May 2011) | 17 lines
  
  Give zombies a safe channel driver to use.
  
  Recent crashes from zombie channels suggests that they need a safe home to
  goto.  When a masquerade happens, the physical part of the zombie channel
  is hungup.  The hangup normally sets the channel private pointer to NULL.
  If someone then blindly does a callback to the channel driver, a crash is
  likely because the private pointer is NULL.
  
  The masquerade now sets the channel technology of zombie channels to the
  kill channel driver.
  
  Related to the following issues:
  (issue #19116)
  (issue #19310)
  
  Review: https://reviewboard.asterisk.org/r/1224/
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@320820 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-05-25 16:50:38 +00:00
Richard Mudgett ae091d166a Merged revisions 320057 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.8

........
  r320057 | rmudgett | 2011-05-20 11:43:02 -0500 (Fri, 20 May 2011) | 19 lines
  
  Crash while transferring a call during DTMF feature timeout.
  
  When a call is being attended transferred during the time between
  AST_FRAME_DTMF_BEGIN and AST_FRAME_DTMF_END, the transferred channel
  becomes a zombie (so tech data is not available), making ast_dtmf_stream()
  segfault when it tries to send the DTMF digit (at least with SIP
  channels).
  
  Patch based on feature-end-zombie.patch uploaded by Irontec (license 1256)
  
  * Check for zombies when ast_channel_bridge() returns.
  
  * Guarantee that the fo parameter value is initialized in
  ast_channel_bridge() before any returns.
  
  (closes issue #19116)
  Reported by: Irontec
  Tested by: rmudgett
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@320058 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-05-20 16:46:02 +00:00
Brett Bryant 475ef22b20 Merged revisions 318921 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.8

........
  r318921 | bbryant | 2011-05-13 14:09:34 -0400 (Fri, 13 May 2011) | 8 lines
  
  Fixes a segmentation fault in dynamic hints when a channel technology isn't
  loaded for a hint.
  
  (closes issue #18495)
  Reported by: bertrand
  Tested by: bertrand
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@318922 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-05-13 18:10:45 +00:00
Matthew Nicholson 5b77bb5060 Merged revisions 318142 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.8

........
  r318142 | mnicholson | 2011-05-09 09:09:38 -0500 (Mon, 09 May 2011) | 9 lines
  
  Make indicate/control frames WRITE events on framehooks.  Also, if a framehook
  returns a non-control frame, don't forward it to the channel.
  
  (closes issue #19251)
  Reported by: irroot
  Patches:
        (modified) framehook_indicate.patch2 uploaded by irroot (license 52)
  Tested by: irroot
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@318143 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-05-09 14:11:57 +00:00
David Vossel f4417923ce Merged revisions 316334 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.8

........
  r316334 | dvossel | 2011-05-03 17:05:59 -0500 (Tue, 03 May 2011) | 8 lines
  
  Fixes framehook segfault on indicate
  
  (closes issue #19215)
  Reported by: irroot
  Patches: 
        framehook_indicate.patch uploaded by irroot (license 52)
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@316335 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-05-03 22:07:18 +00:00
Russell Bryant 37aa52fd78 Merged revisions 316265 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.8

........
  r316265 | russell | 2011-05-03 14:55:49 -0500 (Tue, 03 May 2011) | 5 lines
  
  Fix a bunch of compiler warnings generated by gcc 4.6.0.
  
  Most of these are -Wunused-but-set-variable, but there were a few others
  mixed in here, as well.
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@316293 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-05-03 20:45:32 +00:00
David Vossel 237d47b010 Clears exception flag during ast_read when func_jitterbuffer is enabled
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@315855 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-04-27 17:44:02 +00:00
David Vossel 7f23115ad2 New HD ConfBridge conferencing application.
Includes a new highly optimized and customizable
ConfBridge application capable of mixing audio at
sample rates ranging from 8khz-192khz.

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



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@314598 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-04-21 18:11:40 +00:00
David Vossel 18d591cb48 Introduction of the JITTERBUFFER dialplan function.
Review: https://reviewboard.asterisk.org/r/1157/


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@314509 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-04-20 20:52:15 +00:00
Richard Mudgett c16d39ea83 Merged revisions 313588 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.8

................
  r313588 | rmudgett | 2011-04-13 11:31:50 -0500 (Wed, 13 Apr 2011) | 55 lines
  
  Merged revisions 313579 via svnmerge from 
  https://origsvn.digium.com/svn/asterisk/branches/1.6.2
  
  ................
    r313579 | rmudgett | 2011-04-13 11:29:49 -0500 (Wed, 13 Apr 2011) | 48 lines
    
    Merged revisions 313545 via svnmerge from 
    https://origsvn.digium.com/svn/asterisk/branches/1.4
    
    ........
      r313545 | rmudgett | 2011-04-13 11:21:24 -0500 (Wed, 13 Apr 2011) | 41 lines
      
      Asterisk does not hangup a channel after endpoint hangs up.
      
      If the call that the dialplan started an AGI script for is hungup while
      the AGI script is in the middle of a command then the AGI script is not
      notified of the hangup.  There are many AGI Exec commands that this can
      happen with.  The reported applications have been: Background, Wait, Read,
      and Dial.  Also the AGI Get Data command.
      
      * Don't wait on the Asterisk channel after it has hung up.  The channel is
      likely to never need servicing again.
      
      * Restored the AGI script's ability to return the AGI_RESULT_HANGUP value
      in run_agi().  It previously only could return AGI_RESULT_SUCCESS or
      AGI_RESULT_FAILURE after the DeadAGI and AGI applications were merged.
      
      (closes issue #17954)
      Reported by: mn3250
      Patches:
            issue17954_v1.8.patch uploaded by rmudgett (license 664)
            issue17954_v1.6.2.patch uploaded by rmudgett (license 664)
            issue17954_v1.4.patch uploaded by rmudgett (license 664)
      Tested by: rmudgett
      JIRA SWP-2171
      
      (closes issue #18492)
      Reported by: devmod
      Tested by: rmudgett
      JIRA SWP-2761
      
      (closes issue #18935)
      Reported by: nvitaly
      Tested by: astmiv, rmudgett
      JIRA SWP-3216
      
      (closes issue #17393)
      Reported by: siby
      Tested by: rmudgett
      JIRA SWP-2727
      
      Review: https://reviewboard.asterisk.org/r/1165/
    ........
  ................
................


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@313606 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-04-13 16:37:06 +00:00
Jason Parker a7bfa10472 Add HangupRequest manager event, to specify when/where a channel gets hung up.
(closes issue #18226)
Reported by: clegall_proformatique
Patches: 
      asterisk_1.8_293157_hanguprequests.svn.patch uploaded by clegall proformatique (license 1139)


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@309300 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-03-02 21:08:39 +00:00
Richard Mudgett 642d6c306c Merged revisions 308903 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.8

........
  r308903 | rmudgett | 2011-02-24 15:38:41 -0600 (Thu, 24 Feb 2011) | 9 lines
  
  Invalid read in ast_channel_set_caller_event().
  
  Valgrind reported that ast_channel_set_caller_event() was reading data
  from a freed buffer when using the pre_set structure.
  
  Rearange things to pre-calculate the name and number pointer before
  updating the caller party structure to see if the name or number was
  changed.
........


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

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@308582 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-02-22 23:04:49 +00:00
Richard Mudgett 49feb747ba Pass a MCID request to the bridged channel.
Pass a MCID request to the bridged channel so the bridged channel can send
it to the network.

The ability to send the MCID request on an ISDN span is enabled with the
new chan_dahdi.conf mcid_send option.

JIRA SWP-2845
JIRA ABE-2736


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@306755 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-02-07 23:33:44 +00:00
Paul Belanger 3556e4c2d4 Replace ast_log(LOG_DEBUG, ...) with ast_debug()
(closes issue #18556)
Reported by: kkm

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


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

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

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



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

................
  r305923 | rmudgett | 2011-02-02 18:24:40 -0600 (Wed, 02 Feb 2011) | 24 lines
  
  Merged revisions 305889 via svnmerge from 
  https://origsvn.digium.com/svn/asterisk/branches/1.6.2
  
  ................
    r305889 | rmudgett | 2011-02-02 18:15:07 -0600 (Wed, 02 Feb 2011) | 17 lines
    
    Merged revisions 305888 via svnmerge from
    https://origsvn.digium.com/svn/asterisk/branches/1.4
    
    ........
      r305888 | rmudgett | 2011-02-02 18:02:43 -0600 (Wed, 02 Feb 2011) | 8 lines
    
      Minor AST_FRAME_TEXT related issues.
    
      * Include the null terminator in the buffer length.  When the frame is
      queued it is copied.  If the null terminator is not part of the frame
      buffer length, the receiver could see garbage appended onto it.
    
      * Add channel lock protection with ast_sendtext().
    
      * Fixed AMI SendText action ast_sendtext() return value check.
    ........
  ................
................


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@305939 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-02-03 00:29:46 +00:00
Russell Bryant 092134399c Merged revisions 303549 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.8

................
  r303549 | russell | 2011-01-24 14:51:37 -0600 (Mon, 24 Jan 2011) | 45 lines
  
  Merged revisions 303548 via svnmerge from 
  https://origsvn.digium.com/svn/asterisk/branches/1.6.2
  
  ................
    r303548 | russell | 2011-01-24 14:49:53 -0600 (Mon, 24 Jan 2011) | 38 lines
    
    Merged revisions 303546 via svnmerge from 
    https://origsvn.digium.com/svn/asterisk/branches/1.4
    
    ........
      r303546 | russell | 2011-01-24 14:32:21 -0600 (Mon, 24 Jan 2011) | 31 lines
      
      Fix channel redirect out of MeetMe() and other issues with channel softhangup.
      
      Mantis issue #18585 reports that a channel redirect out of MeetMe() stopped
      working properly.  This issue includes a patch that resolves the issue by
      removing a call to ast_check_hangup() from app_meetme.c.  I left that in my
      patch, as it doesn't need to be there.  However, the rest of the patch fixes
      this problem with or without the change to app_meetme.
      
      The key difference between what happens before and after this patch is the
      effect of the END_OF_Q control frame.  After END_OF_Q is hit in ast_read(),
      ast_read() will return NULL.  With the ast_check_hangup() removed, app_meetme
      sees this which causes it to exit as intended.  Checking ast_check_hangup()
      caused app_meetme to exit earlier in the process, and the target of the
      redirect saw the condition where ast_read() returned NULL.
      
      Removing ast_check_hangup() works around the issue in app_meetme, but doesn't
      solve the issue if another application did the same thing.  There are also
      other edge cases where if an application finishes at the same time that a
      redirect happens, the target of the redirect will think that the channel hung
      up.  So, I made some changes in pbx.c to resolve it at a deeper level.  There
      are already places that unset the SOFTHANGUP_ASYNCGOTO flag in an attempt to
      abort the hangup process.  My patch extends this to remove the END_OF_Q frame
      from the channel's read queue, making the "abort hangup" more complete.  This
      same technique was used in every place where a softhangup flag was cleared.
      
      (closes issue #18585)
      Reported by: oej
      Tested by: oej, wedhorn, russell
      
      Review: https://reviewboard.asterisk.org/r/1082/
    ........
  ................
................


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@303551 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-01-24 20:57:28 +00:00
Jeff Peeler a307b5407e Merged revisions 301504 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.8

................
  r301504 | jpeeler | 2011-01-12 12:12:08 -0600 (Wed, 12 Jan 2011) | 26 lines
  
  Merged revisions 301503 via svnmerge from 
  https://origsvn.digium.com/svn/asterisk/branches/1.6.2
  
  ................
    r301503 | jpeeler | 2011-01-12 12:11:49 -0600 (Wed, 12 Jan 2011) | 19 lines
    
    Merged revisions 301502 via svnmerge from 
    https://origsvn.digium.com/svn/asterisk/branches/1.4
    
    ........
      r301502 | jpeeler | 2011-01-12 12:10:42 -0600 (Wed, 12 Jan 2011) | 12 lines
      
      Fix CPU spike when pressing DTMF after agent login.
      
      The problem here is that DTMF was being continuously deferred and requeued
      since ast_safe_sleep is called in a loop. There are serveral other places in the
      code that sleeps and then loops in a similar fashion. Because of this fact I
      opted to not defer DTMF any more, which will not affect the original fix:
      
      https://reviewboard.asterisk.org/r/674
      
      (closes issue #18130)
      Reported by: rgj
    ........
  ................
................


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@301505 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-01-12 18:12:31 +00:00
Russell Bryant cc0b7e7df5 Some scheduler API cleanup and improvements.
Previously, I had added the ast_sched_thread stuff that was a generic scheduler
thread implementation.  However, if you used it, it required using different
functions for modifying scheduler contents.  This patch reworks how this is
done and just allows you to optionally start a thread on the original scheduler
context structure that has always been there.  This makes it trivial to switch
to the generic scheduler thread implementation without having to touch any of
the other code that adds or removes scheduler entries.

In passing, I made some naming tweaks to add ast_ prefixes where they were not
there before.

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@299091 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-12-20 17:15:54 +00:00
Jeff Peeler a62958eee9 Merged revisions 297825 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.8

................
  r297825 | jpeeler | 2010-12-07 16:59:30 -0600 (Tue, 07 Dec 2010) | 26 lines
  
  Merged revisions 297824 via svnmerge from 
  https://origsvn.digium.com/svn/asterisk/branches/1.6.2
  
  ................
    r297824 | jpeeler | 2010-12-07 16:58:54 -0600 (Tue, 07 Dec 2010) | 19 lines
    
    Merged revisions 297823 via svnmerge from 
    https://origsvn.digium.com/svn/asterisk/branches/1.4
    
    ........
      r297823 | jpeeler | 2010-12-07 16:57:48 -0600 (Tue, 07 Dec 2010) | 12 lines
      
      Revert code that changed SSRC for DTMF.
      
      Some previous behavior was attempted to be restored, but mistakingly I did
      not realize that the previous behavior was incorrect. This fixes DTMF not
      being detected since DTMF shouldn't cause the SSRC to change.
      
      (related to issue #17404)
      (closes issue #18189)
      (closes issue #18352)
      Reported by: marcbou
      Tested by: cmbaker82
    ........
  ................
................


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@297826 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-12-07 23:00:42 +00:00
Russell Bryant 10f375f839 Merged revisions 296230 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.8

................
  r296230 | russell | 2010-11-24 17:29:44 -0600 (Wed, 24 Nov 2010) | 20 lines
  
  Merged revisions 296221 via svnmerge from 
  https://origsvn.digium.com/svn/asterisk/branches/1.6.2
  
  ................
    r296221 | russell | 2010-11-24 17:28:19 -0600 (Wed, 24 Nov 2010) | 13 lines
    
    Merged revisions 296213 via svnmerge from 
    https://origsvn.digium.com/svn/asterisk/branches/1.4
    
    ........
      r296213 | russell | 2010-11-24 17:26:43 -0600 (Wed, 24 Nov 2010) | 6 lines
      
      Make Asterisk less crashy.
      
      Since we might not put a new translation path on the channel, go ahead and
      set it to NULL right after destroying the old one to ensure we don't try
      to free an invalid translation path later on.
    ........
  ................
................


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@296235 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-11-24 23:30:32 +00:00
Russell Bryant ddd0ae53d2 Merged revisions 296084 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.8

................
  r296084 | russell | 2010-11-24 14:23:46 -0600 (Wed, 24 Nov 2010) | 26 lines
  
  Merged revisions 296083 via svnmerge from 
  https://origsvn.digium.com/svn/asterisk/branches/1.6.2
  
  ................
    r296083 | russell | 2010-11-24 14:23:11 -0600 (Wed, 24 Nov 2010) | 19 lines
    
    Merged revisions 296082 via svnmerge from 
    https://origsvn.digium.com/svn/asterisk/branches/1.4
    
    ........
      r296082 | russell | 2010-11-24 14:22:32 -0600 (Wed, 24 Nov 2010) | 12 lines
      
      Fix false reporting of an error by set_format().
      
      In the case that the native format was able to be changed to match the
      new requested format, the code proceeded to attempt to build a translation
      path, anyway.  The result would be NULL, since no translation path is
      necessary and resulted in this function thinking an error has occurred.
      This case is now specifically caught and no attempt to build a translation
      path is attempted.
      
      Thanks to our automated tests and bamboo.asterisk.org for catching this problem
      and making a whole lot of noise when things started failing.  :-)
    ........
  ................
................


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@296085 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-11-24 20:24:38 +00:00
Russell Bryant 712ba23185 Merged revisions 296002 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.8

................
  r296002 | russell | 2010-11-24 11:13:08 -0600 (Wed, 24 Nov 2010) | 52 lines
  
  Merged revisions 296001 via svnmerge from 
  https://origsvn.digium.com/svn/asterisk/branches/1.6.2
  
  ................
    r296001 | russell | 2010-11-24 11:03:16 -0600 (Wed, 24 Nov 2010) | 45 lines
    
    Merged revisions 296000 via svnmerge from 
    https://origsvn.digium.com/svn/asterisk/branches/1.4
    
    ........
      r296000 | russell | 2010-11-24 10:48:39 -0600 (Wed, 24 Nov 2010) | 38 lines
      
      Handle failures building translation paths more effectively.
      
      The problem scenario occurred on a heavily loaded system that was using the
      codec_dahdi module and exceeded the hardware transcoding capacity.  The failure
      mode at that point was not good.  The report came in to us as an Asterisk
      lock-up.  The "core show locks" shows a ton of threads locked up (but no
      obvious deadlock).  Upon deeper investigation, when the system is in this
      state, the CPU was maxed out.  The CPU was being consumed by the Asterisk
      logger spewing messages on every audio frame for calls set up after transcoder
      capacity was reached.
      
      The purpose of this patch is to make Asterisk handle failures to create a
      translation path in a more graceful manner.  If we can't translate, then the
      call just needs to be dropped, as it's not going to work.  These are the
      changes:
      
      1) In set_format() of channel.c (which is called by set_read_format() and
      set_write_format()), it was ignoring if ast_translator_build_path() failed and
      returned NULL.  It now pays attention to that case and returns a result
      reflecting failure.  With this change in place, the bridging code will
      immediately detect a failure and end the bridge instead of proceeding to try to
      bridge frames that can't be translated and making channel drivers freak out by
      sending them frames in a format they weren't expecting.
      
      2) In ast_indicate_data() of channel.c, failure of ast_playtones_start() was
      ignored.  It is now reflected in the return value of the function.  This didn't
      turn out to have any affect on the bug, but seemed like a good change to leave
      in.
      
      3) In app_dial(), when only sending a call to a single endpoint, it will
      attempt to do some bridging of its own of early audio.  It uses
      make_compatible() when it's going to do this.  However, it ignored failure from
      make compatible.  So, even with the fix from #1, if there was early audio going
      through app_dial, there would still be a period of invalid frames passing
      through.  After detecting failure here, Dial() exits.
      
      ABE-2658
    ........
  ................
................


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@296034 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-11-24 17:23:39 +00:00
Richard Mudgett 7c7486ad19 Merged revisions 295866 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.8

................
  r295866 | rmudgett | 2010-11-22 13:36:10 -0600 (Mon, 22 Nov 2010) | 60 lines
  
  Merged revisions 295843 via svnmerge from 
  https://origsvn.digium.com/svn/asterisk/branches/1.6.2
  
  ................
    r295843 | rmudgett | 2010-11-22 13:28:23 -0600 (Mon, 22 Nov 2010) | 53 lines
    
    Merged revisions 295790 via svnmerge from 
    https://origsvn.digium.com/svn/asterisk/branches/1.4
    
    ........
      r295790 | rmudgett | 2010-11-22 12:46:26 -0600 (Mon, 22 Nov 2010) | 46 lines
      
      The channel redirect function (CLI or AMI) hangs up the call instead of redirecting the call.
      
      To recreate the problem:
      1) Party A calls Party B
      2) Invoke CLI "channel redirect" command to redirect channel call leg
      associated with A.
      3) All associated channels are hung up.
      
      Note that if the CLI command were done on the channel call leg associated
      with B it works.
      
      This regression was a result of the fix for issue #16946
      (https://reviewboard.asterisk.org/r/740/).
      
      The regression affects all features that use an async goto to execute the
      dialplan because of an external event: Channel redirect, AMI redirect, SIP
      REFER, and FAX detection.
      
      The struct ast_channel._softhangup code is a mess.  The variable is used
      for several purposes that do not necessarily result in the call being hung
      up.  I have added doxygen comments to describe how the various _softhangup
      bits are used.  I have corrected all the places where the variable was
      tested in a non-bit oriented manner.
      
      The primary fix is the new AST_CONTROL_END_OF_Q frame.  It acts as a weak
      hangup request so the soft hangup requests that do not normally result in
      a hangup do not hangup.
      
      JIRA SWP-2470
      JIRA SWP-2489
      
      (closes issue #18171)
      Reported by: SantaFox
      (closes issue #18185)
      Reported by: kwemheuer
      (closes issue #18211)
      Reported by: zahir_koradia
      (closes issue #18230)
      Reported by: vmarrone
      (closes issue #18299)
      Reported by: mbrevda
      (closes issue #18322)
      Reported by: nerbos
      
      Review:	https://reviewboard.asterisk.org/r/1013/
    ........
  ................
................


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@295867 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-11-22 19:42:02 +00:00
Richard Mudgett e15582b186 Merged revisions 295282 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.8

................
  r295282 | rmudgett | 2010-11-16 17:02:36 -0600 (Tue, 16 Nov 2010) | 16 lines
  
  Merged revisions 295281 via svnmerge from 
  https://origsvn.digium.com/svn/asterisk/branches/1.6.2
  
  ................
    r295281 | rmudgett | 2010-11-16 16:57:07 -0600 (Tue, 16 Nov 2010) | 9 lines
    
    Merged revisions 295280 via svnmerge from 
    https://origsvn.digium.com/svn/asterisk/branches/1.4
    
    ........
      r295280 | rmudgett | 2010-11-16 16:52:06 -0600 (Tue, 16 Nov 2010) | 1 line
      
      Dead code elimination in channel.c:ast_channel_bridge() variable who.
    ........
  ................
................


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@295283 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-11-16 23:04:55 +00:00
Richard Mudgett e2c8ef9179 Merged revisions 294466 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.8

........
  r294466 | rmudgett | 2010-11-09 16:46:45 -0600 (Tue, 09 Nov 2010) | 1 line
  
  Allow ast_do_masquerade() failure to be reported again.
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@294467 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-11-09 22:52:00 +00:00
Richard Mudgett 3adb425b25 Merged revisions 294349 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.8

........
  r294349 | rmudgett | 2010-11-09 10:55:32 -0600 (Tue, 09 Nov 2010) | 17 lines
  
  Analog lines do not transfer CONNECTED LINE or execute the interception macros.
  
  Add connected line update for sig_analog transfers and simplify the
  corresponding sig_pri and chan_misdn transfer code.
  
  Note that if you create a three-way call in sig_analog before transferring
  the call, the distinction of the caller/callee interception macros make
  little sense.  The interception macro writer needs to be prepared for
  either caller/callee macro to be executed.  The current implementation
  swaps which caller/callee interception macro is executed after a three-way
  call is created.
  
  Review:	https://reviewboard.asterisk.org/r/996/
  
  JIRA ABE-2589
  JIRA SWP-2372
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@294351 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-11-09 17:00:07 +00:00
Jeff Peeler 12a40275f2 Merged revisions 294278 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.8

................
  r294278 | jpeeler | 2010-11-08 15:59:45 -0600 (Mon, 08 Nov 2010) | 23 lines
  
  Merged revisions 294277 via svnmerge from 
  https://origsvn.digium.com/svn/asterisk/branches/1.6.2
  
  ........
    r294277 | jpeeler | 2010-11-08 15:58:13 -0600 (Mon, 08 Nov 2010) | 16 lines
    
    Fix playback failure when using IAX with the timerfd module.
    
    To fix this issue the alert pipe will now be used when the timerfd module is
    in use. There appeared to be a race that was not solved by adding locking in the
    timerfd module, but needed to be there anyway. The race was between the timer
    being put in non-continuous mode in ast_read on the channel thread and the IAX 
    frame scheduler queuing a frame which would enable continuous mode before the
    non-continuous mode event was read. This race for now is simply avoided.
    
    (closes issue #18110)
    Reported by: tpanton
    Tested by: tpanton
    
    I put tested by tpanton because it was tested on his hardware. Thanks for the
    remote access to debug this issue!
  ........
................


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@294279 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-11-08 22:03:54 +00:00
Richard Mudgett 64845d73c7 Merged revisions 292704 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.8

........
  r292704 | rmudgett | 2010-10-22 10:47:08 -0500 (Fri, 22 Oct 2010) | 19 lines
  
  Connected line is not updated when chan_dahdi/sig_pri or chan_misdn transfers a call.
  
  When a call is transfered by ECT or implicitly by disconnect in sig_pri or
  implicitly by disconnect in chan_misdn, the connected line information is
  not exchanged.  The connected line interception macros also need to be
  executed if defined.
  
  The CALLER interception macro is executed for the held call.
  The CALLEE interception macro is executed for the active/ringing call.
  
  JIRA ABE-2589
  JIRA SWP-2296
  
  Patches:
        abe_2589_c3bier.patch uploaded by rmudgett (license 664)
        abe_2589_v1.8_v2.patch uploaded by rmudgett (license 664)
  
  Review: https://reviewboard.asterisk.org/r/958/
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@292705 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-10-22 15:47:56 +00:00
Terry Wilson 1b91e18564 Merged revisions 291581 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.8

................
  r291581 | twilson | 2010-10-13 16:01:56 -0700 (Wed, 13 Oct 2010) | 35 lines
  
  Merged revisions 291580 via svnmerge from 
  https://origsvn.digium.com/svn/asterisk/branches/1.6.2
  
  ................
    r291580 | twilson | 2010-10-13 15:58:43 -0700 (Wed, 13 Oct 2010) | 28 lines
    
    Merged revisions 291577 via svnmerge from 
    https://origsvn.digium.com/svn/asterisk/branches/1.4
    
    ........
      r291577 | twilson | 2010-10-13 15:45:15 -0700 (Wed, 13 Oct 2010) | 21 lines
      
      Don't ignore frames that have been queued when softhangup'd
      
      When an outgoing call is answered and hung up by the far end *very* quickly, we
      may not read any frames and therefor end up with a call that displays the wrong
      disposition/DIALSTATUS. The reason is because ast_queue_hangup() immediately
      sets the _softhangup flag on the channel and then queues the HANGUP control
      frame, but __ast_read refuses to read any frames if ast_check_hangup() indicates
      that a hangup request has been made (which it will if _softhangup is set). So,
      we end up losing control frames.
      
      This change makes __ast_read continue to read frames even if a soft hangup has
      been requested. It queues a hangup frame to make sure that __ast_read() will
      still eventually return NULL.
      
      Much thanks to David Vossel for all of the reviews, discussion, and help!
      
      (closes issue #16946)
      Reported by: davidw
      
      Review: https://reviewboard.asterisk.org/r/740/
    ........
  ................
................


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@291657 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-10-13 23:47:10 +00:00
Jason Parker ce6abd6bf7 Merged revisions 289340 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.8

................
  r289340 | qwell | 2010-09-29 16:12:43 -0500 (Wed, 29 Sep 2010) | 22 lines
  
  Merged revisions 289339 via svnmerge from 
  https://origsvn.digium.com/svn/asterisk/branches/1.6.2
  
  ................
    r289339 | qwell | 2010-09-29 16:03:47 -0500 (Wed, 29 Sep 2010) | 15 lines
    
    Merged revisions 289338 via svnmerge from 
    https://origsvn.digium.com/svn/asterisk/branches/1.4
    
    ........
      r289338 | qwell | 2010-09-29 15:56:26 -0500 (Wed, 29 Sep 2010) | 8 lines
      
      Allow a manager originate to succeed on forwarded devices.
      
      The timeout to wait for an answer was being set to 0 when a device forwarded to another
      extension.  We don't always need the timeout set like this, so make it an optional
      parameter, and don't use it in this case.
      
      ABE-2544
    ........
  ................
................


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@289354 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-09-29 21:19:46 +00:00