1
0
Fork 0
mirror of https://gitlab.gnome.org/GNOME/calls.git synced 2024-11-17 07:46:03 +00:00

sip: origin: Tweak debugging

Be slightly more verbose in messages.
Demote some warnings.
Don't print empty tags.
This commit is contained in:
Evangelos Ribeiro Tzaras 2022-05-19 19:00:56 +02:00
parent b31db4a51c
commit 59c06aef44

View file

@ -452,17 +452,24 @@ sip_r_register (int status,
g_debug ("Own IP as reported by the registrar: %s", origin->own_ip); g_debug ("Own IP as reported by the registrar: %s", origin->own_ip);
} }
} else if (status == 100) {
/* nothing to do; request authorized by cache */
} else if (status == 401 || status == 407) { } else 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 ("wrong credentials?"); g_debug ("REGISTER denied: Probably using wrong credentials");
change_state (origin, change_state (origin,
CALLS_ACCOUNT_STATE_OFFLINE, CALLS_ACCOUNT_STATE_OFFLINE,
CALLS_ACCOUNT_STATE_REASON_AUTHENTICATION_FAILURE); CALLS_ACCOUNT_STATE_REASON_AUTHENTICATION_FAILURE);
} else if (status == 904) { } else if (status == 904) {
g_warning ("unmatched challenge"); g_warning ("REGISTER: unmatched challenge");
change_state (origin,
CALLS_ACCOUNT_STATE_ERROR,
CALLS_ACCOUNT_STATE_REASON_INTERNAL_ERROR);
} else {
g_warning ("REGISTER: %d %s", status, phrase);
change_state (origin, change_state (origin,
CALLS_ACCOUNT_STATE_ERROR, CALLS_ACCOUNT_STATE_ERROR,
CALLS_ACCOUNT_STATE_REASON_INTERNAL_ERROR); CALLS_ACCOUNT_STATE_REASON_INTERNAL_ERROR);
@ -487,6 +494,8 @@ sip_r_unregister (int status,
change_state (origin, change_state (origin,
CALLS_ACCOUNT_STATE_OFFLINE, CALLS_ACCOUNT_STATE_OFFLINE,
CALLS_ACCOUNT_STATE_REASON_DISCONNECTED); CALLS_ACCOUNT_STATE_REASON_DISCONNECTED);
} else if (status == 100) {
/* nothing to do; request authorized by cache */
} else { } else {
g_warning ("Unregisterung unsuccessful: %03d %s", status, phrase); g_warning ("Unregisterung unsuccessful: %03d %s", status, phrase);
change_state (origin, change_state (origin,
@ -818,13 +827,15 @@ sip_callback (nua_event_t event,
break; break;
default: default:
/* unknown event -> print out error message */ /* unknown event */
g_warning ("unknown event %d: %03d %s", g_debug ("unknown event %d: %03d %s",
event, event,
status, status,
phrase); phrase);
g_warning ("printing tags"); if (tags && tags[0].t_tag != NULL) {
tl_print (stdout, "", tags); g_debug ("printing tags");
tl_print (stdout, "", tags);
}
break; break;
} }
} }