bool_t linphone_call_get_authentication_token_verified(LinphoneCall *call){
return call->auth_token_verified;
}
-bool_t linphone_call_are_all_streams_encrypted(LinphoneCall *call) {
+
+static bool_t linphone_call_are_all_streams_encrypted(LinphoneCall *call) {
// Check ZRTP encryption in audiostream
if (!call->audiostream_encrypted) {
return FALSE;
}
void propagate_encryption_changed(LinphoneCall *call){
- if (call->core->vtable.call_encryption_changed == NULL) return;
-
+ LinphoneCore *lc=call->core;
if (!linphone_call_are_all_streams_encrypted(call)) {
ms_message("Some streams are not encrypted");
- call->core->vtable.call_encryption_changed(call->core, call, FALSE, call->auth_token);
+ if (lc->vtable.call_encryption_changed)
+ lc->vtable.call_encryption_changed(call->core, call, FALSE, call->auth_token);
} else {
ms_message("All streams are encrypted");
- call->core->vtable.call_encryption_changed(call->core, call, TRUE, call->auth_token);
+ call->current_params.media_encryption=LinphoneMediaEncryptionZRTP;
+ if (lc->vtable.call_encryption_changed)
+ lc->vtable.call_encryption_changed(call->core, call, TRUE, call->auth_token);
}
}
LinphoneCall *call = (LinphoneCall *)data;
call->audiostream_encrypted=encrypted;
-
+
if (encrypted && call->core->vtable.display_status != NULL) {
snprintf(status,sizeof(status)-1,_("Authentication token is %s"),call->auth_token);
call->core->vtable.display_status(call->core, status);
return cp->has_video;
}
-enum LinphoneMediaEncryption linphone_call_params_get_media_encryption(LinphoneCallParams *cp) {
+enum LinphoneMediaEncryption linphone_call_params_get_media_encryption(const LinphoneCallParams *cp) {
return cp->media_encryption;
}
call->playing_ringbacktone=send_ringbacktone;
call->up_bw=linphone_core_get_upload_bandwidth(lc);
- if (ortp_zrtp_available()) {
+ if (call->params.media_encryption==LinphoneMediaEncryptionZRTP) {
OrtpZrtpParams params;
+ /*will be set later when zrtp is activated*/
+ call->current_params.media_encryption=LinphoneMediaEncryptionNone;
+
params.zid=get_hexa_zrtp_identifier(lc);
params.zid_file=lc->zrtp_secrets_cache;
audio_stream_enable_zrtp(call->audiostream,¶ms);
GtkWidget *container=linphone_gtk_get_widget(callview,"in_call_animation");
GList *elem=gtk_container_get_children(GTK_CONTAINER(container));
GtkWidget *image;
- if (!is_stock)
+
+ if (!is_stock){
+ if (image_name==NULL){
+ gtk_widget_hide(container);
+ }
image=create_pixmap(image_name);
- else
+ }else
image=gtk_image_new_from_stock(image_name,GTK_ICON_SIZE_DIALOG);
if (elem)
gtk_widget_destroy((GtkWidget*)elem->data);
gtk_widget_show(image);
gtk_container_add(GTK_CONTAINER(container),image);
-
+ gtk_widget_show_all(container);
}
static void linphone_gtk_in_call_set_animation_spinner(GtkWidget *callview){
gtk_widget_destroy((GtkWidget*)elem->data);
gtk_widget_show(spinner);
gtk_container_add(GTK_CONTAINER(container),spinner);
+ gtk_widget_set_size_request(spinner, 20,20);
gtk_spinner_start(GTK_SPINNER(spinner));
}
}
}
+static void linphone_gtk_in_call_view_show_encryption(LinphoneCall *call){
+ GtkWidget *callview=(GtkWidget*)linphone_call_get_user_pointer(call);
+ GtkWidget *encryption_box=linphone_gtk_get_widget(callview,"encryption_box");
+ GtkWidget *label=linphone_gtk_get_widget(callview,"encryption_label");
+ LinphoneMediaEncryption me=linphone_call_params_get_media_encryption(linphone_call_get_current_params(call));
+ switch(me){
+ case LinphoneMediaEncryptionSRTP:
+ gtk_label_set_markup(GTK_LABEL(label),_("Secured by SRTP"));
+ gtk_widget_show_all(encryption_box);
+ break;
+ case LinphoneMediaEncryptionZRTP:
+ {
+ gchar *text=g_strdup_printf(_("Secured by ZRTP - [auth token: %s]"),linphone_call_get_authentication_token(call));
+ gtk_label_set_markup(GTK_LABEL(label),text);
+ g_free(text);
+ gtk_widget_show_all(encryption_box);
+ }
+ break;
+ default:
+ gtk_widget_hide(encryption_box);
+ }
+}
+
void linphone_gtk_in_call_view_set_in_call(LinphoneCall *call){
GtkWidget *callview=(GtkWidget*)linphone_call_get_user_pointer(call);
GtkWidget *status=linphone_gtk_get_widget(callview,"in_call_status");
g_object_set_data(G_OBJECT(callview),"taskid",GINT_TO_POINTER(taskid));
}
linphone_gtk_in_call_view_enable_audio_view(call, !in_conf);
+ linphone_gtk_in_call_view_show_encryption(call);
if (in_conf) linphone_gtk_set_in_conference(call);
}
<?xml version="1.0" encoding="UTF-8"?>
<interface>
- <requires lib="gtk+" version="2.16"/>
- <!-- interface-naming-policy toplevel-contextual -->
+ <requires lib="gtk+" version="2.24"/>
<object class="GtkWindow" id="dummy_conf_window">
<property name="can_focus">False</property>
<child>
<property name="visible">True</property>
<property name="can_focus">False</property>
<child>
- <object class="GtkHBox" id="incall_hbox1">
+ <object class="GtkVBox" id="in_call_animation">
<property name="visible">True</property>
<property name="can_focus">False</property>
<child>
- <object class="GtkVBox" id="in_call_animation">
+ <placeholder/>
+ </child>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkLabel" id="in_call_uri">
+ <property name="visible">True</property>
+ <property name="can_focus">False</property>
+ <property name="label" translatable="yes">label</property>
+ <property name="justify">center</property>
+ </object>
+ <packing>
+ <property name="expand">True</property>
+ <property name="fill">True</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkHBox" id="encryption_box">
+ <property name="can_focus">False</property>
+ <child>
+ <object class="GtkImage" id="image12">
<property name="visible">True</property>
<property name="can_focus">False</property>
- <child>
- <placeholder/>
- </child>
+ <property name="stock">gtk-dialog-authentication</property>
+ <property name="icon-size">1</property>
</object>
<packing>
- <property name="expand">True</property>
- <property name="fill">True</property>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
<property name="position">0</property>
</packing>
</child>
<child>
- <object class="GtkLabel" id="in_call_uri">
+ <object class="GtkLabel" id="encryption_label">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">label</property>
- <property name="justify">center</property>
</object>
<packing>
<property name="expand">True</property>
<property name="position">1</property>
</packing>
</child>
+ <child>
+ <placeholder/>
+ </child>
</object>
<packing>
- <property name="expand">True</property>
- <property name="fill">True</property>
- <property name="position">0</property>
+ <property name="expand">False</property>
+ <property name="fill">False</property>
+ <property name="position">2</property>
</packing>
</child>
<child>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
- <property name="position">1</property>
+ <property name="position">3</property>
</packing>
</child>
<child>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
- <property name="position">2</property>
+ <property name="position">4</property>
</packing>
</child>
<child>
<packing>
<property name="expand">False</property>
<property name="fill">False</property>
- <property name="position">3</property>
+ <property name="position">5</property>
</packing>
</child>
</object>
<property name="invisible_char">●</property>
<property name="primary_icon_activatable">False</property>
<property name="secondary_icon_activatable">False</property>
- <property name="primary_icon_sensitive">True</property>
- <property name="secondary_icon_sensitive">True</property>
<signal name="activate" handler="linphone_gtk_uri_bar_activate" swapped="no"/>
</object>
<packing>
<property name="invisible_char_set">True</property>
<property name="primary_icon_activatable">False</property>
<property name="secondary_icon_activatable">False</property>
- <property name="primary_icon_sensitive">True</property>
- <property name="secondary_icon_sensitive">True</property>
<signal name="changed" handler="linphone_gtk_show_friends" swapped="no"/>
</object>
<packing>
<object class="GtkScrolledWindow" id="scrolledwindow1">
<property name="visible">True</property>
<property name="can_focus">True</property>
- <property name="hscrollbar_policy">automatic</property>
- <property name="vscrollbar_policy">automatic</property>
<child>
<object class="GtkTreeView" id="contact_list">
<property name="visible">True</property>
<signal name="cursor-changed" handler="linphone_gtk_contact_clicked" swapped="no"/>
<signal name="row-activated" handler="linphone_gtk_contact_activated" swapped="no"/>
<signal name="popup-menu" handler="linphone_gtk_popup_contact_menu" swapped="no"/>
+ <child internal-child="selection">
+ <object class="GtkTreeSelection" id="treeview-selection1"/>
+ </child>
</object>
</child>
</object>
<property name="invisible_char_set">True</property>
<property name="primary_icon_activatable">False</property>
<property name="secondary_icon_activatable">False</property>
- <property name="primary_icon_sensitive">True</property>
- <property name="secondary_icon_sensitive">True</property>
<signal name="activate" handler="linphone_gtk_directory_search_activate" swapped="no"/>
<signal name="icon-press" handler="linphone_gtk_directory_search_activate" swapped="no"/>
<signal name="focus-in-event" handler="linphone_gtk_directory_search_focus_in" swapped="no"/>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="hscrollbar_policy">never</property>
- <property name="vscrollbar_policy">automatic</property>
<child>
<object class="GtkTreeView" id="logs_view">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="headers_visible">False</property>
<signal name="row-activated" handler="linphone_gtk_history_row_activated" swapped="no"/>
+ <child internal-child="selection">
+ <object class="GtkTreeSelection" id="treeview-selection2"/>
+ </child>
</object>
</child>
</object>
<property name="invisible_char">●</property>
<property name="primary_icon_activatable">False</property>
<property name="secondary_icon_activatable">False</property>
- <property name="primary_icon_sensitive">True</property>
- <property name="secondary_icon_sensitive">True</property>
</object>
<packing>
<property name="left_attach">1</property>
<property name="invisible_char">●</property>
<property name="primary_icon_activatable">False</property>
<property name="secondary_icon_activatable">False</property>
- <property name="primary_icon_sensitive">True</property>
- <property name="secondary_icon_sensitive">True</property>
</object>
<packing>
<property name="left_attach">1</property>