diff -ru linphone-3.11.1/coreapi/linphonecall.c linphone-3.11.1,me/coreapi/linphonecall.c
--- linphone-3.11.1/coreapi/linphonecall.c 2017-03-02 13:58:13.000000000 +0000
+++ linphone-3.11.1,me/coreapi/linphonecall.c 2017-09-03 07:20:50.585679723 +0000
@@ -2033,6 +2033,14 @@
return linphone_address_as_string(linphone_call_get_remote_address(call));
}
+const LinphoneAddress *linphone_call_get_local_address(const LinphoneCall *call){
+ return call->dir==LinphoneCallIncoming ? call->log->to : call->log->from;
+}
+
+char *linphone_call_get_local_address_as_string(const LinphoneCall *call){
+ return linphone_address_as_string(linphone_call_get_local_address(call));
+}
+
const LinphoneAddress * linphone_call_get_diversion_address(const LinphoneCall *call){
return call->op?(const LinphoneAddress *)sal_op_get_diversion_address(call->op):NULL;
}
diff -ru linphone-3.11.1/gtk/calllogs.c linphone-3.11.1,me/gtk/calllogs.c
--- linphone-3.11.1/gtk/calllogs.c 2017-02-09 12:29:56.000000000 +0000
+++ linphone-3.11.1,me/gtk/calllogs.c 2017-09-03 07:19:30.393189569 +0000
@@ -291,7 +291,9 @@
LinphoneCallLog *cl=(LinphoneCallLog*)logs->data;
GtkTreeIter iter, iter2;
LinphoneAddress *la=linphone_call_log_get_dir(cl)==LinphoneCallIncoming ? linphone_call_log_get_from(cl) : linphone_call_log_get_to(cl);
+ LinphoneAddress *laMe=linphone_call_log_get_dir(cl)==LinphoneCallIncoming ? linphone_call_log_get_to(cl) : linphone_call_log_get_from(cl);
char *addr= linphone_address_as_string(la);
+ char *addrMe= linphone_address_as_string(laMe);
const char *display;
gchar *logtxt, *headtxt, *minutes, *seconds;
gchar quality[20];
@@ -354,14 +356,14 @@
if (status==NULL) {
headtxt=g_markup_printf_escaped("%s\t%s",display,start_date ? start_date : "");
logtxt=g_markup_printf_escaped(
- _("%s\t"
+ _("%s (me:%s)\t"
"Quality: %s\n%s\t%s\t"),
- addr, quality, minutes, seconds);
+ addr,addrMe, quality, minutes, seconds);
} else {
headtxt=g_markup_printf_escaped(_("%s\t%s"),display,start_date ? start_date : "");
logtxt=g_markup_printf_escaped(
- "%s\t"
- "\n%s",addr, status);
+ "%s (me:%s)\t"
+ "\n%s",addr,addrMe, status);
}
g_free(minutes);
g_free(seconds);
@@ -375,6 +377,7 @@
gtk_tree_store_append (store,&iter2,&iter);
gtk_tree_store_set (store,&iter2,1,logtxt,-1);
ms_free(addr);
+ ms_free(addrMe);
g_free(logtxt);
g_free(headtxt);
}
diff -ru linphone-3.11.1/gtk/incall_view.c linphone-3.11.1,me/gtk/incall_view.c
--- linphone-3.11.1/gtk/incall_view.c 2017-02-24 15:40:16.000000000 +0000
+++ linphone-3.11.1,me/gtk/incall_view.c 2017-09-03 07:23:10.387541832 +0000
@@ -538,21 +538,24 @@
gtk_widget_destroy(w);
}
-static void display_peer_name_in_label(GtkWidget *label, const LinphoneAddress *from){
+static void display_peer_name_in_label(GtkWidget *label, const LinphoneAddress *from, const LinphoneAddress *to){
const char *displayname=NULL;
- char *id;
+ char *idF;
+ char *idT;
char *uri_label;
displayname=linphone_address_get_display_name(from);
- id=linphone_address_as_string_uri_only(from);
+ idF=linphone_address_as_string_uri_only(from);
+ idT=linphone_address_as_string_uri_only(to);
if (displayname!=NULL){
- uri_label=g_markup_printf_escaped("%s\n%s",
- displayname,id);
+ uri_label=g_markup_printf_escaped("%s\n%s (me:%s)",
+ displayname,idF,idT);
}else
- uri_label=g_markup_printf_escaped("%s\n",id);
+ uri_label=g_markup_printf_escaped("from %s (me:%s)\n",idF,idT);
gtk_label_set_markup(GTK_LABEL(label),uri_label);
g_free(uri_label);
- ms_free(id);
+ ms_free(idF);
+ ms_free(idT);
}
void linphone_gtk_in_call_view_set_calling(LinphoneCall *call){
@@ -562,7 +565,7 @@
GtkWidget *duration=linphone_gtk_get_widget(callview,"in_call_duration");
gtk_label_set_markup(GTK_LABEL(status),_("Calling..."));
- display_peer_name_in_label(callee,linphone_call_get_remote_address (call));
+ display_peer_name_in_label(callee,linphone_call_get_remote_address(call),linphone_call_get_local_address(call));
gtk_label_set_text(GTK_LABEL(duration),_("00:00:00"));
linphone_gtk_in_call_set_animation_spinner(callview);
@@ -578,7 +581,7 @@
gtk_label_set_markup(GTK_LABEL(status),_("Incoming call"));
gtk_widget_show_all(linphone_gtk_get_widget(callview,"answer_decline_panel"));
gtk_widget_hide(linphone_gtk_get_widget(callview,"buttons_panel"));
- display_peer_name_in_label(callee,linphone_call_get_remote_address (call));
+ display_peer_name_in_label(callee,linphone_call_get_remote_address(call),linphone_call_get_local_address(call));
answer_button=linphone_gtk_get_widget(callview,"accept_call");
image=gtk_image_new_from_icon_name("linphone-start-call", GTK_ICON_SIZE_BUTTON);
@@ -788,7 +791,7 @@
linphone_gtk_in_call_show_video(call);
- display_peer_name_in_label(callee,linphone_call_get_remote_address (call));
+ display_peer_name_in_label(callee,linphone_call_get_remote_address(call),linphone_call_get_local_address(call));
gtk_widget_hide(linphone_gtk_get_widget(callview,"answer_decline_panel"));
gtk_label_set_markup(GTK_LABEL(status),in_conf ? _("In conference") : _("In call"));
diff -ru linphone-3.11.1/gtk/main.c linphone-3.11.1,me/gtk/main.c
--- linphone-3.11.1/gtk/main.c 2017-03-02 13:58:13.000000000 +0000
+++ linphone-3.11.1,me/gtk/main.c 2017-09-03 06:30:58.880085768 +0000
@@ -1263,6 +1263,7 @@
#ifdef HAVE_NOTIFY
char *body=NULL;
char *remote=call!=NULL ? linphone_call_get_remote_address_as_string(call) : NULL;
+ char *lclid=call ? linphone_call_get_local_address_as_string(call) : NULL;
NotifyNotification *n;
switch(linphone_call_get_state(call)){
case LinphoneCallError:
@@ -1272,7 +1273,7 @@
make_notification(_("Call ended"),body=g_markup_printf_escaped("%s",remote));
break;
case LinphoneCallIncomingReceived:
- n=build_notification(_("Incoming call"),body=g_markup_printf_escaped("%s",remote));
+ n=build_notification(_("Incoming call"),body=g_markup_printf_escaped("from %s to %s",remote,lclid));
if (n){
if (notify_actions_supported()) {
notify_notification_add_action (n,"answer", _("Answer"),
@@ -1291,6 +1292,7 @@
}
if (body) g_free(body);
if (remote) g_free(remote);
+ if (lclid) g_free(lclid);
#else
if (linphone_call_get_state(call) == LinphoneCallIncomingReceived)
show_main_window = TRUE;
diff -ru linphone-3.11.1/include/linphone/call.h linphone-3.11.1,me/include/linphone/call.h
--- linphone-3.11.1/include/linphone/call.h 2017-03-02 13:58:13.000000000 +0000
+++ linphone-3.11.1,me/include/linphone/call.h 2017-09-03 07:11:00.565155939 +0000
@@ -89,12 +89,14 @@
/**
* Returns the remote address associated to this call
**/
+LINPHONE_PUBLIC const LinphoneAddress * linphone_call_get_local_address(const LinphoneCall *call);
LINPHONE_PUBLIC const LinphoneAddress * linphone_call_get_remote_address(const LinphoneCall *call);
/**
* Returns the remote address associated to this call as a string.
* The result string must be freed by user using ms_free().
**/
+LINPHONE_PUBLIC char * linphone_call_get_local_address_as_string(const LinphoneCall *call);
LINPHONE_PUBLIC char * linphone_call_get_remote_address_as_string(const LinphoneCall *call);
/**