Commit Graph

3376 Commits

Author SHA1 Message Date
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 797d633139 Remove inconsistency in CEL eventtype for user defined events.
The CEL eventtype field for ODBC and PGSQL backends should be USER_DEFINED
instead of the user defined event name supplied by the CELGenUserEvent
application.  If the field is output as a number, the user defined name
does not have a value and is always output as 21 for USER_DEFINED and the
userdeftype field would be required to supply the user defined name.

The following CEL backends (cel_odbc, cel_pgsql, cel_custom, cel_manager,
and cel_sqlite3_custom) can be independently configured to remove this
inconsistency.

* Allows cel_manager, cel_custom, and cel_sqlite3_custom to behave the
same way.

(closes issue ASTERISK-17189)
Reported by: Bryant Zimmerman

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@353648 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-02-01 17:42:15 +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
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
Russell Bryant dd35aa1555 Find even more network interfaces.
The previous change made the code look for emN and pciN in addition to what
it did originally, which was search for ethN.  However, it needed to be looking
for pciN#N, so that's what it does now.

This also moves the memset() to be before every ioctl().
........

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@353177 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-01-29 02:45:28 +00:00
Kevin P. Fleming 7023350098 Add 'L16-256' MIME subtype alias for slin16.
Asterisk has supported the 'L16' MIME subtype for 16kHz signed linear (PCM)
audio for quite some time, but some endpoints refer to it as 'L16-256'. This
commit adds this as an alias for the existing format.
........

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@353128 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-01-28 14:52:05 +00:00
Russell Bryant 3b785264b0 Update ast_set_default_eid() to find more network interfaces.
As of Fedora 15, ethN is not the name of ethernet interfaces.  The names
are emN or pciN.  Update some code that searched for interfaces named
ethN to look for the new names, as well.  For more information about why
this change was made, see this page:

    http://domsch.com/blog/?p=455
........

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@353079 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-01-28 04:31:07 +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
Richard Mudgett cbe57b11cb Fixes for sending SIP MESSAGE outside of calls.
* Fix authenticate MESSAGE losing custom headers added by the MESSAGE_DATA
function in the authorization attempt.

* Pass up better From header contents for SIP to use.  Now is in the
"display-name" <URI> format expected by MessageSend.  (Note that this is a
behavior change that could concievably affect some people.)

* Block user from adding standard headers that are added automatically.
(To, From,...)

* Allow the user to override the Content-Type header contents sent by
MessageSend.

* Decrement Max-Forwards header if the user transferred it from an
incoming message.

* Expand SIP short header names so the dialplan and other code only has to
deal with the full names.

* Documents what SIP expects in the MessageSend(from) parameter.

(closes issue ASTERISK-18992)
Reported by: Yuri

(closes issue ASTERISK-18917)
Reported by: Shaun Clark

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@352538 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-01-25 17:23:25 +00:00
Kevin P. Fleming 50de9578aa Eliminate unnecessary rebuilds of main/format*.c.
These files have no need to include "asterisk/version.h", and doing so forces
them to be rebuilt each time a Subversion checkout moves between 'modified'
and 'unmodified' states.
........

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


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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@352348 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-01-24 20:12:09 +00:00
Mark Michelson c3c6b5a0ba Fix grammar of comment.
........

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@352232 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-01-23 20:31:11 +00:00
Mark Michelson 0920c50341 Fix blind transfers from failing if an 'h' extension is present.
This prevents the 'h' extension from being run on the transferee
channel when it is transferred via a native transfer mechanism such
as SIP REFER.

(closes ASTERISK-19173)
Reported by: Ross Beer
Tested by: Kristjan Vrban
Patches:
	ASTERISK-19173 by Mark Michelson (license 5049)

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

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@352229 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-01-23 20:29:48 +00:00
Richard Mudgett 20c6ff71b6 Fix ast_app_dtget() time unit inconsistency.
Note: Noone calls ast_app_dtget() with the timeout parameter of zero so
the bad code normally will never get executed.

* Fix unnecessary floating point division in func_timeout.c
timeout_write() when all other values are integers.

(closes issue ASTERISK-16817)
Reported by: Dmitry Andrianov
........

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@352041 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-01-21 00:23:13 +00:00
Mark Michelson 778fa4abaf Various parking improvements.
* Adds per-parking lot options comebackcontext and comebackdialtime
* Makes comebacktoorigin settable per parking lot
* Sets a PARKER channel variable when comebacktoorigin is disabled

(closes issue ASTERISK-16643)
Reported by: Mitch Sharp (bluecrow76)
Patches:
asterisk-1.6.2.17.2-park-features-comebackcontext-consolidated-v3.diff by Mitch Sharp (bluecrow76) license 5231
with updates by me.

