asterisk/asterisk.git
10 years agoFix incorrect duration reporting in CDRs created in batch mode
Matthew Jordan [Mon, 25 Jun 2012 19:39:03 +0000 (19:39 +0000)]
Fix incorrect duration reporting in CDRs created in batch mode

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

10 years agoRe-fix how local tag is generated when sending a 481 to an INVITE.
Mark Michelson [Mon, 25 Jun 2012 19:26:31 +0000 (19:26 +0000)]
Re-fix how local tag is generated when sending a 481 to an INVITE.

Match our local tag to whatever to-tag was sent in the initial INVITE.
Because the size of the to-tag may not fit in the buffer in the sip_pvt,
it has been changed to a string field.

(closes issue ASTERISK-19892)
reported by Walter Doekes

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

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

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

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@369367 65c4cc65-6c06-0410-ace0-fbb531ad65f3

10 years agoAdd AMI event documentation
Matthew Jordan [Mon, 25 Jun 2012 17:59:34 +0000 (17:59 +0000)]
Add AMI event documentation

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

10 years agoFix Bridge application occasionally returning to the wrong location.
Richard Mudgett [Mon, 25 Jun 2012 16:07:02 +0000 (16:07 +0000)]
Fix Bridge application occasionally returning to the wrong location.

* 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

10 years agoMultiple revisions 369323-369324
Mark Michelson [Mon, 25 Jun 2012 15:55:25 +0000 (15:55 +0000)]
Multiple revisions 369323-369324

........
  r369323 | mmichelson | 2012-06-25 10:35:43 -0500 (Mon, 25 Jun 2012) | 9 lines

  Eliminate embedding of res_adsi.so module.

  The way this is done is to stop using the optional API.
  Instead, res_adsi.so, when loaded fills in a table of
  function pointers.

  Review: https://reviewboard.asterisk.org/r/1991
........
  r369324 | mmichelson | 2012-06-25 10:50:17 -0500 (Mon, 25 Jun 2012) | 2 lines

  Forgot to svn add this file in my last commit.
........

Merged revisions 369323-369324 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........

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

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@369326 65c4cc65-6c06-0410-ace0-fbb531ad65f3

10 years agoBe more consistent with the return code for requests received from invalid domain.
Mark Michelson [Mon, 25 Jun 2012 14:30:19 +0000 (14:30 +0000)]
Be more consistent with the return code for requests received from invalid domain.

When Asterisk receives an INVITE from an external domain when allowexternaldomains=no
send a 403 instead of a 404. This is consistent with Asterisk's behavior when receiving
a REGISTER in this situation.

