Commit Graph

2516 Commits

Author SHA1 Message Date
Terry Wilson 1609fca6bb Add the ability to set flags via the config options api
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
2012-06-28 01:12:06 +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
Matthew Jordan 82a7409c15 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
2012-06-25 17:59:34 +00:00
Mark Michelson 453e01725d 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
2012-06-25 15:55:25 +00:00
Michael L. Young c843dddf80 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
2012-06-20 02:07:00 +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
Kinsey Moore bdab2763ac 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
2012-06-15 16:17:12 +00:00
Richard Mudgett f8746d0009 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
2012-06-14 23:22:53 +00:00
Richard Mudgett c5256059b8 Move vm defines to group them better.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@368972 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-06-14 20:49:28 +00:00
Jason Parker 6334142050 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
2012-06-14 19:40:11 +00:00
Terry Wilson cfa0826c49 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
2012-06-14 13:41:47 +00:00
Terry Wilson 01307e4b7b 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
2012-06-14 13:35:07 +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
Richard Mudgett 745484e1b3 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
2012-06-08 21:08:17 +00:00
Richard Mudgett 8b2412db28 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
2012-06-08 20:49:00 +00:00
Terry Wilson 9f704b5d59 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
2012-06-07 20:32:07 +00:00
Terry Wilson aeeff8cfa2 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
2012-06-07 15:43:37 +00:00
Kinsey Moore 571445ab9c 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
2012-06-05 14:41:43 +00:00
Mark Michelson 14a985560e 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
2012-06-04 20:26:12 +00:00
Joshua Colp 380c7c5c39 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
2012-06-02 21:13:36 +00:00
Terry Wilson d54717c39e 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
2012-06-01 16:33:25 +00:00
Jonathan Rose bdaecbb66b chan_sip: fix problem directmediapermit/deny uses the wrong address
When remotely bridging calls with directmedia, Asterisk would check
the address of the peers/users holding directmedia ACLs (set via
directmediapermit/directmediadeny) instead of the bridged peer. This
is similar to r366547, but trunk specific and involves changes to
the rtpengine instead of just chan_sip.

(closes issue AST-876)
review: https://reviewboard.asterisk.org/r/1924/


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@367640 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-05-24 18:56:43 +00:00
Terry Wilson c7f2d02ef1 Fix race condition for CEL LINKEDID_END event
This patch fixes to situations that could cause the CEL LINKEDID_END event to
be missed.

1) During a core stop gracefully, modules are unloaded when ast_active_channels
== 0. The LINKDEDID_END event fires during the channel destructor. This means
that occasionally, the cel_* module will be unloaded before the channel is
destroyed. It seemed generally useful to wait until the refcount of all
channels == 0 before unloading, so I added a channel counter and used it in the
shutdown code.

2) During a masquerade, ast_channel_change_linkedid is called. It calls
ast_cel_check_retire_linkedid which unrefs the linkedid in the linkedids
container in cel.c. It didn't ref the new linkedid. Now it does. 

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

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@367309 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-05-22 17:29:12 +00:00
Mark Michelson 8b1193087e Revert revision 367163.
This should have been committed to my team trunk-digiumphones branch
instead of trunk.



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@367183 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-05-21 20:31:53 +00:00
Mark Michelson e5f1f0496a Add "send to voicemail" Digium phone functionality to Asterisk.
This change accommodates two methods by which calls can be directed to
a user's voicemail.

* Incoming calls can be redirected to any user's voicemail.
* Established calls can be blind transferred to any user's voicemail.

Digium phones indicate the desire to direct a call to voicemail by using
a Diversion header with a reason parameter of "send_to_vm". 

This patch adds the "send_to_vm" reason as a valid redirecting reason. In
addition, chan_sip.c has been modified to update redirecting information
on the transferred channel by reading a Diversion header on a REFER request.

(closes issue AST-871)
Reported by Malcolm Davenport

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



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@367163 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-05-21 19:22:25 +00:00
Terry Wilson 45149bfdf8 Minor documentation change
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@367124 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-05-21 17:39:37 +00:00
Mark Michelson 5c576aa3c2 Fix memory leak of SSL_CTX structures in TLS core.
SSL_CTX structures were allocated but never freed. This was a bigger
issue for clients than servers since new SSL_CTX structures could be
allocated for each connection. Servers, on the other hand, typically
set up a single SSL_CTX for their lifetime.

This is solved in two ways:

1. In __ssl_setup(), if a tcptls_cfg has an ssl_ctx on it, it is
freed so that a new one can take its place.
2. A companion to ast_ssl_setup() called ast_ssl_teardown() has
been added so that servers can properly free their SSL_CTXs.

