From 1c655401bf5f829fcd6ca4ed66b96a91a0c34925 Mon Sep 17 00:00:00 2001 From: Milanka Ringwald Date: Fri, 20 Nov 2015 13:10:30 +0100 Subject: [PATCH] send ring indicator from hfp_run_for_context --- src/hfp_ag.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/hfp_ag.c b/src/hfp_ag.c index fc7adbfce..cec2c405e 100644 --- a/src/hfp_ag.c +++ b/src/hfp_ag.c @@ -667,12 +667,6 @@ static int incoming_call_state_machine(hfp_connection_t * context){ if (!context->run_call_state_machine) return 0; if (context->state < HFP_SERVICE_LEVEL_CONNECTION_ESTABLISHED) return 0; - if (context->ag_ring){ - context->ag_ring = 0; - hfp_ag_ring(context->rfcomm_cid); - return 1; - } - int done = 0; switch (context->call_state){ case HFP_CALL_TRIGGER_AUDIO_CONNECTION: @@ -953,6 +947,13 @@ static void hfp_run_for_context(hfp_connection_t *context){ hfp_ag_error(context->rfcomm_cid); return; } + + if (context->ag_ring){ + context->ag_ring = 0; + context->command = HFP_CMD_NONE; + hfp_ag_ring(context->rfcomm_cid); + return; + } int done = hfp_ag_run_for_context_service_level_connection(context); if (!done){