Fix crash caused by unloading or reloading of res_http_post

When unlinking itself from the registered HTTP URIs, res_http_post could
inadvertently free all URIs registered with the HTTP server.  This patch
modifies the unregister method to only free the URI that is actually
being unregistered, as opposed to all of them.


git-svn-id: file:///sync/mirror/asterisk/branches/1.8@361803 eedb1c7a-6a47-11e1-93ee-a9c596eb3dd7
Prevent invalid access of free'd memory if DAHDI channel during an MWI event

In the MWI processing loop, when a valid event occurs the temporary caller ID
information is deallocated.  If a new DAHDI channel is successfully created,
the event is passed up to the analog_ss_thread without error and the loop
exits.  If, however, the DAHDI channel is not created, then the caller ID
struct has been free'd, and the gains reset to their previous level.  This
will almost certainly cause an invalid access to the free'd memory, either
in subsequent calls to callerid_free or calls to callerid_feed.

* Rework the -r361705 patch to better manage the cs and mtd allocated
resources.

* Fixed use of mwimonitoractive flag to be correct if the mwi_thread()
fails to start.


git-svn-id: file:///sync/mirror/asterisk/branches/1.8@361854 eedb1c7a-6a47-11e1-93ee-a9c596eb3dd7
Simplify build system architecture optimization

This change to the build system rips out any usage of PROC along with
architecture-specific optimizations in favor of using -march=native where it is
supported.  This fixes broken builds on 64bit Intel systems and results in
better optimized code on systems running GCC 4.2+.

Review: https://reviewboard.asterisk.org/r/1852/
(closes issue ASTERISK-19462)


git-svn-id: file:///sync/mirror/asterisk/branches/1.8@361955 eedb1c7a-6a47-11e1-93ee-a9c596eb3dd7
Make trunkfreq take effect when set

Previously, setting trunkfreq had no effect on initial load or on reload and
only ever used the default value.  This causes trunkfreq to be used 
appropriately on initial load and reload.

(closes issue ASTERISK-19521)
Patch-by: Jaco Kroon


git-svn-id: file:///sync/mirror/asterisk/branches/1.8@361972 eedb1c7a-6a47-11e1-93ee-a9c596eb3dd7
Send relative path named recordings to the meetme directory instead of sounds

Prior to this patch, no effort was made to parse the path name to determine a proper
destination for recordings of MeetMe's r option. This fixes that.

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


git-svn-id: file:///sync/mirror/asterisk/branches/1.8@362079 eedb1c7a-6a47-11e1-93ee-a9c596eb3dd7
Make ForkCDR e option not set end time of the newly forked CDR log

Prior to this patch, ForkCDR's e option would immediately set the end time of the forked
CDR to that of the CDR that is being terminated. This resulted in the new CDR's end time
being roughly the same as it's beginning time (which is in turn roughly the same as the
original's end time).

(closes issue ASTERISK-19164)
Reported by: Steve Davies
Patches:
	cdr_fork_end.v10.patch uploaded by Steve Davies (license 5012)



git-svn-id: file:///sync/mirror/asterisk/branches/1.8@362082 eedb1c7a-6a47-11e1-93ee-a9c596eb3dd7
Check for IO stream failures in various format's truncate/seek operations

For the formats that support seek and/or truncate operations, many of
the C library calls used to determine or set the current position indicator
in the file stream were not being checked.  In some situations, if an error 
occurred, a negative value would be returned from the library call.  This
could then be interpreted inappropriately as positional data.

This patch checks the return values from these library calls before
using them in subsequent operations.

(issue ASTERISK-19655)
Reported by: Matt Jordan

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


git-svn-id: file:///sync/mirror/asterisk/branches/1.8@362151 eedb1c7a-6a47-11e1-93ee-a9c596eb3dd7