(issue ASTERISK-19278)
........

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@367010 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-05-18 17:24:57 +00:00
Jonathan Rose cd37bec058 logger: Adds additional support for call id logging and chan_sip specific stuff
This patch improves the handling of call id logging significantly with regard
to transfers and adding APIs to better handle specific aspects of logging.
Also, changes have been made to chan_sip in order to better handle the creation
of callids and to enable the monitor thread to bind itself to a particular
call id when a dialog is determined to be related to a callid. It then unbinds
itself before returning to normal monitoring.

review: https://reviewboard.asterisk.org/r/1886/


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@366842 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-05-17 16:28:20 +00:00
Richard Mudgett 2d175b7e8f Remove missed idx parameter to some ao2 global holder macros.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@366700 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-05-16 18:00:18 +00:00
Richard Mudgett d4fa095a64 Change ao2 global array to ao2 global object holder.
Review: https://reviewboard.asterisk.org/r/1921/


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

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@366408 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-05-14 19:44:27 +00:00
Richard Mudgett 4ea636c776 Run predial routine on local;2 channel where you would expect.
Before this patch, the predial routine executes on the ;1 channel of a
local channel pair.  Executing predial on the ;1 channel of a local
channel pair is of limited utility.  Any channel variables set by the
predial routine executing on the ;1 channel will not be available when the
local channel executes dialplan on the ;2 channel.

* Create ast_pre_call() and an associated pre_call() technology callback
to handle running the predial routine.  If a channel technology does not
provide the callback, the predial routine is simply run on the channel.

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@366183 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-05-10 21:29:41 +00:00
Russell Bryant eebdf35159 res_corosync: Fix build against corosync 2.0.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@364444 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-04-28 01:20:57 +00:00
Matthew Jordan 50c959580c Prevent overflow in calculation in ast_tvdiff_ms on 32-bit machines
The method ast_tvdiff_ms attempts to calculate the difference, in milliseconds,
between two timeval structs, and return the difference in a 64-bit integer.
Unfortunately, it assumes that the long tv_sec/tv_usec members in the timeval
struct are large enough to hold the calculated values before it returns.  On
64-bit machines, this might be the case, as a long may be 64-bits.  On 32-bit
machines, however, a long may be less (32-bits), in which case, the calculation
can overflow.

This overflow caused significant problems in MixMonitor, which uses the method
to determine if an audio factory, which has not presented audio to an audiohook,
is merely late in providing said audio or will never provide audio.  In an
overflow situation, the audiohook would incorrectly determine that an audio
factory that will never provide audio is merely late instead.  This led to
situations where a MixMonitor never recorded any audio.  Note that this happened
most frequently when that MixMonitor was started by the ConfBridge application
itself, or when the MixMonitor was attached to a Local channel.

