diff --git a/src/hfp_ag.c b/src/hfp_ag.c index cf645005d..88b370f2b 100644 --- a/src/hfp_ag.c +++ b/src/hfp_ag.c @@ -919,6 +919,16 @@ static void hfp_ag_call_sm(hfp_ag_call_event_t event, hfp_connection_t * connect case HFP_AG_TERMINATE_CALL_BY_AG: switch (hfp_ag_call_state){ + case HFP_CALL_STATUS_NO_HELD_OR_ACTIVE_CALLS: + switch (hfp_ag_callsetup_state){ + case HFP_CALLSETUP_STATUS_INCOMING_CALL_SETUP_IN_PROGRESS: + hfp_ag_set_callsetup_state(HFP_CALLSETUP_STATUS_NO_CALL_SETUP_IN_PROGRESS); + hfp_ag_trigger_reject_call(); + printf("TODO AG Rejected Incoming call, AG terminate call\n"); + break; + default: + break; + } case HFP_CALL_STATUS_ACTIVE_OR_HELD_CALL_IS_PRESENT: hfp_ag_set_callsetup_state(HFP_CALLSETUP_STATUS_NO_CALL_SETUP_IN_PROGRESS); hfp_ag_set_call_state(HFP_CALL_STATUS_NO_HELD_OR_ACTIVE_CALLS); diff --git a/test/pts/hfp_ag_test.c b/test/pts/hfp_ag_test.c index 5a3c0d59a..be3834f45 100644 --- a/test/pts/hfp_ag_test.c +++ b/test/pts/hfp_ag_test.c @@ -122,6 +122,7 @@ static void show_usage(void){ printf("d - report AG failure\n"); printf("e - answer call on AG\n"); + printf("E - reject call on AG\n"); printf("r - disable in-band ring tone\n"); printf("R - enable in-band ring tone\n"); @@ -190,6 +191,10 @@ static int stdin_process(struct data_source *ds){ printf("Answer call on AG\n"); hfp_ag_answer_incoming_call(); break; + case 'E': + printf("Reject call on AG\n"); + hfp_ag_terminate_call(); + break; case 'f': printf("Disable cellular network\n"); hfp_ag_set_registration_status(0);