Commit a53740de authored by Simon Morlat's avatar Simon Morlat
Browse files

fix call acceptance with policy test, by adding linphone_core_create_call_params().

parent eca15bf8
......@@ -63,6 +63,7 @@ cd /c/sources
Building belle-sip
******************
* make sure that java version 1.6 is available in the PATH. java-1.7 will not work with antlr generator.
* download the sources with msys-git shell using the following command:
$ git clone git://git.linphone.org/belle-sip.git
* compile and install
......
......@@ -2273,7 +2273,7 @@ static void linphone_call_start_video_stream(LinphoneCall *call, const char *cna
}
}else ms_warning("No video stream accepted.");
}else{
ms_warning("No valid video stream defined.");
ms_message("No valid video stream defined.");
}
#endif
}
......
......@@ -6319,6 +6319,19 @@ LinphoneCallParams *linphone_core_create_default_call_parameters(LinphoneCore *l
return p;
}
/**
* Create a LinphoneCallParams suitable for linphone_core_invite_with_params(), linphone_core_accept_call_with_params(), linphone_core_accept_early_media_with_params(),
* linphone_core_accept_call_update().
* The parameters are initialized according to the current LinphoneCore configuration and the current state of the LinphoneCall.
* @param lc the LinphoneCore
* @param call the call for which the parameters are to be build, or NULL in the case where the parameters are to be used for a new outgoing call.
* @return a new LinphoneCallParams
*/
LinphoneCallParams *linphone_core_create_call_params(LinphoneCore *lc, LinphoneCall *call){
if (!call) return linphone_core_create_default_call_parameters(lc);
return linphone_call_params_copy(&call->params);
}
const char *linphone_reason_to_string(LinphoneReason err){
switch(err){
case LinphoneReasonNone:
......
......@@ -1862,9 +1862,12 @@ LINPHONE_PUBLIC int linphone_core_accept_call_update(LinphoneCore *lc, LinphoneC
* Get default call parameters reflecting current linphone core configuration
* @param lc LinphoneCore object
* @return LinphoneCallParams
* @deprecated use linphone_core_create_call_params()
*/
LINPHONE_PUBLIC LinphoneCallParams *linphone_core_create_default_call_parameters(LinphoneCore *lc);
LINPHONE_PUBLIC LinphoneCallParams *linphone_core_create_call_params(LinphoneCore *lc, LinphoneCall *call);
LINPHONE_PUBLIC LinphoneCall *linphone_core_get_call_by_remote_address(LinphoneCore *lc, const char *remote_address);
LINPHONE_PUBLIC void linphone_core_send_dtmf(LinphoneCore *lc,char dtmf);
......
......@@ -429,16 +429,19 @@ static void linphone_gtk_assistant_prepare(GtkWidget *assistant, GtkWidget *page
linphone_core_add_auth_info(linphone_gtk_get_core(),info);
linphone_address_destroy(identity);
// If account created on sip.linphone.org, we configure linphone to use TLS by default
if (strcmp(creator->domain, "sip:sip.linphone.org") == 0 && linphone_core_sip_transport_supported(linphone_gtk_get_core(),LinphoneTransportTls)) {
LinphoneAddress *addr=linphone_address_new(creator->domain);
char *tmp;
linphone_address_set_transport(addr, LinphoneTransportTls);
tmp=linphone_address_as_string(addr);
linphone_proxy_config_set_server_addr(cfg,tmp);
linphone_proxy_config_set_route(cfg,tmp);
ms_free(tmp);
linphone_address_destroy(addr);
if (strcmp(creator->domain, "sip:sip.linphone.org") == 0 ){
linphone_proxy_config_enable_avpf(cfg,TRUE);
// If account created on sip.linphone.org, we configure linphone to use TLS by default
if (linphone_core_sip_transport_supported(linphone_gtk_get_core(),LinphoneTransportTls)) {
LinphoneAddress *addr=linphone_address_new(creator->domain);
char *tmp;
linphone_address_set_transport(addr, LinphoneTransportTls);
tmp=linphone_address_as_string(addr);
linphone_proxy_config_set_server_addr(cfg,tmp);
linphone_proxy_config_set_route(cfg,tmp);
ms_free(tmp);
linphone_address_destroy(addr);
}
}
if (linphone_core_add_proxy_config(linphone_gtk_get_core(),cfg)==-1)
......
oRTP @ 00701648
Subproject commit b9534b1b2beb4bc549741e1f55a9c0bfe15d6c90
Subproject commit 00701648593b0fce93b3d519e281dd6f547db670
......@@ -160,10 +160,10 @@ void liblinphone_tester_check_rtcp(LinphoneCoreManager* caller, LinphoneCoreMana
linphone_call_unref(c2);
}
bool_t call_with_params(LinphoneCoreManager* caller_mgr
bool_t call_with_params2(LinphoneCoreManager* caller_mgr
,LinphoneCoreManager* callee_mgr
, const LinphoneCallParams *caller_params
, const LinphoneCallParams *callee_params) {
, const LinphoneCallParams *callee_params, bool_t build_callee_params) {
int retry=0;
stats initial_caller=caller_mgr->stat;
stats initial_callee=callee_mgr->stat;
......@@ -215,10 +215,16 @@ bool_t call_with_params(LinphoneCoreManager* caller_mgr
}
linphone_address_destroy(callee_from);
}
if (callee_params)
if (callee_params){
linphone_core_accept_call_with_params(callee_mgr->lc,linphone_core_get_current_call(callee_mgr->lc),callee_params);
else
}else if (build_callee_params){
LinphoneCallParams *default_params=linphone_core_create_call_params(callee_mgr->lc,linphone_core_get_current_call(callee_mgr->lc));
ms_error("Created default call params with video=%i", linphone_call_params_video_enabled(default_params));
linphone_core_accept_call_with_params(callee_mgr->lc,linphone_core_get_current_call(callee_mgr->lc),default_params);
linphone_call_params_destroy(default_params);
}else{
linphone_core_accept_call(callee_mgr->lc,linphone_core_get_current_call(callee_mgr->lc));
}
CU_ASSERT_TRUE(wait_for(callee_mgr->lc,caller_mgr->lc,&callee_mgr->stat.number_of_LinphoneCallConnected,initial_callee.number_of_LinphoneCallConnected+1));
CU_ASSERT_TRUE(wait_for(callee_mgr->lc,caller_mgr->lc,&caller_mgr->stat.number_of_LinphoneCallConnected,initial_callee.number_of_LinphoneCallConnected+1));
......@@ -243,6 +249,14 @@ bool_t call_with_params(LinphoneCoreManager* caller_mgr
}
return result;
}
bool_t call_with_params(LinphoneCoreManager* caller_mgr
,LinphoneCoreManager* callee_mgr
, const LinphoneCallParams *caller_params
, const LinphoneCallParams *callee_params){
return call_with_params2(caller_mgr,callee_mgr,caller_params,callee_params,FALSE);
}
bool_t call_with_caller_params(LinphoneCoreManager* caller_mgr,LinphoneCoreManager* callee_mgr, const LinphoneCallParams *params) {
return call_with_params(caller_mgr,callee_mgr,params,NULL);
}
......@@ -1270,7 +1284,7 @@ static void srtp_call_with_several_video_switches(void) {
static void call_with_declined_video_base(bool_t using_policy) {
LinphoneCoreManager* marie = linphone_core_manager_new( "marie_rc");
LinphoneCoreManager* pauline = linphone_core_manager_new( "pauline_rc");
LinphoneCallParams* callee_params;
LinphoneCallParams* callee_params=NULL;
LinphoneCallParams* caller_params;
LinphoneCall* marie_call;
LinphoneCall* pauline_call;
......@@ -1293,11 +1307,16 @@ static void call_with_declined_video_base(bool_t using_policy) {
caller_params=linphone_core_create_default_call_parameters(pauline->lc);
if (!using_policy)
linphone_call_params_enable_video(caller_params,TRUE);
callee_params=linphone_core_create_default_call_parameters(marie->lc);
if (!using_policy)
if (!using_policy){
callee_params=linphone_core_create_default_call_parameters(marie->lc);
linphone_call_params_enable_video(callee_params,FALSE);
}
CU_ASSERT_TRUE(call_with_params(pauline,marie,caller_params,callee_params));
CU_ASSERT_TRUE(call_with_params2(pauline,marie,caller_params,callee_params,using_policy));
linphone_call_params_destroy(caller_params);
if (callee_params) linphone_call_params_destroy(callee_params);
marie_call=linphone_core_get_current_call(marie->lc);
pauline_call=linphone_core_get_current_call(pauline->lc);
......@@ -1320,7 +1339,7 @@ static void call_with_declined_video_using_policy(void) {
}
static void video_call_base(LinphoneCoreManager* pauline,LinphoneCoreManager* marie, bool_t using_policy) {
LinphoneCallParams* callee_params;
LinphoneCallParams* callee_params=NULL;
LinphoneCallParams* caller_params;
LinphoneCall* marie_call;
LinphoneCall* pauline_call;
......@@ -1343,16 +1362,18 @@ static void video_call_base(LinphoneCoreManager* pauline,LinphoneCoreManager* ma
caller_params=linphone_core_create_default_call_parameters(pauline->lc);
if (!using_policy)
linphone_call_params_enable_video(caller_params,TRUE);
callee_params=linphone_core_create_default_call_parameters(marie->lc);
if (!using_policy)
if (!using_policy){
callee_params=linphone_core_create_default_call_parameters(marie->lc);
linphone_call_params_enable_video(callee_params,TRUE);
}
CU_ASSERT_TRUE(call_with_params(pauline,marie,caller_params,callee_params));
CU_ASSERT_TRUE(call_with_params2(pauline,marie,caller_params,callee_params,using_policy));
marie_call=linphone_core_get_current_call(marie->lc);
pauline_call=linphone_core_get_current_call(pauline->lc);
linphone_call_params_destroy(caller_params);
linphone_call_params_destroy(callee_params);
if (callee_params) linphone_call_params_destroy(callee_params);
if (marie_call && pauline_call ) {
CU_ASSERT_TRUE(linphone_call_log_video_enabled(linphone_call_get_call_log(marie_call)));
......
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