diff --git a/modules/qualify/qualify.c b/modules/qualify/qualify.c index b0f9d00..887190c 100644 --- a/modules/qualify/qualify.c +++ b/modules/qualify/qualify.c @@ -187,8 +187,13 @@ static int call_start_qualify(struct call *call, } (void)call_msg_src(call, &peer_addr); - err = re_snprintf(peer_uri, sizeof(peer_uri), "sip:%H:%d", - sa_print_addr, &peer_addr, sa_port(&peer_addr)); + + err = re_snprintf(peer_uri, sizeof(peer_uri), + "sip:%s%j%s:%d", + sa_af(&peer_addr) == AF_INET6 ? "[" : "", + &peer_addr, + sa_af(&peer_addr) == AF_INET6 ? "]" : "", + sa_port(&peer_addr)); if (err <= 0) { warning("qualify: failed to get peer URI for %s (%m)\n",