1
0
Fork 0
mirror of https://gitlab.gnome.org/GNOME/calls.git synced 2025-01-07 12:25:31 +00:00

sip: origin: Codestyle

This commit is contained in:
Evangelos Ribeiro Tzaras 2021-12-21 08:26:16 +01:00
parent f995f5745b
commit 69b615a2c2

View file

@ -200,9 +200,7 @@ on_call_state_changed (CallsSipOrigin *self,
g_assert (CALLS_IS_CALL (call)); g_assert (CALLS_IS_CALL (call));
if (new_state != CALLS_CALL_STATE_DISCONNECTED) if (new_state != CALLS_CALL_STATE_DISCONNECTED)
{ return;
return;
}
remove_call (self, call, "Disconnected"); remove_call (self, call, "Disconnected");
} }
@ -359,12 +357,10 @@ sip_authenticate (CallsSipOrigin *self,
if (www_auth) { if (www_auth) {
scheme = www_auth->au_scheme; scheme = www_auth->au_scheme;
realm = msg_params_find (www_auth->au_params, "realm="); realm = msg_params_find (www_auth->au_params, "realm=");
} } else if (proxy_auth) {
else if (proxy_auth) {
scheme = proxy_auth->au_scheme; scheme = proxy_auth->au_scheme;
realm = msg_params_find (proxy_auth->au_params, "realm="); realm = msg_params_find (proxy_auth->au_params, "realm=");
} } else {
else {
g_warning ("No authentication context found"); g_warning ("No authentication context found");
return; return;
} }
@ -394,19 +390,14 @@ sip_r_invite (int status,
/* TODO call states (see i_state) */ /* TODO call states (see i_state) */
if (status == 401 || status == 407) { if (status == 401 || status == 407) {
sip_authenticate (origin, nh, sip); sip_authenticate (origin, nh, sip);
} } else if (status == 403) {
else if (status == 403) {
g_warning ("Response to outgoing INVITE: 403 wrong credentials?"); g_warning ("Response to outgoing INVITE: 403 wrong credentials?");
} } else if (status == 904) {
else if (status == 904) {
g_warning ("Response to outgoing INVITE: 904 unmatched challenge." g_warning ("Response to outgoing INVITE: 904 unmatched challenge."
"Possibly the challenge was already answered?"); "Possibly the challenge was already answered?");
} } else if (status == 180) {
else if (status == 180) { } else if (status == 100) {
} } else if (status == 200) {
else if (status == 100) {
}
else if (status == 200) {
} }
} }
@ -657,10 +648,9 @@ sip_callback (nua_event_t event,
if (op->call_handle) { if (op->call_handle) {
nua_respond (nh, 486, NULL, TAG_END ()); nua_respond (nh, 486, NULL, TAG_END ());
g_debug ("Cannot handle more than one call. Rejecting"); g_debug ("Cannot handle more than one call. Rejecting");
} } else {
else
create_inbound (origin, from, nh); create_inbound (origin, from, nh);
}
break; break;
case nua_r_invite: case nua_r_invite:
@ -852,8 +842,6 @@ setup_nua (CallsSipOrigin *self)
g_free (temp); g_free (temp);
} }
nua = nua_create (self->ctx->root, nua = nua_create (self->ctx->root,
sip_callback, sip_callback,
self, self,
@ -875,6 +863,7 @@ setup_nua (CallsSipOrigin *self)
return nua; return nua;
} }
static char * static char *
get_registrar_url (CallsSipOrigin *self) get_registrar_url (CallsSipOrigin *self)
{ {
@ -886,6 +875,7 @@ get_registrar_url (CallsSipOrigin *self)
return g_strconcat (self->protocol_prefix, ":", self->host, NULL); return g_strconcat (self->protocol_prefix, ":", self->host, NULL);
} }
static CallsSipHandles * static CallsSipHandles *
setup_sip_handles (CallsSipOrigin *self) setup_sip_handles (CallsSipOrigin *self)
{ {
@ -952,6 +942,7 @@ go_online (CallsAccount *account,
} }
} }
static const char * static const char *
get_address (CallsAccount *account) get_address (CallsAccount *account)
{ {