Skip to content

Commit

Permalink
qualify: fix OPTIONS peer URI for IPv6 (#38)
Browse files Browse the repository at this point in the history
  • Loading branch information
maximilianfridrich authored Nov 30, 2023
1 parent 06bd9b3 commit f9ab6f1
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 f9ab6f1

Please sign in to comment.