(issue ASTERISK-19497)
Reported by: Ben Klang
Tested by: Ben Klang
Patches:
  32-bit-time-overflow-10-2012-04-26.diff (license #6283) by mjordan

(closes issue ASTERISK-19727)
Reported by: Mark Murawski
Tested by: Michael L. Young
Patches:
  32-bit-time-overflow-2012-04-27.diff (license #6283) by mjordan)

(closes issue ASTERISK-19471)
Reported by: feyfre
Tested by: feyfre

(issue ASTERISK-19426)
Reported by: Johan Wilfer

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

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@364287 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-04-27 19:30:59 +00:00
Olle Johansson 7aa0c3c64b Make it possible to change the minimum DTMF duration in asterisk.conf
Asterisk has a setting for the minimum allowed DTMF. If we get shorter
DTMF tones, these will be changed to the minimum on the outbound call
leg. 

(closes issue ASTERISK-19772)

Review: https://reviewboard.asterisk.org/r/1882/
Reported by: oej
Tested by: oej
Patches by: oej

Thanks to the reviewers.

1.8 branch for this patch: agave-dtmf-duration-asterisk-conf-1.8



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@363558 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-04-25 09:32:21 +00:00
Richard Mudgett 3a874139d4 Fix connected-line/redirecting interception gosubs executing more than intended.
* Redo ast_app_run_sub()/ast_app_exec_sub() to use a known return point so
execution will stop after the routine returns there.
(s@gosub_virtual_context:1)

* Create ast_app_exec_macro() and ast_app_exec_sub() to run the macro and
gosub application respectively with the parameter string already created.


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@362962 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-04-20 23:29:56 +00:00
Richard Mudgett 73f48997f9 Add original party id and reason support.
ISDN ETSI PTP and Q.SIG (And SS7 in future) have support for reporting who
was the original redirecting party of a call.

* Added support for the original redirecting party and reason to the
REDIRECTING function and the system core as well as to the stubbed
locations in sig_pri.c.

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@362779 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-04-20 00:57:13 +00:00
Michael L. Young abf40d9b28 Add IPv6 address support to security events framework.
The current Security Events Framework API only supports IPv4 when it comes to
generating security events.  This patch does the following:

* Changes the Security Events Framework API to support IPV6 and updates
  the components that use this API.

* Eliminates an error message that was being generated since the current
  implementation was treating an IPv6 socket address as if it was IPv4.

* Some copyright dates were updated on files touched by this patch.

(closes issue ASTERISK-19447) 
Reported by: Michael L. Young 
Tested by: Michael L. Young 
Patches: 
  security_events_ipv6v3.diff uploaded by Michael L. Young (license 5026)

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@362200 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-04-16 21:20:50 +00:00
Richard Mudgett a35c7ba8e7 Add option to invoke the extensions.conf stdexten using the legacy macro method.
ASTERISK-18809 eliminated the legacy macro invocation of the stdexten in
favor of the Gosub method without a means of backwards compatibility.

(issue ASTERISK-18809)
(closes issue ASTERISK-19457)
Reported by: Matt Jordan
Tested by: rmudgett

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@361998 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-04-12 16:29:52 +00:00
Mark Murawki 745fcdbffe Fix dev-mode compiler warning about gnu_printf
(related to ASTERISK-19575)


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@361039 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-04-03 20:03:44 +00:00
Mark Murawki e4252eac10 Allow the Hangup manager action to match channels by regex
* Hangup now can take a regular expression as the Channel option.  If you want
  to hangup multiple channels, use /regex/ as the Channel option.  Existing
  behavior to hanging up a single channel is unchanged, but if you pass a regex,
  the manager will send you a list of channels back that were hung up.

(closes issue ASTERISK-19575)
Reported by: Mark Murawski
Tested by: Mark Murawski



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@361038 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-04-03 19:31:25 +00:00
Richard Mudgett fb796aac06 Misc changes to make astobj2 enhancement diffs easier to follow.
* Rename astobj2 API parameter funcname to func.

* Rename astobj2 API iterator parameter to iter.

* Update some documentation for OBJ_MULTIPLE.


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@360827 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-03-29 21:57:23 +00:00
Jonathan Rose 655a8d4420 Introducing the log message unique call identifiers feature
Log messages will now display a call number that they are tied to (ordered for calls
based on when they started). This feature is made to be minimally invasive without
requiring changes to many of the existing log messages. These IDs  won't show up for
verbose messages on CLI (but they will in log files) This is currently in phase II
of production, see more about this feature on the wiki --
https://wiki.asterisk.org/wiki/display/AST/Unique+Call-ID+Logging

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@360787 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-03-29 20:01:20 +00:00
Jonathan Rose d501c2ea2d undoing 360785 due to merging mistake
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@360786 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-03-29 19:59:30 +00:00
Jonathan Rose bf994f0e04 Introducing the log message unique call identifiers feature
Log messages will now display a call number that they are tied to (ordered for calls
based on when they started). This feature is made to be minimally invasive without
requiring changes to many of the existing log messages. These IDs  won't show up for
verbose messages on CLI (but they will in log files) This is currently in phase II
of production, see more about this feature on the wiki --
https://wiki.asterisk.org/wiki/display/AST/Unique+Call-ID+Logging

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@360785 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-03-29 19:54:35 +00:00
Richard Mudgett 38e892b370 Add global ao2 array container.
Global ao2 objects must always exist after initialization because there is
no access control to obtain another reference to the global object.

It is expected that module configuration could use these new API calls to
replace an active configuration parameter object with an updated
configuration parameter object.

With these new API calls, the global object could be replaced, removed, or
referenced without the risk of someone using a stale global object
pointer.

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@360627 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-03-27 17:13:32 +00:00
Jonathan Rose c6979ff581 Adds F option to Bridge application
Similar to dial and queue F option.

(Closes issue ASTERISK-19282)
Reported by: To
Patches:
	bridge_f-v3.diff uploaded by To (license 6347)
Review: https://reviewboard.asterisk.org/r/1825/


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@360227 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-03-22 21:25:22 +00:00
Sean Bright 3a231e090f chan_iax2: Correct spelling of 'Port' header in IAX2 PeerStatus AMI Events
The PeerStatus event for IAX2 channels currently includes a header named Post
which should have been Port.  Post was removed and the AMI version has been
updated to 1.3.
........

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@359983 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-03-20 18:17:16 +00:00
Richard Mudgett 334f13d8b8 Allow AMI action callback to be reentrant.
Fix AMI module reload deadlock regression from ASTERISK-18479 when it
tried to fix the race between calling an AMI action callback and
unregistering that action.  Refixes ASTERISK-13784 broken by
ASTERISK-17785 change.

Locking the ao2 object guaranteed that there were no active callbacks that
mattered when ast_manager_unregister() was called.  Unfortunately, this
causes the deadlock situation.  The patch stops locking the ao2 object to
allow multiple threads to invoke the callback re-entrantly.  There is no
way to guarantee a module unload will not crash because of an active
callback.  The code attempts to minimize the chance with the registered
flag and the maximum 5 second delay before ast_manager_unregister()
returns.

The trunk version of the patch changes the API to fix the race condition
correctly to prevent the module code from unloading from memory while an
action callback is active.

* Don't hold the lock while calling the AMI action callback.

(closes issue ASTERISK-19487)
Reported by: Philippe Lindheimer

Review: https://reviewboard.asterisk.org/r/1818/
Review: https://reviewboard.asterisk.org/r/1820/
........

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@359981 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-03-20 17:31:28 +00:00
Richard Mudgett dd4a3b1825 Simplify some code in ast_app_run_sub().
* Remove unnnecessary const from const char * const var declaration in the
ast_app_run_macro() and ast_app_run_sub() prototypes.  The second const is
unnecessary.


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@359904 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-03-16 20:37:54 +00:00
Mark Michelson 827f2eae92 Revert the pre-dial addition.
The code may be just fine, but it had not received a "ship it!" on
review board yet.



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@359857 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-03-16 15:38:45 +00:00
Mark Murawki c65b41f57a Add options PreDial options 'b' and 'B' to app_dial
* Added 'b' and 'B' options to Dial.  These options will allow you to run
  last-minute dialplan on the caller and callee channels while the Dial
  application is executing, but before the call is started.  For example you
  can use the 'b' option to run dialplan on the callee channel to get the name
  of the newly created channel right away.

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

(closes issue: ASTERISK-19548)
Reported by: Mark Murawski
Tested by: Mark Murawski, Stefan Schmidt



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@359705 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-03-15 18:58:25 +00:00
Russell Bryant 28881524dc app.h: Always initialize AST_DECLARE_APP_ARGS().
This patch ensures that the struct defined by AST_DECLARE_APP_ARGS() is always
fully initialized.  I'm not sure if this fixes any real bugs, but it silences
a bunch of warnings from coverity, and is generally a good thing to do anyway.
........

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@359456 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-03-14 22:41:21 +00:00
Richard Mudgett 9b31bd3cd8 Fix deadlock potential with some ast_indicate/ast_indicate_data calls.
Calling ast_indicate()/ast_indicate_data() with the channel lock held can
result in a deadlock with a local channel because of how local channels
need to avoid deadlock.
........

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@359455 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-03-14 22:38:29 +00:00
Richard Mudgett a22b6f6e4b Three copies of the file contents in channel_internal.h are a bit excessive.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@359360 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-03-14 18:12:08 +00:00
Matthew Jordan 6df0ae5c1f Force non-inlining of ao2_iterator_destroy when TEST_FRAMEWORK is enabled
In r357272, astobj2 was changed to automatically enable REF_DEBUG when the
TEST_FRAMEWORK flag was enabled.  Unfortunately, some compilers (gcc 4.5.1
at least) will attempt to inline ao2_iterator_destroy in handle_astobj2_test.
This by itself is not a problem; unfortunately, the compiler believes that
there is a code path wherein an object allocated on the stack will be
free'd.  As warnings are treated as errors, this prevents compilation of
astobj2.

This patch works around that by adding the noinline attribue to
ao2_iterator_destroy, but only if the TEST_FRAMEWORK flag is enabled.
Preventing inlining is only needed for the test method defined in astobj2,
which is also only enabled if TEST_FRAMEWORK is enabled.

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@359306 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-03-14 14:40:44 +00:00
Russell Bryant 00b270833f Fix bogus reads/writes of console log levels in asterisk.c
This patch updates the NUMLOGLEVELS define in logger.h to 32, to match the fact
that logger.c implements 32 log levels (because of the custom log level stuff).
asterisk.c uses this define to size an array of levels per remote console.

This array is modified in ast_console_toggle_loglevel(), which is called by the
"logger set level" CLI command.  While the documentation for the CLI command
doesn't make it terribly obvious, you can use this CLI command to toggle a
custom log level on a remote console, as well.  However, doing so led to an
invalid array index in asterisk.c.

This array is read from any time a log message is written to a console.  So, 
all custom log level messages resulted in a bogus read if a remote console
was connected.
........

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@359261 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-03-14 10:56:53 +00:00
Russell Bryant 4585000039 Remove chan_usbradio and app_rpt.
These modules are being maintained outside of the tree and have been for a long
time now, so it doesn't make sense to keep them here.

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

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@359052 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-03-13 23:42:24 +00:00
Terry Wilson 128c9109b0 Add missing channel_internal.h
...again.


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@359011 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-03-13 21:24:13 +00:00
Terry Wilson 699d2bd705 Make hints for invalid SIP devices return Unavail, not idle
This patch drastically simplifies the device state aggegation code.
The old method was not only overly complex, but also made it impossible
to return AST_DEVICE_INVALID from the aggregation code. The unit test
update is as a result of fixing that bug.

The SIP change stems from a bug introduced by removing a DNS lookup
for hostname-based SIP channels.

(closes issue ASTERISK-16702)
Review: https://reviewboard.asterisk.org/r/1808/
........

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@358945 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-03-13 20:06:57 +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
Joshua Colp f5fda0eb74 Transition app_page to using app_confbridge internally for the conference bridge portion of paging. This also adds a new 'announcement' option to ConfBridge user profiles.
Review: https://reviewboard.asterisk.org/r/1754/


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@358730 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-03-10 20:06:46 +00:00
Sean Bright a8116350bc Add some underscores in a few of our llist macros to reduce name collisions.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@358646 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-03-08 17:00:22 +00:00
Richard Mudgett 38f6e5d1ad Make usage of DECLARE_STRINGFIELD_SETTERS_FOR() not look so odd.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@358263 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-03-05 21:55:28 +00:00
Kinsey Moore 8d1bde49a9 Fix case-sensitivity for device-specific event subscriptions and CCSS
This change fixes case-sensitivity for device-specific subscriptions such that
the technology identifier is case-insensitive while the remainder of the device
string is still case-sensitive.  This should also preserve the original case of
the device string as passed in to the event system.  CCSS is the only feature
affected as it is the only consumer of device-specific event subscriptions.

The second part of this patch addresses similar case-sensitivity issues within
CCSS itself that prevented it from functioning correctly after the fix to the
events system.

This adds a unit test to verify that the event system works as expected.

(closes issue ASTERISK-19422)
Review: https://reviewboard.asterisk.org/r/1780/
........

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@357942 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-03-02 21:06:12 +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
Walter Doekes 41f5a1ab35 Update stringfield documentation for removed second va_list in favor of va_copy.
In r320946, the second va_list that was passed to ast_string_field_build_va
and friends, was removed. This patch updates the documentation to reflect that.
........

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@357621 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-02-29 20:41:38 +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
Sean Bright 35e2a046fd Documentation update. There is no AST_SOCKADDR_UNSPEC.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@357355 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-02-28 19:55:32 +00:00
Richard Mudgett 85ea4277f1 Convert struct ast_tcptls_session_instance to finally use the ao2 object lock.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@357317 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-02-28 18:46:34 +00:00
Richard Mudgett 2e834f7d36 Astobj2 locking enhancement.
Add the ability to specify what kind of locking an ao2 object has when it
is allocated.  The locking could be one of: MUTEX, RWLOCK, or none.

New API:

ao2_t_alloc_options()
ao2_alloc_options()
ao2_t_container_alloc_options()
ao2_container_alloc_options()

ao2_rdlock()
ao2_wrlock()
ao2_tryrdlock()
ao2_trywrlock()

The OBJ_NOLOCK and AO2_ITERATOR_DONTLOCK flags have a slight meaning
change.  They no longer mean that the object is protected by an external
mechanism.  They mean the lock associated with the object has already been
manually obtained by one of the ao2_lock calls.  This change is necessary
for RWLOCK support since they are not reentrant.  Also an operation on an
ao2 container may require promoting a read lock to a write lock by
releasing the already held read lock to re-acquire as a write lock.


Replaced API calls:

ao2_t_link_nolock()
ao2_link_nolock()
ao2_t_unlink_nolock()
ao2_unlink_nolock()

with the respective

ao2_t_link_flags()
ao2_link_flags()
ao2_t_unlink_flags()
ao2_unlink_flags()

API calls to be more flexible and to allow an anticipated enhancement to
control linking duplicate objects into a container.


The changes to format.c and format_cap.c are taking advantange of the new
ao2 locking options to simplify the use of the format capabilities
containers.

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@357272 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-02-28 18:15:34 +00:00
Richard Mudgett 50c8557f03 Add ability to clone ao2 containers.
Occasionally there is a need to put all objects in one container also into
another container.

Some reasons you might need to do this:

1) You need to reconfigure a container.  You would do this by creating a
new container with the new configuration and ao2_container_dup the old
container into it.  Then replace the old container with the new.  Then
destroy the old container.

2) You need the contents of a container to remain stable while operating
on all of the objects.  You would do this by creating a cloned container
of the original with ao2_container_clone.  The cloned container is a
snapshot of the objects at the time of the cloning.  When done, just
destroy the cloned container.

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@357145 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-02-28 00:42:38 +00:00
Jonathan Rose e37631d071 Converts locking for odbc containers from ast_mutex_lock to ao2_locks.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@357051 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-02-27 19:55:14 +00:00
Kinsey Moore 1fac2fba4b Deprecated macro usage for connected line, redirecting, and CCSS
This commit adds GoSub alternatives to connected line, redirecting, and CCSS
macro hooks so that macro can finally be deprecated.  This also adds
deprecation warnings for those features when used and in documentation.

