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
08a2180c
Commit
08a2180c
authored
Nov 28, 2017
by
Ghislain MARY
Browse files
Fix reception of INFO messages.
parent
fec65e98
Changes
12
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
47 additions
and
19 deletions
+47
-19
coreapi/callbacks.c
coreapi/callbacks.c
+5
-3
coreapi/info.c
coreapi/info.c
+10
-14
coreapi/private.h
coreapi/private.h
+1
-1
include/linphone/info_message.h
include/linphone/info_message.h
+1
-1
src/call/call-listener.h
src/call/call-listener.h
+1
-0
src/call/call-p.h
src/call/call-p.h
+1
-0
src/call/call.cpp
src/call/call.cpp
+5
-0
src/conference/conference.cpp
src/conference/conference.cpp
+6
-0
src/conference/conference.h
src/conference/conference.h
+1
-0
src/conference/session/call-session-listener.h
src/conference/session/call-session-listener.h
+1
-0
src/conference/session/call-session-p.h
src/conference/session/call-session-p.h
+1
-0
src/conference/session/call-session.cpp
src/conference/session/call-session.cpp
+14
-0
No files found.
coreapi/callbacks.c
View file @
08a2180c
...
...
@@ -640,9 +640,11 @@ static void message_delivery_update(SalOp *op, SalMessageDeliveryStatus status){
}
}
static
void
info_received
(
SalOp
*
op
,
SalBodyHandler
*
body_handler
){
LinphoneCore
*
lc
=
(
LinphoneCore
*
)
op
->
get_sal
()
->
get_user_pointer
();
linphone_core_notify_info_message
(
lc
,
op
,
body_handler
);
static
void
info_received
(
SalOp
*
op
,
SalBodyHandler
*
body_handler
)
{
LinphonePrivate
::
CallSession
*
session
=
reinterpret_cast
<
LinphonePrivate
::
CallSession
*>
(
op
->
get_user_pointer
());
if
(
!
session
)
return
;
L_GET_PRIVATE
(
session
)
->
infoReceived
(
body_handler
);
}
static
void
subscribe_response
(
SalOp
*
op
,
SalSubscribeStatus
status
,
int
will_retry
){
...
...
coreapi/info.c
View file @
08a2180c
...
...
@@ -84,8 +84,10 @@ const char *linphone_info_message_get_header(const LinphoneInfoMessage *im, cons
return
sal_custom_header_find
(
im
->
headers
,
name
);
}
void
linphone_info_message_set_content
(
LinphoneInfoMessage
*
im
,
const
LinphoneContent
*
content
){
im
->
content
=
linphone_content_copy
(
content
);
void
linphone_info_message_set_content
(
LinphoneInfoMessage
*
im
,
const
LinphoneContent
*
content
)
{
if
(
im
->
content
)
linphone_content_unref
(
im
->
content
);
im
->
content
=
linphone_content_copy
(
content
);
}
const
LinphoneContent
*
linphone_info_message_get_content
(
const
LinphoneInfoMessage
*
im
){
...
...
@@ -96,17 +98,11 @@ SalCustomHeader *linphone_info_message_get_headers (const LinphoneInfoMessage *i
return
im
->
headers
;
}
void
linphone_core_notify_info_message
(
LinphoneCore
*
lc
,
LinphonePrivate
::
SalOp
*
op
,
SalBodyHandler
*
body_handler
)
{
LinphoneCall
*
call
=
(
LinphoneCall
*
)
op
->
get_user_pointer
();
if
(
call
){
LinphoneInfoMessage
*
info
=
linphone_core_create_info_message
(
lc
);
info
->
headers
=
sal_custom_header_clone
(
op
->
get_recv_custom_header
());
if
(
body_handler
)
info
->
content
=
linphone_content_from_sal_body_handler
(
body_handler
);
linphone_call_notify_info_message_received
(
call
,
info
);
linphone_info_message_unref
(
info
);
void
linphone_info_message_set_headers
(
LinphoneInfoMessage
*
im
,
const
SalCustomHeader
*
headers
)
{
if
(
im
->
headers
)
{
sal_custom_header_free
(
im
->
headers
);
im
->
headers
=
nullptr
;
}
if
(
headers
)
im
->
headers
=
sal_custom_header_clone
(
headers
);
}
coreapi/private.h
View file @
08a2180c
...
...
@@ -1152,7 +1152,6 @@ const char *linphone_core_create_uuid(LinphoneCore *lc);
void
linphone_configure_op
(
LinphoneCore
*
lc
,
LinphonePrivate
::
SalOp
*
op
,
const
LinphoneAddress
*
dest
,
SalCustomHeader
*
headers
,
bool_t
with_contact
);
void
linphone_configure_op_with_proxy
(
LinphoneCore
*
lc
,
LinphonePrivate
::
SalOp
*
op
,
const
LinphoneAddress
*
dest
,
SalCustomHeader
*
headers
,
bool_t
with_contact
,
LinphoneProxyConfig
*
proxy
);
void
linphone_call_create_op
(
LinphoneCall
*
call
);
void
linphone_core_notify_info_message
(
LinphoneCore
*
lc
,
LinphonePrivate
::
SalOp
*
op
,
SalBodyHandler
*
body
);
LinphoneContent
*
linphone_content_new
(
void
);
LinphoneContent
*
linphone_content_copy
(
const
LinphoneContent
*
ref
);
SalBodyHandler
*
sal_body_handler_from_content
(
const
LinphoneContent
*
content
);
...
...
@@ -1586,6 +1585,7 @@ LinphoneNatPolicy * linphone_config_create_nat_policy_from_section(const Linphon
SalCustomHeader
*
linphone_info_message_get_headers
(
const
LinphoneInfoMessage
*
im
);
void
linphone_info_message_set_headers
(
LinphoneInfoMessage
*
im
,
const
SalCustomHeader
*
headers
);
#ifdef __cplusplus
...
...
include/linphone/info_message.h
View file @
08a2180c
...
...
@@ -57,7 +57,7 @@ LINPHONE_PUBLIC const char *linphone_info_message_get_header(const LinphoneInfoM
* @param content the content described as a #LinphoneContent structure.
* All fields of the LinphoneContent are copied, thus the application can destroy/modify/recycloe the content object freely ater the function returns.
**/
LINPHONE_PUBLIC
void
linphone_info_message_set_content
(
LinphoneInfoMessage
*
im
,
const
LinphoneContent
*
content
);
LINPHONE_PUBLIC
void
linphone_info_message_set_content
(
LinphoneInfoMessage
*
im
,
const
LinphoneContent
*
content
);
/**
* Returns the info message's content as a #LinphoneContent structure.
...
...
src/call/call-listener.h
View file @
08a2180c
...
...
@@ -38,6 +38,7 @@ public:
virtual
void
onCheckForAcceptation
()
=
0
;
virtual
void
onIncomingCallStarted
()
=
0
;
virtual
void
onIncomingCallToBeAdded
()
=
0
;
virtual
void
onInfoReceived
(
const
LinphoneInfoMessage
*
im
)
=
0
;
virtual
void
onEncryptionChanged
(
bool
activated
,
const
std
::
string
&
authToken
)
=
0
;
...
...
src/call/call-p.h
View file @
08a2180c
...
...
@@ -77,6 +77,7 @@ private:
void
onCheckForAcceptation
()
override
;
void
onIncomingCallStarted
()
override
;
void
onIncomingCallToBeAdded
()
override
;
void
onInfoReceived
(
const
LinphoneInfoMessage
*
im
)
override
;
void
onEncryptionChanged
(
bool
activated
,
const
std
::
string
&
authToken
)
override
;
void
onStatsUpdated
(
const
LinphoneCallStats
*
stats
)
override
;
void
onResetCurrentCall
()
override
;
...
...
src/call/call.cpp
View file @
08a2180c
...
...
@@ -177,6 +177,11 @@ void CallPrivate::onIncomingCallToBeAdded () {
linphone_core_add_call
(
core
,
lcall
);
}
void
CallPrivate
::
onInfoReceived
(
const
LinphoneInfoMessage
*
im
)
{
if
(
lcall
)
linphone_call_notify_info_message_received
(
lcall
,
im
);
}
void
CallPrivate
::
onEncryptionChanged
(
bool
activated
,
const
string
&
authToken
)
{
if
(
lcall
)
linphone_call_notify_encryption_changed
(
lcall
,
activated
,
authToken
.
empty
()
?
nullptr
:
authToken
.
c_str
());
...
...
src/conference/conference.cpp
View file @
08a2180c
...
...
@@ -170,6 +170,12 @@ void Conference::onIncomingCallSessionStarted (const shared_ptr<const CallSessio
d
->
callListener
->
onIncomingCallStarted
();
}
void
Conference
::
onInfoReceived
(
const
std
::
shared_ptr
<
const
CallSession
>
&
session
,
const
LinphoneInfoMessage
*
im
)
{
L_D
();
if
(
d
->
callListener
)
d
->
callListener
->
onInfoReceived
(
im
);
}
void
Conference
::
onEncryptionChanged
(
const
shared_ptr
<
const
CallSession
>
&
session
,
bool
activated
,
const
string
&
authToken
)
{
L_D
();
if
(
d
->
callListener
)
...
...
src/conference/conference.h
View file @
08a2180c
...
...
@@ -74,6 +74,7 @@ private:
void
onCallSessionStateChanged
(
const
std
::
shared_ptr
<
const
CallSession
>
&
session
,
LinphoneCallState
state
,
const
std
::
string
&
message
)
override
;
void
onCheckForAcceptation
(
const
std
::
shared_ptr
<
const
CallSession
>
&
session
)
override
;
void
onIncomingCallSessionStarted
(
const
std
::
shared_ptr
<
const
CallSession
>
&
session
)
override
;
void
onInfoReceived
(
const
std
::
shared_ptr
<
const
CallSession
>
&
session
,
const
LinphoneInfoMessage
*
im
)
override
;
void
onEncryptionChanged
(
const
std
::
shared_ptr
<
const
CallSession
>
&
session
,
bool
activated
,
const
std
::
string
&
authToken
)
override
;
void
onStatsUpdated
(
const
LinphoneCallStats
*
stats
)
override
;
void
onResetCurrentSession
(
const
std
::
shared_ptr
<
const
CallSession
>
&
session
)
override
;
...
...
src/conference/session/call-session-listener.h
View file @
08a2180c
...
...
@@ -38,6 +38,7 @@ public:
virtual
void
onCallSessionStateChanged
(
const
std
::
shared_ptr
<
const
CallSession
>
&
session
,
LinphoneCallState
state
,
const
std
::
string
&
message
)
=
0
;
virtual
void
onCheckForAcceptation
(
const
std
::
shared_ptr
<
const
CallSession
>
&
session
)
=
0
;
virtual
void
onIncomingCallSessionStarted
(
const
std
::
shared_ptr
<
const
CallSession
>
&
session
)
=
0
;
virtual
void
onInfoReceived
(
const
std
::
shared_ptr
<
const
CallSession
>
&
session
,
const
LinphoneInfoMessage
*
im
)
=
0
;
virtual
void
onEncryptionChanged
(
const
std
::
shared_ptr
<
const
CallSession
>
&
session
,
bool
activated
,
const
std
::
string
&
authToken
)
=
0
;
...
...
src/conference/session/call-session-p.h
View file @
08a2180c
...
...
@@ -49,6 +49,7 @@ public:
void
ackBeingSent
(
LinphoneHeaders
*
headers
);
virtual
void
ackReceived
(
LinphoneHeaders
*
headers
);
virtual
bool
failure
();
void
infoReceived
(
SalBodyHandler
*
bodyHandler
);
void
pingReply
();
virtual
void
remoteRinging
();
virtual
void
terminated
();
...
...
src/conference/session/call-session.cpp
View file @
08a2180c
...
...
@@ -322,6 +322,20 @@ bool CallSessionPrivate::failure () {
return
false
;
}
void
CallSessionPrivate
::
infoReceived
(
SalBodyHandler
*
bodyHandler
)
{
L_Q
();
LinphoneInfoMessage
*
info
=
linphone_core_create_info_message
(
core
);
linphone_info_message_set_headers
(
info
,
op
->
get_recv_custom_header
());
if
(
bodyHandler
)
{
LinphoneContent
*
content
=
linphone_content_from_sal_body_handler
(
bodyHandler
);
linphone_info_message_set_content
(
info
,
content
);
linphone_content_unref
(
content
);
}
if
(
listener
)
listener
->
onInfoReceived
(
q
->
getSharedFromThis
(),
info
);
linphone_info_message_unref
(
info
);
}
void
CallSessionPrivate
::
pingReply
()
{
L_Q
();
if
(
state
==
LinphoneCallOutgoingInit
)
{
...
...
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