Commit Graph

414 Commits

Author SHA1 Message Date
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
Jason Parker
85a04d3597 Merged revisions 285744 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.6.2

................
  r285744 | qwell | 2010-09-09 15:09:23 -0500 (Thu, 09 Sep 2010) | 16 lines
  
  Merged revisions 285742 via svnmerge from 
  https://origsvn.digium.com/svn/asterisk/branches/1.4
  
  ........
    r285742 | qwell | 2010-09-09 15:06:31 -0500 (Thu, 09 Sep 2010) | 9 lines
    
    Transmit silence when reading DTMF in ast_readstring.
    
    Otherwise, you could get issues with DTMF timeouts causing hangups.
    
    (closes issue #17370)
    Reported by: makoto
    Patches: 
          channel-readstring-silence-generator.patch uploaded by makoto (license 38)
  ........
................


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@285745 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-09-09 20:11:06 +00:00
Terry Wilson
e3075ea015 Merged revisions 282467 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.6.2

................
  r282467 | twilson | 2010-08-16 12:32:01 -0500 (Mon, 16 Aug 2010) | 23 lines
  
  Merged revisions 282430 via svnmerge from 
  https://origsvn.digium.com/svn/asterisk/branches/1.4
  
  ........
    r282430 | twilson | 2010-08-16 12:06:37 -0500 (Mon, 16 Aug 2010) | 16 lines
    
    Send a SRCCHANGE indication when we masquerade
    
    Masquerading a channel means that the src of the audio is potentially
    changing, so send a SRCCHANGE so that RTP-based media streams can get
    a new SSRC generated to reflect the change. Original patch by addix
    (along with lots of testing--thanks!).
    
    (closes issue #17007)
    Reported by: addix
    Patches: 
          1001-reset-SSRC-original-channel.diff uploaded by addix (license 1006)
          srcchange.diff uploaded by twilson (license 396)
    Tested by: addix, twilson
    
    Review: https://reviewboard.asterisk.org/r/862/
  ........
................


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@282468 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-08-16 17:53:44 +00:00
Jeff Peeler
99b178fafa Merged revisions 281912 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.6.2

................
  r281912 | jpeeler | 2010-08-11 22:01:38 -0500 (Wed, 11 Aug 2010) | 27 lines
  
  Merged revisions 281911 via svnmerge from 
  https://origsvn.digium.com/svn/asterisk/branches/1.4
  
  ........
    r281911 | jpeeler | 2010-08-11 22:00:14 -0500 (Wed, 11 Aug 2010) | 20 lines
    
    Ensure SSRC is changed when media source is changed to resolve audio delay.
    
    This change causes the SSRC to change right before the channels are bridged,
    which is what used to happen. It seems that fixes were made to attempt limiting
    SSRC changes, targeted mainly at sending DTMF. DTMF is not affecting the SSRC
    with this change.
    
    There are two other control frames sent in ast_channel_bridge that probably
    should also be changed to AST_CONTROL_SRCCHANGE as well, but I'm going to leave
    this change up to the discretion of resolving issue #17007.
    
    For reference - old review implementing new control frame SRCCHANGE:
    https://reviewboard.asterisk.org/r/540
    
    (closes issue #17404)
    Reported by: sdolloff
    Patches: 
          bug17404.patch uploaded by jpeeler (license 325)
    Tested by: sdolloff
  ........
................


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@281913 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-08-12 03:03:37 +00:00
David Vossel
a00f7cf2aa Merged revisions 280449 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.6.2

................
  r280449 | dvossel | 2010-07-29 14:05:25 -0500 (Thu, 29 Jul 2010) | 18 lines
  
  Merged revisions 280448 via svnmerge from 
  https://origsvn.digium.com/svn/asterisk/branches/1.4
  
  ........
    r280448 | dvossel | 2010-07-29 14:04:23 -0500 (Thu, 29 Jul 2010) | 12 lines
    
    fixes issue with translator frame not getting freed
    
    A translator frame even if it local storage so the translation path
    can be freed.  This issue prevented g729 licenses from being freed up.
    
    (closes issue #17630)
    Reported by: manvirr
    Patches:
          encoder_fix.diff uploaded by dvossel (license 671)
    Tested by: manvirr, dvossel
  ........
................


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@280450 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-07-29 19:13:27 +00:00
Matthew Nicholson
bb4178a14a Merged revisions 280306 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.6.2

........
  r280306 | mnicholson | 2010-07-29 08:45:11 -0500 (Thu, 29 Jul 2010) | 2 lines
  
  Implement support for ast_channel_queryoption on local channels.  Currently only AST_OPTION_T38_STATE is supported.

  ABE-2229
  Review: https://reviewboard.asterisk.org/r/813/
........

Additionally, pass AST_CONTROL_T38_PARAMETERS control frames through generic bridges.  This change appears to have been unintentionally left out of rev 203699.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@280307 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-07-29 13:56:35 +00:00
David Vossel
df89f8da6a Merged revisions 279946 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.6.2

................
  r279946 | dvossel | 2010-07-27 15:54:32 -0500 (Tue, 27 Jul 2010) | 24 lines
  
  Merged revisions 279945 via svnmerge from 
  https://origsvn.digium.com/svn/asterisk/branches/1.4
  
  ........
    r279945 | dvossel | 2010-07-27 15:33:40 -0500 (Tue, 27 Jul 2010) | 19 lines
    
    remove empty audiohook write list on channel
    
    If a channel has an audiohook write list created on it, that
    list stays on the channel until the channel is destroyed.  There
    is no reason to keep that list on the channel if it becomes empty.
    If it is empty that just means we are doing needless translating
    for every ast_read and ast_write.  This patch removes the audiohook
    list from the channel once it is detected to be empty on either a
    read or write.  If a audiohook is added back to the channel after
    this list is destroyed, the list just gets recreated as if it never
    existed to begin with.
    
    (closes issue #17630)
    Reported by: manvirr
    
    Review: https://reviewboard.asterisk.org/r/799/
  ........
................


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@279949 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-07-27 20:57:00 +00:00
Russell Bryant
d3700923db Ignore a control subclass of -1 in ast_waitfordigit_full().
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@279636 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-07-26 21:53:30 +00:00
Mark Michelson
0da891c543 Merged revisions 278618 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r278618 | mmichelson | 2010-07-22 09:55:04 -0500 (Thu, 22 Jul 2010) | 13 lines
  
  Allow PLC to function properly when channels use SLIN for audio.
  
  If a channel involved in a bridge was using SLIN audio, then translation
  paths were not guaranteed to be set up properly since in all likelihood
  the number of translation steps was only 1.
  
  This patch enforces the transcode_via_slin behavior if transcode_via_slin
  or generic_plc is enabled and one of the formats to make compatible is
  SLIN.
  
  AST-352
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@278620 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-07-22 14:58:01 +00:00
Matthew Nicholson
e16a5e4727 Print f->subclass.integer instead of f->subclass.
(fix build breakage introduced in r277250)


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@277262 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-07-16 18:05:01 +00:00
Matthew Nicholson
d787ccff35 Merged revisions 277247 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r277247 | mnicholson | 2010-07-16 12:29:57 -0500 (Fri, 16 Jul 2010) | 4 lines
  
  For pass through DTMF tones, measure the actual duration between the begin and end packets on the wire.  If it is detected to be less than AST_MIN_DTMF_DURATION, trigger dtmf emulation.
  
  AST-362
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@277250 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-07-16 17:30:39 +00:00
Jeff Peeler
e7591ab428 Merged revisions 276652 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r276652 | jpeeler | 2010-07-15 08:48:58 -0500 (Thu, 15 Jul 2010) | 2 lines
  
  In a perfect world, the frame source would never be NULL. In the meantime, don't crash when it is.
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@276653 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-07-15 13:51:11 +00:00
Richard Mudgett
cf7bbcc4c6 Expand the caller ANI field to an ast_party_id
Expand the ani field in ast_party_caller and ast_party_connected_line to
an ast_party_id.

This is an extension to the ast_callerid restructuring patch in review:
https://reviewboard.asterisk.org/r/702/

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@276393 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-07-14 16:58:03 +00:00
Richard Mudgett
ec37ffbdaf ast_callerid restructuring
The purpose of this patch is to eliminate struct ast_callerid since it has
turned into a miscellaneous collection of various party information.

Eliminate struct ast_callerid and replace it with the following struct
organization:

struct ast_party_name {
	char *str;
	int char_set;
	int presentation;
	unsigned char valid;
};
struct ast_party_number {
	char *str;
	int plan;
	int presentation;
	unsigned char valid;
};
struct ast_party_subaddress {
	char *str;
	int type;
	unsigned char odd_even_indicator;
	unsigned char valid;
};
struct ast_party_id {
	struct ast_party_name name;
	struct ast_party_number number;
	struct ast_party_subaddress subaddress;
	char *tag;
};
struct ast_party_dialed {
	struct {
		char *str;
		int plan;
	} number;
	struct ast_party_subaddress subaddress;
	int transit_network_select;
};
struct ast_party_caller {
	struct ast_party_id id;
	char *ani;
	int ani2;
};

The new organization adds some new information as well.

* The party name and number now have their own presentation value that can
be manipulated independently.  ISDN supplies the presentation value for
the name and number at different times with the possibility that they
could be different.

* The party name and number now have a valid flag.  Before this change the
name or number string could be empty if the presentation were restricted.
Most channel drivers assume that the name or number is then simply not
available instead of indicating that the name or number was restricted.

* The party name now has a character set value.  SIP and Q.SIG have the
ability to indicate what character set a name string is using so it could
be presented properly.

* The dialed party now has a numbering plan value that could be useful to
have available.

The various channel drivers will need to be updated to support the new
core features as needed.  They have simply been converted to supply
current functionality at this time.


The following items of note were either corrected or enhanced:

* The CONNECTEDLINE() and REDIRECTING() dialplan functions were
consolidated into func_callerid.c to share party id handling code.

* CALLERPRES() is now deprecated because the name and number have their
own presentation values.

* Fixed app_alarmreceiver.c write_metadata().  The workstring[] could
contain garbage.  It also can only contain the caller id number so using
ast_callerid_parse() on it is silly.  There was also a typo in the
CALLERNAME if test.

* Fixed app_rpt.c using ast_callerid_parse() on the channel's caller id
number string.  ast_callerid_parse() alters the given buffer which in this
case is the channel's caller id number string.  Then using
ast_shrink_phone_number() could alter it even more.

* Fixed caller ID name and number memory leak in chan_usbradio.c.

* Fixed uninitialized char arrays cid_num[] and cid_name[] in
sig_analog.c.

* Protected access to a caller channel with lock in chan_sip.c.

* Clarified intent of code in app_meetme.c sla_ring_station() and
dial_trunk().  Also made save all caller ID data instead of just the name
and number strings.

* Simplified cdr.c set_one_cid().  It hand coded the ast_callerid_merge()
function.

* Corrected some weirdness with app_privacy.c's use of caller
presentation.

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@276347 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-07-14 15:48:36 +00:00
Richard Mudgett
30071ba71b Add which ITU spec specifies the numbering plan.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@275725 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-07-12 17:54:46 +00:00
Jeff Peeler
e710ef67b9 Merged revisions 275665 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r275665 | jpeeler | 2010-07-12 11:58:39 -0500 (Mon, 12 Jul 2010) | 11 lines
  
  Change ast_write to not stop generator when called from ast_prod.
  
  For SIP channels configured with the progressinband option on, the ringback was
  being immediately stopped. This problem was due to ast_prod being moved for a
  deadlock fix in 259858. Prodding the channel after setting up the generator
  triggered the check in ast_write to stop the generator. The fix here should
  write the frame the same as was done before the call to ast_prod was moved.
  
  (closes issue #17372)
  Reported by: tech_admin
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@275682 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-07-12 17:21:01 +00:00
Richard Mudgett
816f26c16c Generate a correct AstData string for ast_callerid.cid_ton
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@274782 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-07-08 22:05:40 +00:00
Richard Mudgett
25a3c313b5 Fix trunk compile.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@274773 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-07-08 19:12:55 +00:00
Eliel C. Sardanons
a1b89a6a50 Implement AstData API data providers as part of the GSOC 2010 project,
midterm evaluation.

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



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@274727 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-07-08 14:48:42 +00:00
David Vossel
b00f58da25 adds speex 16khz audio support
(closes issue #17501)
Reported by: fabled
Patches:
      asterisk-trunk-speex-wideband-v2.patch uploaded by fabled (license 448)
Tested by: malcolmd, fabled, dvossel



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@271231 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-06-17 17:23:43 +00:00
David Vossel
fcb055fb4e addition of G.719 pass-through support
(closes issue #16293)
Reported by: malcolmd
Patches:
      g719.passthrough.patch.7 uploaded by malcolmd (license 924)
      format_g719.c uploaded by malcolmd (license 924)



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@270940 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-06-16 19:03:24 +00:00
Mark Michelson
e8d2153da6 Merged revisions 269821 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r269821 | mmichelson | 2010-06-10 14:30:12 -0500 (Thu, 10 Jun 2010) | 19 lines
  
  Fix potential crash when writing raw SLIN audio on a PLC-enabled channel.
  
  The issue here was that the frame created when adjusting for PLC had no offset
  to its audio data. If this frame were translated to another format prior to
  being sent out an RTP socket, all went well because the translation code would
  put an appropriate offset into the frame. However, if the SLIN audio were not
  translated before being sent out the RTP socket, bad things would happen.
  Specifically, the ast_rtp_raw_write makes the assumption that the frame has
  at least enough of an offset that it can accommodate an RTP header. This was
  not the case. As such, data was being written prior to the allocation, likely
  corrupting the data the memory allocator had written. Thus when the time came
  to free the data, all hell broke loose. ....Well, Asterisk crashed at least.
  
  The fix was just what one would expect. Offset the data in the frame by a reasonable
  amount. The method I used is a bit odd since the data in the frame is 16 bit integers
  and not bytes. I left a big ol' comment about it. This can be improved on if someone
  is interested. I was more interested in getting the crash resolved.
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@269822 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-06-10 19:34:03 +00:00
Terry Wilson
857814f435 Add SRTP support for Asterisk
After 5 years in mantis and over a year on reviewboard, SRTP support is finally
being comitted. This includes generic CHANNEL dialplan functions that work for
getting the status of whether a call has secure media or signaling as defined
by the underlying channel technology and for setting whether or not a new
channel being bridged to a calling channel should have secure signaling or
media. See doc/tex/secure-calls.tex for examples.

Original patch by mikma, updated for trunk and revised by me.

(closes issue #5413)
Reported by: mikma
Tested by: twilson, notthematrix, hemanshurpatel

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@268894 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-06-08 05:29:08 +00:00
Richard Mudgett
0760f4e70a Add ETSI Malicious Call ID support.
Add the ability to report malicious callers as an AMI event in the call
event class.

Relevant specification: EN 300 180

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@267350 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-06-02 22:28:58 +00:00