Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
BC
public
liblinphone
Commits
656ff43b
Commit
656ff43b
authored
Jan 14, 2017
by
Simon Morlat
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix most common warnings
parent
5805d4b1
Changes
50
Hide whitespace changes
Inline
Side-by-side
Showing
50 changed files
with
222 additions
and
209 deletions
+222
-209
console/commands.c
console/commands.c
+3
-3
console/linphonec.c
console/linphonec.c
+2
-2
coreapi/account_creator.c
coreapi/account_creator.c
+3
-3
coreapi/address.c
coreapi/address.c
+1
-1
coreapi/call_log.c
coreapi/call_log.c
+4
-4
coreapi/call_params.c
coreapi/call_params.c
+2
-2
coreapi/callbacks.c
coreapi/callbacks.c
+6
-6
coreapi/chat.c
coreapi/chat.c
+16
-16
coreapi/conference.cc
coreapi/conference.cc
+2
-2
coreapi/factory.c
coreapi/factory.c
+7
-0
coreapi/friendlist.c
coreapi/friendlist.c
+1
-1
coreapi/help/buddy_status.c
coreapi/help/buddy_status.c
+1
-1
coreapi/help/notify.c
coreapi/help/notify.c
+1
-1
coreapi/help/realtimetext_sender.c
coreapi/help/realtimetext_sender.c
+1
-1
coreapi/help/registration.c
coreapi/help/registration.c
+1
-1
coreapi/ldapprovider.c
coreapi/ldapprovider.c
+1
-1
coreapi/linphonecall.c
coreapi/linphonecall.c
+2
-2
coreapi/linphonecore.c
coreapi/linphonecore.c
+11
-11
coreapi/message_storage.c
coreapi/message_storage.c
+1
-1
coreapi/misc.c
coreapi/misc.c
+2
-2
coreapi/presence.c
coreapi/presence.c
+1
-1
coreapi/proxy.c
coreapi/proxy.c
+15
-15
coreapi/quality_reporting.c
coreapi/quality_reporting.c
+1
-1
coreapi/siplogin.c
coreapi/siplogin.c
+1
-1
coreapi/sipsetup.c
coreapi/sipsetup.c
+1
-1
daemon/commands/register.cc
daemon/commands/register.cc
+1
-1
daemon/daemon.cc
daemon/daemon.cc
+1
-1
gtk/friendlist.c
gtk/friendlist.c
+3
-3
gtk/incall_view.c
gtk/incall_view.c
+1
-1
gtk/loginframe.c
gtk/loginframe.c
+2
-2
gtk/main.c
gtk/main.c
+6
-6
gtk/propertybox.c
gtk/propertybox.c
+5
-5
gtk/utils.c
gtk/utils.c
+1
-1
include/linphone/factory.h
include/linphone/factory.h
+6
-0
tester/call_multi_tester.c
tester/call_multi_tester.c
+4
-4
tester/call_multicast_tester.c
tester/call_multicast_tester.c
+1
-1
tester/call_single_tester.c
tester/call_single_tester.c
+30
-30
tester/call_video_tester.c
tester/call_video_tester.c
+24
-24
tester/flexisip_tester.c
tester/flexisip_tester.c
+5
-5
tester/message_tester.c
tester/message_tester.c
+8
-8
tester/presence_server_tester.c
tester/presence_server_tester.c
+2
-2
tester/proxy_config_tester.c
tester/proxy_config_tester.c
+1
-1
tester/quality_reporting_tester.c
tester/quality_reporting_tester.c
+5
-5
tester/register_tester.c
tester/register_tester.c
+4
-4
tester/setup_tester.c
tester/setup_tester.c
+11
-11
tester/tester.c
tester/tester.c
+4
-4
tester/tunnel_tester.c
tester/tunnel_tester.c
+3
-3
tester/video_tester.c
tester/video_tester.c
+3
-3
tools/auto_answer.c
tools/auto_answer.c
+1
-1
tools/lpsendmsg.c
tools/lpsendmsg.c
+3
-3
No files found.
console/commands.c
View file @
656ff43b
...
...
@@ -597,7 +597,7 @@ lpc_cmd_call(LinphoneCore *lc, char *args)
{
snprintf
(
callee_name
,
sizeof
(
callee_name
),
"%s"
,
args
);
}
linphone_call_params_
destroy
(
cp
);
linphone_call_params_
unref
(
cp
);
}
return
1
;
}
...
...
@@ -1981,7 +1981,7 @@ static int lpc_cmd_register(LinphoneCore *lc, char *args){
if
((
from
=
linphone_address_new
(
identity
))
!=
NULL
){
info
=
linphone_auth_info_new
(
linphone_address_get_username
(
from
),
NULL
,
passwd
,
NULL
,
NULL
,
linphone_address_get_username
(
from
));
linphone_core_add_auth_info
(
lc
,
info
);
linphone_address_
destroy
(
from
);
linphone_address_
unref
(
from
);
linphone_auth_info_destroy
(
info
);
}
}
...
...
@@ -2574,7 +2574,7 @@ static int lpc_cmd_camera(LinphoneCore *lc, char *args){
LinphoneCallParams
*
ncp
=
linphone_call_params_copy
(
cp
);
linphone_call_params_enable_video
(
ncp
,
TRUE
);
linphone_core_update_call
(
lc
,
call
,
ncp
);
linphone_call_params_
destroy
(
ncp
);
linphone_call_params_
unref
(
ncp
);
linphonec_out
(
"Trying to bring up video stream...
\n
"
);
}
}
...
...
console/linphonec.c
View file @
656ff43b
...
...
@@ -368,7 +368,7 @@ static void linphonec_call_state_changed(LinphoneCore *lc, LinphoneCall *call, L
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
);
linphone_call_params_
destroy
(
callparams
);
linphone_call_params_
unref
(
callparams
);
}
break
;
case
LinphoneCallOutgoingInit
:
...
...
@@ -796,7 +796,7 @@ linphonec_finish(int exit_status)
stop_pipe_reader
();
#endif
/*_WIN32_WCE*/
linphone_core_
destroy
(
linphonec
);
linphone_core_
unref
(
linphonec
);
if
(
mylogfile
!=
NULL
&&
mylogfile
!=
stdout
)
{
...
...
coreapi/account_creator.c
View file @
656ff43b
...
...
@@ -246,7 +246,7 @@ static char* _get_identity(const LinphoneAccountCreator *creator) {
addr
=
linphone_proxy_config_normalize_sip_uri
(
proxy
,
creator
->
username
?
creator
->
username
:
creator
->
phone_number
);
identity
=
linphone_address_as_string
(
addr
);
linphone_address_
destroy
(
addr
);
linphone_address_
unref
(
addr
);
linphone_proxy_config_destroy
(
proxy
);
}
return
identity
;
...
...
@@ -550,7 +550,7 @@ LinphoneProxyConfig * linphone_account_creator_configure(const LinphoneAccountCr
linphone_proxy_config_set_server_addr
(
cfg
,
tmp
);
linphone_proxy_config_set_route
(
cfg
,
tmp
);
ms_free
(
tmp
);
linphone_address_
destroy
(
addr
);
linphone_address_
unref
(
addr
);
}
linphone_core_set_stun_server
(
creator
->
core
,
"stun.linphone.org"
);
linphone_core_set_firewall_policy
(
creator
->
core
,
LinphonePolicyUseIce
);
...
...
@@ -564,7 +564,7 @@ LinphoneProxyConfig * linphone_account_creator_configure(const LinphoneAccountCr
linphone_address_get_domain
(
identity
)
// domain
);
linphone_core_add_auth_info
(
creator
->
core
,
info
);
linphone_address_
destroy
(
identity
);
linphone_address_
unref
(
identity
);
if
(
linphone_core_add_proxy_config
(
creator
->
core
,
cfg
)
!=
-
1
)
{
linphone_core_set_default_proxy
(
creator
->
core
,
cfg
);
...
...
coreapi/address.c
View file @
656ff43b
...
...
@@ -163,7 +163,7 @@ bool_t linphone_address_equal(const LinphoneAddress *a1, const LinphoneAddress *
}
void
linphone_address_destroy
(
LinphoneAddress
*
u
){
sal
_address_unref
(
u
);
linphone
_address_unref
(
u
);
}
void
linphone_address_set_password
(
LinphoneAddress
*
addr
,
const
char
*
passwd
){
...
...
coreapi/call_log.c
View file @
656ff43b
...
...
@@ -281,8 +281,8 @@ void linphone_call_log_unref(LinphoneCallLog *cl) {
******************************************************************************/
static
void
_linphone_call_log_destroy
(
LinphoneCallLog
*
cl
)
{
if
(
cl
->
from
!=
NULL
)
linphone_address_
destroy
(
cl
->
from
);
if
(
cl
->
to
!=
NULL
)
linphone_address_
destroy
(
cl
->
to
);
if
(
cl
->
from
!=
NULL
)
linphone_address_
unref
(
cl
->
from
);
if
(
cl
->
to
!=
NULL
)
linphone_address_
unref
(
cl
->
to
);
if
(
cl
->
refkey
!=
NULL
)
ms_free
(
cl
->
refkey
);
if
(
cl
->
call_id
)
ms_free
(
cl
->
call_id
);
if
(
cl
->
reporting
.
reports
[
LINPHONE_CALL_STATS_AUDIO
]
!=
NULL
)
linphone_reporting_destroy
(
cl
->
reporting
.
reports
[
LINPHONE_CALL_STATS_AUDIO
]);
...
...
@@ -454,10 +454,10 @@ static int create_call_log(void *data, int argc, char **argv, char **colName) {
error:
if
(
from
){
linphone_address_
destroy
(
from
);
linphone_address_
unref
(
from
);
}
if
(
to
){
linphone_address_
destroy
(
to
);
linphone_address_
unref
(
to
);
}
ms_error
(
"Bad call log at storage_id %u"
,
storage_id
);
return
0
;
...
...
coreapi/call_params.c
View file @
656ff43b
...
...
@@ -340,7 +340,7 @@ bool_t linphone_call_params_video_multicast_enabled(const LinphoneCallParams *pa
* Constructor and destructor functions *
******************************************************************************/
static
void
_linphone_call_params_
destroy
(
LinphoneCallParams
*
cp
){
static
void
_linphone_call_params_
unref
(
LinphoneCallParams
*
cp
){
unsigned
int
i
;
if
(
cp
->
record_file
)
ms_free
(
cp
->
record_file
);
if
(
cp
->
custom_headers
)
sal_custom_header_free
(
cp
->
custom_headers
);
...
...
@@ -368,7 +368,7 @@ void linphone_call_params_destroy(LinphoneCallParams *cp) {
BELLE_SIP_DECLARE_NO_IMPLEMENTED_INTERFACES
(
LinphoneCallParams
);
BELLE_SIP_INSTANCIATE_VPTR
(
LinphoneCallParams
,
belle_sip_object_t
,
(
belle_sip_object_destroy_t
)
_linphone_call_params_
destroy
,
(
belle_sip_object_destroy_t
)
_linphone_call_params_
unref
,
NULL
,
// clone
NULL
,
// marshal
FALSE
...
...
coreapi/callbacks.c
View file @
656ff43b
...
...
@@ -334,13 +334,13 @@ static void call_received(SalOp *h){
ms_warning
(
"Receiving a call while one with same address [%s] is initiated, refusing this one with busy message."
,
addr
);
sal_call_decline
(
h
,
SalReasonBusy
,
NULL
);
sal_op_release
(
h
);
linphone_address_
destroy
(
from_addr
);
linphone_address_
destroy
(
to_addr
);
linphone_address_
destroy
(
from_address_to_search_if_me
);
linphone_address_
unref
(
from_addr
);
linphone_address_
unref
(
to_addr
);
linphone_address_
unref
(
from_address_to_search_if_me
);
ms_free
(
addr
);
return
;
}
else
if
(
from_address_to_search_if_me
)
{
linphone_address_
destroy
(
from_address_to_search_if_me
);
linphone_address_
unref
(
from_address_to_search_if_me
);
}
call
=
linphone_call_new_incoming
(
lc
,
from_addr
,
to_addr
,
h
);
...
...
@@ -748,7 +748,7 @@ static void call_updating(SalOp *op, bool_t is_update){
LinphoneCallParams
*
p
=
linphone_core_create_call_params
(
lc
,
NULL
);
ms_message
(
"Applying default policy for offering SDP on call [%p]"
,
call
);
linphone_call_set_new_params
(
call
,
p
);
linphone_call_params_
destroy
(
p
);
linphone_call_params_
unref
(
p
);
}
linphone_call_make_local_media_description
(
call
);
sal_call_set_local_media_description
(
call
->
op
,
call
->
localdesc
);
...
...
@@ -1127,7 +1127,7 @@ static void refer_received(Sal *sal, SalOp *op, const char *referto){
if
(
refer_to_addr
)
{
const
char
*
tmp
=
linphone_address_get_method_param
(
refer_to_addr
);
if
(
tmp
)
strncpy
(
method
,
tmp
,
sizeof
(
method
));
linphone_address_
destroy
(
refer_to_addr
);
linphone_address_
unref
(
refer_to_addr
);
}
if
(
call
&&
(
strlen
(
method
)
==
0
||
strcmp
(
method
,
"INVITE"
)
==
0
))
{
if
(
call
->
refer_to
!=
NULL
){
...
...
coreapi/chat.c
View file @
656ff43b
...
...
@@ -130,7 +130,7 @@ static void _linphone_chat_room_destroy(LinphoneChatRoom *cr) {
cr
->
lc
->
chatrooms
=
bctbx_list_remove
(
cr
->
lc
->
chatrooms
,
cr
);
}
}
linphone_address_
destroy
(
cr
->
peer_url
);
linphone_address_
unref
(
cr
->
peer_url
);
if
(
cr
->
pending_message
)
linphone_chat_message_destroy
(
cr
->
pending_message
);
ms_free
(
cr
->
peer
);
...
...
@@ -243,7 +243,7 @@ static LinphoneChatRoom *_linphone_core_get_or_create_chat_room(LinphoneCore *lc
return
NULL
;
}
ret
=
_linphone_core_get_chat_room
(
lc
,
to_addr
);
linphone_address_
destroy
(
to_addr
);
linphone_address_
unref
(
to_addr
);
if
(
!
ret
)
{
ret
=
_linphone_core_create_chat_room_from_url
(
lc
,
to
);
}
...
...
@@ -405,7 +405,7 @@ void _linphone_chat_room_send_message(LinphoneChatRoom *cr, LinphoneChatMessage
* BUG
* the file transfer message constructor sets the from, but doesn't do it as well as here.
*/
linphone_address_
destroy
(
msg
->
from
);
linphone_address_
unref
(
msg
->
from
);
}
msg
->
from
=
linphone_address_new
(
identity
);
...
...
@@ -660,7 +660,7 @@ LinphoneReason linphone_core_message_received(LinphoneCore *lc, SalOp *op, const
linphone_chat_room_message_received
(
cr
,
lc
,
msg
);
end:
linphone_address_
destroy
(
addr
);
linphone_address_
unref
(
addr
);
linphone_chat_message_unref
(
msg
);
return
reason
;
}
...
...
@@ -769,7 +769,7 @@ LinphoneReason linphone_core_is_composing_received(LinphoneCore *lc, SalOp *op,
}
linphone_chat_message_unref
(
msg
);
}
linphone_address_
destroy
(
addr
);
linphone_address_
unref
(
addr
);
return
reason
;
}
...
...
@@ -864,7 +864,7 @@ LinphoneReason linphone_core_imdn_received(LinphoneCore *lc, SalOp *op, const Sa
if
(
cr
!=
NULL
)
{
linphone_chat_room_notify_imdn
(
cr
,
imdn
->
content
);
}
linphone_address_
destroy
(
addr
);
linphone_address_
unref
(
addr
);
return
LinphoneReasonNone
;
}
...
...
@@ -1030,8 +1030,8 @@ static void linphone_chat_room_send_is_composing_notification(LinphoneChatRoom *
}
linphone_chat_message_unref
(
msg
);
linphone_address_
destroy
(
from_addr
);
linphone_address_
destroy
(
to_addr
);
linphone_address_
unref
(
from_addr
);
linphone_address_
unref
(
to_addr
);
ms_free
(
content
);
sal_op_unref
(
op
);
}
...
...
@@ -1182,8 +1182,8 @@ static void linphone_chat_message_send_imdn(LinphoneChatMessage *cm, enum ImdnTy
}
linphone_chat_message_unref
(
msg
);
linphone_address_
destroy
(
from_addr
);
linphone_address_
destroy
(
to_addr
);
linphone_address_
unref
(
from_addr
);
linphone_address_
unref
(
to_addr
);
ms_free
(
content
);
}
sal_op_unref
(
op
);
...
...
@@ -1259,7 +1259,7 @@ void linphone_core_real_time_text_received(LinphoneCore *lc, LinphoneChatRoom *c
linphone_chat_message_set_from
(
msg
,
cr
->
peer_url
);
if
(
msg
->
to
)
linphone_address_
destroy
(
msg
->
to
);
linphone_address_
unref
(
msg
->
to
);
msg
->
to
=
call
->
dest_proxy
?
linphone_address_clone
(
call
->
dest_proxy
->
identity_address
)
:
linphone_address_new
(
linphone_core_get_identity
(
lc
));
msg
->
time
=
ms_time
(
0
);
...
...
@@ -1319,7 +1319,7 @@ int linphone_chat_message_put_char(LinphoneChatMessage *msg, uint32_t character)
msg
->
time
=
ms_time
(
0
);
msg
->
state
=
LinphoneChatMessageStateDisplayed
;
msg
->
dir
=
LinphoneChatMessageOutgoing
;
if
(
msg
->
from
)
linphone_address_
destroy
(
msg
->
from
);
if
(
msg
->
from
)
linphone_address_
unref
(
msg
->
from
);
msg
->
from
=
linphone_address_new
(
linphone_core_get_identity
(
lc
));
msg
->
storage_id
=
linphone_chat_message_store
(
msg
);
ms_free
(
msg
->
message
);
...
...
@@ -1441,7 +1441,7 @@ void linphone_chat_message_set_appdata(LinphoneChatMessage *msg, const char *dat
void
linphone_chat_message_set_from_address
(
LinphoneChatMessage
*
msg
,
const
LinphoneAddress
*
from
)
{
if
(
msg
->
from
)
linphone_address_
destroy
(
msg
->
from
);
linphone_address_
unref
(
msg
->
from
);
msg
->
from
=
linphone_address_clone
(
from
);
}
...
...
@@ -1451,7 +1451,7 @@ const LinphoneAddress *linphone_chat_message_get_from_address(const LinphoneChat
void
linphone_chat_message_set_to_address
(
LinphoneChatMessage
*
msg
,
const
LinphoneAddress
*
to
)
{
if
(
msg
->
to
)
linphone_address_
destroy
(
msg
->
to
);
linphone_address_
unref
(
msg
->
to
);
msg
->
to
=
linphone_address_clone
(
to
);
}
...
...
@@ -1552,9 +1552,9 @@ static void _linphone_chat_message_destroy(LinphoneChatMessage *msg) {
if
(
msg
->
appdata
)
ms_free
(
msg
->
appdata
);
if
(
msg
->
from
)
linphone_address_
destroy
(
msg
->
from
);
linphone_address_
unref
(
msg
->
from
);
if
(
msg
->
to
)
linphone_address_
destroy
(
msg
->
to
);
linphone_address_
unref
(
msg
->
to
);
if
(
msg
->
message_id
)
ms_free
(
msg
->
message_id
);
if
(
msg
->
custom_headers
)
...
...
coreapi/conference.cc
View file @
656ff43b
...
...
@@ -404,7 +404,7 @@ int LocalConference::addParticipant(LinphoneCall *call) {
/*this will trigger a reINVITE that will later redraw the streams */
/*FIXME probably a bit too much to just redraw streams !*/
linphone_core_update_call
(
m_core
,
call
,
params
);
linphone_call_params_
destroy
(
params
);
linphone_call_params_
unref
(
params
);
addLocalEndpoint
();
}
else
{
ms_error
(
"Call is in state %s, it cannot be added to the conference."
,
linphone_call_state_to_string
(
call
->
state
));
...
...
@@ -441,7 +441,7 @@ int LocalConference::removeFromConference(LinphoneCall *call, bool_t active){
}
ms_message
(
"Updating call to actually remove from conference"
);
err
=
linphone_core_update_call
(
m_core
,
call
,
params
);
linphone_call_params_
destroy
(
params
);
linphone_call_params_
unref
(
params
);
}
else
{
ms_message
(
"Pausing call to actually remove from conference"
);
err
=
_linphone_core_pause_call
(
m_core
,
call
);
...
...
coreapi/factory.c
View file @
656ff43b
...
...
@@ -54,6 +54,13 @@ LinphoneFactory *linphone_factory_get(void) {
return
_factory
;
}
void
linphone_factory_clean
(
void
){
if
(
_factory
){
belle_sip_object_unref
(
_factory
);
_factory
=
NULL
;
}
}
LinphoneCore
*
linphone_factory_create_core
(
const
LinphoneFactory
*
factory
,
LinphoneCoreCbs
*
cbs
,
const
char
*
config_path
,
const
char
*
factory_config_path
)
{
LpConfig
*
config
=
lp_config_new_with_factory
(
config_path
,
factory_config_path
);
...
...
coreapi/friendlist.c
View file @
656ff43b
...
...
@@ -483,7 +483,7 @@ const char * linphone_friend_list_get_rls_uri(const LinphoneFriendList *list) {
void
linphone_friend_list_set_rls_uri
(
LinphoneFriendList
*
list
,
const
char
*
rls_uri
)
{
LinphoneAddress
*
addr
=
rls_uri
?
linphone_core_create_address
(
list
->
lc
,
rls_uri
)
:
NULL
;
linphone_friend_list_set_rls_address
(
list
,
addr
);
if
(
addr
)
linphone_address_
destroy
(
addr
);
if
(
addr
)
linphone_address_
unref
(
addr
);
}
static
LinphoneFriendListStatus
_linphone_friend_list_add_friend
(
LinphoneFriendList
*
list
,
LinphoneFriend
*
lf
,
bool_t
synchronize
)
{
...
...
coreapi/help/buddy_status.c
View file @
656ff43b
...
...
@@ -144,7 +144,7 @@ int main(int argc, char *argv[]){
linphone_proxy_config_set_server_addr
(
proxy_cfg
,
linphone_address_get_domain
(
from
));
/* we assume domain = proxy server address*/
linphone_proxy_config_enable_register
(
proxy_cfg
,
TRUE
);
/*activate registration for this proxy config*/
linphone_proxy_config_enable_publish
(
proxy_cfg
,
TRUE
);
/* enable presence satus publication for this proxy*/
linphone_address_
destroy
(
from
);
/*release resource*/
linphone_address_
unref
(
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*/
...
...
coreapi/help/notify.c
View file @
656ff43b
...
...
@@ -136,7 +136,7 @@ int main(int argc, char *argv[]){
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_address_
unref
(
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*/
...
...
coreapi/help/realtimetext_sender.c
View file @
656ff43b
...
...
@@ -77,7 +77,7 @@ int main(int argc, char *argv[]){
LinphoneCallParams
*
cp
=
linphone_core_create_call_params
(
lc
,
NULL
);
linphone_call_params_enable_realtime_text
(
cp
,
TRUE
);
/*enable real time text*/
call
=
linphone_core_invite_with_params
(
lc
,
dest
,
cp
);
linphone_call_params_
destroy
(
cp
);
linphone_call_params_
unref
(
cp
);
if
(
call
==
NULL
){
printf
(
"Could not place call to %s
\n
"
,
dest
);
goto
end
;
...
...
coreapi/help/registration.c
View file @
656ff43b
...
...
@@ -109,7 +109,7 @@ int main(int argc, char *argv[]){
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_address_
unref
(
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*/
...
...
coreapi/ldapprovider.c
View file @
656ff43b
...
...
@@ -228,7 +228,7 @@ static void linphone_ldap_contact_provider_handle_search_result( LinphoneLDAPCon
//ms_message("Added friend %s / %s", ldap_data.name, ldap_data.sip);
ms_free
(
ldap_data
.
sip
);
ms_free
(
ldap_data
.
name
);
linphone_address_
destroy
(
la
);
linphone_address_
unref
(
la
);
}
}
...
...
coreapi/linphonecall.c
View file @
656ff43b
...
...
@@ -894,7 +894,7 @@ void linphone_call_make_local_media_description(LinphoneCall *call) {
update_media_description_from_stun
(
md
,
&
call
->
ac
,
&
call
->
vc
,
&
call
->
tc
);
call
->
localdesc
=
md
;
linphone_call_update_local_media_description_from_ice_or_upnp
(
call
);
linphone_address_
destroy
(
addr
);
linphone_address_
unref
(
addr
);
if
(
old_md
){
transfer_already_assigned_payload_types
(
old_md
,
md
);
call
->
localdesc_changed
=
sal_media_description_equals
(
md
,
old_md
);
...
...
@@ -4696,7 +4696,7 @@ void linphone_call_set_contact_op(LinphoneCall* call) {
sal_address_clean
((
SalAddress
*
)
contact
);
/* clean out contact_params that come from proxy config*/
sal_address_set_transport
((
SalAddress
*
)
contact
,
tport
);
sal_op_set_contact_address
(
call
->
op
,
contact
);
linphone_address_
destroy
(
contact
);
linphone_address_
unref
(
contact
);
}
}
...
...
coreapi/linphonecore.c
View file @
656ff43b
...
...
@@ -2079,7 +2079,7 @@ int linphone_core_set_primary_contact(LinphoneCore *lc, const char *contact) {
ms_free
(
lc
->
sip_conf
.
guessed_contact
);
lc
->
sip_conf
.
guessed_contact
=
NULL
;
}
linphone_address_
destroy
(
ctt
);
linphone_address_
unref
(
ctt
);
return
0
;
}
...
...
@@ -2110,7 +2110,7 @@ static void update_primary_contact(LinphoneCore *lc){
it won't work. But we prefer to return something in all cases. It at least shows username and ip address.*/
guessed
=
linphone_address_as_string
(
url
);
lc
->
sip_conf
.
guessed_contact
=
guessed
;
linphone_address_
destroy
(
url
);
linphone_address_
unref
(
url
);
}
const
char
*
linphone_core_get_primary_contact
(
LinphoneCore
*
lc
){
...
...
@@ -2918,7 +2918,7 @@ LinphoneCall * linphone_core_start_refered_call(LinphoneCore *lc, LinphoneCall *
ms_message
(
"Starting new call to refered address %s"
,
call
->
refer_to
);
call
->
refer_pending
=
FALSE
;
newcall
=
linphone_core_invite_with_params
(
lc
,
call
->
refer_to
,
cp
);
linphone_call_params_
destroy
(
cp
);
linphone_call_params_
unref
(
cp
);
if
(
newcall
)
{
call
->
transfer_target
=
linphone_call_ref
(
newcall
);
linphone_core_notify_refer_state
(
lc
,
call
,
newcall
);
...
...
@@ -3132,7 +3132,7 @@ LinphoneCall * linphone_core_invite(LinphoneCore *lc, const char *url){
LinphoneCallParams
*
p
=
linphone_core_create_call_params
(
lc
,
NULL
);
p
->
has_video
&=
!!
lc
->
video_policy
.
automatically_initiate
;
call
=
linphone_core_invite_with_params
(
lc
,
url
,
p
);
linphone_call_params_
destroy
(
p
);
linphone_call_params_
unref
(
p
);
return
call
;
}
...
...
@@ -3141,7 +3141,7 @@ LinphoneCall * linphone_core_invite_with_params(LinphoneCore *lc, const char *ur
if
(
addr
){
LinphoneCall
*
call
;
call
=
linphone_core_invite_address_with_params
(
lc
,
addr
,
p
);
linphone_address_
destroy
(
addr
);
linphone_address_
unref
(
addr
);
return
call
;
}
return
NULL
;
...
...
@@ -3152,7 +3152,7 @@ LinphoneCall * linphone_core_invite_address(LinphoneCore *lc, const LinphoneAddr
LinphoneCallParams
*
p
=
linphone_core_create_call_params
(
lc
,
NULL
);
p
->
has_video
&=
!!
lc
->
video_policy
.
automatically_initiate
;
call
=
linphone_core_invite_address_with_params
(
lc
,
addr
,
p
);
linphone_call_params_
destroy
(
p
);
linphone_call_params_
unref
(
p
);
return
call
;
}
...
...
@@ -3244,7 +3244,7 @@ LinphoneCall * linphone_core_invite_address_with_params(LinphoneCore *lc, const
{
ms_warning
(
"we had a problem in adding the call into the invite ... weird"
);
linphone_call_unref
(
call
);
linphone_call_params_
destroy
(
cp
);
linphone_call_params_
unref
(
cp
);
return
NULL
;
}
...
...
@@ -3294,7 +3294,7 @@ LinphoneCall * linphone_core_invite_address_with_params(LinphoneCore *lc, const
}
if
(
real_url
!=
NULL
)
ms_free
(
real_url
);
linphone_call_params_
destroy
(
cp
);
linphone_call_params_
unref
(
cp
);
return
call
;
}
...
...
@@ -3314,7 +3314,7 @@ int linphone_core_transfer_call(LinphoneCore *lc, LinphoneCall *call, const char
real_url
=
linphone_address_as_string
(
real_parsed_url
);
sal_call_refer
(
call
->
op
,
real_url
);
ms_free
(
real_url
);
linphone_address_
destroy
(
real_parsed_url
);
linphone_address_
unref
(
real_parsed_url
);
linphone_call_set_transfer_state
(
call
,
LinphoneCallOutgoingInit
);
return
0
;
}
...
...
@@ -3349,7 +3349,7 @@ void linphone_core_notify_incoming_call(LinphoneCore *lc, LinphoneCall *call){
from_parsed
=
linphone_address_new
(
sal_op_get_from
(
call
->
op
));
linphone_address_clean
(
from_parsed
);
tmp
=
linphone_address_as_string
(
from_parsed
);
linphone_address_
destroy
(
from_parsed
);
linphone_address_
unref
(
from_parsed
);
barmesg
=
ortp_strdup_printf
(
"%s %s%s"
,
tmp
,
_
(
"is contacting you"
),
(
sal_call_autoanswer_asked
(
call
->
op
))
?
_
(
" and asked autoanswer."
)
:
"."
);
linphone_core_notify_show_interface
(
lc
);
...
...
@@ -5927,7 +5927,7 @@ void sip_config_uninit(LinphoneCore *lc)
if
(
config
->
contact
)
ms_free
(
config
->
contact
);
if
(
lc
->
default_rls_addr
)
linphone_address_
destroy
(
lc
->
default_rls_addr
);
linphone_address_
unref
(
lc
->
default_rls_addr
);
linphone_im_notif_policy_unref
(
lc
->
im_notif_policy
);
}
...
...
coreapi/message_storage.c
View file @
656ff43b
...
...
@@ -194,7 +194,7 @@ static int callback_all(void *data, int argc, char **argv, char **colName){
LinphoneAddress
*
addr
=
linphone_address_new
(
address
);
if
(
addr
){
linphone_core_get_chat_room
(
lc
,
addr
);
linphone_address_
destroy
(
addr
);
linphone_address_
unref
(
addr
);
}
return
0
;
}
...
...
coreapi/misc.c
View file @
656ff43b
...
...
@@ -1302,14 +1302,14 @@ static void linphone_core_migrate_proxy_config(LinphoneCore *lc, LinphoneTranspo
tmp
=
linphone_address_as_string
(
proxy_addr
);
linphone_proxy_config_set_server_addr
(
cfg
,
tmp
);
ms_free
(
tmp
);
linphone_address_
destroy
(
proxy_addr
);
linphone_address_
unref
(
proxy_addr
);
}
if
(
route_addr
){
linphone_address_set_transport
(
route_addr
,
type
);
tmp
=
linphone_address_as_string
(
route_addr
);
linphone_proxy_config_set_route
(
cfg
,
tmp
);
ms_free
(
tmp
);
linphone_address_
destroy
(
route_addr
);
linphone_address_
unref
(
route_addr
);
}
}
}
...
...
coreapi/presence.c
View file @
656ff43b
...
...
@@ -1547,7 +1547,7 @@ void linphone_subscription_new(LinphoneCore *lc, SalOp *op, const char *from){
linphone_core_add_subscriber
(
lc
,
tmp
,
op
);
}
}
linphone_address_
destroy
(
uri
);
linphone_address_
unref
(
uri
);
ms_free
(
tmp
);
}
...
...
coreapi/proxy.c
View file @
656ff43b
...
...
@@ -29,13 +29,13 @@ Copyright (C) 2000 Simon MORLAT (simon.morlat@linphone.org)
/*store current config related to server location*/
static
void
linphone_proxy_config_store_server_config
(
LinphoneProxyConfig
*
cfg
)
{
if
(
cfg
->
saved_identity
)
linphone_address_
destroy
(
cfg
->
saved_identity
);
if
(
cfg
->
saved_identity
)
linphone_address_
unref
(
cfg
->
saved_identity
);
if
(
cfg
->
identity_address
)
cfg
->
saved_identity
=
linphone_address_clone
(
cfg
->
identity_address
);
else
cfg
->
saved_identity
=
NULL
;
if
(
cfg
->
saved_proxy
)
linphone_address_
destroy
(
cfg
->
saved_proxy
);
if
(
cfg
->
saved_proxy
)
linphone_address_
unref
(
cfg
->
saved_proxy
);
if
(
cfg
->
reg_proxy
)
cfg
->
saved_proxy
=
linphone_address_new
(
cfg
->
reg_proxy
);
else
...
...
@@ -52,7 +52,7 @@ LinphoneProxyConfigAddressComparisonResult linphone_proxy_config_address_equal(c
return
LinphoneProxyConfigAddressEqual
;
if
(
linphone_address_weak_equal
(
a
,
b
))
{
/*also check both transport and uri */
if
(
linphone_address_
is
_secure
(
a
)
==
linphone_address_
is
_secure
(
b
)
&&
linphone_address_get_transport
(
a
)
==
linphone_address_get_transport
(
b
))
if
(
linphone_address_
get
_secure
(
a
)
==
linphone_address_
get
_secure
(
b
)
&&
linphone_address_get_transport
(
a
)
==
linphone_address_get_transport
(
b
))
return
LinphoneProxyConfigAddressWeakEqual
;
else
return
LinphoneProxyConfigAddressDifferent
;
...
...
@@ -78,7 +78,7 @@ LinphoneProxyConfigAddressComparisonResult linphone_proxy_config_is_server_confi
if
(
result
==
LinphoneProxyConfigAddressEqual
)
result
=
result_identity
;
end:
if
(
current_proxy
)
linphone_address_
destroy
(
current_proxy
);
if
(
current_proxy
)
linphone_address_
unref
(
current_proxy
);
ms_message
(
"linphone_proxy_config_is_server_config_changed : %i"
,
result
);
return
result
;
}
...
...
@@ -208,7 +208,7 @@ void _linphone_proxy_config_release_ops(LinphoneProxyConfig *cfg){
void
_linphone_proxy_config_destroy
(
LinphoneProxyConfig
*
cfg
){
if
(
cfg
->
reg_proxy
!=
NULL
)
ms_free
(
cfg
->
reg_proxy
);
if
(
cfg
->
reg_identity
!=
NULL
)
ms_free
(
cfg
->
reg_identity
);
if
(
cfg
->
identity_address
!=
NULL
)
linphone_address_
destroy
(
cfg
->
identity_address
);
if
(
cfg
->
identity_address
!=
NULL
)
linphone_address_
unref
(
cfg
->
identity_address
);
if
(
cfg
->
reg_route
!=
NULL
)
ms_free
(
cfg
->
reg_route
);
if
(
cfg
->
quality_reporting_collector
!=
NULL
)
ms_free
(
cfg
->
quality_reporting_collector
);
if
(
cfg
->
ssctx
!=
NULL
)
sip_setup_context_free
(
cfg
->
ssctx
);
...
...
@@ -217,8 +217,8 @@ void _linphone_proxy_config_destroy(LinphoneProxyConfig *cfg){
if
(
cfg
->
dial_prefix
!=
NULL
)
ms_free
(
cfg
->
dial_prefix
);
if
(
cfg
->
contact_params
)
ms_free
(
cfg
->
contact_params
);
if
(
cfg
->
contact_uri_params
)
ms_free
(
cfg
->
contact_uri_params
);
if
(
cfg
->
saved_proxy
!=
NULL
)
linphone_address_
destroy
(
cfg
->
saved_proxy
);
if
(
cfg
->
saved_identity
!=
NULL
)
linphone_address_
destroy
(
cfg
->
saved_identity
);
if
(
cfg
->
saved_proxy
!=
NULL
)
linphone_address_
unref
(
cfg
->
saved_proxy
);
if
(
cfg
->
saved_identity
!=
NULL
)
linphone_address_
unref
(
cfg
->
saved_identity
);
if
(
cfg
->
sent_headers
!=
NULL
)
sal_custom_header_free
(
cfg
->
sent_headers
);
if
(
cfg
->
pending_contact
)
linphone_address_unref
(
cfg
->
pending_contact
);
if
(
cfg
->
refkey
)
ms_free
(
cfg
->
refkey
);
...
...
@@ -267,7 +267,7 @@ int linphone_proxy_config_set_server_addr(LinphoneProxyConfig *cfg, const char *
addr
=
linphone_address_new
(
server_addr
);
if
(
addr
){
cfg
->
reg_proxy
=
linphone_address_as_string
(
addr
);
linphone_address_
destroy
(
addr
);
linphone_address_
unref
(
addr
);
}
else
{
ms_warning
(
"Could not parse %s"
,
server_addr
);
return
-
1
;
...
...
@@ -285,7 +285,7 @@ int linphone_proxy_config_set_identity_address(LinphoneProxyConfig *cfg, const L
return
-
1
;
}
if
(
cfg
->
identity_address
!=
NULL
)
{
linphone_address_
destroy
(
cfg
->
identity_address
);
linphone_address_
unref
(
cfg
->
identity_address
);
}
cfg
->
identity_address
=
linphone_address_clone
(
addr
);
...
...
@@ -300,7 +300,7 @@ int linphone_proxy_config_set_identity(LinphoneProxyConfig *cfg, const char *ide
if
(
identity
!=
NULL
&&
strlen
(
identity
)
>
0
){
LinphoneAddress
*
addr
=
linphone_address_new
(
identity
);
int
ret
=
linphone_proxy_config_set_identity_address
(
cfg
,
addr
);
if
(
addr
)
linphone_address_
destroy
(
addr
);
if
(
addr
)
linphone_address_
unref
(
addr
);
return
ret
;
}
return
-
1
;
...
...
@@ -446,7 +446,7 @@ LinphoneAddress *guess_contact_for_register(LinphoneProxyConfig *cfg){
ret
=
contact
;
}