Improved strict compilation flags

This commit is contained in:
Gautier Pelloux-Prayer 2014-09-11 15:08:52 +02:00
parent fcce4b4bbf
commit 717db9fd8d
29 changed files with 362 additions and 259 deletions

View file

@ -135,7 +135,7 @@ AC_DEFINE_UNQUOTED(LINPHONE_ALL_LANGS, "$ALL_LINGUAS", [All supported languages]
if test "$mingw_found" != "yes" ; then
dnl gettext macro does not work properly under mingw. And we want to use the one provided by GTK.
dnl AM_GNU_GETTEXT pollutes CPPFLAGS: workaround this.
CPPFLAGS_save=$CPPFLAGS
AM_GNU_GETTEXT([external])
@ -185,25 +185,25 @@ if test "$enable_ldap" = "true"; then
[AC_MSG_ERROR([You need libldap for LDAP support])]
)
AC_CHECK_HEADERS(ldap.h, [foo=bar], [AC_MSG_ERROR( [ldap.h not found] ) ] )
found_ldap=yes
found_ldap=yes
fi
PKG_CHECK_MODULES(SASL, [libsasl2],[found_sasl=yes],[found_sasl=no] )
if test "$found_sasl" = "no"; then
AC_CHECK_LIB(sasl2, sasl_client_init , [SASL_LIBS="-lsasl2"],
[AC_MSG_ERROR([You need SASL for LDAP support] ) ]
)
AC_CHECK_HEADERS(sasl/sasl.h,foo=bar, [AC_MSG_ERROR([sasl/sasl.h not found])])
found_sasl=yes
found_sasl=yes
fi
AC_SUBST(LDAP_CFLAGS)
AC_SUBST(LDAP_LIBS)
AC_SUBST(SASL_CFLAGS)
AC_SUBST(SASL_LIBS)
if test "$found_ldap$found_sasl" = "yesyes"; then
AC_DEFINE(BUILD_LDAP,1,[Defined if LDAP build option enabled])
else
@ -248,7 +248,7 @@ AC_ARG_ENABLE(upnp,
)
if test "$build_upnp" != "false" ; then
PKG_CHECK_MODULES([LIBUPNP], [libupnp],
PKG_CHECK_MODULES([LIBUPNP], [libupnp],
[if pkg-config --atleast-version=1.6 "libupnp < 1.7"; then
build_upnp=true
else
@ -277,7 +277,7 @@ fi
AM_CONDITIONAL(BUILD_TOOLS, test x$build_tools != xfalse)
if test "$build_tools" != "false" ; then
build_tools=true
AC_DEFINE(BUILD_TOOLS, 1, [Define if tools enabled] )
AC_DEFINE(BUILD_TOOLS, 1, [Define if tools enabled] )
fi
dnl conditionnal build of gtk interface.
@ -553,10 +553,10 @@ AC_ARG_WITH(ffmpeg,
)
if test "$video" = "true"; then
if test "$enable_x11" = "true"; then
AC_CHECK_HEADERS(X11/Xlib.h)
if test "$build_macos" = "yes"; then
if test "$build_macos" = "yes"; then
X11_LIBS="-L/usr/X11/lib -lX11"
else
AC_CHECK_LIB(X11,XUnmapWindow, X11_LIBS="-lX11")
@ -644,7 +644,7 @@ AC_SUBST(LIBSOUP_LIBS)
AM_CONDITIONAL(BUILD_WIZARD, test x$build_wizard != xfalse)
if test "$build_wizard" != "false" ; then
build_wizard=true
AC_DEFINE(BUILD_WIZARD, 1, [Define if wizard enabled] )
AC_DEFINE(BUILD_WIZARD, 1, [Define if wizard enabled] )
fi
AC_CHECK_HEADERS(libudev.h)
@ -656,18 +656,18 @@ AC_CHECK_LIB(udev,udev_new)
AC_ARG_ENABLE(strict,
AC_HELP_STRING([--enable-strict], [Build with stricter options (gcc only) @<:@yes@:>@]),
AC_HELP_STRING([--enable-strict], [Build with stricter options @<:@yes@:>@]),
[strictness="${enableval}"],
[strictness=yes]
)
STRICT_OPTIONS="-Wall"
STRICT_OPTIONS="-Wall -Wdeclaration-after-statement -Wuninitialized"
#for clang
case $CC in
case $CC in
*clang*)
STRICT_OPTIONS="$STRICT_OPTIONS -Qunused-arguments"
STRICT_OPTIONS="$STRICT_OPTIONS -Qunused-arguments "
;;
esac
@ -783,13 +783,13 @@ if test x$enable_msg_storage != xfalse; then
fi
enable_msg_storage=false
fi
AC_SUBST(SQLITE3_CFLAGS)
AC_SUBST(SQLITE3_LIBS)
fi
PKG_CHECK_MODULES(BELLESIP, [belle-sip >= 1.3.1])
SIPSTACK_CFLAGS="$BELLESIP_CFLAGS"
@ -887,7 +887,7 @@ AC_PATH_PROG(DOXYGEN,doxygen,false)
AM_CONDITIONAL(HAVE_DOXYGEN, test $DOXYGEN != false)
AC_CONFIG_FILES([
AC_CONFIG_FILES([
Makefile
build/Makefile
build/macos/Makefile

View file

@ -603,6 +603,7 @@ lpc_cmd_chat(LinphoneCore *lc, char *args)
char *arg1 = args;
char *arg2 = NULL;
char *ptr = args;
LinphoneChatRoom *cr;
if (!args) return 0;
@ -619,7 +620,7 @@ lpc_cmd_chat(LinphoneCore *lc, char *args)
/* missing one parameter */
return 0;
}
LinphoneChatRoom *cr = linphone_core_create_chat_room(lc,arg1);
cr = linphone_core_create_chat_room(lc,arg1);
linphone_chat_room_send_message(cr,arg2);
return 1;
}
@ -2441,8 +2442,9 @@ static void lpc_display_call_states(LinphoneCore *lc){
}else{
for(;elem!=NULL;elem=elem->next){
const char *flag;
bool_t in_conference;
call=(LinphoneCall*)elem->data;
bool_t in_conference=linphone_call_params_get_local_conference_mode(linphone_call_get_current_params(call));
in_conference=linphone_call_params_get_local_conference_mode(linphone_call_get_current_params(call));
tmp=linphone_call_get_remote_address_as_string (call);
flag=in_conference ? "conferencing" : "";
flag=linphone_call_has_transfer_pending(call) ? "transfer pending" : flag;

View file

@ -367,8 +367,8 @@ static void linphonec_call_state_changed(LinphoneCore *lc, LinphoneCall *call, L
if ( auto_answer) {
answer_call=TRUE;
} else if (real_early_media_sending) {
linphonec_out("Sending early media using real hardware\n");
LinphoneCallParams* callparams = linphone_core_create_default_call_parameters(lc);
linphonec_out("Sending early media using real hardware\n");
linphone_call_params_enable_early_media_sending(callparams, TRUE);
if (vcap_enabled) linphone_call_params_enable_video(callparams, TRUE);
linphone_core_accept_early_media_with_params(lc, call, callparams);
@ -828,12 +828,13 @@ linphonec_prompt_for_auth_final(LinphoneCore *lc)
#ifdef HAVE_READLINE
rl_hook_func_t *old_event_hook;
#endif
LinphoneAuthInfo *pending_auth;
if (reentrancy!=0) return 0;
reentrancy++;
LinphoneAuthInfo *pending_auth=auth_stack.elem[auth_stack.nitems-1];
pending_auth=auth_stack.elem[auth_stack.nitems-1];
snprintf(auth_prompt, 256, "Password for %s on %s: ",
pending_auth->username, pending_auth->realm);

View file

@ -100,7 +100,7 @@ static int linphone_chat_message_file_transfer_on_send_body(belle_sip_user_body_
char *buf = (char *)buffer;
/* if we've not reach the end of file yet, ask for more data*/
if (offset<chatMsg->file_transfer_information->size){
if (offset<chatMsg->file_transfer_information->size){
/* get data from call back */
lc->vtable.file_transfer_send(lc, chatMsg, chatMsg->file_transfer_information, buf, size);
}
@ -130,13 +130,16 @@ static void linphone_chat_message_process_response_from_post_file(void *data, co
belle_http_request_t *req;
belle_sip_multipart_body_handler_t *bh;
char* ua;
char *content_type;
char *first_part_header;
belle_sip_user_body_handler_t *first_part_bh;
/* temporary storage of the header of the message part header */
char *content_type=belle_sip_strdup_printf("%s/%s", msg->file_transfer_information->type, msg->file_transfer_information->subtype);
char *first_part_header = belle_sip_strdup_printf("Content-Disposition: form-data; name=\"File\"; filename=\"%s\"\r\nContent-Type: %s\r\n\r\n", msg->file_transfer_information->name, content_type);
content_type=belle_sip_strdup_printf("%s/%s", msg->file_transfer_information->type, msg->file_transfer_information->subtype);
first_part_header=belle_sip_strdup_printf("Content-Disposition: form-data; name=\"File\"; filename=\"%s\"\r\nContent-Type: %s\r\n\r\n", msg->file_transfer_information->name, content_type);
/* create a user body handler to take care of the file */
belle_sip_user_body_handler_t *first_part_bh=belle_sip_user_body_handler_new(msg->file_transfer_information->size,NULL,NULL,linphone_chat_message_file_transfer_on_send_body,msg);
first_part_bh=belle_sip_user_body_handler_new(msg->file_transfer_information->size,NULL,NULL,linphone_chat_message_file_transfer_on_send_body,msg);
belle_sip_body_handler_set_header((belle_sip_body_handler_t *)first_part_bh, first_part_header); /* set the header for this part */
belle_sip_free(first_part_header);

View file

@ -87,6 +87,8 @@ int main(int argc, char *argv[]){
char* identity=NULL;
char* password=NULL;
LinphoneFriend* my_friend=NULL;
/* takes sip uri identity from the command line arguments */
if (argc>1){
dest_friend=argv[1];
@ -123,11 +125,11 @@ int main(int argc, char *argv[]){
LinphoneProxyConfig* proxy_cfg = linphone_proxy_config_new();
/*parse identity*/
LinphoneAddress *from = linphone_address_new(identity);
LinphoneAuthInfo *info;
if (from==NULL){
printf("%s not a valid sip uri, must be like sip:toto@sip.linphone.org \n",identity);
goto end;
}
LinphoneAuthInfo *info;
if (password!=NULL){
info=linphone_auth_info_new(linphone_address_get_username(from),NULL,password,NULL,NULL,NULL); /*create authentication structure from identity*/
linphone_core_add_auth_info(lc,info); /*add authentication info to LinphoneCore*/
@ -152,7 +154,6 @@ int main(int argc, char *argv[]){
while( running && linphone_proxy_config_get_state(proxy_cfg) == LinphoneRegistrationProgress);
}
LinphoneFriend* my_friend=NULL;
if (dest_friend) {
my_friend = linphone_friend_new_with_address(dest_friend); /*creates friend object from dest*/

View file

@ -1,7 +1,7 @@
/*
linphone
Copyright (C) 2010 Belledonne Communications SARL
Copyright (C) 2010 Belledonne Communications SARL
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
@ -55,7 +55,7 @@ int main(int argc, char *argv[]){
LinphoneCoreVTable vtable={0};
char* dest_friend=NULL;
LinphoneChatRoom* chat_room;
/* takes sip uri identity from the command line arguments */
if (argc>1){
@ -67,7 +67,7 @@ int main(int argc, char *argv[]){
#ifdef DEBUG
linphone_core_enable_logs(NULL); /*enable liblinphone logs.*/
#endif
/*
/*
Fill the LinphoneCoreVTable with application callbacks.
All are optional. Here we only use the text_received callback
in order to get notifications about incoming message.
@ -81,7 +81,7 @@ int main(int argc, char *argv[]){
/*Next step is to create a chat root*/
LinphoneChatRoom* chat_room = linphone_core_create_chat_room(lc,dest_friend);
chat_room = linphone_core_create_chat_room(lc,dest_friend);
linphone_chat_room_send_message(chat_room,"Hello world"); /*sending message*/

View file

@ -1,7 +1,7 @@
/*
linphone
Copyright (C) 2010 Belledonne Communications SARL
Copyright (C) 2010 Belledonne Communications SARL
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
@ -144,6 +144,10 @@ int main(int argc, char *argv[]){
const char* dest_friend=NULL;
int i;
const char* big_file_content="big file";
LinphoneChatRoom* chat_room;
LinphoneContent content;
LinphoneChatMessage* chat_message;
/*seting dummy file content to something*/
for (i=0;i<sizeof(big_file);i+=strlen(big_file_content))
memcpy(big_file+i, big_file_content, strlen(big_file_content));
@ -156,7 +160,7 @@ int main(int argc, char *argv[]){
#ifdef DEBUG
linphone_core_enable_logs(NULL); /*enable liblinphone logs.*/
#endif
/*
/*
Fill the LinphoneCoreVTable with application callbacks.
All are optional. Here we only use the file_transfer_received callback
in order to get notifications about incoming file receive, file_transfer_send to feed file to be transfered
@ -183,9 +187,8 @@ int main(int argc, char *argv[]){
/*Next step is to create a chat room*/
LinphoneChatRoom* chat_room = linphone_core_create_chat_room(lc,dest_friend);
chat_room = linphone_core_create_chat_room(lc,dest_friend);
LinphoneContent content;
memset(&content,0,sizeof(content));
content.type="text";
content.subtype="plain";
@ -193,7 +196,7 @@ int main(int argc, char *argv[]){
content.name = "bigfile.txt";
/*now create a chat message with custom content*/
LinphoneChatMessage* chat_message = linphone_chat_room_create_file_transfer_message(chat_room,&content);
chat_message = linphone_chat_room_create_file_transfer_message(chat_room,&content);
if (chat_message == NULL) {
printf("returned message is null\n");
}

View file

@ -1,7 +1,7 @@
/*
linphone
Copyright (C) 2013 Belledonne Communications SARL
Copyright (C) 2013 Belledonne Communications SARL
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
@ -89,6 +89,10 @@ int main(int argc, char *argv[]){
char* identity=NULL;
char* password=NULL;
int i;
LinphoneProxyConfig* proxy_cfg;
LinphoneAddress *from;
LinphoneAuthInfo *info;
const char* server_addr;
/* takes sip uri identity from the command line arguments */
if (argc>1){
@ -105,7 +109,7 @@ int main(int argc, char *argv[]){
#ifdef DEBUG
linphone_core_enable_logs(NULL); /*enable liblinphone logs.*/
#endif
/*
/*
Fill the LinphoneCoreVTable with application callbacks.
All are optional. Here we only use the registration_state_changed callbacks
in order to get notifications about the progress of the registration.
@ -118,30 +122,28 @@ int main(int argc, char *argv[]){
*/
lc=linphone_core_new(&vtable,NULL,NULL,data);
LinphoneProxyConfig* proxy_cfg;
/*create proxy config*/
proxy_cfg = linphone_proxy_config_new();
/*parse identity*/
LinphoneAddress *from = linphone_address_new(identity);
from = linphone_address_new(identity);
if (from==NULL){
printf("%s not a valid sip uri, must be like sip:toto@sip.linphone.org \n",identity);
goto end;
}
LinphoneAuthInfo *info;
if (password!=NULL){
info=linphone_auth_info_new(linphone_address_get_username(from),NULL,password,NULL,NULL,NULL); /*create authentication structure from identity*/
linphone_core_add_auth_info(lc,info); /*add authentication info to LinphoneCore*/
}
if (password!=NULL){
info=linphone_auth_info_new(linphone_address_get_username(from),NULL,password,NULL,NULL,NULL); /*create authentication structure from identity*/
linphone_core_add_auth_info(lc,info); /*add authentication info to LinphoneCore*/
}
// configure proxy entries
linphone_proxy_config_set_identity(proxy_cfg,identity); /*set identity with user name and domain*/
const char* server_addr = linphone_address_get_domain(from); /*extract domain address from identity*/
linphone_proxy_config_set_server_addr(proxy_cfg,server_addr); /* we assume domain = proxy server address*/
linphone_proxy_config_enable_register(proxy_cfg,TRUE); /*activate registration for this proxy config*/
linphone_address_destroy(from); /*release resource*/
// configure proxy entries
linphone_proxy_config_set_identity(proxy_cfg,identity); /*set identity with user name and domain*/
server_addr = linphone_address_get_domain(from); /*extract domain address from identity*/
linphone_proxy_config_set_server_addr(proxy_cfg,server_addr); /* we assume domain = proxy server address*/
linphone_proxy_config_enable_register(proxy_cfg,TRUE); /*activate registration for this proxy config*/
linphone_address_destroy(from); /*release resource*/
linphone_core_add_proxy_config(lc,proxy_cfg); /*add proxy config to linphone core*/
linphone_core_set_default_proxy(lc,proxy_cfg); /*set to default proxy*/
linphone_core_add_proxy_config(lc,proxy_cfg); /*add proxy config to linphone core*/
linphone_core_set_default_proxy(lc,proxy_cfg); /*set to default proxy*/
i=0;
/* main loop for receiving notifications and doing background linphonecore work: */
@ -163,7 +165,7 @@ int main(int argc, char *argv[]){
linphone_proxy_config_edit(proxy_cfg); /*start editing proxy configuration*/
linphone_proxy_config_enable_register(proxy_cfg,FALSE); /*de-activate registration for this proxy config*/
linphone_proxy_config_done(proxy_cfg); /*initiate REGISTER with expire = 0*/
if (data->ev){
linphone_event_terminate(data->ev);
}

View file

@ -1,7 +1,7 @@
/*
linphone
Copyright (C) 2010 Belledonne Communications SARL
Copyright (C) 2010 Belledonne Communications SARL
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
@ -60,9 +60,13 @@ static void registration_state_changed(struct _LinphoneCore *lc, LinphoneProxyCo
LinphoneCore *lc;
int main(int argc, char *argv[]){
LinphoneCoreVTable vtable={0};
LinphoneProxyConfig* proxy_cfg;
LinphoneAddress *from;
LinphoneAuthInfo *info;
char* identity=NULL;
char* password=NULL;
const char* server_addr;
/* takes sip uri identity from the command line arguments */
if (argc>1){
@ -79,7 +83,7 @@ int main(int argc, char *argv[]){
#ifdef DEBUG
linphone_core_enable_logs(NULL); /*enable liblinphone logs.*/
#endif
/*
/*
Fill the LinphoneCoreVTable with application callbacks.
All are optional. Here we only use the registration_state_changed callbacks
in order to get notifications about the progress of the registration.
@ -91,30 +95,28 @@ int main(int argc, char *argv[]){
*/
lc=linphone_core_new(&vtable,NULL,NULL,NULL);
LinphoneProxyConfig* proxy_cfg;
/*create proxy config*/
proxy_cfg = linphone_proxy_config_new();
/*parse identity*/
LinphoneAddress *from = linphone_address_new(identity);
from = linphone_address_new(identity);
if (from==NULL){
printf("%s not a valid sip uri, must be like sip:toto@sip.linphone.org \n",identity);
goto end;
}
LinphoneAuthInfo *info;
if (password!=NULL){
info=linphone_auth_info_new(linphone_address_get_username(from),NULL,password,NULL,NULL,NULL); /*create authentication structure from identity*/
linphone_core_add_auth_info(lc,info); /*add authentication info to LinphoneCore*/
}
if (password!=NULL){
info=linphone_auth_info_new(linphone_address_get_username(from),NULL,password,NULL,NULL,NULL); /*create authentication structure from identity*/
linphone_core_add_auth_info(lc,info); /*add authentication info to LinphoneCore*/
}
// configure proxy entries
linphone_proxy_config_set_identity(proxy_cfg,identity); /*set identity with user name and domain*/
const char* server_addr = linphone_address_get_domain(from); /*extract domain address from identity*/
linphone_proxy_config_set_server_addr(proxy_cfg,server_addr); /* we assume domain = proxy server address*/
linphone_proxy_config_enable_register(proxy_cfg,TRUE); /*activate registration for this proxy config*/
linphone_address_destroy(from); /*release resource*/
// configure proxy entries
linphone_proxy_config_set_identity(proxy_cfg,identity); /*set identity with user name and domain*/
server_addr = linphone_address_get_domain(from); /*extract domain address from identity*/
linphone_proxy_config_set_server_addr(proxy_cfg,server_addr); /* we assume domain = proxy server address*/
linphone_proxy_config_enable_register(proxy_cfg,TRUE); /*activate registration for this proxy config*/
linphone_address_destroy(from); /*release resource*/
linphone_core_add_proxy_config(lc,proxy_cfg); /*add proxy config to linphone core*/
linphone_core_set_default_proxy(lc,proxy_cfg); /*set to default proxy*/
linphone_core_add_proxy_config(lc,proxy_cfg); /*add proxy config to linphone core*/
linphone_core_set_default_proxy(lc,proxy_cfg); /*set to default proxy*/
/* main loop for receiving notifications and doing background linphonecore work: */

View file

@ -29,7 +29,7 @@ struct _lpc2xml_context {
const LpConfig *lpc;
lpc2xml_function cbf;
void *ctx;
xmlDoc *doc;
char errorBuffer[LPC2XML_BZ];
char warningBuffer[LPC2XML_BZ];
@ -42,7 +42,7 @@ lpc2xml_context* lpc2xml_context_new(lpc2xml_function cbf, void *ctx) {
xmlCtx->lpc = NULL;
xmlCtx->cbf = cbf;
xmlCtx->ctx = ctx;
xmlCtx->doc = NULL;
xmlCtx->errorBuffer[0]='\0';
xmlCtx->warningBuffer[0]='\0';
@ -64,8 +64,8 @@ static void lpc2xml_context_clear_logs(lpc2xml_context *ctx) {
}
static void lpc2xml_log(lpc2xml_context *xmlCtx, int level, const char *fmt, ...) {
va_list args;
va_start(args, fmt);
va_list args;
va_start(args, fmt);
if(xmlCtx->cbf != NULL) {
xmlCtx->cbf((xmlCtx)->ctx, level, fmt, args);
}
@ -75,8 +75,8 @@ static void lpc2xml_log(lpc2xml_context *xmlCtx, int level, const char *fmt, ...
static void lpc2xml_genericxml_error(void *ctx, const char *fmt, ...) {
lpc2xml_context *xmlCtx = (lpc2xml_context *)ctx;
int sl = strlen(xmlCtx->errorBuffer);
va_list args;
va_start(args, fmt);
va_list args;
va_start(args, fmt);
vsnprintf(xmlCtx->errorBuffer + sl, LPC2XML_BZ-sl, fmt, args);
va_end(args);
}
@ -85,8 +85,8 @@ static void lpc2xml_genericxml_error(void *ctx, const char *fmt, ...) {
static void lpc2xml_genericxml_warning(void *ctx, const char *fmt, ...) {
lpc2xml_context *xmlCtx = (lpc2xml_context *)ctx;
int sl = strlen(xmlCtx->warningBuffer);
va_list args;
va_start(args, fmt);
va_list args;
va_start(args, fmt);
vsnprintf(xmlCtx->warningBuffer + sl, LPC2XML_BZ-sl, fmt, args);
va_end(args);
}
@ -114,25 +114,27 @@ struct __processSectionCtx {
static void processSection_cb(const char *entry, struct __processSectionCtx *ctx) {
if(ctx->ret == 0) {
const char *comment = "#";
xmlNode *node;
xmlAttr *name_attr;
if (strncmp(comment, entry, strlen(comment)) == 0) {
lpc2xml_log(ctx->ctx, LPC2XML_WARNING, "Skipped commented entry %s", entry);
ctx->ret = 0;
return;
}
xmlNode *node = xmlNewChild(ctx->node, NULL, (const xmlChar *)"entry", NULL);
node = xmlNewChild(ctx->node, NULL, (const xmlChar *)"entry", NULL);
if(node == NULL) {
lpc2xml_log(ctx->ctx, LPC2XML_ERROR, "Can't create \"entry\" element");
ctx->ret = -1;
return;
}
xmlAttr *name_attr = xmlSetProp(node, (const xmlChar *)"name", (const xmlChar *)entry);
name_attr = xmlSetProp(node, (const xmlChar *)"name", (const xmlChar *)entry);
if(name_attr == NULL) {
lpc2xml_log(ctx->ctx, LPC2XML_ERROR, "Can't create name attribute for \"entry\" element");
ctx->ret = -1;
return;
}
ctx->ret = processEntry(ctx->section, entry, node, ctx->ctx);
}
}
@ -154,12 +156,13 @@ struct __processConfigCtx {
static void processConfig_cb(const char *section, struct __processConfigCtx *ctx) {
if(ctx->ret == 0) {
xmlNode *node = xmlNewChild(ctx->node, NULL, (const xmlChar *)"section", NULL);
xmlAttr *name_attr;
if(node == NULL) {
lpc2xml_log(ctx->ctx, LPC2XML_ERROR, "Can't create \"section\" element");
ctx->ret = -1;
return;
}
xmlAttr *name_attr = xmlSetProp(node, (const xmlChar *)"name", (const xmlChar *)section);
name_attr = xmlSetProp(node, (const xmlChar *)"name", (const xmlChar *)section);
if(name_attr == NULL) {
lpc2xml_log(ctx->ctx, LPC2XML_ERROR, "Can't create name attribute for \"section\" element");
ctx->ret = -1;
@ -177,22 +180,25 @@ static int processConfig(xmlNode *node, lpc2xml_context *ctx) {
static int processDoc(xmlDoc *doc, lpc2xml_context *ctx) {
int ret = 0;
xmlNs *xsi_ns;
xmlNs *lpc_ns;
xmlAttr *schemaLocation;
xmlNode *root_node = xmlNewNode(NULL, (const xmlChar *)"config");
if(root_node == NULL) {
lpc2xml_log(ctx, LPC2XML_ERROR, "Can't create \"config\" element");
return -1;
}
xmlNs *lpc_ns = xmlNewNs(root_node, (const xmlChar *)"http://www.linphone.org/xsds/lpconfig.xsd", NULL);
lpc_ns = xmlNewNs(root_node, (const xmlChar *)"http://www.linphone.org/xsds/lpconfig.xsd", NULL);
if(lpc_ns == NULL) {
lpc2xml_log(ctx, LPC2XML_WARNING, "Can't create lpc namespace");
} else {
xmlSetNs(root_node, lpc_ns);
}
xmlNs *xsi_ns = xmlNewNs(root_node, (const xmlChar *)"http://www.w3.org/2001/XMLSchema-instance", (const xmlChar *)"xsi");
xsi_ns = xmlNewNs(root_node, (const xmlChar *)"http://www.w3.org/2001/XMLSchema-instance", (const xmlChar *)"xsi");
if(lpc_ns == NULL) {
lpc2xml_log(ctx, LPC2XML_WARNING, "Can't create xsi namespace");
}
xmlAttr *schemaLocation = xmlNewNsProp(root_node, xsi_ns, (const xmlChar *)"schemaLocation", (const xmlChar *)"http://www.linphone.org/xsds/lpconfig.xsd lpconfig.xsd");
schemaLocation = xmlNewNsProp(root_node, xsi_ns, (const xmlChar *)"schemaLocation", (const xmlChar *)"http://www.linphone.org/xsds/lpconfig.xsd lpconfig.xsd");
if(schemaLocation == NULL) {
lpc2xml_log(ctx, LPC2XML_WARNING, "Can't create schemaLocation");
}
@ -203,12 +209,13 @@ static int processDoc(xmlDoc *doc, lpc2xml_context *ctx) {
static int internal_convert_lpc2xml(lpc2xml_context *ctx) {
int ret = 0;
xmlDoc *doc;
lpc2xml_log(ctx, LPC2XML_DEBUG, "Generation started");
if(ctx->doc != NULL) {
xmlFreeDoc(ctx->doc);
ctx->doc = NULL;
}
xmlDoc *doc = xmlNewDoc((const xmlChar *)"1.0");
doc = xmlNewDoc((const xmlChar *)"1.0");
ret = processDoc(doc, ctx);
if(ret == 0) {
ctx->doc = doc;
@ -226,9 +233,10 @@ int lpc2xml_set_lpc(lpc2xml_context* context, const LpConfig *lpc) {
int lpc2xml_convert_file(lpc2xml_context* context, const char *filename) {
int ret = -1;
xmlSaveCtxtPtr save_ctx;
lpc2xml_context_clear_logs(context);
xmlSetGenericErrorFunc(context, lpc2xml_genericxml_error);
xmlSaveCtxtPtr save_ctx = xmlSaveToFilename(filename, "UTF-8", XML_SAVE_FORMAT);
save_ctx = xmlSaveToFilename(filename, "UTF-8", XML_SAVE_FORMAT);
if(save_ctx != NULL) {
ret = internal_convert_lpc2xml(context);
if(ret == 0) {
@ -248,9 +256,10 @@ int lpc2xml_convert_file(lpc2xml_context* context, const char *filename) {
int lpc2xml_convert_fd(lpc2xml_context* context, int fd) {
int ret = -1;
xmlSaveCtxtPtr save_ctx;
lpc2xml_context_clear_logs(context);
xmlSetGenericErrorFunc(context, lpc2xml_genericxml_error);
xmlSaveCtxtPtr save_ctx = xmlSaveToFd(fd, "UTF-8", XML_SAVE_FORMAT);
save_ctx = xmlSaveToFd(fd, "UTF-8", XML_SAVE_FORMAT);
if(save_ctx != NULL) {
ret = internal_convert_lpc2xml(context);
if(ret == 0) {
@ -271,9 +280,10 @@ int lpc2xml_convert_fd(lpc2xml_context* context, int fd) {
int lpc2xml_convert_string(lpc2xml_context* context, char **content) {
int ret = -1;
xmlBufferPtr buffer = xmlBufferCreate();
xmlSaveCtxtPtr save_ctx;
lpc2xml_context_clear_logs(context);
xmlSetGenericErrorFunc(context, lpc2xml_genericxml_error);
xmlSaveCtxtPtr save_ctx = xmlSaveToBuffer(buffer, "UTF-8", XML_SAVE_FORMAT);
save_ctx = xmlSaveToBuffer(buffer, "UTF-8", XML_SAVE_FORMAT);
if(save_ctx != NULL) {
ret = internal_convert_lpc2xml(context);
if(ret == 0) {

View file

@ -274,11 +274,13 @@ void linphone_chat_message_store_appdata(LinphoneChatMessage* msg){
void linphone_chat_room_mark_as_read(LinphoneChatRoom *cr){
LinphoneCore *lc=linphone_chat_room_get_lc(cr);
int read=1;
char *peer;
char *buf;
if (lc->db==NULL) return ;
char *peer=linphone_address_as_string_uri_only(linphone_chat_room_get_peer_address(cr));
char *buf=sqlite3_mprintf("UPDATE history SET read=%i WHERE remoteContact = %Q;",
peer=linphone_address_as_string_uri_only(linphone_chat_room_get_peer_address(cr));
buf=sqlite3_mprintf("UPDATE history SET read=%i WHERE remoteContact = %Q;",
read,peer);
linphone_sql_request(lc->db,buf);
sqlite3_free(buf);
@ -287,10 +289,11 @@ void linphone_chat_room_mark_as_read(LinphoneChatRoom *cr){
void linphone_chat_room_update_url(LinphoneChatRoom *cr, LinphoneChatMessage *msg) {
LinphoneCore *lc=linphone_chat_room_get_lc(cr);
char *buf;
if (lc->db==NULL) return ;
char *buf=sqlite3_mprintf("UPDATE history SET url=%Q WHERE id=%i;",msg->external_body_url,msg->storage_id);
buf=sqlite3_mprintf("UPDATE history SET url=%Q WHERE id=%i;",msg->external_body_url,msg->storage_id);
linphone_sql_request(lc->db,buf);
sqlite3_free(buf);
}
@ -298,13 +301,16 @@ void linphone_chat_room_update_url(LinphoneChatRoom *cr, LinphoneChatMessage *ms
static int linphone_chat_room_get_messages_count(LinphoneChatRoom *cr, bool_t unread_only){
LinphoneCore *lc=linphone_chat_room_get_lc(cr);
int numrows=0;
char *peer;
char *buf;
sqlite3_stmt *selectStatement;
int returnValue;
if (lc->db==NULL) return 0;
char *peer=linphone_address_as_string_uri_only(linphone_chat_room_get_peer_address(cr));
char *buf=sqlite3_mprintf("SELECT count(*) FROM history WHERE remoteContact = %Q %s;",peer,unread_only?"AND read = 0":"");
sqlite3_stmt *selectStatement;
int returnValue = sqlite3_prepare_v2(lc->db,buf,-1,&selectStatement,NULL);
peer=linphone_address_as_string_uri_only(linphone_chat_room_get_peer_address(cr));
buf=sqlite3_mprintf("SELECT count(*) FROM history WHERE remoteContact = %Q %s;",peer,unread_only?"AND read = 0":"");
returnValue = sqlite3_prepare_v2(lc->db,buf,-1,&selectStatement,NULL);
if (returnValue == SQLITE_OK){
if(sqlite3_step(selectStatement) == SQLITE_ROW){
numrows= sqlite3_column_int(selectStatement, 0);
@ -326,21 +332,24 @@ int linphone_chat_room_get_history_size(LinphoneChatRoom *cr){
void linphone_chat_room_delete_message(LinphoneChatRoom *cr, LinphoneChatMessage *msg) {
LinphoneCore *lc=cr->lc;
char *buf;
if (lc->db==NULL) return ;
char *buf=sqlite3_mprintf("DELETE FROM history WHERE id = %i;", msg->storage_id);
buf=sqlite3_mprintf("DELETE FROM history WHERE id = %i;", msg->storage_id);
linphone_sql_request(lc->db,buf);
sqlite3_free(buf);
}
void linphone_chat_room_delete_history(LinphoneChatRoom *cr){
LinphoneCore *lc=cr->lc;
char *peer;
char *buf;
if (lc->db==NULL) return ;
char *peer=linphone_address_as_string_uri_only(linphone_chat_room_get_peer_address(cr));
char *buf=sqlite3_mprintf("DELETE FROM history WHERE remoteContact = %Q;",peer);
peer=linphone_address_as_string_uri_only(linphone_chat_room_get_peer_address(cr));
buf=sqlite3_mprintf("DELETE FROM history WHERE remoteContact = %Q;",peer);
linphone_sql_request(lc->db,buf);
sqlite3_free(buf);
ms_free(peer);
@ -471,8 +480,9 @@ static void linphone_migrate_timestamps(sqlite3* db){
sqlite3_free(errmsg);
linphone_sql_request(db, "ROLLBACK");
} else {
uint64_t end;
linphone_sql_request(db, "COMMIT");
uint64_t end=ortp_get_cur_time_ms();
end=ortp_get_cur_time_ms();
ms_message("Migrated message timestamps to UTC in %i ms",(int)(end-begin));
}
}

View file

@ -131,7 +131,7 @@ static double get_audio_payload_bandwidth_from_codec_bitrate(const PayloadType *
double npacket=50;
double packet_size;
int bitrate;
if (strcmp(payload_type_get_mime(&payload_type_aaceld_44k), payload_type_get_mime(pt))==0) {
/*special case of aac 44K because ptime= 10ms*/
npacket=100;
@ -209,7 +209,7 @@ void linphone_core_update_allocated_audio_bandwidth(LinphoneCore *lc){
int maxbw=get_min_bandwidth(linphone_core_get_download_bandwidth(lc),
linphone_core_get_upload_bandwidth(lc));
int max_codec_bitrate=0;
for(elem=linphone_core_get_audio_codecs(lc);elem!=NULL;elem=elem->next){
PayloadType *pt=(PayloadType*)elem->data;
if (payload_type_enabled(pt)){
@ -996,7 +996,7 @@ static int get_local_ip_with_getifaddrs(int type, char *address, int size){
struct ifaddrs *ifpstart;
char retaddr[LINPHONE_IPADDR_SIZE]={0};
bool_t found=FALSE;
if (getifaddrs(&ifpstart) < 0) {
return -1;
}
@ -1097,6 +1097,9 @@ static int get_local_ip_for_with_connect(int type, const char *dest, char *resul
int linphone_core_get_local_ip_for(int type, const char *dest, char *result){
int err;
#ifdef HAVE_GETIFADDRS
int found_ifs;
#endif
strcpy(result,type==AF_INET ? "127.0.0.1" : "::1");
if (dest==NULL){
@ -1112,8 +1115,6 @@ int linphone_core_get_local_ip_for(int type, const char *dest, char *result){
#ifdef HAVE_GETIFADDRS
/*we use getifaddrs for lookup of default interface */
int found_ifs;
found_ifs=get_local_ip_with_getifaddrs(type,result,LINPHONE_IPADDR_SIZE);
if (found_ifs==1){
return 0;

View file

@ -168,11 +168,12 @@ static void dialog_click(GtkWidget *dialog, guint response_id, GtkWidget *page){
}
static void calibration_finished(LinphoneCore *lc, LinphoneEcCalibratorStatus status, int delay, void *data){
GtkWidget * dialog;
GtkWidget *speaker_page;
ms_message("echo calibration finished %s.",status==LinphoneEcCalibratorDone ? "successfully" : "with faillure");
if (status==LinphoneEcCalibratorDone) ms_message("Measured delay is %i",delay);
GtkWidget * dialog;
GtkWidget *speaker_page = get_widget_from_assistant("speaker_page");
speaker_page = get_widget_from_assistant("speaker_page");
dialog = gtk_message_dialog_new (
GTK_WINDOW(audio_assistant),
@ -208,6 +209,7 @@ void linphone_gtk_start_record_sound(GtkWidget *w, gpointer data){
AudioStream *stream = NULL;
MSSndCardManager *manager = ms_snd_card_manager_get();
gboolean active=gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(w));
gint timeout_id;
if(active){
gchar *path = get_record_file();
@ -217,12 +219,12 @@ void linphone_gtk_start_record_sound(GtkWidget *w, gpointer data){
path,NULL,ms_snd_card_manager_get_card(manager,linphone_core_get_capture_device(lc)),FALSE);
g_object_set_data(G_OBJECT(audio_assistant),"record_stream",stream);
}
gint timeout_id = gtk_timeout_add(6000,(GtkFunction)linphone_gtk_stop_record,NULL);
timeout_id = gtk_timeout_add(6000,(GtkFunction)linphone_gtk_stop_record,NULL);
g_object_set_data(G_OBJECT(audio_assistant),"timeout_id",GINT_TO_POINTER(timeout_id));
g_object_set_data(G_OBJECT(audio_assistant),"path",path);
} else {
stream = (AudioStream *)g_object_get_data(G_OBJECT(audio_assistant),"record_stream");
gint timeout_id = GPOINTER_TO_INT(g_object_get_data(G_OBJECT(audio_assistant),"timeout_id"));
timeout_id = GPOINTER_TO_INT(g_object_get_data(G_OBJECT(audio_assistant),"timeout_id"));
gtk_timeout_remove(timeout_id);
if(stream != NULL){
audio_stream_stop(stream);
@ -322,7 +324,7 @@ static GtkWidget *create_intro(){
static GtkWidget *create_mic_page(){
GtkWidget *vbox=gtk_table_new(3,2,FALSE);
LinphoneCore *lc=linphone_gtk_get_core();
const char **sound_devices;
GtkWidget *labelMicChoice=gtk_label_new(_("Capture device"));
GtkWidget *labelMicLevel=gtk_label_new(_("Recorded volume"));
GtkWidget *mic_audiolevel=gtk_progress_bar_new();
@ -348,8 +350,8 @@ static GtkWidget *create_mic_page(){
set_widget_to_assistant("mic_audiolevel",mic_audiolevel);
set_widget_to_assistant("label_audiolevel",label_audiolevel);
const char **sound_devices=linphone_core_get_sound_devices(lc);
sound_devices=linphone_core_get_sound_devices(lc);
linphone_gtk_fill_combo_box(capture_device, sound_devices,
linphone_core_get_capture_device(lc), CAP_CAPTURE);
gtk_widget_show_all(vbox);
@ -370,6 +372,7 @@ static GtkWidget *create_speaker_page(){
GtkWidget *playback_device=gtk_combo_box_new();
GtkWidget *mixer_button=gtk_button_new_with_label("System sound preferences");
GtkWidget *image;
const char **sound_devices;
image=gtk_image_new_from_stock(GTK_STOCK_PREFERENCES,GTK_ICON_SIZE_MENU);
gtk_button_set_image(GTK_BUTTON(mixer_button),image);
@ -382,7 +385,7 @@ static GtkWidget *create_speaker_page(){
gtk_table_set_row_spacings(GTK_TABLE(vbox),10);
const char **sound_devices=linphone_core_get_sound_devices(lc);
sound_devices=linphone_core_get_sound_devices(lc);
linphone_gtk_fill_combo_box(playback_device, sound_devices,
linphone_core_get_playback_device(lc),CAP_PLAYBACK);
gtk_widget_show_all(vbox);
@ -414,9 +417,9 @@ static GtkWidget *create_play_record_page(){
gtk_table_attach(GTK_TABLE(vbox), rec_button, 1, 2, 0, 1, GTK_SHRINK, GTK_SHRINK, 0,0);
gtk_table_attach_defaults(GTK_TABLE(vbox), labelPlay, 0, 1, 1, 2);
gtk_table_attach(GTK_TABLE(vbox), play_button, 1, 2, 1, 2, GTK_SHRINK, GTK_SHRINK, 0,0);
gtk_widget_show_all(vbox);
set_widget_to_assistant("rec_button",rec_button);
set_widget_to_assistant("play_button",play_button);
g_signal_connect(G_OBJECT(rec_button),"toggled",(GCallback)linphone_gtk_start_record_sound,vbox);
@ -480,18 +483,23 @@ void linphone_gtk_audio_assistant_apply(GtkWidget *w){
void linphone_gtk_show_audio_assistant(void){
GtkWidget *w;
GtkWidget *welcome;
GtkWidget *mic_page;
GtkWidget *speaker_page;
GtkWidget *play_record_page;
GtkWidget *end_page;
if(audio_assistant!=NULL)
return;
w=audio_assistant=linphone_gtk_create_window("audio_assistant");
gtk_window_set_resizable (GTK_WINDOW(w), FALSE);
gtk_window_set_title(GTK_WINDOW(w),_("Audio Assistant"));
GtkWidget *welcome=create_intro();
GtkWidget *mic_page=create_mic_page();
GtkWidget *speaker_page=create_speaker_page();
GtkWidget *play_record_page=create_play_record_page();
GtkWidget *end_page=create_end_page();
welcome=create_intro();
mic_page=create_mic_page();
speaker_page=create_speaker_page();
play_record_page=create_play_record_page();
end_page=create_end_page();
gtk_assistant_append_page(GTK_ASSISTANT(w),welcome);
gtk_assistant_set_page_type(GTK_ASSISTANT(w),welcome,GTK_ASSISTANT_PAGE_INTRO);

View file

@ -36,7 +36,7 @@ void call_log_selection_changed(GtkTreeView *v){
GtkTreeSelection *select;
GtkTreeIter iter;
GtkTreeModel *model=NULL;
select = gtk_tree_view_get_selection(v);
if (select!=NULL){
if (gtk_tree_selection_get_selected (select, &model, &iter)){
@ -51,7 +51,7 @@ void call_log_selection_changed(GtkTreeView *v){
void linphone_gtk_call_log_chat_selected(GtkWidget *w){
GtkTreeSelection *select;
GtkTreeIter iter;
select=gtk_tree_view_get_selection(GTK_TREE_VIEW(w));
if (select!=NULL){
GtkTreeModel *model=NULL;
@ -72,7 +72,7 @@ void linphone_gtk_call_log_chat_selected(GtkWidget *w){
void linphone_gtk_call_log_add_contact(GtkWidget *w){
GtkTreeSelection *select;
GtkTreeIter iter;
select=gtk_tree_view_get_selection(GTK_TREE_VIEW(w));
if (select!=NULL){
GtkTreeModel *model=NULL;
@ -109,7 +109,7 @@ static bool_t put_selection_to_uribar(GtkWidget *treeview){
cl = (LinphoneCallLog *)pcl;
la = linphone_call_log_get_dir(cl)==LinphoneCallIncoming ? linphone_call_log_get_from(cl) : linphone_call_log_get_to(cl);
tmp = linphone_address_as_string(la);
if(tmp!=NULL)
if(tmp!=NULL)
gtk_entry_set_text(GTK_ENTRY(linphone_gtk_get_widget(linphone_gtk_get_main_window(),"uribar")),tmp);
ms_free(tmp);
return TRUE;
@ -133,7 +133,7 @@ static GtkWidget *linphone_gtk_create_call_log_menu(GtkWidget *call_log){
GtkWidget *image;
GtkTreeSelection *select;
GtkTreeIter iter;
select=gtk_tree_view_get_selection(GTK_TREE_VIEW(call_log));
if (select!=NULL){
GtkTreeModel *model=NULL;
@ -202,7 +202,7 @@ void linphone_gtk_call_log_clear_missed_call(){
GtkWidget *image=gtk_image_new_from_stock(GTK_STOCK_REFRESH,GTK_ICON_SIZE_MENU);
GtkWidget *l;
const gchar*text=gtk_label_get_text(GTK_LABEL(linphone_gtk_get_widget(mw,"label3")));
l=gtk_label_new(text);
gtk_box_pack_start(GTK_BOX(box),image,FALSE,FALSE,0);
gtk_box_pack_start(GTK_BOX(box),l,FALSE,FALSE,0);
@ -228,7 +228,7 @@ void linphone_gtk_call_log_display_missed_call(int nb){
GtkWidget *image=gtk_image_new_from_stock(GTK_STOCK_REFRESH,GTK_ICON_SIZE_MENU);
GtkWidget *l;
gchar *buf;
buf=g_markup_printf_escaped(_("<b>Recent calls (%i)</b>"),nb);
l=gtk_label_new(NULL);
gtk_label_set_markup(GTK_LABEL(l),buf);
@ -281,7 +281,9 @@ void linphone_gtk_call_log_update(GtkWidget *w){
LinphoneFriend *lf=NULL;
int duration=linphone_call_log_get_duration(cl);
time_t start_date_time=linphone_call_log_get_start_date(cl);
GdkPixbuf *incoming;
GdkPixbuf *outgoing;
#if GLIB_CHECK_VERSION(2,26,0)
if (start_date_time){
GDateTime *dt=g_date_time_new_from_unix_local(start_date_time);
@ -332,7 +334,7 @@ void linphone_gtk_call_log_update(GtkWidget *w){
if (status==NULL) {
headtxt=g_markup_printf_escaped(_("<big><b>%s</b></big>\t%s"),display,start_date ? start_date : "");
logtxt=g_markup_printf_escaped(
_("<small><i>%s</i>\t"
_("<small><i>%s</i>\t"
"<i>Quality: %s</i></small>\n%s\t%s\t"),
addr, quality, minutes, seconds);
} else {
@ -346,8 +348,8 @@ void linphone_gtk_call_log_update(GtkWidget *w){
if (start_date) g_free(start_date);
gtk_tree_store_append (store,&iter,NULL);
GdkPixbuf *incoming = create_pixbuf("call_status_incoming.png");
GdkPixbuf *outgoing = create_pixbuf("call_status_outgoing.png");
incoming = create_pixbuf("call_status_incoming.png");
outgoing = create_pixbuf("call_status_outgoing.png");
gtk_tree_store_set (store,&iter,
0, linphone_call_log_get_dir(cl)==LinphoneCallOutgoing ? outgoing : incoming,
1, headtxt,2,cl,-1);

View file

@ -30,9 +30,9 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
const char *linphone_gtk_message_storage_get_db_file(const char *filename){
const int path_max=1024;
static char *db_file=NULL;
if (db_file) return db_file;
db_file=(char *)malloc(path_max*sizeof(char));
if (filename==NULL) filename=CONFIG_FILE;
/*try accessing a local file first if exists*/
@ -63,7 +63,7 @@ void linphone_gtk_quit_chatroom(LinphoneChatRoom *cr) {
GtkWidget *w=g_object_get_data(G_OBJECT(friendlist),"chatview");
gchar *from;
GHashTable *table=g_object_get_data(G_OBJECT(w),"table");
g_return_if_fail(w!=NULL);
gtk_notebook_remove_page(GTK_NOTEBOOK(nb),gtk_notebook_page_num(GTK_NOTEBOOK(nb),w));
linphone_chat_room_mark_as_read(cr);
@ -95,7 +95,7 @@ GtkWidget *create_tab_chat_header(LinphoneChatRoom *cr,const LinphoneAddress *ur
GtkWidget *l;
GtkWidget *image=gtk_image_new_from_stock(GTK_STOCK_CLOSE,GTK_ICON_SIZE_MENU);
GtkWidget *b=gtk_button_new();
gtk_button_set_image(GTK_BUTTON(b),image);
gtk_button_set_relief(GTK_BUTTON(b),GTK_RELIEF_NONE);
gtk_widget_set_size_request(b,25,20);
@ -131,14 +131,15 @@ void udpate_tab_chat_header(GtkWidget *chat_view,const LinphoneAddress *uri,Linp
static gboolean scroll_to_end(GtkTextView *w){
GtkTextBuffer *buffer=gtk_text_view_get_buffer(w);
GtkTextMark *mark;
GtkTextIter iter;
gtk_text_buffer_get_end_iter(buffer,&iter);
GtkTextMark *mark=gtk_text_buffer_create_mark(buffer,NULL,&iter,FALSE);
gtk_text_view_scroll_mark_onscreen(w,mark);
mark=gtk_text_buffer_create_mark(buffer,NULL,&iter,FALSE);
gtk_text_view_scroll_mark_onscreen(w,mark);
return FALSE;
}
void linphone_gtk_push_text(GtkWidget *w, const LinphoneAddress *from,
void linphone_gtk_push_text(GtkWidget *w, const LinphoneAddress *from,
gboolean me,LinphoneChatRoom *cr,LinphoneChatMessage *msg, gboolean hist){
GtkTextView *text=GTK_TEXT_VIEW(linphone_gtk_get_widget(w,"textview"));
GtkTextBuffer *buffer=gtk_text_view_get_buffer(text);
@ -153,7 +154,7 @@ void linphone_gtk_push_text(GtkWidget *w, const LinphoneAddress *from,
struct tm *tm;
int tnow_day;
int tnow_year;
gtk_text_buffer_get_start_iter(buffer,&begin);
gtk_text_buffer_get_end_iter(buffer,&iter);
off=gtk_text_iter_get_offset(&iter);
@ -178,7 +179,7 @@ void linphone_gtk_push_text(GtkWidget *w, const LinphoneAddress *from,
case LinphoneChatMessageStateInProgress:
{
g_hash_table_insert(table,(gpointer)msg,GINT_TO_POINTER(gtk_text_iter_get_line(&iter)));
gtk_text_buffer_insert_with_tags_by_name(buffer,&iter,"Sending ..",-1,
gtk_text_buffer_insert_with_tags_by_name(buffer,&iter,"Sending ..",-1,
"right","small","italic","font_grey","bg",NULL);
g_object_set_data(G_OBJECT(w),"table",table);
break;
@ -195,15 +196,15 @@ void linphone_gtk_push_text(GtkWidget *w, const LinphoneAddress *from,
} else {
strftime(buf,80,"%H:%M",tm);
}
gtk_text_buffer_insert_with_tags_by_name(buffer,&iter,buf,-1,
gtk_text_buffer_insert_with_tags_by_name(buffer,&iter,buf,-1,
"right","small","italic","font_grey",me ? "bg":NULL,NULL);
break;
}
case LinphoneChatMessageStateNotDelivered:
gtk_text_buffer_insert_with_tags_by_name(buffer,&iter,"Message not sent",-1,
gtk_text_buffer_insert_with_tags_by_name(buffer,&iter,"Message not sent",-1,
"right","small","italic","font_grey",me ? "bg":NULL,NULL);
break;
default : gtk_text_buffer_insert_with_tags_by_name(buffer,&iter,"Sending ..",-1,
default : gtk_text_buffer_insert_with_tags_by_name(buffer,&iter,"Sending ..",-1,
"right","small","italic","font_grey",me ? "bg":NULL,NULL);
}
gtk_text_buffer_get_end_iter(buffer,&iter);
@ -225,7 +226,7 @@ void update_chat_state_message(LinphoneChatMessageState state,LinphoneChatMessag
GtkWidget *friendlist=linphone_gtk_get_widget(main_window,"contact_list");
GtkWidget *page=(GtkWidget*)g_object_get_data(G_OBJECT(friendlist),"chatview");
GHashTable *table=(GHashTable*)g_object_get_data(G_OBJECT(page),"table");
if(page!=NULL){
GtkTextView *text=GTK_TEXT_VIEW(linphone_gtk_get_widget(page,"textview"));
GtkTextBuffer *b=gtk_text_view_get_buffer(text);
@ -272,7 +273,7 @@ void update_chat_state_message(LinphoneChatMessageState state,LinphoneChatMessag
gtk_text_buffer_insert_with_tags_by_name(b,&iter,result,-1,
"right","small","italic","font_grey","bg",NULL);
g_object_set_data(G_OBJECT(page),"table",table);
}
}
}
static void on_chat_state_changed(LinphoneChatMessage *msg, LinphoneChatMessageState state, void *user_pointer){
@ -330,8 +331,8 @@ void display_history_message(GtkWidget *chat_view,MSList *messages,const Linphon
LinphoneChatMessage *msg=(LinphoneChatMessage *)it->data;
from_str=linphone_address_as_string_uri_only(linphone_chat_message_get_from(msg));
with_str=linphone_address_as_string_uri_only(with);
linphone_gtk_push_text(chat_view,strcmp(from_str,with_str)==0? with :
linphone_chat_message_get_from(msg),
linphone_gtk_push_text(chat_view,strcmp(from_str,with_str)==0? with :
linphone_chat_message_get_from(msg),
strcmp(from_str,with_str)==0? FALSE : TRUE,
linphone_chat_message_get_chat_room(msg),msg,TRUE);
}
@ -343,7 +344,7 @@ void display_history_message(GtkWidget *chat_view,MSList *messages,const Linphon
ms_free(from_str);
ms_free(with_str);
linphone_gtk_free_list(messages);
}
}
}
void linphone_gtk_chat_add_contact(const LinphoneAddress *addr){
@ -445,7 +446,7 @@ void linphone_gtk_load_chatroom(LinphoneChatRoom *cr,const LinphoneAddress *uri,
char *uri_str=linphone_address_as_string(uri);
char *uri_only=linphone_address_as_string_uri_only(uri);
MSList *messages=NULL;
if(g_strcmp0(from_str,uri_only)!=0){
GtkTextView *text_view=GTK_TEXT_VIEW(linphone_gtk_get_widget(chat_view,"textview"));
GtkTextIter start;
@ -483,7 +484,7 @@ void linphone_gtk_text_received ( LinphoneCore *lc, LinphoneChatRoom *room,
gboolean send=TRUE;
/*GtkNotebook *notebook= ( GtkNotebook * ) linphone_gtk_get_widget ( main_window,"viewswitch" );*/
const LinphoneAddress *from= linphone_chat_message_get_from ( msg );
w= ( GtkWidget* ) g_object_get_data ( G_OBJECT ( friendlist ),"chatview" );
if ( w!=NULL ) {
/* Chat window opened */
@ -496,7 +497,7 @@ void linphone_gtk_text_received ( LinphoneCore *lc, LinphoneChatRoom *room,
}
send=FALSE;
}
} else {
} else {
/* Chat window closed */
#ifdef MSG_STORAGE_ENABLED
send=FALSE;
@ -530,7 +531,7 @@ void linphone_gtk_text_received ( LinphoneCore *lc, LinphoneChatRoom *room,
}
linphone_core_play_local(lc,linphone_gtk_get_sound_path("incoming_chat.wav"));
linphone_gtk_show_friends();
}
void linphone_gtk_is_composing_received(LinphoneCore *lc, LinphoneChatRoom *room) {

View file

@ -61,9 +61,9 @@ static GtkWidget *find_conferencee_from_call(LinphoneCall *call){
GtkWidget *conferencee_box=get_conferencee_box(mw);
GList *elem;
GtkWidget *ret=NULL;
if (conferencee_box==NULL) return NULL;
if (call!=NULL){
GList *l=gtk_container_get_children(GTK_CONTAINER(conferencee_box));
for(elem=l;elem!=NULL;elem=elem->next){
@ -87,13 +87,14 @@ static GtkWidget * create_conference_panel(void){
GtkWidget *image=create_pixmap("stopcall-small.png");
GtkWidget *box;
GtkWidget *viewswitch=linphone_gtk_get_widget(mw,"viewswitch");
GtkWidget *participant;
gtk_button_set_image(GTK_BUTTON(button_conf),image);
g_signal_connect_swapped(G_OBJECT(button_conf),"clicked",(GCallback)linphone_gtk_terminate_call,NULL);
g_object_set_data(G_OBJECT(mw),"conf_frame",(gpointer)conf_frame);
box=gtk_vbox_new(FALSE,0);
GtkWidget *participant=linphone_gtk_create_widget("main","callee_frame");
participant=linphone_gtk_create_widget("main","callee_frame");
gtk_widget_show(participant);
gtk_box_set_homogeneous(GTK_BOX(box),TRUE);
init_local_participant(participant);
@ -101,7 +102,7 @@ static GtkWidget * create_conference_panel(void){
gtk_widget_show(box);
g_object_set_data(G_OBJECT(mw),"conferencee_box",box);
gtk_box_pack_start(GTK_BOX(conf_box),box,FALSE,FALSE,PADDING_PIXELS);
gtk_notebook_append_page(GTK_NOTEBOOK(viewswitch),conf_frame,
create_conference_label());
return conf_frame;
@ -111,19 +112,20 @@ void linphone_gtk_set_in_conference(LinphoneCall *call){
GtkWidget *mw=linphone_gtk_get_main_window();
GtkWidget *conf_frame=(GtkWidget *)g_object_get_data(G_OBJECT(mw),"conf_frame");
GtkWidget *viewswitch=linphone_gtk_get_widget(mw,"viewswitch");
GtkWidget *participant;
if(conf_frame==NULL){
conf_frame=create_conference_panel();
}
GtkWidget *participant=find_conferencee_from_call(call);
participant=find_conferencee_from_call(call);
if (participant==NULL){
/*create and add it */
GtkWidget *conferencee_box=get_conferencee_box(mw);
GtkWidget *sound_meter;
const LinphoneAddress *addr=linphone_call_get_remote_address(call);
gchar *markup;
participant=linphone_gtk_create_widget("main","callee_frame");
gtk_widget_show(participant);
if (linphone_address_get_display_name(addr)!=NULL){
@ -153,13 +155,13 @@ void linphone_gtk_terminate_conference_participant(LinphoneCall *call){
void linphone_gtk_unset_from_conference(LinphoneCall *call){
GtkWidget *frame=find_conferencee_from_call(call);
if (frame){
GtkWidget *mw=linphone_gtk_get_main_window();
GtkWidget *conf_frame=(GtkWidget *)g_object_get_data(G_OBJECT(mw),"conf_frame");
GtkWidget *conferencee_box=g_object_get_data(G_OBJECT(mw),"conferencee_box");
GList *children;
g_message("Removing a participant from conference");
gtk_widget_destroy(frame);
children=gtk_container_get_children(GTK_CONTAINER(conferencee_box));

View file

@ -198,7 +198,7 @@ void linphone_gtk_delete_history(GtkWidget *button){
GtkWidget *chat_view;
LinphoneFriend *lf=NULL;
GtkWidget *friendlist;
friendlist=linphone_gtk_get_widget(w,"contact_list");
chat_view=(GtkWidget *)g_object_get_data(G_OBJECT(friendlist),"chatview");
select = gtk_tree_view_get_selection(GTK_TREE_VIEW(friendlist));
@ -216,7 +216,7 @@ void linphone_gtk_delete_history(GtkWidget *button){
GtkTextIter start;
GtkTextIter end;
GtkTextBuffer *text_buffer;
text_buffer=gtk_text_view_get_buffer(text_view);
gtk_text_buffer_get_bounds(text_buffer, &start, &end);
gtk_text_buffer_delete (text_buffer, &start, &end);
@ -290,7 +290,7 @@ void linphone_gtk_friend_list_set_chat_conversation(const LinphoneAddress *la){
LinphoneFriend *lf=NULL;
LinphoneChatRoom *cr=NULL;
GtkNotebook *notebook=(GtkNotebook *)linphone_gtk_get_widget(w,"viewswitch");
lf=linphone_core_find_friend(linphone_gtk_get_core(),la);
if(lf==NULL){
cr=linphone_gtk_create_chatroom(la);
@ -331,7 +331,7 @@ void linphone_gtk_friend_list_set_chat_conversation(const LinphoneAddress *la){
}
}while(gtk_tree_model_iter_next(model,&iter));
}
}
}
}
void linphone_gtk_notebook_tab_select(GtkNotebook *notebook,GtkWidget *page,guint page_num, gpointer data){
@ -595,11 +595,11 @@ static int get_friend_weight(const LinphoneFriend *lf){
int w=0;
LinphoneCore *lc=linphone_gtk_get_core();
LinphoneChatRoom *cr=linphone_core_get_chat_room(lc,linphone_friend_get_address(lf));
if (cr && linphone_chat_room_get_unread_messages_count(cr)>0){
w+=2000;
}
switch(linphone_friend_get_status(lf)){
case LinphoneStatusOnline:
w+=1000;
@ -685,7 +685,7 @@ static void linphone_gtk_friend_list_init(GtkWidget *friendlist){
gtk_tree_view_set_search_equal_func(GTK_TREE_VIEW(friendlist),friend_search_func,NULL,NULL);
gtk_tree_view_set_search_column(GTK_TREE_VIEW(friendlist),FRIEND_NAME);
gtk_tree_sortable_set_sort_func(GTK_TREE_SORTABLE(store),FRIEND_NAME,friend_sort,NULL,NULL);
/*Name and presence column*/
renderer = gtk_cell_renderer_text_new ();
column = gtk_tree_view_column_new_with_attributes (_("Presence status"),
@ -781,8 +781,9 @@ gboolean linphone_gtk_directory_search_focus_in(GtkWidget *entry){
void linphone_gtk_directory_search_activate(GtkWidget *entry){
LinphoneProxyConfig *cfg;
GtkWidget *w;
linphone_core_get_default_proxy(linphone_gtk_get_core(),&cfg);
GtkWidget *w=linphone_gtk_show_buddy_lookup_window(linphone_proxy_config_get_sip_setup_context(cfg));
w=linphone_gtk_show_buddy_lookup_window(linphone_proxy_config_get_sip_setup_context(cfg));
if (GPOINTER_TO_INT(g_object_get_data(G_OBJECT(entry),"active"))==1)
linphone_gtk_buddy_lookup_set_keyword(w,gtk_entry_get_text(GTK_ENTRY(entry)));
}
@ -809,7 +810,7 @@ void linphone_gtk_show_friends(void){
if (gtk_tree_view_get_model(GTK_TREE_VIEW(friendlist))==NULL){
linphone_gtk_friend_list_init(friendlist);
}
store=GTK_LIST_STORE(gtk_tree_view_get_model(GTK_TREE_VIEW(friendlist)));
gtk_list_store_clear(store);
@ -1076,7 +1077,7 @@ static gint tree_view_get_cell_from_pos(GtkTreeView *view, guint x, guint y){
gint colx = 0;
GtkTreePath *path;
GtkTreeViewDropPosition pos;
g_return_val_if_fail ( view != NULL, 0 );
columns = gtk_tree_view_get_columns(view);
@ -1086,8 +1087,7 @@ static gint tree_view_get_cell_from_pos(GtkTreeView *view, guint x, guint y){
GtkTreeViewColumn *checkcol = (GtkTreeViewColumn*) node->data;
if (x >= colx && x < (colx + checkcol->width)){
col = checkcol;
gint num = get_col_number_from_tree_view_column(col);
return num;
return get_col_number_from_tree_view_column(col);
} else {
colx += checkcol->width;
}

View file

@ -269,7 +269,7 @@ static void _refresh_call_stats(GtkWidget *callstats, LinphoneCall *call){
gtk_label_set_markup(GTK_LABEL(linphone_gtk_get_widget(callstats,"audio_bandwidth_usage")),tmp);
g_free(tmp);
if (has_video){
gchar *size_r=g_strdup_printf(_("%ix%i @ %f fps"),size_received.width,size_received.height,
gchar *size_r=g_strdup_printf(_("%ix%i @ %f fps"),size_received.width,size_received.height,
linphone_call_params_get_received_framerate(curparams));
gchar *size_s=g_strdup_printf(_("%ix%i @ %f fps"),size_sent.width,size_sent.height,
linphone_call_params_get_sent_framerate(curparams));
@ -366,6 +366,11 @@ void linphone_gtk_create_in_call_view(LinphoneCall *call){
GtkNotebook *notebook=(GtkNotebook *)linphone_gtk_get_widget(main_window,"viewswitch");
static int call_index=1;
int idx;
GtkWidget *transfer;
GtkWidget *conf;
GtkWidget *button;
GtkWidget *image;
if (ms_list_size(linphone_core_get_calls(linphone_gtk_get_core()))==1){
/*this is the only call at this time */
@ -386,19 +391,19 @@ void linphone_gtk_create_in_call_view(LinphoneCall *call){
linphone_gtk_enable_mute_button(
GTK_BUTTON(linphone_gtk_get_widget(call_view,"incall_mute")),FALSE);
GtkWidget *transfer = linphone_gtk_get_widget(call_view,"transfer_button");
transfer = linphone_gtk_get_widget(call_view,"transfer_button");
gtk_button_set_image(GTK_BUTTON(transfer),gtk_image_new_from_stock
(GTK_STOCK_GO_FORWARD,GTK_ICON_SIZE_BUTTON));
g_signal_connect(G_OBJECT(transfer),"clicked",(GCallback)transfer_button_clicked,call);
gtk_widget_hide(transfer);
GtkWidget *conf = linphone_gtk_get_widget(call_view,"conference_button");
conf = linphone_gtk_get_widget(call_view,"conference_button");
gtk_button_set_image(GTK_BUTTON(conf),gtk_image_new_from_stock (GTK_STOCK_ADD,GTK_ICON_SIZE_BUTTON));
g_signal_connect(G_OBJECT(conf),"clicked",(GCallback)conference_button_clicked,call);
gtk_widget_hide(conf);
GtkWidget *button=linphone_gtk_get_widget(call_view,"terminate_call");
GtkWidget *image=create_pixmap("stopcall-small.png");
button=linphone_gtk_get_widget(call_view,"terminate_call");
image=create_pixmap("stopcall-small.png");
gtk_button_set_label(GTK_BUTTON(button),_("Hang up"));
gtk_button_set_image(GTK_BUTTON(button),image);
gtk_widget_show(image);
@ -418,6 +423,7 @@ static void video_button_clicked(GtkWidget *button, LinphoneCall *call){
void linphone_gtk_update_video_button(LinphoneCall *call){
GtkWidget *call_view=(GtkWidget*)linphone_call_get_user_pointer(call);
GtkWidget *button;
GtkWidget *conf_frame;
const LinphoneCallParams *params=linphone_call_get_current_params(call);
gboolean has_video=linphone_call_params_video_enabled(params);
if (call_view==NULL) return;
@ -434,7 +440,7 @@ void linphone_gtk_update_video_button(LinphoneCall *call){
g_signal_connect(G_OBJECT(button),"clicked",(GCallback)video_button_clicked,call);
g_object_set_data(G_OBJECT(button),"signal_connected",GINT_TO_POINTER(1));
}
GtkWidget *conf_frame=(GtkWidget *)g_object_get_data(G_OBJECT(linphone_gtk_get_main_window()),"conf_frame");
conf_frame=(GtkWidget *)g_object_get_data(G_OBJECT(linphone_gtk_get_main_window()),"conf_frame");
gtk_widget_set_sensitive(button,linphone_call_get_state(call)==LinphoneCallStreamsRunning);
if(conf_frame!=NULL){
gtk_widget_set_sensitive(button,FALSE);
@ -753,10 +759,13 @@ static gboolean in_call_view_terminated(LinphoneCall *call){
void linphone_gtk_in_call_view_terminate(LinphoneCall *call, const char *error_msg){
GtkWidget *callview=(GtkWidget*)linphone_call_get_user_pointer(call);
GtkWidget *status;
gboolean in_conf;
guint taskid;
if(callview==NULL) return;
GtkWidget *status=linphone_gtk_get_widget(callview,"in_call_status");
guint taskid=GPOINTER_TO_INT(g_object_get_data(G_OBJECT(callview),"taskid"));
gboolean in_conf=linphone_call_params_get_local_conference_mode(linphone_call_get_current_params(call));
status=linphone_gtk_get_widget(callview,"in_call_status");
taskid=GPOINTER_TO_INT(g_object_get_data(G_OBJECT(callview),"taskid"));
in_conf=linphone_call_params_get_local_conference_mode(linphone_call_get_current_params(call));
if (status==NULL) return;
if (error_msg==NULL)
@ -896,8 +905,9 @@ void linphone_gtk_record_call_toggled(GtkWidget *button){
GtkWidget *callview;
GtkWidget *label;
if (call){
const LinphoneCallParams *params;
callview=(GtkWidget*)linphone_call_get_user_pointer (call);
const LinphoneCallParams *params=linphone_call_get_current_params(call);
params=linphone_call_get_current_params(call);
filepath=linphone_call_params_get_record_file(params);
label=linphone_gtk_get_widget(callview,"record_status");
}else if (is_conf){

View file

@ -864,7 +864,7 @@ static gboolean launch_contact_provider_search(void *userdata)
if( ldap && strlen(predicate) >= 3 ){ // don't search too small predicates
unsigned int max_res_count = linphone_ldap_contact_provider_get_max_result(ldap);
LinphoneContactSearch* search;
if( previous_search &&
(strstr(predicate, previous_search) == predicate) && // last search contained results from this one
(prev_res_count != max_res_count) ){ // and we didn't reach the max result limit
@ -879,7 +879,7 @@ static gboolean launch_contact_provider_search(void *userdata)
gtk_object_set_data(GTK_OBJECT(uribar), "previous_search", ms_strdup(predicate));
ms_message("launch_contact_provider_search");
LinphoneContactSearch* search =linphone_contact_provider_begin_search(
search =linphone_contact_provider_begin_search(
linphone_contact_provider_cast(ldap_provider),
predicate, on_contact_provider_search_results, uribar
);
@ -940,6 +940,7 @@ static void linphone_gtk_update_call_buttons(LinphoneCall *call){
//bool_t stop_active=FALSE;
bool_t add_call=FALSE;
int call_list_size=ms_list_size(calls);
GtkWidget *conf_frame;
if (calls==NULL){
start_active=TRUE;
@ -962,7 +963,7 @@ static void linphone_gtk_update_call_buttons(LinphoneCall *call){
gtk_widget_set_visible(button,add_call);
//gtk_widget_set_sensitive(linphone_gtk_get_widget(mw,"terminate_call"),stop_active);
GtkWidget *conf_frame=(GtkWidget *)g_object_get_data(G_OBJECT(mw),"conf_frame");
conf_frame=(GtkWidget *)g_object_get_data(G_OBJECT(mw),"conf_frame");
if(conf_frame==NULL){
linphone_gtk_enable_transfer_button(lc,call_list_size>1);
linphone_gtk_enable_conference_button(lc,call_list_size>1);
@ -1000,7 +1001,7 @@ gchar *linphone_gtk_get_record_path(const LinphoneAddress *address, gboolean is_
break;
}
}
if (address){
id=linphone_address_get_username(address);
if (id==NULL) id=linphone_address_get_domain(address);
@ -1172,13 +1173,14 @@ static void linphone_gtk_new_subscriber_response(GtkWidget *dialog, guint respon
static void linphone_gtk_new_unknown_subscriber(LinphoneCore *lc, LinphoneFriend *lf, const char *url){
GtkWidget *dialog;
gchar *message;
if (linphone_gtk_get_ui_config_int("subscribe_deny_all",0)){
linphone_core_reject_subscriber(linphone_gtk_get_core(),lf);
return;
}
gchar *message=g_strdup_printf(_("%s would like to add you to his contact list.\nWould you allow him to see your presence status or add him to your contact list ?\nIf you answer no, this person will be temporarily blacklisted."),url);
message=g_strdup_printf(_("%s would like to add you to his contact list.\nWould you allow him to see your presence status or add him to your contact list ?\nIf you answer no, this person will be temporarily blacklisted."),url);
dialog = gtk_message_dialog_new (
GTK_WINDOW(linphone_gtk_get_main_window()),
GTK_DIALOG_DESTROY_WITH_PARENT,
@ -2001,10 +2003,11 @@ void linphone_gtk_keypad_key_released(GtkWidget *w, GdkEvent *event, gpointer us
void linphone_gtk_create_keypad(GtkWidget *button){
GtkWidget *mw=linphone_gtk_get_main_window();
GtkWidget *k=(GtkWidget *)g_object_get_data(G_OBJECT(mw),"keypad");
GtkWidget *keypad;
if(k!=NULL){
gtk_widget_destroy(k);
}
GtkWidget *keypad=linphone_gtk_create_window("keypad");
keypad=linphone_gtk_create_window("keypad");
linphone_gtk_connect_digits(keypad);
linphone_gtk_init_dtmf_table(keypad);
g_object_set_data(G_OBJECT(mw),"keypad",(gpointer)keypad);

View file

@ -179,6 +179,7 @@ void linphone_gtk_ldap_save(GtkWidget *button)
GtkEntry* entry;
GtkToggleButton* toggle;
GtkSpinButton* spin;
GtkComboBox* cbox;
ms_message("SAVE LDAP");
@ -204,7 +205,7 @@ void linphone_gtk_ldap_save(GtkWidget *button)
linphone_dictionary_set_string(dict, "sasl_realm", gtk_entry_get_text(entry));
GtkComboBox* cbox = GTK_COMBO_BOX(linphone_gtk_get_widget(ldap_widget,"ldap_auth_method"));
cbox = GTK_COMBO_BOX(linphone_gtk_get_widget(ldap_widget,"ldap_auth_method"));
linphone_dictionary_set_string(dict, "auth_method", gtk_combo_box_get_active_text(cbox));
entry = GTK_ENTRY(linphone_gtk_get_widget(ldap_widget,"ldap_base_object"));
@ -245,10 +246,11 @@ void linphone_gtk_ldap_save(GtkWidget *button)
}
void linphone_gtk_fill_video_sizes(GtkWidget *combo){
const MSVideoSizeDef *def=linphone_core_get_supported_video_sizes(linphone_gtk_get_core());;
int i,active=0;
int i;
int active=0;
char vsize_def[256];
MSVideoSize cur=linphone_core_get_preferred_video_size(linphone_gtk_get_core());
const MSVideoSizeDef *def=linphone_core_get_supported_video_sizes(linphone_gtk_get_core());;
/* glade creates a combo box without list model and text renderer,
unless we fill it with a dummy text.
This dummy text needs to be removed first*/
@ -1098,14 +1100,14 @@ static void linphone_gtk_fill_langs(GtkWidget *pb){
const char *all_langs="C " LINPHONE_ALL_LANGS;
const char *name;
int i=0,index=0;
int cur_lang_index=-1;
char text[256]={0};
const char *cur_lang;
#if defined(WIN32) || defined(__APPLE__)
cur_lang=getenv("LANG");
#else
cur_lang=getenv("LANGUAGE");
#endif
int cur_lang_index=-1;
char text[256]={0};
if (cur_lang==NULL) cur_lang="C";
/* glade creates a combo box without list model and text renderer,
unless we fill it with a dummy text.

View file

@ -44,7 +44,7 @@ static GtkWidget *create_setup_signin_choice(){
GtkWidget *t2=gtk_radio_button_new_with_label_from_widget(GTK_RADIO_BUTTON(t1),_("I have already a linphone.org account and I just want to use it"));
GtkWidget *t3=gtk_radio_button_new_with_label_from_widget(GTK_RADIO_BUTTON(t1),_("I have already a sip account and I just want to use it"));
GtkWidget *t4=gtk_radio_button_new_with_label_from_widget(GTK_RADIO_BUTTON(t1),_("I want to specify a remote configuration URI"));
gtk_box_pack_start (GTK_BOX (vbox), t1, TRUE, TRUE, 2);
gtk_box_pack_start (GTK_BOX (vbox), t2, TRUE, TRUE, 2);
gtk_box_pack_start (GTK_BOX (vbox), t3, TRUE, TRUE, 2);
@ -89,14 +89,20 @@ static GtkWidget *create_linphone_account_informations_page() {
GtkWidget *label=gtk_label_new(_("Enter your linphone.org username"));
GdkColor color;
GtkWidget *labelEmpty;
GtkWidget *labelUsername;
GtkWidget *entryUsername;
GtkWidget *labelPassword;
GtkWidget *entryPassword;
gdk_color_parse ("red", &color);
GtkWidget *labelEmpty=gtk_label_new(NULL);
labelEmpty=gtk_label_new(NULL);
gtk_widget_modify_fg(labelEmpty, GTK_STATE_NORMAL, &color);
GtkWidget *labelUsername=gtk_label_new(_("Username:"));
GtkWidget *entryUsername=gtk_entry_new();
GtkWidget *labelPassword=gtk_label_new(_("Password:"));
GtkWidget *entryPassword=gtk_entry_new();
labelUsername=gtk_label_new(_("Username:"));
entryUsername=gtk_entry_new();
labelPassword=gtk_label_new(_("Password:"));
entryPassword=gtk_entry_new();
gtk_entry_set_visibility(GTK_ENTRY(entryPassword), FALSE);
gtk_table_attach_defaults(GTK_TABLE(vbox), label, 0, 2, 0, 1);
@ -118,19 +124,28 @@ static GtkWidget *create_account_informations_page() {
GtkWidget *label=gtk_label_new(_("Enter your account informations"));
GdkColor color;
GtkWidget *labelEmpty;
GtkWidget *labelUsername;
GtkWidget *labelPassword;
GtkWidget *entryPassword;
GtkWidget *labelDomain;
GtkWidget *labelProxy;
GtkWidget *entryUsername;
GtkWidget *entryDomain;
GtkWidget *entryRoute;
gdk_color_parse ("red", &color);
GtkWidget *labelEmpty=gtk_label_new(NULL);
labelEmpty=gtk_label_new(NULL);
gtk_widget_modify_fg(labelEmpty, GTK_STATE_NORMAL, &color);
GtkWidget *labelUsername=gtk_label_new(_("Username*"));
GtkWidget *labelPassword=gtk_label_new(_("Password*"));
GtkWidget *entryPassword=gtk_entry_new();
labelUsername=gtk_label_new(_("Username*"));
labelPassword=gtk_label_new(_("Password*"));
entryPassword=gtk_entry_new();
gtk_entry_set_visibility(GTK_ENTRY(entryPassword), FALSE);
GtkWidget *labelDomain=gtk_label_new(_("Domain*"));
GtkWidget *labelProxy=gtk_label_new(_("Proxy"));
GtkWidget *entryUsername=gtk_entry_new();
GtkWidget *entryDomain=gtk_entry_new();
GtkWidget *entryRoute=gtk_entry_new();
labelDomain=gtk_label_new(_("Domain*"));
labelProxy=gtk_label_new(_("Proxy"));
entryUsername=gtk_entry_new();
entryDomain=gtk_entry_new();
entryRoute=gtk_entry_new();
gtk_table_attach_defaults(GTK_TABLE(vbox), label, 0, 2, 0, 1);
gtk_table_attach_defaults(GTK_TABLE(vbox), labelUsername, 0, 1, 1, 2);
@ -309,19 +324,25 @@ static GtkWidget *create_account_information_page() {
GtkWidget *labelPassword2=gtk_label_new(_("Confirm your password: (*)"));
GtkWidget *entryUsername=gtk_entry_new();
GtkWidget *entryPassword=gtk_entry_new();
gtk_entry_set_visibility(GTK_ENTRY(entryPassword), FALSE);
GtkWidget *entryEmail=gtk_entry_new();
GtkWidget *entryPassword2=gtk_entry_new();
gtk_entry_set_visibility(GTK_ENTRY(entryPassword2), FALSE);
GtkWidget *checkNewsletter=gtk_check_button_new_with_label("Keep me informed with linphone updates");
GtkWidget *entryEmail;
GtkWidget *entryPassword2;
GtkWidget *checkNewsletter;
GtkWidget *labelError;
GtkWidget *passwordVbox1;
GtkWidget *passwordVbox2;
GdkColor color;
gtk_entry_set_visibility(GTK_ENTRY(entryPassword), FALSE);
entryEmail=gtk_entry_new();
entryPassword2=gtk_entry_new();
gtk_entry_set_visibility(GTK_ENTRY(entryPassword2), FALSE);
checkNewsletter=gtk_check_button_new_with_label("Keep me informed with linphone updates");
gdk_color_parse ("red", &color);
GtkWidget *labelError=gtk_label_new(NULL);
labelError=gtk_label_new(NULL);
gtk_widget_modify_fg(labelError, GTK_STATE_NORMAL, &color);
GtkWidget *passwordVbox1=gtk_vbox_new(FALSE,2);
GtkWidget *passwordVbox2=gtk_vbox_new(FALSE,2);
passwordVbox1=gtk_vbox_new(FALSE,2);
passwordVbox2=gtk_vbox_new(FALSE,2);
gtk_box_pack_start (GTK_BOX (passwordVbox1), labelPassword, TRUE, FALSE, 2);
gtk_box_pack_start (GTK_BOX (passwordVbox1), labelPassword2, TRUE, FALSE, 2);
gtk_box_pack_start (GTK_BOX (passwordVbox2), entryPassword, TRUE, FALSE, 2);
@ -414,6 +435,8 @@ static void linphone_gtk_assistant_prepare(GtkWidget *assistant, GtkWidget *page
if (pagenum == 5) {
gtk_assistant_commit(GTK_ASSISTANT(assistant));
} else if (pagenum == gtk_assistant_get_n_pages(GTK_ASSISTANT(assistant)) - 1) {
LinphoneAddress *identity;
LinphoneAuthInfo *info;
// Saving the account and making it default
LinphoneAccountCreator *creator=linphone_gtk_assistant_get_creator(assistant);
LinphoneProxyConfig *cfg=linphone_proxy_config_new();
@ -424,11 +447,11 @@ static void linphone_gtk_assistant_prepare(GtkWidget *assistant, GtkWidget *page
linphone_proxy_config_enable_publish(cfg, FALSE);
linphone_proxy_config_enable_register(cfg, TRUE);
LinphoneAddress *identity = linphone_address_new(creator->username);
LinphoneAuthInfo *info=linphone_auth_info_new(linphone_address_get_username(identity), NULL, creator->password, NULL, NULL, linphone_address_get_domain(identity));
identity = linphone_address_new(creator->username);
info=linphone_auth_info_new(linphone_address_get_username(identity), NULL, creator->password, NULL, NULL, linphone_address_get_domain(identity));
linphone_core_add_auth_info(linphone_gtk_get_core(),info);
linphone_address_destroy(identity);
if (strcmp(creator->domain, "sip:sip.linphone.org") == 0 ){
linphone_proxy_config_enable_avpf(cfg,TRUE);
// If account created on sip.linphone.org, we configure linphone to use TLS by default
@ -443,14 +466,14 @@ static void linphone_gtk_assistant_prepare(GtkWidget *assistant, GtkWidget *page
linphone_address_destroy(addr);
}
}
if (linphone_core_add_proxy_config(linphone_gtk_get_core(),cfg)==-1)
return;
linphone_core_set_default_proxy(linphone_gtk_get_core(),cfg);
linphone_gtk_load_identities();
}
}
@ -489,9 +512,9 @@ static int linphone_gtk_assistant_forward(int curpage, gpointer data){
else if (curpage == 2) { // Account's informations entered
LinphoneAccountCreator *c=linphone_gtk_assistant_get_creator(w);
gchar identity[128];
gchar proxy[128];
g_snprintf(identity, sizeof(identity), "sip:%s@%s", gtk_entry_get_text(GTK_ENTRY(g_object_get_data(G_OBJECT(box),"username"))), gtk_entry_get_text(GTK_ENTRY(g_object_get_data(G_OBJECT(box),"domain"))));
gchar proxy[128];
g_snprintf(proxy, sizeof(proxy), "sip:%s", gtk_entry_get_text(GTK_ENTRY(g_object_get_data(G_OBJECT(box),"domain"))));
linphone_account_creator_set_username(c, identity);
@ -560,25 +583,35 @@ void linphone_gtk_close_assistant(void){
}
void linphone_gtk_show_assistant(void){
GtkWidget *w;
GtkWidget *p1;
GtkWidget *p2;
GtkWidget *p31;
GtkWidget *p32;
GtkWidget *p33;
//GtkWidget *confirm;
GtkWidget *validate;
GtkWidget *error;
GtkWidget *end;
if(the_assistant!=NULL)
return;
GtkWidget *w=the_assistant=gtk_assistant_new();
w=the_assistant=gtk_assistant_new();
gtk_window_set_resizable (GTK_WINDOW(w), FALSE);
gtk_window_set_title(GTK_WINDOW(w),_("SIP account configuration assistant"));
ok = create_pixbuf(linphone_gtk_get_ui_config("ok","ok.png"));
notok = create_pixbuf(linphone_gtk_get_ui_config("notok","notok.png"));
GtkWidget *p1=create_intro();
GtkWidget *p2=create_setup_signin_choice();
GtkWidget *p31=create_account_informations_page();
GtkWidget *p32=create_linphone_account_informations_page();
GtkWidget *p33=create_account_information_page();
//GtkWidget *confirm=create_confirmation_page();
GtkWidget *validate=wait_for_activation();
GtkWidget *error=create_error_page();
GtkWidget *end=create_finish_page();
p1=create_intro();
p2=create_setup_signin_choice();
p31=create_account_informations_page();
p32=create_linphone_account_informations_page();
p33=create_account_information_page();
//confirm=create_confirmation_page();
validate=wait_for_activation();
error=create_error_page();
end=create_finish_page();
linphone_gtk_assistant_init(w);
gtk_assistant_append_page(GTK_ASSISTANT(w),p1);
gtk_assistant_set_page_type(GTK_ASSISTANT(w),p1,GTK_ASSISTANT_PAGE_INTRO);

View file

@ -58,7 +58,7 @@ static gboolean execute_wakeup(char *buf){
static void * server_pipe_thread(void *pointer){
ortp_pipe_t child;
do{
child=ortp_server_pipe_accept_client(server_pipe);
if (server_pipe_running && child!=(ortp_pipe_t)-1){
@ -87,8 +87,9 @@ static void linphone_gtk_init_pipe(const char *name){
}
bool_t linphone_gtk_init_instance(const char *app_name, int option, const char *addr_to_call){
ortp_pipe_t p;
pipe_name=make_name(app_name);
ortp_pipe_t p=ortp_client_pipe_connect(pipe_name);
p=ortp_client_pipe_connect(pipe_name);
if (p!=(ortp_pipe_t)-1){
uint8_t buf[256]={0};
g_message("There is already a running instance.");

@ -1 +1 @@
Subproject commit 1b8a4cff3684354ae07fcfa83f0416f1b146a839
Subproject commit c94f19adf2596a0b4d0ddf0f24b330e728bfa7e5

2
oRTP

@ -1 +1 @@
Subproject commit b6110374745f6a422cd95b4667100af3f55ba6af
Subproject commit 6d1c2c1dc45045839173c95e0cd91312e875be5a

View file

@ -329,10 +329,11 @@ static void text_message_compatibility_mode(void) {
}
static void text_message_with_ack(void) {
belle_sip_object_enable_leak_detector(TRUE);
int begin=belle_sip_object_get_object_count();
int leaked_objects;
int begin;
belle_sip_object_enable_leak_detector(TRUE);
begin=belle_sip_object_get_object_count();
{
LinphoneCoreManager* marie = linphone_core_manager_new( "marie_rc");
LinphoneCoreManager* pauline = linphone_core_manager_new( "pauline_rc");
@ -905,6 +906,7 @@ static void message_storage_migration() {
LinphoneCoreManager* marie = linphone_core_manager_new("marie_rc");
char src_db[256];
char tmp_db[256];
MSList* chatrooms;
snprintf(src_db,sizeof(src_db), "%s/messages.db", liblinphone_tester_file_prefix);
snprintf(tmp_db,sizeof(tmp_db), "%s/tmp.db", liblinphone_tester_writable_dir_prefix);
@ -917,7 +919,7 @@ static void message_storage_migration() {
// This will test the migration procedure
linphone_core_set_chat_database_path(marie->lc, tmp_db);
MSList* chatrooms = linphone_core_get_chat_rooms(marie->lc);
chatrooms = linphone_core_get_chat_rooms(marie->lc);
CU_ASSERT(ms_list_size(chatrooms) > 0);
// check that all messages have been migrated to the UTC time storage

View file

@ -457,9 +457,9 @@ int liblinphone_tester_run_tests(const char *suite_name, const char *test_name)
return ret;
}
int liblinphone_tester_fprintf(FILE * stream, const char * format, ...) {
int result;
va_list args;
va_start(args, format);
int result;
#ifndef ANDROID
result = vfprintf(stream,format,args);
#else

View file

@ -43,9 +43,10 @@ static void upnp_check_state(void) {
static void upnp_check_ipaddress(void) {
int tmp = 0;
const char *addr;
LinphoneCoreManager* lc_upnp = linphone_core_manager_new2( "upnp_rc", FALSE);
wait_for(lc_upnp->lc,lc_upnp->lc,&tmp,1);
const char *addr = linphone_core_get_upnp_external_ipaddress(lc_upnp->lc);
addr = linphone_core_get_upnp_external_ipaddress(lc_upnp->lc);
CU_ASSERT_TRUE(addr != NULL && strlen(addr)>=7);
linphone_core_manager_destroy(lc_upnp);
}

View file

@ -47,13 +47,15 @@ void show_usage(int argc, char *argv[]) {
}
int main(int argc, char *argv[]) {
lpc2xml_context *ctx;
LpConfig *lpc;
if(argc != 4) {
show_usage(argc, argv);
return -1;
}
lpc2xml_context *ctx = lpc2xml_context_new(cb_function, NULL);
LpConfig *lpc = lp_config_new(argv[2]);
ctx = lpc2xml_context_new(cb_function, NULL);
lpc = lp_config_new(argv[2]);
lpc2xml_set_lpc(ctx, lpc);
if(strcmp("convert", argv[1]) == 0) {
lpc2xml_convert_file(ctx, argv[3]);

View file

@ -43,17 +43,18 @@ void cb_function(void *ctx, xml2lpc_log_level level, const char *msg, va_list li
void show_usage(int argc, char *argv[]) {
fprintf(stderr, "usage %s convert <xml_file> <lpc_file>\n"
" %s validate <xml_file> <xsd_file>\n",
" %s validate <xml_file> <xsd_file>\n",
argv[0], argv[0]);
}
int main(int argc, char *argv[]) {
xml2lpc_context *ctx;
if(argc != 4) {
show_usage(argc, argv);
return -1;
}
xml2lpc_context *ctx = xml2lpc_context_new(cb_function, NULL);
ctx = xml2lpc_context_new(cb_function, NULL);
xml2lpc_set_xml_file(ctx, argv[2]);
if(strcmp("convert", argv[1]) == 0) {
LpConfig *lpc = lp_config_new(argv[3]);