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
It's harder to correlate the Newchannel and Hangup AMI events without
specifying "AccountCode" in both.
(closes issue ASTERISK-19963)
Reported by: Oleg A. Arkhangelsky
Patches:
hangup_acctcode.diff (license #6397) patch uploaded by Oleg A. Arkhangelsky
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@370309 65c4cc65-6c06-0410-ace0-fbb531ad65f3
A number of applications/AMI commands in Asterisk have specific behavioral
differences depending on the resource or channel technology those
applications are executed on. For example, the MessageSend application/
command is technology agnostic, but how the channel drivers that support
that functionality behave is dependant on the protocols and channel
driver implementation. Prior to this patch, those details were either
documented in the application/command documentation itself, or were left
undocumented.
This patch adds a new element to the documentation schema, <info/>. An info
node is essentially a piece of technology specific reference information that
can be included by any top level XML documentation node. For example, the
MessageSend application can now include XMPP/SIP specific information, where
that technology specific information can be defined in chan_motif/res_xmpp/
chan_sip. Likewise, that information can also be included in the MessageSend
AMI command.
Review: https://reviewboard.asterisk.org/r/2049
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@370278 65c4cc65-6c06-0410-ace0-fbb531ad65f3
To fix a memory leak in CEL, a channel datastore was introduced whose
destruction function pointer was pointed to the ast_free macro. Without
MALLOC_DEBUG enabled this compiles as fine, as ast_free is defined as free.
With MALLOC_DEBUG enabled, however, ast_free takes on a definition from a
different place then utils.h, and became undefined. This patch resolves this
by using a reference to ast_free_ptr. When MALLOC_DEBUG is enabled, this
calls ast_free; when MALLOC_DEBUG is not enabled, this is defined to be
ast_free, which is defined to be free.
(issue AST-916)
Reported by: Thomas Arimont
........
Merged revisions 370273 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........
Merged revisions 370274 from http://svn.asterisk.org/svn/asterisk/branches/10
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@370276 65c4cc65-6c06-0410-ace0-fbb531ad65f3
A customer reported a significant memory leak using Asterisk 1.8. They
have tracked it down to ast_cel_fabricate_channel_from_event() in
main/cel.c, which is called by both in-tree CEL logging modules
(cel_custom.c and cel_sqlite3_custom.c) for each and every CEL event
that they log.
The cause was an incorrect assumption about how data attached to an
ast_channel would be handled when the channel is destroyed; the data
is now stored in a datastore attached to the channel, which is
destroyed along with the channel at the proper time.
(closes issue AST-916)
Reported by: Thomas Arimont
Review: https://reviewboard.asterisk.org/r/2053/
........
Merged revisions 370205 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........
Merged revisions 370206 from http://svn.asterisk.org/svn/asterisk/branches/10
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@370211 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This patch adds Named ACL functionality to Asterisk. This allows system
administrators to define an ACL and refer to it by a unique name. Configurable
items can then refer to that name when specifying access control lists.
It also includes updates to all core supported consumers of ACLs. That includes
manager, chan_sip, and chan_iax2. This feature is based on the deluxepine-trunk
by Olle E. Johansson and provides a subset of the Named ACL functionality
implemented in that branch. For more information on this feature, see acl.conf
and/or the Asterisk wiki.
Review: https://reviewboard.asterisk.org/r/1978/
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@369959 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Because some of the manager events are defined in the top of the source, due
to the macro calls not containing all necessary information to have the
documentation colocated with the call itself, several include statements were
failing when built with 'make'. While this did not cause any problems in
compilation or validation, it did result in a number of warnings being dumped
to stderr.
This patch changes those references such that they always resolve, regardless
of the documentation build options.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@369939 65c4cc65-6c06-0410-ace0-fbb531ad65f3
The awk script parses out the first instance of the DOCUMENTATION tag that it
finds within a file. If a file did not previously have a DOCUMENTATION tag
but received one due to it having an AMI event, then the XML fragment
associated with the AMI event was erroneously placed in the resulting XML
file. Without the python scripts, these XML fragments will not validate.
This patch adds DOCUMENTATION tags at the top of those files that did
not previously have them to prevent the awk script from pulling AMI event
documentation.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@369910 65c4cc65-6c06-0410-ace0-fbb531ad65f3
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
When the OpenSSL duplicate initialization issues were resolved in r351447,
res_curl could fail to load if it checked SSL_library_init after SSL
initialization completed. This is due to the SSL_library_init stub returning
a value of 0 for success, as opposed to a value of 1. OpenSSL uses a value of
1 to indicate success - in fact, SSL_library_init is documented to always return
1. Interestingly, the CURL libraries actually checked the return value - the fact
that nothing else that depends on OpenSSL was having problems loading probably means
they don't check the return value.
(closes issue AST-924)
Reported by: Guenther Kelleter
patches:
(AST-924.patch license #6372 uploaded by Guenther Kelleter)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@369870 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Failure to do this results in the Google Talk client ignoring RTP packets after a specific period of time. This is also done as a result of receiving a STUN binding request so that the username information can be used from the inbound request, thus not requiring it to be stored on a per candidate basis.
(closes issue ASTERISK-20107)
Reported by: Malcolm Davenport
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@369858 65c4cc65-6c06-0410-ace0-fbb531ad65f3
The problem here is that multiple server sessions share
a SSL_CTX. When one session ended, the SSL_CTX would be
freed and set NULL, leaving the other sessions unable to
function.
The code being removed is superfluous because the SSL_CTX
structures for servers will be properly freed when ast_ssl_teardown
is called.
(closes issue ASTERISK-20074)
Reported by Trevor Helmsley
Patches:
ASTERISK-20074.diff uploaded by Mark Michelson (license #5049)
Testers:
Trevor Helmsley
........
Merged revisions 369731 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........
Merged revisions 369732 from http://svn.asterisk.org/svn/asterisk/branches/10
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@369733 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Hangup handlers are an alternative to the h extension. They can be used
in addition to the h extension. The idea is to attach a Gosub routine to
a channel that will execute when the call hangs up. Whereas which h
extension gets executed depends on the location of dialplan execution when
the call hangs up, hangup handlers are attached to the call channel. You
can attach multiple handlers that will execute in the order of most
recently added first.
(closes issue ASTERISK-19549)
Reported by: Mark Murawski
Tested by: rmudgett
Review: https://reviewboard.asterisk.org/r/2002/
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@369493 65c4cc65-6c06-0410-ace0-fbb531ad65f3
The opaquing the ast_channel struct no longer requires .cleancount to be
changed when the struct is changed.
* Bump .cleancount value one last time because of struct ast_channel for
old times sake.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@369489 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Allows the setting of flags via the config options api.
For example, code like this:
#define OPT1 1 << 0
#define OPT2 1 << 1
#define OPT3 1 << 2
struct thing {
unsigned int flags;
};
and a config like this:
[blah]
opt1=yes
opt2=no
opt3=yes
Review: https://reviewboard.asterisk.org/r/2004/
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@369454 65c4cc65-6c06-0410-ace0-fbb531ad65f3
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
When res_adsi is unloaded, it removes the ADSI functions that it previously installed
by passing a NULL adsi_funcs pointer to ast_adsi_install_funcs. This function was not
checking whether or not the adsi_funcs pointer passed in was NULL before dereferencing
it to check whether or not the version of the functions matches what the core was
expecting it.
This patch makes it so that the version is only checked if a potentially valid adsi_funcs
pointer was passed in. Passing in NULL removes the installed functions, bypassing the
version check.
........
Merged revisions 369390 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........
Merged revisions 369391 from http://svn.asterisk.org/svn/asterisk/branches/10
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@369392 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Thank you rmudgett for pointing out that I was missing this in the initial
check-in for AMI event documentation (r369346)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@369386 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Certain places in core/cdr.c would, if the duration value were 0, calculate the
duration as being the delta between the current time and the time at which the
CDR record was started. While this does not typically cause a problem in
non-batch mode, this can cause an issue in batch mode where CDR records are
gathered and written long after those calls have ended. In particular, this
affects calls that were never answered, as those are expected to have a duration
of 0. Often, this would result in CDR logs with a significant number of calls
with lengthy durations, but dispositions of "BUSY".
Note that this does not affect cdr_csv, as that backend does not use
ast_cdr_getvar and instead directly reports the duration value. The affected
core backends include cdr_apative_odbc and cdr_custom; other extended or
deprecated CDR backends may potentially still directly manipulate the duration
values.
(issue ASTERISK-19860)
Reported by: Thomas Arimont
(issue AST-883)
Reported by: Thomas Arimont
Tested by: Matt Jordan
Review: https://reviewboard.asterisk.org/r/1996/
........
Merged revisions 369351 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........
Merged revisions 369369 from http://svn.asterisk.org/svn/asterisk/branches/10
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@369370 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This patch adds the core changes necessary to support AMI event documentation
in the source files of Asterisk, and adds documentation to those AMI events
defined in the core application modules. Event documentation is built from
the source by two new python scripts, located in build_tools:
get_documentation.py and post_process_documentation.py.
The get_documentation.py script mirrors the actions of the existing AWK
get_documentation scripts, except that it will scan the entirety of a source
file for Asterisk documentation. Upon encountering it, if the documentation
happens to be an AMI event, it will attempt to extract information about the
event directly from the manager event macro calls that raise the event. The
post_process_documentation.py script combines manager event instances that
are the same event but documented in multiple source files. It generates
the final core-[lang].xml file.
As this process can take longer to complete than a typical 'make all', it
is only performed if a new make target, 'full', is chosen.
Review: https://reviewboard.asterisk.org/r/1967/
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@369346 65c4cc65-6c06-0410-ace0-fbb531ad65f3
* Fix do_bridge_masquerade() getting the resume location from the zombie
channel. The code must not touch a clone channel after it has masqueraded
it. The clone channel has become a zombie and is starting to hangup.
(closes issue ASTERISK-19985)
Reported by: jamicque
Patches:
jira_asterisk_19985_v1.8.patch (license #5621) patch uploaded by rmudgett
Tested by: jamicque
........
Merged revisions 369327 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........
Merged revisions 369328 from http://svn.asterisk.org/svn/asterisk/branches/10
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@369329 65c4cc65-6c06-0410-ace0-fbb531ad65f3
* Fix AMI Bridge action disconnecting the AMI link on error.
* Fix AMI Bridge action and Bridge application not checking if their
masquerades were successful.
* Fix Bridge application running the h-exten when it should not.
* Made do_bridge_masquerade() return if the masquerade was successful so
the Bridge application and AMI Bridge action could deal with it correctly.
* Made bridge_call_thread_launch() hangup the passed in channels if the
bridge_call_thread fails to start. Those channels would have been
orphaned.
* Made builtin_atxfer() check the success of the transfer masquerade
setup.
........
Merged revisions 369282 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........
Merged revisions 369283 from http://svn.asterisk.org/svn/asterisk/branches/10
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@369295 65c4cc65-6c06-0410-ace0-fbb531ad65f3
While working with ast_parse_arg() to perform a validity check, a segfault
occurred. The segfault occurred due to passing a NULL pointer to
ast_sockaddr_parse() from ast_parse_arg(). According to the documentation in
config.h, "result pointer to the result. NULL is valid here, and can be used to
perform only the validity checks."
This patch fixes the segfault by checking for a NULL pointer. This patch also
adds documentation to netsock2.h about why it is necessary to check for a NULL
pointer.
(Closes issue ASTERISK-20006)
Reported by: Michael L. Young
Tested by: Michael L. Young
Patches:
asterisk-20006-netsock-null-ptr.diff uploaded by Michael L. Young (license 5026)
Review: https://reviewboard.asterisk.org/r/1990/
........
Merged revisions 369108 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........
Merged revisions 369109 from http://svn.asterisk.org/svn/asterisk/branches/10
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@369110 65c4cc65-6c06-0410-ace0-fbb531ad65f3
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
When the IAX2 Who Hung Up? changes were added, they uncovered a bug in
the way AST_CONTROL_PVT_CAUSE_CODE was handled in
feature_request_and_dial(). This particular frame subtype was being
treated like more terminal control frames causing the function to be
exited prematurely.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@369061 65c4cc65-6c06-0410-ace0-fbb531ad65f3
........
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
Continuing with the Who Hung Up? project for Asterisk 11, this adds
support to IAX2 for the HANGUPCAUSE hash.
Additionally, this breaks out some functionality in frame.c for getting
information about frame types and subclasses.
Review: https://reviewboard.asterisk.org/r/1941/
(issue SWP-4222)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@369007 65c4cc65-6c06-0410-ace0-fbb531ad65f3
* Make non-normal dialplan execution routines be able to run on a hung up
channel. This is preparation work for hangup handler routines.
* Fixed ability to support relative non-normal dialplan execution
routines. (i.e., The context and exten are optional for the specified
dialplan location.) Predial routines are the only non-normal routines that
it makes sense to optionally omit the context and exten. Setting a hangup
handler also needs this ability.
* Fix Return application being able to restore a dialplan location
exactly. Channels without a PBX may not have context or exten set.
* Fixes non-normal execution routines like connected line interception and
predial leaving the dialplan execution stack unbalanced. Errors like
missing Return statements, popping too many stack frames using StackPop,
or an application returning non-zero could leave the dialplan stack
unbalanced.
* Fixed the AGI gosub application so it cleans up the dialplan execution
stack and handles the autoloop priority increments correctly.
* Eliminated the need for the gosub_virtual_context return location.
Review: https://reviewboard.asterisk.org/r/1984/
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@368985 65c4cc65-6c06-0410-ace0-fbb531ad65f3
The Hangup application used to just return -1 to cause normal dialplan
execution to hangup a channel. For the non-normal execution routines like
predial and connected-line interception routines, the hangup request would
exit the routine early but otherwise be ignored.
* Made the Hangup application not allow setting a cause code of zero. A
zero cause code is not defined.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@368979 65c4cc65-6c06-0410-ace0-fbb531ad65f3