]> git.ipfire.org Git - thirdparty/asterisk.git/log
thirdparty/asterisk.git
16 years agoThese changes allow AEL to better check ${} constructs within $[...], that are concat...
Steve Murphy [Tue, 3 Mar 2009 18:11:34 +0000 (18:11 +0000)] 
These changes allow AEL to better check ${} constructs within $[...], that are concatenated with text.

I modified and added rules in ast_expr2.fl to better handle
the concatenations.

I added some default routines to ast_expr2.y so the standalone would
compile. It also looks like I haven't run this thru bison since 2.1, so
it's good to get this updated.

The Makefile has comments added now for check_expr2 and check_expr to
explain what they are for, and how to run them.

The testexpr2s stuff has been removed, in favor of check_expr2.

expr2.testinput has been updated to include the two expressions
that inspired these changes (from mcnobody on #asterisk this morning)
The regression has been run and all looks well.

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@179807 65c4cc65-6c06-0410-ace0-fbb531ad65f3

16 years agoEnsure chan->fdno always gets reset to -1 after handling a channel fd event.
Russell Bryant [Tue, 3 Mar 2009 16:45:46 +0000 (16:45 +0000)] 
Ensure chan->fdno always gets reset to -1 after handling a channel fd event.

Since setting fdno to -1 had to be moved, a couple of other code paths that
do process an fd event return early and do not pass through the code path
where it was moved to.  So, set it to -1 in a few other places, too.

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@179741 65c4cc65-6c06-0410-ace0-fbb531ad65f3

16 years agoMove where fdno is set to the default value to *after* the read callback of the chann...
Joshua Colp [Tue, 3 Mar 2009 14:38:09 +0000 (14:38 +0000)] 
Move where fdno is set to the default value to *after* the read callback of the channel driver is called.
We have to do this as the underlying channel driver may need the fdno value to determine what to read.

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@179671 65c4cc65-6c06-0410-ace0-fbb531ad65f3

16 years agoMake it easier to detect an improper call to ast_read().
Russell Bryant [Tue, 3 Mar 2009 13:53:52 +0000 (13:53 +0000)] 
Make it easier to detect an improper call to ast_read().

When you call ast_waitfor() on a channel, the index into the channel fds array
that holds the file descriptor that poll() determines has input available is
stored in fdno.  This patch clears out this value after a call to ast_read()
and also reports errors if ast_read() is called without an fdno set.

From a discussion on the asterisk-dev list.

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@179608 65c4cc65-6c06-0410-ace0-fbb531ad65f3

16 years agoFix bridging regression from commit 176701
Jeff Peeler [Mon, 2 Mar 2009 23:54:39 +0000 (23:54 +0000)] 
Fix bridging regression from commit 176701

This fixes a bad regression where the bridge would exit after an attended
transfer was made. The problem was due to nexteventts getting set after the
masquerade which caused the bridge to return AST_BRIDGE_COMPLETE.

(closes issue #14315)
Reported by: tim_ringenbach

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@179536 65c4cc65-6c06-0410-ace0-fbb531ad65f3

16 years agoMove ast_waitfor() down to avoid the results of the API call becoming stale.
Russell Bryant [Mon, 2 Mar 2009 23:34:13 +0000 (23:34 +0000)] 
Move ast_waitfor() down to avoid the results of the API call becoming stale.

This call to ast_waitfor() was being done way too soon in this section of code.
Specifically, there was code in between the call to waitfor and the code that
uses the result that puts the channel in autoservice.  By putting the channel
in autoservice, the previous results of ast_waitfor() become meaningless,
as the autoservice thread will do it's own ast_waitfor() and ast_read()
on the channel.

So, when we came back out of autoservice and eventually hit the block of code
that calls ast_read() on the channel, there may not actually be any input on
the channel available.  Even though the previous call to ast_waitfor() in
app_meetme said there was input, the autoservice thread has since serviced
the channel for some period of time.

This bug manifested itself while dvossel was doing some testing of MeetMe in
Asterisk trunk.  He was using the timerfd timing module.  When the code hit
ast_read() erroneously, it determined that it must have been called because of
input on the timer fd, as chan->fdno was set to AST_TIMING_FD, since that was
the cause of the last legitimate call to ast_read() done by autoservice.

In this test, an IAX2 channel was calling into the MeetMe conference.  It was
_much_ more likely to be seen with an IAX2 channel because of the way audio
is handled.  Every audio frame that comes in results in a call to
ast_queue_frame(), which then uses ast_timer_enable_continuous() to notify
the channel thread that a frame is waiting to be handled.  So, the chances
of ast_waitfor() indicating that a channel needs servicing due to a timer
event on an IAX2 event is very high.

Finally, it is interesting to note that if a different timing interface was
being used, this bug would probably not be noticed.  When ast_read() is called
and erroneously thinks that there is a timer event to handle, it calls the
ast_timer_ack() function.  The pthread and dahdi timing modules handle the
ack() function being called when there is no event by simply ignoring it.
In the case of the timerfd module, it results in a read() on the timer fd
that will block forever, as there is no data to read.  This caused Asterisk
to lock up very quickly.

Thanks to dvossel and mmichelson for the fun debugging session.  :-)

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@179532 65c4cc65-6c06-0410-ace0-fbb531ad65f3

16 years agoWhen ending a recording with silence detection, remember to reduce the duration.
Tilghman Lesher [Mon, 2 Mar 2009 23:09:01 +0000 (23:09 +0000)] 
When ending a recording with silence detection, remember to reduce the duration.
The end of the recording is correspondingly trimmed, but the duration was not
trimmed by the number of seconds trimmed, so the saved duration was necessarily
longer than the actual soundfile duration.
(closes issue #14406)
 Reported by: sasargen
 Patches:
       20090226__bug14406.diff.txt uploaded by tilghman (license 14)
 Tested by: sasargen

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@179468 65c4cc65-6c06-0410-ace0-fbb531ad65f3

16 years agoEnsure that only one thread is calling ast_settimeout() on a channel at a time.
Russell Bryant [Mon, 2 Mar 2009 22:58:18 +0000 (22:58 +0000)] 
Ensure that only one thread is calling ast_settimeout() on a channel at a time.

For example, with an IAX2 channel, you can have both the channel thread and the
chan_iax2 processing threads calling this function, and doing so twice at the
same time is a bad thing.

(Found in a debugging session with dvossel and mmichelson)

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@179461 65c4cc65-6c06-0410-ace0-fbb531ad65f3

16 years agoRemove several silly warnings in editline. One about a broken preprocessor directive...
Jason Parker [Mon, 2 Mar 2009 20:14:57 +0000 (20:14 +0000)] 
Remove several silly warnings in editline.  One about a broken preprocessor directive, and another about strlcpy/strlcat.

(closes issue #14264)
Reported by: dimas

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@179395 65c4cc65-6c06-0410-ace0-fbb531ad65f3

16 years agoUpdate documentation for DIALEDTIME and ANSWEREDTIME variables.
Jason Parker [Fri, 27 Feb 2009 19:03:56 +0000 (19:03 +0000)] 
Update documentation for DIALEDTIME and ANSWEREDTIME variables.

(closes issue #14566)
Reported by: klaus3000
Patches:
      ANSWEREDTIME-1.4-patch.txt uploaded by klaus3000 (license 65)
      ANSWEREDTIME-trunk-patch.txt uploaded by klaus3000 (license 65)

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@179056 65c4cc65-6c06-0410-ace0-fbb531ad65f3

16 years agoThis change moves the default feature digit timeout to 1000 ms from the previous...
Steve Murphy [Thu, 26 Feb 2009 21:27:32 +0000 (21:27 +0000)] 
This change moves the default feature digit timeout to 1000 ms from the previous default of 500.

As per bug 14515, a dev discussion arrived at a "mediated concensus"
of a default feature digit timeout of 1.0 sec. Some voted for 1300;
ctooley thought 1500 for distracted phone users in phone booths;
kpfleming put his foot down at 1.0 sec.

Users who found the previous default max delay of 250 msec perfect,
are welcome to override the new default. Notice that I said that
250 msec was the default; wait a minute, you might say, the config
file said it was 500 msec!; well, because of the bug fix for 14515,
we found that 500 msec was actually enforcing a max of 250. The bug
fix would restore 500 msec, but we felt even that was a bit tight
for most users... 2000 msec was pushed earlier by mmichelson, so
that reduces to 1000 msec after the bug fix. Enjoy!

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@178956 65c4cc65-6c06-0410-ace0-fbb531ad65f3

16 years agoIAX2 prune realtime fix
David Vossel [Thu, 26 Feb 2009 17:24:02 +0000 (17:24 +0000)] 
IAX2 prune realtime fix

Now prune_users() and prune_peers() are called instead of reload_config() to prune all users/peers that are realtime.  These functions remove all users/peers with the rtfriend and delme flags set. iax2_prune_realtime() also lacked the code to properly delete a single friend.  For example. if iax2 prune realtime <friend> was called, only the peer instance would be removed. The user would still remain.

(closes issue #14479)
Reported by: mousepad99
Review: http://reviewboard.digium.com/r/176/

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@178838 65c4cc65-6c06-0410-ace0-fbb531ad65f3

16 years agoThis patch prevents the feature detection timeout from being cut in half.
Steve Murphy [Thu, 26 Feb 2009 17:09:03 +0000 (17:09 +0000)] 
This patch prevents the feature detection timeout from being cut in half.

Because the ast_channel_bridge() call will return 0 and pass
a frame pointer for both DTMF_BEGIN and DTMF_END, the feature_timer
field in hte config struct is getting decremented twice, which
effectively cuts the digittimeout in half. I added conditions
to the if statement to only let DTMF_END frames to flow thru,
which solved the problem. Also, when the frame pointer is null,
let control flow thru-- this usually happens on timeouts. I added
a comment to the code to explain what's going on and why.

Many thanks to sodom for reporting this problem. Personnally, it always seemed
like something was wrong with the featuredigittimeout, but I never
could quite decide what... and was too busy to investigate.
This bug forced the issue, and now we know.

Sodom had other issues in 14515, but I couldn't reproduce them. If
he still has problems, and wants to get them solved, he is welcome
to reopen 14515.

(closes issue #14515)
Reported by: sodom
Patches:
      14515.patch uploaded by murf (license 17)
Tested by: murf, sodom

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@178804 65c4cc65-6c06-0410-ace0-fbb531ad65f3

16 years agoThis patch completes the fixes nec. to make 1.4 asterisk dialplan expressions ($...
Steve Murphy [Wed, 25 Feb 2009 21:00:50 +0000 (21:00 +0000)] 
This patch completes the fixes nec. to make 1.4 asterisk dialplan expressions ($[...]) 8-bit transparent

While I was updating ast_expr2.fl, I missed one rule that would allow 8-bit chars to be caught
in tokens; and in so doing, it absorbs the ${ sequence and messes up the
checking of raw exprs by AEL.

Trunk already has these changes.

(closes issue #14543)
Reported by: klaus3000
Patches:
      patch.14543 uploaded by murf (license 17)
Tested by: murf

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@178640 65c4cc65-6c06-0410-ace0-fbb531ad65f3

16 years agoUpdate the copyright year for the main page of the doxygen documentation.
Russell Bryant [Wed, 25 Feb 2009 12:43:36 +0000 (12:43 +0000)] 
Update the copyright year for the main page of the doxygen documentation.

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@178508 65c4cc65-6c06-0410-ace0-fbb531ad65f3

16 years agoAdd section about the #exec command in configuration files.
Tilghman Lesher [Tue, 24 Feb 2009 23:25:24 +0000 (23:25 +0000)] 
Add section about the #exec command in configuration files.
(closes issue #14540)
 Reported by: jtodd
 Patch by: jtodd, with additional notes by tilghman (license 14)

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@178445 65c4cc65-6c06-0410-ace0-fbb531ad65f3

16 years agoOnly set dtmfcount on BEGIN, and ensure it gets reset to 0 properly.
Russell Bryant [Tue, 24 Feb 2009 20:36:19 +0000 (20:36 +0000)] 
Only set dtmfcount on BEGIN, and ensure it gets reset to 0 properly.

(issue #14460)
Reported by: moliveras
Tested by: russell

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@178373 65c4cc65-6c06-0410-ace0-fbb531ad65f3

16 years agoChange include order to make compile on Centos 5 with DAHDI
Terry Wilson [Tue, 24 Feb 2009 17:02:20 +0000 (17:02 +0000)] 
Change include order to make compile on Centos 5 with DAHDI

If BIT_TYPES_DEFINED gets defined before linux/types.h is included, the
__s32 type doesn't get defined

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@178266 65c4cc65-6c06-0410-ace0-fbb531ad65f3

16 years agoSkip check for extension when subscribing for MWI.
Joshua Colp [Tue, 24 Feb 2009 15:16:07 +0000 (15:16 +0000)] 
Skip check for extension when subscribing for MWI.

Since the remote side is not actually subscribing to a specific extension when
subscribing for MWI just skip the check to see if the extension exists. They can't use it
to specify the mailbox either since we require configuration of that in sip.conf

(closes issue #14531)
Reported by: festr

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@178205 65c4cc65-6c06-0410-ace0-fbb531ad65f3

16 years agoFix infinite DTMF when a BEGIN is received without an END.
Russell Bryant [Mon, 23 Feb 2009 23:09:01 +0000 (23:09 +0000)] 
Fix infinite DTMF when a BEGIN is received without an END.

This commit is related to rev 175124 of 1.4 where a previous attempt was made
to fix this problem.  The problem with the previous patch was that the inserted
code needed to go _before_ setting the lastrxts to the current timestamp.
Because those were the same, the dtmfcount variable was never decremented, and
so the END was never sent.

In passing, I removed the dtmfsamples variable which was completed unused.  I
also removed a redundant setting of the lastrxts variable.

(closes issue #14460)
Reported by: moliveras

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@178141 65c4cc65-6c06-0410-ace0-fbb531ad65f3

16 years agoDon't print the CR-NL combination when we aren't outputting to the manager.
Tilghman Lesher [Fri, 20 Feb 2009 22:59:52 +0000 (22:59 +0000)] 
Don't print the CR-NL combination when we aren't outputting to the manager.

An embedded CR-NL in a CLI command screws up several AMI parsers that don't
expect to see that combination in the middle of output.

(Closes issue #14305)
Reported by: martins
Patch by: tilghman

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@177786 65c4cc65-6c06-0410-ace0-fbb531ad65f3

16 years agoThis exception does not appear to still be true for Solaris 10, and OpenSolaris defin...
Tilghman Lesher [Fri, 20 Feb 2009 21:15:01 +0000 (21:15 +0000)] 
This exception does not appear to still be true for Solaris 10, and OpenSolaris definitely needs it to be removed.
Fixed for snuff-home on -dev channel.

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@177701 65c4cc65-6c06-0410-ace0-fbb531ad65f3

16 years agoFixes issue with undefined audio codecs in chan_iax2
David Vossel [Fri, 20 Feb 2009 20:17:37 +0000 (20:17 +0000)] 
Fixes issue with undefined audio codecs in chan_iax2

During iax2 call negotiation, supported codecs are passed in an Information Element containing a 2 byte field where each bit correlates to a specific codec.  In 1.4 only audio codec bits 0-12 are defined, leaving bits 13-15 undefined.  By default all bits are enabled unless specified otherwise.  Since its a 2 byte field and 13-15 are not defined, these bits are never turned off.  In trunk, bits 13-15 are defined, which means 1.4 is advertising support for codecs it does not have when talking to trunk.  I fixed this by adding #define for undefined audio codec bits.  These bits are then removed from iax2's full bandwidth capabilities.

(closes issue #14283)
Reported by: jcovert

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@177696 65c4cc65-6c06-0410-ace0-fbb531ad65f3

16 years agoThis patch fixes a problem with 8-bit input to the ast_expr2 scanner.
Steve Murphy [Thu, 19 Feb 2009 22:51:37 +0000 (22:51 +0000)] 
This patch fixes a problem with 8-bit input to the ast_expr2 scanner.

The real culprit was the --full argument to flex
in the Makefile! This causes a 7-bit scanner to be
generated.

I reviewed the rules and found one rule where I needed
to specifically include 8-bit chars for a token.

I tested against the text supplied by ibercom, and
all looks very well.

This has been there a surprisingly long time!

(closes issue #14498)
Reported by: ibercom
Patches:
      14498.patch uploaded by murf (license 17)
Tested by: murf

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@177540 65c4cc65-6c06-0410-ace0-fbb531ad65f3

16 years agoFix up potential crashes, by reducing the sharing between interactive and non-interac...
Tilghman Lesher [Thu, 19 Feb 2009 22:26:01 +0000 (22:26 +0000)] 
Fix up potential crashes, by reducing the sharing between interactive and non-interactive threads.
(closes issue #14253)
 Reported by: Skavin
 Patches:
       20090219__bug14253.diff.txt uploaded by Corydon76 (license 14)
 Tested by: Skavin

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@177536 65c4cc65-6c06-0410-ace0-fbb531ad65f3

16 years agoForce a MWI notification after subscribe request. Reported by the Resiprocate dev...
Olle Johansson [Thu, 19 Feb 2009 18:58:57 +0000 (18:58 +0000)] 
Force a MWI notification after subscribe request. Reported by the Resiprocate dev team. Thanks!

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@177450 65c4cc65-6c06-0410-ace0-fbb531ad65f3

16 years agoIf we are able to create a speech structure unset the ERROR variable in case it was...
Joshua Colp [Thu, 19 Feb 2009 16:37:25 +0000 (16:37 +0000)] 
If we are able to create a speech structure unset the ERROR variable in case it was previously set.
(issue #LUMENVOX-13)

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@177383 65c4cc65-6c06-0410-ace0-fbb531ad65f3

16 years agoThis patch fixes a regression of sorts that was introduced in
Steve Murphy [Wed, 18 Feb 2009 22:43:14 +0000 (22:43 +0000)] 
This patch fixes a regression of sorts that was introduced in
rev 24425.

It basically fixes AST-190/ABE-1782.

What was wrong: the user has 6000 extensions in one context; and
then 6000 contexts, one per extension. The parser could only handle
about 4893 of the 6000 extens in the single context.

This was due to the regression I mentioned. To get rid of
shift/reduce conflicts, Luigi set up right-recursive lists
for globals, context elements, switch lists, and statements.
Right recursive lists got rid of the warnings, but instead, they
use up a tremendous amount of stack space when the lists are long.

I saw this a few years back, and resolved not to fix it until
someone complained. That day has arrived!

After the changes were made, I ran the regression test suite,
and there were no problems.

I took the test case the user provided, and added 100,000
extensions to the single context, that already had 6,000 extens
in it. (I'll see your 6, and raise you 100!) It takes a few minutes
to read it all in, check it and generate code for it, but no
problems.

So, I think I can say that fundamentally, there are no longer
any limits on the number of items you can place in contexts,
statement blocks, switches, or globals, beyond your virt mem
constraints.

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@177225 65c4cc65-6c06-0410-ace0-fbb531ad65f3

16 years agoModify h323 to build against PTLib as well as the older PWLib
Jeff Peeler [Wed, 18 Feb 2009 20:06:45 +0000 (20:06 +0000)] 
Modify h323 to build against PTLib as well as the older PWLib

Several changes in PTLib have occurred requiring build time detection. Changes
accounted for include the library name change, config option change, install
location change, and a boolean type change which is handled by ast_ptlib.h.
Also, the sed check has been modified to properly work with autoconf >= 2.62.

(closes issue #14224)
Reported by: bergolth
Patches:
      asterisk-autoconf-sed.patch uploaded by bergolth (license 661)
      asterisk-pwlib-v3.patch uploaded by bergolth (license 661)
Tested by: jpeeler

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@177160 65c4cc65-6c06-0410-ace0-fbb531ad65f3

16 years agoDocument the return value of the update method (as requested on -dev list)
Tilghman Lesher [Wed, 18 Feb 2009 18:30:38 +0000 (18:30 +0000)] 
Document the return value of the update method (as requested on -dev list)

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@177096 65c4cc65-6c06-0410-ace0-fbb531ad65f3

16 years agoMerged revisions 177035 manually from
Doug Bailey [Wed, 18 Feb 2009 17:41:05 +0000 (17:41 +0000)] 
Merged revisions 177035 manually from
https://origsvn.digium.com/svn/asterisk/trunk

........
  r177035 | dbailey | 2009-02-18 11:24:07 -0600 (Wed, 18 Feb 2009) | 2 lines

  Fixed error where a check for an zero length, terminated string was needed.
........

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@177039 65c4cc65-6c06-0410-ace0-fbb531ad65f3

16 years agoNeed to take into account the \0 terminator of the old string to determine the amount...
Doug Bailey [Wed, 18 Feb 2009 15:59:22 +0000 (15:59 +0000)] 
Need to take into account the \0 terminator of the old string to determine the amount available.

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@176945 65c4cc65-6c06-0410-ace0-fbb531ad65f3

16 years agoSeveral changes to codec_dahdi to play nice with G723.
Shaun Ruffell [Wed, 18 Feb 2009 00:34:38 +0000 (00:34 +0000)] 
Several changes to codec_dahdi to play nice with G723.

This commit brings in the changes that were living out on the
svn/asterisk/team/sruffell/asterisk-1.4-transcoder branch.  codec_dahdi.c now
always uses signed linear as the simple codec so that a soft g729 codec will
not end up being preferred to the hardware codec.  There are also changes to
allow codec_dahdi.c to feed packets to the hardware in the native sample size of
the codec.  This solves problems with choppy audio when using G723.

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@176810 65c4cc65-6c06-0410-ace0-fbb531ad65f3

16 years agoModify bridging to properly evaluate DTMF after first warning is played
Jeff Peeler [Tue, 17 Feb 2009 21:54:34 +0000 (21:54 +0000)] 
Modify bridging to properly evaluate DTMF after first warning is played

The main problem is currently if the Dial flag L is used with a warning sound,
DTMF is not evaluated after the first warning sound. To fix this, a flag has
been added in ast_generic_bridge for playing the warning which ensures that if
a scheduled warning is missed, multiple warrnings are not played back (due to a
feature evaluation or waiting for digits). ast_channel_bridge was modified to
store the nexteventts in the ast_bridge_config structure as that information
was lost every time ast_channel_bridge was reentered, causing a hangup due to
incorrect time calculations.

(closes issue #14315)
Reported by: tim_ringenbach

Reviewed on reviewboard:
http://reviewboard.digium.com/r/163/

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@176701 65c4cc65-6c06-0410-ace0-fbb531ad65f3

16 years agoBackport change to 1.4:
Tilghman Lesher [Tue, 17 Feb 2009 21:21:41 +0000 (21:21 +0000)] 
Backport change to 1.4:
  Prior to masquerade, move the group definitions to the channel performing the
  masq, so that the group count lingers past the bridge.
  (closes issue #14275)
   Reported by: kowalma
   Patches:
         20090216__bug14275.diff.txt uploaded by Corydon76 (license 14)
   Tested by: kowalma

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@176661 65c4cc65-6c06-0410-ace0-fbb531ad65f3

16 years agoAfter a 'sip reload', qualifies for realtime peers weren't immediately
Tilghman Lesher [Tue, 17 Feb 2009 00:49:22 +0000 (00:49 +0000)] 
After a 'sip reload', qualifies for realtime peers weren't immediately
restarted, instead waiting until the next registration.  We're now
caching the qualify across a reload/restart and starting the qualify
immediately upon loading the peer.
(closes issue #14196)
 Reported by: pdf
 Patches:
       20090120__bug14196_1.4.diff.txt uploaded by pdf (license 663)
 Tested by: pdf

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@176426 65c4cc65-6c06-0410-ace0-fbb531ad65f3

16 years agoFixes issue with AST_CONTROL_SRCUPDATE not being relayed correctly during bridging
David Vossel [Mon, 16 Feb 2009 23:30:52 +0000 (23:30 +0000)] 
Fixes issue with AST_CONTROL_SRCUPDATE not being relayed correctly during bridging

This should have been committed with rev176247, but I missed it.  srcupdate frames no longer break out of the native bridge, but are not being sent to the other call leg either.  This fixs that.

issue #13749

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@176354 65c4cc65-6c06-0410-ace0-fbb531ad65f3

16 years agocorrect a logic error in the last stringfields commit... don't mark additional space...
Kevin P. Fleming [Mon, 16 Feb 2009 21:41:46 +0000 (21:41 +0000)] 
correct a logic error in the last stringfields commit... don't mark additional space as allocated if the string was built using already-allocated space

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@176254 65c4cc65-6c06-0410-ace0-fbb531ad65f3

16 years agoRemove unused variable and make dev-mode compilation happy
Mark Michelson [Mon, 16 Feb 2009 21:39:21 +0000 (21:39 +0000)] 
Remove unused variable and make dev-mode compilation happy

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@176252 65c4cc65-6c06-0410-ace0-fbb531ad65f3

16 years agoOpen the DAHDI pseudo device and set it to be nonblocking atomically
Mark Michelson [Mon, 16 Feb 2009 21:34:27 +0000 (21:34 +0000)] 
Open the DAHDI pseudo device and set it to be nonblocking atomically

Apparently on FreeBSD, attempting to set the O_NONBLOCKING flag separately
from opening the file was causing an "inappropriate ioctl for device" error.
While I cannot fathom why this would be happening, I certainly am not opposed
to making the code a bit more compact/efficient if it also fixes a bug.

(closes issue #14482)
Reported by: ys
Patches:
      meetme.patch uploaded by ys (license 281)
Tested by: ys

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@176249 65c4cc65-6c06-0410-ace0-fbb531ad65f3

16 years agoFixes issue with AST_CONTROL_SRCUPDATE breaking out of native bridge
David Vossel [Mon, 16 Feb 2009 21:28:20 +0000 (21:28 +0000)] 
Fixes issue with AST_CONTROL_SRCUPDATE breaking out of native bridge

In iax2, when a AST_CONTROL_SRCUPDATE is received it breaks from the native bridge, but since there is no code path to handle srcupdate it just goes to be beginning of the loop.  This was causing packet storms of srcupdate frames between servers.  Now srcupdate frames do not break the native bridge for processing.

(closes issue #13749)
Reported by: adiemus

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@176247 65c4cc65-6c06-0410-ace0-fbb531ad65f3

16 years agofix a flaw in the ast_string_field_build() family of API calls; these functions made...
Kevin P. Fleming [Mon, 16 Feb 2009 21:10:38 +0000 (21:10 +0000)] 
fix a flaw in the ast_string_field_build() family of API calls; these functions made no attempt to reuse the space already allocated to a field, so every time the field was written it would allocate new space, leading to what appeared to be a memory leak.

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@176216 65c4cc65-6c06-0410-ace0-fbb531ad65f3

16 years agoDon't have the Via header stored as a stringfield as it can change often during the...
Joshua Colp [Mon, 16 Feb 2009 15:33:53 +0000 (15:33 +0000)] 
Don't have the Via header stored as a stringfield as it can change often during the lifetime of a dialog.

This issue crept up with subscriptions on the AA50. When an outgoing NOTIFY is sent a new branch value
is created and the Via header is changed to reflect it. Since this was a stringfield a new spot in the
pool was used for the value while the old was left untouched/unused. If the current pool was full a new
pool was created. This would cause memory usage to increase steadily.

(issue #AA50-2332)

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@176029 65c4cc65-6c06-0410-ace0-fbb531ad65f3

16 years agofix mis-spelling of the word registered.
Michiel van Baak [Sun, 15 Feb 2009 23:37:03 +0000 (23:37 +0000)] 
fix mis-spelling of the word registered.
Reported by De_Mon on #asterisk-dev.

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@175921 65c4cc65-6c06-0410-ace0-fbb531ad65f3

16 years agoformat_ilbc does not depend on codec libraries and can therefore always be made....
Olle Johansson [Sun, 15 Feb 2009 20:33:17 +0000 (20:33 +0000)] 
format_ilbc does not depend on codec libraries and can therefore always be made. My mistake. Ursäkta!

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@175825 65c4cc65-6c06-0410-ace0-fbb531ad65f3

16 years agoDisable format_ilbc.so by default, like codec_ilbc.so
Olle Johansson [Sun, 15 Feb 2009 20:20:21 +0000 (20:20 +0000)] 
Disable format_ilbc.so by default, like codec_ilbc.so

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@175792 65c4cc65-6c06-0410-ace0-fbb531ad65f3

16 years agoMake sure that the debug line is not printed on debug level 0
Olle Johansson [Sun, 15 Feb 2009 19:48:38 +0000 (19:48 +0000)] 
Make sure that the debug line is not printed on debug level 0

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@175777 65c4cc65-6c06-0410-ace0-fbb531ad65f3

16 years agoZaptel is not DAHDI. Rather, Zaptel is actually Zaptel. (in case you're confused...
Jason Parker [Fri, 13 Feb 2009 21:53:16 +0000 (21:53 +0000)] 
Zaptel is not DAHDI.  Rather, Zaptel is actually Zaptel.  (in case you're confused, DAHDI is still DAHDI)

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@175698 65c4cc65-6c06-0410-ace0-fbb531ad65f3

16 years agoFix a potential crash situation when using IMAP voicemail
Mark Michelson [Fri, 13 Feb 2009 19:47:48 +0000 (19:47 +0000)] 
Fix a potential crash situation when using IMAP voicemail

If calling into VoiceMailMain when using IMAP storage, it was
possible to crash Asterisk by hanging up the phone when prompted
for a voicemail mailbox. This patch fixes the issue.

While it may appear that this patch is superficial, it allows code
execution to continue to the failure case just below the IMAP_STORAGE
code block where this patch has been applied

(closes issue #14473)
Reported by: dwpaul
Patches:
      voicemail_imap_crash_no_mailbox.patch uploaded by dwpaul (license 689)

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@175590 65c4cc65-6c06-0410-ace0-fbb531ad65f3

16 years agoFix a place where filestreams were not refcounted properly
Mark Michelson [Thu, 12 Feb 2009 23:22:44 +0000 (23:22 +0000)] 
Fix a place where filestreams were not refcounted properly

This section was already present in trunk and other branches,
but did not exist in 1.4.

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

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@175407 65c4cc65-6c06-0410-ace0-fbb531ad65f3

16 years agoFix crashes when receiving certain T.38 packets. Also, increase the maximum
Tilghman Lesher [Thu, 12 Feb 2009 21:19:40 +0000 (21:19 +0000)] 
Fix crashes when receiving certain T.38 packets.  Also, increase the maximum
size of T.38 packets and warn users when they try to set the limits above those
maximums.
(closes issue #13050)
 Reported by: schern
 Patches:
       20090212__bug13050.diff.txt uploaded by Corydon76 (license 14)
 Tested by: schern

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@175311 65c4cc65-6c06-0410-ace0-fbb531ad65f3

16 years agoFix ParkedCall event information for From field in the case of a blind transfer
Jeff Peeler [Thu, 12 Feb 2009 20:34:36 +0000 (20:34 +0000)] 
Fix ParkedCall event information for From field in the case of a blind transfer

If the parker information can not be obtained from the peer, try and see if
the BLINDTRANSFER channel variable has been set. Previously, a blind transfer
to the ParkAndAnnounce app would return nothing for the From.

Closes AST-189

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@175294 65c4cc65-6c06-0410-ace0-fbb531ad65f3

16 years agoFix crash in event of failed attempt to transfer to parking
Jeff Peeler [Thu, 12 Feb 2009 17:57:10 +0000 (17:57 +0000)] 
Fix crash in event of failed attempt to transfer to parking

The peer may not necessarily exist, such as in the case of a transfer to
ParkAndAnnounce. In this case don't try to play a sound to it.

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@175187 65c4cc65-6c06-0410-ace0-fbb531ad65f3

16 years agoDon't send DTMF for infinite time if we do not receive an END event.
Russell Bryant [Thu, 12 Feb 2009 16:51:13 +0000 (16:51 +0000)] 
Don't send DTMF for infinite time if we do not receive an END event.

I thought that this was going to end up being a pretty gnarly fix, but it turns
out that there was actually already a configuration option in rtp.conf,
dtmftimeout, that was intended to handle this situation.  However, in between
Asterisk 1.2 and Asterisk 1.4, the code that processed the option got lost.
So, this commit brings it back to life.

The default timeout is 3 seconds.  However, it is worth noting that having
this be configurable at all is not really the recommended behavior in RFC 2833.
From Section 3.5 of RFC 2833:

      Limiting the time period of extending the tone is necessary
      to avoid that a tone "gets stuck". Regardless of the
      algorithm used, the tone SHOULD NOT be extended by more than
      three packet interarrival times. A slight extension of tone
      durations and shortening of pauses is generally harmless.

Three seconds will pretty much _always_ be far more than three packet
interarrival times.  However, that behavior is not required, so I'm going to
leave it with our legacy behavior for now.

Code from svn/asterisk/team/russell/issue_14460

(closes issue #14460)
Reported by: moliveras

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@175124 65c4cc65-6c06-0410-ace0-fbb531ad65f3

16 years agoSet the initiator attribute to lowercase in our replies when receiving calls.
Philippe Sultan [Thu, 12 Feb 2009 10:16:21 +0000 (10:16 +0000)] 
Set the initiator attribute to lowercase in our replies when receiving calls.

This attribute contains a JID that identifies the initiator of the GoogleTalk
voice session. The GoogleTalk client discards Asterisk's replies if the
initiator attribute contains uppercase characters.

(closes issue #13984)
Reported by: jcovert
Patches:
      chan_gtalk.2.patch uploaded by jcovert (license 551)
Tested by: jcovert

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@175029 65c4cc65-6c06-0410-ace0-fbb531ad65f3

16 years agoRevert RTP changes for continuation of DTMF. Proxy commit by russell via SMS.
Joshua Colp [Thu, 12 Feb 2009 00:19:30 +0000 (00:19 +0000)] 
Revert RTP changes for continuation of DTMF. Proxy commit by russell via SMS.

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@174997 65c4cc65-6c06-0410-ace0-fbb531ad65f3

16 years agoClear out the current event after forcing the end of a digit
Russell Bryant [Thu, 12 Feb 2009 00:01:02 +0000 (00:01 +0000)] 
Clear out the current event after forcing the end of a digit

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@174986 65c4cc65-6c06-0410-ace0-fbb531ad65f3

16 years agoFixify infinite DTMF in the case that no RFC2833 END event is ever received
Russell Bryant [Wed, 11 Feb 2009 23:56:37 +0000 (23:56 +0000)] 
Fixify infinite DTMF in the case that no RFC2833 END event is ever received

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@174985 65c4cc65-6c06-0410-ace0-fbb531ad65f3

16 years agoRestore a behavior that was recently changed, when we fixed issue #13962 and
Tilghman Lesher [Wed, 11 Feb 2009 20:54:18 +0000 (20:54 +0000)] 
Restore a behavior that was recently changed, when we fixed issue #13962 and
issue #13363 (related to issue #6176).  When a hangup occurs during a Macro
execution in earlier 1.4, the h extension would execute within the Macro
context, whereas it was always supposed to execute only within the main context
(where Macro was called).  So this fix checks for an "h" extension in the
deepest macro context where a hangup occurred; if it exists, that "h" extension
executes, otherwise the main context "h" is executed.
(closes issue #14122)
 Reported by: wetwired
 Patches:
       20090210__bug14122.diff.txt uploaded by Corydon76 (license 14)
 Tested by: andrew

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@174885 65c4cc65-6c06-0410-ace0-fbb531ad65f3

16 years agoGo off hold when we get an empty reinvite telling us to.
Joshua Colp [Tue, 10 Feb 2009 18:50:50 +0000 (18:50 +0000)] 
Go off hold when we get an empty reinvite telling us to.
(closes issue #14448)
Reported by: frawd
Patches:
      hold_invite_nosdp.patch uploaded by frawd (license 610)

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@174644 65c4cc65-6c06-0410-ace0-fbb531ad65f3

16 years agoImprove behavior of jitterbuffer when maxjitterbuffer is set.
Matthew Nicholson [Tue, 10 Feb 2009 17:52:42 +0000 (17:52 +0000)] 
Improve behavior of jitterbuffer when maxjitterbuffer is set.

This change improves the way the jitterbuffer handles maxjitterbuffer and
dramatically reduces the number of frames dropped when maxjitterbuffer is
exceeded.  In the previous jitterbuffer, when maxjitterbuffer was exceeded, all
new frames were dropped until the jitterbuffer is empty.  This change modifies
the code to only drop frames until maxjitterbuffer is no longer exceeded.

Also, previously when maxjitterbuffer was exceeded, dropped frames were not
tracked causing stats for dropped frames to be incorrect, this change also
addresses that problem.

(closes issue #14044)
Patches:
      bug14044-1.diff uploaded by mnicholson (license 96)
Tested by: mnicholson
Review: http://reviewboard.digium.com/r/144/

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@174583 65c4cc65-6c06-0410-ace0-fbb531ad65f3

16 years agoThis patch solves some compiler complaints
Steve Murphy [Tue, 10 Feb 2009 02:27:40 +0000 (02:27 +0000)] 
This patch solves some compiler complaints
in both 32 and 64-bit environments.

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@174369 65c4cc65-6c06-0410-ace0-fbb531ad65f3

16 years agoDon't do an SRV lookup if a port is specified
Mark Michelson [Mon, 9 Feb 2009 17:11:05 +0000 (17:11 +0000)] 
Don't do an SRV lookup if a port is specified

RFC 3263 says to do A record lookups on a hostname
if a port has been specified, so that's what we're
going to do. See section 4.2.

(closes issue #14419)
Reported by: klaus3000
Patches:
      patch_chan_sip_nosrvifport_1.4.23.txt uploaded by klaus3000 (license 65)

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@174282 65c4cc65-6c06-0410-ace0-fbb531ad65f3

16 years agoDon't overwrite our pointer to the music class when music on hold stops. We will...
Joshua Colp [Mon, 9 Feb 2009 14:48:21 +0000 (14:48 +0000)] 
Don't overwrite our pointer to the music class when music on hold stops. We will use this if it starts again to see if we can resume the music where it left off.
(closes issue #14407)
Reported by: mostyn

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@174218 65c4cc65-6c06-0410-ace0-fbb531ad65f3

16 years agoFix a race condition that could cause a crash.
Russell Bryant [Sat, 7 Feb 2009 16:15:07 +0000 (16:15 +0000)] 
Fix a race condition that could cause a crash.

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@174148 65c4cc65-6c06-0410-ace0-fbb531ad65f3

16 years agocheck ast_strlen_zero() before calling ast_strdupa() in sip_uri_headers_cmp()
Dwayne M. Hubbard [Fri, 6 Feb 2009 23:36:03 +0000 (23:36 +0000)] 
check ast_strlen_zero() before calling ast_strdupa() in sip_uri_headers_cmp()
and sip_uri_params_cmp()

The reporter didn't actually upload a properly-formed patch, instead a
modified chan_sip.c file was uploaded.  I created a patch to determine the
changes, then modified the suggested changes to create a proper fix.  The
summary above is a complete description of the changes.

(closes issue #13547)
Reported by: tecnoxarxa
Patches:
      chan_sip.c.gz uploaded by tecnoxarxa (license 258)
Tested by: tecnoxarxa

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@174082 65c4cc65-6c06-0410-ace0-fbb531ad65f3

16 years agoRemove a debug message I put in by accident.
Joshua Colp [Fri, 6 Feb 2009 17:15:01 +0000 (17:15 +0000)] 
Remove a debug message I put in by accident.

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@173968 65c4cc65-6c06-0410-ace0-fbb531ad65f3

16 years agoSome clients do not put the call-id for replaces at the beginning, so support it...
Joshua Colp [Fri, 6 Feb 2009 17:14:15 +0000 (17:14 +0000)] 
Some clients do not put the call-id for replaces at the beginning, so support it being anywhere in the string.
(closes issue #14350)
Reported by: fhackenberger

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@173967 65c4cc65-6c06-0410-ace0-fbb531ad65f3

16 years agoLimit the addition of the Contact header in SIP responses according to various
Matthew Nicholson [Fri, 6 Feb 2009 16:20:23 +0000 (16:20 +0000)] 
Limit the addition of the Contact header in SIP responses according to various
SIP RFCs.

(closes issue #13602)
Reported by: hjourdain
Tested by: mnicholson

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@173917 65c4cc65-6c06-0410-ace0-fbb531ad65f3

16 years agoBackport OS X fix from trunk
Tilghman Lesher [Fri, 6 Feb 2009 15:43:32 +0000 (15:43 +0000)] 
Backport OS X fix from trunk
(AGAIN, closes issue #14360)

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@173900 65c4cc65-6c06-0410-ace0-fbb531ad65f3

16 years agoFix logic regarding when to perform an SRV lookup for outgoing REGISTER requests
Mark Michelson [Thu, 5 Feb 2009 23:19:16 +0000 (23:19 +0000)] 
Fix logic regarding when to perform an SRV lookup for outgoing REGISTER requests

With this fix, we only will perform an SRV lookup at the following times:

* The first time we register with a remote registrar
* If we send a REGISTER but do not receive a response
* If the sendto() function returns an error

While I wrote the patch that fixes this issue, a huge amount of credit is due
to Brett Bryant, who wrote the initial patch on which I based this one.

(closes issue #12312)
Reported by: jrast
Patches:
      12312.patch uploaded by putnopvut (license 60)
Tested by: blitzrage

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

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@173770 65c4cc65-6c06-0410-ace0-fbb531ad65f3

16 years agoAdd new configuration option to make shared IMAP mailboxes function as expected.
Jeff Peeler [Thu, 5 Feb 2009 20:47:51 +0000 (20:47 +0000)] 
Add new configuration option to make shared IMAP mailboxes function as expected.

The new option is "imapvmshareid" which is an ID to tag multiple mailboxes
using the same IMAP storage location to function as one mailbox. This allows
all messages to be retrieved for any user in the group. The patch alters the
'X-Asterisk-VM-Extension' header that is responsible for matching voicemails
for a given user.

(closes issue #13673)
Reported by: howardwilkinson

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@173696 65c4cc65-6c06-0410-ace0-fbb531ad65f3

16 years agoFix situations where queue members could be autopaused unexpectedly
Mark Michelson [Thu, 5 Feb 2009 20:29:09 +0000 (20:29 +0000)] 
Fix situations where queue members could be autopaused unexpectedly

Specifically, this patch prevents us from autopausing members when
we receive a busy or congestion frame from them.

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

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@173692 65c4cc65-6c06-0410-ace0-fbb531ad65f3

16 years agoAdd some missing cleanup to app_mixmonitor
Mark Michelson [Thu, 5 Feb 2009 18:47:24 +0000 (18:47 +0000)] 
Add some missing cleanup to app_mixmonitor

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@173592 65c4cc65-6c06-0410-ace0-fbb531ad65f3

16 years agoFix a problem where a channel pointer becomes invalid due to masquerading or hanging up.
Mark Michelson [Thu, 5 Feb 2009 17:34:33 +0000 (17:34 +0000)] 
Fix a problem where a channel pointer becomes invalid due to masquerading or hanging up.

app_mixmonitor runs its own thread to monitor the channel's activity and write the mixed
audio to a file. Since this thread runs independently of the channel, it is possible that
the mixmonitor thread's channel pointer will point to freed memory when the channel either
is masqueraded or hangs up (technically, both cases are hangups, but we need to handle the
cases slightly differently).

The solution for this is to employ a datastore, which has the nice benefit of allowing us
to hook into channel masquerades and hangups and update our pointer as necessary. If this
looks familiar, this same technique is employed in app_chanspy. app_chanspy is a bit more
involved since it does a lot more operations on the channel that is being spied upon.

app_mixmonitor does have an extra touch that app_chanspy doesn't have, though. Since there
is a thread race between the channel's thread and the mixmonitor thread on a hangup, we em-
ploy a condition-and-boolean combination to ensure that the channel thread finishes with
our structure before the mixmonitor thread attempts to free it. No crashes!

(closes issue #14374)
Reported by: aragon
Patches:
  14374.patch uploaded by putnopvut (license 60)
Tested by: aragon, putnopvut

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@173559 65c4cc65-6c06-0410-ace0-fbb531ad65f3

16 years agoRevert my previous change because it was stupid
Mark Michelson [Wed, 4 Feb 2009 17:44:48 +0000 (17:44 +0000)] 
Revert my previous change because it was stupid

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@173396 65c4cc65-6c06-0410-ace0-fbb531ad65f3

16 years agoAdd a missing unlock. Extremely unlikely to ever matter, but it's needed.
Mark Michelson [Wed, 4 Feb 2009 17:40:29 +0000 (17:40 +0000)] 
Add a missing unlock. Extremely unlikely to ever matter, but it's needed.

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@173392 65c4cc65-6c06-0410-ace0-fbb531ad65f3

16 years agoFixes issue with IAX2 transfer not handing off calls.
David Vossel [Tue, 3 Feb 2009 23:35:55 +0000 (23:35 +0000)] 
Fixes issue with IAX2 transfer not handing off calls.

Fixes issue with IAX2 transfers not taking place.  As it was, a call that was being transfered would never be handed off correctly to the call ends because of how call numbers were stored in a hash table.  The hash table, "iax_peercallno_pvt", storing all the current call numbers did not take into account the complications associated with transferring a call, so a separate hash table was required.  This second hash table "iax_transfercallno_pvt" handles calls being transfered, once the call transfer is complete the call is removed from the transfer hash table and added to the peer hash table resuming normal operations. Addition functions were created to handle storing, removing, and comparing items in the iax_transfercallno_pvt table.

(issue #13468)
Review: http://reviewboard.digium.com/r/140/

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@173248 65c4cc65-6c06-0410-ace0-fbb531ad65f3

16 years agoParking attempts made to one end of a bridge no longer will hang up due to a
Jeff Peeler [Tue, 3 Feb 2009 21:57:01 +0000 (21:57 +0000)] 
Parking attempts made to one end of a bridge no longer will hang up due to a
parking failure.

Parking attempts made using either one-touch, or doing either a blind or
assisted transfer to the parking extension now keep up the bridge instead of
hanging up the attempted parked party. Normal causes for the parking attempt
to fail includes the specific specified extension (via PARKINGEXTEN) not being
available or if all the parking spaces are currently in use. To avoid having
to reverse a masquerade park_space_reserve was made to provide foresight if
a parking attempt will succeed and if so reserve the parking space.

(closes issue #13494)
Reported by: mdu113

Reviewed by Russell: http://reviewboard.digium.com/r/133/

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@173211 65c4cc65-6c06-0410-ace0-fbb531ad65f3

16 years agoAdd warning to standard config, that globals may be overridden by other
Tilghman Lesher [Tue, 3 Feb 2009 00:15:59 +0000 (00:15 +0000)] 
Add warning to standard config, that globals may be overridden by other
dialplan configuration files.
(closes issue #14388)
 Reported by: macli

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@173070 65c4cc65-6c06-0410-ace0-fbb531ad65f3

16 years agoFix a feature inheritance bug I added after code review
Terry Wilson [Mon, 2 Feb 2009 23:48:06 +0000 (23:48 +0000)] 
Fix a feature inheritance bug I added after code review

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@173066 65c4cc65-6c06-0410-ace0-fbb531ad65f3

16 years agochannels/chan_dahdi.c
Richard Mudgett [Mon, 2 Feb 2009 20:28:54 +0000 (20:28 +0000)] 
channels/chan_dahdi.c
*  Added doxygen comments to the major dahdi structures.
*  Fixed PRI using an incorrect string value if the extension
delimiter is not present in the Dial() function.
*  Fixed some uninitialized string variables on FXS ports.

configs/chan_dahdi.conf.sample
*  Updated some documentation.

These changes are already in trunk -r172400

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@172962 65c4cc65-6c06-0410-ace0-fbb531ad65f3

16 years agoRename new parkedcallparking option to parkedcallreparking
Terry Wilson [Sat, 31 Jan 2009 00:15:09 +0000 (00:15 +0000)] 
Rename new parkedcallparking option to parkedcallreparking

Since this option actually already existed in 1.6.0+, use the same name so as
not to confuse people when they upgrade

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@172639 65c4cc65-6c06-0410-ace0-fbb531ad65f3

16 years agoFix feature inheritance with builtin features
Terry Wilson [Fri, 30 Jan 2009 17:47:41 +0000 (17:47 +0000)] 
Fix feature inheritance with builtin features

When using builtin features like parking and transfers, the AST_FEATURE_* flags
would not be set correctly for all instances when either performing a builtin
attended transfer, or parking a call and getting the timeout callback.  Also,
there was no way on a per-call basis to specify what features someone should
have on picking up a parked call (since that doesn't involve the Dial() command).
There was a global option for setting whether or not all users who pickup a
parked call should have AST_FEATURE_REDIRECT set, but nothing for DISCONNECT,
AUTOMON, or PARKCALL.

This patch:
1) adds the BRIDGE_FEATURES dialplan variable which can be set either in the
dialplan or with setvar in channels that support it.  This variable can be set
to any combination of 't', 'k', 'w', and 'h' (case insensitive matching of the
equivalent dial options), to set what features should be activated on this
channel.  The patch moves the setting of the features datastores into the
bridging code instead of app_dial to help facilitate this.

2) adds global options parkedcallparking, parkedcallhangup, and
parkedcallrecording to be similar to the parkedcalltransfers option for
globally setting features.

3) has builtin_atxfer call builtin_parkcall if being transfered to the parking
extension since tracking everything through multiple masquerades, etc. is
difficult and error-prone

4) attempts to fix all cases of return calls from parking and completed builtin
transfers not having the correct permissions
(closes issue #14274)
Reported by: aragon
Patches:
      fix_feature_inheritence.diff.txt uploaded by otherwiseguy (license 396)
Tested by: aragon, otherwiseguy

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

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@172517 65c4cc65-6c06-0410-ace0-fbb531ad65f3

16 years agoLose the CAP_NET_ADMIN at every fork, instead of at startup. Otherwise, if
Tilghman Lesher [Thu, 29 Jan 2009 22:54:29 +0000 (22:54 +0000)] 
Lose the CAP_NET_ADMIN at every fork, instead of at startup.  Otherwise, if
Asterisk runs as a non-root user and the administrator does a 'restart now',
Asterisk loses the ability to set QOS on packets.
(closes issue #14004)
 Reported by: nemo
 Patches:
       20090105__bug14004.diff.txt uploaded by Corydon76 (license 14)
 Tested by: Corydon76

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@172438 65c4cc65-6c06-0410-ace0-fbb531ad65f3

16 years agoMake sure that we always add the hangupcause headers. In some cases, the owner was...
Olle Johansson [Thu, 29 Jan 2009 08:48:18 +0000 (08:48 +0000)] 
Make sure that we always add the hangupcause headers. In some cases, the owner was disconnected before we checked for the cause.
This patch implements a temporary storage in the pvt and use that instead.

The code is based on ideas from code from Adomjan in issue #13385 (Add support for Reason: header)
Thanks to Klaus Darillion for testing!

(closes issue #14294)
related to issue #13385

Reported by: klaus3000 and adomjan
Patches:
      bug14294b.diff uploaded by oej (license 306)
      Based on 20080829_chan_sip.c-q850reason_header.patch uploaded by adomjan (license 487)
Tested by: oej, klaus3000

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@172169 65c4cc65-6c06-0410-ace0-fbb531ad65f3

16 years agoThis patch fixes h-exten running misbehavior in manager-redirected
Steve Murphy [Wed, 28 Jan 2009 18:51:16 +0000 (18:51 +0000)] 
This patch fixes h-exten running misbehavior in manager-redirected
situations.

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

(closes issue #14241)
Reported by: jmls
Patches:
      14241_redirect_no_bridgeCDR_or_h_exten_via_transfer uploaded by murf (license 17)
Tested by: murf, jmls

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@172030 65c4cc65-6c06-0410-ace0-fbb531ad65f3

16 years agoClarify log message (suggested by manxpower on #asterisk-dev)
Tilghman Lesher [Wed, 28 Jan 2009 17:25:18 +0000 (17:25 +0000)] 
Clarify log message (suggested by manxpower on #asterisk-dev)

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@171963 65c4cc65-6c06-0410-ace0-fbb531ad65f3

16 years agoAdd a better explanation of the difference between the device namespace and the dialp...
Olle Johansson [Wed, 28 Jan 2009 13:07:27 +0000 (13:07 +0000)] 
Add a better explanation of the difference between the device namespace and the dialplan for newbies.

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@171837 65c4cc65-6c06-0410-ace0-fbb531ad65f3

16 years agoFix devicestate problems for "always-on" agent channels
Mark Michelson [Tue, 27 Jan 2009 21:55:08 +0000 (21:55 +0000)] 
Fix devicestate problems for "always-on" agent channels

A revision to chan_agent attempted to "inherit" the device
state of the underlying channel in order to report the
device state of an agent channel more accurately.

The problem with the logic here is that it makes no sense to
use this for always-on agents. If the agent is logged in, then
to the underlying channel, the agent will always appear to be
"in use," no matter if the agent is on a call or not. The reason
is that to the underlying channel, the channel is currently in use
on a call to the AgentLogin application.

The most common cause that I found for this issue to occur was for
a SIP channel to be the underlying channel type for an Agent channel.
If the SIP phone re-registers, then the registration will cause the
device state core to query the device state of the SIP channel. Since the
SIP channel is in use, the Agent channel would also inherit this status.
Once the agent channel was set to "in use" there was no way that the device
state could change on that channel unless the agent logged out.

The solution for this problem is a bit different in 1.4 than it is in the
other branches. In 1.4, there will be a one-line fix to make sure that only
callback agents will inherit device state from their underlying channel type.
For the other branches of Asterisk, since callback support has been removed, there
is also no need for device state inheritance in chan_agent, so I will simply be
removing it from the code.

In addition, the 1.4 source is getting a new comment to help the next person who
edits chan_agent.c. I'm adding a comment that a agent_pvt's loginchan field may be
used to determine if the agent is a callback agent or not.

(closes issue #14173)
Reported by: nathan
Patches:
      14173.patch uploaded by putnopvut (license 60)
Tested by: nathan, aramirez

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@171689 65c4cc65-6c06-0410-ace0-fbb531ad65f3

16 years agoPrevent a crash from occurring when a jitter buffer interpolated frame is
Mark Michelson [Tue, 27 Jan 2009 20:06:01 +0000 (20:06 +0000)] 
Prevent a crash from occurring when a jitter buffer interpolated frame is
removed from a slinfactory

slinfactory used the "samples" field of an ast_frame in order to determine
the amount of data contained within the frame. In certain cases, such as
jitter buffer interpolated frames, the frame would have a non-zero value for
"samples" but have NULL "data"

This caused a problem when a memcpy call in ast_slinfactory_read would attempt
to access invalid memory. The solution in use here is to never feed frames into
the slinfactory if they have NULL "data"

(closes issue #13116)
Reported by: aragon
Patches:
      13116.diff uploaded by putnopvut (license 60)

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@171621 65c4cc65-6c06-0410-ace0-fbb531ad65f3

16 years agoUse the same branch tag in CANCEL as in INVITE
Olle Johansson [Tue, 27 Jan 2009 14:33:20 +0000 (14:33 +0000)] 
Use the same branch tag in CANCEL as in INVITE

Originally putnopvut implemented some changes in revision 142079 that according to the bug report seemed to have worked then, but somehow fails now.
I guess code, as humans, get old and forget stuff. Anyway, this bug caused CANCEL not to work with picky systems.

Thanks Fredrik for pointing out where the bug in the SIP messaging was.

(closes issue #14346)
Reported by: oej
Patches:
      bug14346.diff uploaded by oej (license 306)
Tested by: oej

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@171527 65c4cc65-6c06-0410-ace0-fbb531ad65f3

16 years agoResolve some synchronization issues in chan_iax2 scheduler handling.
Russell Bryant [Mon, 26 Jan 2009 21:31:59 +0000 (21:31 +0000)] 
Resolve some synchronization issues in chan_iax2 scheduler handling.

The important changes here are related to the synchronization between threads
adding items into the scheduler and the scheduler handling thread.  By adjusting
the lock and condition handling, we ensure that the scheduler thread sleeps no
longer and no less than it is supposed to.  We also ensure that it does not
wake up more often than it has to.

There is no bug report associated with this.  It is just something that I found
while putting scheduler thread handling into a reusable form (review 129).

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

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@171452 65c4cc65-6c06-0410-ace0-fbb531ad65f3

16 years agoDon't retransmit 401 on REGISTER requests when alwaysauthreject=yes
Olle Johansson [Mon, 26 Jan 2009 12:51:53 +0000 (12:51 +0000)] 
Don't retransmit 401 on REGISTER requests when alwaysauthreject=yes

(closes issue #14284)
Reported by: klaus3000
Patches:
      patch_chan_sip_unreliable_1.4.23_14284.txt uploaded by klaus3000 (license 65)
Tested by: klaus3000

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@171264 65c4cc65-6c06-0410-ace0-fbb531ad65f3

16 years agoCorrectly track the hookstate
Tilghman Lesher [Sun, 25 Jan 2009 23:44:01 +0000 (23:44 +0000)] 
Correctly track the hookstate
(closes issue #13686)
 Reported by: itiliti
 Patches:
       20081013__bug13686.diff.txt uploaded by Corydon76 (license 14)

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@171187 65c4cc65-6c06-0410-ace0-fbb531ad65f3

16 years agoErr, yeah.
Tilghman Lesher [Sun, 25 Jan 2009 20:40:44 +0000 (20:40 +0000)] 
Err, yeah.

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@171122 65c4cc65-6c06-0410-ace0-fbb531ad65f3

16 years agoAdd thread to kill zombies, when child processes don't die immediately on
Tilghman Lesher [Sun, 25 Jan 2009 20:30:41 +0000 (20:30 +0000)] 
Add thread to kill zombies, when child processes don't die immediately on
SIGHUP.
(closes issue #13968)
 Reported by: eldadran
 Patches:
       20090114__bug13968.diff.txt uploaded by Corydon76 (license 14)
 Tested by: eldadran

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@171120 65c4cc65-6c06-0410-ace0-fbb531ad65f3

16 years agoResolve a logic error that was causing Page() to crash when more than one
Sean Bright [Sun, 25 Jan 2009 13:33:20 +0000 (13:33 +0000)] 
Resolve a logic error that was causing Page() to crash when more than one
channel was specified.

(closes issue #14308)
Reported by: bluefox
Patches:
      20090124__bug14308.diff.txt uploaded by seanbright (license 71)
Tested by: kc0bvu

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@170979 65c4cc65-6c06-0410-ace0-fbb531ad65f3

16 years agoRemove superfluous implementation note (closes issue #14319)
Tilghman Lesher [Sat, 24 Jan 2009 13:55:02 +0000 (13:55 +0000)] 
Remove superfluous implementation note (closes issue #14319)

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@170836 65c4cc65-6c06-0410-ace0-fbb531ad65f3

16 years agoAdd notes to the idlecheck explanation in res_odbc.conf.sample
Mark Michelson [Fri, 23 Jan 2009 20:55:26 +0000 (20:55 +0000)] 
Add notes to the idlecheck explanation in res_odbc.conf.sample

(closes issue #14319)
Reported by: klaus3000
Patches:
      patch_idlecheck_res_odbc.conf.sample.txt uploaded by klaus3000 (license 65)

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@170719 65c4cc65-6c06-0410-ace0-fbb531ad65f3