Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
L
liblinphone
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
10
Issues
10
List
Board
Labels
Milestones
Merge Requests
21
Merge Requests
21
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
External Wiki
External Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
BC
public
liblinphone
Commits
58cb7a3f
Commit
58cb7a3f
authored
Jan 28, 2016
by
jehan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
use belle-sip refresher with dialog terminated recovery capability
parent
e73f376c
Changes
15
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
15 changed files
with
182 additions
and
43 deletions
+182
-43
sal_impl.c
coreapi/bellesip_sal/sal_impl.c
+2
-2
sal_op_events.c
coreapi/bellesip_sal/sal_op_events.c
+9
-5
sal_op_impl.c
coreapi/bellesip_sal/sal_op_impl.c
+2
-2
callbacks.c
coreapi/callbacks.c
+2
-2
event.c
coreapi/event.c
+1
-1
friendlist.c
coreapi/friendlist.c
+19
-0
linphonecore.c
coreapi/linphonecore.c
+7
-0
private.h
coreapi/private.h
+1
-0
vtables.c
coreapi/vtables.c
+1
-1
sal.h
include/sal/sal.h
+2
-2
eventapi_tester.c
tester/eventapi_tester.c
+2
-1
flexisip.conf
tester/flexisip/flexisip.conf
+1
-0
presence_tester.c
tester/presence_tester.c
+131
-19
register_tester.c
tester/register_tester.c
+1
-1
tester.c
tester/tester.c
+1
-7
No files found.
coreapi/bellesip_sal/sal_impl.c
View file @
58cb7a3f
...
...
@@ -542,8 +542,8 @@ void sal_set_callbacks(Sal *ctx, const SalCallbacks *cbs){
ctx
->
callbacks
.
notify
=
(
SalOnNotify
)
unimplemented_stub
;
if
(
ctx
->
callbacks
.
subscribe_received
==
NULL
)
ctx
->
callbacks
.
subscribe_received
=
(
SalOnSubscribeReceived
)
unimplemented_stub
;
if
(
ctx
->
callbacks
.
subscribe_closed
==
NULL
)
ctx
->
callbacks
.
subscribe_closed
=
(
SalOn
SubscribeClosed
)
unimplemented_stub
;
if
(
ctx
->
callbacks
.
incoming_
subscribe_closed
==
NULL
)
ctx
->
callbacks
.
incoming_subscribe_closed
=
(
SalOnIncoming
SubscribeClosed
)
unimplemented_stub
;
if
(
ctx
->
callbacks
.
parse_presence_requested
==
NULL
)
ctx
->
callbacks
.
parse_presence_requested
=
(
SalOnParsePresenceRequested
)
unimplemented_stub
;
if
(
ctx
->
callbacks
.
convert_presence_to_xml_requested
==
NULL
)
...
...
coreapi/bellesip_sal/sal_op_events.c
View file @
58cb7a3f
...
...
@@ -46,11 +46,15 @@ static void subscribe_refresher_listener (belle_sip_refresher_t* refresher
if
(
status_code
==
200
)
sss
=
SalSubscribeActive
;
else
if
(
status_code
==
202
)
sss
=
SalSubscribePending
;
set_or_update_dialog
(
op
,
belle_sip_transaction_get_dialog
(
tr
));
}
if
(
status_code
>=
200
){
sal_error_info_set
(
&
op
->
error_info
,
SalReasonUnknown
,
status_code
,
reason_phrase
,
NULL
);
op
->
base
.
root
->
callbacks
.
subscribe_response
(
op
,
sss
);
}
else
if
(
status_code
==
0
){
}
else
if
(
status_code
>=
300
)
{
SalReason
reason
=
SalReasonUnknown
;
if
(
status_code
==
503
)
{
/*refresher returns 503 for IO error*/
reason
=
SalReasonIOError
;
}
sal_error_info_set
(
&
op
->
error_info
,
reason
,
status_code
,
reason_phrase
,
NULL
);
op
->
base
.
root
->
callbacks
.
subscribe_response
(
op
,
sss
);
}
if
(
status_code
==
0
){
op
->
base
.
root
->
callbacks
.
on_expire
(
op
);
}
...
...
@@ -172,7 +176,7 @@ static void subscribe_process_request_event(void *op_base, const belle_sip_reque
ms_message
(
"Unsubscribe received from [%s]"
,
sal_op_get_from
(
op
));
resp
=
sal_op_create_response_from_request
(
op
,
req
,
200
);
belle_sip_server_transaction_send_response
(
server_transaction
,
resp
);
op
->
base
.
root
->
callbacks
.
subscribe_closed
(
op
);
op
->
base
.
root
->
callbacks
.
incoming_
subscribe_closed
(
op
);
}
}
break
;
...
...
coreapi/bellesip_sal/sal_op_impl.c
View file @
58cb7a3f
...
...
@@ -518,14 +518,14 @@ SalReason _sal_reason_from_sip_code(int code) {
return
SalReasonNotImplemented
;
case
502
:
return
SalReasonBadGateway
;
case
503
:
return
SalReasonServiceUnavailable
;
case
504
:
return
SalReasonServerTimeout
;
case
600
:
return
SalReasonDoNotDisturb
;
case
603
:
return
SalReasonDeclined
;
case
503
:
return
SalReasonServiceUnavailable
;
default
:
return
SalReasonUnknown
;
}
...
...
coreapi/callbacks.c
View file @
58cb7a3f
...
...
@@ -1343,7 +1343,7 @@ static void subscribe_received(SalOp *op, const char *eventname, const SalBodyHa
}
static
void
subscribe_closed
(
SalOp
*
op
){
static
void
incoming_
subscribe_closed
(
SalOp
*
op
){
LinphoneEvent
*
lev
=
(
LinphoneEvent
*
)
sal_op_get_user_pointer
(
op
);
linphone_event_set_state
(
lev
,
LinphoneSubscriptionTerminated
);
...
...
@@ -1400,7 +1400,7 @@ SalCallbacks linphone_sal_callbacks={
is_composing_received
,
notify_refer
,
subscribe_received
,
subscribe_closed
,
incoming_
subscribe_closed
,
subscribe_response
,
notify
,
subscribe_presence_received
,
...
...
coreapi/event.c
View file @
58cb7a3f
...
...
@@ -35,7 +35,7 @@ const char *linphone_subscription_state_to_string(LinphoneSubscriptionState stat
switch
(
state
){
case
LinphoneSubscriptionNone
:
return
"LinphoneSubscriptionNone"
;
case
LinphoneSubscriptionIncomingReceived
:
return
"LinphoneSubscriptionIncomingReceived"
;
case
LinphoneSubscriptionOutgoing
Init
:
return
"LinphoneSubscriptionOutoingInit
"
;
case
LinphoneSubscriptionOutgoing
Progress
:
return
"LinphoneSubscriptionOutgoingProgress
"
;
case
LinphoneSubscriptionPending
:
return
"LinphoneSubscriptionPending"
;
case
LinphoneSubscriptionActive
:
return
"LinphoneSubscriptionActive"
;
case
LinphoneSubscriptionTerminated
:
return
"LinphoneSubscriptionTerminated"
;
...
...
coreapi/friendlist.c
View file @
58cb7a3f
...
...
@@ -419,6 +419,7 @@ void linphone_friend_list_update_subscriptions(LinphoneFriendList *list, Linphon
linphone_content_set_string_buffer
(
content
,
xml_content
);
linphone_event_send_subscribe
(
list
->
event
,
content
);
linphone_content_unref
(
content
);
linphone_event_set_user_data
(
list
->
event
,
list
);
}
}
if
(
address
!=
NULL
)
linphone_address_unref
(
address
);
...
...
@@ -476,3 +477,21 @@ void linphone_friend_list_notify_presence_received(LinphoneFriendList *list, Lin
linphone_content_unref
(
first_part
);
}
}
void
linphone_friend_list_subscription_state_changed
(
LinphoneCore
*
lc
,
LinphoneEvent
*
lev
,
LinphoneSubscriptionState
state
)
{
LinphoneFriendList
*
list
=
(
LinphoneFriendList
*
)
linphone_event_get_user_data
(
lev
);
if
(
!
list
)
{
ms_warning
(
"core [%p] Receiving unexpected state [%s] for event [%p], no associated friend list"
,
lc
,
linphone_subscription_state_to_string
(
state
)
,
lev
);
}
else
{
ms_message
(
"Receiving new state [%s] for event [%p] for friend list [%p]"
,
linphone_subscription_state_to_string
(
state
)
,
lev
,
list
);
if
(
state
==
LinphoneSubscriptionOutgoingProgress
)
{
ms_message
(
"Resseting version count for friend list [%p]"
,
list
);
list
->
expected_notification_version
=
0
;
}
}
}
coreapi/linphonecore.c
View file @
58cb7a3f
...
...
@@ -1654,6 +1654,12 @@ static void linphone_core_internal_notify_received(LinphoneCore *lc, LinphoneEve
}
}
static
void
linphone_core_internal_subscription_state_changed
(
LinphoneCore
*
lc
,
LinphoneEvent
*
lev
,
LinphoneSubscriptionState
state
)
{
if
(
strcasecmp
(
linphone_event_get_name
(
lev
),
"Presence"
)
==
0
)
{
linphone_friend_list_subscription_state_changed
(
lc
,
lev
,
state
);
}
}
static
void
linphone_core_init
(
LinphoneCore
*
lc
,
const
LinphoneCoreVTable
*
vtable
,
LpConfig
*
config
,
void
*
userdata
){
const
char
*
remote_provisioning_uri
=
NULL
;
LinphoneCoreVTable
*
local_vtable
=
linphone_core_v_table_new
();
...
...
@@ -1668,6 +1674,7 @@ static void linphone_core_init(LinphoneCore * lc, const LinphoneCoreVTable *vtab
linphone_task_list_init
(
&
lc
->
hooks
);
internal_vtable
->
notify_received
=
linphone_core_internal_notify_received
;
internal_vtable
->
subscription_state_changed
=
linphone_core_internal_subscription_state_changed
;
_linphone_core_add_listener
(
lc
,
internal_vtable
,
TRUE
,
TRUE
);
memcpy
(
local_vtable
,
vtable
,
sizeof
(
LinphoneCoreVTable
));
_linphone_core_add_listener
(
lc
,
local_vtable
,
TRUE
,
FALSE
);
...
...
coreapi/private.h
View file @
58cb7a3f
...
...
@@ -406,6 +406,7 @@ const LinphoneAddress* linphone_proxy_config_get_service_route(const LinphonePro
void
linphone_friend_list_invalidate_subscriptions
(
LinphoneFriendList
*
list
);
void
linphone_friend_list_notify_presence_received
(
LinphoneFriendList
*
list
,
LinphoneEvent
*
lev
,
const
LinphoneContent
*
body
);
void
linphone_friend_list_subscription_state_changed
(
LinphoneCore
*
lc
,
LinphoneEvent
*
lev
,
LinphoneSubscriptionState
state
);
void
_linphone_friend_list_release
(
LinphoneFriendList
*
list
);
void
linphone_friend_invalidate_subscription
(
LinphoneFriend
*
lf
);
void
linphone_friend_close_subscriptions
(
LinphoneFriend
*
lf
);
...
...
coreapi/vtables.c
View file @
58cb7a3f
...
...
@@ -245,7 +245,7 @@ void linphone_core_notify_notify_received(LinphoneCore *lc, LinphoneEvent *lev,
}
void
linphone_core_notify_subscription_state_changed
(
LinphoneCore
*
lc
,
LinphoneEvent
*
lev
,
LinphoneSubscriptionState
state
)
{
NOTIFY_IF_EXIST
(
subscription_state_changed
,
lc
,
lev
,
state
);
NOTIFY_IF_EXIST
_INTERNAL
(
subscription_state_changed
,
linphone_event_is_internal
(
lev
)
,
lc
,
lev
,
state
);
cleanup_dead_vtable_refs
(
lc
);
}
...
...
include/sal/sal.h
View file @
58cb7a3f
...
...
@@ -489,7 +489,7 @@ typedef void (*SalOnNotifyRefer)(SalOp *op, SalReferStatus state);
typedef
void
(
*
SalOnSubscribeResponse
)(
SalOp
*
op
,
SalSubscribeStatus
status
);
typedef
void
(
*
SalOnNotify
)(
SalOp
*
op
,
SalSubscribeStatus
status
,
const
char
*
event
,
SalBodyHandler
*
body
);
typedef
void
(
*
SalOnSubscribeReceived
)(
SalOp
*
salop
,
const
char
*
event
,
const
SalBodyHandler
*
body
);
typedef
void
(
*
SalOnSubscribeClosed
)(
SalOp
*
salop
);
typedef
void
(
*
SalOn
Incoming
SubscribeClosed
)(
SalOp
*
salop
);
typedef
void
(
*
SalOnParsePresenceRequested
)(
SalOp
*
salop
,
const
char
*
content_type
,
const
char
*
content_subtype
,
const
char
*
content
,
SalPresenceModel
**
result
);
typedef
void
(
*
SalOnConvertPresenceToXMLRequested
)(
SalOp
*
salop
,
SalPresenceModel
*
presence
,
const
char
*
contact
,
char
**
content
);
typedef
void
(
*
SalOnNotifyPresence
)(
SalOp
*
op
,
SalSubscribeStatus
ss
,
SalPresenceModel
*
model
,
const
char
*
msg
);
...
...
@@ -523,7 +523,7 @@ typedef struct SalCallbacks{
SalOnIsComposingReceived
is_composing_received
;
SalOnNotifyRefer
notify_refer
;
SalOnSubscribeReceived
subscribe_received
;
SalOn
SubscribeClosed
subscribe_closed
;
SalOn
IncomingSubscribeClosed
incoming_
subscribe_closed
;
SalOnSubscribeResponse
subscribe_response
;
SalOnNotify
notify
;
SalOnSubscribePresenceReceived
subscribe_presence_received
;
...
...
tester/eventapi_tester.c
View file @
58cb7a3f
...
...
@@ -38,8 +38,9 @@ const char *liblinphone_tester_get_notify_content(void){
void
linphone_notify_received
(
LinphoneCore
*
lc
,
LinphoneEvent
*
lev
,
const
char
*
eventname
,
const
LinphoneContent
*
content
){
LinphoneCoreManager
*
mgr
;
const
char
*
ua
=
linphone_event_get_custom_header
(
lev
,
"User-Agent"
);
BC_ASSERT_PTR_NOT_NULL_FATAL
(
content
);
if
(
!
linphone_content_is_multipart
(
content
)
)
{
if
(
!
linphone_content_is_multipart
(
content
)
&&
(
!
ua
||
!
strcasestr
(
ua
,
"flexisip"
)))
{
/*disable check for full presence serveur support*/
/*hack to disable content checking for list notify */
BC_ASSERT_STRING_EQUAL
(
notify_content
,(
const
char
*
)
linphone_content_get_buffer
(
content
));
}
...
...
tester/flexisip/flexisip.conf
View file @
58cb7a3f
...
...
@@ -617,6 +617,7 @@ ban-time=1
[
module
::
Presence
]
enabled
=
true
presence
-
server
= <
sip
:
127
.
0
.
0
.
1
:
5065
;
transport
=
tcp
>
only
-
list
-
subscription
= !(
user
-
agent
contains
'full-presence-support'
)
[
presence
-
server
]
expires
=
600
...
...
tester/presence_tester.c
View file @
58cb7a3f
This diff is collapsed.
Click to expand it.
tester/register_tester.c
View file @
58cb7a3f
...
...
@@ -216,7 +216,7 @@ static void simple_unregister(void){
LinphoneProxyConfig
*
proxy_config
;
register_with_refresh_base
(
lcm
->
lc
,
FALSE
,
NULL
,
NULL
);
linphone_core_get_default_proxy
(
lcm
->
lc
,
&
proxy_config
);
proxy_config
=
linphone_core_get_default_proxy_config
(
lcm
->
lc
);
linphone_proxy_config_edit
(
proxy_config
);
reset_counters
(
counters
);
/*clear stats*/
...
...
tester/tester.c
View file @
58cb7a3f
...
...
@@ -255,11 +255,6 @@ bool_t transport_supported(LinphoneTransportType transport) {
return
supported
;
}
static
void
display_status
(
LinphoneCore
*
lc
,
const
char
*
status
){
ms_message
(
"display_status(): %s"
,
status
);
}
void
linphone_core_manager_init
(
LinphoneCoreManager
*
mgr
,
const
char
*
rc_file
)
{
char
*
rc_path
=
NULL
;
char
*
hellopath
=
bc_tester_res
(
"sounds/hello8000.wav"
);
...
...
@@ -282,7 +277,6 @@ void linphone_core_manager_init(LinphoneCoreManager *mgr, const char* rc_file) {
mgr
->
v_table
.
network_reachable
=
network_reachable
;
mgr
->
v_table
.
dtmf_received
=
dtmf_received
;
mgr
->
v_table
.
call_stats_updated
=
call_stats_updated
;
mgr
->
v_table
.
display_status
=
display_status
;
reset_counters
(
&
mgr
->
stat
);
if
(
rc_file
)
rc_path
=
ms_strdup_printf
(
"rcfiles/%s"
,
rc_file
);
...
...
@@ -354,7 +348,7 @@ void linphone_core_manager_start(LinphoneCoreManager *mgr, int check_for_proxies
BC_ASSERT_EQUAL
(
mgr
->
stat
.
number_of_LinphoneRegistrationOk
,
proxy_count
,
int
,
"%d"
);
enable_codec
(
mgr
->
lc
,
"PCMU"
,
8000
);
linphone_core_get_default_proxy
(
mgr
->
lc
,
&
proxy
);
proxy
=
linphone_core_get_default_proxy_config
(
mgr
->
lc
);
if
(
proxy
)
{
mgr
->
identity
=
linphone_address_clone
(
linphone_proxy_config_get_identity_address
(
proxy
));
linphone_address_clean
(
mgr
->
identity
);
...
...
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