Review: https://reviewboard.asterisk.org/r/1760/
(closes issue SWP-4256)


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@357013 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-02-27 16:50:19 +00:00
Sean Bright 3cf09f40f7 Convert netsock.h over to use ast_sockaddrs rather than sockaddr_in and update
chan_iax2 to pass in the correct types.

chan_iax2 is the only consumer for the various ast_netsock_* functions in trunk
at this point, so this feels like a safe change to make.


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@357005 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-02-27 16:31:24 +00:00
Sean Bright 6214285950 Make ast_netsock_set_qos() delegate to ast_set_qos().
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@356916 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-02-27 14:57:23 +00:00
Sean Bright 0cf8b2b136 Correct typo in deprecation comment.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@356883 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-02-27 14:15:24 +00:00
Sean Bright 51c24c88a1 Prefer ast_set_qos() over ast_netsock_set_qos()
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@356882 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-02-27 14:13:58 +00:00
Richard Mudgett 0553e61207 astobj2.h comment tweaks.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@356765 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-02-24 23:40:23 +00:00
Richard Mudgett e43d123f11 astobj2.h documentation updates.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@356734 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-02-24 20:47:12 +00:00
Richard Mudgett ebe2c33b72 Fix worker thread resource leak in SIP TCP/TLS.
The SIP TCP/TLS worker threads were created joinable but noone could join
them if they died on their own.

