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
70163d16
Commit
70163d16
authored
May 17, 2017
by
Ghislain MARY
Browse files
Fix wrong event ref handling for long term event of presence.
parent
79b3427a
Changes
3
Hide whitespace changes
Inline
Side-by-side
coreapi/linphonecore.c
View file @
70163d16
...
...
@@ -2085,6 +2085,20 @@ static void linphone_core_internal_subscription_state_changed(LinphoneCore *lc,
}
}
static
void
linphone_core_internal_publish_state_changed
(
LinphoneCore
*
lc
,
LinphoneEvent
*
lev
,
LinphonePublishState
state
)
{
if
(
strcasecmp
(
linphone_event_get_name
(
lev
),
"Presence"
)
==
0
)
{
const
bctbx_list_t
*
cfgs
=
linphone_core_get_proxy_config_list
(
lc
);
const
bctbx_list_t
*
item
;
for
(
item
=
cfgs
;
item
!=
NULL
;
item
=
bctbx_list_next
(
item
))
{
LinphoneProxyConfig
*
cfg
=
(
LinphoneProxyConfig
*
)
bctbx_list_get_data
(
item
);
if
(
cfg
->
long_term_event
==
lev
)
{
linphone_proxy_config_notify_publish_state_changed
(
cfg
,
state
);
break
;
}
}
}
}
static
void
_linphone_core_init_account_creator_service
(
LinphoneCore
*
lc
)
{
LinphoneAccountCreatorService
*
service
=
linphone_account_creator_service_new
();
service
->
account_creator_service_constructor_cb
=
linphone_account_creator_constructor_linphone
;
...
...
@@ -2121,6 +2135,7 @@ static void linphone_core_init(LinphoneCore * lc, LinphoneCoreCbs *cbs, LpConfig
linphone_core_cbs_set_notify_received
(
internal_cbs
,
linphone_core_internal_notify_received
);
linphone_core_cbs_set_subscription_state_changed
(
internal_cbs
,
linphone_core_internal_subscription_state_changed
);
linphone_core_cbs_set_publish_state_changed
(
internal_cbs
,
linphone_core_internal_publish_state_changed
);
_linphone_core_add_callbacks
(
lc
,
internal_cbs
,
TRUE
);
belle_sip_object_unref
(
internal_cbs
);
...
...
coreapi/private.h
View file @
70163d16
...
...
@@ -453,6 +453,7 @@ void linphone_proxy_config_stop_refreshing(LinphoneProxyConfig *obj);
void
linphone_proxy_config_write_all_to_config_file
(
LinphoneCore
*
lc
);
void
_linphone_proxy_config_release
(
LinphoneProxyConfig
*
cfg
);
void
_linphone_proxy_config_unpublish
(
LinphoneProxyConfig
*
obj
);
void
linphone_proxy_config_notify_publish_state_changed
(
LinphoneProxyConfig
*
cfg
,
LinphonePublishState
state
);
/*
* returns service route as defined in as defined by rfc3608, might be a list instead of just one.
...
...
coreapi/proxy.c
View file @
70163d16
...
...
@@ -824,8 +824,6 @@ LinphoneStatus linphone_proxy_config_done(LinphoneProxyConfig *cfg)
}
/*publish is terminated*/
linphone_event_terminate
(
cfg
->
long_term_event
);
linphone_event_unref
(
cfg
->
long_term_event
);
cfg
->
long_term_event
=
NULL
;
}
if
(
cfg
->
publish
)
cfg
->
send_publish
=
TRUE
;
}
else
{
...
...
@@ -1461,3 +1459,10 @@ void linphone_proxy_config_set_nat_policy(LinphoneProxyConfig *cfg, LinphoneNatP
if
(
cfg
->
nat_policy
!=
NULL
)
linphone_nat_policy_unref
(
cfg
->
nat_policy
);
cfg
->
nat_policy
=
policy
;
}
void
linphone_proxy_config_notify_publish_state_changed
(
LinphoneProxyConfig
*
cfg
,
LinphonePublishState
state
)
{
if
((
cfg
->
long_term_event
!=
NULL
)
&&
((
state
==
LinphonePublishCleared
)
||
(
state
==
LinphonePublishError
)))
{
linphone_event_unref
(
cfg
->
long_term_event
);
cfg
->
long_term_event
=
NULL
;
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment