Commit Graph

437 Commits

Author SHA1 Message Date
Jason Parker
d204fe57a2 Update ChangeLog. Merge revisions 339719,340878,341088 from branches/1.8/
git-svn-id: https://origsvn.digium.com/svn/asterisk/tags/1.8.8.0-rc2@341282 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-10-18 21:26:48 +00:00
Gregory Nietsky
c47fd8f774 Its possible to loose audio on ast_write when the channel is not transcoded correctly.
in the case of DAHDI the channel is hungup.

This patch tries to "fix" the problem and make the channel compatiable and warn the user of
this problem.

Please note there is a underlying problem with codec negotion this does not fix the problem
it does try to rectify it and prevent loss of service.

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

(closes issue ASTERISK-17541)
(closes issue ASTERISK-18063)
(issue ASTERISK-14384)
(issue ASTERISK-17502)
(issue ASTERISK-18325)
(issue ASTERISK-18422)



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@337430 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-09-22 06:18:33 +00:00
Jonathan Rose
21714a05b6 Fix bad RTP media bridges in directmedia calls on peers separated by multiple Asterisk nodes.
In a situation involving devices on separate Asterisk trunks, the remote RTP bridge would
break when starting a call with directmedia. This patch queues a new type of control frame
so that our RTP bridge loop can properly detect when these situations occur and check to see
if peers need to be updated in order to send their media to the proper location.

(Closes issue ASTERISK-18340)
Reported by: Thomas Arimont
(Closes issue ASTERISK-17725)
Reported by: kwk
Tested by: twilson, jrose


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@336294 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-09-16 19:53:40 +00:00
Matthew Nicholson
1aeb6f1242 Properly set caller_warning and callee_warning before we try to use them.
ASTERISK-18199
Patch by: elguero
Testing by: rtang


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@335433 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-09-12 15:54:41 +00:00
Matthew Jordan
7dc49195d8 Updated SIP 484 handling; added Incomplete control frame
When a SIP phone uses the dial application and receives a 484 Address 
Incomplete response, if overlapped dialing is enabled for SIP, then
the 484 Address Incomplete is forwarded back to the SIP phone and the
HANGUPCAUSE channel variable is set to 28.  Previously, the Incomplete
application dialplan logic was automatically triggered; now, explicit
dialplan usage of the application is required.

Additionally, this patch adds a new AST_CONTOL_FRAME type called
AST_CONTROL_INCOMPLETE.  If a channel driver receives this control frame,
it is an indication that the dialplan expects more digits back from the
device.  If the device supports overlap dialing it should attempt to 
notify the device that the dialplan is waiting for more digits; otherwise,
it can handle the frame in a manner appropriate to the channel driver.

(closes issue ASTERISK-17288)
Reported by: Mikael Carlsson
Tested by: Matthew Jordan

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



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@335064 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-09-09 16:09:09 +00:00
Richard Mudgett
9e99b1819e Call pickup race leaves orphaned channels or crashes.
Multiple users attempting to pickup a call that has been forked to
multiple extensions either crashes or fails a masquerade with a "bad
things may happen" message.

This is the scenario that is causing all the grief:
1) Pickup target is selected
2) target is marked as being picked up in ast_do_pickup()
3) target is unlocked by ast_do_pickup()
4) app dial or queue gets a chance to hang up losing calls and calls
ast_hangup() on target
5) SINCE A MASQUERADE HAS NOT BEEN SETUP YET BY ast_do_pickup() with
ast_channel_masquerade(), ast_hangup() completes successfully and the
channel is no longer in the channels container.
6) ast_do_pickup() then calls ast_channel_masquerade() to schedule the
masquerade on the dead channel.
7) ast_do_pickup() then calls ast_do_masquerade() on the dead channel
8) bad things happen while doing the masquerade and in the process
ast_do_masquerade() puts the dead channel back into the channels container
9) The "orphaned" channel is visible in the channels list if a crash does
not happen.

This patch does the following:

* Made ast_hangup() set AST_FLAG_ZOMBIE on a successfully hung-up channel
and not release the channel lock until that has happened.

* Made __ast_channel_masquerade() not setup a masquerade if either channel
has AST_FLAG_ZOMBIE set.

* Fix chan_agent misuse of AST_FLAG_ZOMBIE since it would no longer work.

(closes issue ASTERISK-18222)
Reported by: Alec Davis
Tested by: rmudgett, Alec Davis, irroot, Karsten Wemheuer

