Commit Graph

2354 Commits

Author SHA1 Message Date
Mark Michelson b504a707f5 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


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/10@353820 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-02-02 18:48:05 +00:00
Sean Bright 73b93bbc17 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


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/10@353599 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-02-01 15:51:29 +00:00
Richard Mudgett 754e821648 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


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/10@353463 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-01-31 17:21:17 +00:00
Terry Wilson 48b42ebe3a 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


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/10@353397 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-01-30 23:28:10 +00:00
Richard Mudgett 88af121f9f 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


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/10@352956 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-01-27 18:36:43 +00:00
Jonathan Rose 1ee1b73567 Eliminates doubling the :port part of SIP Notify Message-Account headers.
This patch prevents the domain string from getting mangled during the initreqprep
step by moving the initialization to before its immediate use.  It also documents
this pitfall for the ast_sockaddr_stringify functions.

(issue ASTERISK-19057)
Reported by: Yuri
Review: https://reviewboard.asterisk.org/r/1678/
........

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/10@351560 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-01-19 21:47:22 +00:00
Kinsey Moore bb11601d06 Run bootstrap.sh for the for the ASTERISK-18929 fix
configure and autoconfig.h.in were not regenerated when the fix was committed.
........

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/10@350737 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-01-13 22:10:48 +00:00
Matthew Jordan d3fbfc50f4 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/



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/10@350550 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2012-01-13 16:43:11 +00:00
Kevin P. Fleming a881e1740d 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).



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/10@349248 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-12-28 18:49:29 +00:00
Matthew Jordan 580c6f9a48 Fix timing source dependency issues with MOH
Prior to this patch, res_musiconhold existed at the same module priority level
as the timing sources that it depends on.  This would cause a problem when
music on hold was reloaded, as the timing source could be changed after
res_musiconhold was processed.  This patch adds a new module priority level,
AST_MODPRI_TIMING, that the various timing modules are now loaded at.  This
now occurs before loading other resource modules, such that the timing source
is guaranteed to be set prior to resolving the timing source dependencies.

