mirror of
https://gitlab.gnome.org/GNOME/calls.git
synced 2025-01-07 12:25:31 +00:00
sip: fix infinite ringtone loop
by making sure the call-added signal is emitted early enough
so that all consumers (display, ringer, etc) have a chance of getting
notified when the call state changes from f.e. DIALING to DISCONNECTED
similar to how its done in 03d960ccaf
for the dummy provider.
This commit is contained in:
parent
17ac56fe44
commit
8a6f1bb203
2 changed files with 10 additions and 15 deletions
|
@ -140,8 +140,6 @@ hang_up (CallsCall *call)
|
||||||
default:
|
default:
|
||||||
g_warning ("Hanging up not possible in state %d", self->state);
|
g_warning ("Hanging up not possible in state %d", self->state);
|
||||||
}
|
}
|
||||||
|
|
||||||
calls_sip_call_set_state (self, CALLS_CALL_STATE_DISCONNECTED);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
|
|
@ -280,11 +280,7 @@ sip_i_state (int status,
|
||||||
state = CALLS_CALL_STATE_DISCONNECTED;
|
state = CALLS_CALL_STATE_DISCONNECTED;
|
||||||
|
|
||||||
g_hash_table_remove (origin->call_handles, nh);
|
g_hash_table_remove (origin->call_handles, nh);
|
||||||
|
break;
|
||||||
calls_sip_call_set_state (call, state);
|
|
||||||
g_object_unref (G_OBJECT (call));
|
|
||||||
|
|
||||||
return;
|
|
||||||
|
|
||||||
default:
|
default:
|
||||||
return;
|
return;
|
||||||
|
@ -649,6 +645,7 @@ remove_call (CallsSipOrigin *self,
|
||||||
self->oper->call_handle = NULL;
|
self->oper->call_handle = NULL;
|
||||||
|
|
||||||
g_signal_emit_by_name (origin, "call-removed", call, reason);
|
g_signal_emit_by_name (origin, "call-removed", call, reason);
|
||||||
|
g_object_unref (call);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -717,8 +714,16 @@ add_call (CallsSipOrigin *self,
|
||||||
|
|
||||||
self->oper->call_handle = handle;
|
self->oper->call_handle = handle;
|
||||||
|
|
||||||
|
self->calls = g_list_append (self->calls, sip_call);
|
||||||
g_hash_table_insert (self->call_handles, handle, sip_call);
|
g_hash_table_insert (self->call_handles, handle, sip_call);
|
||||||
|
|
||||||
|
call = CALLS_CALL (sip_call);
|
||||||
|
|
||||||
|
g_signal_emit_by_name (CALLS_ORIGIN (self), "call-added", call);
|
||||||
|
g_signal_connect_swapped (call, "state-changed",
|
||||||
|
G_CALLBACK (on_call_state_changed_cb),
|
||||||
|
self);
|
||||||
|
|
||||||
if (!inbound) {
|
if (!inbound) {
|
||||||
calls_sip_call_setup_local_media (sip_call, local_port, local_port + 1);
|
calls_sip_call_setup_local_media (sip_call, local_port, local_port + 1);
|
||||||
|
|
||||||
|
@ -739,14 +744,6 @@ add_call (CallsSipOrigin *self,
|
||||||
SOATAG_RTP_SELECT (SOA_RTP_SELECT_ALL),
|
SOATAG_RTP_SELECT (SOA_RTP_SELECT_ALL),
|
||||||
TAG_END ());
|
TAG_END ());
|
||||||
}
|
}
|
||||||
call = CALLS_CALL (sip_call);
|
|
||||||
g_signal_connect_swapped (call, "state-changed",
|
|
||||||
G_CALLBACK (on_call_state_changed_cb),
|
|
||||||
self);
|
|
||||||
|
|
||||||
self->calls = g_list_append (self->calls, sip_call);
|
|
||||||
|
|
||||||
g_signal_emit_by_name (CALLS_ORIGIN (self), "call-added", call);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue