Commit Graph

296 Commits

Author SHA1 Message Date
Kinsey Moore c2d9192660 Fix build error in chan_misdn from commit 370316
chan_misdn was not updated properly to account for a change in
parameters for HANGUPCAUSE functionality. It now builds properly.


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@370328 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-07-20 18:37:44 +00:00
Richard Mudgett c11c6b6cb0 Fix chan_misdn compile error.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@369166 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-06-20 21:32:40 +00:00
Kinsey Moore f080be134e Ensure that pvt cause information does not break native bridging
Channel drivers that allow native bridging need to handle
AST_CONTROL_PVT_CAUSE_CODE frames and previously did not handle them
properly, usually breaking out of the native bridge. This change
corrects that behavior and exposes the available cause code information
to the dialplan while native bridges are in place. This required
exposing the HANGUPCAUSE hash setter outside of channel.c, so
additional documentation has been added.


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@369086 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-06-19 21:13:41 +00:00
Kevin P. Fleming 166b4e2b30 Multiple revisions 369001-369002
........
  r369001 | kpfleming | 2012-06-15 10:56:08 -0500 (Fri, 15 Jun 2012) | 11 lines
  
  Add support-level indications to many more source files.
  
  Since we now have tools that scan through the source tree looking for files
  with specific support levels, we need to ensure that every file that is
  a component of a 'core' or 'extended' module (or the main Asterisk binary)
  is explicitly marked with its support level. This patch adds support-level
  indications to many more source files in tree, but avoids adding them to
  third-party libraries that are included in the tree and to source files
  that don't end up involved in Asterisk itself.
........
  r369002 | kpfleming | 2012-06-15 10:57:14 -0500 (Fri, 15 Jun 2012) | 3 lines
  
  Add a script to enable finding source files without support-levels defined.
........

Merged revisions 369001-369002 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........

Merged revisions 369005 from http://svn.asterisk.org/svn/asterisk/branches/10


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@369013 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-06-15 16:20:16 +00:00
Kinsey Moore b5a6de76fc Commit framework for HANGUPCAUSE (replacement for SIP_CAUSE)
This is the starting point for the Asterisk 11: Who Hung Up work and provides
a framework which will allow channel drivers to report the types of hangup
cause information available in SIP_CAUSE without incurring the overhead of the
MASTER_CHANNEL dialplan function. The initial implementation only includes
cause generation for chan_sip and does not include cause code translation
utilities.

This change deprecates SIP_CAUSE and replaces its method of reporting cause
codes with the new framework. This change also deprecates the 'storesipcause'
option in sip.conf.

Review: https://reviewboard.asterisk.org/r/1822/
(Closes issue SWP-4221)


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@366408 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-05-14 19:44:27 +00:00
Richard Mudgett 01194c5811 Use ast_channel_lock_both() where it was inlined before.
The CHANNEL_DEADLOCK_AVOIDANCE() feature of preserving where the channel
lock was originally obtained is overkill where ast_channel_lock_both() was
inlined.


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@362888 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-04-20 16:23:01 +00:00
Terry Wilson 0e5c761c28 Opaquify ast_channel typedefs, fd arrays, and softhangup flag
Review: https://reviewboard.asterisk.org/r/1784/


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@357721 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-03-01 22:09:18 +00:00
Terry Wilson a9d607a357 Opaquify ast_channel structs and lists
Review: https://reviewboard.asterisk.org/r/1773/


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@357542 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-02-29 16:52:47 +00:00
Terry Wilson ebaf59a656 Opaquification for ast_format structs in struct ast_channel
Review: https://reviewboard.asterisk.org/r/1770/


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@356573 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-02-24 00:32:20 +00:00
Terry Wilson 90a6848c67 Fix chan_misdn after the lastest opaquification changes
It now compiles, but there are some unrelated warnings for set but
unused variables.


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@356259 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-02-22 17:34:33 +00:00
Terry Wilson 57f42bd74f ast_channel opaquification of pointers and integral types
Review: https://reviewboard.asterisk.org/r/1753/


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@356042 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-02-20 23:43:27 +00:00
Richard Mudgett d8af1a4882 Fix compile error from most recent ast_channel opaquification installment.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@355055 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-02-13 21:36:26 +00:00
Terry Wilson 34c55e8e7c Opaquify char * and char[] in ast_channel
Review: https://reviewboard.asterisk.org/r/1733/


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@354968 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-02-13 17:27:06 +00:00
Richard Mudgett 16fbc7e902 Fix some compile problems from the 'cppcheck' patch.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@354498 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-02-09 03:09:39 +00:00
Walter Doekes db24fc2523 Avoid cppcheck warnings; removing unused vars and a bit of cleanup.
Patch by: Clod Patry
Review: https://reviewboard.asterisk.org/r/1651


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@354429 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-02-08 20:49:48 +00:00
Richard Mudgett 23bc964e1c Constify some more channel driver technology callback parameters.
Review: https://reviewboard.asterisk.org/r/1707/


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@353685 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-02-01 19:53:38 +00:00
Terry Wilson 99cae5b750 Opaquify channel stringfields
Continue channel opaque-ification by wrapping all of the stringfields.
Eventually, we will restrict what can actually set these variables, but
the purpose for now is to hide the implementation and keep people from
adding code that directly accesses the channel structure. Semantic
changes will follow afterward.

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@352348 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-01-24 20:12:09 +00:00
Terry Wilson 04da92c379 Replace direct access to channel name with accessor functions
There are many benefits to making the ast_channel an opaque handle, from
increasing maintainability to presenting ways to kill masquerades. This patch
kicks things off by taking things a field at a time, renaming the field to
'__do_not_use_${fieldname}' and then writing setters/getters and converting the
existing code to using them. When all fields are done, we can move ast_channel
to a C file from channel.h and lop off the '__do_not_use_'.

