Ticket #2070 (closed enhancement: fixed)

Opened 13 months ago

Last modified 4 months ago

Print IPv6 addresses with brackets in the log

Reported by: ming Owned by: bennylp
Priority: normal Milestone: release-2.8
Component: common Version: trunk
Keywords: Cc:
Backport to 1.x milestone: Backported: no

Description (last modified by ming) (diff)

Currently IPv6 addresses are printed as is, i.e. without brackets, in various places such as:

pjsip/src/pjsua-lib/pjsua_core.c:logging_on_tx_msg, and
pjsip/src/pjsua-lib/pjsua_core.c:logging_on_rx_msg

pjsip/src/pjsua-lib/pjsua_acc.c:acc_check_nat_addr
with "IP address change detected for account"

pjsip/src/pjsua-lib/pjsua_acc.c:update_keep_alive
with "Keep-alive timer started for acc"

pjsip/src/pjsip/sip_transport_tcp.c:on_connect_complete
pjsip/src/pjsip/sip_transport_tls.c:on_connect_complete
with "transport %.*s:%d is connected to"

For clarity, it is desirable for these addresses to be printed with the brackets, especially if there's a port number behind it.

In the SIP message itself, we have implemented this by adding beginquote and endquote, such as in pjsua_acc.c: acc_check_nat_addr(), pjsua_acc_create_uac_contact(), pjsua_acc_create_uas_contact()

So we probably need to use pj_sockaddr_print() or create a helper new pjlib API instead of copy-pasting it all over the place.

Change History

comment:1 Changed 13 months ago by ming

  • Description modified (diff)

comment:2 Changed 5 months ago by riza

  • Status changed from new to closed
  • Resolution set to fixed

In 5833:

Close #2070: Print IPv6 addresses with brackets.

comment:3 Changed 4 months ago by riza

In 5854:

Re #2070: Missed silly mistake on log formatting.

Note: See TracTickets for help on using tickets.