(Closes issue ASTERISK-19601)
Reported by Matthew Jordan
Patches:
ASTERISK-19601-no401.patch uploaded by Mark Michelson (License #5049)
........

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

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

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@369304 65c4cc65-6c06-0410-ace0-fbb531ad65f3

10 years agoFix F and F(x) action logic in Bridge application.
Richard Mudgett [Sat, 23 Jun 2012 00:33:41 +0000 (00:33 +0000)]
Fix F and F(x) action logic in Bridge application.

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@369296 65c4cc65-6c06-0410-ace0-fbb531ad65f3

10 years agoFix Bridge application and AMI Bridge action error handling.
Richard Mudgett [Sat, 23 Jun 2012 00:29:18 +0000 (00:29 +0000)]
Fix Bridge application and AMI Bridge action error handling.

* 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

10 years agoExplicitly check caller hangup in app Queue rather than a polluted res2 value.
Richard Mudgett [Fri, 22 Jun 2012 22:12:06 +0000 (22:12 +0000)]
Explicitly check caller hangup in app Queue rather than a polluted res2 value.
........

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

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

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@369264 65c4cc65-6c06-0410-ace0-fbb531ad65f3

10 years agoFix F and F(x) action logic in Queue application.
Richard Mudgett [Fri, 22 Jun 2012 21:51:05 +0000 (21:51 +0000)]
Fix F and F(x) action logic in Queue application.

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@369261 65c4cc65-6c06-0410-ace0-fbb531ad65f3

10 years agoCheck if PBX was started and fix F and F(x) action logic in Dial application.
Richard Mudgett [Fri, 22 Jun 2012 21:43:44 +0000 (21:43 +0000)]
Check if PBX was started and fix F and F(x) action logic in Dial application.
........

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

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

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@369260 65c4cc65-6c06-0410-ace0-fbb531ad65f3

10 years agoCheck if PBX was started for generic CCSS recall.
Richard Mudgett [Fri, 22 Jun 2012 21:06:36 +0000 (21:06 +0000)]
Check if PBX was started for generic CCSS recall.
........

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

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

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@369240 65c4cc65-6c06-0410-ace0-fbb531ad65f3

10 years agoChange incorrect chan_sip zombie hangup debug message. They are all zombies now.
Richard Mudgett [Fri, 22 Jun 2012 20:52:54 +0000 (20:52 +0000)]
Change incorrect chan_sip zombie hangup debug message.  They are all zombies now.
........

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

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

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@369237 65c4cc65-6c06-0410-ace0-fbb531ad65f3

10 years agoDon't crash on a guest directmedia call
Terry Wilson [Fri, 22 Jun 2012 20:05:22 +0000 (20:05 +0000)]
Don't crash on a guest directmedia call

A sip_pvt may not have relatedpeer set if a call doesn't match up
with a peer. If there is no relatedpeer, there is no direct media
ACL to apply, so just return that it is allowed.

(closes issue ASTERISK-20040)
Reported by: Terry Wilson
........

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

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

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@369217 65c4cc65-6c06-0410-ace0-fbb531ad65f3

10 years agoFix wrong variable name in the R2 disconnect callback
Kinsey Moore [Fri, 22 Jun 2012 19:54:41 +0000 (19:54 +0000)]
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

10 years agoDon't parse media stream state for SIP video streams
Kinsey Moore [Fri, 22 Jun 2012 17:25:06 +0000 (17:25 +0000)]
Don't parse media stream state for SIP video streams

The sendonly/recvonly/sendrecv/inactive media stream attributes were
parsed for video, but nothing was ever done with them.  With this code
removed, an UNSUPPORTED message is produced when these attributes are
used in conjunction with a video stream which is the better behavior
since they were never really supported in the first place.
........

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

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

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@369207 65c4cc65-6c06-0410-ace0-fbb531ad65f3

10 years agoAdd HANGUPCAUSE hash implementation for DAHDI MFC/R2 subtech
Kinsey Moore [Fri, 22 Jun 2012 15:57:02 +0000 (15:57 +0000)]
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

10 years agoAdd HANGUPCAUSE hash support for analog and PRI DAHDI subtechs
Kinsey Moore [Fri, 22 Jun 2012 15:10:38 +0000 (15:10 +0000)]
Add HANGUPCAUSE hash support for analog and PRI DAHDI subtechs

This is part of the DAHDI support for the Asterisk 11 "Who Hung Up?"
project and covers the implementation for the technologies implemented
in sig_analog.c and sig_pri.c. Tested on a local machine to verify
protocol and cause information is available.

Review: https://reviewboard.asterisk.org/r/1953/
(issue SWP-4222)

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@369185 65c4cc65-6c06-0410-ace0-fbb531ad65f3

10 years agoAdd "Who Hung Up?" implementation for DAHDI SS7 subtechnology
Kinsey Moore [Fri, 22 Jun 2012 14:57:07 +0000 (14:57 +0000)]
Add "Who Hung Up?" implementation for DAHDI SS7 subtechnology

Testing was done on a local machine to verify that protocol and
cause information was being sent properly.

Review: https://reviewboard.asterisk.org/r/1955/
(issue SWP-4222)

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@369184 65c4cc65-6c06-0410-ace0-fbb531ad65f3

10 years agoDon't waste time initializing the whole call_identifer_str[].
Richard Mudgett [Wed, 20 Jun 2012 21:33:11 +0000 (21:33 +0000)]
Don't waste time initializing the whole call_identifer_str[].

The array is either setup with a callid string or only the first element
needs to be initialized.

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@369167 65c4cc65-6c06-0410-ace0-fbb531ad65f3

10 years agoFix chan_misdn compile error.
Richard Mudgett [Wed, 20 Jun 2012 21:32:40 +0000 (21:32 +0000)]
Fix chan_misdn compile error.

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@369166 65c4cc65-6c06-0410-ace0-fbb531ad65f3

10 years agofix locking issue on empty callList
Alexandr Anikin [Wed, 20 Jun 2012 17:48:20 +0000 (17:48 +0000)]
fix locking issue on empty callList
(issue ASTERISK-19298)
Reported by:
        Dmitry Melekhov
Patches:
        ASTERISK-18322-2.patch
........

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

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

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@369148 65c4cc65-6c06-0410-ace0-fbb531ad65f3

10 years agoRemove declaration of eivr_connect_socket because it no longer exists.
Sean Bright [Wed, 20 Jun 2012 11:47:12 +0000 (11:47 +0000)]
Remove declaration of eivr_connect_socket because it no longer exists.

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@369142 65c4cc65-6c06-0410-ace0-fbb531ad65f3

10 years agouse right definition for channel name
Alexandr Anikin [Wed, 20 Jun 2012 11:20:05 +0000 (11:20 +0000)]
use right definition for channel name

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@369141 65c4cc65-6c06-0410-ace0-fbb531ad65f3

10 years agoAdd IPv6 Support To Manager
Michael L. Young [Wed, 20 Jun 2012 03:18:50 +0000 (03:18 +0000)]
Add IPv6 Support To Manager

This patch adds IPv6 support to AMI.

(Closes issue ASTERISK-19965)
Reported by: Michael L. Young
Tested by: Michael L. Young
Patches:
    ami_ipv6_v3.diff uploaded by Michael L. Young (license 5026)

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

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@369126 65c4cc65-6c06-0410-ace0-fbb531ad65f3

10 years agoFix NULL pointer segfault in ast_sockaddr_parse()
Michael L. Young [Wed, 20 Jun 2012 02:07:00 +0000 (02:07 +0000)]
Fix NULL pointer segfault in ast_sockaddr_parse()

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

10 years agocheck rtptimeouts in ooh323 channels as per config file
Alexandr Anikin [Tue, 19 Jun 2012 23:36:43 +0000 (23:36 +0000)]
check rtptimeouts in ooh323 channels as per config file
(rtp voice, video, udptl except rtcp)

(closes issue ASTERISK-19179)
Reported by: TSAREGORODTSEV Yury
Patches:
        19179-ooh323-ast10.patch
........

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

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@369092 65c4cc65-6c06-0410-ace0-fbb531ad65f3

10 years agoEnsure that pvt cause information does not break native bridging
Kinsey Moore [Tue, 19 Jun 2012 21:13:41 +0000 (21:13 +0000)]
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

10 years agoFix request routing issue when outboundproxy is used.
Mark Michelson [Tue, 19 Jun 2012 15:44:42 +0000 (15:44 +0000)]
Fix request routing issue when outboundproxy is used.

Asterisk was incorrectly setting the destination of CANCELs
and ACKs for error responses to the URI of the initial INVITE.
This resulted in further requests, such as INVITEs with authentication
credentials, to be routed incorrectly. Instead, when these CANCEL
or ACKs are to be sent, we should simply keep the destination the
same as what it previously was. There is no need to alter it any.

(closes issue ASTERISK-20008)
Reported by Marcus Hunger
Patches:
ASTERISK-20008.patch uploaded by Mark Michelson (license #5049)
........

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

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

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@369068 65c4cc65-6c06-0410-ace0-fbb531ad65f3

10 years agoFix AST_CONTROL_PVT_CAUSE_CODE handling
Kinsey Moore [Mon, 18 Jun 2012 22:56:01 +0000 (22:56 +0000)]
Fix AST_CONTROL_PVT_CAUSE_CODE handling

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

10 years agoFix monitoring calls put in a parking lot.
Richard Mudgett [Mon, 18 Jun 2012 18:25:22 +0000 (18:25 +0000)]
Fix monitoring calls put in a parking lot.

* Fix a regression that was introduced by -r366167 which effectively
disabled monitoring parked calls.

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

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

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

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@369057 65c4cc65-6c06-0410-ace0-fbb531ad65f3

10 years agoVarious small chan_skinny fixes and cleanup
Damien Wedhorn [Fri, 15 Jun 2012 21:18:56 +0000 (21:18 +0000)]
Various small chan_skinny fixes and cleanup

Added test to skinny_register to only allow device to register against
a device that is not already registered.

Addback l->device test for skinny_show_lines. Fixes segfault if a line
is configured but not configured to a device. Reverses part of r368680.

Removed redundant l->device tests in subsubstate and dumpsub. l->device
will always be valid if these routines are called. Reverses 368948 -
discussed with mjordan on irc.

Some indentation cleanup.

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@369034 65c4cc65-6c06-0410-ace0-fbb531ad65f3

10 years agoAllow chan_sip to decline unwanted media streams
Kinsey Moore [Fri, 15 Jun 2012 17:13:20 +0000 (17:13 +0000)]
Allow chan_sip to decline unwanted media streams

This change replaces the static array of four representable media
streams with an AST_LIST so that chan_sip can keep track of offered
media streams.  This allows chan_sip to deal with offers containing
multiple same-type streams and many other situations without rejecting
the SDP offer in its entirety, yet still generating a valid response.
This also covers cases where Asterisk can not comprehend the offer if
it is in the correct format.

Previously, chan_sip would reject SDP offers or entirely ignore
individual stream offers in an effort to be more compatible which
would often result in invalid SDP responses.

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

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@369028 65c4cc65-6c06-0410-ace0-fbb531ad65f3

10 years agoFix voicemail API tests by using the correct argument order for create/destroy.
Jason Parker [Fri, 15 Jun 2012 16:30:58 +0000 (16:30 +0000)]
Fix voicemail API tests by using the correct argument order for create/destroy.
........

Merged revisions 369024 from http://svn.asterisk.org/svn/asterisk/certified/branches/1.8.11
........

Merged revisions 369026 from http://svn.asterisk.org/svn/asterisk/branches/10-digiumphones

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@369027 65c4cc65-6c06-0410-ace0-fbb531ad65f3

10 years agoMultiple revisions 369001-369002
Kevin P. Fleming [Fri, 15 Jun 2012 16:20:16 +0000 (16:20 +0000)]
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

10 years agoAdd HANGUPCAUSE hash support to IAX2
Kinsey Moore [Fri, 15 Jun 2012 16:17:12 +0000 (16:17 +0000)]
Add HANGUPCAUSE hash support to IAX2

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

10 years agoRemove some symbol exports that got missed in the removal of global symbols.
Jason Parker [Fri, 15 Jun 2012 15:33:41 +0000 (15:33 +0000)]
Remove some symbol exports that got missed in the removal of global symbols.

(issue AST-807)
(issue AST-901)
(issue AST-908)
........

Merged revisions 368998 from http://svn.asterisk.org/svn/asterisk/certified/branches/1.8.11
........

Merged revisions 368999 from http://svn.asterisk.org/svn/asterisk/branches/10-digiumphones

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@369000 65c4cc65-6c06-0410-ace0-fbb531ad65f3

10 years agoRemove remaining properties mmichelson left laying around from phones branch merge.
Richard Mudgett [Fri, 15 Jun 2012 00:55:43 +0000 (00:55 +0000)]
Remove remaining properties mmichelson left laying around from phones branch merge.

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@368991 65c4cc65-6c06-0410-ace0-fbb531ad65f3

10 years agoAllow non-normal execution routines to be able to run on hungup channels.
Richard Mudgett [Thu, 14 Jun 2012 23:22:53 +0000 (23:22 +0000)]
Allow non-normal execution routines to be able to run on hungup channels.

* 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

10 years agoMake the Hangup application set a softhangup flag.
Richard Mudgett [Thu, 14 Jun 2012 22:57:21 +0000 (22:57 +0000)]
Make the Hangup application set a softhangup flag.

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

10 years agoMove vm defines to group them better.
Richard Mudgett [Thu, 14 Jun 2012 20:49:28 +0000 (20:49 +0000)]
Move vm defines to group them better.

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@368972 65c4cc65-6c06-0410-ace0-fbb531ad65f3

10 years agoMultiple revisions 368963,368965
Jason Parker [Thu, 14 Jun 2012 19:40:11 +0000 (19:40 +0000)]
Multiple revisions 368963,368965

........
  r368963 | qwell | 2012-06-14 13:47:03 -0500 (Thu, 14 Jun 2012) | 14 lines

  Remove global symbol requirement from app_voicemail.

  This uses the existing "function installation" stuff that already existed for
  other functions, like getting message counts.

  (closes issue AST-807)
  (issue AST-901)
  (issue AST-908)

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

  Merged revisions 368962 from http://svn.asterisk.org/svn/asterisk/certified/branches/1.8.11
........
  r368965 | qwell | 2012-06-14 14:04:57 -0500 (Thu, 14 Jun 2012) | 11 lines

  These functions that were moved need to be static.

  Also wrap test functions in a #ifdef.

  (issue AST-807)
  (issue AST-901)
  (issue AST-908)
  ........

  Merged revisions 368964 from http://svn.asterisk.org/svn/asterisk/certified/branches/1.8.11
........

Merged revisions 368963,368965 from http://svn.asterisk.org/svn/asterisk/branches/10-digiumphones

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@368966 65c4cc65-6c06-0410-ace0-fbb531ad65f3

10 years agoAST-2012-009: Fix crash in chan_skinny due to Key Pad Button Message handling
Matthew Jordan [Thu, 14 Jun 2012 17:34:10 +0000 (17:34 +0000)]
AST-2012-009: Fix crash in chan_skinny due to Key Pad Button Message handling

AST-2012-008 (r367844) fixed a denial of service attack exploitable in the
Skinny channel driver that occurred when certain messages are sent after a
previously registered station sends an Off Hook message.  Unresolved in that
patch is an issue in the Asterisk 10 releases, wherein, if a Station Key
Pad Button Message is processed after an Off Hook message, the channel driver
will inappropriately dereference a NULL pointer.

This patch fixes those places where the message handling or the channel
callback functions would attempt to dereference the line's pointer to the
device.

(issue ASTERISK-19905)
Reported by: Christoph Hebeisen
Tested by: mjordan, Christoph Hebeisen
Patches:
  AST-2012-009-10.diff uploaded by mjordan (license 6283)
........

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

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@368948 65c4cc65-6c06-0410-ace0-fbb531ad65f3

10 years agoRevert Makefile change to remove embedding res_adsi.so
Mark Michelson [Thu, 14 Jun 2012 15:28:02 +0000 (15:28 +0000)]
Revert Makefile change to remove embedding res_adsi.so

The change has resulted in a linking error for certain versions
of GCC. This is much worse than the original issue, so for now,
temporarily revert the change. A more thorough change will be
sought out.
........

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

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

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@368929 65c4cc65-6c06-0410-ace0-fbb531ad65f3

10 years agoAdd a post_apply callback to the Config Options API
Terry Wilson [Thu, 14 Jun 2012 13:41:47 +0000 (13:41 +0000)]
Add a post_apply callback to the Config Options API

This adds a callback that only fires when changes have been successfully
applied via the Config Options API.

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

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@368921 65c4cc65-6c06-0410-ace0-fbb531ad65f3

10 years agoAdd filename alias support to the Config Options API
Terry Wilson [Thu, 14 Jun 2012 13:35:07 +0000 (13:35 +0000)]
Add filename alias support to the Config Options API

This adds the ability to handle a single filename alias for a config
file. This is useful if a config filename has changed, but the old
filename should be supported for backwards compatibility.

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

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@368920 65c4cc65-6c06-0410-ace0-fbb531ad65f3

10 years agoFix a deadlock that occurs when func_volume is used on a local channel.
Mark Michelson [Wed, 13 Jun 2012 21:17:13 +0000 (21:17 +0000)]
Fix a deadlock that occurs when func_volume is used on a local channel.

This was discovered by trying to perform a call forward to an extension
that makes use of func_volume. When the local channel is optimized away,
the datastore on the local;2 channel would have its audiohook destroyed
rather than detaching the audiohook from the channel and then destroying
it.

With this patch, func_volume's datastore destructor takes the proper
route of detaching the audiohook and then destroying it.

(closes issue ASTERISK-19611)
reported by Volker Sauer
Patches:
ASTERISK-19611.patch uploaded by Mark Michelson (license #5049)
........

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

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

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@368900 65c4cc65-6c06-0410-ace0-fbb531ad65f3

10 years agoMark res_smdi/res_adsi as 'core' supported modules
Matthew Jordan [Wed, 13 Jun 2012 20:28:07 +0000 (20:28 +0000)]
Mark res_smdi/res_adsi as 'core' supported modules

Recently, various issues surrounding weak symbols have caused problems with
modules that rely on that feature to be enabled in menuselect.  This includes
app_voicemail and chan_dahdi, as they both rely upon res_smdi and res_adsi,
which, in certain circumstances, may not be enabled by default in menuselect.

Because res_smdi/res_adsi are dependencies for chan_dahdi/app_voicemail, this
patch marks both as 'core' supported modules.  This will allow both
app_voicemail and chan_dahdi to be enabled as well, regardless of whether or
not that system supports weak symbols.

(issue AST-900)
Reported by: Thomas Arimont

(issue AST-885)
Reported by: Denis Alberto Martinez
........

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

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

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@368896 65c4cc65-6c06-0410-ace0-fbb531ad65f3

10 years agoRemove forced linking of res_adsi.o
Mark Michelson [Wed, 13 Jun 2012 19:51:08 +0000 (19:51 +0000)]
Remove forced linking of res_adsi.o

In GCC 4.5+ the result is that Asterisk has a phantom
module loaded at startup, claiming to be res_adsi.

(closes issue ASTERISK-19920)
reported by Leif Madsen
........

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

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

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@368886 65c4cc65-6c06-0410-ace0-fbb531ad65f3

10 years agoReplace MODULES_DIR with ASTMODDIR in Makefile's INSTALLDIRS
Matthew Jordan [Wed, 13 Jun 2012 14:55:30 +0000 (14:55 +0000)]
Replace MODULES_DIR with ASTMODDIR in Makefile's INSTALLDIRS

Post Asterisk 10, the MODULES_DIR variable no longer exists, and was replaced
with ASTMODDIR.

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@368855 65c4cc65-6c06-0410-ace0-fbb531ad65f3

10 years agoDo not install empty directories; add ASTLIBDIR
Matthew Jordan [Wed, 13 Jun 2012 14:31:24 +0000 (14:31 +0000)]
Do not install empty directories; add ASTLIBDIR

r368830 modified the installation script to only create a directory if that
directory does not exist.  If some directory variable was empty, it would attempt
to create the empty location.  It also failed to create the ASTLIBDIR directory.
This patch fixes it such that the correct directories are made and only created if
a value specifying them actually exists.
........

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

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

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@368854 65c4cc65-6c06-0410-ace0-fbb531ad65f3

10 years agoDo not perform install on existing directories
Matthew Jordan [Tue, 12 Jun 2012 18:41:50 +0000 (18:41 +0000)]
Do not perform install on existing directories

If a directory already exists, performing a 'make install' will remove the
permissions associated with the current directory and replace them with the
permissions of the user executing the install.

This patch changes this behavior to only perform an install on the directory
if the directory does not exist.  Thus, if a user later changes the permissions
on that directory, those permissions will be preserved in subsequent installs.

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

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

(closes issue ASTERISK-19492)
Reported by: Karl Fife
Tested by: Paul Belanger, Tilghman Lesher
patches:
  ASTERISK-19492 by pabelanger
  (uploaded by mjordan)
........

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

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

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@368832 65c4cc65-6c06-0410-ace0-fbb531ad65f3

10 years agoSet the Caller ID "tag" on peers even if remote party information is present.
Mark Michelson [Tue, 12 Jun 2012 15:46:48 +0000 (15:46 +0000)]
Set the Caller ID "tag" on peers even if remote party information is present.

On incoming calls, we were setting the cid_tag on the dialog only if there was
no remote party information (Remote-Party-ID or P-Asserted-Identity) present.
The Caller ID tag is an invented parameter, though, and should be set no matter
the circumstance.

(closes issue ASTERISK-19859)
Reported by Thomas Arimont
(closes issue AST-884)
Reported by Trey Blancher
........

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

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

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@368809 65c4cc65-6c06-0410-ace0-fbb531ad65f3

10 years agoUpdate merge property information
Matthew Jordan [Tue, 12 Jun 2012 14:09:41 +0000 (14:09 +0000)]
Update merge property information

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@368794 65c4cc65-6c06-0410-ace0-fbb531ad65f3

10 years agoFix deadlock in SIP transfers that involve a REFER request
Matthew Jordan [Tue, 12 Jun 2012 14:07:13 +0000 (14:07 +0000)]
Fix deadlock in SIP transfers that involve a REFER request

In r367163, "send to voicemail" functionality was added to the SIP channel
driver.  This required updating the party redirecting information for the
channel based on the headers provided in the REFER request.  When the
redirecting party information is updated on the channel, a call to
ast_indicate_data occurs.  Because handle_request_refer still had the sip_pvt
locked, a deadlock could occur between the pbx_thread and the do_monitor thread
servicing the REFER request.

This patch preserves the proper locking order between the channel and the
sip_pvt by ensuring that the sip_pvt is unlocked prior to updating the party
redirecting information on the channel.

(closes issue AST-903)
Reported by: Matt Jordan
patches:
  jira_ast_903_trunk.patch by rmudgett (license 5621)

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@368793 65c4cc65-6c06-0410-ace0-fbb531ad65f3

10 years agoParse ANI2 information from SIP From header parameters
Kinsey Moore [Tue, 12 Jun 2012 04:03:23 +0000 (04:03 +0000)]
Parse ANI2 information from SIP From header parameters

ANI2 information is now parsed out of SIP From headers when present in
the oli, isup-oli, and ss7-oli parameters and is available via the
CALLERID(ani2) dialplan function.

(closes issue ASTERISK-19912)
Patch-by: Rob Gagnon
Review: https://reviewboard.asterisk.org/r/1947/

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@368784 65c4cc65-6c06-0410-ace0-fbb531ad65f3

10 years agoFix deadlock potential with ast_set_hangupsource() calls.
Richard Mudgett [Mon, 11 Jun 2012 17:34:08 +0000 (17:34 +0000)]
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

10 years agoFix coverity UNUSED_VALUE findings in core support level files
Kinsey Moore [Mon, 11 Jun 2012 15:23:30 +0000 (15:23 +0000)]
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

10 years agoRecorded merge of revisions 368721 from http://svn.asterisk.org/svn/asterisk/branches/10
Kinsey Moore [Mon, 11 Jun 2012 14:12:08 +0000 (14:12 +0000)]
Recorded merge of revisions 368721 from svn.asterisk.org/svn/asterisk/branches/10

........
Fix compilation in dev-mode

Backport a compilation fix in md5.c from trunk that only showed up in
dev-mode under certain compiler versions.
........

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

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@368722 65c4cc65-6c06-0410-ace0-fbb531ad65f3

10 years agoFix error paths in action_hangup() for AMI Hangup action.
Richard Mudgett [Fri, 8 Jun 2012 21:08:17 +0000 (21:08 +0000)]
Fix error paths in action_hangup() for AMI Hangup action.

* Check allocation function return values for failure.  Crashing is bad.

* Tweak ast_regex_string_to_regex_pattern() parameters for proper ast_str
usage.

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@368714 65c4cc65-6c06-0410-ace0-fbb531ad65f3

10 years agoTweak ast_channel_softhangup_withcause_locked() to take a typed parameter.
Richard Mudgett [Fri, 8 Jun 2012 20:49:00 +0000 (20:49 +0000)]
Tweak ast_channel_softhangup_withcause_locked() to take a typed parameter.

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@368712 65c4cc65-6c06-0410-ace0-fbb531ad65f3

10 years agoFix MWI update so LED display correct voicemail state after phone usage. Also fixes...
Igor Goncharovskiy [Fri, 8 Jun 2012 08:32:49 +0000 (08:32 +0000)]
Fix MWI update so LED display correct voicemail state after phone usage. Also fixes few warnings.
(closes issue #19675)
 Reported by: dbohling
 Patches:
       fixmwi.patch uploaded by dbohling (license 6378)

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@368688 65c4cc65-6c06-0410-ace0-fbb531ad65f3

10 years agoSkinny cleanup (mwi_event_cb).
Damien Wedhorn [Thu, 7 Jun 2012 21:44:15 +0000 (21:44 +0000)]
Skinny cleanup (mwi_event_cb).

Original was testing for d->session, setting and testing again (all nested).

Removed duplicate testing and restructured function to test/return and then
the main code.

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@368681 65c4cc65-6c06-0410-ace0-fbb531ad65f3

10 years agoSkinny cleanup.
Damien Wedhorn [Thu, 7 Jun 2012 21:23:42 +0000 (21:23 +0000)]
Skinny cleanup.

Removed d->registered which was mirroring d->session. Changed relevant
references to use d->session instead.

Moved setting and unsetting of l->device from session register to device
configuration. As such, l->device will always be valid unless it is has not
been configured to a device. Revised various test where checking if a device
is registered to use l->device->session.

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@368680 65c4cc65-6c06-0410-ace0-fbb531ad65f3

10 years agoFix app_queue debug message use of args.options after the string has been parsed.
Richard Mudgett [Thu, 7 Jun 2012 20:39:25 +0000 (20:39 +0000)]
Fix app_queue debug message use of args.options after the string has been parsed.

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@368675 65c4cc65-6c06-0410-ace0-fbb531ad65f3

10 years agoFix inverted test in app_queue for ringinuse.
Richard Mudgett [Thu, 7 Jun 2012 20:37:05 +0000 (20:37 +0000)]
Fix inverted test in app_queue for ringinuse.

Regression from -r367080 ringinuse commit.

(issue ASTERISK-19536)

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@368674 65c4cc65-6c06-0410-ace0-fbb531ad65f3

10 years agoFix reloading an unchanged file with the Config Options API
Terry Wilson [Thu, 7 Jun 2012 20:32:07 +0000 (20:32 +0000)]
Fix reloading an unchanged file with the Config Options API

Adding multiple file support broke reloading an unchanged file. This
adds an enum for return values for the aco_process_* functions and
ensures that the config is not applied if res is not ACO_PROCESS_OK.

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

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@368673 65c4cc65-6c06-0410-ace0-fbb531ad65f3

10 years agoFix a typo in format_ogg_vorbis.c: suport
Tzafrir Cohen [Thu, 7 Jun 2012 20:00:29 +0000 (20:00 +0000)]
Fix a typo in format_ogg_vorbis.c: suport

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

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@368668 65c4cc65-6c06-0410-ace0-fbb531ad65f3

10 years agoAdd default handler documentation and standardize acl handler
Terry Wilson [Thu, 7 Jun 2012 15:43:37 +0000 (15:43 +0000)]
Add default handler documentation and standardize acl handler

Added documentation describing what flags and arguments to pass to
aco_option_register for default option types. Also changed the ACL
handler to use the flags parameter to differentiate between "permit"
and "deny" instead of adding an additional vararg parameter.

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

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@368663 65c4cc65-6c06-0410-ace0-fbb531ad65f3

10 years agoFix POTS flash hook to orignate a second call deadlock.
Richard Mudgett [Wed, 6 Jun 2012 21:34:10 +0000 (21:34 +0000)]
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

10 years agoFix a specific scenario where ACKs are not matched.
Mark Michelson [Wed, 6 Jun 2012 19:25:44 +0000 (19:25 +0000)]
Fix a specific scenario where ACKs are not matched.

If a dialog-starting INVITE contains a to-tag, then Asterisk
will respond with a 481. In this case, the resulting incoming
ACK would not be matched, so Asterisk would continue retransmitting
the 481 until the transaction times out.

There were two issues. Asterisk, upon creating a sip_pvt would generate
a local tag. However, when the time came to transmit the 481, since there
was a to-tag in the INVITE, Asterisk would place this original to-tag
in the 481 response. When the ACK came in, Asterisk would attempt to
match the to-tag in the ACK to the generated local tag. Unfortunately,
Asterisk never actually transmitted a response with the generated local
tag, so the to-tag in the ACK would not match.

The other problem was that when the 481 was sent, nothing was set
on the sip_pvt to indicate what CSeq is expected in the ACK.

To fix the first problem, we zero out the to-tag seen in the incoming
INVITE. This way, Asterisk, when time to send a response, will send
its generated local tag instead.

To fix the second problem, we set the sip_pvt's pendinginvite to the
CSeq of the INVITE when we send a 481.

(closes issue ASTERISK-19892)
Reported by Mark Michelson
........

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

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

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@368637 65c4cc65-6c06-0410-ace0-fbb531ad65f3

10 years agoAdd feature modifier to versions produced from branches
Matthew Jordan [Wed, 6 Jun 2012 17:22:11 +0000 (17:22 +0000)]
Add feature modifier to versions produced from branches

Certain branches, such as Certified Asterisk, may have a modifier added to
them that specifies the features available in that branch.  For branches, this
modifier is expected to be reflected in the location of the branch in
subversion. For example, a subversion of URL of /certified/branches/1.8.11
would have a feature modifier of 'certified'.  This is slightly different then
how features are determined for tags, where the feature is part of the actual
tag name, e.g., "10.5.0-digiumphones".

In keeping with the nomenclature used for tags, the feature specifier for
branches is translated and placed after the revision numbers.  For the example
given previously, this would result in a branch version of
"Asterisk SVN-branch-1.8.11-cert-rXXXXXX".
........

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

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

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@368606 65c4cc65-6c06-0410-ace0-fbb531ad65f3

10 years agoEnsure overlapping hold flags do not conflict
Kinsey Moore [Wed, 6 Jun 2012 16:11:01 +0000 (16:11 +0000)]
Ensure overlapping hold flags do not conflict

When changing between different modes of hold, the flags were not being
cleared out properly causing a failure to change hold states.

(closes issue ASTERISK-19919)
Patch-by: Morten Tryfoss
Reported-by: Morten Tryfoss
........

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

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

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@368588 65c4cc65-6c06-0410-ace0-fbb531ad65f3

10 years agoFix parked call performing a DTMF blind transfer after being retrieved.
Richard Mudgett [Wed, 6 Jun 2012 01:11:12 +0000 (01:11 +0000)]
Fix parked call performing a DTMF blind transfer after being retrieved.

When a parked call was retrieved from the parking lot, it could not do a
blind transfer because it caused the involved calls to be hung up
unconditionally.

* Made the ParkedCall application return the ast_bridge_call() return
value.

(closes issue ABE-2862)
Reported by: Vlad Povorozniuc
........

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

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

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@368569 65c4cc65-6c06-0410-ace0-fbb531ad65f3

10 years agoMake builtin_blindtransfer() fully use ast_async_goto() abilities.
Richard Mudgett [Wed, 6 Jun 2012 00:54:20 +0000 (00:54 +0000)]
Make builtin_blindtransfer() fully use ast_async_goto() abilities.

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@368566 65c4cc65-6c06-0410-ace0-fbb531ad65f3

10 years agoMerge 'core' and 'core changes' sections in CHANGES file.
Jonathan Rose [Tue, 5 Jun 2012 16:25:14 +0000 (16:25 +0000)]
Merge 'core' and 'core changes' sections in CHANGES file.

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@368550 65c4cc65-6c06-0410-ace0-fbb531ad65f3

10 years agoRecorded merge of revisions 368536 from http://svn.asterisk.org/svn/asterisk/branches/10
Kinsey Moore [Tue, 5 Jun 2012 15:28:28 +0000 (15:28 +0000)]
Recorded merge of revisions 368536 from svn.asterisk.org/svn/asterisk/branches/10

........
Resolve some build warnings

My newly upgraded compiler caught these usages of uninitialized values.
They weren't actually used.
........

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

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@368537 65c4cc65-6c06-0410-ace0-fbb531ad65f3

10 years agoEnsure that pages and emails are sent using RFC822-compliant date format
Kinsey Moore [Tue, 5 Jun 2012 15:23:43 +0000 (15:23 +0000)]
Ensure that pages and emails are sent using RFC822-compliant date format

When localization was added to app_voicemail, these headers were altered
when they should have remained in en_US format for RFC compliance. This
reverts the changes to those two lines.

(closes issue ASTERISK-19876)
........

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

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

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@368529 65c4cc65-6c06-0410-ace0-fbb531ad65f3

10 years agoConvert AST_FLAG_ANSWERED_ELSEWHERE usage to AST_CAUSE_ANSWERED_ELSEWHERE
Kinsey Moore [Tue, 5 Jun 2012 14:41:43 +0000 (14:41 +0000)]
Convert AST_FLAG_ANSWERED_ELSEWHERE usage to AST_CAUSE_ANSWERED_ELSEWHERE

This was essentially duplicated functionality where normal channels used
AST_CAUSE_ANSWERED_ELSEWHERE while local channels and queues used
AST_FLAG_ANSWERED_ELSEWHERE.  This removes the flag and converts that usage
into AST_CAUSE_ANSWERED_ELSEWHER usage.

Review: https://reviewboard.asterisk.org/r/1944
(closes issue ASTERISK-19865)
Patch-by: Birger Harzenetter

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@368519 65c4cc65-6c06-0410-ace0-fbb531ad65f3

10 years agoRelay proper SIP responses on calling side.
Mark Michelson [Mon, 4 Jun 2012 22:12:19 +0000 (22:12 +0000)]
Relay proper SIP responses on calling side.

Revision 351130 broke corect HANGUPCAUSE setting
for the 404 case in chan_sip. Other cases were also
potentially broken. This patch fixes the relaying
of causes to be what they used to be.

(closes issue ASTERISK-19914)
Reported by Pavel Troller
Tested by Walter Doekes (via a reviewboard test to be committed later)
Patches:
chan_sip.diff uploaded by Pavel Troller (license #6302)
........

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

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

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@368500 65c4cc65-6c06-0410-ace0-fbb531ad65f3

10 years agoDocument BLINDTRANSFER behavior change.
Richard Mudgett [Mon, 4 Jun 2012 21:18:04 +0000 (21:18 +0000)]
Document BLINDTRANSFER behavior change.

(issue ASTERISK-19322)

(closes issue ASTERISK-19875)
Reported by: call
........

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

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

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@368472 65c4cc65-6c06-0410-ace0-fbb531ad65f3

10 years agoAlso have vim syntax-highlight type=network.
Mark Michelson [Mon, 4 Jun 2012 20:53:43 +0000 (20:53 +0000)]
Also have vim syntax-highlight type=network.

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@368467 65c4cc65-6c06-0410-ace0-fbb531ad65f3

10 years agoAdd vim syntax highlighting for type=line, type=phone, and type=application.
Mark Michelson [Mon, 4 Jun 2012 20:51:17 +0000 (20:51 +0000)]
Add vim syntax highlighting for type=line, type=phone, and type=application.

(closes issue ASTERISK-19800)
Reported by: Billy Chia
Patches:
asterisk.vim.patch uploaded by Billy Chia (license #6381)

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@368466 65c4cc65-6c06-0410-ace0-fbb531ad65f3

10 years agoRemove some extra debugging I forgot to remove in the merge of Digium phone support.
Mark Michelson [Mon, 4 Jun 2012 20:40:12 +0000 (20:40 +0000)]
Remove some extra debugging I forgot to remove in the merge of Digium phone support.

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@368455 65c4cc65-6c06-0410-ace0-fbb531ad65f3

10 years agoRemove automerge properties.
Mark Michelson [Mon, 4 Jun 2012 20:30:07 +0000 (20:30 +0000)]
Remove automerge properties.

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@368441 65c4cc65-6c06-0410-ace0-fbb531ad65f3

10 years agoMerge changes dealing with support for Digium phones.
Mark Michelson [Mon, 4 Jun 2012 20:26:12 +0000 (20:26 +0000)]
Merge changes dealing with support for Digium phones.

Presence support has been added. This is accomplished by
allowing for presence hints in addition to device state
hints. A dialplan function called PRESENCE_STATE has been
added to allow for setting and reading presence. Presence
can be transmitted to Digium phones using custom XML
elements in a PIDF presence document.

Voicemail has new APIs that allow for moving, removing,
forwarding, and playing messages. Messages have had a new
unique message ID added to them so that the APIs will work
reliably. The state of a voicemail mailbox can be obtained
using an API that allows one to get a snapshot of the mailbox.
A voicemail Dialplan App called VoiceMailPlayMsg has been
added to be able to play back a specific message.

Configuration hooks have been added. Configuration hooks
allow for a piece of code to be executed when a specific
configuration file is loaded by a specific module. This is
useful for modules that are dependent on the configuration
of other modules.

chan_sip now has a public method that allows for a custom
SIP INFO request to be sent mid-dialog. Digium phones use
this in order to display progress bars when files are played.

Messaging support has been expanded a bit. The main
visible difference is the addition of an AMI action
MessageSend.

Finally, a ParkingLots manager action has been added in order
to get a list of parking lots.

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@368435 65c4cc65-6c06-0410-ace0-fbb531ad65f3

10 years agoFix potential deadlock between masquerade and chan_local.
Richard Mudgett [Mon, 4 Jun 2012 19:46:33 +0000 (19:46 +0000)]
Fix potential deadlock between masquerade and chan_local.

* Restructure ast_do_masquerade() to not hold channel locks while it calls
ast_indicate().

* Simplify many calls to ast_do_masquerade() since it will never return a
failure now.  If it does fail internally because a channel driver callback
operation failed, the only thing ast_do_masquerade() can do is generate a
warning message about strange things may happen and press on.

* Fixed the call to ast_bridged_channel() in ast_do_masquerade().  This
change fixes half of the deadlock reported in ASTERISK-19801 between
masquerades and chan_iax.

(closes issue ASTERISK-19537)
Reported by: rmudgett
Tested by: rmudgett

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

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

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

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@368421 65c4cc65-6c06-0410-ace0-fbb531ad65f3

10 years agoAdd res_http_websocket module which implements the WebSocket protocol according to...
Joshua Colp [Sat, 2 Jun 2012 21:13:36 +0000 (21:13 +0000)]
Add res_http_websocket module which implements the WebSocket protocol according to RFC 6455.

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

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@368359 65c4cc65-6c06-0410-ace0-fbb531ad65f3

10 years agoFix deadlock when Gosub used with alternate dialplan switches.
Richard Mudgett [Fri, 1 Jun 2012 23:53:59 +0000 (23:53 +0000)]
Fix deadlock when Gosub used with alternate dialplan switches.

Attempting to remove a channel from autoservice with the channel lock held
will result in deadlock.

* Restructured gosub_exec() to not call ast_parseable_goto() and
ast_exists_extension() with the channel lock held.

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

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

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

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@368311 65c4cc65-6c06-0410-ace0-fbb531ad65f3

10 years agoImprove SDP offer/answer RFC compliance
Kevin P. Fleming [Fri, 1 Jun 2012 20:42:10 +0000 (20:42 +0000)]
Improve SDP offer/answer RFC compliance

Asterisk should not accept SDP offers that contain unknown RTP profiles (for
audio/video streams) or unknown top-level media types. When it does, it answers
with an SDP that does not match the offer properly, and this will nearly
always result in a broken call. This patch causes such offers to be rejected.

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

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@368269 65c4cc65-6c06-0410-ace0-fbb531ad65f3

10 years agoImprove SDP parsing warning messages
Kevin P. Fleming [Fri, 1 Jun 2012 20:31:15 +0000 (20:31 +0000)]
Improve SDP parsing warning messages

* 'Unsupported media type' is only reported when that is in fact the case,
   not when a supported media type is included in an 'm' line that has an
   invalid format.

* All warning messages related to parsing 'm' lines now include the 'm' line contents.

* (minor bugfix) newline added to port-number-zero warning messages.

* Warning messages improved to use RFC-specified terminology for various items.

* Warnings for offers that include more than one port for a single media type now
  include the media type.

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

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

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

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@368268 65c4cc65-6c06-0410-ace0-fbb531ad65f3

10 years agoAdd missing config for config API test
Terry Wilson [Fri, 1 Jun 2012 18:20:44 +0000 (18:20 +0000)]
Add missing config for config API test

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@368221 65c4cc65-6c06-0410-ace0-fbb531ad65f3

10 years agoAdd new config-parsing framework
Terry Wilson [Fri, 1 Jun 2012 16:33:25 +0000 (16:33 +0000)]
Add new config-parsing framework

This framework adds a way to register the various options in a config
file with Asterisk and to handle loading and reloading of that config
in a consistent and atomic manner.

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

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@368181 65c4cc65-6c06-0410-ace0-fbb531ad65f3

10 years agoHelp mitigate potential reinvite glare scenarios.
Mark Michelson [Fri, 1 Jun 2012 13:04:32 +0000 (13:04 +0000)]
Help mitigate potential reinvite glare scenarios.

When Asterisk servers are set up back-to-back, and
direct media is to be used betweeen endpoints, it is
fairly common for the two Asterisk servers to send
direct media reinvites to each other simultaneously.
This results in 491s and ACKs being exchanged between
the servers. While the media eventually gets set up
properly, the problem is that there can be a noticeable
delay for the streams to stabilize.

This patch adds a new directmedia option called "outgoing".
With this set, an immediate direct media reinvite will only
be sent if the call direction is outgoing. For incoming
dialogs, an immediate direct media reinvite will not be sent,
but further "reactionary" direct media reinvites may be sent.

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

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@368143 65c4cc65-6c06-0410-ace0-fbb531ad65f3

10 years agoAdd documentation to function CHANNEL for options echocan_mode and buffers
Michael L. Young [Fri, 1 Jun 2012 03:30:01 +0000 (03:30 +0000)]
Add documentation to function CHANNEL for options echocan_mode and buffers

The ability to set "echocan_mode" and "buffers" through the dialplan was added
to chan_dahdi some time ago.  This patch adds some documentation to
func_channel.

(Closes issue ASTERISK-19911)
Reported by: Dale Noll
Tested by: Michael L. Young
Patches:
  asterisk-19911-branch18.diff uploaded by Michael L. Young (license 5026)

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

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

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

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@368094 65c4cc65-6c06-0410-ace0-fbb531ad65f3

10 years agoCoverity Report: Fix issues for error type REVERSE_INULL (core modules)
Richard Mudgett [Thu, 31 May 2012 18:39:30 +0000 (18:39 +0000)]
Coverity Report: Fix issues for error type REVERSE_INULL (core modules)

* Fixes findings: 0-2,5,7-15,24-26,28-31

(issue ASTERISK-19648)
Reported by: Matt Jordan
........

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

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

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@368052 65c4cc65-6c06-0410-ace0-fbb531ad65f3

10 years agoUse the DEADLOCK_AVOIDANCE() macro instead.
Richard Mudgett [Wed, 30 May 2012 18:08:12 +0000 (18:08 +0000)]
Use the DEADLOCK_AVOIDANCE() macro instead.

(issue ASTERISK-19854)
........

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

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

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@367982 65c4cc65-6c06-0410-ace0-fbb531ad65f3

10 years agoFix deadlock when executing CLI "pri show channels" and "ss7 show channels" commands.
Richard Mudgett [Wed, 30 May 2012 17:50:38 +0000 (17:50 +0000)]
Fix deadlock when executing CLI "pri show channels" and  "ss7 show channels" commands.

* Fix sig_pri_lock_owner() to avoid deadlock properly.

* Code pri_grab() better.

* Fix sig_ss7_lock_owner() to avoid deadlock properly.

* Code ss7_grab() better.

(closes issue ASTERISK-19854)
Reported by: Jaxon
Patches:
      jira_asterisk_19854_v1.8.6.patch (license #5621) patch uploaded by rmudgett (Modified to do the same thing to sig_ss7)
Tested by: Jaxon
........

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

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

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@367979 65c4cc65-6c06-0410-ace0-fbb531ad65f3

10 years agoCoverity Report: Fix issues for error type REVERSE_INULL (deprecated modules)
Richard Mudgett [Tue, 29 May 2012 22:37:19 +0000 (22:37 +0000)]
Coverity Report: Fix issues for error type REVERSE_INULL (deprecated modules)

* Fix only issue pointed out by deprecated_REVERSE_INULL.txt for
app_meetme.c in find_user().

* Change use of %i to %d in sscanf() in find_user().  The use of %i gives
unexpected parsing because it can accept hex, octal, and decimal integer
formats.

* Changed other uses of %i in app_meetme() to use %d for consistency.

(issue ASTERISK-19648)
Reported by: Matt Jordan
........

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

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

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@367908 65c4cc65-6c06-0410-ace0-fbb531ad65f3

10 years agoAST-2012-008: Fix remote crash vulnerability in chan_skinny
Matthew Jordan [Tue, 29 May 2012 18:40:26 +0000 (18:40 +0000)]
AST-2012-008: Fix remote crash vulnerability in chan_skinny

When a skinny session is unregistered, the corresponding device pointer is set
to NULL in the channel private data.  If the client was not in the on-hook state
at the time the connection was closed, the device pointer can later be
dereferened if a message or channel event attempts to use a line's pointer to
said device.

The patches prevent this from occurring by checking the line's pointer in
message handlers and channel callbacks that can fire after an unregistration
attempt.

(closes issue ASTERISK-19905)
Reported by: Christoph Hebeisen
Tested by: mjordan, Damien Wedhorn
Patches:
  AST-2012-008-1.8.diff uploaded by mjordan (license 6283)
  AST-2012-008-10.diff uploaded by mjordan (licesen 6283)
........

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

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@367845 65c4cc65-6c06-0410-ace0-fbb531ad65f3