summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMikhail Zabaluev <mikhail.zabaluev@nokia.com>2011-02-15 13:43:28 +0200
committerMikhail Zabaluev <mikhail.zabaluev@nokia.com>2011-02-15 13:43:28 +0200
commit1e56054fc8f87fc65fd8bd032e23cfda4957ec72 (patch)
treefb44d93080f5adecf816b8be439cd7f0e0d34531 /src
parent8dcddb61752cfa140df30c94b54bd02684419323 (diff)
parent2ff3e6a357852c88c09680b3c2fef3c9eea6b5b6 (diff)
Merge branch 'stunning-fixes'
Diffstat (limited to 'src')
-rw-r--r--src/sip-connection-helpers.c19
1 files changed, 16 insertions, 3 deletions
diff --git a/src/sip-connection-helpers.c b/src/sip-connection-helpers.c
index 9fab39f..9f72ed5 100644
--- a/src/sip-connection-helpers.c
+++ b/src/sip-connection-helpers.c
@@ -516,6 +516,7 @@ rakia_conn_resolv_stun_server (RakiaConnection *conn, const gchar *stun_host)
return;
}
+ /* FIXME: support IPv6 as well */
if (inet_aton (stun_host, &test_addr))
{
rakia_conn_set_stun_server_address (conn, stun_host);
@@ -644,13 +645,25 @@ rakia_conn_discover_stun_server (RakiaConnection *conn)
{
RakiaConnectionPrivate *priv = TPSIP_CONNECTION_GET_PRIVATE (conn);
char *srv_domain;
+ struct in_addr test_addr;
+
+ g_return_if_fail (priv->account_url != NULL);
- if ((NULL == priv->account_url) || (NULL == priv->account_url->url_host))
+ url_host = priv->account_url->url_host;
+
+ if (url_host == NULL)
{
DEBUG("unknown domain, not making STUN SRV lookup");
return;
}
+ /* FIXME: support IPv6 as well */
+ if (inet_aton (url_host, &test_addr))
+ {
+ DEBUG("AOR URI has IP address, not making STUN SRV lookup");
+ return;
+ }
+
if (NULL == priv->sofia_resolver)
{
su_root_t *root = NULL;
@@ -661,9 +674,9 @@ rakia_conn_discover_stun_server (RakiaConnection *conn)
g_return_if_fail (priv->sofia_resolver != NULL);
}
- DEBUG("creating a new STUN SRV query for domain %s", priv->account_url->url_host);
+ DEBUG("creating a new STUN SRV query for domain %s", url_host);
- srv_domain = g_strdup_printf ("_stun._udp.%s", priv->account_url->url_host);
+ srv_domain = g_strdup_printf ("_stun._udp.%s", url_host);
sres_query (priv->sofia_resolver,
priv_stun_discover_cb,