]> git.ipfire.org Git - thirdparty/asterisk.git/log
thirdparty/asterisk.git
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

16 years agoUpdate contrib/i18n.testsuite.conf to not use deprecated syntax
Mark Michelson [Fri, 23 Jan 2009 20:21:51 +0000 (20:21 +0000)] 
Update contrib/i18n.testsuite.conf to not use deprecated syntax

* Convert Wait,1 to Wait(1)
* Convert SetLanguage to Set(CHANNEL(language))
* Use 'n' for all priorities beyond the first

Also added test for Chinese numbers, too.

(closes issue #14320)
Reported by: dant
Patches:
      i18n.testsuite.conf.issue14320.v2.diff uploaded by dant (license 670)

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

16 years agoWhen a channel is answered make sure any indications currently playing stop. Usually...
Joshua Colp [Fri, 23 Jan 2009 20:16:39 +0000 (20:16 +0000)] 
When a channel is answered make sure any indications currently playing stop. Usually the phone would do this but if the channel was already answered then they are being generated by Asterisk and we darn well need to stop them.
(closes issue #14249)
Reported by: RadicAlish

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

16 years agoAdditions to AST-2009-001
Tilghman Lesher [Fri, 23 Jan 2009 19:20:44 +0000 (19:20 +0000)] 
Additions to AST-2009-001

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

16 years agoWhen a call is forwarded stop any active indications. The new channel will provide...
Joshua Colp [Fri, 23 Jan 2009 19:06:54 +0000 (19:06 +0000)] 
When a call is forwarded stop any active indications. The new channel will provide an indication, if need be, itself.
(closes issue #14310)
Reported by: RadicAlish

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

16 years agoUse the on hold flag to see if the call is on hold or not. It is possible that our...
Joshua Colp [Fri, 23 Jan 2009 18:04:08 +0000 (18:04 +0000)] 
Use the on hold flag to see if the call is on hold or not. It is possible that our address for them will still be valid even though they are on hold.
(closes issue #14295)
Reported by: klaus3000

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

16 years agoFix broken call pickup
Mark Michelson [Fri, 23 Jan 2009 15:40:39 +0000 (15:40 +0000)] 
Fix broken call pickup

There was a subtle change in ast_do_masquerade which
resulted in failed attempts to pickup calls. The problem
was that the value of the AST_FLAG_OUTGOING flag was
copied from the clone to the original channel. In the case
of call pickup, this meant that the AST_FLAG_OUTGOING flag
ended up being cleared on the channel that was attempting
to execute the pickup.

Because this flag was not set, when ast_read came across
an answer frame, it ignored it. The result of this was that
the calling channel was never properly answered.

This fix changes the behavior in ast_do_masquerade to set
the flags on the original channel to the union of the flags
on the clone channel. This way, if the AST_FLAG_OUTGOING
flag is set on either of the two channels involved in the
masquerade, the resulting channel will have the flag set
as well.

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

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

16 years agoDon't crash if RTCP is not enabled on an RTP structure but statistics are output.
Joshua Colp [Thu, 22 Jan 2009 20:02:35 +0000 (20:02 +0000)] 
Don't crash if RTCP is not enabled on an RTP structure but statistics are output.
(closes issue #14234)
Reported by: jcovert
Patches:
      rtp.c.patch-1.6.0.3 uploaded by jcovert (license 551)
      rtp.c.patch-svn-165599 uploaded by jcovert (license 551)

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

16 years agoAllow global variables after substitution to be as long as other variables.
Tilghman Lesher [Thu, 22 Jan 2009 17:18:07 +0000 (17:18 +0000)] 
Allow global variables after substitution to be as long as other variables.
(closes issue #14263)
 Reported by: markd
 Patches:
       20090120__bug14263.diff.txt uploaded by Corydon76 (license 14)

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

16 years agoIf we are unable to request a DAHDI pseudo channel and we are using the user introduc...
Joshua Colp [Thu, 22 Jan 2009 16:50:54 +0000 (16:50 +0000)] 
If we are unable to request a DAHDI pseudo channel and we are using the user introduction without review option make sure it gets unset so other code does not blindly assume a DAHDI pseudo channel exists.
(closes issue #14282)
Reported by: cheesegrits

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

16 years agoDo a string comparison instead of pointer comparison since some people specify the...
Joshua Colp [Thu, 22 Jan 2009 15:13:56 +0000 (15:13 +0000)] 
Do a string comparison instead of pointer comparison since some people specify the context they are actually in as an argument to get around some funkiness.
(closes issue #14011)
Reported by: dveiga
Patches:
      pbx.c.patch uploaded by dveiga (license 665)

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

16 years agoAST_RWLOCK_INIT_VALUE is always defined. What we really wanted to ask is
Tilghman Lesher [Thu, 22 Jan 2009 00:43:31 +0000 (00:43 +0000)] 
AST_RWLOCK_INIT_VALUE is always defined.  What we really wanted to ask is
whether autoconf detected a static initializer value.  This fixes rwlocks
on all such platforms (mainly, Mac OS X).
(closes issue #13767)
 Reported by: jcovert
 Patches:
       20090121__bug13767.diff.txt uploaded by Corydon76 (license 14)
 Tested by: jcovert, Corydon76

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

16 years agoFix builtin_blindtransfer calling back the wrong channel
Terry Wilson [Wed, 21 Jan 2009 23:23:59 +0000 (23:23 +0000)] 
Fix builtin_blindtransfer calling back the wrong channel

Blindtransfer also was calling back the wrong channel when a timeout occurred.
This should be the last of these, as there are no more masq_park_announce calls
that aren't passing orig_chan_name

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

16 years agoRead lock the contexts to maintain the locking order when we are notified that the...
Joshua Colp [Wed, 21 Jan 2009 23:20:47 +0000 (23:20 +0000)] 
Read lock the contexts to maintain the locking order when we are notified that the state of a device has changed.
(closes issue #13839)
Reported by: mcallist

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

16 years agoAdding revision 169794 to 1.4 since 1.4 is also affected by the issue
Mark Michelson [Wed, 21 Jan 2009 22:14:52 +0000 (22:14 +0000)] 
Adding revision 169794 to 1.4 since 1.4 is also affected by the issue

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

16 years agoExtra NULLs in the output cause some terminal types to abort in the middle of
Tilghman Lesher [Wed, 21 Jan 2009 21:02:32 +0000 (21:02 +0000)] 
Extra NULLs in the output cause some terminal types to abort in the middle of
a color code, causing terminal weirdness.
(closes issue #14130)
 Reported by: coolmig
 Patches:
       20090121__bug14130.diff.txt uploaded by Corydon76 (license 14)
 Tested by: Corydon76, coolmig

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

16 years agoOne-touch parking was calling back the wrong channel on timeout
Terry Wilson [Tue, 20 Jan 2009 23:49:34 +0000 (23:49 +0000)] 
One-touch parking was calling back the wrong channel on timeout

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

16 years agoDon't play audio to the channel if we've masqueraded
Terry Wilson [Tue, 20 Jan 2009 18:40:56 +0000 (18:40 +0000)] 
Don't play audio to the channel if we've masqueraded

(closes issue #14066)
Reported by: bluefox
Tested by: otherwiseguy, bluefox

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

16 years agoTruncate userevents at the end of a line, when the command exceeds the buffer.
Tilghman Lesher [Mon, 19 Jan 2009 19:49:25 +0000 (19:49 +0000)] 
Truncate userevents at the end of a line, when the command exceeds the buffer.
(closes issue #14278)
 Reported by: fnordian

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

16 years agoPrevent a crash in chan_local due to a potential NULL pointer dereference
Mark Michelson [Mon, 19 Jan 2009 15:52:15 +0000 (15:52 +0000)] 
Prevent a crash in chan_local due to a potential NULL pointer dereference

Move the check for if both channels on a local_pvt have generators to below
where p->chan is checked for NULLity (NULLness?). This prevents a crash from
occurring if p->chan is NULL.

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

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

16 years agoAccount for possible NULL pointer when we receive a 408 in response to a REGISTER
Mark Michelson [Fri, 16 Jan 2009 22:42:13 +0000 (22:42 +0000)] 
Account for possible NULL pointer when we receive a 408 in response to a REGISTER

It may be that by the time we receive a reply to a REGISTER request, the attempt has
timed out and thus the registry structure pointed to by the corresponding sip_pvt has
gone away. This situation was handled properly for a 200 OK response, but the 408
case assumed that the sip_registry struct was non-NULL, thus potentially causing a crash

This commit fixes this assumption and prints out a message to the console if we should
receive a late 408 response to a REGISTER

(closes issue #14211)
Reported by: aborghi
Patches:
      14211.diff uploaded by putnopvut (license 60)
Tested by: aborghi

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

16 years agoFix the conjugation of Russian and Ukrainian languages.
Tilghman Lesher [Fri, 16 Jan 2009 18:41:35 +0000 (18:41 +0000)] 
Fix the conjugation of Russian and Ukrainian languages.
(related to issue #12475)
 Reported by: chappell
 Patches:
       vm_multilang.patch uploaded by chappell (license 8)

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

16 years agoThis patch fixes a problem where a goto (or jump, in this case)
Steve Murphy [Fri, 16 Jan 2009 00:19:12 +0000 (00:19 +0000)] 
This patch fixes a problem where a goto (or jump, in this case)
fails a consistency check because it can't find a matching
extension. The problem was a missing instruction to end
the range notation in the code where it converts the pattern
into a regex and uses the regex code to determine the match.

I tested using the AEL code the user supplied, and now,
the consistency check passes.

(closes issue #14141)
Reported by: dimas

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

16 years agoMeetme actually has realtime but wasn't documented
Olle Johansson [Thu, 15 Jan 2009 18:43:43 +0000 (18:43 +0000)] 
Meetme actually has realtime but wasn't documented

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

16 years agoConvert call to park_call_full to masq_park_call_announce
Terry Wilson [Thu, 15 Jan 2009 18:22:49 +0000 (18:22 +0000)] 
Convert call to park_call_full to masq_park_call_announce

Since we removed the AST_PBX_KEEPALIVE return value, we need to use masqueraded
parking, otherwise we will try to call ast_hangup() in __pbx_run() and in
do_parking_thread() and then promptly crash.
(closes issue #14215)
Reported by: waverly360
Tested by: otherwiseguy
(closes issue #14228)
Reported by: kobaz
Tested by: otherwiseguy

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

16 years agoBlocked revision 168632 from /branches/1.2:
Tilghman Lesher [Thu, 15 Jan 2009 01:20:20 +0000 (01:20 +0000)] 
Blocked revision 168632 from /branches/1.2:

1.2 regression on security fix AST-2009-001
(Closes issue #14238)

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

16 years agoFix some crashes from bad datastore handling in app_queue.c
Mark Michelson [Thu, 15 Jan 2009 00:11:01 +0000 (00:11 +0000)] 
Fix some crashes from bad datastore handling in app_queue.c

* The queue_transfer_fixup function was searching for and removing
  the datastore from the incorrect channel, so this was fixed.

* Most datastore operations regarding the queue_transfer datastore
  were being done without the channel locked, so proper channel locking
  was added, too.

(closes issue #14086)
Reported by: ZX81
Patches:
      14086v2.patch uploaded by putnopvut (license 60)
Tested by: ZX81, festr

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

16 years ago* Fixed create_process() allocation of process ID values.
Richard Mudgett [Wed, 14 Jan 2009 21:48:22 +0000 (21:48 +0000)] 
*  Fixed create_process() allocation of process ID values.
The allocated process IDs could overflow their respective
NT and TE fields.  Affects outgoing calls.

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

16 years agoUpdate autosupport script to supply info for both Zaptel and DAHDI in 1.4 and
Sean Bright [Wed, 14 Jan 2009 20:52:00 +0000 (20:52 +0000)] 
Update autosupport script to supply info for both Zaptel and DAHDI in 1.4 and
be sure to run dahdi_test in 1.6.x and trunk instead of zttest.

(closes issue #14132)
Reported by: dsedivec
Patches:
      asterisk-1.4-autosupport.patch uploaded by dsedivec (license 638)
      asterisk-trunk-autosupport.patch uploaded by dsedivec (license 638)

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

16 years agoapp_page was failing to compile in dev-mode on my gcc-4.2.4 system. This change gets...
Steve Murphy [Wed, 14 Jan 2009 19:34:35 +0000 (19:34 +0000)] 
app_page was failing to compile in dev-mode on my gcc-4.2.4 system. This change gets rid of the warning.

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

16 years agoDon't read into a buffer without first checking if a value is beyond the end.
Tilghman Lesher [Wed, 14 Jan 2009 19:02:55 +0000 (19:02 +0000)] 
Don't read into a buffer without first checking if a value is beyond the end.
(closes issue #13600)
 Reported by: atis
 Patches:
       20090106__bug13600.diff.txt uploaded by Corydon76 (license 14)
 Tested by: atis

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

16 years agoFix a logic error I found while searching through chan_agent.c
Mark Michelson [Wed, 14 Jan 2009 16:19:26 +0000 (16:19 +0000)] 
Fix a logic error I found while searching through chan_agent.c

I found that the allow_multiple_logins function would never return
0 due to an incorrect comparison being used when traversing the
list of agents. While I was modifying this function, I also did
a little bit of coding guidelines cleanup, too.

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

16 years agoDon't overflow when paging more than 128 extensions
Terry Wilson [Wed, 14 Jan 2009 01:27:18 +0000 (01:27 +0000)] 
Don't overflow when paging more than 128 extensions

The number of available slots for calls in app_page was hardcoded to 128.
Proper bounds checking was not in place to enforce this limit, so if more than
128 extensions were passed to the Page() app, Asterisk would crash.  This patch
instead dynamically allocates memory for the ast_dial structures and removes
the (non-functional) arbitrary limit.

This issue would have special importance to anyone who is dynamically creating
the argument passed to the Page application and allowing more than 128
extensions to be added by an outside user via some external interface.

The patch posted by a_villacis was slightly modified for some coding guidelines
and other cleanups.  Thanks, a_villacis!
(closes issue #14217)
Reported by: a_villacis
Patches:
      20080912-asterisk-app_page-fix-buffer-overflow.patch uploaded by a (license 660)
Tested by: otherwiseguy

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

16 years agoRevert unnecessary indications API change from rev 122314
Russell Bryant [Tue, 13 Jan 2009 19:13:05 +0000 (19:13 +0000)] 
Revert unnecessary indications API change from rev 122314

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

16 years agoDon't pass a value with a side effect to a macro
Terry Wilson [Tue, 13 Jan 2009 18:34:14 +0000 (18:34 +0000)] 
Don't pass a value with a side effect to a macro

(closes issue #14176)
Reported by: paraeco
Patches:
      chan_sip.c.diff uploaded by paraeco (license 658)

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

16 years agoIf either conditional is NULL, don't try copying it.
Tilghman Lesher [Tue, 13 Jan 2009 17:48:00 +0000 (17:48 +0000)] 
If either conditional is NULL, don't try copying it.
(closes issue #14226)
 Reported by: caspy
 Patches:
       20090113__bug14226.diff.txt uploaded by Corydon76 (license 14)

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

16 years ago(closes issue #13881)
Jeff Peeler [Mon, 12 Jan 2009 21:42:34 +0000 (21:42 +0000)] 
(closes issue #13881)
Reported by: hoowa

Update the app CDR field for AGI commands that are not executing an application via "exec".

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

16 years ago(closes issue #12269)
Jeff Peeler [Mon, 12 Jan 2009 20:26:22 +0000 (20:26 +0000)] 
(closes issue #12269)
Reported by: IgorG
Tested by: denisgalvao

This gits rid of the notion of an owning_app allowing the request and hangup to be initiated by different threads. Originating from an active agent channel requires this. The implementation primarily changes __login_exec to wait on a condition variable rather than a lock.

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

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

16 years agoI am reverting the fix made in revision 168128 (and its upward merges)
Mark Michelson [Mon, 12 Jan 2009 14:58:25 +0000 (14:58 +0000)] 
I am reverting the fix made in revision 168128 (and its upward merges)
after being contacted by Olle Johansson and being shown how this fix is
incorrect. Thanks to Olle for clearing this up for me.

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

16 years agos/ringdance/ringcadence/ for Bulgaria
Russell Bryant [Mon, 12 Jan 2009 14:57:27 +0000 (14:57 +0000)] 
s/ringdance/ringcadence/ for Bulgaria

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

16 years agosmall commit to test new server
Kevin P. Fleming [Sat, 10 Jan 2009 20:47:31 +0000 (20:47 +0000)] 
small commit to test new server

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

16 years agosmall commit to test new server
Kevin P. Fleming [Sat, 10 Jan 2009 20:38:38 +0000 (20:38 +0000)] 
small commit to test new server

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

16 years agoupdate to use new sound file packages that include license files
Kevin P. Fleming [Fri, 9 Jan 2009 23:12:29 +0000 (23:12 +0000)] 
update to use new sound file packages that include license files

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

16 years agoMake this compile for mvanbaak
Russell Bryant [Fri, 9 Jan 2009 22:14:38 +0000 (22:14 +0000)] 
Make this compile for mvanbaak

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

16 years ago* Fix for JIRA AST-175/ABE-1757
Richard Mudgett [Fri, 9 Jan 2009 21:28:42 +0000 (21:28 +0000)] 
*  Fix for JIRA AST-175/ABE-1757
*  Miscellaneous doxygen comments added.

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

16 years agoAdd check_via calls to more request handlers
Mark Michelson [Fri, 9 Jan 2009 20:08:04 +0000 (20:08 +0000)] 
Add check_via calls to more request handlers

INFO, NOTIFY, OPTIONS, REFER, and MESSAGE requests
were not checking the topmost Via to determine where
to send the response. Adding check_via calls to those
request handlers solves this.

(closes issue #13071)
Reported by: baron
Patches:
      check_via.patch uploaded by baron (license 531)
Tested by: baron

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

16 years agoDon't truncate database results at 255 chars.
Tilghman Lesher [Thu, 8 Jan 2009 22:08:56 +0000 (22:08 +0000)] 
Don't truncate database results at 255 chars.
(closes issue #14069)
 Reported by: evandro
 Patches:
       20081214__bug14069.diff.txt uploaded by Corydon76 (license 14)

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

16 years agoremove an unnecessary argument to queue_request()
Kevin P. Fleming [Thu, 8 Jan 2009 17:24:21 +0000 (17:24 +0000)] 
remove an unnecessary argument to queue_request()

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

16 years agoWhen a SIP request or response arrives for a dialog with an associated Asterisk chann...
Kevin P. Fleming [Wed, 7 Jan 2009 23:32:21 +0000 (23:32 +0000)] 
When a SIP request or response arrives for a dialog with an associated Asterisk channel, and the lock on that channel cannot be obtained because it is held by another thread, instead of dropping the request/response, queue it for later processing when the channel lock becomes available.

http://reviewboard.digium.com/r/117/

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

16 years agoFix the last couple of places where free() was improperly used directly.
Russell Bryant [Wed, 7 Jan 2009 22:35:36 +0000 (22:35 +0000)] 
Fix the last couple of places where free() was improperly used directly.

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

16 years agoDon't fclose() the file early, the filestream destructor will handle it.
Russell Bryant [Wed, 7 Jan 2009 22:26:42 +0000 (22:26 +0000)] 
Don't fclose() the file early, the filestream destructor will handle it.

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

16 years agoOnly try to close the file if one was actually opened
Russell Bryant [Wed, 7 Jan 2009 22:19:47 +0000 (22:19 +0000)] 
Only try to close the file if one was actually opened

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

16 years agoDon't use free() directly. This caused a crash since ast_filestream is now an ao2...
Russell Bryant [Wed, 7 Jan 2009 22:03:59 +0000 (22:03 +0000)] 
Don't use free() directly.  This caused a crash since ast_filestream is now an ao2 object.

Reported by JunK-Y on IRC, #asterisk-dev

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

16 years agoTreat an empty string the same way as a NULL country argument.
Russell Bryant [Wed, 7 Jan 2009 17:29:53 +0000 (17:29 +0000)] 
Treat an empty string the same way as a NULL country argument.

In passing, simplify the handling of returning a default tone zone.

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

16 years agoUse the correct variable when creating the format string
Mark Michelson [Tue, 6 Jan 2009 21:35:57 +0000 (21:35 +0000)] 
Use the correct variable when creating the format string

(closes issue #14177)
Reported by: nic_bellamy
Patches:
      asterisk-trunk-svn-r167242-ast_db_gettree.patch uploaded by nic (license 299)

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

16 years agoMerged revisions 167259 via svnmerge from
Tilghman Lesher [Tue, 6 Jan 2009 20:48:05 +0000 (20:48 +0000)] 
Merged revisions 167259 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
  r167259 | tilghman | 2009-01-06 14:44:03 -0600 (Tue, 06 Jan 2009) | 2 lines

  Security fix AST-2009-001.
........

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

16 years agoA couple of changes to T.38 SDP attribute handling
Mark Michelson [Mon, 5 Jan 2009 16:51:59 +0000 (16:51 +0000)] 
A couple of changes to T.38 SDP attribute handling

There are some boolean attributes for T.38 such
as T38FaxFillBitRemoval, T38FaxTranscodingMMR, and
T38FaxTranscodingJBIG. By simply being present, we
should treat these as a "true" value. The current
code, however, was requiring a 1 or 0 as the value
of the attribute in order to parse it. This is due
to the fact that there are some T.38 endpoints and
gateways that also transmit this information
incorrectly. This patch follows the "be liberal in
what you accept and strict in what you send"
philosophy by accepting both the correctly- and
incorrectly-formatted attributes, but only sending
information as it is supposed to be sent.

It was also discovered that a particular type of
T.38 gateway sends some non-standard T.38 SDP
attributes. Instead of using T38FaxMaxDatagram
and T38MaxBitRate, it used T38MaxDatagram and
T38FaxMaxRate respectively. We now will properly
accept these attributes as well.

Note that there are a lot of patches cited in
the below commit message template. This is
because the person who submitted these patches is
an awesome person and wrote 1.4, 1.6.0, and 1.6.1
variants.

(closes issue #13976)
Reported by: linulin
Patches:
     chan_sip.c.1.4-update1.diff uploaded by arcivanov (license 648)
 chan_sip.c.1.6.0-update1.diff uploaded by arcivanov (license 648)
 chan_sip.c.1.6.1-update1.diff uploaded by arcivanov (license 648)
 chan_sip.c.1.4-relaxedT38_update1.diff uploaded by arcivanov (license 648)
 chan_sip.c.1.6.0-relaxedT38_update1.diff uploaded by arcivanov (license 648)
 chan_sip.c.1.6.1-relaxedT38_update1.diff uploaded by arcivanov (license 648)
Tested by: arcivanov

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

16 years agoRepeat attempts to write when we receive -EAGAIN from the driver, as detailed
Tilghman Lesher [Thu, 1 Jan 2009 00:01:22 +0000 (00:01 +0000)] 
Repeat attempts to write when we receive -EAGAIN from the driver, as detailed
in the ALSA sample code (see http://www.alsa-project.org/alsa-doc/alsa-lib/_2test_2pcm_8c-example.html#a32)
Reported by: Jerry Geis (via the -users list)
Fixed by: me (license 14)

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

16 years agoAlso inherit the musiconhold class.
Tilghman Lesher [Wed, 31 Dec 2008 19:20:35 +0000 (19:20 +0000)] 
Also inherit the musiconhold class.
(Closes #14153)
Reported by: Jerry Geis, via the users list.
Patch by: me (license 14)

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

16 years agoUse strncat() instead of an sprintf() in which source and target buffers overlap
Russell Bryant [Sun, 28 Dec 2008 15:13:48 +0000 (15:13 +0000)] 
Use strncat() instead of an sprintf() in which source and target buffers overlap

http://lists.digium.com/pipermail/asterisk-dev/2008-December/035919.html

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

16 years agoCompile, even if both DAHDI and Zaptel are not installed.
Tilghman Lesher [Tue, 23 Dec 2008 15:35:38 +0000 (15:35 +0000)] 
Compile, even if both DAHDI and Zaptel are not installed.
(Closes issue #14120)

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

16 years agoFix a crash resulting from a datastore with inheritance but no duplicate callback
Mark Michelson [Tue, 23 Dec 2008 15:16:26 +0000 (15:16 +0000)] 
Fix a crash resulting from a datastore with inheritance but no duplicate callback

The fix for this is to simply set the newly created datastore's data pointer
to NULL if it is inherited but has no duplicate callback.

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

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

16 years agoUse the integer form of condition for integer comparisons.
Tilghman Lesher [Tue, 23 Dec 2008 04:05:25 +0000 (04:05 +0000)] 
Use the integer form of condition for integer comparisons.
(closes issue #14127)
 Reported by: andrew

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

16 years agoFix a deadlock relating to channel locks and autoservice
Mark Michelson [Mon, 22 Dec 2008 20:56:29 +0000 (20:56 +0000)] 
Fix a deadlock relating to channel locks and autoservice

It has been discovered that if a channel is locked prior
to a call to ast_autoservice_stop, then it is likely that
a deadlock will occur. The reason is that the call to
ast_autoservice_stop has a check built into it to be sure
that the thread running autoservice is not currently trying
to manipulate the channel we are about to pull out of
autoservice.

The autoservice thread, however, cannot advance beyond where
it currently is, though, because it is trying to acquire
the lock of the channel for which autoservice is attempting
to be stopped.

The gist of all this is that a channel MUST NOT be locked
when attempting to stop autoservice on the channel.

In this particular case, the channel was locked by a call
to ast_read. A call to ast_exists_extension led to autoservice
being started and stopped due to the existence of dialplan
switches.

It may be that there are future commits which handle the same
symptoms but in a different location, but based on my looks through
the code, it is very rare to see a construct such as this one.

(closes issue #14057)
Reported by: rtrauntvein
Patches:
      14057v3.patch uploaded by putnopvut (license 60)
Tested by: rtrauntvein

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

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

16 years agoFix up timeout handling in ast_carefulwrite().
Russell Bryant [Mon, 22 Dec 2008 17:22:56 +0000 (17:22 +0000)] 
Fix up timeout handling in ast_carefulwrite().

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

16 years agoRe-work ref count handling of MoH classes using astobj2 to resolve crashes.
Russell Bryant [Mon, 22 Dec 2008 14:45:27 +0000 (14:45 +0000)] 
Re-work ref count handling of MoH classes using astobj2 to resolve crashes.

(closes issue #13566)
Reported by: igorcarneiro
Tested by: russell
Review: http://reviewboard.digium.com/r/106/

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

16 years agoBackport of AUDIOHOOK_INHERIT for Asterisk 1.4
Mark Michelson [Fri, 19 Dec 2008 23:34:57 +0000 (23:34 +0000)] 
Backport of AUDIOHOOK_INHERIT for Asterisk 1.4

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

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

16 years agoThis merges the masqpark branch into 1.4
Steve Murphy [Fri, 19 Dec 2008 22:30:32 +0000 (22:30 +0000)] 
This merges the masqpark branch into 1.4

These changes eliminate the need for (and use of)
the KEEPALIVE return code in res_features.c;
There are other places that use this result code
for similar purposes at a higher level, these appear
to be left alone in 1.4, but attacked in trunk.

The reason these changes are being made in 1.4, is
that parking ends a channel's life, in some situations,
and the code in the bridge (and some other places),
was not checking the result code properly, and dereferencing
the channel pointer, which could lead to memory corruption
and crashes.

Calling the masq_park function eliminates this danger
in higher levels.

A series of previous commits have replaced some parking calls
with masq_park, but this patch puts them ALL to rest,
(except one, purposely left alone because a masquerade
is done anyway), and gets rid of the code that tests
the KEEPALIVE result, and the NOHANGUP_PEER result codes.

While bug 13820 inspired this work, this patch does
not solve all the problems mentioned there.

I have tested this patch (again) to make sure I have
not introduced regressions.

Crashes that occurred when a parked party hung up
while the parking party was listening to the numbers
of the parking stall being assigned, is eliminated.

These are the cases where parking code may be activated:

1. Feature one touch (eg. *3)
2. Feature blind xfer to parking lot (eg ##700)
3. Run Park() app from dialplan (eg sip xfer to 700)
   (eg. dahdi hookflash xfer to 700)
4. Run Park via manager.

The interesting testing cases for parking are:
I. A calls B, A parks B
    a. B hangs up while A is getting the numbers announced.
    b. B hangs up after A gets the announcement, but
       before the parking time expires
    c. B waits, time expires, A is redialed,
       A answers, B and A are connected, after
       which, B hangs up.
    d. C picks up B while still in parking lot.

II. A calls B, B parks A
    a. A hangs up while B is getting the numbers announced.
    b. A hangs up after B gets the announcement, but
       before the parking time expires
    c. A waits, time expires, B is redialed,
       B answers, A and B are connected, after
       which, A hangs up.
    d. C picks up A while still in parking lot.

Testing this throroughly involves acting all the permutations
of I and II, in situations 1,2,3, and 4.

Since I added a few more changes (ALL references to KEEPALIVE in the bridge
code eliimated (I missed one earlier), I retested
most of the above cases, and no crashes.

H-extension weirdness.

Current h-extension execution is not completely
correct for several of the cases.

For the case where A calls B, and A parks B, the
'h' exten is run on A's channel as soon as the park
is accomplished. This is expected behavior.

But when A calls B, and B parks A, this will be
current behavior:

After B parks A, B is hung up by the system, and
the 'h' (hangup) exten gets run, but the channel
mentioned will be a derivative of A's...

Thus, if A is DAHDI/1, and B is DAHDI/2,
the h-extension will be run on channel
Parked/DAHDI/1-1<ZOMBIE>, and the
start/answer/end info will be those
relating to Channel A.

And, in the case where A is reconnected to
B after the park time expires, when both parties
hang up after the joyful reunion, no h-exten
will be run at all.

In the case where C picks up A from the
parking lot, when either A or C hang up,
the h-exten will be run for the C channel.

CDR's are a separate issue, and not addressed
here.

As to WHY this strange behavior occurs,
the answer lies in the procedure followed
to accomplish handing over the channel
to the parking manager thread. This procedure
is called masquerading. In the process,
a duplicate copy of the channel is created,
and most of the active data is given to the
new copy. The original channel gets its name
changed to XXX<ZOMBIE> and keeps the PBX
information for the sake of the original
thread (preserving its role as a call
originator, if it had this role to begin
with), while the new channel is without
this info and becomes a call target (a
"peer").

In this case, the parking lot manager
thread is handed the new (masqueraded)
channel. It will not run an h-exten
on the channel if it hangs up while
in the parking lot. The h exten will
be run on the original channel instead,
in the original thread, after the bridge
completes.

See bug 13820 for our intentions as
to how to clean up the h exten behavior.

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

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

16 years ago(closes issue #13480)
Jeff Peeler [Fri, 19 Dec 2008 19:48:00 +0000 (19:48 +0000)] 
(closes issue #13480)
Reported by: tzafrir

Replace a bunch of if defined checks for Zaptel/DAHDI through several new defines in dahdi_compat.h. This removes a lot of code duplication. Example from bug:

#ifdef HAVE_ZAPTEL
  fd = open("/dev/zap/pseudo", O_RDWR);
#else
  fd = open("/dev/dahdi/pseudo", O_RDWR);
#endif

is replaced with:
  fd = open(DAHDI_FILE_PSEUDO, O_RDRW);

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

16 years agoEnsure that the chanspy datastore is fully initialized.
Russell Bryant [Fri, 19 Dec 2008 15:03:02 +0000 (15:03 +0000)] 
Ensure that the chanspy datastore is fully initialized.

This patch resolved some random crash issues observed by a user on a BSD system

(closes issue #14111)
Reported by: ys
Patches:
      app_chanspy.c.diff uploaded by ys (license 281)

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

16 years agoMake ast_carefulwrite() be more careful.
Russell Bryant [Thu, 18 Dec 2008 21:39:25 +0000 (21:39 +0000)] 
Make ast_carefulwrite() be more careful.

This patch handles some additional cases that could result in partial writes
to the file description.  This was done to address complaints about partial
writes on AMI.

(issue #13546) (more changes needed to address potential problems in 1.6)
Reported by: srt
Tested by: russell
Review: http://reviewboard.digium.com/r/99/

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

16 years agoAdd mutexes around accesses to the IMAP library interface. This prevents
Tilghman Lesher [Thu, 18 Dec 2008 21:14:47 +0000 (21:14 +0000)] 
Add mutexes around accesses to the IMAP library interface.  This prevents
certain crashes, especially when shared mailboxes are used.
(closes issue #13653)
 Reported by: howardwilkinson
 Patches:
       asterisk-1.4.21.2-appvoicemail-sharedimap-lock.patch uploaded by howardwilkinson (license 590)
 Tested by: jpeeler

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

16 years agoSet the process group ID on the MOH process so that all children will get killed
Russell Bryant [Thu, 18 Dec 2008 18:52:18 +0000 (18:52 +0000)] 
Set the process group ID on the MOH process so that all children will get killed

(closes issue #14099)
Reported by: caspy
Patches:
      res_musiconhold.c.patch.killpg.try2 uploaded by caspy (license 645)

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

16 years agoOnly care about a compatible codec for early bridging if we are actually bridging...
Joshua Colp [Thu, 18 Dec 2008 17:11:42 +0000 (17:11 +0000)] 
Only care about a compatible codec for early bridging if we are actually bridging to another channel. If we are not we actually want to bring the audio back to us.
(closes issue #13545)
Reported by: davidw

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

16 years agoDo not crash if we are not passed in a followme id.
Joshua Colp [Thu, 18 Dec 2008 16:07:37 +0000 (16:07 +0000)] 
Do not crash if we are not passed in a followme id.
(closes issue #14106)
Reported by: ys
Patches:
      app_followme.c.2.diff uploaded by ys (license 281)

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