diff options
Diffstat (limited to 'binding/gdbus/ofono_voicecallmanager.c')
-rw-r--r-- | binding/gdbus/ofono_voicecallmanager.c | 88 |
1 files changed, 88 insertions, 0 deletions
diff --git a/binding/gdbus/ofono_voicecallmanager.c b/binding/gdbus/ofono_voicecallmanager.c index 2a361a1..78924dc 100644 --- a/binding/gdbus/ofono_voicecallmanager.c +++ b/binding/gdbus/ofono_voicecallmanager.c @@ -45,6 +45,8 @@ static void call_added(OrgOfonoVoiceCallManager *manager, g_signal_emit_by_name(manager, "incoming-call", op, cl ? cl : ""); } else if (!strcmp(state, "dialing")) { g_signal_emit_by_name(manager, "dialing-call", op, cl ? cl : ""); + } else if (!strcmp(state, "waiting")) { + g_signal_emit_by_name(manager, "waiting-call", op, cl ? cl : ""); } } @@ -59,6 +61,7 @@ const OrgOfonoVoiceCallManager *ofono_voicecallmanager_init(const gchar *op, void (*incoming_call)(OrgOfonoVoiceCallManager *manager,gchar *,gchar *), void (*dialing_call)(OrgOfonoVoiceCallManager *manager,gchar *,gchar *), + void (*waiting_call)(OrgOfonoVoiceCallManager *manager,gchar *,gchar *), void (*terminated_call)(OrgOfonoVoiceCallManager *manager,gchar *)) { OrgOfonoVoiceCallManager *manager = org_ofono_voice_call_manager_proxy_new_for_bus_sync( @@ -89,6 +92,18 @@ const OrgOfonoVoiceCallManager G_TYPE_STRING, G_TYPE_STRING); + g_signal_new("waiting-call", + G_TYPE_OBJECT, + G_SIGNAL_RUN_LAST, + 0, + NULL, + NULL, + g_cclosure_marshal_generic, + G_TYPE_NONE, + 2, + G_TYPE_STRING, + G_TYPE_STRING); + g_signal_new("terminated-call", G_TYPE_OBJECT, G_SIGNAL_RUN_LAST, @@ -108,6 +123,10 @@ const OrgOfonoVoiceCallManager AFB_ERROR("Failed to connect to signal dialing-call\n"); } + if (g_signal_connect(G_OBJECT(manager), "waiting-call", G_CALLBACK(waiting_call), NULL) <= 0) { + AFB_ERROR("Failed to connect to signal waiting-call\n"); + } + if (g_signal_connect(G_OBJECT(manager), "terminated-call", G_CALLBACK(terminated_call), NULL) <= 0) { AFB_ERROR("Failed to connect to signal terminated-call\n"); } @@ -188,3 +207,72 @@ void ofono_voicecallmanager_hangup_all(OrgOfonoVoiceCallManager *manager) org_ofono_voice_call_manager_call_hangup_all_sync(manager, NULL, &error); } + +gchar **ofono_voicecallmanager_create_multiparty(OrgOfonoVoiceCallManager *manager) +{ + gchar **out = NULL; + GError *error = NULL; + if (!manager) { + AFB_ERROR("Ofono VoiceCallmanager uninitialized\n"); + return NULL; + } + + org_ofono_voice_call_manager_call_create_multiparty_sync(manager, &out, NULL, &error); + if (error != NULL) + return NULL; + return out; +} + +gboolean ofono_voicecallmanager_hangup_multiparty(OrgOfonoVoiceCallManager *manager) +{ + GError *error = NULL; + gboolean res; + if (!manager) { + AFB_ERROR("Ofono VoiceCallmanager uninitialized\n"); + return FALSE; + } + + res = org_ofono_voice_call_manager_call_hangup_multiparty_sync(manager, NULL, &error); + + return (res && error == NULL); +} + +gboolean ofono_voicecallmanager_hold_and_answer(OrgOfonoVoiceCallManager *manager) +{ + GError *error = NULL; + gboolean res; + if (!manager) { + AFB_ERROR("Ofono VoiceCallmanager uninitialized\n"); + return FALSE; + } + + res = org_ofono_voice_call_manager_call_hold_and_answer_sync(manager, NULL, &error); + + return (res && error == NULL); +} + +gboolean ofono_voicecallmanager_release_and_answer(OrgOfonoVoiceCallManager *manager) +{ + GError *error = NULL; + if (!manager) { + AFB_ERROR("Ofono VoiceCallmanager uninitialized\n"); + return FALSE; + } + AFB_ERROR("release and answer"); + org_ofono_voice_call_manager_call_release_and_answer_sync(manager, NULL, &error); + + return (error == NULL); +} + +gboolean ofono_voicecallmanager_swap_calls(OrgOfonoVoiceCallManager *manager) +{ + GError *error = NULL; + if (!manager) { + AFB_ERROR("Ofono VoiceCallmanager uninitialized\n"); + return FALSE; + } + + org_ofono_voice_call_manager_call_swap_calls_sync(manager, NULL, &error); + + return (error == NULL); +} |