Commit Graph

428 Commits

Author SHA1 Message Date
Mark Michelson f2bb9afe17 Multiple revisions 375993-375994
........
  r375993 | mmichelson | 2012-11-07 11:01:13 -0600 (Wed, 07 Nov 2012) | 30 lines
  
  Fix misuses of timeouts throughout the code.
  
  Prior to this change, a common method for determining if a timeout
  was reached was to call a function such as ast_waitfor_n() and inspect
  the out parameter that told how many milliseconds were left, then use
  that as the input to ast_waitfor_n() on the next go-around.
  
  The problem with this is that in some cases, submillisecond timeouts
  can occur, resulting in the out parameter not decreasing any. When this
  happens thousands of times, the result is that the timeout takes much
  longer than intended to be reached. As an example, I had a situation where
  a 3 second timeout took multiple days to finally end since most wakeups
  from ast_waitfor_n() were under a millisecond.
  
  This patch seeks to fix this pattern throughout the code. Now we log the
  time when an operation began and find the difference in wall clock time
  between now and when the event started. This means that sub-millisecond timeouts
  now cannot play havoc when trying to determine if something has timed out.
  
  Part of this fix also includes changing the function ast_waitfor() so that it
  is possible for it to return less than zero when a negative timeout is given
  to it. This makes it actually possible to detect errors in ast_waitfor() when
  there is no timeout.
  
  (closes issue ASTERISK-20414)
  reported by David M. Lee
  
  Review: https://reviewboard.asterisk.org/r/2135/
........
  r375994 | mmichelson | 2012-11-07 11:08:44 -0600 (Wed, 07 Nov 2012) | 3 lines
  
  Remove some debugging that accidentally made it in the last commit.
........

Merged revisions 375993-375994 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........

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

Merged revisions 376014 from http://svn.asterisk.org/svn/asterisk/branches/11


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@376015 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-11-07 19:15:26 +00:00
Richard Mudgett e2702177a4 chan_dahdi: Fix segfault dereferencing a NULL tech_pvt.
The tech support customer was using the AMI Redirect action shortly after
a call was placed.  While the channel tried to do an ast_read(), the
masquerade resulting from the channel redirect took place.  The masquerade
in the middle of the ast_read() resulted in the segfault.