* Fix the SIP TCP/TLS worker threads to not be created joinable.

* _sip_tcp_helper_thread() only needs one parameter since the pvt
parameter is only passed in as NULL and never used.

(closes issue ASTERISK-19203)
Reported by: Steve Davies

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

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@356697 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-02-24 18:33:04 +00:00
Matthew Jordan 670797e5da Allow SRTP policies to be reloaded
Currently, when using res_srtp, once the SRTP policy has been added to the
current session the policy is locked into place.  Any attempt to replace an
existing policy, which would be needed if the remote endpoint negotiated a new
cryptographic key, is instead rejected in res_srtp.  This happens in particular
in transfer scenarios, where the endpoint that Asterisk is communicating with
changes but uses the same RTP session.

This patch modifies res_srtp to allow remote and local policies to be reloaded
in the underlying SRTP library.  From the perspective of users of the SRTP API,
the only change is that the adding of remote and local policies are now added
in a single method call, whereas they previously were added separately.  This
was changed to account for the differences in handling remote and local
policies in libsrtp.

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

(closes issue ASTERISK-19253)
Reported by: Thomas Arimont
Tested by: Thomas Arimont
Patches:
  srtp_renew_keys_2012_02_22.diff uploaded by Matt Jordan (license 6283)
  (with some small modifications for this check-in)
