Skip to content

Commit

Permalink
basertpendpoint: add externalIPv4 and externalIPv6 parameters, simila…
Browse files Browse the repository at this point in the history
…r to WebRTCEndpoint
  • Loading branch information
dpocock committed Nov 23, 2021
1 parent 23524f0 commit 91719d9
Showing 1 changed file with 14 additions and 2 deletions.
16 changes: 14 additions & 2 deletions src/gst-plugins/siprtpendpoint/kmssiprtpendpoint.c
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,20 @@ kms_sip_rtp_endpoint_set_addr (KmsSipRtpEndpoint * self)
{
GList *ips, *l;
gboolean done = FALSE;
gboolean use_ipv6;
gchar *external_ip;

g_object_get (self, "use-ipv6", &use_ipv6, NULL);

g_object_get (self, use_ipv6 ? "external-ipv6" : "external-ipv4",
&external_ip, NULL);

if (external_ip != NULL) {
g_object_set (self, "addr", external_ip, NULL);
g_free (external_ip);
done = TRUE;
return;
}

ips = nice_interfaces_get_local_ips (FALSE);
for (l = ips; l != NULL && !done; l = l->next) {
Expand All @@ -236,9 +250,7 @@ kms_sip_rtp_endpoint_set_addr (KmsSipRtpEndpoint * self)
case G_SOCKET_FAMILY_IPV4:
{
gchar *addr_str;
gboolean use_ipv6;

g_object_get (self, "use-ipv6", &use_ipv6, NULL);
if (is_ipv6 != use_ipv6) {
GST_DEBUG_OBJECT (self, "Skip address (wanted IPv6: %d)", use_ipv6);
break;
Expand Down

0 comments on commit 91719d9

Please sign in to comment.