(closes issue AST-1025)
Reported by: Trey Blancher
Patches:
      jira_ast_1025_v1.8_v2.patch (license #5621) patch uploaded by rmudgett
........

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

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

Merged revisions 375363 from http://svn.asterisk.org/svn/asterisk/branches/11


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@375364 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-10-29 15:56:13 +00:00
Andrew Latham 3820f1586e Doxygen Updates - Title update
Update and extend the configuration_file group and enable linking.  Update title that was left behind many years ago.

(issue ASTERISK-20259)


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@375006 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-10-14 21:47:40 +00:00
Andrew Latham 99e1174bfa Doxygen Cleanup
Start adding configuration file linking and pages.  Add module loading doxygen block.

Breaking up commits to keep it easy to track

(issue ASTERISK-20259)


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@374166 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-10-01 23:24:35 +00:00
Richard Mudgett b5138fccf4 Add pause one second W dial modifier.
* The following dialplan applications now recognize 'W' to pause sending
DTMF for one second in addition to the previously existing 'w' that paused
sending DTMF for half a second.  Dial, ExternalIVR, and SendDTMF.

* The chan_dahdi analog port dialing and deferred DTMF dialing for PRI now
distinguishes between 'w' and 'W'.  The 'w' pauses dialing for half a
second.  The 'W' pauses dialing for one second.

* Created dahdi_dial_str() in chan_dahdi that eliminated a lot of
duplicated dialing code and diagnostic messages for the channel driver.

(closes issue ASTERISK-20039)
Reported by: Jeremiah Gowdy
Patches:
      jgowdy-wait-6-22-2012.diff (license #5621) patch uploaded by Jeremiah Gowdy
      Expanded patch to add support in chan_dahdi.
Tested by: rmudgett


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@374030 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-09-28 18:27:02 +00:00
Mark Michelson 6a539ace84 Fix misuses of asprintf throughout the code.
This fixes three main issues

* Change asprintf() uses to ast_asprintf() so that it
pairs properly with ast_free() and no longer causes
MALLOC_DEBUG to freak out.

* When ast_asprintf() fails, set the pointer NULL if
it will be referenced later.

* Fix some memory leaks that were spotted while taking
care of the first two points.

(Closes issue ASTERISK-20135)
reported by Richard Mudgett

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

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

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

Merged revisions 371592 from http://svn.asterisk.org/svn/asterisk/branches/11


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@371593 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-08-21 21:01:11 +00:00
Kinsey Moore 76d642ff69 Add HANGUPCAUSE information to callee channels
This adds HANGUPCAUSE information to called channels so that hangup
handlers can, in conjunction with predial dialplan execution, access
the hangupcause information when the dialed channel hangs up on a
one-to-one basis instead of a many-to-one basis as with HANGUPCAUSE
usage on the caller channel.

Review: https://reviewboard.asterisk.org/r/2069/
(closes issue ASTERISK-20198)
........

Merged revisions 371258 from http://svn.asterisk.org/svn/asterisk/branches/11


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@371259 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-08-15 17:56:04 +00:00
Richard Mudgett 18d5041981 Use better libss7 detection test and move libpri compile test.
........

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@371030 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-08-09 19:22:35 +00:00
Richard Mudgett 062becab80 Convert sig_analog to use a global callback table.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@370926 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-08-08 20:32:53 +00:00
Richard Mudgett f1dce57742 Fix the analog dial *0 flash-hook of bridged peer feature.
The flash-hook the bridged peer feature now correctly determines if the
bridged peer is another chan_dahdi channel, that it is an analog channel,
and that it has the correct signaling for an FXO port.  It now also
flash-hooks the correct channel.
........

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@370902 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-08-08 20:17:02 +00:00
Richard Mudgett 35bf5efeaf Convert sig_pri to use a global callback table.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@370893 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-08-08 00:35:37 +00:00
Richard Mudgett f24be2740b Convert sig_ss7 to use a global callback table.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@370887 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-08-08 00:15:54 +00:00
Matthew Jordan 5c4578f4ad Add named callgroups/pickupgroups
This patch adds named calledgroups/pickupgroups to Asterisk.  Named groups are
implemented in parallel to the existing numbered callgroup/pickupgroup
implementation.  However, unlike the existing implementation, which is limited
to a maximum of 64 defined groups, the number of defined groups allowed for
named callgroups/pickupgroups is effectively unlimited.

Named groups are configured with the keywords "namedcallgroup" and
"namedpickupgroup".  This corresponds to the numbered group definitions of
"callgroup" and "pickupgroup".  Note that as the implementation of named groups
coexists with the existing numbered implementation, a defined named group of
"4" does not equate to numbered group 4.

Support for the named groups has been added to the SIP, DAHDI, and mISDN channel
drivers.

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

Uploaded by:
	Guenther Kelleter(license #6372)



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@370831 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-08-07 12:46:36 +00:00
Kinsey Moore 9b16c8b0f6 Clean up and ensure proper usage of alloca()
This replaces all calls to alloca() with ast_alloca() which calls gcc's
__builtin_alloca() to avoid BSD semantics and removes all NULL checks
on memory allocated via ast_alloca() and ast_strdupa().

(closes issue ASTERISK-20125)
Review: https://reviewboard.asterisk.org/r/2032/
Patch-by: Walter Doekes (wdoekes)
........

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@370655 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-07-31 20:21:43 +00:00
Kinsey Moore cb9756daa2 Add hangupcause translation support
The HANGUPCAUSE hash (trunk only) meant to replace SIP_CAUSE has now
been replaced with the HANGUPCAUSE and HANGUPCAUSE_KEYS dialplan
functions to better facilitate access to the AST_CAUSE translations
for technology-specific cause codes. The HangupCauseClear application
has also been added to remove this data from the channel.

(closes issue SWP-4738)
Review: https://reviewboard.asterisk.org/r/2025/


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@370316 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-07-20 15:48:55 +00:00
Richard Mudgett 9773d2351b Add missing ast_hangup() calls on some analog exception paths.
Make starting analog_ss_thread() or __analog_ss_thread() failure paths
hangup the channel.
........

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@370037 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-07-12 20:28:07 +00:00
Matthew Jordan 2ffae5745d Add some additional documentation for core AMI events
This patch adds some basic documentation for a number of modules.  This
includes core source files in Asterisk (those in main), as well as
chan_agent, chan_dahdi, chan_local, sig_analog, and sig_pri.  The DTD
has also been updated to allow referencing of AMI commands.

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@369905 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-07-10 22:26:27 +00:00
Kinsey Moore db59a3f123 Remove unnecessary generation of informational cause frames
It is not necessary to generate information cause code frames on every
protocol event that occurs.  This removes all the instances where the
frame was not conveying a cause code and was instead just conveying a
protocol-specific message.  This also corrects the generation of the
message associated with disconnects for MFC/R2 to use the MFC/R2
specific text for the disconnect cause.


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@369765 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-07-06 22:03:44 +00:00
Jonathan Rose 5eb94d7ebb Unique Call ID logging Phases III and IV
Adds call ID logging changes to specific channel drivers that weren't handled
handled in phase II of Call ID Logging. Also covers logging for threads for
threads created by systems that may be involved with many different calls.
Extra special thanks to Richard for rigorous review of chan_dahdi and its
various signalling modules.

review: https://reviewboard.asterisk.org/r/1927/
review: https://reviewboard.asterisk.org/r/1950/



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@369414 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-06-26 21:45:22 +00:00
Kinsey Moore eaf8d8a0d8 Fix wrong variable name in the R2 disconnect callback
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@369216 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-06-22 19:54:41 +00:00
Kinsey Moore 6a1843bbd0 Add HANGUPCAUSE hash implementation for DAHDI MFC/R2 subtech
This adds a minimal implementation of the "Who Hung Up?" Asterisk 11
work to chan_dahdi.c for the MFC/R2 DAHDI subtech.  Given the way that
OpenR2 interfaces with chan_dahdi, it is much harder to expose the
type of protocol information that is available in PRI, SS7, or other
channel technologies.


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@369190 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-06-22 15:57:02 +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
Richard Mudgett 72eb8eb1e7 Fix deadlock potential with ast_set_hangupsource() calls.
Calling ast_set_hangupsource() with the channel lock held can result in a
deadlock because the function also locks the bridged channel.

(issue ASTERISK-19537)

(closes issue AST-891)
Reported by: Guenther Kelleter
Tested by: Guenther Kelleter

(closes issue ASTERISK-19801)
Reported by: Alec Davis
........

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@368772 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-06-11 17:34:08 +00:00
Kinsey Moore c6142cf2cc Fix coverity UNUSED_VALUE findings in core support level files
Most of these were just saving returned values without using them and
in some cases the variable being saved to could be removed as well.

(issue ASTERISK-19672)
........

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@368751 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-06-11 15:23:30 +00:00
Richard Mudgett 0f71b29e2f Fix POTS flash hook to orignate a second call deadlock.
A deadlock can occur when a POTS phone tries to flash hook to originate a
second call for 3-way or transfer.  If another process is scanning the
channels container when the POTS line flash hooks then a deadlock will
occur.

* Release the channel and private locks when creating a new channel as a
result of a flash hook.

(closes issue ASTERISK-19842)
Reported by: rmudgett
Tested by: rmudgett
........

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@368646 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-06-06 21:34:10 +00:00
Mark Michelson 11348736af Address MISSING_BREAK static analysis reports some more.
This addresses core findings 4 and 6.

Moises Silva helped me by stating that a break could be
safely added to the case where it is added in chan_dahdi.c

In say.c, I have added a comment indicating that static analysis
complains but that it is currently unknown if this is correct.

This fixes all core findings of this type.

(closes issue ASTERISK-19662)
reported by Matthew Jordan
........

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@367029 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-05-18 17:54:07 +00:00
Matthew Jordan 6eb4e81033 Fix more memory leaks
This patch adds to what was fixed in r366880.  Specifically, it addresses the
following:

* chan_sip:   dispose of an allocated frame in off nominal code paths in
              sip_rtp_read
* func_odbc:  when disposing of an allocated resultset, ensure that any rows
              that were appended to that resultset are also disposed of
* cli:        free the created return string buffer in another off nominal code
              path
* chan_dahdi: free a frame that was allocated by the dsp layer if we choose
              not to process that frame

(issue ASTERISK-19665)
Reported by: Matt Jordan

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

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@366955 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-05-18 15:51:16 +00:00
Matthew Jordan 7b51320642 Fix a variety of memory leaks
This patch addresses a number of memory leaks in a variety of modules that were
found by a static analysis tool.  A brief summary of the changes:

* app_minivm:       free ast_str objects on off nominal paths
* app_page:         free the ast_dial object if the requested channel technology
                    cannot be appended to the dialing structure
* app_queue:        if a penalty rule failed to match any existing rule list
                    names, the created rule would not be inserted and its memory
                    would be leaked
* app_read:         dispose of the created silence detector in the presence of
                    off nominal circumstances
* app_voicemail:    dispose of an allocated unique ID field for MWI event
                    un-subscribe requests in off nominal paths; dispose of
                    configuration objects when using the secret.conf option
* chan_dahdi:       dispose of the allocated frame produced by ast_dsp_process
* chan_iax2:        properly unref peer in CLI command "iax2 unregister"
* chan_sip:         dispose of the allocated frame produced by sip_rtp_read's
                    call of ast_dsp_process; free memory in parse unit tests
* func_dialgroup:   properly deref ao2 object grhead in nominal path of
                    dialgroup_read
* func_odbc:        free resultset in off nominal paths of odbc_read
* cli:              free match_list in off nominal paths of CLI match completion
* config:           free comment_buffer/list_buffer when configuration file load
                    is unchanged; free the same buffers any time they were
                    created and config files were processed
* data:             free XML nodes in various places
* enum:             free context buffer in off nominal paths
* features:         free ast_call_feature in off nominal paths of applicationmap
                    config processing
* netsock2:         users of ast_sockaddr_resolve pass in an ast_sockaddr struct
                    that is allocated by the method.  Failures in
                    ast_sockaddr_resolve could result in the users of the method
                    not knowing whether or not the buffer was allocated.  The
                    method will now not allocate the ast_sockaddr struct if it
                    will return failure.
* pbx:              cleanup hash table traversals in off nominal paths; free
                    ignore pattern buffer if it already exists for the specified
                    context
* xmldoc:           cleanup various nodes when we no longer need them
* main/editline:    various cleanup of pointers not being freed before being
                    assigned to other memory, cleanup along off nominal paths
* menuselect/mxml:  cleanup of value buffer for an attribute when that attribute
                    did not specify a value
* res_calendar*:    responses are allocated via the various *_request method
                    returns and should not be allocated in the various
                    write_event methods; ensure attendee buffer is freed if no
                    data exists in the parsed node; ensure that calendar objects
                    are de-ref'd appropriately
* res_jabber:       free buffer in off nominal path
* res_musiconhold:  close the DIR* object in off nominal paths
* res_rtp_asterisk: if we run out of ports, close the rtp socket object and free
                    the rtp object
* res_srtp:         if we fail to create the session in libsrtp, destroy the
                    temporary ast_srtp object

(issue ASTERISK-19665)
Reported by: Matt Jordan

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

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@366917 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-05-18 14:43:44 +00:00
Matthew Jordan 87113f1a0c Fix checking bounds of array index after using it; improper sizeof
This patch fixes two problems pointed out by a static analysis tool.

* In chan_dahdi, when an event is handled the index of the sub channel is first
  obtained.  In very off nominal cases, the method that determines the index
  can return a negative value.  In the event handling code, whether or not
  the index returned is valid was being checked after that value was used to
  index into an array.  This patch makes it so the value is checked before
  any indexing is done.

* In res_calendar_ews, sizeof was being passed a pointer instead of the struct to
  determine the amount of memory to allocate.

(issue ASTERISK-19651)
Reported by: Matt Jordan

(closes issue ASTERISK-19671)
Reported by: Matt Jordan
........

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@366746 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-05-17 13:21:19 +00:00
Kinsey Moore dd81b047db Resolve FORWARD_NULL static analysis warnings
This resolves core findings from ASTERISK-19650 numbers 0-2, 6, 7, 9-11, 14-20,
22-24, 28, 30-32, 34-36, 42-56, 82-84, 87, 89-90, 93-102, 104, 105, 109-111,
and 115. Finding numbers 26, 33, and 29 were already resolved.  Those skipped
were either extended/deprecated or in areas of code that shouldn't be
disturbed.

(Closes issue ASTERISK-19650)
........

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@366169 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-05-10 20:56:09 +00:00
Richard Mudgett af39a4374e Make DAHDISendCallreroutingFacility wait 5 seconds for a reply before disconnecting the call.
Some switches may not handle the call-deflection/call-rerouting message if
the call is disconnected too soon after being sent.  Asteisk was not
waiting for any reply before disconnecting the call.

* Added a 5 second delay before disconnecting the call to wait for a
potential response if the peer does not disconnect first.

(closes issue ASTERISK-19708)
Reported by: mehdi Shirazi
Patches:
      jira_asterisk_19708_v1.8.patch (license #5621) patch uploaded by rmudgett
Tested by: rmudgett
........

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@363740 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-04-25 20:51:58 +00:00
Richard Mudgett d2ac624b87 Clear ISDN channel resetting state if the peer continues to use it.
Some ISDN switches occasionally fail to send a RESTART ACKNOWLEDGE in
response to a RESTART request.

* Made the second SETUP received after sending a RESTART request clear the
channel resetting state as if the peer had sent the expected RESTART
ACKNOWLEDGE before continuing to process the SETUP.  The peer may not be
sending the expected RESTART ACKNOWLEDGE.

(issue ASTERISK-19608)
(issue AST-844)
(issue AST-815)
Patches:
      jira_ast_815_v1.8.patch (license #5621) patch uploaded by rmudgett (modified)
........

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@363689 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-04-25 19:55:12 +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
Richard Mudgett c7cb03a975 Add ability to ignore layer 1 alarms for BRI PTMP lines.
Several telcos bring the BRI PTMP layer 1 down when the line is idle.
When layer 1 goes down, Asterisk cannot make outgoing calls.  Incoming
calls could fail as well because the alarm processing is handled by a
different code path than the Q.931 messages.

* Add the layer1_presence configuration option to ignore layer 1 alarms
when the telco brings layer 1 down.  This option can be configured by span
while the similar DAHDI driver teignorered=1 option is system wide.  This
option unlike layer2_persistence does not require libpri v1.4.13 or newer.

Related to JIRA AST-598

JIRA ABE-2845
........

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@362430 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-04-18 16:41:17 +00:00
Walter Doekes fc63e07135 Avoid cppcheck warnings; removing unused vars and a bit of cleanup.
Patch by: junky
Review: https://reviewboard.asterisk.org/r/1743/


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@362307 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-04-17 18:57:40 +00:00
Matthew Jordan 2fed9cfa8f Fix negative return handling in channel drivers
In chan_agent, while handling a channel indicate, the agent channel driver
must obtain a lock on both the agent channel, as well as the channel the
agent channel is using.  To do so, it attempts to lock the other channel
first, then unlock the agent channel which is locked prior to entry into
the indicate handler.  If this unlock fails with a negative return value,
which can occur if the object passed to agent_indicate is an invalid ao2
object or is NULL, the return value is passed directly to strerror, which
can only accept positive integer values.

In chan_dahdi, the return value of dahdi_get_index is used to directly
index into the sub-channel array.  If dahd_get_index returns a negative
value, it would use that value to index into the array, which could cause
an invalid memory access.  If dahdi_get_index returns a negative number,
we now default to SUB_REAL.

(issue ASTERISK-19655)
Reported by: Matt Jordan

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

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@362206 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-04-16 21:58:06 +00:00
Richard Mudgett 198046d706 Prevent invalid access of free'd memory if DAHDI channel during an MWI event
In the MWI processing loop, when a valid event occurs the temporary caller ID
information is deallocated.  If a new DAHDI channel is successfully created,
the event is passed up to the analog_ss_thread without error and the loop
exits.  If, however, the DAHDI channel is not created, then the caller ID
struct has been free'd, and the gains reset to their previous level.  This
will almost certainly cause an invalid access to the free'd memory, either
in subsequent calls to callerid_free or calls to callerid_feed.

* Rework the -r361705 patch to better manage the cs and mtd allocated
resources.

* Fixed use of mwimonitoractive flag to be correct if the mwi_thread()
fails to start.
........

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@361856 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-04-10 21:50:46 +00:00
Matthew Jordan 97f813f3a4 Prevent invalid access of free'd memory if DAHDI channel during an MWI event
In the MWI processing loop, when a valid event occurs the temporary caller ID
information is deallocated.  If a new DAHDI channel is successfully created, 
the event is passed up to the analog_ss_thread without error and the loop
exits.  If, however, the DAHDI channel is not created, then the caller ID
struct has been free'd, and the gains reset to their previous level.  This
will almost certainly cause an invalid access to the free'd memory, either
in subsequent calls to callerid_free or calls to callerid_feed.

This patch makes it so that we only free the caller ID structure if a
DAHDI channel is successfully created, and we bump the gains back up
if we fail to make a DAHDI channel.
........

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@361707 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-04-09 20:55:53 +00:00
Richard Mudgett a22b56235b Add ability for chan_dahdi ISDN to block connected line updates per span.
Added new chan_dahdi.conf colp_send option parameter to block connected
line updates per span.

(closes issue ASTERISK-17025)
Reported by: Michael Smith


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@358997 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-03-13 21:18:31 +00:00
Terry Wilson 786f5898d1 Finalize ast_channel opaquification
Review: https://reviewboard.asterisk.org/r/1786/


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@358907 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-03-13 18:20:34 +00:00
Richard Mudgett 82ac7fb643 Fix ring cadance setup for outgoing calls on FXS ports.
* Fix referencing the wrong variable in chan_dahdi.c:my_set_cadence().

Thanks to Sean Bright for compiling with -Wshadow and finding this bug.
........

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@358379 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-03-06 17:47:40 +00:00
Richard Mudgett a0f8821749 Add dialtone_detect option for analog incoming calls.
For analog lines, enables Asterisk to use dialtone detection per channel
if an incoming call was hung up before it was answered.  If dialtone is
detected, the call is hung up.
no:       Disabled. (Default)
yes:      Look for dialtone for 10000 ms after answer.
<number>: Look for dialtone for the specified number of ms after answer.
always:   Look for dialtone for the entire call.  Dialtone may return
          if the far end hangs up first.

dialtone_detect=yes
dialtone_detect=5000
dialtone_detect=always

(closes issue ASTERISK-19316)
Reported by: Jeremy Pepper
Patch by: Jeremy Pepper
Tested by: rmudgett,Jeremy Pepper

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@358344 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-03-06 01:56:10 +00:00
Richard Mudgett dda40528ed Setup DSP when SS7 call is connected or early media is available.
Outgoing SS7 calls fail to detect incoming DTMF so any bridged channel
that requires out-of-band DTMF will not work.

* Added sig_ss7_open_media() calls at appropriate places in sig_ss7.c.
The new call converts conditionaled out unconverted code and shows that
the code really did something useful.

* Improved some chan_dahdi DTMF debug messages to help track DTMF
handling.

(closes issue ASTERISK-19312)
Reported by: Igor Nikolaev
........

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@358262 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-03-05 21:48:32 +00:00
Mark Michelson 4094a9f57e Fix compilation error due to typo during channel opaquification.
s/ast_channel_fd_set/ast_channel_internal_fd_set/g



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@357774 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-03-02 01:25:36 +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 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
Sean Bright db487bd7f8 This was a LOG_NOTICE, so roll it back.
........

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@355954 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-02-20 14:41:21 +00:00
Sean Bright 2bd6649a93 Change some debug messages from LOG_DEBUG to ast_debug.
........

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@355951 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-02-20 14:37:41 +00:00