]> sjero.net Git - linphone/blobdiff - gtk-glade/main.c
Merge branch 'master' into dev_multicall
[linphone] / gtk-glade / main.c
index 3ce841ad0bd2d97eb884375d921139e0e06c77e1..87db8fb2a4889c2c28e263003b6d981f056f0a4d 100644 (file)
@@ -42,8 +42,8 @@ static LinphoneCore *the_core=NULL;
 static GtkWidget *the_ui=NULL;
 
 static void linphone_gtk_show(LinphoneCore *lc);
-static void linphone_gtk_inv_recv(LinphoneCore *lc, const char *from);
-static void linphone_gtk_bye_recv(LinphoneCore *lc, const char *from);
+static void linphone_gtk_inv_recv(LinphoneCore *lc, LinphoneCall *call);
+static void linphone_gtk_bye_recv(LinphoneCore *lc, LinphoneCall *call);
 static void linphone_gtk_notify_recv(LinphoneCore *lc, LinphoneFriend * fid);
 static void linphone_gtk_new_unknown_subscriber(LinphoneCore *lc, LinphoneFriend *lf, const char *url);
 static void linphone_gtk_auth_info_requested(LinphoneCore *lc, const char *realm, const char *username);
@@ -54,7 +54,7 @@ static void linphone_gtk_display_url(LinphoneCore *lc, const char *msg, const ch
 static void linphone_gtk_display_question(LinphoneCore *lc, const char *question);
 static void linphone_gtk_call_log_updated(LinphoneCore *lc, LinphoneCallLog *cl);
 static void linphone_gtk_general_state(LinphoneCore *lc, LinphoneGeneralState *gstate);
-static void linphone_gtk_refer_received(LinphoneCore *lc, const char *refer_to);
+static void linphone_gtk_refer_received(LinphoneCore *lc, LinphoneCall *call, const char  *refer_to);
 static gboolean linphone_gtk_auto_answer(GtkWidget *incall_window);
 
 static LinphoneCoreVTable vtable={
@@ -390,7 +390,7 @@ static void set_video_window_decorations(GdkWindow *w){
                gdk_window_set_keep_above(w, FALSE);
        }else{
                LinphoneAddress *uri =
-                       linphone_address_clone(linphone_core_get_remote_uri(linphone_gtk_get_core()));
+                       linphone_address_clone(linphone_core_get_current_call_remote_address(linphone_gtk_get_core()));
                char *display_name;
 
                linphone_address_clean(uri);
@@ -588,7 +588,7 @@ static void linphone_gtk_call_started(GtkWidget *mw){
 
 static gboolean linphone_gtk_start_call_do(GtkWidget *uri_bar){
        const char *entered=gtk_entry_get_text(GTK_ENTRY(uri_bar));
-       if (linphone_core_invite(linphone_gtk_get_core(),entered)==0) {
+       if (linphone_core_invite(linphone_gtk_get_core(),entered)!=NULL) {
                completion_add_text(GTK_ENTRY(uri_bar),entered);
        }else{
                linphone_gtk_call_terminated(NULL);
@@ -704,10 +704,11 @@ static void linphone_gtk_show(LinphoneCore *lc){
        linphone_gtk_show_main_window();
 }
 
-static void linphone_gtk_inv_recv(LinphoneCore *lc, const char *from){
+static void linphone_gtk_inv_recv(LinphoneCore *lc, LinphoneCall *call){
        GtkWidget *w=linphone_gtk_create_window("incoming_call");
        GtkWidget *label;
        gchar *msg;
+       char *from=linphone_call_get_remote_address_as_string(call);
 
        if (auto_answer){
                g_timeout_add(2000,(GSourceFunc)linphone_gtk_auto_answer,w);
@@ -727,9 +728,10 @@ static void linphone_gtk_inv_recv(LinphoneCore *lc, const char *from){
        g_object_set_data(G_OBJECT(linphone_gtk_get_main_window()),"incoming_call",w);
        gtk_entry_set_text(GTK_ENTRY(linphone_gtk_get_widget(linphone_gtk_get_main_window(),"uribar")),
                        from);
+       ms_free(from);
 }
 
-static void linphone_gtk_bye_recv(LinphoneCore *lc, const char *from){
+static void linphone_gtk_bye_recv(LinphoneCore *lc, LinphoneCall *call){
        
 }
 
@@ -1145,6 +1147,8 @@ static void linphone_gtk_init_main_window(){
                                        "main_mute")),FALSE);
        linphone_gtk_enable_mute_button(GTK_TOGGLE_BUTTON(linphone_gtk_get_widget(main_window,
                                        "incall_mute")),FALSE);
+       linphone_gtk_enable_hold_button(GTK_TOGGLE_BUTTON(linphone_gtk_get_widget(main_window,
+                                       "hold_call")),FALSE);
        if (!linphone_gtk_use_in_call_view()) {
                gtk_widget_show(linphone_gtk_get_widget(main_window, "main_mute"));
        }
@@ -1206,7 +1210,7 @@ void linphone_gtk_log_handler(OrtpLogLevel lev, const char *fmt, va_list args){
 }
 
 
-static void linphone_gtk_refer_received(LinphoneCore *lc, const char *refer_to){
+static void linphone_gtk_refer_received(LinphoneCore *lc, LinphoneCall *call, const char *refer_to){
     GtkEntry * uri_bar =GTK_ENTRY(linphone_gtk_get_widget(
                linphone_gtk_get_main_window(), "uribar"));
        linphone_gtk_show_main_window();