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
ce01af18
Commit
ce01af18
authored
Jan 04, 2016
by
Ghislain MARY
Browse files
Notify presence list notify events only to the internal vtables.
parent
c20bcb0d
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
39 additions
and
1 deletion
+39
-1
coreapi/event.c
coreapi/event.c
+8
-0
coreapi/friendlist.c
coreapi/friendlist.c
+1
-0
coreapi/linphonecore.c
coreapi/linphonecore.c
+2
-0
coreapi/linphonecore.h
coreapi/linphonecore.h
+1
-0
coreapi/private.h
coreapi/private.h
+7
-0
coreapi/vtables.c
coreapi/vtables.c
+20
-1
No files found.
coreapi/event.c
View file @
ce01af18
...
...
@@ -88,6 +88,14 @@ LinphoneEvent *linphone_event_new_with_out_of_dialog_op(LinphoneCore *lc, SalOp
return
linphone_event_new_with_op_base
(
lc
,
op
,
dir
,
name
,
TRUE
);
}
void
linphone_event_set_internal
(
LinphoneEvent
*
lev
,
bool_t
internal
)
{
lev
->
internal
=
internal
;
}
bool_t
linphone_event_is_internal
(
LinphoneEvent
*
lev
)
{
return
lev
->
internal
;
}
void
linphone_event_set_state
(
LinphoneEvent
*
lev
,
LinphoneSubscriptionState
state
){
if
(
lev
->
subscription_state
!=
state
){
ms_message
(
"LinphoneEvent [%p] moving to subscription state %s"
,
lev
,
linphone_subscription_state_to_string
(
state
));
...
...
coreapi/friendlist.c
View file @
ce01af18
...
...
@@ -381,6 +381,7 @@ void linphone_friend_list_update_subscriptions(LinphoneFriendList *list, Linphon
int
expires
=
lp_config_get_int
(
list
->
lc
->
config
,
"sip"
,
"rls_presence_expires"
,
3600
);
list
->
expected_notification_version
=
0
;
list
->
event
=
linphone_core_create_subscribe
(
list
->
lc
,
address
,
"presence"
,
expires
);
linphone_event_set_internal
(
list
->
event
,
TRUE
);
linphone_event_add_custom_header
(
list
->
event
,
"Require"
,
"recipient-list-subscribe"
);
linphone_event_add_custom_header
(
list
->
event
,
"Supported"
,
"eventlist"
);
linphone_event_add_custom_header
(
list
->
event
,
"Accept"
,
"multipart/related, application/pidf+xml, application/rlmi+xml"
);
...
...
coreapi/linphonecore.c
View file @
ce01af18
...
...
@@ -1685,6 +1685,8 @@ static void linphone_core_init(LinphoneCore * lc, const LinphoneCoreVTable *vtab
const
char
*
remote_provisioning_uri
=
NULL
;
LinphoneCoreVTable
*
local_vtable
=
linphone_core_v_table_new
();
LinphoneCoreVTable
*
internal_vtable
=
linphone_core_v_table_new
();
linphone_core_v_table_set_internal
(
internal_vtable
,
TRUE
);
ms_message
(
"Initializing LinphoneCore %s"
,
linphone_core_get_version
());
lc
->
config
=
lp_config_ref
(
config
);
...
...
coreapi/linphonecore.h
View file @
ce01af18
...
...
@@ -2090,6 +2090,7 @@ typedef struct _LinphoneCoreVTable{
LinphoneCoreLogCollectionUploadStateChangedCb
log_collection_upload_state_changed
;
/**< Callback to upload collected logs */
LinphoneCoreLogCollectionUploadProgressIndicationCb
log_collection_upload_progress_indication
;
/**< Callback to indicate log collection upload progress */
void
*
user_data
;
/**<User data associated with the above callbacks */
bool_t
internal
;
}
LinphoneCoreVTable
;
/**
...
...
coreapi/private.h
View file @
ce01af18
...
...
@@ -976,6 +976,7 @@ struct _LinphoneEvent{
int
expires
;
bool_t
terminating
;
bool_t
is_out_of_dialog_op
;
/*used for out of dialog notify*/
bool_t
internal
;
};
...
...
@@ -1103,6 +1104,8 @@ LinphoneEvent *linphone_event_new_with_op(LinphoneCore *lc, SalOp *op, LinphoneS
* Useful for out of dialog notify
* */
LinphoneEvent
*
linphone_event_new_with_out_of_dialog_op
(
LinphoneCore
*
lc
,
SalOp
*
op
,
LinphoneSubscriptionDir
dir
,
const
char
*
name
);
void
linphone_event_set_internal
(
LinphoneEvent
*
lev
,
bool_t
internal
);
bool_t
linphone_event_is_internal
(
LinphoneEvent
*
lev
);
void
linphone_event_set_state
(
LinphoneEvent
*
lev
,
LinphoneSubscriptionState
state
);
void
linphone_event_set_publish_state
(
LinphoneEvent
*
lev
,
LinphonePublishState
state
);
LinphoneSubscriptionState
linphone_subscription_state_from_sal
(
SalSubscribeStatus
ss
);
...
...
@@ -1420,6 +1423,10 @@ typedef struct _VTableReference VTableReference;
void
v_table_reference_destroy
(
VTableReference
*
ref
);
void
_linphone_core_add_listener
(
LinphoneCore
*
lc
,
LinphoneCoreVTable
*
vtable
,
bool_t
autorelease
);
void
linphone_core_v_table_set_internal
(
LinphoneCoreVTable
*
table
,
bool_t
internal
);
bool_t
linphone_core_v_table_is_internal
(
LinphoneCoreVTable
*
table
);
#ifdef VIDEO_ENABLED
LINPHONE_PUBLIC
MSWebCam
*
linphone_call_get_video_device
(
const
LinphoneCall
*
call
);
MSWebCam
*
get_nowebcam_device
(
void
);
...
...
coreapi/vtables.c
View file @
ce01af18
...
...
@@ -33,6 +33,14 @@ void* linphone_core_v_table_get_user_data(LinphoneCoreVTable *table) {
return
table
->
user_data
;
}
void
linphone_core_v_table_set_internal
(
LinphoneCoreVTable
*
table
,
bool_t
internal
)
{
table
->
internal
=
internal
;
}
bool_t
linphone_core_v_table_is_internal
(
LinphoneCoreVTable
*
table
)
{
return
table
->
internal
;
}
void
linphone_core_v_table_destroy
(
LinphoneCoreVTable
*
table
)
{
ms_free
(
table
);
}
...
...
@@ -66,6 +74,17 @@ static void cleanup_dead_vtable_refs(LinphoneCore *lc){
}\
if (has_cb) ms_message("Linphone core [%p] notifying [%s]",lc,#function_name)
#define NOTIFY_IF_EXIST_INTERNAL(function_name, internal, ...) \
MSList* iterator; \
VTableReference *ref; \
bool_t has_cb = FALSE; \
for (iterator=lc->vtable_refs; iterator!=NULL; iterator=iterator->next)\
if ((ref=(VTableReference*)iterator->data)->valid && (lc->current_vtable=ref->vtable)->function_name && (linphone_core_v_table_is_internal(lc->current_vtable) == internal)) {\
lc->current_vtable->function_name(__VA_ARGS__);\
has_cb = TRUE;\
}\
if (has_cb) ms_message("Linphone core [%p] notifying [%s]",lc,#function_name)
void
linphone_core_notify_global_state_changed
(
LinphoneCore
*
lc
,
LinphoneGlobalState
gstate
,
const
char
*
message
)
{
NOTIFY_IF_EXIST
(
global_state_changed
,
lc
,
gstate
,
message
);
cleanup_dead_vtable_refs
(
lc
);
...
...
@@ -229,7 +248,7 @@ void linphone_core_notify_network_reachable(LinphoneCore *lc, bool_t reachable)
}
void
linphone_core_notify_notify_received
(
LinphoneCore
*
lc
,
LinphoneEvent
*
lev
,
const
char
*
notified_event
,
const
LinphoneContent
*
body
)
{
NOTIFY_IF_EXIST
(
notify_received
,
lc
,
lev
,
notified_event
,
body
);
NOTIFY_IF_EXIST
_INTERNAL
(
notify_received
,
linphone_event_is_internal
(
lev
),
lc
,
lev
,
notified_event
,
body
);
cleanup_dead_vtable_refs
(
lc
);
}
...
...
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