1
0
Fork 0
mirror of https://gitlab.gnome.org/GNOME/calls.git synced 2024-06-24 12:49:30 +00:00

sip: origin: Handle unregistering (going offline)

and set the account state accordingly.
This commit is contained in:
Evangelos Ribeiro Tzaras 2021-06-18 19:09:00 +02:00
parent e6c7994abc
commit a803294c4a

View file

@ -475,6 +475,31 @@ sip_r_register (int status,
}
static void
sip_r_unregister (int status,
char const *phrase,
nua_t *nua,
CallsSipOrigin *origin,
nua_handle_t *nh,
CallsSipHandles *op,
sip_t const *sip,
tagi_t tags[])
{
g_debug ("response to unregistering: %03d %s", status, phrase);
if (status == 200) {
g_debug ("Unregistering successful");
origin->state = CALLS_ACCOUNT_OFFLINE;
} else {
g_warning ("Unregisterung unsuccessful: %03d %s", status, phrase);
origin->state = CALLS_ACCOUNT_UNKNOWN_ERROR;
}
g_object_notify_by_pspec (G_OBJECT (origin), props[PROP_ACC_STATE]);
}
static void
sip_i_state (int status,
char const *phrase,
@ -658,6 +683,17 @@ sip_callback (nua_event_t event,
tags);
break;
case nua_r_unregister:
sip_r_unregister (status,
phrase,
nua,
origin,
nh,
op,
sip,
tags);
break;
case nua_r_set_params:
g_debug ("response to set_params: %03d %s", status, phrase);
break;