Commit Graph

3218 Commits

Author SHA1 Message Date
Russell Bryant
3173d54bd0 Don't enable AO2_DEBUG by default if AST_DEVMODE is on.
AO2_DEBUG is not important and is causing a false compiler warning to be
generated on my Ubuntu Natty dev box.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@302267 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-01-18 20:19:57 +00:00
Jeff Peeler
8e1e37c43e Merged revisions 302265 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.6.2

........
  r302265 | jpeeler | 2011-01-18 14:13:52 -0600 (Tue, 18 Jan 2011) | 27 lines
  
  Convert device state callbacks to ao2 objects to fix a deadlock in chan_sip.
  
  Lock scenario presented here:
  Thread 1
   holds ast_rdlock_contexts &conlock
   holds handle_statechange hints
   holds handle_statechange hint
    waiting for cb_extensionstate
     Locked Here: chan_sip.c line 7428 (find_call)
  Thread 2
   holds handle_request_do &netlock
   holds find_call sip_pvt_ptr
    waiting for ast_rdlock_contexts &conlock
     Locked Here: pbx.c line 9911 (ast_rdlock_contexts)
  
  Chan_sip has an established locking order of locking the sip_pvt and then
  getting the context lock. So the as stated by the summary, the operations in
  thread 2 have been modified to no longer require the context lock.
  
  (closes issue #18310)
  Reported by: one47
  Patches: 
        statecbs_ao2.mk2.patch uploaded by one47 (license 23),
        modified by me
  
  Review: https://reviewboard.asterisk.org/r/1072/
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@302266 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-01-18 20:19:57 +00:00
Richard Mudgett
d900b5dbc5 Merged revisions 302173 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.6.2

................
  r302173 | rmudgett | 2011-01-18 12:07:15 -0600 (Tue, 18 Jan 2011) | 95 lines
  
  Merged revisions 302172 via svnmerge from 
  https://origsvn.digium.com/svn/asterisk/branches/1.4
  
  ........
    r302172 | rmudgett | 2011-01-18 12:04:36 -0600 (Tue, 18 Jan 2011) | 88 lines
    
    Issues with DTMF triggered attended transfers.
    
    Issue #17999
    1) A calls B. B answers.
    2) B using DTMF dial *2 (code in features.conf for attended transfer).
    3) A hears MOH. B dial number C
    4) C ringing. A hears MOH.
    5) B hangup. A still hears MOH. C ringing.
    6) A hangup. C still ringing until "atxfernoanswertimeout" expires.
    For v1.4 C will ring forever until C answers the dead line. (Issue #17096)
    
    Problem: When A and B hangup, C is still ringing.
    
    Issue #18395
    SIP call limit of B is 1
    1. A call B, B answered
    2. B *2(atxfer) call C
    3. B hangup, C ringing
    4. Timeout waiting for C to answer
    5. Recall to B fails because B has reached its call limit.
    
    Because B reached its call limit, it cannot do anything until the transfer
    it started completes.
    
    Issue #17273
    Same scenario as issue 18395 but party B is an FXS port.  Party B cannot
    do anything until the transfer it started completes.  If B goes back off
    hook before C answers, B hears ringback instead of the expected dialtone.
    
    **********
    Note for the issue #17273 and #18395 fix:
    
    DTMF attended transfer works within the channel bridge.  Unfortunately,
    when either party A or B in the channel bridge hangs up, that channel is
    not completely hung up until the transfer completes.  This is a real
    problem depending upon the channel technology involved.
    
    For chan_dahdi, the channel is crippled until the hangup is complete.
    Either the channel is not useable (analog) or the protocol disconnect
    messages are held up (PRI/BRI/SS7) and the media is not released.
    
    For chan_sip, a call limit of one is going to block that endpoint from any
    further calls until the hangup is complete.
    
    For party A this is a minor problem.  The party A channel will only be in
    this condition while party B is dialing and when party B and C are
    conferring.  The conversation between party B and C is expected to be a
    short one.  Party B is either asking a question of party C or announcing
    party A.  Also party A does not have much incentive to hangup at this
    point.
    
    For party B this can be a major problem during a blonde transfer.  (A
    blonde transfer is our term for an attended transfer that is converted
    into a blind transfer.  :)) Party B could be the operator.  When party B
    hangs up, he assumes that he is out of the original call entirely.  The
    party B channel will be in this condition while party C is ringing, while
    attempting to recall party B, and while waiting between call attempts.
    
    WARNING:
    The ATXFER_NULL_TECH conditional is a hack to fix the problem.  It will
    replace the party B channel technology with a NULL channel driver to
    complete hanging up the party B channel technology.  The consequences of
    this code is that the 'h' extension will not be able to access any channel
    technology specific information like SIP statistics for the call.
    
    ATXFER_NULL_TECH is not defined by default.
    **********
    
    (closes issue #17999)
    Reported by: iskatel
    Tested by: rmudgett
    JIRA SWP-2246
    
    (closes issue #17096)
    Reported by: gelo
    Tested by: rmudgett
    JIRA SWP-1192
    
    (closes issue #18395)
    Reported by: shihchuan
    Tested by: rmudgett
    
    (closes issue #17273)
    Reported by: grecco
    Tested by: rmudgett
    
    Review: https://reviewboard.asterisk.org/r/1047/
  ........
................


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@302174 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-01-18 18:11:43 +00:00
Matthew Nicholson
523aed7d2f Merged revisions 301594 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.6.2

................
  r301594 | mnicholson | 2011-01-12 12:50:31 -0600 (Wed, 12 Jan 2011) | 15 lines
  
  Removed a usleep(1) that shouldn't be necessary in session_do, and removed the
  ms_t member from the mansession_session structure.
  
  Merged revisions 301591 via svnmerge from 
  https://origsvn.digium.com/svn/asterisk/branches/1.4
  
  ........
    r301591 | mnicholson | 2011-01-12 12:39:03 -0600 (Wed, 12 Jan 2011) | 5 lines
    
    Don't store the thread id for the manager session in the structure we pass to
    the thread for the manager session.
    
    ABE-2543
  ........
................


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@301595 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-01-12 18:51:37 +00:00
Jeff Peeler
743048953d Merged revisions 301503 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.6.2

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@301504 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-01-12 18:12:08 +00:00
David Vossel
a0bfbc836c Removal of unused variables so Asterisk will compile.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@301446 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-01-12 16:05:12 +00:00
Tilghman Lesher
b98153bf45 Call execl() directly for a better solution for paths with spaces.
(closes issue #18600)
Reported by: ebroad
Patches: 
      20110111__issue18600__2.diff.txt uploaded by tilghman (license 14)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@301402 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-01-12 00:26:39 +00:00
Matthew Nicholson
dc4e49bc2b Merged revisions 301307 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.6.2

................
  r301307 | mnicholson | 2011-01-11 12:42:05 -0600 (Tue, 11 Jan 2011) | 11 lines
  
  Merged revisions 301305 via svnmerge from 
  https://origsvn.digium.com/svn/asterisk/branches/1.4
  
  ........
    r301305 | mnicholson | 2011-01-11 12:34:40 -0600 (Tue, 11 Jan 2011) | 4 lines
    
    Prevent buffer overflows in ast_uri_encode()
    
    ABE-2705
  ........
................


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@301308 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-01-11 18:51:40 +00:00
Tilghman Lesher
4399cbef3f Little endian machines were not converted properly.
(closes issue #18583)
Reported by: jcovert
Patches: 
      20110110__issue18583.diff.txt uploaded by tilghman (license 14)
Tested by: jcovert


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@301263 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-01-10 22:39:31 +00:00
Leif Madsen
d5036e449b Merged revisions 300520 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.6.2

........
  r300520 | lmadsen | 2011-01-04 15:52:41 -0600 (Tue, 04 Jan 2011) | 9 lines
  
  Fix backwards and broken XML documentation.
  
  (closes issue #18547)
  Reported by: jcovert
  Patches: 
        xmldoc.c.patch uploaded by jcovert (license 551)
        chan_iax2.c.doc.patch uploaded by jcovert (license 551)
        chan_sip.c.patch uploaded by jcovert (license 551)
        chan_agent.c.patch uploaded by jcovert (license 551)
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@300521 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-01-04 21:53:27 +00:00
Richard Mudgett
6e32efa8c2 Merged revisions 300165 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.6.2

........
  r300165 | rmudgett | 2011-01-03 17:02:13 -0600 (Mon, 03 Jan 2011) | 4 lines
  
  Use correct variable for atxfercallbackretries config option.
  
  * Misc formatting changes.
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@300166 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-01-03 23:14:55 +00:00
Tilghman Lesher
d514f9c3a8 Quote arguments, just in case there's a space in a pathname.
(Diagnosed by pabelanger on #asterisk-dev, fixed by me.)


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@299989 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-12-29 22:02:59 +00:00
Leif Madsen
88b1f72afe Merged revisions 299087 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.6.2

........
  r299087 | lmadsen | 2010-12-20 10:18:03 -0600 (Mon, 20 Dec 2010) | 5 lines
  
  Note that Park() timeout is milliseconds.
  
  (closes issue #15758)
  Reported by: mmurdock
  Tested by: mmurdock, seanbright
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@299088 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-12-20 16:18:26 +00:00
Tzafrir Cohen
8a73e54701 Typos: recieved => received
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@299004 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-12-20 09:14:29 +00:00
Tilghman Lesher
c8f2f6961b Merged revisions 298962 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.6.2

........
  r298962 | tilghman | 2010-12-17 18:08:57 -0600 (Fri, 17 Dec 2010) | 2 lines
  
  Remove backtrace used for testing merge process
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@298963 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-12-18 00:09:49 +00:00
Tilghman Lesher
d70a3b0856 Merged revisions 298957 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.6.2

................
  r298957 | tilghman | 2010-12-17 17:30:55 -0600 (Fri, 17 Dec 2010) | 13 lines
  
  Merged revisions 298905 via svnmerge from 
  https://origsvn.digium.com/svn/asterisk/branches/1.4
  
  ........
    r298905 | tilghman | 2010-12-17 15:40:56 -0600 (Fri, 17 Dec 2010) | 6 lines
    
    Let Asterisk find better backtrace information with libbfd.
    
    The menuselect option BETTER_BACKTRACES, if enabled, will use libbfd to search
    for better symbol information within both the Asterisk binary, as well as
    loaded modules, to assist when using inline backtraces to track down problems.
  ........
................


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@298960 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-12-17 23:52:04 +00:00
Tilghman Lesher
5c50b497f5 Merged revisions 298050 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.6.2

........
  r298050 | tilghman | 2010-12-10 10:24:13 -0600 (Fri, 10 Dec 2010) | 11 lines
  
  Portability issue on OpenSolaris.
  
  Also detect the required structure element, because OpenSolaris defines
  SIOCGIFHWADDR, but without support for IP sockets.
  
  (closes issue #18442)
   Reported by: ranjtech
   Patches: 
         20101209__issue18442.diff.txt uploaded by tilghman (license 14)
   Tested by: ranjtech
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@298051 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-12-10 16:26:46 +00:00
Terry Wilson
b42d70951b Don't crash after Set(CDR(userfield)=...) in ast_bridge_call
Instead of setting peer->cdr = NULL, set it to not post.

(closes issue #18415)
Reported by: macbrody
Patches: 
      patch-18415 uploaded by jsolares (license 1167)
Tested by: jsolares, twilson


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@297952 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-12-09 20:48:44 +00:00
Jeff Peeler
2a7d090ba1 Merged revisions 297824 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.6.2

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@297825 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-12-07 22:59:30 +00:00
Terry Wilson
165ec9b4e6 Merged revisions 297311 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.6.2

................
  r297311 | twilson | 2010-12-02 12:07:39 -0600 (Thu, 02 Dec 2010) | 21 lines
  
  Merged revisions 297310 via svnmerge from 
  https://origsvn.digium.com/svn/asterisk/branches/1.4
  
  ........
    r297310 | twilson | 2010-12-02 12:00:27 -0600 (Thu, 02 Dec 2010) | 12 lines
    
    Initialize offset for adaptive jitter buffer
    
    When the adaptive jitter buffer is enabled in sip.conf, the first frame placed
    in the jitter buffer fails with something like:
    
    jb_warning_output: Resyncing the jb. last_delay 0, this delay -215886466,
    threshold 1000, new offset 215886466
    
    This happens because the offset is not initialized before calling jb_put(). This
    patch modifies jb_put_first_adaptive() to set the offset to the frame's
    timestamp.
  
    Review: https://reviewboard.asterisk.org/r/1041/
  ........
................


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@297312 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-12-02 18:13:49 +00:00
Tilghman Lesher
5211e1c9d3 Merged revisions 296533 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.6.2

........
  r296533 | tilghman | 2010-11-29 01:27:09 -0600 (Mon, 29 Nov 2010) | 13 lines
  
  I love standards.  There are so many to choose from.  Except when there isn't one.
  
  Linux and *BSD disagree on the elements within the ucred structure.  Detect
  which one is in use on the system.
  
  (closes issue #18384)
   Reported by: bjm
   Patches: 
         cred-diffs uploaded by bjm (license 473)
         20101127__issue18384__1.6.2.diff.txt uploaded by tilghman (license 14)
         20101127__issue18384__1.8.diff.txt uploaded by tilghman (license 14)
   Tested by: tilghman, bjm
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@296534 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-11-29 07:28:44 +00:00
Olle Johansson
2bf0ccd7eb Merged revisions 296351 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.6.2

................
  r296351 | oej | 2010-11-26 13:23:03 +0100 (Fre, 26 Nov 2010) | 17 lines
  
  Merged revisions 296309 via svnmerge from 
  https://origsvn.digium.com/svn/asterisk/branches/1.4
  
  ........
    r296309 | oej | 2010-11-26 10:53:31 +0100 (Fre, 26 Nov 2010) | 11 lines
    
    Fix bugs in saying numbers using the Swedish language syntax
    
    (closes issue #18355)
    Reported by: oej
    Patch by: oej
    
    Much help from Peter Lindahl. Testing by the ClearIT team during a coffee break.
    
    Review: https://reviewboard.asterisk.org/r/1033/
  ........
................


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@296391 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-11-26 21:37:21 +00:00
Russell Bryant
f8153e4567 Merged revisions 296221 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.6.2

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@296230 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-11-24 23:29:44 +00:00
Russell Bryant
515c5f489f Merged revisions 296083 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.6.2

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


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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@296002 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-11-24 17:13:08 +00:00
Olle Johansson
47cb712df7 Merged revisions 295907 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.6.2

................
  r295907 | oej | 2010-11-23 10:36:38 +0100 (Tis, 23 Nov 2010) | 14 lines
  
  Merged revisions 295906 via svnmerge from 
  https://origsvn.digium.com/svn/asterisk/branches/1.4
  
  ........
    r295906 | oej | 2010-11-23 10:28:14 +0100 (Tis, 23 Nov 2010) | 8 lines
    
    Fix support of saynumber(1,n) in the Swedish language
    
    (closes issue #18353)
    Reported by: oej
    
    Review: https://reviewboard.asterisk.org/r/1031/
  ........
................


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@295949 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-11-23 10:30:05 +00:00
Richard Mudgett
c08103f033 Merged revisions 295843 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.6.2

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@295866 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-11-22 19:36:10 +00:00
Russell Bryant
5153fbef97 Merged revisions 295710 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.6.2

........
  r295710 | russell | 2010-11-19 18:45:51 -0600 (Fri, 19 Nov 2010) | 29 lines
  
  Fix cache of device state changes for multiple servers.
  
  This patch addresses a regression where device states across multiple servers
  were not being processing completely correctly.  The code works to determine
  the overall state by looking at the last known state of a device on each
  server.  However, there was a regression due to some invasive rewrites of how
  the cache works that led to the cache only storing the last device state change
  for a device, regardless of which server it was on.
  
  The code is set up to cache device state change events by ensuring that each
  event in the cache has a unique device name + entity ID (server ID).  The code
  that was responsible for comparing raw information elements (which EID is)
  always returned a match due to a memcmp() with a length of 0.
  
  There isn't much code to fix the actual bug.  This patch also introduces a new
  CLI command that was very useful for debugging this problem.  The command
  allows you to dump the contents of the event cache.
  
  (closes issue #18284)
  Reported by: klaus3000
  Patches:
        issue18284.rev1.txt uploaded by russell (license 2)
  Tested by: russell, klaus3000
  
  (closes issue #18280)
  Reported by: klaus3000
  
  Review: https://reviewboard.asterisk.org/r/1012/
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@295711 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-11-20 00:50:00 +00:00
Richard Mudgett
b63471b048 Merged revisions 295281 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.6.2

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@295282 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-11-16 23:02:36 +00:00
Jeff Peeler
aafc5f4e99 Merged revisions 294639 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.6.2

................
  r294639 | jpeeler | 2010-11-11 13:31:00 -0600 (Thu, 11 Nov 2010) | 53 lines
  
  Merged revisions 294384 via svnmerge from 
  https://origsvn.digium.com/svn/asterisk/branches/1.4
  
  ........
    r294384 | jpeeler | 2010-11-09 11:37:59 -0600 (Tue, 09 Nov 2010) | 47 lines
    
    Fix a deadlock in device state change processing.
    
    Copied from some notes from the original author (Russell):
    
    Deadlock scenario:
    Thread 1: device state change thread
      Holds - rdlock on contexts
      Holds - hints lock
      Waiting on channels container lock
    
    Thread 2: SIP monitor thread
      Holds the "iflock"
      Holds a sip_pvt lock
      Holds channel container lock
      Waiting for a channel lock
    
    Thread 3: A channel thread (chan_local in this case)
      Holds 2 channel locks acquired within app_dial
      Holds a 3rd channel lock it got inside of chan_local
      Holds a local_pvt lock
      Waiting on a rdlock of the contexts lock
    
    A bunch of other threads waiting on a wrlock of the contexts lock
    
    
    To address this deadlock, some locking order rules must be put in place and
    enforced. Existing relevant rules:
    
    1) channel lock before a pvt lock
    2) contexts lock before hints lock
    3) channels container before a channel
    
    What's missing is some enforcement of the order when you involve more than any
    two. To fix this problem, I put in some code that ensures that (at least in the
    code paths involved in this bug) the locks in (3) come before the locks in (2).
    To change the operation of thread 1 to comply, I converted the storage of hints
    to an astobj2 container. This allows processing of hints without holding the
    hints container lock. So, in the code path that led to thread 1's state, it no
    longer holds either the contexts or hints lock while it attempts to lock the
    channels container.
    
    (closes issue #18165)
    Reported by: antonio
    
    ABE-2583
  ........
................


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@294640 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-11-11 19:42:06 +00:00
Russell Bryant
2ee0c4ddff Merged revisions 294500 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.6.2

........
  r294500 | russell | 2010-11-10 06:41:41 -0600 (Wed, 10 Nov 2010) | 7 lines
  
  Improve a debug message to be more readable and consistent.
  
  (closes issue #18282)
  Reported by: klaus3000
  Patches:
        ast_devstate2str-patch.txt uploaded by klaus3000 (license 65)
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@294501 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-11-10 12:46:27 +00:00
Richard Mudgett
1334febddc Allow ast_do_masquerade() failure to be reported again.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@294466 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-11-09 22:46:45 +00:00
Richard Mudgett
3f9644b7db Analog lines do not transfer CONNECTED LINE or execute the interception macros.
Add connected line update for sig_analog transfers and simplify the
corresponding sig_pri and chan_misdn transfer code.

Note that if you create a three-way call in sig_analog before transferring
the call, the distinction of the caller/callee interception macros make
little sense.  The interception macro writer needs to be prepared for
either caller/callee macro to be executed.  The current implementation
swaps which caller/callee interception macro is executed after a three-way
call is created.

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

JIRA ABE-2589
JIRA SWP-2372


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@294349 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-11-09 16:55:32 +00:00
Jeff Peeler
375b5b6b09 Merged revisions 294277 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.6.2

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@294278 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-11-08 21:59:45 +00:00
Terry Wilson
6dfc9dddd8 Avoid valgrind warnings for ast_rtp_instance_get_xxx_address
The documentation for ast_rtp_instance_get_(local/remote)_address stated that
they returned 0 for success and -1 on failure. Instead, they returned 0 if the
address structure passed in was already equivalent to the address instance
local/remote address or 1 otherwise. 90% of the calls to these functions
completely ignored the return address and passed in an uninitialized struct,
which would make valgrind complain even though the operation was technically
safe.

This patch fixes the documentation and converts the get_xxx_address functions
to void since all they really do is copy the address and cannot fail.
Additionally two new functions
(ast_rtp_instance_get_and_cmp_(local/remote)_address) are created for the 3
times where the return value was actually checked. The
get_and_cmp_local_address function is currently unused, but exists for the sake
of symmetry.

The only functional change as a result of this change is that we will not do an
ast_sockaddr_cmp() on (mostly uninitialized) addresses before doing the
ast_sockaddr_copy() in the get_*_address functions. So, even though it is an
API change, it shouldn't have a noticeable change in behavior.

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@293803 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-11-03 18:05:14 +00:00
Paul Belanger
2c98e867f4 If manager and tls are disabled, do not display TCP/TLS Bindaddress.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@293611 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-11-02 20:45:09 +00:00
Tilghman Lesher
e90dbe2963 Merged revisions 293195-293196 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.6.2

................
  r293195 | tilghman | 2010-10-28 14:52:52 -0500 (Thu, 28 Oct 2010) | 12 lines
  
  Merged revisions 293194 via svnmerge from 
  https://origsvn.digium.com/svn/asterisk/branches/1.4
  
  ........
    r293194 | tilghman | 2010-10-28 14:44:37 -0500 (Thu, 28 Oct 2010) | 5 lines
    
    "!00" evaluated as false, which is incorrect.  Fixing.
    
    Reported (though the reporter did not understand he was reporting a bug) on the asterisk-users list:
    http://lists.digium.com/pipermail/asterisk-users/2010-October/255505.html
  ........
................
  r293196 | tilghman | 2010-10-28 14:54:34 -0500 (Thu, 28 Oct 2010) | 12 lines
  
  Merged revisions 293194 via svnmerge from 
  https://origsvn.digium.com/svn/asterisk/branches/1.4
  
  ........
    r293194 | tilghman | 2010-10-28 14:44:37 -0500 (Thu, 28 Oct 2010) | 5 lines
    
    "!00" evaluated as false, which is incorrect.  Fixing.
    
    Reported (though the reporter did not understand he was reporting a bug) on the asterisk-users list:
    http://lists.digium.com/pipermail/asterisk-users/2010-October/255505.html
  ........
................


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@293197 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-10-28 20:00:06 +00:00
Richard Mudgett
eeec27dafc Connected line is not updated when chan_dahdi/sig_pri or chan_misdn transfers a call.
When a call is transfered by ECT or implicitly by disconnect in sig_pri or
implicitly by disconnect in chan_misdn, the connected line information is
not exchanged.  The connected line interception macros also need to be
executed if defined.

The CALLER interception macro is executed for the held call.
The CALLEE interception macro is executed for the active/ringing call.

JIRA ABE-2589
JIRA SWP-2296

Patches:
      abe_2589_c3bier.patch uploaded by rmudgett (license 664)
      abe_2589_v1.8_v2.patch uploaded by rmudgett (license 664)

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@292704 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-10-22 15:47:08 +00:00
David Vossel
042d5edaa3 Fixes recursive lock problem in manager.c
It is possible for a AMI session to freeze because of invalid
use of recursive locks during the EVENT processing.  This
patch removes the unnecessary locks.

(closes issue #18167)
Reported by: sustav
Patches:
      manager_locking_v1.diff uploaded by dvossel (license 671)
Tested by: sustav




git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@292595 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-10-21 16:14:33 +00:00
Russell Bryant
f10b21bd24 Resolve some compiler errors in ast_sockaddr_is_any().
These errors came up once this function was used from within netsock2.c.
The errors were like the following:

netsock2.c:393: error: dereferencing pointer ‘({anonymous})’ does break strict-aliasing rules

The usage of a union here avoids this problem.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@292188 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-10-18 19:50:04 +00:00
David Vossel
64a0eebfa3 Fixes build error for systems not supporting IPV6_TCLASS.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@292155 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-10-18 19:16:00 +00:00
David Vossel
df369754da Fixes qos settings for sockets bound to any IPv6 or IPv4 address.
(closes issue #18099)
Reported by: jamesnet
Patches:
      issues_18099_v3.diff uploaded by dvossel (license 671 


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@292085 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-10-18 16:02:17 +00:00
David Vossel
e735b3f28c Set TCLASS field of IPv6 header when sip qos options are set.
(closes issue #18099)
Reported by: jamesnet
Patches:
      issues_18099_v2.diff uploaded by dvossel (license 671)
Tested by: dvossel, jamesnet


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@291829 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-10-14 22:09:32 +00:00
Jeff Peeler
c55bdb40f0 Add missing ifdefs for test framework and new locale code.
(closes issue #18137)
Reported by: ovi
Patches: 
      18137_test_framework_ifdef.patch uploaded by wdoekes (license 717)
      18137_localelist_warning.patch uploaded by wdoekes (license 717)
Tested by: ovi



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@291791 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-10-14 18:45:02 +00:00
Paul Belanger
a37956721c Add the ability for ast_find_ourip to return IPv4, IPv6 or both.
While testing chan_gtalk I noticed jabber was using my IPv6 address
and not IPv4. When using bindaddr=0.0.0.0 it is possible for ast_find_ourip()
to return both IPv6 and IPv4 results.  Adding a family parameter gives you
the ablility to choose.

Since jabber/gtalk/h323 do not support IPv6, we should only return IPv4 results.

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@291758 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-10-14 15:15:12 +00:00
Terry Wilson
9b9204c5ae Merged revisions 291580 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.6.2

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@291581 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-10-13 23:01:56 +00:00
Tilghman Lesher
c4ead286ef Merged revisions 291264 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.6.2

................
  r291264 | tilghman | 2010-10-12 12:05:31 -0500 (Tue, 12 Oct 2010) | 9 lines
  
  Merged revisions 291263 via svnmerge from 
  https://origsvn.digium.com/svn/asterisk/branches/1.4
  
  ........
    r291263 | tilghman | 2010-10-12 11:55:30 -0500 (Tue, 12 Oct 2010) | 2 lines
    
    Oops, incorrect range (although unallocated at ARIN)
  ........
................


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@291265 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-10-12 17:06:23 +00:00
David Vossel
197b033cd7 Fixes manager.c crash.
This issue was caused by improper use of the mansession lock and
manession_session lock.  These two structures are confusing to begin
with so I'm not surprised this occurred.  I fixed this by consistently
making sure we use each of these locks only to protect the data
in the corresponding structure.  We had mismatched usage of these
locks which resulted in no mutual exclusivity occurring at all.


(closes issue #17994)
Reported by: vrban
Patches:
      mansession_locking_fix.diff uploaded by dvossel (license 671)
Tested by: vrban


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@291227 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-10-12 15:58:56 +00:00
Richard Mudgett
d6214fe55d Merged revisions 291073 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.6.2

........
  r291073 | rmudgett | 2010-10-11 11:39:17 -0500 (Mon, 11 Oct 2010) | 15 lines
  
  Fixed infinite loop in verbose/debug message output.
  
  Setting the module/filename specific message level and then changing it
  resulted in the linked list being looped on itself.  Traversing this
  linked list is an infinite loop if what you are looking for is not in the
  list.
  
  Also plugged some CLI parsing holes in the associated CLI command:
  
  * Removing a nonexistent module from the list actually added it with a
  level of zero.
  
  * Setting the non-module specific level to zero is now equivalent to
  setting it to "off" as documented.
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@291075 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-10-11 16:42:54 +00:00
Jeff Peeler
c55ebead20 Merged revisions 290863 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.6.2

................
  r290863 | jpeeler | 2010-10-07 21:45:44 -0500 (Thu, 07 Oct 2010) | 16 lines
  
  Merged revisions 290862 via svnmerge from 
  https://origsvn.digium.com/svn/asterisk/branches/1.4
  
  ........
    r290862 | jpeeler | 2010-10-07 21:35:29 -0500 (Thu, 07 Oct 2010) | 9 lines
    
    Ensure editline cleanup occurs when Ctrl-C is pressed at control console.
    
    A recent change was made to avoid a race condition on shutdown which only called
    the end functions from the console thread. However, when pressing Ctrl-C the
    quit handler is called from the signal handler thread.
    
    (closes issue #17698)
    Reported by: jmls
  ........
................


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@290864 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-10-08 02:56:24 +00:00