db_mysql: fixed condition checking the parameter for db uri parsing

- on a report generated by cppcheck sent by David Binderman

(cherry picked from commit c0b2e567b2a27d5d29ede39409d6299f7d375d87)
db_postgres: fixed condition checking the parameter for db uri parsing

- on a report generated by cppcheck sent by David Binderman

(cherry picked from commit 480b6d4dfc954fbbb8afb9dbbbf17b80dcdf71ce)
xhttp: check first the possition limits then access the data

- in the eval function for the transformation
- on a report generated by cppcheck sent by David Binderman

(cherry picked from commit 79bfabdc2ae35a5b280c6a23ff611a005dac333c)
core/parse_methods: removed duplicate check for same characters

- on a report generated by cppcheck sent by David Binderman

(cherry picked from commit 935f06eb8c34fe5fe82588cdd5b4af2f68c51466)
core: avoid warning of using bitwise operator with boolean result

- on a report generated by cppcheck sent by David Binderman

(cherry picked from commit cfb815e440804c2870126c1c098362d5a117f97c)
sercmd: memset with proper size

(cherry picked from commit d0ebc7fa4b4b20bee83f57b3f0d0e6e75b5f0b08)
utils/db_berkeley: release file description in error cases

(cherry picked from commit e7a0840a1334280650d4abb865843da0072adec6)
core: test the limits of nested select level before accessing array value

(cherry picked from commit b61f173a8dc40592809912e137e42d8ffe1154fa)
db_cluster: updated the old application name in doc examples

(cherry picked from commit 32f688659fcc6f7c44d9095e585951780e277522)
topoh: don't encode/decode content for local generated messages

- requests generated by kamailio don't have headers that should be
  hidden
- replies to them don't have anything hidden
- update as part of report from FS#390

(cherry picked from commit 41f12e01b20a6b32d26297fbdf6ce17d40823ef2)
topoh: let replies for CANCEL requests be handled

- CANCEL is hop by hop, but can have the call-id hidden when sending out

(cherry picked from commit 376d8b3972d96b70d1e12cc57104475b2ee7ade8)
call_control: Passthrough sip_application

Current patches being submitted to CDRTool and the call_control daemon
allow for SIP application type to be specified. This allows audio or
video services to be rated differently, or even different ratings for
application subtypes (audio.inbound vs. audio.outbound).

This patch allows the sip_application value to be passed through to the
call_control daemon.

(cherry picked from commit 0a4519af5c1ea3f61362fba7451eb4acc479d488)
mtree: reset tree statistics upon reload

- related to FS#398, reported by JoshE

(cherry picked from commit 94bad4414b36334061ef0d3ec42747d672eaf058)
dialog: remove dialog from profile as soon as gets to terminated state

(cherry picked from commit edf61acb57ed5e8ee0ca9ec1f796e43ce993be48)
dialog: don't add dialog profiles when loading from db and state is terminated

(cherry picked from commit 9b88eb7ee2d243882383a44f601baa21fd679cd5)
mtree: enahced docs to specify that the mtree parameter can be set many times

(cherry picked from commit 0b122416932030c9459f16d46438489b115941aa)
parser/parse_fline: print offset in log message when failing to parse first line

(cherry picked from commit a111b33ae7b64dbf9486f2fc4b7f3007f4015e77)
geoip: safety check to see if the result structure is filled

- return $null if not
- reported by Juha Heinanen

(cherry picked from commit 721ffe3576e8e7891c27f8578eb244a857ede759)
tm: 487 Request Terminated has priority when transaction is cancelled and no reply received from downstream

- for cancel_b_method 1, timeout was sent back even when transaction was
  canceled

(cherry picked from commit 6c3725d5535e0b5bff5c63251d37e7139f92321c)
tm: t_continue() polishing

- variables declared at beginning of function to work on old C standard
  compilers
- log messages compacted - function name and log level are prefixed
  automatically
- stay under 80 chars per line to fit in text terminals

(cherry picked from commit 47f6cfd76a9d801a83ca14b55926d389f6c3c2da)