sip: Do not fail if CallsNetworkWatch is unavailable
In this case network changes will not be detected. Additionally fall back to binding on all network interfaces (in this case a user will have problems when using multiple network interfaces, but there is really not much we can do without a functioning CallsNetworkWatch).
This commit is contained in:
@@ -803,9 +803,11 @@ setup_nua (CallsSipOrigin *self)
|
|||||||
|
|
||||||
if (!sip_test_env || sip_test_env[0] == '\0') {
|
if (!sip_test_env || sip_test_env[0] == '\0') {
|
||||||
CallsNetworkWatch *nw = calls_network_watch_get_default ();
|
CallsNetworkWatch *nw = calls_network_watch_get_default ();
|
||||||
|
if (nw) {
|
||||||
ipv4_bind = calls_network_watch_get_ipv4 (nw);
|
ipv4_bind = calls_network_watch_get_ipv4 (nw);
|
||||||
ipv6_bind = calls_network_watch_get_ipv6 (nw);
|
ipv6_bind = calls_network_watch_get_ipv6 (nw);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
uuid = nua_generate_instance_identifier (self->ctx->home);
|
uuid = nua_generate_instance_identifier (self->ctx->home);
|
||||||
urn_uuid = g_strdup_printf ("urn:uuid:%s", uuid);
|
urn_uuid = g_strdup_printf ("urn:uuid:%s", uuid);
|
||||||
@@ -1461,9 +1463,14 @@ calls_sip_origin_init (CallsSipOrigin *self)
|
|||||||
{
|
{
|
||||||
const char *sip_test_env = g_getenv ("CALLS_SIP_TEST");
|
const char *sip_test_env = g_getenv ("CALLS_SIP_TEST");
|
||||||
|
|
||||||
if (!sip_test_env || sip_test_env[0] == '\0')
|
if (!sip_test_env || sip_test_env[0] == '\0') {
|
||||||
|
CallsNetworkWatch *nw = calls_network_watch_get_default ();
|
||||||
|
if (nw)
|
||||||
g_signal_connect_swapped (calls_network_watch_get_default (), "network-changed",
|
g_signal_connect_swapped (calls_network_watch_get_default (), "network-changed",
|
||||||
G_CALLBACK (on_network_changed), self);
|
G_CALLBACK (on_network_changed), self);
|
||||||
|
else
|
||||||
|
g_warning ("Network watch unavailable. Unable to detect network changes.");
|
||||||
|
}
|
||||||
|
|
||||||
self->call_handles = g_hash_table_new (NULL, NULL);
|
self->call_handles = g_hash_table_new (NULL, NULL);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user