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
5737db39
Commit
5737db39
authored
Feb 19, 2013
by
jehan
Browse files
implement attended transfert
parent
85c3a634
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
33 additions
and
11 deletions
+33
-11
coreapi/bellesip_sal/sal_op_call.c
coreapi/bellesip_sal/sal_op_call.c
+2
-2
coreapi/bellesip_sal/sal_op_call_transfer.c
coreapi/bellesip_sal/sal_op_call_transfer.c
+13
-6
tester/call_tester.c
tester/call_tester.c
+18
-3
No files found.
coreapi/bellesip_sal/sal_op_call.c
View file @
5737db39
...
...
@@ -198,8 +198,8 @@ static void call_response_event(void *op_base, const belle_sip_response_event_t
op
->
sdp_answer
=
NULL
;
}
belle_sip_dialog_send_ack
(
op
->
dialog
,
ack
);
/*if (op->state != SalOpStateActive)
*/
op
->
base
.
root
->
callbacks
.
call_accepted
(
op
);
op
->
base
.
root
->
callbacks
.
call_accepted
(
op
);
/*INVITE
*/
op
->
state
=
SalOpStateActive
;
}
else
{
/*nop*/
...
...
coreapi/bellesip_sal/sal_op_call_transfer.c
View file @
5737db39
...
...
@@ -58,19 +58,26 @@ int sal_call_refer(SalOp *op, const char *refer_to){
}
int
sal_call_refer_with_replaces
(
SalOp
*
op
,
SalOp
*
other_call_op
){
belle_sip_dialog_state_t
other_call_dialod_state
=
other_call_op
->
dialog
?
belle_sip_dialog_get_state
(
other_call_op
->
dialog
)
:
BELLE_SIP_DIALOG_NULL
;
belle_sip_dialog_state_t
other_call_dialog_state
=
other_call_op
->
dialog
?
belle_sip_dialog_get_state
(
other_call_op
->
dialog
)
:
BELLE_SIP_DIALOG_NULL
;
belle_sip_dialog_state_t
op_dialog_state
=
op
->
dialog
?
belle_sip_dialog_get_state
(
op
->
dialog
)
:
BELLE_SIP_DIALOG_NULL
;
belle_sip_header_refer_to_t
*
refer_to
;
belle_sip_header_referred_by_t
*
referred_by
;
/*first, build refer to*/
if
(
other_call_dialo
d
_state
!=
BELLE_SIP_DIALOG_CONFIRMED
)
{
ms_error
(
" wrong dialog state [%s] for op [%p], sould be BELLE_SIP_DIALOG_CONFIRMED"
,
belle_sip_dialog_state_to_string
(
other_call_dialo
d
_state
)
if
(
other_call_dialo
g
_state
!=
BELLE_SIP_DIALOG_CONFIRMED
)
{
ms_error
(
" wrong dialog state [%s] for op [%p], s
h
ould be BELLE_SIP_DIALOG_CONFIRMED"
,
belle_sip_dialog_state_to_string
(
other_call_dialo
g
_state
)
,
other_call_op
);
return
-
1
;
}
else
{
refer_to
=
belle_sip_header_refer_to_create
(
belle_sip_dialog_get_remote_party
(
other_call_op
->
dialog
));
referred_by
=
belle_sip_header_referred_by_create
(
belle_sip_dialog_get_local_party
(
op
->
dialog
));
}
if
(
op_dialog_state
!=
BELLE_SIP_DIALOG_CONFIRMED
)
{
ms_error
(
" wrong dialog state [%s] for op [%p], should be BELLE_SIP_DIALOG_CONFIRMED"
,
belle_sip_dialog_state_to_string
(
op_dialog_state
)
,
op
);
return
-
1
;
}
refer_to
=
belle_sip_header_refer_to_create
(
belle_sip_dialog_get_remote_party
(
other_call_op
->
dialog
));
referred_by
=
belle_sip_header_referred_by_create
(
belle_sip_dialog_get_local_party
(
op
->
dialog
));
return
sal_call_refer_to
(
op
,
refer_to
,
referred_by
);
}
int
sal_call_accept_refer
(
SalOp
*
h
){
...
...
tester/call_tester.c
View file @
5737db39
...
...
@@ -259,8 +259,9 @@ static void call_paused_resumed() {
call_obj
=
linphone_core_get_current_call
(
pauline
->
lc
);
linphone_core_pause_call
(
pauline
->
lc
,
call_obj
);
CU_ASSERT_TRUE
(
wait_for
(
pauline
->
lc
,
marie
->
lc
,
&
pauline
->
stat
.
number_of_LinphoneCallPaus
ed
,
1
));
CU_ASSERT_TRUE
(
wait_for
(
pauline
->
lc
,
marie
->
lc
,
&
pauline
->
stat
.
number_of_LinphoneCallPaus
ing
,
1
));
CU_ASSERT_TRUE
(
wait_for
(
pauline
->
lc
,
marie
->
lc
,
&
marie
->
stat
.
number_of_LinphoneCallPausedByRemote
,
1
));
CU_ASSERT_TRUE
(
wait_for
(
pauline
->
lc
,
marie
->
lc
,
&
pauline
->
stat
.
number_of_LinphoneCallPaused
,
1
));
linphone_core_resume_call
(
pauline
->
lc
,
call_obj
);
CU_ASSERT_TRUE
(
wait_for
(
pauline
->
lc
,
marie
->
lc
,
&
pauline
->
stat
.
number_of_LinphoneCallStreamsRunning
,
2
));
...
...
@@ -295,8 +296,9 @@ static void call_paused_resumed_from_callee() {
call_obj
=
linphone_core_get_current_call
(
marie
->
lc
);
linphone_core_pause_call
(
marie
->
lc
,
call_obj
);
CU_ASSERT_TRUE
(
wait_for
(
pauline
->
lc
,
marie
->
lc
,
&
marie
->
stat
.
number_of_LinphoneCallPaus
ed
,
1
));
CU_ASSERT_TRUE
(
wait_for
(
pauline
->
lc
,
marie
->
lc
,
&
marie
->
stat
.
number_of_LinphoneCallPaus
ing
,
1
));
CU_ASSERT_TRUE
(
wait_for
(
pauline
->
lc
,
marie
->
lc
,
&
pauline
->
stat
.
number_of_LinphoneCallPausedByRemote
,
1
));
CU_ASSERT_TRUE
(
wait_for
(
pauline
->
lc
,
marie
->
lc
,
&
marie
->
stat
.
number_of_LinphoneCallPaused
,
1
));
linphone_core_resume_call
(
marie
->
lc
,
call_obj
);
CU_ASSERT_TRUE
(
wait_for
(
pauline
->
lc
,
marie
->
lc
,
&
marie
->
stat
.
number_of_LinphoneCallStreamsRunning
,
2
));
...
...
@@ -508,6 +510,7 @@ static void call_transfer_existing_call_outgoing_call() {
LinphoneCoreManager
*
laure
=
linphone_core_manager_new
(
"./tester/laure_rc"
);
MSList
*
lcs
=
ms_list_append
(
NULL
,
marie
->
lc
);
const
MSList
*
calls
;
lcs
=
ms_list_append
(
lcs
,
pauline
->
lc
);
lcs
=
ms_list_append
(
lcs
,
laure
->
lc
);
...
...
@@ -538,13 +541,25 @@ static void call_transfer_existing_call_outgoing_call() {
linphone_core_transfer_call_to_another
(
marie
->
lc
,
marie_call_pauline
,
marie_call_laure
);
CU_ASSERT_TRUE
(
wait_for_list
(
lcs
,
&
pauline
->
stat
.
number_of_LinphoneCallRefered
,
1
,
2000
));
/*pauline pausing marie*/
CU_ASSERT_TRUE
(
wait_for_list
(
lcs
,
&
pauline
->
stat
.
number_of_LinphoneCallPausing
,
1
,
2000
));
CU_ASSERT_TRUE
(
wait_for_list
(
lcs
,
&
pauline
->
stat
.
number_of_LinphoneCallPaused
,
1
,
2000
));
/*pauline calling laure*/
CU_ASSERT_TRUE
(
wait_for_list
(
lcs
,
&
pauline
->
stat
.
number_of_LinphoneCallOutgoingProgress
,
1
,
2000
));
CU_ASSERT_TRUE
(
wait_for_list
(
lcs
,
&
marie
->
stat
.
number_of_LinphoneTransferCallOutgoingInit
,
1
,
2000
));
CU_ASSERT_TRUE
(
wait_for_list
(
lcs
,
&
laure
->
stat
.
number_of_LinphoneCallIncomingReceived
,
1
,
2000
));
CU_ASSERT_TRUE
(
wait_for_list
(
lcs
,
&
pauline
->
stat
.
number_of_LinphoneCallOutgoingRinging
,
1
,
2000
));
CU_ASSERT_TRUE
(
wait_for_list
(
lcs
,
&
marie
->
stat
.
number_of_LinphoneTransfertCallOutgoingProgress
,
1
,
2000
));
linphone_core_accept_call
(
laure
->
lc
,
linphone_core_get_current_call
(
laure
->
lc
));
/*laure accept call*/
for
(
calls
=
linphone_core_get_calls
(
laure
->
lc
);
calls
!=
NULL
;
calls
=
calls
->
next
)
{
LinphoneCall
*
call
=
(
LinphoneCall
*
)
calls
->
data
;
if
(
linphone_call_get_state
(
call
)
==
LinphoneCallIncomingReceived
)
{
CU_ASSERT_EQUAL
(
linphone_call_get_replaced_call
(
call
),
laure_called_by_marie
);
linphone_core_accept_call
(
laure
->
lc
,
call
);
break
;
}
}
CU_ASSERT_TRUE
(
wait_for_list
(
lcs
,
&
laure
->
stat
.
number_of_LinphoneCallConnected
,
1
,
2000
));
CU_ASSERT_TRUE
(
wait_for_list
(
lcs
,
&
laure
->
stat
.
number_of_LinphoneCallStreamsRunning
,
1
,
2000
));
CU_ASSERT_TRUE
(
wait_for_list
(
lcs
,
&
pauline
->
stat
.
number_of_LinphoneCallConnected
,
1
,
2000
));
...
...
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