Review: https://reviewboard.asterisk.org/r/1674
Review: https://reviewboard.asterisk.org/r/963
Reviewed by Richard Mudgett



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@351913 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-01-20 20:47:42 +00:00
Tilghman Lesher c60d15222c Add ABS() absolute value function to the expression parser.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@351079 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-01-16 19:49:50 +00:00
Sean Bright 409751e2dc Sort the output of 'database showkey' as well.
You can pass wildcards (%) to the database CLI commands, so this will sort the
returned list of matches.
........

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@350979 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-01-16 17:12:36 +00:00
Joshua Colp 35fef9a7dc Add missing code to set direct RTP setup information during dialing.
........

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@350977 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-01-16 17:07:13 +00:00
Sean Bright 382d14a214 Sort the output of 'database show' by key.
This more closely mimics the behavior of 'database show' before the conversion
to sqlite3.
........

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@350939 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-01-16 14:31:37 +00:00
Walter Doekes ef0de1358d Allow only one thread at a time to do asterisk cleanup/shutdown.
Add locking around the really-really-quit part of the core stop/restart
part. Previously more than one thread could be called to do cleanup,
causing atexit handlers to be run multiple times, in turn causing
segfaults.

(issue ASTERISK-18883)
Reviewed by: Terry Wilson
Review: https://reviewboard.asterisk.org/r/1662/
Review: https://reviewboard.asterisk.org/r/1658/
........

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@350890 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-01-15 20:16:08 +00:00
Kinsey Moore 76888b5990 Make sure asterisk builds on OpenBSD
OpenBSD defines SO_PEERCRED, but it returns a 'struct sockpeercred', not
'struct ucred', which causes compilation of main/asterisk.c to fail in
read_credentials().  This allows configure to check for sockpeercred and
asterisk to deal with it properly.

(closes issue ASTERISK-18929)
Reported-by: Barry Miller
Patch-by: Barry Miller
........

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@350732 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-01-13 21:42:12 +00:00
Richard Mudgett ec2b28d913 Remove some dead code in ast_bridge_call().
None of the parameters to ast_bridge_call() can be NULL for the bridge to
work so no need to check for it.


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@350644 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-01-13 18:52:53 +00:00
Richard Mudgett 523c95e146 Add missing CEL logging fields to various CEL backends.
Multiple revisions 350555,350571

........
  r350555 | rmudgett | 2012-01-13 11:12:51 -0600 (Fri, 13 Jan 2012) | 12 lines
  
  Add missing CEL logging fields to various CEL backends.
  
  * Add missing eventextra to cel_psql.c and cel_odbc.c.
  
  * Add missing PeerAccount and EventExtra to cel_manager.c.
  
  * Add missing userdeftype support for cel_custom.conf.sample and
  cel_sqlite3_custom.conf.sample.
  
  (closes issue ASTERISK-17190)
  Reported by: Bryant Zimmerman
........
  r350571 | rmudgett | 2012-01-13 11:23:57 -0600 (Fri, 13 Jan 2012) | 8 lines
  
  Use compatible names for event extra data for various CEL backends.
  
  * Change eventextra to extra in cel_psql.c and cel_odbc.c.
  
  * Change EventExtra to Extra in cel_manager.c.
  
  (issue ASTERISK-17190)
........

Merged revisions 350555,350571 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@350605 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-01-13 17:36:44 +00:00
Matthew Jordan a8276fe8ef Fix crash from bridge channel hangup race condition in ConfBridge
This patch addresses two issues in ConfBridge and the channel bridge layer:
1. It fixes a race condition wherein the bridge channel could be hung up
2. It removes the deadlock avoidance from the bridging layer and makes the
   bridge_pvt an ao2 ref counted object

Patch by David Vossel (mjordan was merely the commit monkey)

(issue ASTERISK-18988)
(closes issue ASTERISK-18885)
Reported by: Dmitry Melekhov
Tested by: Matt Jordan
Patches: chan_bridge_cleanup_v.diff uploaded by David Vossel (license 5628)

(closes issue ASTERISK-19100)
Reported by: Matt Jordan
Tested by: Matt Jordan

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@350551 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-01-13 16:48:06 +00:00
Jonathan Rose 19a9761084 Adds peer to CEL report on CEL_BRIDGE_START and CEL_BRIDGE_END
(closes issue ASTERISK-17940)
Reporter: Nic Colledge
Patches:
	features_18.patch uploaded by Nic Colledge (license 6245)
