res_pjsip_messaging.c: Misc cleanups and fixes.
authorRichard Mudgett <rmudgett@digium.com>
Tue, 6 Sep 2016 16:46:16 +0000 (11:46 -0500)
committerRichard Mudgett <rmudgett@digium.com>
Wed, 7 Sep 2016 21:04:33 +0000 (16:04 -0500)
commitf369dbb705fb92a410e5ffb25ace1756074ccf22
tree70368c9dc9425f81355cea725eadee9d17316ffc
parent004d3c32ba5e15d06ae709a420c6d9177c91b134
res_pjsip_messaging.c: Misc cleanups and fixes.

* Eliminated RAII_VAR in get_outbound_endpoint().

* Simplify update_to() coding.  However, this function can only be a NoOp
because the To string can only be a URI and not a name-address formatted
string.

* Simplify update_from() coding.  Also fixed a code path modifying the
from string when the caller could still want to use the original string.

* Fixed msg_data_create() incompletely removing the "pjsip:" to then add
back the "sip:" string if needed.  The code didn't handle the "pjsip:sip:"
case because it left the colon after pjsip in the string.

Change-Id: I68a09a665f6d4daa9eaa59069045ab69122e28db
res/res_pjsip_messaging.c