res_pjsip: Log IPv6 addresses correctly
authorSean Bright <sean.bright@gmail.com>
Fri, 7 Sep 2018 14:40:05 +0000 (10:40 -0400)
committerSean Bright <sean.bright@gmail.com>
Fri, 14 Sep 2018 19:59:23 +0000 (14:59 -0500)
commit07cb13f75f65d3a359f20d7163e464f3305b0830
tree71baf443f302e7c4cc772e46d60f4bb676cfa846
parent8be6998f8d30d5b34bd98bb030edee4f33a74869
res_pjsip: Log IPv6 addresses correctly

Both pjsip_tx_data.tp_info.dst_name and pjsip_rx_data.pkt_info.src_name
store IPv6 addresses without enclosing brackets. This causes some log
output to be confusing because it is difficult to separate the IPv6
address from a port specification.

* Use pj_sockaddr_print() along with pjsip_tx_data.tp_info.dst_addr and
  pjsip_rx_data.pkt_info.src_addr where possible for consistent IPv6
  output.

* When a pj_sockaddr is not available, explicitly wrap IPv6 addresses
  in brackets.

* When assigning pjsip_rx_data.pkt_info.src_name ourselves, make sure
  to also set pjsip_rx_data.pkt_info.src_addr.

Change-Id: I5cfe997ced7883862a12b9c7d8551d76ae02fcf8
include/asterisk/netsock2.h
res/res_pjsip.c
res/res_pjsip/pjsip_distributor.c
res/res_pjsip_logger.c
res/res_pjsip_outbound_authenticator_digest.c
res/res_pjsip_session.c
res/res_pjsip_transport_websocket.c