Commit Graph

13017 Commits

Author SHA1 Message Date
Jeff Peeler
c9cec47bf0 (closes issue #13173)
Reported by: pep

This change adds an announce_thread responsible for playing announcements to an existing conference. This allows all announcing to be immediately stopped if necessary but more importantly allows other threads that need to play something to not block. There are multiple benefits to this, but the actual bug is for solving the scenario for a channel to be unusable after hang up for the entire duration of the parting announcement. The parting announcement can be extremely long depending on what the user recorded upon joining the conference.

Reviewed by Russell on Review Board:
http://reviewboard.digium.com/r/25/


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@156178 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-11-12 17:53:44 +00:00
Mark Michelson
bd9001e16b When doing some tests, I was having a crash at the end of every call
if an attended transfer occurred during the call. I traced the cause to
the CDR on one of the channels being NULL. murf suggested a check in
the end bridge callback to be sure the CDR is non-NULL before proceeding,
so that's what I'm adding.



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@156167 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-11-12 17:38:33 +00:00
Russell Bryant
96d185b5aa Move the sanity check that makes sure "always fork" is not set along with the
console option to be after the code that reads options from asterisk.conf.  
This resolves a situation where Asterisk can start taking up 100% when
misconfigured.
(Thanks to Bryce Porter (x86 on IRC) for letting me log in to his system to
 figure out what was causing the 100% CPU problem.)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@156164 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-11-12 17:29:52 +00:00
Mark Michelson
abc56833ad Channel drivers assume that when their indicate callback
is invoked, that the channel on which the callback was called
is locked. This patch corrects an instance in chan_agent where
a channel's indicate callback is called directly without first
locking the channel.

This was leading to some observed locking issues in chan_local,
but considering that all channel drivers operate under the
same expectations, the generic fix in chan_agent is the right
way to go.

AST-126



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@155861 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-11-10 21:07:39 +00:00
Tilghman Lesher
52e17f5cf8 I got tired of saying this in every single bugnote referring to this file.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@155803 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-11-10 20:49:59 +00:00
Sean Bright
f2ecc4c80e Use static functions here instead of nested ones. This requires a small
change to the ast_bridge_config struct as well.  To understand the reason
for this change, see the following post:

    http://gcc.gnu.org/ml/gcc-help/2008-11/msg00049.html


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@155553 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-11-09 01:08:07 +00:00
Tilghman Lesher
a0386906cf Clarify error message.
(closes issue #13809)
 Reported by: denke
 Patches: 
       20081104__bug13809.diff.txt uploaded by Corydon76 (license 14)
 Tested by: denke


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@155398 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-11-07 22:27:32 +00:00
Mark Michelson
a5ebe35d26 The documentation listed the ability to set 'maxmsg' per
context. The truth is that you can only set this in the general section
or per mailbox. Thus I am updating the sample config file to be more
accurate.

Thanks to sasargen on IRC for bringing up this issue.



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@155011 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-11-06 19:45:52 +00:00
Mark Michelson
a82f9caadf The logic of a strcasecmp call was reversed
(closes issue #13841)
Reported by: clegall_proformatique



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@154724 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-11-05 16:44:34 +00:00
Steve Murphy
8c352bb9aa This fix was prompted by communication from user, who was seeing thousands of error logs... looks like EAGAIN. Made such uninteresting.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@154685 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-11-05 16:06:53 +00:00
Tilghman Lesher
537f626328 On busy systems, it's possible for the values checked within a single line
of code to change, unless the structure is locked to ensure a consistent
state.
(closes issue #13717)
 Reported by: kowalma
 Patches: 
       20081102__bug13717.diff.txt uploaded by Corydon76 (license 14)
 Tested by: kowalma


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@154365 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-11-04 20:49:33 +00:00
Richard Mudgett
f7c8bfed9c JIRA ABE-1703
mISDN sets the channel to the wrong state when it receives
the indication AST_CONTROL_RINGING.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@154266 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-11-04 19:01:08 +00:00
Tilghman Lesher
66d3d10d8c Make the monitor thread non-detached, so it can be joined (suggested by Russell
on -dev list).


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@154263 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-11-04 18:58:05 +00:00
Tilghman Lesher
799fe53401 Attempting to expunge a mailbox when the mailstream is NULL will crash Asterisk.
(Closes issue #13829)
Reported by: jaroth
Patch by: me (modified jaroth's patch)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@154066 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-11-03 22:27:10 +00:00
Tilghman Lesher
9f7707dae8 Remove the potential for a division by zero error.
(Closes issue #13810)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@154060 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-11-03 21:48:21 +00:00
Kevin P. Fleming
18df35a2c1 somehow missed a bunch of gcc 4.3.x warnings in this branch on the first pass
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@153823 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-11-03 13:01:18 +00:00
Russell Bryant
0d1441526e features.h depends on linkedlists.h, so include it
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@153651 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-11-02 19:51:17 +00:00
Kevin P. Fleming
add5ff5b05 fix a bunch of potential problems found by gcc 4.3.x, primarily bare strings being passed to printf()-like functions and ignored results from read()/write() and friends
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@153337 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-11-01 18:22:39 +00:00
Terry Wilson
705d6f3742 Add end_bridge_callback for app_follome and add AUTOLOOP flag to res_features
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@153270 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-10-31 22:36:57 +00:00
Tilghman Lesher
1c4d34a0f7 Turn off qualify on uncached realtime peers.
(Closes issue #13383)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@153114 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-10-31 16:30:32 +00:00
Terry Wilson
6280e04736 Recent CDR fixes moved execution of the 'h' exten into the bridging code, so variables that were set after ast_bridge_call was called would not show up in the 'h' exten. Added a callback function to handle setting variables, etc. from w/in the bridging code. Calls back into a nested function within the function calling ast_bridge_call
(closes issue #13793)
Reported by: greenfieldtech


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@153095 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-10-31 15:45:29 +00:00
Sean Bright
db2283b512 The -I argument to aclocal needs a space before the include directory name.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@152992 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-10-30 20:58:24 +00:00
Tilghman Lesher
ac0c617f43 Cannot join detached threads. See http://www.opengroup.org/onlinepubs/000095399/functions/pthread_join.html
(Closes issue #13400)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@152958 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-10-30 20:33:28 +00:00
Tilghman Lesher
e8b8a35b3d Unlock before returning, when extension doesn't exist.
(closes issue #13807)
 Reported by: eliel
 Patches: 
       chan_local.c.patch uploaded by eliel (license 64)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@152922 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-10-30 19:43:38 +00:00
Kevin P. Fleming
1a56159a79 instead of comparing the string pointer to 0, let's compare the value that was actually parsed out of the string (found by sparse)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@152811 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-10-30 16:53:48 +00:00
Russell Bryant
c1cdf01a0e Fix an incorrect usage of sizeof()
(closes issue #13795)
Reported by: andrew53
Patches:
	chan_sip_sizeof.patch uploaded by andrew53 (license 519)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@152539 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-10-29 05:23:51 +00:00
Steve Murphy
fffb7722be A little documentation cross-ref between features and
dial and queue... I wasted some time (stupidly) trying
to get the one-touch parking stuff working, because it
didn't occur to me that I had to also have the corresponding
options in the dial command! Duh! (In all this time, I never
set this up before!)
So, to keep some poor fool from suffering the same fate,
I made the features.conf.sample file mention the corresponding
opts in dial/queue; and the docs for dial/app specifically
mention the corresponding decls in the feature.conf file.

I hope this doesn't spoil some vast, eternal plan...



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@152538 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-10-29 05:19:04 +00:00
Steve Murphy
961bc7e758 The magic trick to avoid this crash is not to
try to find the channel by name in the list,
which is slow and resource consuming, but rather
to pay attention to the result codes from the
ast_bridge_call, to which I added the 
AST_PBX_NO_HANGUP_PEER_PARKED value, which
now are returned when a channel is parked.

If you get AST_PBX_KEEPALIVE,
then don't touch the channel pointer.

If you get AST_PBX_NO_HANGUP_PEER, or
AST_PBX_NO_HANGUP_PEER_PARKED, then don't
touch the peer pointer.

Updated the several places where the results
from a bridge were not being properly obeyed,
and fixed some code I had introduced so that
the results of the bridge were not overridden 
(in trunk).

All the places that previously tested for 
AST_PBX_NO_HANGUP_PEER now have to check for
both AST_PBX_NO_HANGUP_PEER and AST_PBX_NO_HANGUP_PEER_PARKED.

I tested this against the 4 common parking
scenarios:


1. A calls B; B answers; A parks B; B hangs up while A is getting the parking
slot announcement, immediately after being put on hold.

2. A calls B; B answers; A parks B; B hangs up after A has been hung up, but
before the park times out.

3. A calls B; B answers; B parks A; A hangs up while B is getting the parking slot announcement, immediately after being put on hold.

4. A calls B; B answers; B parks A; A hangs up after B has been hung up, but before the park times out.


No crash.

I also ran the scenarios above against valgrind, and accesses looked good.




git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@152535 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-10-29 04:36:32 +00:00
Tilghman Lesher
fd9de775c5 Quoting in the wrong direction
(Fixes AST-107)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@152463 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-10-28 22:32:34 +00:00
Tilghman Lesher
785f27a29a Reset all DIAL variables back to blank, in case Dial is called multiple times
per call (which could otherwise lead to inconsistent status reports).
(closes issue #13216)
 Reported by: ruddy
 Patches: 
       20081014__bug13216.diff.txt uploaded by Corydon76 (license 14)
 Tested by: ruddy


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@152368 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-10-28 17:04:56 +00:00
Jeff Peeler
1400db9dfc Buffer policy setting for half is not needed.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@152286 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-10-27 23:28:49 +00:00
Tilghman Lesher
2156982d3e Inherit ALL elements of CallerID across a local channel.
(closes issue #13368)
 Reported by: Peter Schlaile
 Patches: 
       20080826__bug13368.diff.txt uploaded by Corydon76 (license 14)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@152215 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-10-27 21:32:00 +00:00
Sean Bright
a300fefab6 Since passing \0 as the second argument to strchr is valid (and will
match the trailing \0 of a string) we need to check that first, otherwise
we end up with incorrect results.  Fix suggested by reporter.

(closes issue #13787)
Reported by: meitinger


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@152059 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-10-26 20:23:36 +00:00
Russell Bryant
17f164852c Move AMI initialization to occur after loading modules. This prevents a
deadlock when someone tries to initiate a module reload from the AMI just
as Asterisk is starting.

(closes issue #13778)
Reported by: hotsblanc
Fix suggested by hotsblanc


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@151905 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-10-25 10:59:02 +00:00
Terry Wilson
3f6d4154b8 Backport fix from 1.6.0 that allows you to set parkedcalltransfers=no|caller|callee|both, but default to both which would be the equivalent of the existing behaviour.
The problem was that if someone parked a call, the callee and caller would both get assigned the builtin transfer feature, which would not only be potentially giving someone the ability to transfer themselves when they shouldn't have it, but would also dissallow reinviting the media off of the call.
(closes issue #12854)
	Reported by: davidw
	Patches: 
	      parkingfix4.diff.txt uploaded by otherwiseguy
		  Tested by: davidw, otherwiseguy


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@151763 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-10-23 16:04:42 +00:00
Kevin P. Fleming
bc51c18f3d rename this macro to properly reflect what it does
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@151241 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-10-20 04:57:33 +00:00
Kevin P. Fleming
fe3cd94ec6 break up acinclude.m4 into individual files, which will make it easier to maintain, easier to add new macros (less patching) and will ease maintenance of these macros across Asterisk branches
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@151240 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-10-20 04:45:56 +00:00
BJ Weschke
656de6f30d As per kpfleming's comments to the prior commit, I'm reverting some of the changes here.
A comment was made in bug #13726 
 "3. The same mistake as in (2) is done in a few other places in the code that check for: #if defined(HAVE_ZAPTEL) || defined(HAVE_DAHDI)
Harmless, but still incorrect."

 In the case of main/asterisk.c, this is not incorrect because without HAVE_ZAPTEL defined, we're missing
 the include for ioctl and the namespace that defines DAHDI_TIMERCONFIG which is still required when
 using Zaptel with the 1.4 branch.



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@151167 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-10-19 19:51:16 +00:00
BJ Weschke
77b4928d8d Fix the 1.4 branch compile again broken with r150557 when using with Zaptel and not DAHDI
(closes issue #13740)
 reported by: jmls
 patch by: bweschke



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@151100 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-10-19 19:07:05 +00:00
BJ Weschke
4ac62c324b Using the GetVar handler in AMI is potentially dangerous (insta-crash [tm]) when you use a dialplan function that requires a channel and then you don't provide one or provide an invalid one in the Channel: parameter. We'll handle this situation exactly the same way it was handled in pbx.c back on r61766.
We'll create a bogus channel for the function call and destroy it when we're done. If we have trouble allocating the bogus channel then we're not going to try executing the function call at all and run the risk of crashing.
 (closes issue #13715)
 reported by: makoto
 patch by: bweschke


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@150816 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-10-18 01:42:23 +00:00
Steve Murphy
8f30902385 Interesting crash. In this case, you exit the
bridge with peer completely GONE. 

I moved the channel find call up to cover the
whole peer CDR reset code segment. This appears
to solve the crash without changing the logic
at all.




git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@150637 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-10-17 17:18:31 +00:00
Jason Parker
979e2cd58d Correctly allow chan_dahdi to compile against older versions of Zaptel.
Don't always define HAVE_ZAPTEL_CHANALARMS (since we check if it's defined..)
Minor cleanup to make things clear.

(closes issue #13726)
Reported by: tzafrir
Patches:
      dahdi_def.diff uploaded by tzafrir (license 46)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@150557 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-10-17 15:31:35 +00:00
Mark Michelson
47cf653623 Reverting changes from commits 150298 and 150301 since
I was mistakenly under the assumption that dialplan functions
*always* required that a channel be present. I need to go
home earlier, I think :)



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@150304 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-10-16 23:40:54 +00:00
Mark Michelson
d61eb37af6 And don't forget to return on the error condition
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@150301 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-10-16 23:35:07 +00:00
Mark Michelson
e9035cc286 Don't try to call a dialplan function's read callback from
the manager's GetVar handler if an invalid channel has
been specified. Several dialplan functions, including
CHANNEL and SIP_HEADER, do not check for NULL-ness of
the channel being passed in.

(closes issue #13715)
Reported by: makoto



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@150298 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-10-16 23:34:37 +00:00
Richard Mudgett
4fa4c33f6d Fix memory leak found by customer
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@150124 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-10-16 15:56:06 +00:00
Steve Murphy
1985be224e This patch is relevant to:
ABE-1628 and RYM-150398 and AST-103 in internal Digium 
bug trackers.

These fixes address a really subtle memory corruption
problem that would happen in machines heavily loaded
in production environments. The corruption would
always take the form of the STMT object getting
nulled out and one of the unixODBC calls would
crash trying to access statement->connection.

It isn't fully proven yet, but the server has
now been running 2.5 days without appreciable
memory growth, or any gain of %cpu, and no 
crashes. Whether this is the problem or not
on that server, these fixes are still warranted.

As it turns out, **I** introduced these errors
unwittingly, when I corrected another crash earlier.
I had formed the build_query routine, and failed
to remove mutex_unlock calls in 3 places in the
transplanted code. These unlocks would only
happen in error situations, but unlocking the
mutex early set the code up for a catastrophic
failure, it appears. It would happen only once
every 100K-200K or more calls, under heavy load... 
but that is enough.

If another crash occurs, with the same MO, 
I'll come back and remove my confession from the log, and
we'll keep searching, but the fact that we
have Asterisk dying from an asynchronous
wiping of the STMT object, only on some connection
error, and that the server has lived for 2.5
days on this code without a crash, sure make
it look like this was the problem!

Also, in several points, Statement handles are
set to NULL after SQLFreeHandle. This was mainly
for insurance, to guarantee a crash. As it turns
out, the code does not appear to be attempting
to use these freed pointers.

Asterisk owes a debt of gratitude to Federico Alves
and Frediano Ziglio for their untiring efforts in
finding this bug, among others.




git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@150056 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-10-16 15:26:10 +00:00
BJ Weschke
829ffbc857 Another documentation fix.
(closes issue #13708)



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@149840 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-10-15 21:34:02 +00:00
BJ Weschke
1d21453b49 An update to the documentation/example of agents.conf.sample with the correct parameter for this feature as defined in chan_agent.c
(closes issue #13709)



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@149683 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-10-15 18:28:54 +00:00
Kevin P. Fleming
1573ebed8c fix some problems when parsing SIP messages that have the maximum number of headers or body lines that we support
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@149452 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2008-10-15 10:30:40 +00:00