Check voice call state

Check voice call state, possible results: connected, connecting, idle.
//    PRIVILEGE needed to be set in tizen-manifest.xml:
//    http://tizen.org/telephony

#include <dlog.h> // for logging purposes
#include <telephony.h>

void
check_voice_call_state() {
	telephony_handle_list_s handle_list;
	if(telephony_init(&handle_list) == TELEPHONY_ERROR_NONE) {
		telephony_error_e ret;
		telephony_call_state_e voice_call_state;
		ret = telephony_call_get_voice_call_state(handle_list.handle[0], &voice_call_state);

		if (ret == TELEPHONY_ERROR_NONE) {
			switch (voice_call_state) {
				case TELEPHONY_CALL_STATE_CONNECTED:
					LOGI("Connected state");
					break;
				case TELEPHONY_CALL_STATE_CONNECTING:
					LOGI("Connecting state");
					break;
				case TELEPHONY_CALL_STATE_IDLE:
					LOGI("Idle state");
					break;
			}
		}
	}
}

Responses

0 Replies