(closes issue ASTERISK-18273)
Reported by: Karsten Wemheuer
Tested by: rmudgett, Alec Davis, irroot, Karsten Wemheuer

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@334009 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-08-31 15:20:31 +00:00
Richard Mudgett
4bd9b75724 Remove some redundant locking code in ast_do_masquerade().
Also updated some comments.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@330368 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-07-30 23:56:29 +00:00
Gregory Nietsky
842ab32ecc prevent double masqurading channels when one is been hung up and deadlock avoidance is used.
There is a race condition in ast_do_masquerade / ast_hangup (at least)

Reported by me signed off by schmidts with input from David Vossel

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@330311 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-07-30 15:25:16 +00:00
Matthew Nicholson
0bdbde0690 make framehooks prevent native bridging (for real this time)
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@325545 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-06-29 16:18:39 +00:00
Terry Wilson
c84e7b911e Lock the channel before calling the setoption callback
The channel needs to be locked before calling these callback functions. Also,
sip_setoption needs to lock the pvt and a check p->rtp is non-null before using
it.

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@324048 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-06-16 22:35:41 +00:00
Leif Madsen
a3c4818a51 Avoid dividing by zero with L() option to Dial()
Reported by: nicolasom
Patches:
    
issue-17995.patch - nicolasom (License #5994)

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@323213 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-06-13 19:51:52 +00:00
Richard Mudgett
59a41188a8 The AMI Newstate event contains different information between v1.4 and v1.8.
The addition of connected line support in v1.8 changes the behavior of the
channel caller ID somewhat.  The channel caller ID value no longer time
shares with the connected line ID on outgoing call legs.  The timing of
some AMI events/responses output the connected line ID as caller ID.
These party ID's are now separate.

* The ConnectedLineNum and ConnectedLineName headers were added to many
AMI events/responses if the CallerIDNum/CallerIDName headers were also
present.

(closes issue #18252)
Reported by: gje
Tested by: rmudgett

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@320823 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-05-25 17:06:38 +00:00
Richard Mudgett
aa64eb1077 Give zombies a safe channel driver to use.
Recent crashes from zombie channels suggests that they need a safe home to
goto.  When a masquerade happens, the physical part of the zombie channel
is hungup.  The hangup normally sets the channel private pointer to NULL.
If someone then blindly does a callback to the channel driver, a crash is
likely because the private pointer is NULL.

The masquerade now sets the channel technology of zombie channels to the
kill channel driver.

Related to the following issues:
(issue #19116)
(issue #19310)

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@320796 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-05-25 16:23:11 +00:00
Richard Mudgett
11b3c3add1 Crash while transferring a call during DTMF feature timeout.
When a call is being attended transferred during the time between
AST_FRAME_DTMF_BEGIN and AST_FRAME_DTMF_END, the transferred channel
becomes a zombie (so tech data is not available), making ast_dtmf_stream()
segfault when it tries to send the DTMF digit (at least with SIP
channels).

Patch based on feature-end-zombie.patch uploaded by Irontec (license 1256)

* Check for zombies when ast_channel_bridge() returns.

* Guarantee that the fo parameter value is initialized in
ast_channel_bridge() before any returns.

(closes issue #19116)
Reported by: Irontec
Tested by: rmudgett


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@320057 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-05-20 16:43:02 +00:00
Brett Bryant
7c38148a7d Fixes a segmentation fault in dynamic hints when a channel technology isn't
loaded for a hint.

(closes issue #18495)
Reported by: bertrand
Tested by: bertrand



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@318921 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-05-13 18:09:34 +00:00
Matthew Nicholson
9bfd90d329 Make indicate/control frames WRITE events on framehooks. Also, if a framehook
returns a non-control frame, don't forward it to the channel.

(closes issue #19251)
Reported by: irroot
Patches:
      (modified) framehook_indicate.patch2 uploaded by irroot (license 52)
Tested by: irroot


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@318142 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-05-09 14:09:38 +00:00
David Vossel
7e76c46220 Fixes framehook segfault on indicate
(closes issue #19215)
Reported by: irroot
Patches: 
      framehook_indicate.patch uploaded by irroot (license 52)



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@316334 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-05-03 22:05:59 +00:00
Russell Bryant
a82f1bb995 Fix a bunch of compiler warnings generated by gcc 4.6.0.
Most of these are -Wunused-but-set-variable, but there were a few others
mixed in here, as well.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@316265 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-05-03 19:55:49 +00:00
Richard Mudgett
b183d64131 Merged revisions 313579 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.6.2

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@313588 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-04-13 16:31:50 +00:00
Jonathan Rose
1a7d232a5a Undoes 310726 for further analysis
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@310733 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-03-14 21:30:25 +00:00
Jonathan Rose
89eaad8ab8 Moves data store destruction from channel destruction to hangup in channel.c
This moves the data store destruction and app signaling events for a call to ast_hangup so that threads which wait for data store destruction
don't become stuck forever when attached to an application/function/etc that keeps the channel open.

(closes issue #18742)
Reported by: jkister
Patches:
      patch.diff uploaded by jrose (license 1225)
Tested by: jkister, jcovert, jrose

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@310726 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-03-14 21:17:13 +00:00
Richard Mudgett
6fb282becb Invalid read in ast_channel_set_caller_event().
Valgrind reported that ast_channel_set_caller_event() was reading data
from a freed buffer when using the pre_set structure.

Rearange things to pre-calculate the name and number pointer before
updating the caller party structure to see if the name or number was
changed.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@308903 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-02-24 21:38:41 +00:00
Richard Mudgett
a785544090 Merged revisions 305889 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.6.2

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@305923 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-02-03 00:24:40 +00:00
Russell Bryant
cfc893a5bc Merged revisions 303548 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.6.2

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@303549 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-01-24 20: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
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
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
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
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
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
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
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
Jason Parker
86460af890 Merged revisions 289339 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.6.2

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@289340 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-09-29 21:12:43 +00:00
Matthew Nicholson
fd8c58834e Update the CDR record when ast_channel_set_caller_event() is called
(related to issue #17569)
Reported by: tbelder


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@289268 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-09-29 17:08:20 +00:00
Richard Mudgett
8ce2f83b20 Make development error message indicate which channel.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@289253 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-09-29 16:16:47 +00:00
Matthew Nicholson
3d39781818 Merged revisions 289178 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.6.2

................
  r289178 | mnicholson | 2010-09-29 10:04:11 -0500 (Wed, 29 Sep 2010) | 15 lines
  
  Merged revisions 289177 via svnmerge from 
  https://origsvn.digium.com/svn/asterisk/branches/1.4
  
  ........
    r289177 | mnicholson | 2010-09-29 10:03:27 -0500 (Wed, 29 Sep 2010) | 8 lines
    
    Set the caller id on CDRs when it is set on the parent channel.
    
    (closes issue #17569)
    Reported by: tbelder
    Patches:
          17569.diff uploaded by tbelder (license 618)
    Tested by: tbelder
  ........
................


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@289179 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-09-29 15:04:56 +00:00
Brett Bryant
c2c707637f Merged revisions 289095 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.6.2

................
  r289095 | bbryant | 2010-09-28 14:14:19 -0400 (Tue, 28 Sep 2010) | 21 lines
  
  Merged revisions 289094 via svnmerge from 
  https://origsvn.digium.com/svn/asterisk/branches/1.4
  
  ........
    r289094 | bbryant | 2010-09-28 14:10:19 -0400 (Tue, 28 Sep 2010) | 14 lines
    
    Fixes an issue with the Newchannel AMI event during the Masquerading process.
    
    Fixes an issue with the Newchannel AMI event during the Masquerading process,
    where no Newchannel AMI event was generated for the psuedo channel used during
    the masquerading process.
    
    (closes issue #17987)
    Reported by: RadicAlish
    Patches: 
          newchannel.patch.txt uploaded by RadicAlish (license 1122)
          Tested by: RadicAlish
    
          Review: https://reviewboard.asterisk.org/r/937/
  ........
................


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@289099 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-09-28 18:18:02 +00:00
Richard Mudgett
c05d497703 Protect channel access in CONNECTED_LINE and REDIRECTING interception macro launch code.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@288079 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-09-21 20:29:51 +00:00
Brett Bryant
1c4aabd5d6 Merged revisions 288006 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.6.2

................
  r288006 | bbryant | 2010-09-21 15:46:20 -0400 (Tue, 21 Sep 2010) | 14 lines
  
  Merged revisions 288005 via svnmerge from 
  https://origsvn.digium.com/svn/asterisk/branches/1.4
  
  ........
    r288005 | bbryant | 2010-09-21 15:43:46 -0400 (Tue, 21 Sep 2010) | 8 lines
    
    Add a check to fix a rare segmentation fault you'd get if ast_frdup couldn't allocate
    memory on the first frame being queued in ast_queue_frame.
    
    (closes issue #17882)
    Reported by: seanbright
    Tested by: seanbright
  ........
................


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@288007 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-09-21 19:48:53 +00:00
Terry Wilson
1fd16be0b1 Revert change in favor of a more targeted fix
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@287931 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-09-21 19:02:40 +00:00
Terry Wilson
0f8d99d616 Don't generate connected line buffer twice for comparison
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@287833 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-09-21 04:37:44 +00:00
Terry Wilson
6c75697c13 Avoid infinite loop with certain local channel connected line updates
Compare connected line data before sending a connected line indication to avoid
possible loops.

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@287757 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-09-20 23:51:38 +00:00
Alec L Davis
4ce624d57e Merged revisions 287685 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.6.2

........
  r287685 | alecdavis | 2010-09-21 11:16:45 +1200 (Tue, 21 Sep 2010) | 18 lines
  
  ast_channel_masquerade: Avoid recursive masquerades.
  
  Check all 4 combinations of (original/clonechan) * (masq/masqr).
  
  Initially original->masq and clonechan->masqr were only checked.
  
  It's possible with multiple masq's planned - and not yet executed, that
   the 'original' chan could already have another masq'd into it - thus original->masqr
  would be set, that masqr would lost.
  Likewise for the clonechan->masq.
  
  (closes issue #16057;#17363)
  Reported by: amorsen;davidw,alecdavis
  Patches: 
        based on bug16057.diff4.txt uploaded by alecdavis (license 585)
  Tested by: ramonpeek, davidw, alecdavis
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@287701 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-09-20 23:20:03 +00:00
Alec L Davis
6f9f45f1dd ast_do_masquerade. Keep channels ao2_container locked while unlink and linking channels.
Previously, Masquerade would unlock 'original' and 'clonechan' and allow another masq thread to run.
End result would be corrupted memory, and the frequent report 'Bad Magic Number'.

(closes issue #17801,#17710)
Reported by: notthematrix
Patches: 
      Based on bug17801.diff1.txt uploaded by alecdavis (license 585)
Tested by: alecdavis

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



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@287661 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-09-20 22:21:50 +00:00
David Vossel
ecabd15422 Addition of the FrameHook API (AKA AwesomeHooks)
So far all our tools for viewing and manipulating media streams
within Asterisk have been entirely focused on audio.  That made
sense then, but is not scalable now.  The FrameHook API lets us
tap into and manipulate _ANY_ type of media or signaling passed
on a channel present today or in the future.  This tool is a step
in the direction of expanding Asterisk's boundaries and will help
generate some rather interesting applications in the future.

In addition to the FrameHook API, a simple dialplan function
exercising the api has been included as well.  This function
is called FRAME_TRACE().  FRAME_TRACE() allows for the internal
ast_frames read and written to a channel to be output.  Filters
can be placed on this function to debug only certain types of frames.
This function could be thought of as an internal way of doing
ast_frame packet captures.

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



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@287647 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-09-20 22:09:16 +00:00
Matthew Nicholson
985d92c074 Merged revisions 286681 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.6.2

................
  r286681 | mnicholson | 2010-09-14 13:02:24 -0500 (Tue, 14 Sep 2010) | 14 lines
  
  Merged revisions 286679 via svnmerge from 
  https://origsvn.digium.com/svn/asterisk/branches/1.4
  
  ........
    r286679 | mnicholson | 2010-09-14 13:00:01 -0500 (Tue, 14 Sep 2010) | 7 lines
    
    Only drop duplicate answer frames if the channel is bridged.
    
    Back in r3710 ast_read() was modified to drop answer frames on channels that were in the UP state.  This modification prevented bridges that were up before the answer from being broken and reestablished by an ANSWER control frame.  That change also prevents pickup of channels called from the ast_dial framework from working properly.  The ast_dial framework expects to see an ANSWER frame after dialing and the pickup code queues one but ast_read() drops it.  This new change only drops ANSWER frames when the channel is bridged, allowing the answer queued by the pickup code to properly pass through ast_read() on to the ast_dial framework.
    
    ABE-2473
    (related to issue #2342)
  ........
................


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@286682 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-09-14 18:04:21 +00:00