........

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@356606 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-02-24 15:10:35 +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 0cc38858dd Track module use count for res_calendar
If the res_calendar module was followed immediately by one of the
calendar tech modules and "core stop gracefully" was run, Asterisk
would crash.

This patch adds use count tracking for res_calendar so that it is
unloaded after the tech modules when shutting down gracefully. It
is now not possible to unload all the of the calendar modules via
"module unload res_calednar.so", but it is still possible to unload
them all via "module unload -h res_calendar.so".

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

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@356314 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-02-22 21:22:43 +00:00
Terry Wilson 3a9ac7c10c Rename ast_channel_emulate_dtmf_digit* funcs
The accessors names for the "emulate_dtmf_digit" field on the ast_channel
are misleading. Change them to ast_channel_dtmf_digit_to_emulate*.


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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@356042 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-02-20 23:43:27 +00:00
Richard Mudgett 7093cf278c Fix compile problem when old version of libvorbisfile v1.1.2 is used.
The principle difference between libvorbisfile v1.1.2 and newer (at least
v1.2.0) is the addition of the predefined callbacks OV_CALLBACKS_xxx in
vorbis/vorbisfile.h used for ov_open_callbacks().

* Updated the configure script to detect if libvorbisfile.h declares
OV_CALLBACKS_NOCLOSE.

