diff --git a/console/commands.c b/console/commands.c index d953878..73e1b2b 100644 --- a/console/commands.c +++ b/console/commands.c @@ -542,8 +542,8 @@ lpc_cmd_answer(LinphoneCore *lc, char *args) if (!args) { - //TODO if just one call is present answer the only one ... - if ( -1 == linphone_core_accept_call(lc, linphone_core_get_current_call(lc)) )//TODO is there any current call here=> nope + //if just one call is present answer the only one in passing NULL to the linphone_core_accept_call ... + if ( -1 == linphone_core_accept_call(lc, NULL) ) { linphonec_out("No incoming call.\n"); } diff --git a/coreapi/linphonecore.c b/coreapi/linphonecore.c index f9d3f29..1a9b1e0 100644 --- a/coreapi/linphonecore.c +++ b/coreapi/linphonecore.c @@ -2205,7 +2205,11 @@ int linphone_core_accept_call(LinphoneCore *lc, LinphoneCall *call) const char *contact=NULL; if (call==NULL){ - return -1; + //if just one call is present answer the only one ... + if(ms_list_size(linphone_core_get_calls(lc)) != 1) + return -1; + else + call = linphone_core_get_calls(lc)->data; } if (call->state==LinphoneCallAVRunning){