Commit 837c3f7c authored by Simon Morlat's avatar Simon Morlat
Browse files

fix transfer test (requires sipstack upgrade too)

parent a08b50bd
......@@ -53,8 +53,16 @@ int sal_call_refer_to(SalOp *op, belle_sip_header_refer_to_t* refer_to, belle_si
}
int sal_call_refer(SalOp *op, const char *refer_to){
belle_sip_header_refer_to_t* refer_to_header=belle_sip_header_refer_to_create(belle_sip_header_address_parse(refer_to));
return sal_call_refer_to(op,refer_to_header,NULL);
belle_sip_header_address_t *referred_by;
belle_sip_header_refer_to_t* refer_to_header;
if (op->dialog) {
referred_by=(belle_sip_header_address_t*)belle_sip_object_clone(BELLE_SIP_OBJECT(belle_sip_dialog_get_local_party(op->dialog)));
}else{
referred_by=BELLE_SIP_HEADER_ADDRESS(sal_op_get_from_address(op));
}
refer_to_header=belle_sip_header_refer_to_create(belle_sip_header_address_parse(refer_to));
return sal_call_refer_to(op,refer_to_header,belle_sip_header_referred_by_create(referred_by));
}
int sal_call_refer_with_replaces(SalOp *op, SalOp *other_call_op){
......@@ -174,6 +182,7 @@ void sal_op_process_refer(SalOp *op, const belle_sip_request_event_t *event){
if (refer_to_uri && belle_sip_uri_get_header(refer_to_uri,"Replaces")) {
sal_op_set_replaces(op,belle_sip_header_replaces_create2(belle_sip_uri_get_header(refer_to_uri,"Replaces")));
belle_sip_uri_remove_header(refer_to_uri,"Replaces");
}
if (referred_by){
sal_op_set_referred_by(op,referred_by);
......
......@@ -70,11 +70,11 @@ void linphone_transfer_state_changed(LinphoneCore *lc, LinphoneCall *transfered,
counters = (stats*)linphone_core_get_user_data(lc);
switch (new_call_state) {
case LinphoneCallOutgoingInit :counters->number_of_LinphoneTransferCallOutgoingInit++;break;
case LinphoneCallOutgoingProgress :counters->number_of_LinphoneTransfertCallOutgoingProgress++;break;
case LinphoneCallOutgoingRinging :counters->number_of_LinphoneTransfertCallOutgoingRinging++;break;
case LinphoneCallOutgoingEarlyMedia :counters->number_of_LinphoneTransfertCallOutgoingEarlyMedia++;break;
case LinphoneCallConnected :counters->number_of_LinphoneTransfertCallConnected++;break;
case LinphoneCallStreamsRunning :counters->number_of_LinphoneTransfertCallStreamsRunning++;break;
case LinphoneCallOutgoingProgress :counters->number_of_LinphoneTransferCallOutgoingProgress++;break;
case LinphoneCallOutgoingRinging :counters->number_of_LinphoneTransferCallOutgoingRinging++;break;
case LinphoneCallOutgoingEarlyMedia :counters->number_of_LinphoneTransferCallOutgoingEarlyMedia++;break;
case LinphoneCallConnected :counters->number_of_LinphoneTransferCallConnected++;break;
case LinphoneCallStreamsRunning :counters->number_of_LinphoneTransferCallStreamsRunning++;break;
default:
CU_FAIL("unexpected event");break;
}
......@@ -798,13 +798,13 @@ static void simple_call_transfer(void) {
CU_ASSERT_TRUE(wait_for_list(lcs,&pauline->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,&marie->stat.number_of_LinphoneCallOutgoingRinging,1,2000));
CU_ASSERT_TRUE(wait_for_list(lcs,&pauline->stat.number_of_LinphoneTransfertCallOutgoingProgress,1,2000));
CU_ASSERT_TRUE(wait_for_list(lcs,&pauline->stat.number_of_LinphoneTransferCallOutgoingProgress,1,2000));
linphone_core_accept_call(laure->lc,linphone_core_get_current_call(laure->lc));
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,&marie->stat.number_of_LinphoneCallConnected,1,2000));
CU_ASSERT_TRUE(wait_for_list(lcs,&marie->stat.number_of_LinphoneCallStreamsRunning,1,2000));
CU_ASSERT_TRUE(wait_for_list(lcs,&pauline->stat.number_of_LinphoneTransfertCallConnected,1,2000));
CU_ASSERT_TRUE(wait_for_list(lcs,&pauline->stat.number_of_LinphoneTransferCallConnected,1,2000));
/*terminate marie to pauline call*/
CU_ASSERT_TRUE(wait_for_list(lcs,&pauline->stat.number_of_LinphoneCallEnd,1,2000));
......@@ -862,7 +862,7 @@ static void call_transfer_existing_call_outgoing_call(void) {
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));
CU_ASSERT_TRUE(wait_for_list(lcs,&marie->stat.number_of_LinphoneTransferCallOutgoingProgress,1,2000));
/*laure accept call*/
for(calls=linphone_core_get_calls(laure->lc);calls!=NULL;calls=calls->next) {
......@@ -877,7 +877,7 @@ static void call_transfer_existing_call_outgoing_call(void) {
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));
CU_ASSERT_TRUE(wait_for_list(lcs,&pauline->stat.number_of_LinphoneCallStreamsRunning,1,2000));
CU_ASSERT_TRUE(wait_for_list(lcs,&marie->stat.number_of_LinphoneTransfertCallConnected,1,2000));
CU_ASSERT_TRUE(wait_for_list(lcs,&marie->stat.number_of_LinphoneTransferCallConnected,1,2000));
/*terminate marie to pauline/laure call*/
CU_ASSERT_TRUE(wait_for_list(lcs,&pauline->stat.number_of_LinphoneCallEnd,1,2000));
......
......@@ -103,11 +103,11 @@ typedef struct _stats {
int number_of_LinphoneCallReleased;
int number_of_LinphoneTransferCallOutgoingInit;
int number_of_LinphoneTransfertCallOutgoingProgress;
int number_of_LinphoneTransfertCallOutgoingRinging;
int number_of_LinphoneTransfertCallOutgoingEarlyMedia;
int number_of_LinphoneTransfertCallConnected;
int number_of_LinphoneTransfertCallStreamsRunning;
int number_of_LinphoneTransferCallOutgoingProgress;
int number_of_LinphoneTransferCallOutgoingRinging;
int number_of_LinphoneTransferCallOutgoingEarlyMedia;
int number_of_LinphoneTransferCallConnected;
int number_of_LinphoneTransferCallStreamsRunning;
int number_of_LinphoneMessageReceived;
int number_of_LinphoneMessageReceivedLegacy;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment