mirror of
https://gitlab.gnome.org/GNOME/calls.git
synced 2025-01-07 20:35:31 +00:00
sip: origin: Handle unregistering (going offline)
and set the account state accordingly.
This commit is contained in:
parent
e6c7994abc
commit
a803294c4a
1 changed files with 36 additions and 0 deletions
|
@ -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
|
static void
|
||||||
sip_i_state (int status,
|
sip_i_state (int status,
|
||||||
char const *phrase,
|
char const *phrase,
|
||||||
|
@ -658,6 +683,17 @@ sip_callback (nua_event_t event,
|
||||||
tags);
|
tags);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case nua_r_unregister:
|
||||||
|
sip_r_unregister (status,
|
||||||
|
phrase,
|
||||||
|
nua,
|
||||||
|
origin,
|
||||||
|
nh,
|
||||||
|
op,
|
||||||
|
sip,
|
||||||
|
tags);
|
||||||
|
break;
|
||||||
|
|
||||||
case nua_r_set_params:
|
case nua_r_set_params:
|
||||||
g_debug ("response to set_params: %03d %s", status, phrase);
|
g_debug ("response to set_params: %03d %s", status, phrase);
|
||||||
break;
|
break;
|
||||||
|
|
Loading…
Reference in a new issue