Fix crash in res_pjsip_outbound_registration when the remote server can not be resolved.

This crash was caused by decrementing the reference count of a newly created message when
it should not be. This change fixes that but also fixes all other cases where this was
incorrectly done.

(closes issue ASTERISK-22188)
Reported by: Kinsey Moore


git-svn-id: http://svn.asterisk.org/svn/asterisk/trunk@396319 f38db490-d61c-443f-a65b-d21fe96a405b
Fix memory leaks in the CDR engine

Fix refcount bugs and a possible locking problem in the CDR engine
relating to use of ao2_iterators.

Review: https://reviewboard.asterisk.org/r/2724/
(closes issue ASTERISK-22126)


git-svn-id: http://svn.asterisk.org/svn/asterisk/trunk@396320 f38db490-d61c-443f-a65b-d21fe96a405b
Expose res_pjsip threadpool options

Expose initial size, automatic increment, maximum size, and idle
timeout as configurable parameters for the res_pjsip thread pool.

Review: https://reviewboard.asterisk.org/r/2704/
(closes issue ASTERISK-22143)


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