Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
BC
public
liblinphone
Commits
b535d1f1
Commit
b535d1f1
authored
Jun 16, 2016
by
Ghislain MARY
Browse files
Use bctbx_list_t instead of MSList that has been deprecated.
parent
9f01da42
Changes
31
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
20 changed files
with
538 additions
and
538 deletions
+538
-538
coreapi/authentication.c
coreapi/authentication.c
+16
-16
coreapi/bellesip_sal/sal_impl.c
coreapi/bellesip_sal/sal_impl.c
+16
-16
coreapi/bellesip_sal/sal_sdp.c
coreapi/bellesip_sal/sal_sdp.c
+6
-6
coreapi/call_log.c
coreapi/call_log.c
+19
-19
coreapi/callbacks.c
coreapi/callbacks.c
+10
-10
coreapi/carddav.c
coreapi/carddav.c
+35
-35
coreapi/chat.c
coreapi/chat.c
+17
-17
coreapi/conference.cc
coreapi/conference.cc
+5
-5
coreapi/friend.c
coreapi/friend.c
+63
-63
coreapi/friendlist.c
coreapi/friendlist.c
+38
-38
coreapi/ldap/ldapprovider.c
coreapi/ldap/ldapprovider.c
+12
-12
coreapi/linphone_tunnel.cc
coreapi/linphone_tunnel.cc
+9
-9
coreapi/linphonecall.c
coreapi/linphonecall.c
+41
-41
coreapi/linphonecore.c
coreapi/linphonecore.c
+144
-144
coreapi/linphonecore.h
coreapi/linphonecore.h
+24
-24
coreapi/lpconfig.c
coreapi/lpconfig.c
+35
-35
coreapi/message_storage.c
coreapi/message_storage.c
+7
-7
coreapi/misc.c
coreapi/misc.c
+16
-16
coreapi/nat_policy.c
coreapi/nat_policy.c
+8
-8
coreapi/offeranswer.c
coreapi/offeranswer.c
+17
-17
No files found.
coreapi/authentication.c
View file @
b535d1f1
...
...
@@ -231,7 +231,7 @@ static bool_t realm_match(const char *realm1, const char *realm2){
}
static
const
LinphoneAuthInfo
*
find_auth_info
(
LinphoneCore
*
lc
,
const
char
*
username
,
const
char
*
realm
,
const
char
*
domain
,
bool_t
ignore_realm
){
MSLis
t
*
elem
;
bctbx_list_
t
*
elem
;
const
LinphoneAuthInfo
*
ret
=
NULL
;
for
(
elem
=
lc
->
auth_info
;
elem
!=
NULL
;
elem
=
elem
->
next
)
{
...
...
@@ -286,7 +286,7 @@ const LinphoneAuthInfo *linphone_core_find_auth_info(LinphoneCore *lc, const cha
/*the auth info is expected to be in the core's list*/
void
linphone_core_write_auth_info
(
LinphoneCore
*
lc
,
LinphoneAuthInfo
*
ai
){
int
i
;
MSLis
t
*
elem
=
lc
->
auth_info
;
bctbx_list_
t
*
elem
=
lc
->
auth_info
;
if
(
!
lc
->
sip_conf
.
save_auth_info
)
return
;
...
...
@@ -298,12 +298,12 @@ void linphone_core_write_auth_info(LinphoneCore *lc, LinphoneAuthInfo *ai){
}
static
void
write_auth_infos
(
LinphoneCore
*
lc
){
MSLis
t
*
elem
;
bctbx_list_
t
*
elem
;
int
i
;
if
(
!
linphone_core_ready
(
lc
))
return
;
if
(
!
lc
->
sip_conf
.
save_auth_info
)
return
;
for
(
elem
=
lc
->
auth_info
,
i
=
0
;
elem
!=
NULL
;
elem
=
ms
_list_next
(
elem
),
i
++
){
for
(
elem
=
lc
->
auth_info
,
i
=
0
;
elem
!=
NULL
;
elem
=
bctbx
_list_next
(
elem
),
i
++
){
LinphoneAuthInfo
*
ai
=
(
LinphoneAuthInfo
*
)(
elem
->
data
);
linphone_auth_info_write_config
(
lc
->
config
,
ai
,
i
);
}
...
...
@@ -321,8 +321,8 @@ LinphoneAuthInfo * linphone_core_create_auth_info(LinphoneCore *lc, const char *
**/
void
linphone_core_add_auth_info
(
LinphoneCore
*
lc
,
const
LinphoneAuthInfo
*
info
){
LinphoneAuthInfo
*
ai
;
MSLis
t
*
elem
;
MSLis
t
*
l
;
bctbx_list_
t
*
elem
;
bctbx_list_
t
*
l
;
int
restarted_op_count
=
0
;
bool_t
updating
=
FALSE
;
...
...
@@ -333,11 +333,11 @@ void linphone_core_add_auth_info(LinphoneCore *lc, const LinphoneAuthInfo *info)
/* find if we are attempting to modify an existing auth info */
ai
=
(
LinphoneAuthInfo
*
)
linphone_core_find_auth_info
(
lc
,
info
->
realm
,
info
->
username
,
info
->
domain
);
if
(
ai
!=
NULL
&&
ai
->
domain
&&
info
->
domain
&&
strcmp
(
ai
->
domain
,
info
->
domain
)
==
0
){
lc
->
auth_info
=
ms
_list_remove
(
lc
->
auth_info
,
ai
);
lc
->
auth_info
=
bctbx
_list_remove
(
lc
->
auth_info
,
ai
);
linphone_auth_info_destroy
(
ai
);
updating
=
TRUE
;
}
lc
->
auth_info
=
ms
_list_append
(
lc
->
auth_info
,
linphone_auth_info_clone
(
info
));
lc
->
auth_info
=
bctbx
_list_append
(
lc
->
auth_info
,
linphone_auth_info_clone
(
info
));
/* retry pending authentication operations */
for
(
l
=
elem
=
sal_get_pending_auths
(
lc
->
sal
);
elem
!=
NULL
;
elem
=
elem
->
next
){
...
...
@@ -347,14 +347,14 @@ void linphone_core_add_auth_info(LinphoneCore *lc, const LinphoneAuthInfo *info)
ai
=
(
LinphoneAuthInfo
*
)
_linphone_core_find_auth_info
(
lc
,
req_sai
->
realm
,
req_sai
->
username
,
req_sai
->
domain
,
FALSE
);
if
(
ai
){
SalAuthInfo
sai
;
MSLis
t
*
proxy
;
bctbx_list_
t
*
proxy
;
sai
.
username
=
ai
->
username
;
sai
.
userid
=
ai
->
userid
;
sai
.
realm
=
ai
->
realm
;
sai
.
password
=
ai
->
passwd
;
sai
.
ha1
=
ai
->
ha1
;
/*proxy case*/
for
(
proxy
=
(
MSLis
t
*
)
linphone_core_get_proxy_config_list
(
lc
);
proxy
!=
NULL
;
proxy
=
proxy
->
next
)
{
for
(
proxy
=
(
bctbx_list_
t
*
)
linphone_core_get_proxy_config_list
(
lc
);
proxy
!=
NULL
;
proxy
=
proxy
->
next
)
{
if
(
proxy
->
data
==
sal_op_get_user_pointer
(
op
))
{
linphone_proxy_config_set_state
((
LinphoneProxyConfig
*
)(
proxy
->
data
),
LinphoneRegistrationProgress
,
"Authentication..."
);
break
;
...
...
@@ -375,7 +375,7 @@ void linphone_core_add_auth_info(LinphoneCore *lc, const LinphoneAuthInfo *info)
info
->
realm
?
info
->
realm
:
""
,
info
->
domain
?
info
->
domain
:
""
);
}
ms
_list_free
(
l
);
bctbx
_list_free
(
l
);
write_auth_infos
(
lc
);
}
...
...
@@ -394,7 +394,7 @@ void linphone_core_remove_auth_info(LinphoneCore *lc, const LinphoneAuthInfo *in
LinphoneAuthInfo
*
r
;
r
=
(
LinphoneAuthInfo
*
)
linphone_core_find_auth_info
(
lc
,
info
->
realm
,
info
->
username
,
info
->
domain
);
if
(
r
){
lc
->
auth_info
=
ms
_list_remove
(
lc
->
auth_info
,
r
);
lc
->
auth_info
=
bctbx
_list_remove
(
lc
->
auth_info
,
r
);
linphone_auth_info_destroy
(
r
);
write_auth_infos
(
lc
);
}
...
...
@@ -405,7 +405,7 @@ void linphone_core_remove_auth_info(LinphoneCore *lc, const LinphoneAuthInfo *in
* @param[in] lc The LinphoneCore object
* @return \mslist{LinphoneAuthInfo}
**/
const
MSLis
t
*
linphone_core_get_auth_info_list
(
const
LinphoneCore
*
lc
){
const
bctbx_list_
t
*
linphone_core_get_auth_info_list
(
const
LinphoneCore
*
lc
){
return
lc
->
auth_info
;
}
...
...
@@ -413,14 +413,14 @@ const MSList *linphone_core_get_auth_info_list(const LinphoneCore *lc){
* Clear all authentication information.
**/
void
linphone_core_clear_all_auth_info
(
LinphoneCore
*
lc
){
MSLis
t
*
elem
;
bctbx_list_
t
*
elem
;
int
i
;
for
(
i
=
0
,
elem
=
lc
->
auth_info
;
elem
!=
NULL
;
elem
=
ms
_list_next
(
elem
),
i
++
){
for
(
i
=
0
,
elem
=
lc
->
auth_info
;
elem
!=
NULL
;
elem
=
bctbx
_list_next
(
elem
),
i
++
){
LinphoneAuthInfo
*
info
=
(
LinphoneAuthInfo
*
)
elem
->
data
;
linphone_auth_info_destroy
(
info
);
linphone_auth_info_write_config
(
lc
->
config
,
NULL
,
i
);
}
ms
_list_free
(
lc
->
auth_info
);
bctbx
_list_free
(
lc
->
auth_info
);
lc
->
auth_info
=
NULL
;
}
...
...
coreapi/bellesip_sal/sal_impl.c
View file @
b535d1f1
...
...
@@ -115,8 +115,8 @@ void sal_set_log_level(OrtpLogLevel level) {
}
void
sal_add_pending_auth
(
Sal
*
sal
,
SalOp
*
op
){
if
(
ms
_list_find
(
sal
->
pending_auths
,
op
)
==
NULL
){
sal
->
pending_auths
=
ms
_list_append
(
sal
->
pending_auths
,
op
);
if
(
bctbx
_list_find
(
sal
->
pending_auths
,
op
)
==
NULL
){
sal
->
pending_auths
=
bctbx
_list_append
(
sal
->
pending_auths
,
op
);
op
->
has_auth_pending
=
TRUE
;
}
}
...
...
@@ -124,8 +124,8 @@ void sal_add_pending_auth(Sal *sal, SalOp *op){
void
sal_remove_pending_auth
(
Sal
*
sal
,
SalOp
*
op
){
if
(
op
->
has_auth_pending
){
op
->
has_auth_pending
=
FALSE
;
if
(
ms
_list_find
(
sal
->
pending_auths
,
op
)){
sal
->
pending_auths
=
ms
_list_remove
(
sal
->
pending_auths
,
op
);
if
(
bctbx
_list_find
(
sal
->
pending_auths
,
op
)){
sal
->
pending_auths
=
bctbx
_list_remove
(
sal
->
pending_auths
,
op
);
}
}
}
...
...
@@ -593,7 +593,7 @@ void sal_uninit(Sal* sal){
belle_sip_object_unref
(
sal
->
stack
);
belle_sip_object_unref
(
sal
->
listener
);
if
(
sal
->
supported
)
belle_sip_object_unref
(
sal
->
supported
);
ms
_list_free_with_data
(
sal
->
supported_tags
,
ms_free
);
bctbx
_list_free_with_data
(
sal
->
supported_tags
,
ms_free
);
if
(
sal
->
uuid
)
ms_free
(
sal
->
uuid
);
if
(
sal
->
root_ca
)
ms_free
(
sal
->
root_ca
);
ms_free
(
sal
);
...
...
@@ -804,8 +804,8 @@ int sal_iterate(Sal *sal){
belle_sip_stack_sleep
(
sal
->
stack
,
0
);
return
0
;
}
MSLis
t
*
sal_get_pending_auths
(
Sal
*
sal
){
return
ms
_list_copy
(
sal
->
pending_auths
);
bctbx_list_
t
*
sal_get_pending_auths
(
Sal
*
sal
){
return
bctbx
_list_copy
(
sal
->
pending_auths
);
}
/*misc*/
...
...
@@ -858,10 +858,10 @@ int sal_get_transport_timeout(const Sal* sal) {
return
belle_sip_stack_get_transport_timeout
(
sal
->
stack
);
}
void
sal_set_dns_servers
(
Sal
*
sal
,
const
MSLis
t
*
servers
){
void
sal_set_dns_servers
(
Sal
*
sal
,
const
bctbx_list_
t
*
servers
){
belle_sip_list_t
*
l
=
NULL
;
/*we have to convert the
MSLis
t into a belle_sip_list_t first*/
/*we have to convert the
bctbx_list_
t into a belle_sip_list_t first*/
for
(;
servers
!=
NULL
;
servers
=
servers
->
next
){
l
=
belle_sip_list_append
(
l
,
servers
->
data
);
}
...
...
@@ -1055,7 +1055,7 @@ int sal_create_uuid(Sal*ctx, char *uuid, size_t len) {
}
static
void
make_supported_header
(
Sal
*
sal
){
MSLis
t
*
it
;
bctbx_list_
t
*
it
;
char
*
alltags
=
NULL
;
size_t
buflen
=
64
;
size_t
written
=
0
;
...
...
@@ -1080,7 +1080,7 @@ static void make_supported_header(Sal *sal){
}
void
sal_set_supported_tags
(
Sal
*
ctx
,
const
char
*
tags
){
ctx
->
supported_tags
=
ms
_list_free_with_data
(
ctx
->
supported_tags
,
ms_free
);
ctx
->
supported_tags
=
bctbx
_list_free_with_data
(
ctx
->
supported_tags
,
ms_free
);
if
(
tags
){
char
*
iter
;
char
*
buffer
=
ms_strdup
(
tags
);
...
...
@@ -1089,7 +1089,7 @@ void sal_set_supported_tags(Sal *ctx, const char* tags){
iter
=
buffer
;
while
((
tag
=
strtok_r
(
iter
,
", "
,
&
context
))
!=
NULL
){
iter
=
NULL
;
ctx
->
supported_tags
=
ms
_list_append
(
ctx
->
supported_tags
,
ms_strdup
(
tag
));
ctx
->
supported_tags
=
bctbx
_list_append
(
ctx
->
supported_tags
,
ms_strdup
(
tag
));
}
ms_free
(
buffer
);
}
...
...
@@ -1104,19 +1104,19 @@ const char *sal_get_supported_tags(Sal *ctx){
}
void
sal_add_supported_tag
(
Sal
*
ctx
,
const
char
*
tag
){
MSL
ist
*
elem
=
ms
_list_find_custom
(
ctx
->
supported_tags
,(
MSC
ompare
F
unc
)
strcasecmp
,
tag
);
bctbx_l
ist
_t
*
elem
=
bctbx
_list_find_custom
(
ctx
->
supported_tags
,(
bctbx_c
ompare
_f
unc
)
strcasecmp
,
tag
);
if
(
!
elem
){
ctx
->
supported_tags
=
ms
_list_append
(
ctx
->
supported_tags
,
ms_strdup
(
tag
));
ctx
->
supported_tags
=
bctbx
_list_append
(
ctx
->
supported_tags
,
ms_strdup
(
tag
));
make_supported_header
(
ctx
);
}
}
void
sal_remove_supported_tag
(
Sal
*
ctx
,
const
char
*
tag
){
MSL
ist
*
elem
=
ms
_list_find_custom
(
ctx
->
supported_tags
,(
MSC
ompare
F
unc
)
strcasecmp
,
tag
);
bctbx_l
ist
_t
*
elem
=
bctbx
_list_find_custom
(
ctx
->
supported_tags
,(
bctbx_c
ompare
_f
unc
)
strcasecmp
,
tag
);
if
(
elem
){
ms_free
(
elem
->
data
);
ctx
->
supported_tags
=
ms
_list_remove_link
(
ctx
->
supported_tags
,
elem
);
ctx
->
supported_tags
=
bctbx
_list_remove_link
(
ctx
->
supported_tags
,
elem
);
make_supported_header
(
ctx
);
}
}
...
...
coreapi/bellesip_sal/sal_sdp.c
View file @
b535d1f1
...
...
@@ -70,7 +70,7 @@ static void add_ice_remote_candidates(belle_sdp_media_description_t *md, const S
}
static
bool_t
is_rtcp_fb_trr_int_the_same_for_all_payloads
(
const
SalStreamDescription
*
stream
,
uint16_t
*
trr_int
)
{
MSLis
t
*
pt_it
;
bctbx_list_
t
*
pt_it
;
bool_t
first
=
TRUE
;
for
(
pt_it
=
stream
->
payloads
;
pt_it
!=
NULL
;
pt_it
=
pt_it
->
next
)
{
PayloadType
*
pt
=
(
PayloadType
*
)
pt_it
->
data
;
...
...
@@ -119,7 +119,7 @@ static void add_rtcp_fb_ccm_attribute(belle_sdp_media_description_t *media_desc,
}
static
void
add_rtcp_fb_attributes
(
belle_sdp_media_description_t
*
media_desc
,
const
SalMediaDescription
*
md
,
const
SalStreamDescription
*
stream
)
{
MSLis
t
*
pt_it
;
bctbx_list_
t
*
pt_it
;
PayloadType
*
pt
;
PayloadTypeAvpfParams
avpf_params
;
bool_t
general_trr_int
;
...
...
@@ -191,7 +191,7 @@ static void stream_description_to_sdp ( belle_sdp_session_description_t *session
belle_sdp_mime_parameter_t
*
mime_param
;
belle_sdp_media_description_t
*
media_desc
;
int
j
;
MSLis
t
*
pt_it
;
bctbx_list_
t
*
pt_it
;
PayloadType
*
pt
;
char
buffer
[
1024
];
char
*
dir
=
NULL
;
...
...
@@ -470,7 +470,7 @@ static void sdp_parse_payload_types(belle_sdp_media_description_t *media_desc, S
pt
->
channels
=
belle_sdp_mime_parameter_get_channel_count
(
mime_param
);
payload_type_set_send_fmtp
(
pt
,
belle_sdp_mime_parameter_get_parameters
(
mime_param
)
);
payload_type_set_avpf_params
(
pt
,
avpf_params
);
stream
->
payloads
=
ms
_list_append
(
stream
->
payloads
,
pt
);
stream
->
payloads
=
bctbx
_list_append
(
stream
->
payloads
,
pt
);
stream
->
ptime
=
belle_sdp_mime_parameter_get_ptime
(
mime_param
);
ms_message
(
"Found payload %s/%i fmtp=%s"
,
pt
->
mime_type
,
pt
->
clock_rate
,
pt
->
send_fmtp
?
pt
->
send_fmtp
:
""
);
...
...
@@ -577,7 +577,7 @@ static void sdp_parse_media_ice_parameters(belle_sdp_media_description_t *media_
}
static
void
enable_avpf_for_stream
(
SalStreamDescription
*
stream
)
{
MSLis
t
*
pt_it
;
bctbx_list_
t
*
pt_it
;
for
(
pt_it
=
stream
->
payloads
;
pt_it
!=
NULL
;
pt_it
=
pt_it
->
next
)
{
PayloadType
*
pt
=
(
PayloadType
*
)
pt_it
->
data
;
payload_type_set_flag
(
pt
,
PAYLOAD_TYPE_RTCP_FEEDBACK_ENABLED
);
...
...
@@ -639,7 +639,7 @@ static bool_t sdp_parse_rtcp_fb_parameters(belle_sdp_media_description_t *media_
belle_sip_list_t
*
it
;
belle_sdp_attribute_t
*
attribute
;
belle_sdp_rtcp_fb_attribute_t
*
fb_attribute
;
MSLis
t
*
pt_it
;
bctbx_list_
t
*
pt_it
;
PayloadType
*
pt
;
int8_t
pt_num
;
bool_t
retval
=
FALSE
;
...
...
coreapi/call_log.c
View file @
b535d1f1
...
...
@@ -74,7 +74,7 @@ static void set_call_log_date(LinphoneCallLog *cl, time_t start_time){
******************************************************************************/
void
call_logs_write_to_config_file
(
LinphoneCore
*
lc
){
MSLis
t
*
elem
;
bctbx_list_
t
*
elem
;
char
logsection
[
32
];
unsigned
int
i
;
char
*
tmp
;
...
...
@@ -147,7 +147,7 @@ void call_logs_read_from_config_file(LinphoneCore *lc){
cl
->
video_enabled
=
lp_config_get_int
(
cfg
,
logsection
,
"video_enabled"
,
0
);
tmp
=
lp_config_get_string
(
cfg
,
logsection
,
"call_id"
,
NULL
);
if
(
tmp
)
cl
->
call_id
=
ms_strdup
(
tmp
);
lc
->
call_logs
=
ms
_list_append
(
lc
->
call_logs
,
cl
);
lc
->
call_logs
=
bctbx
_list_append
(
lc
->
call_logs
,
cl
);
}
else
break
;
}
}
...
...
@@ -414,7 +414,7 @@ void linphone_core_call_log_storage_close(LinphoneCore *lc) {
* | 11 | refkey
*/
static
int
create_call_log
(
void
*
data
,
int
argc
,
char
**
argv
,
char
**
colName
)
{
MSLis
t
**
list
=
(
MSLis
t
**
)
data
;
bctbx_list_
t
**
list
=
(
bctbx_list_
t
**
)
data
;
LinphoneAddress
*
from
;
LinphoneAddress
*
to
;
LinphoneCallDir
dir
;
...
...
@@ -447,7 +447,7 @@ static int create_call_log(void *data, int argc, char **argv, char **colName) {
}
}
*
list
=
ms
_list_append
(
*
list
,
log
);
*
list
=
bctbx
_list_append
(
*
list
,
log
);
return
0
;
error:
...
...
@@ -461,7 +461,7 @@ error:
return
0
;
}
static
void
linphone_sql_request_call_log
(
sqlite3
*
db
,
const
char
*
stmt
,
MSLis
t
**
list
)
{
static
void
linphone_sql_request_call_log
(
sqlite3
*
db
,
const
char
*
stmt
,
bctbx_list_
t
**
list
)
{
char
*
errmsg
=
NULL
;
int
ret
;
ret
=
sqlite3_exec
(
db
,
stmt
,
create_call_log
,
list
,
&
errmsg
);
...
...
@@ -511,33 +511,33 @@ void linphone_core_store_call_log(LinphoneCore *lc, LinphoneCallLog *log) {
}
if
(
lc
)
{
lc
->
call_logs
=
ms
_list_prepend
(
lc
->
call_logs
,
linphone_call_log_ref
(
log
));
lc
->
call_logs
=
bctbx
_list_prepend
(
lc
->
call_logs
,
linphone_call_log_ref
(
log
));
}
}
static
void
copy_user_data_from_existing_log
(
MSLis
t
*
existing_logs
,
LinphoneCallLog
*
log
)
{
static
void
copy_user_data_from_existing_log
(
bctbx_list_
t
*
existing_logs
,
LinphoneCallLog
*
log
)
{
while
(
existing_logs
)
{
LinphoneCallLog
*
existing_log
=
(
LinphoneCallLog
*
)
existing_logs
->
data
;
if
(
existing_log
->
storage_id
==
log
->
storage_id
)
{
log
->
user_data
=
existing_log
->
user_data
;
break
;
}
existing_logs
=
ms
_list_next
(
existing_logs
);
existing_logs
=
bctbx
_list_next
(
existing_logs
);
}
}
static
void
copy_user_data_from_existing_logs
(
MSLis
t
*
existing_logs
,
MSLis
t
*
new_logs
)
{
static
void
copy_user_data_from_existing_logs
(
bctbx_list_
t
*
existing_logs
,
bctbx_list_
t
*
new_logs
)
{
while
(
new_logs
)
{
LinphoneCallLog
*
new_log
=
(
LinphoneCallLog
*
)
new_logs
->
data
;
copy_user_data_from_existing_log
(
existing_logs
,
new_log
);
new_logs
=
ms
_list_next
(
new_logs
);
new_logs
=
bctbx
_list_next
(
new_logs
);
}
}
const
MSLis
t
*
linphone_core_get_call_history
(
LinphoneCore
*
lc
)
{
const
bctbx_list_
t
*
linphone_core_get_call_history
(
LinphoneCore
*
lc
)
{
char
*
buf
;
uint64_t
begin
,
end
;
MSLis
t
*
result
=
NULL
;
bctbx_list_
t
*
result
=
NULL
;
if
(
!
lc
||
lc
->
logs_db
==
NULL
)
return
NULL
;
...
...
@@ -553,7 +553,7 @@ const MSList *linphone_core_get_call_history(LinphoneCore *lc) {
copy_user_data_from_existing_logs
(
lc
->
call_logs
,
result
);
}
lc
->
call_logs
=
ms
_list_free_with_data
(
lc
->
call_logs
,
(
void
(
*
)(
void
*
))
linphone_call_log_unref
);
lc
->
call_logs
=
bctbx
_list_free_with_data
(
lc
->
call_logs
,
(
void
(
*
)(
void
*
))
linphone_call_log_unref
);
lc
->
call_logs
=
result
;
return
lc
->
call_logs
;
...
...
@@ -600,11 +600,11 @@ int linphone_core_get_call_history_size(LinphoneCore *lc) {
return
numrows
;
}
MSLis
t
*
linphone_core_get_call_history_for_address
(
LinphoneCore
*
lc
,
const
LinphoneAddress
*
addr
)
{
bctbx_list_
t
*
linphone_core_get_call_history_for_address
(
LinphoneCore
*
lc
,
const
LinphoneAddress
*
addr
)
{
char
*
buf
;
char
*
sipAddress
;
uint64_t
begin
,
end
;
MSLis
t
*
result
=
NULL
;
bctbx_list_
t
*
result
=
NULL
;
if
(
!
lc
||
lc
->
logs_db
==
NULL
||
addr
==
NULL
)
return
NULL
;
...
...
@@ -629,7 +629,7 @@ MSList * linphone_core_get_call_history_for_address(LinphoneCore *lc, const Linp
LinphoneCallLog
*
linphone_core_get_last_outgoing_call_log
(
LinphoneCore
*
lc
)
{
char
*
buf
;
uint64_t
begin
,
end
;
MSLis
t
*
list
=
NULL
;
bctbx_list_
t
*
list
=
NULL
;
LinphoneCallLog
*
result
=
NULL
;
if
(
!
lc
||
lc
->
logs_db
==
NULL
)
return
NULL
;
...
...
@@ -657,7 +657,7 @@ LinphoneCallLog * linphone_core_get_last_outgoing_call_log(LinphoneCore *lc) {
LinphoneCallLog
*
linphone_core_find_call_log_from_call_id
(
LinphoneCore
*
lc
,
const
char
*
call_id
)
{
char
*
buf
;
uint64_t
begin
,
end
;
MSLis
t
*
list
=
NULL
;
bctbx_list_
t
*
list
=
NULL
;
LinphoneCallLog
*
result
=
NULL
;
if
(
!
lc
||
lc
->
logs_db
==
NULL
)
return
NULL
;
...
...
@@ -693,7 +693,7 @@ void linphone_core_call_log_storage_close(LinphoneCore *lc) {
void
linphone_core_store_call_log
(
LinphoneCore
*
lc
,
LinphoneCallLog
*
log
)
{
}
const
MSLis
t
*
linphone_core_get_call_history
(
LinphoneCore
*
lc
)
{
const
bctbx_list_
t
*
linphone_core_get_call_history
(
LinphoneCore
*
lc
)
{
return
NULL
;
}
...
...
@@ -707,7 +707,7 @@ int linphone_core_get_call_history_size(LinphoneCore *lc) {
return
0
;
}
MSLis
t
*
linphone_core_get_call_history_for_address
(
LinphoneCore
*
lc
,
const
LinphoneAddress
*
addr
)
{
bctbx_list_
t
*
linphone_core_get_call_history_for_address
(
LinphoneCore
*
lc
,
const
LinphoneAddress
*
addr
)
{
return
NULL
;
}
...
...
coreapi/callbacks.c
View file @
b535d1f1
...
...
@@ -111,12 +111,12 @@ void linphone_call_update_frozen_payloads(LinphoneCall *call, SalMediaDescriptio
SalMediaDescription
*
local
=
call
->
localdesc
;
int
i
;
for
(
i
=
0
;
i
<
result_desc
->
nb_streams
;
++
i
){
MSLis
t
*
elem
;
bctbx_list_
t
*
elem
;
for
(
elem
=
result_desc
->
streams
[
i
].
payloads
;
elem
!=
NULL
;
elem
=
elem
->
next
){
PayloadType
*
pt
=
(
PayloadType
*
)
elem
->
data
;
if
(
is_payload_type_number_available
(
local
->
streams
[
i
].
already_assigned_payloads
,
payload_type_get_number
(
pt
),
NULL
)){
/*new codec, needs to be added to the list*/
local
->
streams
[
i
].
already_assigned_payloads
=
ms
_list_append
(
local
->
streams
[
i
].
already_assigned_payloads
,
payload_type_clone
(
pt
));
local
->
streams
[
i
].
already_assigned_payloads
=
bctbx
_list_append
(
local
->
streams
[
i
].
already_assigned_payloads
,
payload_type_clone
(
pt
));
ms_message
(
"LinphoneCall[%p] : payload type %i %s/%i fmtp=%s added to frozen list."
,
call
,
payload_type_get_number
(
pt
),
pt
->
mime_type
,
pt
->
clock_rate
,
pt
->
recv_fmtp
?
pt
->
recv_fmtp
:
""
);
}
...
...
@@ -201,7 +201,7 @@ void linphone_core_update_streams(LinphoneCore *lc, LinphoneCall *call, SalMedia
prepare_early_media_forking
(
call
);
}
linphone_call_start_media_streams
(
call
,
target_state
);
if
(
call
->
state
==
LinphoneCallPausing
&&
call
->
paused_by_app
&&
ms
_list_size
(
lc
->
calls
)
==
1
){
if
(
call
->
state
==
LinphoneCallPausing
&&
call
->
paused_by_app
&&
bctbx
_list_size
(
lc
->
calls
)
==
1
){
linphone_core_play_named_tone
(
lc
,
LinphoneToneCallOnHold
);
}
linphone_call_update_frozen_payloads
(
call
,
new_md
);
...
...
@@ -212,7 +212,7 @@ void linphone_core_update_streams(LinphoneCore *lc, LinphoneCall *call, SalMedia
}
#if 0
static bool_t is_duplicate_call(LinphoneCore *lc, const LinphoneAddress *from, const LinphoneAddress *to){
MSLis
t *elem;
bctbx_list_
t *elem;
for(elem=lc->calls;elem!=NULL;elem=elem->next){
LinphoneCall *call=(LinphoneCall*)elem->data;
if (linphone_address_weak_equal(call->log->from,from) &&
...
...
@@ -225,7 +225,7 @@ static bool_t is_duplicate_call(LinphoneCore *lc, const LinphoneAddress *from, c
#endif
static
bool_t
already_a_call_with_remote_address
(
const
LinphoneCore
*
lc
,
const
LinphoneAddress
*
remote
)
{
MSLis
t
*
elem
;
bctbx_list_
t
*
elem
;
ms_message
(
"Searching for already_a_call_with_remote_address."
);
for
(
elem
=
lc
->
calls
;
elem
!=
NULL
;
elem
=
elem
->
next
){
...
...
@@ -786,7 +786,7 @@ static void call_terminated(SalOp *op, const char *from){
linphone_core_start_refered_call
(
lc
,
call
,
NULL
);
}
//we stop the call only if we have this current call or if we are in call
if
((
ms
_list_size
(
lc
->
calls
)
==
1
)
||
linphone_core_in_call
(
lc
))
{
if
((
bctbx
_list_size
(
lc
->
calls
)
==
1
)
||
linphone_core_in_call
(
lc
))
{
linphone_core_stop_ringing
(
lc
);
}
linphone_call_stop_media_streams
(
call
);
...
...
@@ -1088,8 +1088,8 @@ static void refer_received(Sal *sal, SalOp *op, const char *referto){
}
static
bool_t
is_duplicate_msg
(
LinphoneCore
*
lc
,
const
char
*
msg_id
){
MSLis
t
*
elem
=
lc
->
last_recv_msg_ids
;
MSLis
t
*
tail
=
NULL
;
bctbx_list_
t
*
elem
=
lc
->
last_recv_msg_ids
;
bctbx_list_
t
*
tail
=
NULL
;
int
i
;
bool_t
is_duplicate
=
FALSE
;
for
(
i
=
0
;
elem
!=
NULL
;
elem
=
elem
->
next
,
i
++
){
...
...
@@ -1099,11 +1099,11 @@ static bool_t is_duplicate_msg(LinphoneCore *lc, const char *msg_id){
tail
=
elem
;
}
if
(
!
is_duplicate
){
lc
->
last_recv_msg_ids
=
ms
_list_prepend
(
lc
->
last_recv_msg_ids
,
ms_strdup
(
msg_id
));
lc
->
last_recv_msg_ids
=
bctbx
_list_prepend
(
lc
->
last_recv_msg_ids
,
ms_strdup
(
msg_id
));
}
if
(
i
>=
10
){
ms_free
(
tail
->
data
);
lc
->
last_recv_msg_ids
=
ms
_list_remove_link
(
lc
->
last_recv_msg_ids
,
tail
);
lc
->
last_recv_msg_ids
=
bctbx
_list_remove_link
(
lc
->
last_recv_msg_ids
,
tail
);
}
return
is_duplicate
;
}
...
...
coreapi/carddav.c
View file @
b535d1f1
...
...
@@ -105,15 +105,15 @@ static void linphone_carddav_response_free(LinphoneCardDavResponse *response) {
ms_free
(
response
);
}
static
void
linphone_carddav_vcards_pulled
(
LinphoneCardDavContext
*
cdc
,
MSLis
t
*
vCards
)
{
if
(
vCards
!=
NULL
&&
ms
_list_size
(
vCards
)
>
0
)
{
MSLis
t
*
friends
=
cdc
->
friend_list
->
friends
;
static
void
linphone_carddav_vcards_pulled
(
LinphoneCardDavContext
*
cdc
,
bctbx_list_
t
*
vCards
)
{
if
(
vCards
!=
NULL
&&
bctbx
_list_size
(
vCards
)
>
0
)
{
bctbx_list_
t
*
friends
=
cdc
->
friend_list
->
friends
;
while
(
vCards
)
{
LinphoneCardDavResponse
*
vCard
=
(
LinphoneCardDavResponse
*
)
vCards
->
data
;
if
(
vCard
)
{
LinphoneVcard
*
lvc
=
linphone_vcard_new_from_vcard4_buffer
(
vCard
->
vcard
);
LinphoneFriend
*
lf
=
NULL
;
MSLis
t
*
local_friend
=
NULL
;
bctbx_list_
t
*
local_friend
=
NULL
;
if
(
lvc
)
{
// Compute downloaded vCards' URL and save it (+ eTag)
...
...
@@ -126,7 +126,7 @@ static void linphone_carddav_vcards_pulled(LinphoneCardDavContext *cdc, MSList *
lf
=
linphone_friend_new_from_vcard
(
lvc
);
if
(
lf
)
{
local_friend
=
ms
_list_find_custom
(
friends
,
(
int
(
*
)(
const
void
*
,
const
void
*
))
find_matching_friend
,
lf
);
local_friend
=
bctbx
_list_find_custom
(
friends
,
(
int
(
*
)(
const
void
*
,
const
void
*
))
find_matching_friend
,
lf
);
if
(
local_friend
)
{
LinphoneFriend
*
lf2
=
(
LinphoneFriend
*
)
local_friend
->
data
;
...
...
@@ -156,15 +156,15 @@ static void linphone_carddav_vcards_pulled(LinphoneCardDavContext *cdc, MSList *
ms_error
(
"[carddav] Couldn't parse vCard %s"
,
vCard
->
vcard
);
}
}
vCards
=
ms
_list_next
(
vCards
);
vCards
=
bctbx
_list_next
(
vCards
);
}
ms
_list_free_with_data
(
vCards
,
(
void
(
*
)(
void
*
))
linphone_carddav_response_free
);
bctbx
_list_free_with_data
(
vCards
,
(
void
(
*
)(
void
*
))
linphone_carddav_response_free
);
}
linphone_carddav_server_to_client_sync_done
(
cdc
,
TRUE
,
NULL
);
}
static
MSLis
t
*
parse_vcards_from_xml_response
(
const
char
*
body
)
{
MSLis
t
*
result
=
NULL
;
static
bctbx_list_
t
*
parse_vcards_from_xml_response
(
const
char
*
body
)
{
bctbx_list_
t
*
result
=
NULL
;
xmlparsing_context_t
*
xml_ctx
=
linphone_xmlparsing_context_new
();
xmlSetGenericErrorFunc
(
xml_ctx
,
linphone_xmlparsing_genericxml_error
);
xml_ctx
->
doc
=
xmlReadDoc
((
const
unsigned
char
*
)
body
,
0
,
NULL
,
0
);
...
...
@@ -188,7 +188,7 @@ static MSList* parse_vcards_from_xml_response(const char *body) {
response
->
etag
=
ms_strdup
(
etag
);
response
->
url
=
ms_strdup
(
url
);
response
->
vcard
=
ms_strdup
(
vcard
);
result
=
ms
_list_append
(
result
,
response
);
result
=
bctbx
_list_append
(
result
,
response
);
ms_debug
(
"Added vCard object with eTag %s, URL %s and vCard %s"
,
etag
,
url
,
vcard
);
}
}
...
...
@@ -209,19 +209,19 @@ static int find_matching_vcard(LinphoneCardDavResponse *response, LinphoneFriend
return
strcmp
(
response
->
url
,
linphone_vcard_get_url
(
lf
->
vcard
));
}
static
void
linphone_carddav_vcards_fetched
(
LinphoneCardDavContext
*
cdc
,
MSLis
t
*
vCards
)
{
if
(
vCards
!=
NULL
&&
ms
_list_size
(
vCards
)
>
0
)
{
MSLis
t
*
friends
=
cdc
->
friend_list
->
friends
;
MSLis
t
*
friends_to_remove
=
NULL
;
MSLis
t
*
temp_list
=
NULL
;
static
void
linphone_carddav_vcards_fetched
(
LinphoneCardDavContext
*
cdc
,
bctbx_list_
t
*
vCards
)
{
if
(
vCards
!=
NULL
&&
bctbx
_list_size
(
vCards
)
>
0
)
{
bctbx_list_
t
*
friends
=
cdc
->
friend_list
->
friends
;
bctbx_list_
t
*
friends_to_remove
=
NULL
;
bctbx_list_
t
*
temp_list
=
NULL
;
while
(
friends
)
{
LinphoneFriend
*
lf
=
(
LinphoneFriend
*
)
friends
->
data
;
if
(
lf
)
{
MSL
ist
*
vCard
=
ms
_list_find_custom
(
vCards
,
(
int
(
*
)(
const
void
*
,
const
void
*
))
find_matching_vcard
,
lf
);
bctbx_l
ist
_t
*
vCard
=
bctbx
_list_find_custom
(
vCards
,
(
int
(
*
)(
const
void
*
,
const
void
*
))
find_matching_vcard
,
lf
);
if
(
!
vCard
)
{
ms_debug
(
"Local friend %s isn't in the remote vCard list, delete it"
,
linphone_friend_get_name
(
lf
));
temp_list
=
ms
_list_append
(
temp_list
,
linphone_friend_ref
(
lf
));
temp_list
=
bctbx
_list_append
(
temp_list
,
linphone_friend_ref
(
lf
));
}
else
{
LinphoneCardDavResponse
*
response
=
(
LinphoneCardDavResponse
*
)
vCard
->
data
;
ms_debug
(
"Local friend %s is in the remote vCard list, check eTag"
,
linphone_friend_get_name
(
lf
));
...
...
@@ -230,13 +230,13 @@ static void linphone_carddav_vcards_fetched(LinphoneCardDavContext *cdc, MSList
const
char
*
etag
=
linphone_vcard_get_etag
(
lvc
);
ms_debug
(
"Local friend eTag is %s, remote vCard eTag is %s"
,
etag
,
response
->
etag
);
if
(
lvc
&&
etag
&&
strcmp
(
etag
,
response
->
etag
)
==
0
)
{
ms
_list_remove
(
vCards
,
vCard
);
bctbx
_list_remove
(
vCards
,
vCard
);
linphone_carddav_response_free
(
response
);
}
}
}
}
friends
=
ms
_list_next
(
friends
);
friends
=
bctbx
_list_next
(
friends
);
}
friends_to_remove
=
temp_list
;
while
(
friends_to_remove
)
{
...
...
@@ -247,17 +247,17 @@ static void linphone_carddav_vcards_fetched(LinphoneCardDavContext *cdc, MSList
cdc
->
contact_removed_cb
(
cdc
,
lf
);
}
}
friends_to_remove
=
ms
_list_next
(
friends_to_remove
);
friends_to_remove
=
bctbx
_list_next
(
friends_to_remove
);
}
temp_list
=
ms
_list_free_with_data
(
temp_list
,
(
void
(
*
)(
void
*
))
linphone_friend_unref
);
temp_list
=
bctbx
_list_free_with_data
(
temp_list
,
(
void
(
*
)(
void
*
))
linphone_friend_unref
);