diff --git a/src/switch_utils.c b/src/switch_utils.c index c9ae2090b6..bff05aeeb0 100644 --- a/src/switch_utils.c +++ b/src/switch_utils.c @@ -2002,11 +2002,15 @@ SWITCH_DECLARE(int) switch_cp_addr(switch_sockaddr_t *sa1, switch_sockaddr_t *sa if (ss1->sa_family != ss2->sa_family) return 0; - + + sa1->port = sa2->port; + sa1->family = sa2->family; + switch (ss1->sa_family) { case AF_INET: s1->sin_addr.s_addr = s2->sin_addr.s_addr; s1->sin_port = s2->sin_port; + return 1; case AF_INET6: if (s16->sin6_addr.s6_addr && s26->sin6_addr.s6_addr) {