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
4cc7985d
Commit
4cc7985d
authored
Dec 28, 2017
by
Ghislain MARY
Browse files
Correctly define call session state enumeration.
parent
4c0c1b6a
Changes
26
Hide whitespace changes
Inline
Side-by-side
Showing
20 changed files
with
198 additions
and
116 deletions
+198
-116
coreapi/callbacks.c
coreapi/callbacks.c
+6
-8
coreapi/linphonecall.c
coreapi/linphonecall.c
+0
-29
coreapi/private_functions.h
coreapi/private_functions.h
+0
-2
include/CMakeLists.txt
include/CMakeLists.txt
+1
-0
include/linphone/api/c-types.h
include/linphone/api/c-types.h
+12
-0
include/linphone/enums/call-enums.h
include/linphone/enums/call-enums.h
+74
-0
include/linphone/types.h
include/linphone/types.h
+0
-29
include/linphone/utils/magic-macros.h
include/linphone/utils/magic-macros.h
+52
-2
src/c-wrapper/api/c-call.cpp
src/c-wrapper/api/c-call.cpp
+2
-2
src/call/call-p.h
src/call/call-p.h
+2
-2
src/call/call.cpp
src/call/call.cpp
+15
-15
src/call/call.h
src/call/call.h
+3
-2
src/chat/chat-message/chat-message.cpp
src/chat/chat-message/chat-message.cpp
+16
-12
src/chat/chat-room/basic-to-client-group-chat-room.cpp
src/chat/chat-room/basic-to-client-group-chat-room.cpp
+2
-2
src/chat/chat-room/client-group-chat-room-p.h
src/chat/chat-room/client-group-chat-room-p.h
+1
-1
src/chat/chat-room/client-group-chat-room.cpp
src/chat/chat-room/client-group-chat-room.cpp
+4
-4
src/chat/chat-room/client-group-to-basic-chat-room.cpp
src/chat/chat-room/client-group-to-basic-chat-room.cpp
+2
-2
src/chat/chat-room/server-group-chat-room-p.h
src/chat/chat-room/server-group-chat-room-p.h
+1
-1
src/chat/chat-room/server-group-chat-room-stub.cpp
src/chat/chat-room/server-group-chat-room-stub.cpp
+1
-1
src/conference/session/call-session-listener.h
src/conference/session/call-session-listener.h
+4
-2
No files found.
coreapi/callbacks.c
View file @
4cc7985d
...
...
@@ -248,7 +248,7 @@ static void call_released(SalOp *op) {
* when declining an incoming call with busy because maximum number of calls is reached. */
return
;
}
L_GET_PRIVATE
(
session
)
->
setState
(
Linphone
Call
Released
,
"Call released"
);
L_GET_PRIVATE
(
session
)
->
setState
(
Linphone
Private
::
CallSession
::
State
::
Released
,
"Call released"
);
}
static
void
call_cancel_done
(
SalOp
*
op
)
{
...
...
@@ -506,23 +506,21 @@ static void notify_refer(SalOp *op, SalReferStatus status) {
ms_warning
(
"Receiving notify_refer for unknown CallSession"
);
return
;
}
Linphone
Call
State
cstate
;
Linphone
Private
::
CallSession
::
State
cstate
;
switch
(
status
)
{
case
SalReferTrying
:
cstate
=
Linphone
Call
OutgoingProgress
;
cstate
=
Linphone
Private
::
CallSession
::
State
::
OutgoingProgress
;
break
;
case
SalReferSuccess
:
cstate
=
Linphone
Call
Connected
;
cstate
=
Linphone
Private
::
CallSession
::
State
::
Connected
;
break
;
case
SalReferFailed
:
cstate
=
LinphoneCallError
;
break
;
default:
cstate
=
Linphone
Call
Error
;
cstate
=
Linphone
Private
::
CallSession
::
State
::
Error
;
break
;
}
L_GET_PRIVATE
(
session
)
->
setTransferState
(
cstate
);
if
(
cstate
==
Linphone
Call
Connected
)
if
(
cstate
==
Linphone
Private
::
CallSession
::
State
::
Connected
)
session
->
terminate
();
// Automatically terminate the call as the transfer is complete
}
...
...
coreapi/linphonecall.c
View file @
4cc7985d
...
...
@@ -27,35 +27,6 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#include "private.h"
bool_t
linphone_call_state_is_early
(
LinphoneCallState
state
){
switch
(
state
){
case
LinphoneCallIdle
:
case
LinphoneCallOutgoingInit
:
case
LinphoneCallOutgoingEarlyMedia
:
case
LinphoneCallOutgoingRinging
:
case
LinphoneCallOutgoingProgress
:
case
LinphoneCallIncomingReceived
:
case
LinphoneCallIncomingEarlyMedia
:
case
LinphoneCallEarlyUpdatedByRemote
:
case
LinphoneCallEarlyUpdating
:
return
TRUE
;
case
LinphoneCallResuming
:
case
LinphoneCallEnd
:
case
LinphoneCallUpdating
:
case
LinphoneCallRefered
:
case
LinphoneCallPausing
:
case
LinphoneCallPausedByRemote
:
case
LinphoneCallPaused
:
case
LinphoneCallConnected
:
case
LinphoneCallError
:
case
LinphoneCallUpdatedByRemote
:
case
LinphoneCallReleased
:
case
LinphoneCallStreamsRunning
:
break
;
}
return
FALSE
;
}
const
char
*
linphone_call_state_to_string
(
LinphoneCallState
cs
){
switch
(
cs
){
case
LinphoneCallIdle
:
...
...
coreapi/private_functions.h
View file @
4cc7985d
...
...
@@ -526,8 +526,6 @@ int linphone_core_get_default_proxy_config_index(LinphoneCore *lc);
char
*
linphone_presence_model_to_xml
(
LinphonePresenceModel
*
model
)
;
bool_t
linphone_call_state_is_early
(
LinphoneCallState
state
);
void
linphone_core_report_call_log
(
LinphoneCore
*
lc
,
LinphoneCallLog
*
call_log
);
void
linphone_core_report_early_failed_call
(
LinphoneCore
*
lc
,
LinphoneCallDir
dir
,
LinphoneAddress
*
from
,
LinphoneAddress
*
to
,
LinphoneErrorInfo
*
ei
);
...
...
include/CMakeLists.txt
View file @
4cc7985d
...
...
@@ -91,6 +91,7 @@ set(C_API_HEADER_FILES
)
set
(
ENUMS_HEADER_FILES
call-enums.h
chat-message-enums.h
chat-room-enums.h
event-log-enums.h
...
...
include/linphone/api/c-types.h
View file @
4cc7985d
...
...
@@ -23,6 +23,7 @@
// TODO: Remove me in the future.
#include "linphone/types.h"
#include "linphone/enums/call-enums.h"
#include "linphone/enums/chat-message-enums.h"
#include "linphone/enums/chat-room-enums.h"
#include "linphone/enums/event-log-enums.h"
...
...
@@ -159,6 +160,17 @@ typedef struct _LinphoneParticipant LinphoneParticipant;
// C Enums.
// =============================================================================
// -----------------------------------------------------------------------------
// Call.
// -----------------------------------------------------------------------------
/**
* LinphoneCallState enum represents the different state a call can reach into.
* The application is notified of state changes through the LinphoneCoreVTable::call_state_changed callback.
* @ingroup call_control
**/
L_DECLARE_C_ENUM
(
CallState
,
L_ENUM_VALUES_CALL_SESSION_STATE
);
// -----------------------------------------------------------------------------
// ChatRoom.
// -----------------------------------------------------------------------------
...
...
include/linphone/enums/call-enums.h
0 → 100644
View file @
4cc7985d
/*
* call-enums.h
* Copyright (C) 2010-2017 Belledonne Communications SARL
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation; either version 2
* of the License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
#ifndef _CALL_ENUMS_H_
#define _CALL_ENUMS_H_
// =============================================================================
#define L_ENUM_VALUES_CALL_SESSION_STATE(F) \
F(Idle) \
F(IncomingReceived) \
F(OutgoingInit) \
F(OutgoingProgress) \
F(OutgoingRinging) \
F(OutgoingEarlyMedia) \
F(Connected) \
F(StreamsRunning) \
F(Pausing) \
F(Paused) \
F(Resuming) \
F(Referred) \
F(Error) \
F(End) \
F(PausedByRemote) \
F(UpdatedByRemote) \
F(IncomingEarlyMedia) \
F(Updating) \
F(Released) \
F(EarlyUpdatedByRemote) \
F(EarlyUpdating)
// =============================================================================
// DEPRECATED
// =============================================================================
#define LinphoneCallIdle LinphoneCallStateIdle
#define LinphoneCallIncomingReceived LinphoneCallStateIncomingReceived
#define LinphoneCallOutgoingInit LinphoneCallStateOutgoingInit
#define LinphoneCallOutgoingProgress LinphoneCallStateOutgoingProgress
#define LinphoneCallOutgoingRinging LinphoneCallStateOutgoingRinging
#define LinphoneCallOutgoingEarlyMedia LinphoneCallStateOutgoingEarlyMedia
#define LinphoneCallConnected LinphoneCallStateConnected
#define LinphoneCallStreamsRunning LinphoneCallStateStreamsRunning
#define LinphoneCallPausing LinphoneCallStatePausing
#define LinphoneCallPaused LinphoneCallStatePaused
#define LinphoneCallResuming LinphoneCallStateResuming
#define LinphoneCallRefered LinphoneCallStateReferred
#define LinphoneCallError LinphoneCallStateError
#define LinphoneCallEnd LinphoneCallStateEnd
#define LinphoneCallPausedByRemote LinphoneCallStatePausedByRemote
#define LinphoneCallUpdatedByRemote LinphoneCallStateUpdatedByRemote
#define LinphoneCallIncomingEarlyMedia LinphoneCallStateIncomingEarlyMedia
#define LinphoneCallUpdating LinphoneCallStateUpdating
#define LinphoneCallReleased LinphoneCallStateReleased
#define LinphoneCallEarlyUpdatedByRemote LinphoneCallStateEarlyUpdatedByRemote
#define LinphoneCallEarlyUpdating LinphoneCallStateEarlyUpdating
#endif // ifndef _CALL_ENUMS_H_
include/linphone/types.h
View file @
4cc7985d
...
...
@@ -264,35 +264,6 @@ typedef struct _LinphoneCallLog LinphoneCallLog;
**/
typedef
struct
_LinphoneCallParams
LinphoneCallParams
;
/**
* LinphoneCallState enum represents the different state a call can reach into.
* The application is notified of state changes through the LinphoneCoreVTable::call_state_changed callback.
* @ingroup call_control
**/
typedef
enum
_LinphoneCallState
{
LinphoneCallIdle
,
/**< Initial call state */
LinphoneCallIncomingReceived
,
/**< This is a new incoming call */
LinphoneCallOutgoingInit
,
/**< An outgoing call is started */
LinphoneCallOutgoingProgress
,
/**< An outgoing call is in progress */
LinphoneCallOutgoingRinging
,
/**< An outgoing call is ringing at remote end */
LinphoneCallOutgoingEarlyMedia
,
/**< An outgoing call is proposed early media */
LinphoneCallConnected
,
/**< Connected, the call is answered */
LinphoneCallStreamsRunning
,
/**< The media streams are established and running */
LinphoneCallPausing
,
/**< The call is pausing at the initiative of local end */
LinphoneCallPaused
,
/**< The call is paused, remote end has accepted the pause */
LinphoneCallResuming
,
/**< The call is being resumed by local end */
LinphoneCallRefered
,
/**< The call is being transfered to another party, resulting in a new outgoing call to follow immediately */
LinphoneCallError
,
/**< The call encountered an error */
LinphoneCallEnd
,
/**< The call ended normally */
LinphoneCallPausedByRemote
,
/**< The call is paused by remote end */
LinphoneCallUpdatedByRemote
,
/**< The call's parameters change is requested by remote end, used for example when video is added by remote */
LinphoneCallIncomingEarlyMedia
,
/**< We are proposing early media to an incoming call */
LinphoneCallUpdating
,
/**< A call update has been initiated by us */
LinphoneCallReleased
,
/**< The call object is no more retained by the core */
LinphoneCallEarlyUpdatedByRemote
,
/**< The call is updated by remote while not yet answered (early dialog SIP UPDATE received) */
LinphoneCallEarlyUpdating
/**< We are updating the call while not yet answered (early dialog SIP UPDATE sent) */
}
LinphoneCallState
;
/**
* The LinphoneCallStats objects carries various statistic informations regarding quality of audio or video streams.
*
...
...
include/linphone/utils/magic-macros.h
View file @
4cc7985d
...
...
@@ -34,14 +34,14 @@ LINPHONE_BEGIN_NAMESPACE
// Get argument numbers from variadic.
#define L_ARG_N( \
A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, \
A11, A12, A13, A14, A15, A16, N, ... \
A11, A12, A13, A14, A15, A16,
A17, A18, A19, A20, A21,
N, ... \
) N
#define L_EXPAND(X) X
#define L_GET_N_ARGS(...) L_EXPAND(L_ARG_N( \
__VA_ARGS__, \
16, 15, 14, 13, 12, 11, 10, \
21, 20, 19, 18, 17,
16, 15, 14, 13, 12, 11, 10, \
9, 8, 7, 6, 5, 4, 3, 2, 1, 0 \
))
...
...
@@ -65,6 +65,11 @@ LINPHONE_BEGIN_NAMESPACE
#define L_GET_ARG_14(A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, ...) A14
#define L_GET_ARG_15(A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, ...) A15
#define L_GET_ARG_16(A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, ...) A16
#define L_GET_ARG_17(A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, ...) A17
#define L_GET_ARG_18(A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18, ...) A18
#define L_GET_ARG_19(A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18, A19, ...) A19
#define L_GET_ARG_20(A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18, A19, A20, ...) A20
#define L_GET_ARG_21(A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18, A19, A20, A21, ...) A21
// Get left part of variadic.
#define L_GET_HEAP_1(A1, ...) A1
...
...
@@ -83,6 +88,11 @@ LINPHONE_BEGIN_NAMESPACE
#define L_GET_HEAP_14(A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, ...) A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14
#define L_GET_HEAP_15(A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, ...) A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15
#define L_GET_HEAP_16(A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, ...) A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16
#define L_GET_HEAP_17(A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, ...) A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17
#define L_GET_HEAP_18(A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18, ...) A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18
#define L_GET_HEAP_19(A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18, A19, ...) A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18, A19
#define L_GET_HEAP_20(A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18, A19, A20, ...) A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18, A19, A20
#define L_GET_HEAP_21(A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18, A19, A20, A21, ...) A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18, A19, A20, A21
#define L_GET_HEAP(...) L_EXPAND( \
L_CONCAT(L_GET_HEAP_, L_GET_N_ARGS_SUB(__VA_ARGS__)) (__VA_ARGS__) \
...
...
@@ -156,6 +166,26 @@ LINPHONE_BEGIN_NAMESPACE
L_CALL_HELPER(MACRONAME, (DATA, A1)), \
L_APPLY_15(MACRONAME, DATA, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16)
#define L_APPLY_17(MACRONAME, DATA, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17) \
L_CALL_HELPER(MACRONAME, (DATA, A1)), \
L_APPLY_16(MACRONAME, DATA, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17)
#define L_APPLY_18(MACRONAME, DATA, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18) \
L_CALL_HELPER(MACRONAME, (DATA, A1)), \
L_APPLY_17(MACRONAME, DATA, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18)
#define L_APPLY_19(MACRONAME, DATA, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18, A19) \
L_CALL_HELPER(MACRONAME, (DATA, A1)), \
L_APPLY_18(MACRONAME, DATA, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18, A19)
#define L_APPLY_20(MACRONAME, DATA, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18, A19, A20) \
L_CALL_HELPER(MACRONAME, (DATA, A1)), \
L_APPLY_19(MACRONAME, DATA, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18, A19, A20)
#define L_APPLY_21(MACRONAME, DATA, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18, A19, A20, A21) \
L_CALL_HELPER(MACRONAME, (DATA, A1)), \
L_APPLY_20(MACRONAME, DATA, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18, A19, A20, A21)
#define L_APPLY(MACRONAME, DATA, ...) \
L_CALL( \
L_CONCAT(L_APPLY_, L_GET_N_ARGS(__VA_ARGS__)), \
...
...
@@ -226,6 +256,26 @@ LINPHONE_BEGIN_NAMESPACE
L_CALL_HELPER(MACRONAME, (DATA, A1)) \
L_APPLY_WITHOUT_COMMA_15(MACRONAME, DATA, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16)
#define L_APPLY_WITHOUT_COMMA_17(MACRONAME, DATA, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17) \
L_CALL_HELPER(MACRONAME, (DATA, A1)) \
L_APPLY_WITHOUT_COMMA_16(MACRONAME, DATA, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17)
#define L_APPLY_WITHOUT_COMMA_18(MACRONAME, DATA, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18) \
L_CALL_HELPER(MACRONAME, (DATA, A1)) \
L_APPLY_WITHOUT_COMMA_17(MACRONAME, DATA, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18)
#define L_APPLY_WITHOUT_COMMA_19(MACRONAME, DATA, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18, A19) \
L_CALL_HELPER(MACRONAME, (DATA, A1)) \
L_APPLY_WITHOUT_COMMA_18(MACRONAME, DATA, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18, A19)
#define L_APPLY_WITHOUT_COMMA_20(MACRONAME, DATA, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18, A19, A20) \
L_CALL_HELPER(MACRONAME, (DATA, A1)) \
L_APPLY_WITHOUT_COMMA_19(MACRONAME, DATA, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18, A19, A20)
#define L_APPLY_WITHOUT_COMMA_21(MACRONAME, DATA, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18, A19, A20, A21) \
L_CALL_HELPER(MACRONAME, (DATA, A1)) \
L_APPLY_WITHOUT_COMMA_20(MACRONAME, DATA, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11, A12, A13, A14, A15, A16, A17, A18, A19, A20, A21)
#define L_APPLY_WITHOUT_COMMA(MACRONAME, DATA, ...) \
L_CALL( \
L_CONCAT(L_APPLY_WITHOUT_COMMA_, L_GET_N_ARGS(__VA_ARGS__)), \
...
...
src/c-wrapper/api/c-call.cpp
View file @
4cc7985d
...
...
@@ -215,7 +215,7 @@ LinphoneCore *linphone_call_get_core (const LinphoneCall *call) {
}
LinphoneCallState
linphone_call_get_state
(
const
LinphoneCall
*
call
)
{
return
L_GET_CPP_PTR_FROM_C_OBJECT
(
call
)
->
getState
();
return
static_cast
<
LinphoneCallState
>
(
L_GET_CPP_PTR_FROM_C_OBJECT
(
call
)
->
getState
()
)
;
}
bool_t
linphone_call_asked_to_autoanswer
(
LinphoneCall
*
call
)
{
...
...
@@ -388,7 +388,7 @@ void linphone_call_set_next_video_frame_decoded_callback (LinphoneCall *call, Li
}
LinphoneCallState
linphone_call_get_transfer_state
(
LinphoneCall
*
call
)
{
return
L_GET_CPP_PTR_FROM_C_OBJECT
(
call
)
->
getTransferState
();
return
static_cast
<
LinphoneCallState
>
(
L_GET_CPP_PTR_FROM_C_OBJECT
(
call
)
->
getTransferState
()
)
;
}
void
linphone_call_zoom_video
(
LinphoneCall
*
call
,
float
zoom_factor
,
float
*
cx
,
float
*
cy
)
{
...
...
src/call/call-p.h
View file @
4cc7985d
...
...
@@ -82,8 +82,8 @@ private:
void
onCallSessionSetReleased
(
const
std
::
shared_ptr
<
const
CallSession
>
&
session
)
override
;
void
onCallSessionSetTerminated
(
const
std
::
shared_ptr
<
const
CallSession
>
&
session
)
override
;
void
onCallSessionStartReferred
(
const
std
::
shared_ptr
<
const
CallSession
>
&
session
)
override
;
void
onCallSessionStateChanged
(
const
std
::
shared_ptr
<
const
CallSession
>
&
session
,
LinphoneCall
State
state
,
const
std
::
string
&
message
)
override
;
void
onCallSessionTransferStateChanged
(
const
std
::
shared_ptr
<
const
CallSession
>
&
session
,
LinphoneCall
State
state
)
override
;
void
onCallSessionStateChanged
(
const
std
::
shared_ptr
<
const
CallSession
>
&
session
,
CallSession
::
State
state
,
const
std
::
string
&
message
)
override
;
void
onCallSessionTransferStateChanged
(
const
std
::
shared_ptr
<
const
CallSession
>
&
session
,
CallSession
::
State
state
)
override
;
void
onCheckForAcceptation
(
const
std
::
shared_ptr
<
const
CallSession
>
&
session
)
override
;
void
onDtmfReceived
(
const
std
::
shared_ptr
<
const
CallSession
>
&
session
,
char
dtmf
)
override
;
void
onIncomingCallSessionNotified
(
const
std
::
shared_ptr
<
const
CallSession
>
&
session
)
override
;
...
...
src/call/call.cpp
View file @
4cc7985d
...
...
@@ -89,7 +89,7 @@ int CallPrivate::startInvite (const Address *destination) {
shared_ptr
<
Call
>
CallPrivate
::
startReferredCall
(
const
MediaSessionParams
*
params
)
{
L_Q
();
if
(
q
->
getState
()
!=
LinphoneCall
Paused
)
{
if
(
q
->
getState
()
!=
CallSession
::
State
::
Paused
)
{
pauseForTransfer
();
}
MediaSessionParams
msp
;
...
...
@@ -266,14 +266,14 @@ void CallPrivate::onCallSessionStartReferred (const shared_ptr<const CallSession
startReferredCall
(
nullptr
);
}
void
CallPrivate
::
onCallSessionStateChanged
(
const
shared_ptr
<
const
CallSession
>
&
session
,
LinphoneCall
State
state
,
const
string
&
message
)
{
void
CallPrivate
::
onCallSessionStateChanged
(
const
shared_ptr
<
const
CallSession
>
&
session
,
CallSession
::
State
state
,
const
string
&
message
)
{
L_Q
();
linphone_call_notify_state_changed
(
L_GET_C_BACK_PTR
(
q
),
stat
e
,
message
.
c_str
());
linphone_call_notify_state_changed
(
L_GET_C_BACK_PTR
(
q
),
stat
ic_cast
<
LinphoneCallState
>
(
state
)
,
message
.
c_str
());
}
void
CallPrivate
::
onCallSessionTransferStateChanged
(
const
shared_ptr
<
const
CallSession
>
&
session
,
LinphoneCall
State
state
)
{
void
CallPrivate
::
onCallSessionTransferStateChanged
(
const
shared_ptr
<
const
CallSession
>
&
session
,
CallSession
::
State
state
)
{
L_Q
();
linphone_call_notify_transfer_state_changed
(
L_GET_C_BACK_PTR
(
q
),
stat
e
);
linphone_call_notify_transfer_state_changed
(
L_GET_C_BACK_PTR
(
q
),
stat
ic_cast
<
LinphoneCallState
>
(
state
)
);
}
void
CallPrivate
::
onCheckForAcceptation
(
const
shared_ptr
<
const
CallSession
>
&
session
)
{
...
...
@@ -283,11 +283,11 @@ void CallPrivate::onCheckForAcceptation (const shared_ptr<const CallSession> &se
for
(
bctbx_list_t
*
it
=
copy
;
it
!=
nullptr
;
it
=
bctbx_list_next
(
it
))
{
LinphoneCall
*
call
=
reinterpret_cast
<
LinphoneCall
*>
(
bctbx_list_get_data
(
it
));
if
(
call
==
lcall
)
continue
;
switch
(
linphone_
call
_
get
_s
tate
(
call
))
{
case
LinphoneCall
OutgoingInit
:
case
LinphoneCall
OutgoingProgress
:
case
LinphoneCall
OutgoingRinging
:
case
LinphoneCall
OutgoingEarlyMedia
:
switch
(
L_GET_CPP_PTR_FROM_C_OBJECT
(
call
)
->
get
S
tate
())
{
case
CallSession
::
State
::
OutgoingInit
:
case
CallSession
::
State
::
OutgoingProgress
:
case
CallSession
::
State
::
OutgoingRinging
:
case
CallSession
::
State
::
OutgoingEarlyMedia
:
lInfo
()
<<
"Already existing call ["
<<
call
<<
"] in state ["
<<
linphone_call_state_to_string
(
linphone_call_get_state
(
call
))
<<
"], canceling it before accepting new call ["
<<
lcall
<<
"]"
;
linphone_call_terminate
(
call
);
...
...
@@ -337,7 +337,7 @@ void CallPrivate::onNoMediaTimeoutCheck (const shared_ptr<const CallSession> &se
int
disconnectTimeout
=
linphone_core_get_nortp_timeout
(
q
->
getCore
()
->
getCCore
());
bool
disconnected
=
false
;
AudioStream
*
as
=
reinterpret_cast
<
AudioStream
*>
(
getMediaStream
(
LinphoneStreamTypeAudio
));
if
(((
q
->
getState
()
==
LinphoneCall
StreamsRunning
)
||
(
q
->
getState
()
==
LinphoneCall
PausedByRemote
))
if
(((
q
->
getState
()
==
CallSession
::
State
::
StreamsRunning
)
||
(
q
->
getState
()
==
CallSession
::
State
::
PausedByRemote
))
&&
oneSecondElapsed
&&
as
&&
(
as
->
ms
.
state
==
MSStreamStarted
)
&&
(
disconnectTimeout
>
0
))
disconnected
=
!
audio_stream_alive
(
as
,
disconnectTimeout
);
if
(
disconnected
)
...
...
@@ -418,8 +418,8 @@ void CallPrivate::onStopRingingIfNeeded (const shared_ptr<const CallSession> &se
bool
stopRinging
=
true
;
bool
ringDuringEarlyMedia
=
linphone_core_get_ring_during_incoming_early_media
(
lc
);
for
(
const
auto
&
call
:
q
->
getCore
()
->
getCalls
())
{
if
((
call
->
getState
()
==
LinphoneCall
IncomingReceived
)
||
(
ringDuringEarlyMedia
&&
call
->
getState
()
==
LinphoneCall
IncomingEarlyMedia
))
{
if
((
call
->
getState
()
==
CallSession
::
State
::
IncomingReceived
)
||
(
ringDuringEarlyMedia
&&
call
->
getState
()
==
CallSession
::
State
::
IncomingEarlyMedia
))
{
stopRinging
=
false
;
break
;
}
...
...
@@ -771,7 +771,7 @@ float Call::getSpeakerVolumeGain () const {
return
static_pointer_cast
<
const
MediaSession
>
(
d
->
getActiveSession
())
->
getSpeakerVolumeGain
();
}
LinphoneCall
State
Call
::
getState
()
const
{
CallSession
::
State
Call
::
getState
()
const
{
L_D
();
return
d
->
getActiveSession
()
->
getState
();
}
...
...
@@ -806,7 +806,7 @@ string Call::getToHeader (const std::string &name) const {
return
d
->
getActiveSession
()
->
getToHeader
(
name
);
}
LinphoneCall
State
Call
::
getTransferState
()
const
{
CallSession
::
State
Call
::
getTransferState
()
const
{
L_D
();
return
d
->
getActiveSession
()
->
getTransferState
();
}
...
...
src/call/call.h
View file @
4cc7985d
...
...
@@ -21,6 +21,7 @@
#define _CALL_CALL_H_
#include "conference/params/media-session-params.h"
#include "conference/session/call-session.h"
#include "core/core-accessor.h"
#include "object/object.h"
...
...
@@ -103,14 +104,14 @@ public:
std
::
string
getRemoteUserAgent
()
const
;
std
::
shared_ptr
<
Call
>
getReplacedCall
()
const
;
float
getSpeakerVolumeGain
()
const
;
LinphoneCall
State
getState
()
const
;
CallSession
::
State
getState
()
const
;
LinphoneCallStats
*
getStats
(
LinphoneStreamType
type
)
const
;
int
getStreamCount
()
const
;
MSFormatType
getStreamType
(
int
streamIndex
)
const
;
LinphoneCallStats
*
getTextStats
()
const
;
const
Address
&
getToAddress
()
const
;
std
::
string
getToHeader
(
const
std
::
string
&
name
)
const
;
LinphoneCall
State
getTransferState
()
const
;
CallSession
::
State
getTransferState
()
const
;
std
::
shared_ptr
<
Call
>
getTransferTarget
()
const
;
LinphoneCallStats
*
getVideoStats
()
const
;
bool
isInConference
()
const
;
...
...
src/chat/chat-message/chat-message.cpp
View file @
4cc7985d
...
...
@@ -22,11 +22,11 @@
#include "linphone/core.h"
#include "linphone/lpconfig.h"
#include "linphone/utils/utils.h"
#include "c-wrapper/c-wrapper.h"
#include "address/address.h"
#include "address/address.h"
#include "c-wrapper/c-wrapper.h"
#include "call/call.h"
#include "chat/chat-message/chat-message-p.h"
#include "chat/chat-room/chat-room-p.h"
#include "chat/chat-room/client-group-to-basic-chat-room.h"
#include "chat/chat-room/real-time-text-chat-room.h"
...
...
@@ -482,7 +482,7 @@ LinphoneReason ChatMessagePrivate::receive () {
void
ChatMessagePrivate
::
send
()
{
L_Q
();
SalOp
*
op
=
salOp
;
LinphoneCall
*
call
=
nullptr
;
LinphoneCall
*
l
call
=
nullptr
;
int
errorCode
=
0
;
if
((
currentSendStep
&
ChatMessagePrivate
::
Step
::
FileUpload
)
==
ChatMessagePrivate
::
Step
::
FileUpload
)
{
...
...
@@ -501,14 +501,18 @@ void ChatMessagePrivate::send () {
shared_ptr
<
Core
>
core
=
q
->
getCore
();
if
(
lp_config_get_int
(
core
->
getCCore
()
->
config
,
"sip"
,
"chat_use_call_dialogs"
,
0
)
!=
0
)
{
call
=
linphone_core_get_call_by_remote_address
(
core
->
getCCore
(),
q
->
getToAddress
().
asString
().
c_str
());
if
(
call
)
{
if
(
linphone_call_get_state
(
call
)
==
LinphoneCallConnected
||
linphone_call_get_state
(
call
)
==
LinphoneCallStreamsRunning
||
linphone_call_get_state
(
call
)
==
LinphoneCallPaused
||
linphone_call_get_state
(
call
)
==
LinphoneCallPausing
||
linphone_call_get_state
(
call
)
==
LinphoneCallPausedByRemote
)
{
lcall
=
linphone_core_get_call_by_remote_address
(
core
->
getCCore
(),
q
->
getToAddress
().
asString
().
c_str
());
if
(
lcall
)
{
shared_ptr
<
Call
>
call
=
L_GET_CPP_PTR_FROM_C_OBJECT
(
lcall
);
if
((
call
->
getState
()
==
CallSession
::
State
::
Connected
)
||
(
call
->
getState
()
==
CallSession
::
State
::
StreamsRunning
)
||
(
call
->
getState
()
==
CallSession
::
State
::
Paused
)
||
(
call
->
getState
()
==
CallSession
::
State
::
Pausing
)
||
(
call
->
getState
()
==
CallSession
::
State
::
PausedByRemote
)
)
{
lInfo
()
<<
"send SIP msg through the existing call."
;
op
=
linphone_call_get_op
(
call
);
string
identity
=
linphone_core_find_best_identity
(
core
->
getCCore
(),
linphone_call_get_remote_address
(
call
));
op
=
linphone_call_get_op
(
l
call
);
string
identity
=
linphone_core_find_best_identity
(
core
->
getCCore
(),
linphone_call_get_remote_address
(
l
call
));
if
(
identity
.
empty
())
{
LinphoneAddress
*
addr
=
linphone_address_new
(
q
->
getToAddress
().
asString
().
c_str
());
LinphoneProxyConfig
*
proxy
=
linphone_core_lookup_known_proxy
(
core
->
getCCore
(),
addr
);
...
...
@@ -617,7 +621,7 @@ void ChatMessagePrivate::send () {
//store(); // Store will be done right below in the setState(InProgress)
if
(
call
&&
linphone_call_get_op
(
call
)
==
op
)
{
if
(
l
call
&&
linphone_call_get_op
(
l
call
)
==
op
)
{
/* In this case, chat delivery status is not notified, so unrefing chat message right now */
/* Might be better fixed by delivering status, but too costly for now */
return
;
...
...
src/chat/chat-room/basic-to-client-group-chat-room.cpp
View file @
4cc7985d
...
...
@@ -72,12 +72,12 @@ public:
void
onCallSessionStateChanged
(
const
shared_ptr
<
const
CallSession
>
&
session
,
LinphoneCall
State
newState
,
CallSession
::
State
newState
,
const
string
&
message
)
override
{
if
(
!
clientGroupChatRoom
)
return
;
if
((
newState
==
LinphoneCall
Error
)
&&
(
clientGroupChatRoom
->
getState
()
==
ChatRoom
::
State
::
CreationPending
))
{
if
((
newState
==
CallSession
::
State
::
Error
)
&&
(
clientGroupChatRoom
->
getState
()
==
ChatRoom
::
State
::
CreationPending
))
{
Core
::
deleteChatRoom
(
clientGroupChatRoom
);
if
(
session
->
getReason
()
==
LinphoneReasonNotAcceptable
)
{
clientGroupChatRoom
=
nullptr
;
...
...
src/chat/chat-room/client-group-chat-room-p.h
View file @
4cc7985d
...
...
@@ -45,7 +45,7 @@ public:
// CallSessionListener
void
onCallSessionSetReleased
(
const
std
::
shared_ptr
<
const
CallSession
>
&
session
)
override
;
void
onCallSessionStateChanged
(
const
std
::
shared_ptr
<
const
CallSession
>
&
session
,
LinphoneCall
State
state
,
const
std
::
string
&
message
)
override
;
void
onCallSessionStateChanged
(
const
std
::
shared_ptr
<
const
CallSession
>
&
session
,
CallSession
::
State
state
,
const
std
::
string
&
message
)
override
;
private:
CallSessionListener
*
callSessionListener
=
this
;
...
...
src/chat/chat-room/client-group-chat-room.cpp
View file @
4cc7985d
...
...
@@ -123,13 +123,13 @@ void ClientGroupChatRoomPrivate::onCallSessionSetReleased (const shared_ptr<cons
void
ClientGroupChatRoomPrivate
::
onCallSessionStateChanged
(
const
shared_ptr
<
const
CallSession
>
&
session
,
LinphoneCall
State
newState
,
CallSession
::
State
newState
,
const
string
&
message
)
{
L_Q
();
L_Q_T
(
RemoteConference
,
qConference
);
if
(
newState
==
LinphoneCall
Connected
)
{
if
(
newState
==
CallSession
::
State
::
Connected
)
{
if
(
q
->
getState
()
==
ChatRoom
::
State
::
CreationPending
)
{
IdentityAddress
addr
(
session
->
getRemoteContactAddress
()
->
asStringUriOnly
());
q
->
onConferenceCreated
(
addr
);
...
...
@@ -137,9 +137,9 @@ void ClientGroupChatRoomPrivate::onCallSessionStateChanged (
qConference
->
getPrivate
()
->
eventHandler
->
subscribe
(
q
->
getChatRoomId
());
}
else
if
(
q
->
getState
()
==
ChatRoom
::
State
::
TerminationPending
)
qConference
->
getPrivate
()
->
focus
->
getPrivate
()
->
getSession
()
->
terminate
();
}
else
if
((
newState
==
LinphoneCall
Released
)
&&
(
q
->
getState
()
==
ChatRoom
::
State
::
TerminationPending
))
{
}
else
if
((
newState
==
CallSession
::
State
::
Released
)
&&
(
q
->
getState
()
==
ChatRoom
::
State
::
TerminationPending
))
{
q
->
onConferenceTerminated
(
q
->
getConferenceAddress
());
}
else
if
((
newState
==
LinphoneCall
Error
)
&&
(
q
->
getState
()
==
ChatRoom
::
State
::
CreationPending
))
{
}
else
if
((
newState
==
CallSession
::
State
::
Error
)
&&
(
q
->
getState
()
==
ChatRoom
::
State
::
CreationPending
))
{
setState
(
ChatRoom
::
State
::
CreationFailed
);
}
}
...
...
src/chat/chat-room/client-group-to-basic-chat-room.cpp
View file @
4cc7985d
...
...
@@ -54,14 +54,14 @@ public:
void
onCallSessionStateChanged
(
const
shared_ptr
<
const
CallSession
>
&
session
,
LinphoneCall
State
newState
,
CallSession
::
State
newState
,
const
string
&
message
)
override
{
L_Q
();
shared_ptr
<
ClientGroupChatRoom
>
cgcr
=
dynamic_pointer_cast
<
ClientGroupChatRoom
>
(
chatRoom
);
if
(
!
cgcr
)
return
;
if
((
newState
==
LinphoneCall
Error
)
&&
(
cgcr
->
getState
()
==
ChatRoom
::
State
::
CreationPending
)
if
((
newState
==
CallSession
::
State
::
Error
)
&&
(
cgcr
->
getState
()
==
ChatRoom
::
State
::
CreationPending
)
&&
(
session
->
getReason
()
==
LinphoneReasonNotAcceptable
)
&&
(
invitedAddresses
.
size
()
==
1
))
{
cgcr
->
getPrivate
()
->
onCallSessionStateChanged
(
session
,
newState
,
message
);