(closes issue ASTERISK-17474)
Reporter: Luke H
Tested by: Luke H, Vladimir Mikhelson, zzsurf, Wes Van Tlghem, elguero, Thomas Arimont
Patches:
 asterisk-17474-dahdi_timing-infinite-wait-fix_v3_branch-1.8.diff uploaded by elguero (License #5026)
 asterisk-17474-dahdi_timing-infinite-wait-fix_v3_branch-10.diff uploaded by elguero (License #5026)
 asterisk-17474-dahdi_timing-infinite-wait-fix_v3.diff uploaded by elguero (License #5026)

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/10@349195 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-12-27 20:53:46 +00:00
Richard Mudgett d43b217d08 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


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/10@348952 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-12-23 02:30:19 +00:00
Terry Wilson 07fd1458d7 Allow packetization vaules > 127
According to the RTP packetization documentation, and the maximum values
listed in AST_FORMAT_LIST, we should support values > that the signed
char array that ast_codec_pref makes available to store the value. All
places in the code treat the framing field as though it were an int
array instaead of a char array anyway, so this just fixes the type of
the array.

(closes issue ASTERISK-18876)
Review: https://reviewboard.asterisk.org/r/1639/
........

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/10@348845 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-12-22 20:17:39 +00:00
Richard Mudgett 5688637636 Fix crash during CDR update.
The ast_cdr_setcid() and ast_cdr_update() were shown in ASTERISK-18836 to
be called by different threads for the same channel.  The channel driver
thread and the PBX thread running dialplan.

* Add lock protection around CDR API calls that access an ast_channel
pointer.

(closes issue ASTERISK-18836)
Reported by: gpluser

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/10@348363 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-12-16 21:04:01 +00:00
Terry Wilson 309c50e4bb Add ASTSBINDIR to the list of configurable paths
This patch also makes astdb2sqlite3 and astcanary use the configured
directory instead of relying on $PATH.

(closes issue ASTERISK-18959)
Review: https://reviewboard.asterisk.org/r/1613/


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/10@347344 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-12-07 20:12:53 +00:00
Richard Mudgett ae9145e400 Re-resolve the STUN address if a STUN poll fails for res_stun_monitor.
The STUN socket must remain open between polls or the external address
seen by the STUN server is likely to change.  However, if the STUN request
poll fails then the STUN server address needs to be re-resolved and the
STUN socket needs to be closed and reopened.

* Re-resolve the STUN server address and create a new socket if the STUN
request poll fails.

* Fix ast_stun_request() return value consistency.

* Fix ast_stun_request() to check the received packet for expected message
type and transaction ID.

* Fix ast_stun_request() to read packets until timeout or an associated
response packet is found.  The stun_purge_socket() hack is no longer
required.

* Reduce ast_stun_request() error messages to debug output.

* No longer pass in the destination address to ast_stun_request() if the
socket is already bound or connected to the destination.

(closes issue ASTERISK-18327)
Reported by: Wolfram Joost
Tested by: rmudgett

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/10@346701 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-12-01 21:14:55 +00:00
Jonathan Rose e0bcc2b29d r346525 | jrose | 2011-11-30 15:10:38 -0600 (Wed, 30 Nov 2011) | 18 lines
Cleaning up chan_sip/tcptls file descriptor closing.

This patch attempts to eliminate various possible instances of undefined behavior caused
by invoking close/fclose in situations where fclose may have already been issued on a
tcptls_session_instance and/or closing file descriptors that don't have a valid index
for fd (-1). Thanks for more than a little help from wdoekes.

(closes issue ASTERISK-18700)
Reported by: Erik Wallin

(issue ASTERISK-18345)
Reported by: Stephane Cazelas

(issue ASTERISK-18342)
Reported by: Stephane Chazelas

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/10@346565 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-11-30 21:46:47 +00:00
David Vossel 5d452c2647 Fixes memory leak in message API.
The ast_msg_get_var function did not properly decrement
the ref count of the var it retrieves.  The way this is
implemented is a bit tricky, as we must decrement the var and then
return the var's value.  As long as the documentation for the
function is followed, this will not result in a dangling pointer as
the ast_msg structure owns its own reference to the var while it
exists in the var container.


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/10@346349 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-11-29 00:00:11 +00:00
Richard Mudgett 8a8179fa03 Fix calls to ast_get_ip() not initializing the address family.
........

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/10@346240 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-11-23 22:58:43 +00:00
Walter Doekes 9ddc1ed171 Fix ast_str_truncate signedness warning and documentation.
Review: https://reviewboard.asterisk.org/r/1594
........

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/10@346145 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-11-23 19:55:41 +00:00
Kinsey Moore 328f07623f Fix res_jabber resource leaks
This should fix almost all resource leaks in res_jabber that involve
ASTOBJ_CONTAINER_FIND and resolves an ambiguous situation where
ast_aji_get_client would sometimes bump an object's refcount and sometimes not.

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/10@346087 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-11-23 17:14:41 +00:00
Richard Mudgett baf71ede93 Fix dnsmgr entries to ask for the same address family each time.
The dnsmgr refresh would always get the first address found regardless of
the original address family requested.  So if you asked for only IPv4
addresses originally, you might get an IPv6 address on refresh.

* Saved the original address family requested by ast_dnsmgr_lookup() to be
used when the address is refreshed.
........

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/10@345977 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-11-22 23:00:31 +00:00
Walter Doekes ea9adef27d Clarify why the AST_LOG_* macros exist next to the LOG_* macros.
(issue ASTERISK-17973)
........

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/10@345924 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-11-22 20:31:06 +00:00
Walter Doekes 5488244b13 Use __alignof__ instead of sizeof for stringfield length storage.
Kevin P Fleming suggested that r343157 should use __alignof__ instead
of sizeof. For most systems this won't be an issue, but better fix it
now while it's still fresh.

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/10@344845 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-11-11 21:58:31 +00:00
Walter Doekes e04eea4fab Ensure that string field lengths are properly aligned
Integers should always be aligned. For some platforms (ARM, SPARC) this
is more important than for others. This changeset ensures that the
string field string lengths are aligned on *all* platforms, not just on
the SPARC for which there was a workaround. It also fixes that the
length integer can be resized to 32 bits without problems if needed.

(closes issue ASTERISK-17310)
Reported by: radael, S Adrian
Reviewed by: Tzafrir Cohen, Terry Wilson
Tested by: S Adrian

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/10@343158 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-11-02 21:37:11 +00:00
Walter Doekes 14200ca67f Several fixes to the chan_sip dynamic realtime peer/user lookup
There were several problems with the dynamic realtime peer/user lookup
code. The lookup logic had become rather hard to read due to lots of
incremental changes to the realtime_peer function. And, during the
addition of the sipregs functionality, several possibilities for memory
leaks had been introduced. The insecure=port matching has always been
broken for anyone using the sipregs family. And, related, the broken
implementation forced those using sipregs to *still* have an ipaddr
column on their sippeers table.

Thanks Terry Wilson for comprehensive testing and finding and fixing
unexpected behaviour from the multientry realtime call which caused
the realtime_peer to have a completely unused code path.

This changeset fixes the leaks, the lookup inconsistenties and that
you won't need an ipaddr column on your sippeers table anymore (when
you're using sipregs). Beware that when you're using sipregs, peers
with insecure=port will now start matching!

(closes issue ASTERISK-17792)
(closes issue ASTERISK-18356)
Reported by: marcelloceschia, Walter Doekes
Reviewed by: Terry Wilson

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/10@342929 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-11-01 20:58:18 +00:00
Richard Mudgett 24a8f7627d Fix AST_LIST_INSERT_BEFORE_CURRENT() updating the wrong variable.
AST_LIST_INSERT_BEFORE_CURRENT() could not be used twice in an iteration
or before AST_LIST_REMOVE_CURRENT() without corrupting the list.
AST_LIST_INSERT_BEFORE_CURRENT() could also corrupt the list if
AST_LIST_INSERT_BEFORE_CURRENT() or AST_LIST_REMOVE_CURRENT() is used on
the next iteration.

* Fixed cut and paste error using the wrong variable in
AST_LIST_INSERT_BEFORE_CURRENT().

* Added linked list unit tests for AST_LIST_INSERT_BEFORE_CURRENT(),
AST_LIST_APPEND_LIST(), and AST_LIST_INSERT_LIST_AFTER().
........

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/10@342662 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-10-29 04:26:28 +00:00
Terry Wilson 2bdeae0faf Return NULL when no results returned for realtime_multientry
It was not documented what the return value should be when no entries
were returned with the multientry realtime callback. This change forces
consistent behavior even if the backends return an empty ast_config.

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

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/10@342224 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-10-25 01:25:52 +00:00
Richard Mudgett 06f43f5c04 Fix ao2obj.h comment typos and add missing link/unlink nolock debug defines.
git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/10@342183 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-10-24 22:32:26 +00:00
Richard Mudgett ce19768cec Fix AGI exec Park to honor the Park application parameters.
The fix for ASTERISK-12715 and ASTERISK-12685 added a check for the Park
application because the channel needed to be masqueraded to prevent a
crash.  Since the Park application now always masquerades the channel into
the parking lot, the special check is no longer needed.  The fix also
resulted in AGI exec Park attempting to double park the call and not honor
the Park application parameters.

* Removed no longer necessary call to ast_masq_park_call() by AGI exec for
the Park application.  (Reverts -r146923)

* Fix Park application to only return 0 or -1.  The AGI exec Park was
causing broken pipe error messages because the Park application returned 1
on successful park.

(closes issue ASTERISK-18737)
........

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/10@341718 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-10-20 21:58:39 +00:00
Terry Wilson b761c1eef2 Clean up ast_check_digits
The code was originally copied from the is_int() function in the AEL
code. wdoekes pointed out that the function should take a const char*
and that their was an unneeded variable. This is now fixed.
........

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/10@341530 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-10-20 15:14:08 +00:00
Terry Wilson 26f196468f Don't use is_int() since it doesn't link well on all platforms
Just create an normal API function in strings.h that does the same thing
just to be safe.

ASTERISK-17146
........

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/10@341380 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-10-19 07:42:55 +00:00
Richard Mudgett fa58ec2c74 More parking issues.
* Fix potential deadlocks in SIP and IAX blind transfer to parking.

* Fix SIP, IAX, DAHDI analog, and MGCP channel drivers to respect the
parkext_exclusive option with transfers (Park(,,,,,exclusive_lot)
parameter).  Created ast_park_call_exten() and ast_masq_park_call_exten()
to maintian API compatibility.

* Made masq_park_call() handle a failed ast_channel_masquerade() setup.

* Reduced excessive struct parkeduser.peername[] size.
........

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/10@341255 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-10-18 21:11:42 +00:00
Richard Mudgett 4348fc2cc9 Convert registered AMI actions to ao2 objects.
* Fixed race between calling an AMI action callback and unregistering that
action.  Refixes ASTERISK-13784 broken by ASTERISK-17785 change.

* Fixed potential memory leak if an AMI action failed to get registered
because is already was registered.  Part of the ao2 conversion.

* Fixed AMI ListCommands action not walking the actions list with a lock
held.

* Fix usage of ast_strdupa() and alloca() in loops.  Excess stack usage.

* Fix AMI Originate action Variable header requiring a space after the
header colon.  Reported by Yaroslav Panych on the asterisk-dev list.

* Increased the number of listed variables allowed per AMI Originate
action Variable header to 64.

* Fixed AMI GetConfigJSON action output format.

* Fixed usage of res contents outside of scope in append_channel_vars().

* Fixed inconsistency of config file channelvars option.  The values no
longer accumulate with every channelvars option in the config file.  Only
the last value is kept to be consistent with the CLI "manager show
settings" command.

(closes issue ASTERISK-18479)
Reported by: Jaco Kroon
........

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


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/10@340281 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-10-11 18:53:34 +00:00
Tzafrir Cohen 3275275a07 Update SHA1 code to RFC 6234
RFC 6234 is an update to RFC 3174 from which the code was originally taken.
It has a slightly better code, and a better phrased license (simple 3-clause
BSD).

* main/sha1.c is sha1.c from RFC 6234 with formatting changes only.
* include/asterisk/sha1.h merges sha.h and sha-private.h from RFC 6234.
* Removed unused include of asterisk/sha1.h from main/channels.c

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

Merge-From: http://svn.asterisk.org/svn/asterisk/branches/1.8@340263


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/10@340280 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-10-11 18:41:05 +00:00
Matthew Nicholson 63d4530e93 Merged revisions 340108 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.8

........
  r340108 | mnicholson | 2011-10-10 09:14:48 -0500 (Mon, 10 Oct 2011) | 11 lines
  
  Load the proper XML documentation when multiple modules document the same application.
  
  This patch adds an optional "module" attribute to the XML documentation spec
  that allows the documentation processor to match apps with identical names from
  different modules to their documentation. This patch also fixes a number of
  bugs with the documentation processor and should make it a little more
  efficient. Support for multiple languages has also been properly implemented.
  
  ASTERISK-18130
  Review: https://reviewboard.asterisk.org/r/1485/
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/10@340109 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-10-10 14:15:41 +00:00
Richard Mudgett b1876538ec Merged revisions 339719 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.8

........
  r339719 | rmudgett | 2011-10-06 17:47:50 -0500 (Thu, 06 Oct 2011) | 20 lines
  
  Fix regression in configure script for libpri capability checks.
  
  JIRA AST-598 added the PRI_L2_PERSISTENCE option to fix BRI PTMP TE layer
  2 persistence issues with some telcos.  ASTERISK-18535 attempted to fix
  the unexpected requirement that libpri *must* have that feature to work
  with Asterisk.  The AST_EXT_LIB_SETUP_DEPENDENT lines made the PRI
  optional features required.  Unfortunately, I thought
  AST_EXT_LIB_SETUP_DEPENDENT didn't do anything useful for libpri and
  deleted those lines for libpri.  The result was the HAVE_PRI_xxx defines
  that control the ability to use optional libpri features were also
  deleted.
  
  * Created AST_EXT_LIB_SETUP_OPTIONAL configuration macro to allow optional
  features in a library that the source code could take advantage of if the
  code supports the feature.
  
  (closes issue ASTERISK-18687)
  Reported by: Norbert
  Tested by: rmudgett
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/10@339720 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-10-06 22:58:40 +00:00
Richard Mudgett 58ddd59548 Merged revisions 338235 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.8

........
  r338235 | rmudgett | 2011-09-28 16:17:45 -0500 (Wed, 28 Sep 2011) | 7 lines
  
  Fix inconsistency in LOG_VERBOSE/AST_LOG_VERBOSE declaration.
  
  (closes issue ASTERISK-17973)
  Reported by: Luke H
  Patches:
        logger_h.patch (license #6278) patch uploaded by Luke H
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/10@338253 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-09-28 21:22:05 +00:00
Richard Mudgett 0764556d4f Merged revisions 337973 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.8

........
  r337973 | rmudgett | 2011-09-26 14:30:39 -0500 (Mon, 26 Sep 2011) | 30 lines
  
  Fix deadlock when using dummy channels.
  
  Dummy channels created by ast_dummy_channel_alloc() should be destoyed by
  ast_channel_unref().  Using ast_channel_release() needlessly grabs the
  channel container lock and can cause a deadlock as a result.
  
  * Analyzed use of ast_dummy_channel_alloc() and made use
  ast_channel_unref() when done with the dummy channel.  (Primary reason for
  the reported deadlock.)
  
  * Made app_dial.c:dial_exec_full() not call ast_call() holding any channel
  locks.  Chan_local could not perform deadlock avoidance correctly.
  (Potential deadlock exposed by this issue.  Secondary reason for the
  reported deadlock since the held lock was part of the deadlock chain.)
  
  * Fixed some uses of ast_dummy_channel_alloc() not checking the returned
  channel pointer for failure.
  
  * Fixed some potential chan=NULL pointer usage in func_odbc.c.  Protected
  by testing the bogus_chan value.
  
  * Fixed needlessly clearing a 1024 char auto array when setting the first
  char to zero is enough in manager.c:action_getvar().
  
  (closes issue ASTERISK-18613)
  Reported by: Thomas Arimont
  Patches:
        jira_asterisk_18613_v1.8.patch (license #5621) patch uploaded by rmudgett
  Tested by: Thomas Arimont
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/10@337974 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-09-26 19:35:23 +00:00
Jonathan Rose 857e4fdb14 Generate Security events in chan_sip using new Security Events Framework
Security Events Framework was added in 1.8 and support was added for AMI to generate
events at that time. This patch adds support for chan_sip to generate security events.

(closes issue ASTERISK-18264)
Reported by: Michael L. Young
Patches:
     security_events_chan_sip_v4.patch (license #5026) by Michael L. Young
Review: https://reviewboard.asterisk.org/r/1362/



git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/10@337595 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-09-22 15:35:50 +00:00
Matthew Jordan 944cdaa94d Merged revisions 337118 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.8

........
  r337118 | mjordan | 2011-09-20 17:38:54 -0500 (Tue, 20 Sep 2011) | 21 lines
  
  Fix for incorrect voicemail duration in external notifications
  
  This patch fixes an issue where the voicemail duration was being reported
  with a duration significantly less than the actual sound file duration.
  Voicemails that contained mostly silence were reporting the duration of
  only the sound in the file, as opposed to the duration of the file with
  the silence.  This patch fixes this by having two durations reported in
  the __ast_play_and_record family of functions - the sound_duration and the
  actual duration of the file.  The sound_duration, which is optional, now
  reports the duration of the sound in the file, while the actual full duration
  of the file is reported in the duration parameter.  This allows the voicemail
  applications to use the sound_duration for minimum duration checking, while
  reporting the full duration to external parties if the voicemail is kept.
  
  (issue ASTERISK-2234)
  (closes issue ASTERISK-16981)
  Reported by: Mary Ciuciu, Byron Clark, Brad House, Karsten Wemheuer, KevinH
  Tested by: Matt Jordan
  
  Review: https://reviewboard.asterisk.org/r/1443
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/10@337120 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-09-20 22:49:36 +00:00
Tilghman Lesher e1c3a38653 Merged revisions 336733 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.8

........
  r336733 | tilghman | 2011-09-19 15:27:03 -0500 (Mon, 19 Sep 2011) | 11 lines
  
  Various changes to allow 1.8 to compile on Mac OS X Lion (10.7)
  
  * Makefile workaround for 10.6 extended to work on 10.7 and later.
  * Now uses the 'weak' symbol for Lion systems, which no longer support
    'weak_import'
  
  Closes ASTERISK-17612.
  Closes ASTERISK-18213.
  
  Tested by: tilghman, oej.
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/10@336734 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-09-19 20:29:40 +00:00
Jonathan Rose 1701266596 Merged revisions 336294 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.8

........
  r336294 | jrose | 2011-09-16 14:53:40 -0500 (Fri, 16 Sep 2011) | 13 lines
  
  Fix bad RTP media bridges in directmedia calls on peers separated by multiple Asterisk nodes.
  
  In a situation involving devices on separate Asterisk trunks, the remote RTP bridge would
  break when starting a call with directmedia. This patch queues a new type of control frame
  so that our RTP bridge loop can properly detect when these situations occur and check to see
  if peers need to be updated in order to send their media to the proper location.
  
  (Closes issue ASTERISK-18340)
  Reported by: Thomas Arimont
  (Closes issue ASTERISK-17725)
  Reported by: kwk
  Tested by: twilson, jrose
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/10@336307 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-09-16 21:09:20 +00:00
Richard Mudgett ff58a3f1b9 Merged revisions 335911 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.8

........
  r335911 | rmudgett | 2011-09-14 13:21:35 -0500 (Wed, 14 Sep 2011) | 13 lines
  
  Remove unnecessary libpri dependency checks in the configure script.
  
  Using the --with-pri option with the configure script generated an error
  about not having PRI_L2_PERSISTENCE if you did not have the absolute
  latest libpri SVN checkout installed.
  
  The AST_EXT_LIB_SETUP_DEPENDENT macro in the configure.ac script seems to
  be for libraries that are dependent upon other libraries and not
  necessarily for optional/added features within a library.
  
  (closes issue ASTERISK-18535)
  Reported by: Michael Keuter
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/10@335912 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-09-14 18:31:15 +00:00
Russell Bryant d287e6116a Merged revisions 335497 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.8

........
  r335497 | russell | 2011-09-13 02:11:36 -0500 (Tue, 13 Sep 2011) | 15 lines
  
  Fix a crash in res_ais.
  
  This patch resolves a crash observed in a load testing environment that
  involved the use of the res_ais module.  I observed some crashes where
  the event delivery callback would get called, but the length parameter
  incidcating how much data there was to read was 0.  The code assumed
  (with good reason I would think) that if this callback got called, there
  was an event available to read.  However, if the rare case that there's
  nothing there, catch it and return instead of blowing up.
  
  More specifically, the change always ensure that the size of the received
  event in the cluster is always big enough to be a real ast_event.
  
  Review: https://reviewboard.asterisk.org/r/1423/
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/10@335510 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-09-13 07:24:34 +00:00
Matthew Jordan 4e57652651 Merged revisions 335064 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.8

........
  r335064 | mjordan | 2011-09-09 11:09:09 -0500 (Fri, 09 Sep 2011) | 23 lines
  
  Updated SIP 484 handling; added Incomplete control frame
  
  When a SIP phone uses the dial application and receives a 484 Address 
  Incomplete response, if overlapped dialing is enabled for SIP, then
  the 484 Address Incomplete is forwarded back to the SIP phone and the
  HANGUPCAUSE channel variable is set to 28.  Previously, the Incomplete
  application dialplan logic was automatically triggered; now, explicit
  dialplan usage of the application is required.
  
  Additionally, this patch adds a new AST_CONTOL_FRAME type called
  AST_CONTROL_INCOMPLETE.  If a channel driver receives this control frame,
  it is an indication that the dialplan expects more digits back from the
  device.  If the device supports overlap dialing it should attempt to 
  notify the device that the dialplan is waiting for more digits; otherwise,
  it can handle the frame in a manner appropriate to the channel driver.
  
  (closes issue ASTERISK-17288)
  Reported by: Mikael Carlsson
  Tested by: Matthew Jordan
  
  Review: https://reviewboard.asterisk.org/r/1416/
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/10@335078 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-09-09 16:27:01 +00:00
Richard Mudgett 57acdddb2d Merged revisions 334296 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.8

........
  r334296 | rmudgett | 2011-09-02 12:10:58 -0500 (Fri, 02 Sep 2011) | 39 lines
  
  Fix potential memory allocation failure crashes in config.c.
  
  * Added required checks to the returned memory allocation pointers to
  prevent crashes.
  
  * Made ast_include_rename() create a replacement ast_variable list node if
  the new filename is longer than the available space.  Fixes potential
  crash and memory leak.
  
  * Factored out ast_variable_move() from ast_variable_update() so
  ast_include_rename() can also use it when creating a replacement
  ast_variable list node.
  
  * Made the filename stuffed at the end of the struct a minimum allocated
  size in ast_variable_new() in case ast_include_rename() changes the stored
  filename.
  
  * Constify struct char pointers pointing to strings stuffed at the end of
  the struct for: ast_variable, cache_file_mtime, and ast_config_map.
  
  * Factored out cfmtime_new() to remove inlined code and allow some struct
  pointers to become const.
  
  * Removed the list lock from struct cache_file_mtime that was never used.
  
  * Added doxygen comments to several structure elements and better
  documented what strings are stuffed at the struct end char array.
  
  * Reworked ast_config_text_file_save() and set_fn() to handle allocation
  failure of the include file scratch pad object tracking blank lines.
  
  * Made ast_config_text_file_save() fn[] declared with PATH_MAX to ensure
  it is long enough for any filename with path.  Also reduced the number of
  container fileset buckets from a rediculus 180,000 to 1023.
  
  JIRA AST-618
  
  Review: https://reviewboard.asterisk.org/r/1378/
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/10@334297 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-09-02 17:15:08 +00:00
Richard Mudgett dc7d36333c Merged revisions 333784-333785 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.8

........
  r333784 | rmudgett | 2011-08-29 16:05:43 -0500 (Mon, 29 Aug 2011) | 2 lines
  
  Fix deadlock potential of chan_mobile.c:mbl_ast_hangup().
........
  r333785 | rmudgett | 2011-08-29 16:06:16 -0500 (Mon, 29 Aug 2011) | 1 line
  
  Add some do not hold locks notes to channel.h
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/10@333786 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-08-29 21:12:29 +00:00
Matthew Jordan be5c67401d Merged revisions 332817 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.8

........
  r332817 | mjordan | 2011-08-22 13:15:51 -0500 (Mon, 22 Aug 2011) | 4 lines
  
  Review: https://reviewboard.asterisk.org/r/1364/
  
  This update adds a new AMI event, TestEvent, which is enabled when the TEST_FRAMEWORK compiler flag is defined.  It also adds initial usage of this event to app_voicemail.  The TestEvent AMI event is used extensively by the voicemail tests in the Asterisk Test Suite.
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/10@332832 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-08-22 18:40:33 +00:00
Matthew Nicholson f3c6244fa9 add a way to disable and/or modify the gateway timeout
ASTERISK-18219


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/10@332756 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-08-22 16:29:45 +00:00
Tilghman Lesher 753ed11149 Merged revisions 332355 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.8

........
  r332355 | tilghman | 2011-08-17 14:21:36 -0500 (Wed, 17 Aug 2011) | 10 lines
  
  Re-add support for spaces in pathnames, including now spaces in DESTDIR.
  
  This was initially added to 1.8 prior to release, primarily to support the
  standard paths on Mac OS X, but was partially reverted recently in Subversion,
  due to the lack of support for spaces in DESTDIR.  This commit restores support
  for the standard paths on Mac OS X, and also includes support for spaces in
  DESTDIR.

  (closes issue ASTERISK-18290)
  Reported by: pabelanger
  
  Review: https://reviewboard.asterisk.org/r/1326/
........


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/10@332369 65c4cc65-6c06-0410-ace0-fbb531ad65f3
2011-08-17 19:24:59 +00:00