Fix some tests that didn't get opaquification changes

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


git-svn-id: http://svn.asterisk.org/svn/asterisk/trunk@356397 f38db490-d61c-443f-a65b-d21fe96a405b
Multiple revisions 356290,356335,356337

........
  r356290 | pabelanger | 2012-02-22 15:20:29 -0500 (Wed, 22 Feb 2012) | 4 lines
  
  Fix -Werror=unused-but-set-variable compiler error (gcc 4.6.2)
  
  Review: https://reviewboard.asterisk.org/r/1763/
........
  r356335 | pabelanger | 2012-02-22 16:29:25 -0500 (Wed, 22 Feb 2012) | 2 lines
  
  Add back strsep() function for previous commit
........
  r356337 | pabelanger | 2012-02-22 16:36:37 -0500 (Wed, 22 Feb 2012) | 2 lines
  
  Missed one strsep() function
........

Merged revisions 356290,356335,356337 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........

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


git-svn-id: http://svn.asterisk.org/svn/asterisk/trunk@356429 f38db490-d61c-443f-a65b-d21fe96a405b
Blocked revisions 356431

........
Fix -Werror=unused-but-set-variable compiler error (gcc 4.6.2)
........

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


git-svn-id: http://svn.asterisk.org/svn/asterisk/trunk@356432 f38db490-d61c-443f-a65b-d21fe96a405b
Fix ACK routing for non-2xx responses.

When we send an ACK for a 2xx response to an INVITE, we are supposed
to use the learned route set. However, when we receive a non-2xx final
response to an INVITE, we are supposed to send the ACK to the same place
we initially sent the INVITE.

We had been doing this up until the changes went in that would build a route
set from provisional responses. That introduced a regression where we would
use the learned route set under all circumstances.

With this change, we now will set the destination of our ACK based on the
invitestate. If it is INV_COMPLETED then that means that we have received
a non-2xx final response (INV_TERMINATED indicates a 2xx response was received).
If it is INV_CANCELLED, then that means the call is being canceled, which
means that we should be ACKing a 487 response.

The other change introduced here is setting the invitestate to INV_CONFIRMED
when we send an ACK *after* the reqprep instead of before. This way, we can
tell in reqprep more easily what the invitestate is prior to sending the ACK.

