Skip to content

Commit

Permalink
qualify: fix OPTIONS peer URI for IPv6
Browse files Browse the repository at this point in the history
  • Loading branch information
maximilianfridrich committed Nov 29, 2023
1 parent 06bd9b3 commit 9c0df9c
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions modules/qualify/qualify.c
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down

0 comments on commit 9c0df9c

Please sign in to comment.