ARI: Correct error codes for bridge operations

This patch adds error checking to ARI bridge operations, when
adding/removing channels to/from bridges.

In general, the error codes fall out as follows:
 * Bridge not found - 404 Not Found
 * Bridge not in Stasis - 409 Conflict
 * Channel not found - 400 Bad Request
 * Channel not in Stasis - 422 Unprocessable Entity
 * Channel not in this bridge (on remove) - 422 Unprocessable Entity

(closes issue ASTERISK-22036)
Review: https://reviewboard.asterisk.org/r/2769/


git-svn-id: http://svn.asterisk.org/svn/asterisk/trunk@397565 f38db490-d61c-443f-a65b-d21fe96a405b
PSJIP - sip.conf to res_sip.conf script

Most, if not all, of the backing features of a conf file should now be
implemented (e.g. multi-line comments, includes, templates, etc...).  A
few of the options still need to be mapped.  Those are currently listed
in the 'sip_to_res_sip.py' file.

Things to do:

(1) There is more work to do here, at least for the sip.conf items that
aren't currently parsed. An issue will be created for that.
(2) All of the scripts should probably be passed through pylint and have
as many PEP8 issues fixed as possible.
(3) A public review is probably warranted at that point of the entire script.

Reported by: Matt Jordan


git-svn-id: http://svn.asterisk.org/svn/asterisk/trunk@397567 f38db490-d61c-443f-a65b-d21fe96a405b
Prevent seg fault in off nominal path when registered option fails to validate

If an option is registered to a type and it is the last known type in the list
of registered types, and the option fails to register, an overrun of the types
array can occur due to the index variable having been already incremented.



git-svn-id: http://svn.asterisk.org/svn/asterisk/trunk@397568 f38db490-d61c-443f-a65b-d21fe96a405b
Fix memory corruption when trying to get "core show locks".

Review https://reviewboard.asterisk.org/r/2580/ tried to fix the mismatch
in memory pools but had a math error determining the buffer size and
didn't address other similar memory pool mismatches.

* Effectively reverted the previous patch to go in the same direction as
trunk for the returned memory pool of ast_bt_get_symbols().

* Fixed memory leak in ast_bt_get_symbols() when BETTER_BACKTRACES is
defined.

* Fixed some formatting in ast_bt_get_symbols().

* Fixed sig_pri.c freeing memory allocated by libpri when MALLOC_DEBUG is
enabled.

* Fixed __dump_backtrace() freeing memory from ast_bt_get_symbols() when
MALLOC_DEBUG is enabled.

* Moved __dump_backtrace() because of compile issues with the utils
directory.

(closes issue ASTERISK-22221)
Reported by: Matt Jordan

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

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

Merged revisions 397528 from http://svn.asterisk.org/svn/asterisk/branches/11


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