(closes issue ASTERISK-19389)
reported by Karsten Wemheuer
patches:
    ASTERISK-19389v2.patch uploaded by Mark Michelson (license #5049)
	(with some slight modifications prior to commit)
........

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

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


git-svn-id: http://svn.asterisk.org/svn/asterisk/trunk@356477 f38db490-d61c-443f-a65b-d21fe96a405b
Fix blind transfer parking issues if the dialed extension is not recognized as a parking extension.

Custom parking extensions may not be coded such that the first and only
extension priority is the Park application.  These custom parking
extensions will not be recognized as parking extensions.  When a call is
blind transferred to an extension that is not recognized as a parking
extension, the normal blind transfer code causes the transferred channel
to start executing dialplan.  Calls that get parked in this manner do not
know the original channel name that parked the call so the original parker
could never be called back if the parked call is not retrieved before the
timeout time.  The parking space is also announced to the call being
parked as a side effect of not knowing the original parking channel.

* Fix handling of BLINDTRANSFER channel variable for call parking.

* Fixed SIP blind transfer using the wrong dialplan context variable to
check for the parking extension.

(closes issue ASTERISK-19322)
Reported by: aragon
Tested by: rmudgett, jparker

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

JIRA AST-766
........

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

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


git-svn-id: http://svn.asterisk.org/svn/asterisk/trunk@356523 f38db490-d61c-443f-a65b-d21fe96a405b
Opaquification for ast_format structs in struct ast_channel

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


git-svn-id: http://svn.asterisk.org/svn/asterisk/trunk@356573 f38db490-d61c-443f-a65b-d21fe96a405b
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: http://svn.asterisk.org/svn/asterisk/trunk@356606 f38db490-d61c-443f-a65b-d21fe96a405b
Remove srtp_shutdown from res_srtp

The patch for ASTERISK-19253 included properly shutting down the libsrtp
library in the case of module unload.  Unfortunately, not all distributions
have the srtp_shutdown call.  As such, this patch removes calling
srtp_shutdown.
........

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

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


git-svn-id: http://svn.asterisk.org/svn/asterisk/trunk@356652 f38db490-d61c-443f-a65b-d21fe96a405b
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: http://svn.asterisk.org/svn/asterisk/trunk@356697 f38db490-d61c-443f-a65b-d21fe96a405b
astobj2.h documentation updates.

git-svn-id: http://svn.asterisk.org/svn/asterisk/trunk@356734 f38db490-d61c-443f-a65b-d21fe96a405b
astobj2.h comment tweaks.

git-svn-id: http://svn.asterisk.org/svn/asterisk/trunk@356765 f38db490-d61c-443f-a65b-d21fe96a405b
Fix crash in app_voicemail during close_mailbox

In r354890, a memory leak in app_voicemail was fixed by properly disposing of
the allocated heard/deleted pointers.  However, there are situations,
particularly when no messages are found in a folder, where these pointers are
not allocated and not NULL.  In that case, an invalid free would be attempted,
which could crash app_voicemail.  As there are a number of code paths where
this could occur, this patch uses the number of messages detected in the folder
before it attempts to free the pointers.  This resolves the crash detected in
the Asterisk Test Suite's check_voicemail_nominal test.
........

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

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


git-svn-id: http://svn.asterisk.org/svn/asterisk/trunk@356799 f38db490-d61c-443f-a65b-d21fe96a405b
Add support change gatekeeper mode or ip per ooh323 reload command

(issue ASTERISK-19298)
Reported by: Dmitry Melekhov
Patches:
        change_gk_on_reload-1.patch (License #5415)



git-svn-id: http://svn.asterisk.org/svn/asterisk/trunk@356848 f38db490-d61c-443f-a65b-d21fe96a405b
Remove trailing whitespace

git-svn-id: http://svn.asterisk.org/svn/asterisk/trunk@356881 f38db490-d61c-443f-a65b-d21fe96a405b
Prefer ast_set_qos() over ast_netsock_set_qos()

git-svn-id: http://svn.asterisk.org/svn/asterisk/trunk@356882 f38db490-d61c-443f-a65b-d21fe96a405b
Correct typo in deprecation comment.

git-svn-id: http://svn.asterisk.org/svn/asterisk/trunk@356883 f38db490-d61c-443f-a65b-d21fe96a405b
Make ast_netsock_set_qos() delegate to ast_set_qos().

git-svn-id: http://svn.asterisk.org/svn/asterisk/trunk@356916 f38db490-d61c-443f-a65b-d21fe96a405b
Remove possible segfaults from res_odbc by adding locks around usage of odbc handle

(closes issue ASTERISK-19011)
Reported by: Walter Doekes
Patches:
	issueA19011_combine_read_and_write_locks_WORK_IN_PROGRESS.patch uploaded by Walter Doekes (license 5674)
review: https://reviewboard.asterisk.org/r/1719/
review: https://reviewboard.asterisk.org/r/1622/
........

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

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


git-svn-id: http://svn.asterisk.org/svn/asterisk/trunk@356962 f38db490-d61c-443f-a65b-d21fe96a405b
Copy CDR variables when set during a bridge

This patch makes sure amaflags, accountcode, and userfield get copied
to the bridge CDR when set during a bridge (like via a custom feature).

(closes issue ASTERISK-16990)
Review: https://reviewboard.asterisk.org/r/1721/
........

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

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


git-svn-id: http://svn.asterisk.org/svn/asterisk/trunk@356965 f38db490-d61c-443f-a65b-d21fe96a405b
There isn't much point in saving off and restoring a value that we never use again.


git-svn-id: http://svn.asterisk.org/svn/asterisk/trunk@356966 f38db490-d61c-443f-a65b-d21fe96a405b