Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
BC
public
liblinphone
Commits
dba5a233
Commit
dba5a233
authored
Feb 12, 2014
by
Simon Morlat
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gtk app remote provisioning in progress
parent
8367c0fe
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
81 additions
and
8 deletions
+81
-8
coreapi/linphonecore.h
coreapi/linphonecore.h
+21
-1
coreapi/remote_provisioning.c
coreapi/remote_provisioning.c
+12
-3
gtk/config-fetching.c
gtk/config-fetching.c
+31
-1
gtk/linphone.h
gtk/linphone.h
+5
-1
gtk/main.c
gtk/main.c
+12
-2
No files found.
coreapi/linphonecore.h
View file @
dba5a233
...
...
@@ -2280,9 +2280,29 @@ typedef struct _LinphoneContactProvider LinphoneContactProvider;
typedef
void
(
*
ContactSearchCallback
)(
LinphoneContactSearch
*
id
,
MSList
*
friends
,
void
*
data
);
/** Remote provisioning
/*
* Remote provisioning
*/
/**
* Set URI where to download xml configuration file at startup.
* This can also be set from configuration file or factory config file, from [misc] section, item "config-uri".
* Calling this function does not load the configuration. It will write the value into configuration so that configuration
* from remote URI will take place at next LinphoneCore start.
* @param lc the linphone core
* @param uri the http or https uri to use in order to download the configuration.
* @ingroup initializing
**/
LINPHONE_PUBLIC
void
linphone_core_set_provisioning_uri
(
LinphoneCore
*
lc
,
const
char
*
uri
);
/**
* Get provisioning URI.
* @param lc the linphone core
* @return the provisioning URI.
* @ingroup initializing
**/
LINPHONE_PUBLIC
const
char
*
linphone_core_get_provisioning_uri
(
const
LinphoneCore
*
lc
);
typedef
void
(
*
ConfiguringCallback
)(
LinphoneCore
*
lc
,
LinphoneConfiguringState
state
,
const
char
*
message
);
/**
...
...
coreapi/remote_provisioning.c
View file @
dba5a233
...
...
@@ -16,8 +16,7 @@ You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#include "linphonecore.h"
#include "bellesip_sal/sal_impl.h"
#include "private.h"
#include "xml2lpc.h"
#define XML2LPC_CALLBACK_BUFFER_SIZE 1024
...
...
@@ -137,4 +136,14 @@ static void linphone_remote_provisioning_download(LinphoneCore *lc, const char *
void
linphone_remote_provisioning_download_and_apply
(
LinphoneCore
*
lc
,
const
char
*
remote_provisioning_uri
,
ConfiguringCallback
cb
)
{
linphone_callback
=
cb
;
linphone_remote_provisioning_download
(
lc
,
remote_provisioning_uri
);
}
\ No newline at end of file
}
void
linphone_core_set_provisioning_uri
(
LinphoneCore
*
lc
,
const
char
*
uri
){
if
(
linphone_core_ready
(
lc
)){
lp_config_set_string
(
lc
->
config
,
"misc"
,
"config-uri"
,
uri
);
}
}
const
char
*
linphone_core_get_provisioning_uri
(
const
LinphoneCore
*
lc
){
return
lp_config_get_string
(
lc
->
config
,
"misc"
,
"config-uri"
,
NULL
);
}
gtk/config-fetching.c
View file @
dba5a233
...
...
@@ -23,6 +23,9 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
void
linphone_gtk_set_configuration_uri
(
GtkWidget
*
item
){
GtkWidget
*
w
=
linphone_gtk_create_window
(
"config-uri"
);
GtkWidget
*
entry
=
linphone_gtk_get_widget
(
w
,
"uri_entry"
);
const
char
*
uri
=
linphone_core_get_provisioning_uri
(
linphone_gtk_get_core
());
gtk_entry_set_text
(
GTK_ENTRY
(
entry
),
uri
);
gtk_widget_show
(
w
);
}
...
...
@@ -30,8 +33,9 @@ void linphone_gtk_config_uri_changed(GtkWidget *button){
GtkWidget
*
w
=
gtk_widget_get_toplevel
(
button
);
GtkWidget
*
entry
=
linphone_gtk_get_widget
(
w
,
"uri_entry"
);
const
char
*
uri
=
gtk_entry_get_text
(
GTK_ENTRY
(
entry
));
if
(
uri
){
if
(
uri
&&
strcmp
(
uri
,
"https://"
)
!=
0
){
/*not just the hint text*/
/*set provisionning uri to the core*/
linphone_core_set_provisioning_uri
(
linphone_gtk_get_core
(),
uri
);
gtk_widget_destroy
(
w
);
}
...
...
@@ -46,3 +50,29 @@ void linphone_gtk_config_uri_cancel(GtkWidget *button){
gtk_widget_destroy
(
w
);
}
GtkWidget
*
linphone_gtk_show_config_fetching
(
void
){
LinphoneCore
*
lc
=
linphone_gtk_get_core
();
GtkWidget
*
w
=
linphone_gtk_create_window
(
"provisioning-fetch"
);
g_message
(
"Fetching started"
);
gtk_message_dialog_format_secondary_text
(
GTK_MESSAGE_DIALOG
(
w
),
_
(
"fetching from %s"
),
linphone_core_get_provisioning_uri
(
lc
));
#if GTK_CHECK_VERSION(2,20,0)
{
GtkWidget
*
spinner
=
gtk_spinner_new
();
gtk_message_dialog_set_image
(
GTK_MESSAGE_DIALOG
(
w
),
spinner
);
}
#endif
gtk_widget_show
(
w
);
return
w
;
}
void
linphone_gtk_close_config_fetching
(
GtkWidget
*
w
,
LinphoneConfiguringState
state
){
LinphoneCore
*
lc
=
linphone_gtk_get_core
();
gtk_widget_destroy
(
w
);
g_message
(
"Fetching finished"
);
if
(
state
==
LinphoneConfiguringFailed
){
GtkWidget
*
msg
=
gtk_message_dialog_new
(
NULL
,
0
,
GTK_MESSAGE_ERROR
,
GTK_BUTTONS_CLOSE
,
_
(
"Downloading of remote configuration from %s failed."
),
linphone_core_get_provisioning_uri
(
lc
));
gtk_widget_show
(
msg
);
}
}
gtk/linphone.h
View file @
dba5a233
...
...
@@ -165,4 +165,8 @@ void linphone_gtk_monitor_usb(void);
void
linphone_gtk_unmonitor_usb
(
void
);
gchar
*
linphone_gtk_get_record_path
(
const
LinphoneAddress
*
address
,
gboolean
is_conference
);
void
linphone_gtk_schedule_restart
(
void
);
\ No newline at end of file
void
linphone_gtk_schedule_restart
(
void
);
GtkWidget
*
linphone_gtk_show_config_fetching
(
void
);
void
linphone_gtk_close_config_fetching
(
GtkWidget
*
w
,
LinphoneConfiguringState
state
);
gtk/main.c
View file @
dba5a233
...
...
@@ -90,6 +90,7 @@ gchar *linphone_logfile=NULL;
static
gboolean
workaround_gtk_entry_chinese_bug
=
FALSE
;
static
gchar
*
custom_config_file
=
NULL
;
static
gboolean
restart
=
FALSE
;
static
GtkWidget
*
config_fetching_dialog
=
NULL
;
static
GOptionEntry
linphone_options
[]
=
{
{
...
...
@@ -1248,7 +1249,8 @@ static void linphone_gtk_display_status(LinphoneCore *lc, const char *status){
}
static
void
linphone_gtk_configuring_status
(
LinphoneCore
*
lc
,
LinphoneConfiguringState
status
,
const
char
*
message
)
{
if
(
config_fetching_dialog
)
linphone_gtk_close_config_fetching
(
config_fetching_dialog
,
status
);
config_fetching_dialog
=
NULL
;
}
static
void
linphone_gtk_display_message
(
LinphoneCore
*
lc
,
const
char
*
msg
){
...
...
@@ -1362,8 +1364,16 @@ void linphone_gtk_notify(LinphoneCall *call, const char *msg){
static
void
linphone_gtk_global_state_changed
(
LinphoneCore
*
lc
,
LinphoneGlobalState
state
,
const
char
*
str
){
switch
(
state
){
case
LinphoneGlobalStartup
:
the_core
=
lc
;
break
;
case
LinphoneGlobalConfiguring
:
if
(
linphone_core_get_provisioning_uri
(
lc
)){
config_fetching_dialog
=
linphone_gtk_show_config_fetching
();
}
break
;
case
LinphoneGlobalOn
:
if
(
the_core
)
linphone_gtk_init_ui
();
linphone_gtk_init_ui
();
break
;
default:
break
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment