Skip to content
Snippets Groups Projects
Commit a102e499 authored by pierre-luc's avatar pierre-luc
Browse files

[#2028] A minidialog is showed to the user under sflphone-client-gnome

when an error occur during zrtp negotiation.
parent 004d2d93
No related branches found
No related tags found
No related merge requests found
......@@ -153,7 +153,13 @@
<signal name="zrtpNotSuppOther">
<arg type="s" name="callID" direction="out" />
</signal>
<signal name="zrtpNegotiationFailed">
<arg type="s" name="callID" direction="out" />
<arg type="s" name="reason" direction="out" />
<arg type="s" name="severity" direction="out" />
</signal>
<signal name="confirmGoClear">
<arg type="s" name="callID" direction="out" />
</signal>
......
......@@ -67,6 +67,17 @@ incoming_call_cb (DBusGProxy *proxy UNUSED,
sflphone_incoming_call (c);
}
static void
zrtp_negotiation_failed_cb (DBusGProxy *proxy UNUSED,
const gchar* callID,
const gchar* reason,
const gchar* severity,
void * foo UNUSED )
{
DEBUG ("Zrtp negotiation failed.");
main_window_zrtp_negotiation_failed(callID, reason, severity);
}
static void
curent_selected_codec (DBusGProxy *proxy UNUSED,
const gchar* callID,
......@@ -377,6 +388,7 @@ dbus_connect ()
}
DEBUG ("DBus connected to CallManager");
/* STRING STRING STRING Marshaller */
/* Incoming call */
dbus_g_object_register_marshaller(g_cclosure_user_marshal_VOID__STRING_STRING_STRING,
G_TYPE_NONE, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_INVALID);
......@@ -385,6 +397,11 @@ dbus_connect ()
dbus_g_proxy_connect_signal (callManagerProxy,
"incomingCall", G_CALLBACK(incoming_call_cb), NULL, NULL);
dbus_g_proxy_add_signal (callManagerProxy,
"zrtpNegotiationFailed", G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_INVALID);
dbus_g_proxy_connect_signal (callManagerProxy,
"zrtpNegotiationFailed", G_CALLBACK(zrtp_negotiation_failed_cb), NULL, NULL);
/* Current codec */
dbus_g_object_register_marshaller(g_cclosure_user_marshal_VOID__STRING_STRING_STRING,
G_TYPE_NONE, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_INVALID);
......
......@@ -389,6 +389,27 @@ main_window_zrtp_not_supported(callable_obj_t * c)
}
}
void
main_window_zrtp_negotiation_failed(const gchar* callID, const gchar* reason, const gchar* severity)
{
gchar* peer_number = "(number unknown)";
callable_obj_t * c = NULL;
c = calllist_get(current_calls, callID);
if (c != NULL) {
peer_number = c->_peer_number;
}
PidginMiniDialog *mini_dialog;
gchar *desc = g_markup_printf_escaped(_("A %s error forced the call with %s to fall under unencrypted mode.\nExact reason: %s\n"), severity, peer_number, reason);
mini_dialog = pidgin_mini_dialog_new(_("ZRTP negotiation failed"), desc, GTK_STOCK_DIALOG_WARNING);
pidgin_mini_dialog_add_button(mini_dialog, _("Continue"), NULL, NULL);
pidgin_mini_dialog_add_button(mini_dialog, _("Stop Call"), sflphone_hang_up, NULL);
g_signal_connect_after(mini_dialog, "destroy", (GCallback) destroy_error_dialog_cb, c);
add_error_dialog(GTK_WIDGET(mini_dialog), c);
}
void
main_window_confirm_go_clear(callable_obj_t * c)
{
......
......@@ -104,6 +104,8 @@ gboolean focus_is_on_searchbar;
void main_window_zrtp_not_supported(callable_obj_t * c);
void main_window_zrtp_negotiation_failed(const gchar* callID, const gchar* reason, const gchar* severity);
void main_window_confirm_go_clear(callable_obj_t * c);
#endif
......@@ -195,7 +195,7 @@ namespace sfl {
else {
msg = _severeMap[subCode];
_debug("%s\n", msg->c_str());
DBusManager::instance().getCallManager()->zrtpNegotiationFailed(_sipcall->getCallId(), *msg, "SEVERE");
DBusManager::instance().getCallManager()->zrtpNegotiationFailed(_sipcall->getCallId(), *msg, "severe");
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment