1
0
Fork 0
mirror of https://gitlab.gnome.org/GNOME/calls.git synced 2025-01-06 03:25:31 +00:00

sip: use ipv4 exclusively for now

IPv6 should work, but sofia's outbound engine keep printing
errors involving the outbound engine. Working theory:
Failing ICMPv6 (pings) can make sofia think we don't have connectivity.
Note that we also don't get any answers from the SIP servers we tried so far.
This commit is contained in:
Evangelos Ribeiro Tzaras 2021-03-08 11:26:55 +01:00
parent dcff7538f2
commit de44a17fe5
4 changed files with 28 additions and 7 deletions

View file

@ -430,6 +430,9 @@ setup_nua (CallsSipOrigin *self)
g_autofree gchar *address = NULL;
nua_t *nua;
gboolean use_sips;
gboolean use_ipv6 = FALSE; /* TODO make configurable or use DNS to figure out if ipv6 is supported*/
gchar *ipv6_bind = "*";
gchar *ipv4_bind = "0.0.0.0";
g_autofree gchar * sip_url = NULL;
g_autofree gchar * sips_url = NULL;
@ -438,13 +441,21 @@ setup_nua (CallsSipOrigin *self)
address = g_strconcat (self->protocol_prefix, ":", self->user, "@", self->host, NULL);
use_sips = check_sips (address);
use_ipv6 = check_ipv6 (self->host);
if (self->local_port > 0) {
sip_url = g_strdup_printf ("sip:*:%d", self->local_port);
sips_url = g_strdup_printf ("sips:*:%d", self->local_port);
sip_url = g_strdup_printf ("sip:%s:%d",
use_ipv6 ? ipv6_bind : ipv4_bind,
self->local_port);
sips_url = g_strdup_printf ("sips:%s:%d",
use_ipv6 ? ipv6_bind : ipv4_bind,
self->local_port);
} else {
sip_url = g_strdup ("sip:*:*");
sips_url = g_strdup_printf ("sips:*:*");
sip_url = g_strdup_printf ("sip:%s:*",
use_ipv6 ? ipv6_bind : ipv4_bind);
sips_url = g_strdup_printf ("sips:%s:*",
use_ipv6 ? ipv6_bind : ipv4_bind);
}
nua = nua_create (self->ctx->root,
@ -698,6 +709,7 @@ add_call (CallsSipOrigin *self,
g_debug ("Setting local SDP for outgoing call to %s:\n%s", address, local_sdp);
/* TODO handle IPv4 vs IPv6 for nua_invite (SOATAG_TAG) */
nua_invite (self->oper->call_handle,
SOATAG_AF (SOA_AF_IP4_IP6),
SOATAG_USER_SDP_STR (local_sdp),

View file

@ -24,6 +24,14 @@
#include "calls-sip-util.h"
gboolean
check_ipv6 (const gchar *host)
{
/* TODO DNS SRV records to determine whether or not to use IPv6 */
return FALSE;
}
gboolean
check_sips (const gchar *addr)
{

View file

@ -80,6 +80,7 @@ typedef enum
gboolean check_sips (const gchar *addr);
gboolean check_ipv6 (const gchar *host);
const gchar *get_protocol_prefix (const gchar *protocol);
gboolean protocol_is_valid (const gchar *protocol);
guint get_port_for_rtp (void);

View file

@ -58,9 +58,9 @@ calls_origin_default_init (CallsOriginInterface *iface)
g_object_interface_install_property (
iface,
g_param_spec_pointer ("calls",
"Calls",
"The list of current calls",
G_PARAM_READABLE));
"Calls",
"The list of current calls",
G_PARAM_READABLE));
signals[SIGNAL_CALL_ADDED] =
g_signal_newv ("call-added",