This patch sets up main/channel_interal_api.c to be the only file that actually
accesses the ast_channel's fields directly. The intent would be for any API
functions in channel.c to use the accessor functions. No more monkeying around
with channel internals. We should use our own APIs.

The interesting changes in this patch are the addition of
channel_internal_api.c, the moving of the AST_DATA stuff from channel.c to
channel_internal_api.c (note: the AST_DATA stuff will have to be reworked to
use accessor functions when ast_channel is really opaque), and some re-working
of the way channel iterators/callbacks are handled so as to avoid creating fake
ast_channels on the stack to pass in matching data by directly accessing fields
(since "name" is a stringfield and the fake channel doesn't init the
stringfields, you can't use the ast_channel_name_set() function). I went with
ast_channel_name(chan) for a getter, and ast_channel_name_set(chan, name) for a
setter.

The majority of the grunt-work for this change was done by writing a semantic
patch using Coccinelle ( http://coccinelle.lip6.fr/ ).

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@350223 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-01-09 22:15:50 +00:00
Gregory Nietsky 3845299e46 mISDN Round Robin break when no channel is available
Prevent channels been parsed repetitively.
........

Merged revisions 344965 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........

Merged revisions 344966 from http://svn.asterisk.org/svn/asterisk/branches/10


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@344979 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-11-12 16:32:45 +00:00
Gregory Nietsky b5a641d1fe Merged revisions 336167 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/10

................
  r336167 | irroot | 2011-09-16 12:12:03 +0200 (Fri, 16 Sep 2011) | 22 lines
  
  Merged revisions 336166 via svnmerge from 
  https://origsvn.digium.com/svn/asterisk/branches/1.8
  
  ........
    r336166 | irroot | 2011-09-16 12:09:17 +0200 (Fri, 16 Sep 2011) | 16 lines
    
    The round robin routing routine in chan_misdn.c is broken.
    
    it rotates between ports but never checks the channels in the ports.
    
    i have extensivly tested it and verified it works on 1 upto 4 ports.
    before the patch only 1 out of each port was used now all are used as
    expected.
    
    (closes issue ASTERISK-18413)
    Reported by: irroot
    Tested by: irroot
    Reviewed by: irroot
        
    Review: https://reviewboard.asterisk.org/r/1410/
  ........
................


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@336168 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-09-16 10:16:56 +00:00
Matthew Jordan 8b5ba33fe0 Merged revisions 335078 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/10

................
  r335078 | mjordan | 2011-09-09 11:27:01 -0500 (Fri, 09 Sep 2011) | 29 lines
  
  Merged revisions 335064 via svnmerge from 
  https://origsvn.digium.com/svn/asterisk/branches/1.8
  
  ........
    r335064 | mjordan | 2011-09-09 11:09:09 -0500 (Fri, 09 Sep 2011) | 23 lines
    
    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/trunk@335079 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-09-09 16:28:23 +00:00
Leif Madsen a525edea59 Merged revisions 328247 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.10

................
  r328247 | lmadsen | 2011-07-14 16:25:31 -0400 (Thu, 14 Jul 2011) | 14 lines
  
  Merged revisions 328209 via svnmerge from 
  https://origsvn.digium.com/svn/asterisk/branches/1.8
  
  ........
    r328209 | lmadsen | 2011-07-14 16:13:06 -0400 (Thu, 14 Jul 2011) | 6 lines
    
    Introduce <support_level> tags in MODULEINFO.
    This change introduces MODULEINFO into many modules in Asterisk in order to show
    the community support level for those modules. This is used by changes committed
    to menuselect by Russell Bryant recently (r917 in menuselect). More information about
    the support level types and what they mean is available on the wiki at
    https://wiki.asterisk.org/wiki/display/AST/Asterisk+Module+Support+States
  ........
................


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@328259 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-07-14 20:28:54 +00:00
Richard Mudgett 6826b083ec Merged revisions 312509 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.8

........
  r312509 | rmudgett | 2011-04-01 18:15:42 -0500 (Fri, 01 Apr 2011) | 22 lines
  
  When a call going out an NT-PTMP port gets rejected, Asterisk crashes.
  
  If a call is sent to an ISDN phone that rejects the call with
  RELEASE_COMPLETE(cause: call reject(21), or busy(17)) Asterisk crashes.
  
  I could not get my setup to crash.  However, I could see the possibility
  from a race condition between queuing an AST_CONTROL_BUSY to the core and
  then queueing an AST_CONTROL_HANGUP.  If the AST_CONTROL_BUSY is processed
  before the AST_CONTROL_HANGUP is queued, the ast_channel could be
  destroyed out from under chan_misdn.
  
  Avoid this particular crash scenario by not queueing the
  AST_CONTROL_HANGUP if the AST_CONTROL_BUSY was queued.
  
  (closes issue #18408)
  Reported by: wimpy
  Patches:
        issue18408_v1.8.patch uploaded by rmudgett (license 664)
  Tested by: rmudgett, wimpy
  
  JIRA SWP-2679
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@312510 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-04-01 23:17:05 +00:00
Richard Mudgett ee44bf7257 Merged revisions 312022 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.8

........
  r312022 | rmudgett | 2011-03-31 15:11:40 -0500 (Thu, 31 Mar 2011) | 14 lines
  
  chan_misdn segfaults when DEBUG_THREADS is enabled.
  
  The segfault happens because jb->mutexjb is uninitialized from the
  ast_malloc().  The internals of ast_mutex_init() were assuming a nonzero
  value meant mutex tracking initialization had already happened.  Recent
  changes to mutex tracking code to reduce excessive memory consumption
  exposed this uninitialized value.
  
  Converted misdn_jb_init() to use ast_calloc() instead of ast_malloc().
  Also eliminated redundant zero initialization code in the routine.
  
  (closes issue #18975)
  Reported by: irroot
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@312023 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-03-31 20:12:34 +00:00
Paul Belanger 3556e4c2d4 Replace ast_log(LOG_DEBUG, ...) with ast_debug()
(closes issue #18556)
Reported by: kkm

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@306258 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-02-04 16:55:39 +00:00
David Vossel c26c190711 Asterisk media architecture conversion - no more format bitfields
This patch is the foundation of an entire new way of looking at media in Asterisk.
The code present in this patch is everything required to complete phase1 of my
Media Architecture proposal.  For more information about this project visit the link below.
https://wiki.asterisk.org/wiki/display/AST/Media+Architecture+Proposal

The primary function of this patch is to convert all the usages of format
bitfields in Asterisk to use the new format and format_cap APIs.  Functionally
no change in behavior should be present in this patch.  Thanks to twilson
and russell for all the time they spent reviewing these changes.

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



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@306010 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-02-03 16:22:10 +00:00
Russell Bryant 9ae2d8024d Fix chan_misdn build after sched API changes.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@299134 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-12-20 17:59:38 +00:00
Richard Mudgett 267cf27744 Merged revisions 296582 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.8

................
  r296582 | rmudgett | 2010-11-29 14:46:03 -0600 (Mon, 29 Nov 2010) | 24 lines
  
  Merged revision 296575 from
  https://origsvn.digium.com/svn/asterisk/be/branches/C.3-bier
  
  ..........
    r296575 | rmudgett | 2010-11-29 14:27:37 -0600 (Mon, 29 Nov 2010) | 13 lines
  
    Invalid mISDN PTMP redirecting signaling as TE towards NT.
  
    The mISDN PTMP redirection signaling (NOTIFY redirecting number and
    notification code, SETUP redirecting number) is also sent in PTMP/TE mode.
    It should only apply in PTMP/NT mode.  The call setup proceeds but the
    network (Deutsche Telekom) reacts with ugly ISDN STATUS messages.
  
    Also don't send the redirecting number ie when PTP is also sending the
    DivertingLegInformation2 facility.  The redirecting number ie is redundant
    and the network (Deutsche Telekom) complains about it.
  
    Patches:
          abe_2651_v4.patch uploaded by rmudgett (license 664)
  
    JIRA ABE-2651
    JIRA SWP-2537
  ..........
................


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@296585 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-11-29 20:54:27 +00:00
Richard Mudgett 3adb425b25 Merged revisions 294349 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.8

........
  r294349 | rmudgett | 2010-11-09 10:55:32 -0600 (Tue, 09 Nov 2010) | 17 lines
  
  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/trunk@294351 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-11-09 17:00:07 +00:00
Richard Mudgett 18553bb804 Merged revisions 294125 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.8

........
  r294125 | rmudgett | 2010-11-08 11:16:01 -0600 (Mon, 08 Nov 2010) | 33 lines
  
  valgrind reported references to freed memory during a mISDN hangup collision.
  
  Bad things have been happening in chan_misdn because the chan_misdn
  channel private struct chan_list is not protected from reentrancy.  Hangup
  collisions have be causing read and write accesses to freed memory.
  
  Converted chan_misdn struct chan_list to an ao2 object for its reference
  counting feature.
  
  **********
  Removed an impediment to converting chan_list to an ao2 object.
  
  The use of the other_ch member in chan_list is shaky at best.  It is set
  if the incoming and outgoing call legs are mISDN.  The use of the other_ch
  member goes against the Asterisk architecture and can even cause problems.
  
  1) It is used to disable echo cancellation.  This could be bad if the call
  is forked and the winning call leg is not mISDN or the winning call leg is
  not the last mISDN channel called by the fork.  The other_ch would become
  a dangling pointer.
  
  2) It is used when the far end is alerting to hear the far end's inband
  audio instead of Asterisk's generated ringback tone.  This is bad if the
  call is forked.  You would only hear the last forked mISDN channel and it
  may not be ringing yet.
  
  The other_ch would become a dangling pointer if the call is later
  transferred.
  **********
  
  JIRA SWP-2423
  JIRA ABE-2614
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@294127 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-11-08 17:19:04 +00:00
Richard Mudgett 64845d73c7 Merged revisions 292704 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.8

........
  r292704 | rmudgett | 2010-10-22 10:47:08 -0500 (Fri, 22 Oct 2010) | 19 lines
  
  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/trunk@292705 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-10-22 15:47:56 +00:00
Richard Mudgett 5077d4aae0 Merged revisions 291507 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.8

................
  r291507 | rmudgett | 2010-10-13 14:01:48 -0500 (Wed, 13 Oct 2010) | 18 lines
  
  Merged revision 291504 from
  https://origsvn.digium.com/svn/asterisk/be/branches/C.3-bier
  
  ..........
    r291504 | rmudgett | 2010-10-13 13:30:21 -0500 (Wed, 13 Oct 2010) | 11 lines
  
    Hold off ast_hangup() from destroying the ast_channel.
  
    Must get the ast_channel lock before proceeding with release_chan() and
    release_chan_early() to hold off ast_hangup() from destroying the
    ast_channel.
  
    Missed this change for -r291468.
  
    JIRA ABE-2598
    JIRA SWP-2317
  ..........
................


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@291508 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-10-13 19:06:55 +00:00
Richard Mudgett 8f725c6cb5 Merged revisions 291469 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.8

................
  r291469 | rmudgett | 2010-10-13 13:10:21 -0500 (Wed, 13 Oct 2010) | 23 lines
  
  Merge revision 291468 from
  https://origsvn.digium.com/svn/asterisk/be/branches/C.3-bier
  
  ..........
    r291468 | rmudgett | 2010-10-13 12:39:02 -0500 (Wed, 13 Oct 2010) | 16 lines
  
    Memory overwrites when releasing mISDN call.
  
    Phone <--> Asterisk
    <-- ALERTING
    --> DISCONNECT
    <-- RELEASE
    --> RELEASE_COMPLETE
  
    * Add lock protection around channel list for find/add/delete operations.
  
    * Protect misdn_hangup() from release_chan() and vise versa using the
    release_lock.
  
    JIRA ABE-2598
    JIRA SWP-2317
  ..........
................


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@291470 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-10-13 18:15:23 +00:00
Richard Mudgett 8193e24e1a Merged revisions 289549 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.8

................
  r289549 | rmudgett | 2010-09-30 14:28:36 -0500 (Thu, 30 Sep 2010) | 17 lines
  
  Merged revision 289547 from
  https://origsvn.digium.com/svn/asterisk/be/branches/C.3-bier
  
  ..........
    r289547 | rmudgett | 2010-09-30 14:16:36 -0500 (Thu, 30 Sep 2010) | 10 lines
  
    In chan_misdn, the DivertingLegInformation2 DivertingNr is garbage when the number is restricted.
  
    The same thing happens with DivertingLegInformation1 DivertedTo number.
  
    The misdn_PresentedNumberUnscreened_extract() extracted the Unscreened
    PartyNumber field unconditionally.  It now checks the presented number
    unscreened type to see if the PartyNumber was even present.
  
    JIRA ABE-2595
  ..........
................


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@289552 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-09-30 19:35:47 +00:00
Richard Mudgett c1af98603b Merged revisions 287017 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.8

................
  r287017 | rmudgett | 2010-09-15 15:53:38 -0500 (Wed, 15 Sep 2010) | 65 lines
  
  Merged revision 287014 from
  https://origsvn.digium.com/svn/asterisk/be/branches/C.3-bier
  
  ..........
    r287014 | rmudgett | 2010-09-15 15:32:24 -0500 (Wed, 15 Sep 2010) | 58 lines
  
    The handling of call transfer signaling for mISDN PTMP is not fully implemented.
  
    The handling of call transfer signaling for mISDN PTMP is not fully
    implemented.  The signaling of number updates with ISDN/DSS1 ECT
    supplementary services (ETS 300 369-1) comes along with a notification
    indicator IE and redirection number IE for PTMP.  The implementation in
    the current Asterisk mISDN channel unfortunately can handle these
    information elements only in a NOTIFY message.  These information elements
    are also signaled in a FACILTY message with a RequestSubaddress facility,
    when the subscriber is already in the active state (see 9.2.4 and 9.2.5 of
    ETS 300 369-1).
  
    **********
  
    abe_2526_ast.patch
  
    * Added support to handle the notification indicator IE and redirection
    number IE with the RequestSubaddress facility.
  
    * Made misdn_update_connected_line() send a NOTIFY message if Asterisk
    originated the call and it is not connected yet.
  
    * Made misdn_update_connected_line() send a FACILITY message if the call
    is already connected.
  
    This patch requires the presence of the associated mISDN patches to
    compile.  I had to enhance mISDN to allow the notification indicator IE
    and the redirection number IE to be used with a FACILITY message.  Earlier
    versions of the Digium enhanced mISDN are no longer going to work.
  
    **********
  
    abe_2526_misdn.patch
  
    * Made an incoming FACILITY message allow the presence of the notification
    indicator IE and the redirection number IE.
  
    **********
  
    abe_2526_misdnuser_v3.patch
  
    * Added support to send and receive a FACILITY message with the
    notification indicator IE and the redirection number IE.
  
    * Added the ability to send a NOTIFY message in PTMP/NT mode to all
    responding subcalls in Q.931 states 6, 7, 8, 9, and 25.
  
    **********
  
    Patches:
  	abe_2526_ast.patch uploaded by rmudgett (license 664)
  	abe_2526_misdn.patch uploaded by rmudgett (license 664)
  	abe_2526_misdnuser_v3.patch uploaded by rmudgett (license 664)
    Tested by: rmudgett and reporter
  
    JIRA SWP-2146
    JIRA ABE-2526
  ..........
................


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@287018 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-09-15 20:56:21 +00:00
Richard Mudgett 6c5e3d5966 Merged revisions 285195 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.8

................
  r285195 | rmudgett | 2010-09-07 12:47:34 -0500 (Tue, 07 Sep 2010) | 20 lines
  
  Merged revisions 285193 via svnmerge from
  https://origsvn.digium.com/svn/asterisk/be/branches/C.3-bier
  
  ........
    Merged revisions 285192 via svnmerge from
    https://origsvn.digium.com/svn/asterisk/be/branches/C.3
  
    ........
      r285192 | rmudgett | 2010-09-07 11:58:57 -0500 (Tue, 07 Sep 2010) | 8 lines
  
      COLP/CONP and chan_misdn missing update
  
      chan_misdn does not update the caller id of the channel if a new connected
      number or ECT-INFORM (w/ new peer number on call transfer) is received.
  
      JIRA ABE-2502
      JIRA SWP-2058
    ........
  ........
................


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@285198 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-09-07 17:55:16 +00:00
Tilghman Lesher 5eae9f44f7 Merged revisions 284597 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.8

................
  r284597 | tilghman | 2010-09-02 00:00:34 -0500 (Thu, 02 Sep 2010) | 29 lines
  
  Merged revisions 284593,284595 via svnmerge from 
  https://origsvn.digium.com/svn/asterisk/branches/1.6.2
  
  ................
    r284593 | tilghman | 2010-09-01 17:59:50 -0500 (Wed, 01 Sep 2010) | 18 lines
    
    Merged revisions 284478 via svnmerge from 
    https://origsvn.digium.com/svn/asterisk/branches/1.4
    
    ........
      r284478 | tilghman | 2010-09-01 13:49:11 -0500 (Wed, 01 Sep 2010) | 11 lines
      
      Ensure that all areas that previously used select(2) now use poll(2), with implementations that need poll(2) implemented with select(2) safe against 1024-bit overflows.
      
      This is a followup to the fix for the pthread timer in 1.6.2 and beyond, fixing
      a potential crash bug in all supported releases.
      
      (closes issue #17678)
       Reported by: russell
      Branch: https://origsvn.digium.com/svn/asterisk/team/tilghman/ast_select 
      
      Review: https://reviewboard.asterisk.org/r/824/
    ........
  ................
    r284595 | tilghman | 2010-09-01 22:57:43 -0500 (Wed, 01 Sep 2010) | 2 lines
    
    Failed to rerun bootstrap.sh after last commit
  ................
................


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@284598 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-09-02 05:02:54 +00:00
Tilghman Lesher b4e18d5660 Add load priority order, such that preload becomes unnecessary in most cases
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@278132 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-07-20 19:35:02 +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
Tzafrir Cohen c613897d1c Fix various typos reported by Lintian
(Also fix the typos in the comments)


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@273641 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-07-02 15:57:02 +00:00
Mark Michelson b5d5cc565f Enhancements to connected line and redirecting work.
From reviewboard:

Digium has a commercial customer who has made extensive use of the connected party and
redirecting information present in later versions of Asterisk Business Edition and which
is to be in the upcoming 1.8 release. Through their use of the feature, new problems and solutions
have come about. This patch adds several enhancements to maximize usage of the connected party
and redirecting information functionality.

First, Asterisk trunk already had connected line interception macros. These macros allow you to
manipulate connected line information before it was sent out to its target. This patch adds the
same feature except for redirecting information instead.

Second, the ast_callerid and ast_party_id structures have been enhanced to provide a "tag." This
tag can be set with func_callerid, func_connectedline, func_redirecting, and in the case of DAHDI,
mISDN, and SIP channels, can be set in a configuration file. The idea behind the callerid tag is
that it can be set to whatever value the administrator likes. Later, when running connected line
and redirecting macros, the admin can read the tag off the appropriate structure to determine what
action to take. You can think of this sort of like a channel variable, except that instead of having
the variable associated with a channel, the variable is associated with a specific identity within
Asterisk.

Third, app_dial has two new options, s and u. The s option lets a dialplan writer force a specific
caller ID tag to be placed on the outgoing channel. The u option allows the dialplan writer to force
a specific calling presentation value on the outgoing channel.

Fourth, there is a new control frame subclass called AST_CONTROL_READ_ACTION added. This was added
to correct a very specific situation. In the case of SIP semi-attended (blond) transfers, the party
being transferred would not have the opportunity to run a connected line interception macro to
possibly alter the transfer target's connected line information. The issue here was that during a
blond transfer, the SIP transfer code has no bridged channel on which to queue the connected line
update. The way this was corrected was to add this new control frame subclass. Now, we queue an
AST_CONTROL_READ_ACTION frame on the channel on which the connected line interception macro should
be run. When ast_read is called to read the frame, ast_read responds by calling a callback function
associated with the specific read action the control frame describes. In this case, the action taken
is to run the connected line interception macro on the transferee's channel.

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@263541 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-05-17 15:36:31 +00:00
Richard Mudgett e2336b73ef Merged revisions 262657,262660 from
https://origsvn.digium.com/svn/asterisk/be/branches/C.3-bier

..........
  r262660 | rmudgett | 2010-05-12 11:46:47 -0500 (Wed, 12 May 2010) | 4 lines

  Forgot some conditionals around the callrerouting facility help text.

  JIRA ABE-2223
..........
  r262657 | rmudgett | 2010-05-12 11:26:49 -0500 (Wed, 12 May 2010) | 22 lines

  Add mISDN Call rerouting facility for point-to-point ISDN lines (exchange line)

  In the case of ISDN point-to-multipoint (multidevice) you can use the
  mISDN "facility calldeflect" application for call diversions from external
  (PSTN) to external (PSTN).  In that case this is the only way to get rid
  of the two call legs to the PBX and let the calling number at the C party
  become the number of the A party.  In the case of ISDN point-to-point
  (exchange line) the call deflection facility may not be used.  Instead a
  call rerouting facility has to be used.

  This patch for chan_misdn.c is an extension to realize this service
  (facility rerouting application).  It can accept either spelling:
  "callrerouting" or "callrerouteing".

  The patch is tested towards Deutsche Telekom and requires a modified
  version of mISDN from Digium, Inc.

  Patches:
        misdn_rerouteing_corrected.patch (Slightly modified.)

  JIRA ABE-2223


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@262661 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-05-12 16:51:03 +00:00
Richard Mudgett a5a0a5f867 Consolidate ast_channel.cid.cid_rdnis into ast_channel.redirecting.from.number.
SWP-1229
ABE-2161

* Ensure chan_local.c:local_call() will not leak cid.cid_dnid when
copying.


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@256104 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-04-03 02:12:33 +00:00
Richard Mudgett 57ee669d9f Merged revisions 247910 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

................
  r247910 | rmudgett | 2010-02-19 11:18:49 -0600 (Fri, 19 Feb 2010) | 55 lines
  
  Merged revision 247904 from
  https://origsvn.digium.com/svn/asterisk/be/branches/C.2-...
  
  ..........
  r247904 | rmudgett | 2010-02-19 10:49:44 -0600 (Fri, 19 Feb 2010) | 49 lines
  
  Make chan_misdn DTMF processing consistent with other channel technologies.
  
  The processing of DTMF tones on the receiving side of an ISDN channel is
  inconsistent with the way it is handled in other channels, especially
  DAHDI analog.  This causes DTMF tones sent from an ISDN phone to be
  doubled at the connected party.
  
  We are using the following 2 options of misdn.conf
  1) astdtmf=yes
  2) senddtmf=yes
  
  Option one is necessary because the asterisk DSP DTMF detection is better
  than mISDN's internal DSP.  Not as many false positives.
  
  Option two is necessary to transmit DTMF tones end to end when mISDN
  channels are connected to SIP channels with out of band DTMF for example.
  
  The symptom is that DTMF tones sent by an ISDN phone are doubled on the
  way through asterisk when two mISDN channels are connected with a Local
  channel in between or if it is bridged to an analog channel.
  
  The doubling of DTMF tones is because DTMF is passed inband to asterisk by
  the mISDN channel and passed out of band once again after the release of
  the DTMF tone.  Passing it inband is wrong.  Neither an analog channel nor
  SIP channel passes DTMF inband if configured to inband DTMF.  Analog and
  SIP channels filter out the DTMF tones because they use the voice frames
  returned by ast_dsp_process.  But chan_misdn passes the unfiltered input
  voice frames instead.
  
  To overcome one aspect of the problem, the doubling of DTMF tones when two
  mISDN channels are directly bridged, someone made an 'optimization', where
  in that case the DTMF tone passed out-of-band to the peer channel is not
  translated to an inband tone at the transmit side.  This optimization is
  bad because it does not work in general.  For example, analog channels or
  mISDN channels when bridged through an intermediary local channel will
  generate DTMF tones from out-of-band information.  Also, of course, it
  must not be done when there is no inband DTMF available.
  
  This patch fixes the issue.  Now chan_misdn will filter the received
  inband DTMF signal the same as other channel types.
  
  Another change included: No need to build an extra translation path
  because ast_process_dsp does it if required.
  
  Patches:
  	misdn-dtmf.patch
  
  JIRA ABE-2080
................


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@247914 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2010-02-19 17:33:33 +00:00
Kevin P. Fleming ef9be94b35 Change all refererences to 1.6.3 to be 1.8, since that will be the next feature release
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@235904 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-12-21 18:51:17 +00:00
David Brooks 45ad82fda3 Merged revisions 228078 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r228078 | dbrooks | 2009-11-05 12:59:41 -0600 (Thu, 05 Nov 2009) | 9 lines
  
  chan_misdn Asterisk 1.4.27-rc2 crash
  
  Crash related to chan_misdn connection. Patch submitted by gknispel_proformatique, tested
  by francesco_r. "I have many crash since i have upgraded to Asterisk 1.4.27-rc2. Attached
  a full bt." This patch zeros out an ast_frame.
  
  (closes issue #16041)
  Reported by: francesco_r
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@228145 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-11-05 19:34:50 +00:00
Tilghman Lesher d8e0c58437 Expand codec bitfield from 32 bits to 64 bits.
Reviewboard: https://reviewboard.asterisk.org/r/416/


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@227580 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-11-04 14:05:12 +00:00
David Vossel 9456ab2724 Deadlock in channel masquerade handling
Channels are stored in an ao2_container.  When accessing an item within
an ao2_container the proper locking order is to first lock the container,
and then the items within it.

In ast_do_masquerade both the clone and original channel must be locked
for the entire duration of the function.  The problem with this is that
it attemptes to unlink and link these channels back into the ao2_container
when one of the channel's name changes.  This is invalid locking order as
the process of unlinking and linking will lock the ao2_container while
the channels are locked!!! Now, both the channels in do_masquerade are
unlinked from the ao2_container and then locked for the entire function.
At the end of the function both channels are unlocked and linked back
into the container with their new names as hash values.

This new method of requiring all channels and tech pvts to be unlocked
before ast_do_masquerade() or ast_change_name() required several
changes throughout the code base.

(closes issue #15911)
Reported by: russell
Patches:
      masq_deadlock_trunk.diff uploaded by dvossel (license 671)
Tested by: dvossel, atis

(closes issue #15618)
Reported by: lmsteffan
Patches:
      deadlock_local_attended_transfers_trunk.diff uploaded by dvossel (license 671)
Tested by: lmsteffan, dvossel

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



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@222761 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-10-07 22:58:38 +00:00
Richard Mudgett 49b90d5e61 Merged revisions 222691 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
  r222691 | rmudgett | 2009-10-07 16:51:24 -0500 (Wed, 07 Oct 2009) | 14 lines
  
  chan_misdn.c:process_ast_dsp() memory leak
  
  misdn.conf: astdtmf must be set to "yes".  With "no", buffer loss does not
  occur.
  
  The translated frame "f2" when passing through ast_dsp_process() is not
  freed whenever it is not used further in process_ast_dsp().  Then in the
  end it is never ever freed.
  
  Patches:
        translate.patch
  
  JIRA ABE-1993
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@222692 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2009-10-07 21:56:36 +00:00