void telephony_answer_call_req(void *telephony_device) { telephony_answer_call_rsp(telephony_device, CME_ERROR_NONE); telephony_update_indicator(dummy_indicators, "call", EV_CALL_ACTIVE); telephony_update_indicator(dummy_indicators, "callsetup", EV_CALLSETUP_INACTIVE); active_call_status = CALL_STATUS_ACTIVE; }
void telephony_last_dialed_number_req(void *telephony_device) { telephony_last_dialed_number_rsp(telephony_device, CME_ERROR_NONE); /* Notify outgoing call set-up successfully initiated */ telephony_update_indicator(dummy_indicators, "callsetup", EV_CALLSETUP_OUTGOING); telephony_update_indicator(dummy_indicators, "callsetup", EV_CALLSETUP_ALERTING); active_call_status = CALL_STATUS_ALERTING; active_call_dir = CALL_DIR_OUTGOING; }
void telephony_terminate_call_req(void *telephony_device) { g_free(active_call_number); active_call_number = NULL; telephony_terminate_call_rsp(telephony_device, CME_ERROR_NONE); if (telephony_get_indicator(dummy_indicators, "callsetup") > 0) telephony_update_indicator(dummy_indicators, "callsetup", EV_CALLSETUP_INACTIVE); else telephony_update_indicator(dummy_indicators, "call", EV_CALL_INACTIVE); }
void telephony_dial_number_req(void *telephony_device, const char *number) { g_free(active_call_number); active_call_number = g_strdup(number); DBG("telephony-dummy: dial request to %s", active_call_number); telephony_dial_number_rsp(telephony_device, CME_ERROR_NONE); /* Notify outgoing call set-up successfully initiated */ telephony_update_indicator(dummy_indicators, "callsetup", EV_CALLSETUP_OUTGOING); telephony_update_indicator(dummy_indicators, "callsetup", EV_CALLSETUP_ALERTING); active_call_status = CALL_STATUS_ALERTING; active_call_dir = CALL_DIR_OUTGOING; }
static DBusMessage *cancel_call(DBusConnection *conn, DBusMessage *msg, void *data) { DBG("telephony-dummy: cancel call"); g_free(active_call_number); active_call_number = NULL; if (telephony_get_indicator(dummy_indicators, "callsetup") > 0) { telephony_update_indicator(dummy_indicators, "callsetup", EV_CALLSETUP_INACTIVE); telephony_calling_stopped_ind(); } if (telephony_get_indicator(dummy_indicators, "call") > 0) telephony_update_indicator(dummy_indicators, "call", EV_CALL_INACTIVE); return dbus_message_new_method_return(msg); }
/* D-Bus method handlers */ static DBusMessage *outgoing_call(DBusConnection *conn, DBusMessage *msg, void *data) { const char *number; if (!dbus_message_get_args(msg, NULL, DBUS_TYPE_STRING, &number, DBUS_TYPE_INVALID)) return invalid_args(msg); DBG("telephony-dummy: outgoing call to %s", number); g_free(active_call_number); active_call_number = g_strdup(number); telephony_update_indicator(dummy_indicators, "callsetup", EV_CALLSETUP_OUTGOING); telephony_update_indicator(dummy_indicators, "callsetup", EV_CALLSETUP_ALERTING); active_call_status = CALL_STATUS_ALERTING; active_call_dir = CALL_DIR_OUTGOING; return dbus_message_new_method_return(msg); }
static DBusMessage *registration_status(DBusConnection *conn, DBusMessage *msg, void *data) { dbus_bool_t registration; int val; if (!dbus_message_get_args(msg, NULL, DBUS_TYPE_BOOLEAN, ®istration, DBUS_TYPE_INVALID)) return invalid_args(msg); val = registration ? EV_SERVICE_PRESENT : EV_SERVICE_NONE; telephony_update_indicator(dummy_indicators, "service", val); DBG("telephony-dummy: registration status set to %d", val); return dbus_message_new_method_return(msg); }
static DBusMessage *roaming_status(DBusConnection *conn, DBusMessage *msg, void *data) { dbus_bool_t roaming; int val; if (!dbus_message_get_args(msg, NULL, DBUS_TYPE_BOOLEAN, &roaming, DBUS_TYPE_INVALID)) return invalid_args(msg); val = roaming ? EV_ROAM_ACTIVE : EV_ROAM_INACTIVE; telephony_update_indicator(dummy_indicators, "roam", val); DBG("telephony-dummy: roaming status set to %d", val); return dbus_message_new_method_return(msg); }
static DBusMessage *battery_level(DBusConnection *conn, DBusMessage *msg, void *data) { dbus_uint32_t level; if (!dbus_message_get_args(msg, NULL, DBUS_TYPE_UINT32, &level, DBUS_TYPE_INVALID)) return invalid_args(msg); if (level > 5) return invalid_args(msg); telephony_update_indicator(dummy_indicators, "battchg", level); DBG("telephony-dummy: battery level set to %u", level); return dbus_message_new_method_return(msg); }
static DBusMessage *signal_strength(DBusConnection *conn, DBusMessage *msg, void *data) { dbus_uint32_t strength; if (!dbus_message_get_args(msg, NULL, DBUS_TYPE_UINT32, &strength, DBUS_TYPE_INVALID)) return invalid_args(msg); if (strength > 5) return invalid_args(msg); telephony_update_indicator(dummy_indicators, "signal", strength); DBG("telephony-dummy: signal strength set to %u", strength); return dbus_message_new_method_return(msg); }
static DBusMessage *incoming_call(DBusConnection *conn, DBusMessage *msg, void *data) { const char *number; if (!dbus_message_get_args(msg, NULL, DBUS_TYPE_STRING, &number, DBUS_TYPE_INVALID)) return btd_error_invalid_args(msg); DBG("telephony-dummy: incoming call to %s", number); g_free(active_call_number); active_call_number = g_strdup(number); telephony_update_indicator(dummy_indicators, "callsetup", EV_CALLSETUP_INCOMING); active_call_status = CALL_STATUS_INCOMING; active_call_dir = CALL_DIR_INCOMING; telephony_incoming_call_ind(number, NUMBER_TYPE_TELEPHONY, FALSE); return dbus_message_new_method_return(msg); }