Skip to content

Commit 91719d9

Browse files
committed
basertpendpoint: add externalIPv4 and externalIPv6 parameters, similar to WebRTCEndpoint
1 parent 23524f0 commit 91719d9

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

src/gst-plugins/siprtpendpoint/kmssiprtpendpoint.c

+14-2
Original file line numberDiff line numberDiff line change
@@ -216,6 +216,20 @@ kms_sip_rtp_endpoint_set_addr (KmsSipRtpEndpoint * self)
216216
{
217217
GList *ips, *l;
218218
gboolean done = FALSE;
219+
gboolean use_ipv6;
220+
gchar *external_ip;
221+
222+
g_object_get (self, "use-ipv6", &use_ipv6, NULL);
223+
224+
g_object_get (self, use_ipv6 ? "external-ipv6" : "external-ipv4",
225+
&external_ip, NULL);
226+
227+
if (external_ip != NULL) {
228+
g_object_set (self, "addr", external_ip, NULL);
229+
g_free (external_ip);
230+
done = TRUE;
231+
return;
232+
}
219233

220234
ips = nice_interfaces_get_local_ips (FALSE);
221235
for (l = ips; l != NULL && !done; l = l->next) {
@@ -236,9 +250,7 @@ kms_sip_rtp_endpoint_set_addr (KmsSipRtpEndpoint * self)
236250
case G_SOCKET_FAMILY_IPV4:
237251
{
238252
gchar *addr_str;
239-
gboolean use_ipv6;
240253

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

0 commit comments

Comments
 (0)