* Copied the declaration of OV_CALLBACKS_NOCLOSE from v1.2.0 to allow
v1.1.2 to compile.

(closes issue ASTERISK-19370)
Reported by: Jonn Taylor
........

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@355621 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-02-16 19:51:15 +00:00
Tilghman Lesher a78b0af5ea Re-commit the verbose branch.
This change permits each verbose destination (consoles, logger) to have its
own concept of what the verbosity level is.  The big feature here is that
the logger will now be able to capture a particular verbosity level without
condemning each console to need to suffer that level of verbosity.
Additionally, a stray 'core set verbose' will no longer change what will go
to the log.

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@355413 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-02-14 20:27:16 +00:00
Richard Mudgett 51b32041d5 Fix voicemail problems when using ogg/vorbis.
Ogg/vorbis was fairly useless as a voicemail file format because it did
not implement the seek and tell format callbacks among other problems.

Since we were already using the libvorbis and libvorbisenc libraries we
can use libvorbisfile as it is also part of the vorbis library package.

* Made use the libvorbisfile to handle the ogg/vorbis file stream.  The
format_ogg_vorbis.c is now mostly a wrapper around libvorbisfile.

(closes issue ASTERISK-16926)
Reported by: sque
Patches:
      ogg_vorbis_use_libvorbisfile.patch (license #6108) patch uploaded by sque
........

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@355376 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-02-14 19:29:24 +00:00
Terry Wilson 34c55e8e7c Opaquify char * and char[] in ast_channel
Review: https://reviewboard.asterisk.org/r/1733/


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@354968 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-02-13 17:27:06 +00:00
Russell Bryant 055a19e128 Replace res_ais with a new module, res_corosync.
This patch removes res_ais and introduces a new module, res_corosync.
The OpenAIS project is deprecated and is now just a wrapper around
Corosync.  This module provides the same functionality using the same
core infrastructure, but without the use of the deprecated components.

Technically res_ais could have been used with an AIS implementation other
than OpenAIS, but that is the only one I know of that was ever used.

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@354046 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-02-05 10:58:37 +00:00
Mark Michelson 0f4489dc0f Fix TLS port binding behavior as well as reload behavior:
* Removes references to tlsbindport from http.conf.sample and manager.conf.sample
* Properly bind to port specified in tlsbindaddr, using the default port if specified.
* On a reload, properly close socket if the service has been disabled.

A note has been added to UPGRADE.txt to indicate how ports must be set for TLS.

(closes issue ASTERISK-16959)
reported by Olaf Holthausen

(closes issue ASTERISK-19201)
reported by Chris Mylonas

(closes issue ASTERISK-19204)
reported by Chris Mylonas

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

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

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


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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@353685 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-02-01 19:53:38 +00:00
Richard Mudgett a99b3c817b Fix ExtenSpy and simplify the channel search functions.
When ast_channel name was opaquified, the channel search functions did not
get converted correctly.  As a result ExtenSpy which uses a channel
iterator search by exten@context could never find anything.

* Updated the doxygen documentation for the search functions in channel.h.

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@353647 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-02-01 17:21:40 +00:00
Sean Bright 544333b435 Resolve an overlap in the ast_audiohook_flags values.
AST_AUDIOHOOK_TRIGGER_WRITE and AST_AUDIOHOOK_WANTS_DTMF were overlapping which
may have caused unintended side effects.  This patch moves
AST_AUDIOHOOK_TRIGGER_WRITE, and updates AST_AUDIOHOOK_TRIGGER_MODE to reflect
the original intention.

This will affect existing modules that use these flags, so be sure to recompile
as necessary.

(closes issue ASTERISK-19246)
Reported by: feyfre
........

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@353600 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-02-01 15:59:54 +00:00
Richard Mudgett 2d7a40de58 Fix memory leak in error paths for action_originate().
* Fix memory leak of vars in error paths for action_originate().

* Moved struct fast_originate_helper tech and data members to stringfields.

* Simplified ActionID header handling for fast_originate().

* Added doxygen note to ast_request() and ast_call() and the associated
channel callbacks that the data/addr parameters should be treated as const
char *.

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

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@353466 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-01-31 17:26:09 +00:00
Terry Wilson de57235ac6 Re-link peers by IP when dnsmgr changes the IP
Asterisk's dnsmgr currently takes a pointer to an ast_sockaddr and updates it
anytime an address resolves to something different. There are a couple of
issues with this. First, the ast_sockaddr is usually the address of an
ast_sockaddr inside a refcounted struct and we never bump the refcount of those
structs when using dnsmgr. This makes it possible that a refresh could happen
after the destructor for that object is called (despite ast_dnsmgr_release
being called in that destructor). Second, the module using dnsmgr cannot be
aware of an address changing without polling for it in the code. If an action
needs to be taken on address update (like re-linking a SIP peer in the
peers_by_ip table), then polling for this change negates many of the benefits
of having dnsmgr in the first place.

This patch adds a function to the dnsmgr API that calls an update callback
instead of blindly updating the address itself. It also moves calls to
ast_dnsmgr_release outside of the destructor functions and into cleanup
functions that are called when we no longer need the objects and increments the
refcount of the objects using dnsmgr since those objects are stored on the
ast_dnsmgr_entry struct. A helper function for returning the proper default SIP
port (non-tls vs tls) is also added and used.

This patch also incorporates changes from a patch posted by Timo Teräs to
ASTERISK-19106 for related dnsmgr issues.

(closes issue ASTERISK-19106)

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

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@353418 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-01-30 23:58:51 +00:00
Kevin P. Fleming 92ef8a6fe1 Address OpenSSL initialization issues when using third-party libraries.
When Asterisk is used with various third-party libraries (CURL, PostgresSQL,
many others) that have the ability themselves to use OpenSSL, it is possible
for conflicts to arise in how the OpenSSL libraries are initialized and
shutdown. This patch addresses these conflicts by 'wrapping' the important
functions from the OpenSSL libraries in a new shared library that is part
of Asterisk itself, and is loaded in such a way as to ensure that *all*
calls to these functions will be dispatched through the Asterisk wrapper
functions, not the native functions.

This new library is optional, but enabled by default. See the CHANGES file
for documentation on how to disable it.

Along the way, this patch also makes a few other minor changes:

* Changes MODULES_DIR to ASTMODDIR throughout the build system, in order to
  more closely match what is used during run-time configuration.

* Corrects some errors in the configure script where AC_CHECK_TOOLS was used
  instead of AC_PATH_PROG.

* Adds a new variable for linker flags in the build system (DYLINK), used for
  producing true shared libraries (as opposed to the dynamically loadable
  modules that the build system produces for 'regular' Asterisk modules).

* Moves the Makefile bits that handle installation and uninstallation of the
  main Asterisk binary into main/Makefile from the top-level Makefile.

* Moves a couple of useful preprocessor macros from optional_api.h to
  asterisk.h.

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@353317 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-01-30 21:21:16 +00:00
Richard Mudgett 27b69e7d29 Audit of ao2_iterator_init() usage for v1.8.
Fixes numerous reference leaks and missing ao2_iterator_destroy() calls as
a result.

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

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@352957 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-01-27 18:47:16 +00:00
Kevin P. Fleming 9ee8a74461 Remove "asterisk/version.h" in favor of "asterisk/ast_version.h".
A long time ago, in a land far far away, we added "asterisk/ast_version.h",
which provides the ast_get_version() and ast_get_version_num() functions. These
were added so that modules that needed the version information for the Asterisk
instance they were loaded in could actually get it (as opposed the version that
they were compiled against). We changed everything in the tree to use the
new mechanism (although later main/test.c was added using the old method).
However, the old mechanism was never removed, and as a result, new code is
still trying to use it.

This commit removes asterisk/version.h and replaces it with a header that
will generate a compile-time error if you try to use it (the error message
tells you which header you should use instead). It also removes the Makefile
and build_tools bits that generated the file, and it updates main/test.c to
use the 'proper' method of getting the Asterisk version information.

This is an API change and thus is being committed for trunk only, but it's
a fairly minor one and definitely improves the situation for out-of-tree
modules.


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@352626 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-01-25 21:31:28 +00:00