........

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@350503 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-01-12 16:10:47 +00:00
Richard Mudgett 9988918829 Remove extraneous BRIDGEPEER AMI VarSet event on a CEL dummy channel.
(closes issue ASTERISK-19180)
Reported by: Corey Farrell
Patches:
      asterisk_cel_noevent_varset.diff (license #5909) patch uploaded by Corey Farrell
........

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@350454 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-01-11 22:53:09 +00:00
Terry Wilson 9748f19e96 Always treat arguments to get_by_name_cb as strings
Initially, support was left in for the old style of searching, even
though it wasn't actually used. In the case of name_len != 0, the
OBJ_KEY flag isn't passed because we aren't matching on a full key
and therefor can't use the hash function to optimize. The code left
in to support the old way of searching unfortunately treated a prefix
search like this as though an ast_channel struct was passed as an arg
and caused a crash.

This patch also adds needed parentheses around some matching conditions.

(closes issue ASTERISK-19182)


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

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

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

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@350223 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-01-09 22:15:50 +00:00
Walter Doekes a2a3b3ee4b Fix shutdown handling of sqlite3 astdb.
If a db_sync was scheduled just before shutdown, the atexit code calling
db_sync would have no effect, causing the astdb commit thread to stay
alive. This caused the SIP/realtime_sipregs test to fail. (The fallback
kill would run the atexit code again and that would wreak havoc.) This
fixes that the atexit kill condition is picked up properly.

(closes issue ASTERISK-18883)
Reviewed by: Terry Wilson

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@350181 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-01-09 19:37:23 +00:00
Richard Mudgett 70b246f338 Make Asterisk -x command line parameter imply -r parameter presence.
The Asterisk -x command line parameter is documented inconsistently.

* Made the -x documentation and behavior consistent.

* Since this is also a new year, updated the copyright notices while here.

(closes issue ASTERISK-19094)
Reported by: Eugene
Patches:
      issueA19094_correct_asterisk_option_x.patch (license #5674) patch uploaded by Walter Doekes (modified)
Tested by: Eugene
........

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@350077 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-01-09 17:06:30 +00:00
Kinsey Moore 6fa808447b Allow playback of formats that don't support seeking
ast_streamfile previously did unconditional seeking on files that broke
playback of formats that don't support that functionality.  This patch avoids
the seek that was causing the problem.  This regression was introduced in
r158062.

(closes issue ASTERISK-18994)
Patch-by: Timo Teras
........

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@349733 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-01-05 22:11:41 +00:00
Jonathan Rose fd04da5114 Fix an issue where dsp.c would interpret multiple dtmf events from a single key press.
When receiving calls from a mobile phone into a DISA system on a connection with
significant interference, the reporter's Asterisk system would interpret DTMF incorrectly
and replicate digits received. This patch resolves that by increasing the number of
frames a mismatch has to be detected before assuming the DTMF is over by 1 frame and
adjusts dtmf_detect function to reset hits and misses only when an edge is detected.

(closes issue ASTERISK-17493)
Reported by: Alec Davis
Patches:
	bug18904-refactor.diff.txt uploaded by Alec Davis (license 5546)
Review: https://reviewboard.asterisk.org/r/1130/
........

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@349730 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-01-05 22:02:33 +00:00
Jonathan Rose ebf40f1129 Ensures Asterisk closes when receiving terminal signals in 'no fork' mode.
When catching a signal, in no fork mode the console thread is identical to the thread
responsible for catching the signal and closing Asterisk, which requires it to first
dispense with the console thread. Prior to this patch, if these threads were identical,
upon receiving a killing signal, the thread will send an URG signal to itself, which
we also catch and then promptly do nothing with. Obviously this isn't useful behavior.

(closes issue ASTERISK-19127)
Reported By: Bryon Clark
Patches:
	quit_on_signals.patch uploaded by Bryon Clark (license 6157)
........

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@349674 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-01-05 16:16:51 +00:00
Jonathan Rose 573e1e5dc0 Fix documentation for SayNumber to reflect the fact that language is changed in CHANNEL()
(closes issue ASTERISK-18962)
reported by: Nir Simionovich
........

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@349452 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-01-04 18:46:51 +00:00
Russell Bryant 2b2d34b3c9 Constify tag argument in REF_DEBUG related code.
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@349409 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-12-31 15:45:57 +00:00
Matthew Jordan 24a6c9b815 Handle AST_CONTROL_UPDATE_RTP_PEER frames in local bridge loop
Failing to handle AST_CONTROL_UPDATE_RTP_PEER frames in the local bridge loop
causes the loop to exit prematurely.  This causes a variety of negative side
effects, depending on when the loop exits.  This patch handles the frame by
essentially swallowing the frame in the local loop, as the current channel
drivers expect the RTP bridge to handle the frame, and, in the case of the
local bridge loop, no additional action is necessary.

(issue ASTERISK-19040)
(issue ASTERISK-19128)
(issue ASTERISK-17725)
(issue ASTERISK-18340)
(closes issue ASTERISK-19095)
Reported by: Stefan Schmidt
Tested by: Matt Jordan

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

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@349341 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-12-29 15:16:46 +00:00
Sean Bright 9e48f6799d Use ast_audiohook_write_list_empty to determine if our lists are empty instead
of duplicating that logic.
........

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@349291 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-12-28 21:39:12 +00:00
Kevin P. Fleming fdda494776 Improve T.38 gateway V.21 preamble detection.
This commit removes the V.21 preamble detection code previously added to the
generic DSP implementation in Asterisk, and instead enhances the res_fax module
to be able to utilize V.21 preamble detection functionality made available by
FAX technology modules. This commit also adds such support to res_fax_spandsp,
which uses the Spandsp modem tone detection code to do the V.21 preamble
detection.

There should be no functional change here, other than much more reliable V.21
preamble detection (and thus T.38 gateway initiation).
........

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@349249 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-12-28 18:59:16 +00:00
Sean Bright 8017be6fa9 Once an audiohook is attached to a channel, we continue to transcode all of the
frames, even after all of the hooks are detached.  This patch short-cicuits us
out before we transcode unnecessarily.
........

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@349146 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-12-27 17:17:58 +00:00
Jonathan Rose 19a4928fee INFO/Record request configurable to use dynamic features
Adds two new options to SIP peers allowing them to specify features (dynamic or builtin)
to use when sending INFO/record requests. Recordonfeature activates whatever feature
is specified when recieving a record: on request while recordofffeature activates
whatever feature is specified when receiving a record: off request. Both of these
features can be disabled by setting the feature to an empty string.

(closes issue ASTERISK-16507)
Reported by: Jon Bright
Review: https://reviewboard.asterisk.org/r/1634/



git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@349098 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-12-23 20:42:21 +00:00
Richard Mudgett 32e35e5fcd Fix extension state callback references in chan_sip.
Chan_sip gives a dialog reference to the extension state callback and
assumes that when ast_extension_state_del() returns, the callback cannot
happen anymore.  Chan_sip then reduces the dialog reference count
associated with the callback.  Recent changes (ASTERISK-17760) have
resulted in the potential for the callback to happen after
ast_extension_state_del() has returned.  For chan_sip, this could be very
bad because the dialog pointer could have already been destroyed.

* Added ast_extension_state_add_destroy() so chan_sip can account for the
sip_pvt reference given to the extension state callback when the extension
state callback is deleted.

* Fix pbx.c awkward statecbs handling in ast_extension_state_add_destroy()
and handle_statechange() now that the struct ast_state_cb has a destructor
to call.

* Ensure that ast_extension_state_add_destroy() will never return -1 or 0
for a successful registration.

* Fixed pbx.c statecbs_cmp() to compare the correct information.  The
passed in value to compare is a change_cb function pointer not an object
pointer.

* Make pbx.c ast_merge_contexts_and_delete() not perform callbacks with
AST_EXTENSION_REMOVED with locks held.  Chan_sip is notorious for
deadlocking when those locks are held during the callback.

* Removed unused lock declaration for the pbx.c store_hints list.

(closes issue ASTERISK-18844)
Reported by: rmudgett

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

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@348953 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-12-23 02:35:13 +00:00
Matthew Jordan cf0c9830bf Add Asterisk TestSuite event hooks to support ConfBridge testing
This patch adds initial testsuite event hooks so that ConfBridge tests
can be executed in the Asterisk TestSuite.

(issue ASTERISK-19059)
........

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@348848 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-12-22 20:44:53 +00:00
Leif Madsen eb37d38b7d Update documentation for MESSAGE_SEND_STATUS variable.
(Closes issue ASTERISK-19056)
Reported by: Yuri
Patches:
     348360.diff uploaded by Yuri (license #5242)
........

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@348606 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-12-19 19:55:18 +00:00
Richard Mudgett be74e6f16e Clean-up on isle five for __ast_request_and_dial() and ast_call_forward().
* Add locking when a channel inherits variables and datastores in
__ast_request_and_dial() and ast_call_forward().  Note: The involved
channels are not active so there was minimal potential for problems.

* Remove calls to ast_set_callerid() in __ast_request_and_dial() and
ast_call_forward() because the set information is for the wrong direction.

* Don't use C++ keywords for variable names in ast_call_forward().

* Run the redirecting interception macro if defined when forwarding a call
in ast_call_forward().  Note: Currently will never execute because the
only callers that supply a calling channel supply a hungup or zombie
channel.

* Make feature_request_and_dial() put the transferee into autoservice when
it calls ast_call_forward() in case a redirection interception macro is
run.  Note: Currently will never happen because the caller channel (Party
B) is always hungup at this time.

* Make feature_request_and_dial() ignore the AST_CONTROL_PROCEEDING frame
to silence a log message.
........

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@348466 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-12-16 23:58:44 +00:00
Richard Mudgett e71bad4958 Fix cut and past error in ast_call_forward().
(issue ASTERISK-18836)
........

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@348408 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-12-16 21:30:35 +00:00