aboutsummaryrefslogtreecommitdiff
path: root/cli/mmcli-modem-voice.c
diff options
context:
space:
mode:
Diffstat (limited to 'cli/mmcli-modem-voice.c')
-rw-r--r--cli/mmcli-modem-voice.c28
1 files changed, 27 insertions, 1 deletions
diff --git a/cli/mmcli-modem-voice.c b/cli/mmcli-modem-voice.c
index 9e54f8ea..878984b3 100644
--- a/cli/mmcli-modem-voice.c
+++ b/cli/mmcli-modem-voice.c
@@ -47,6 +47,7 @@ typedef struct {
static Context *ctx;
/* Options */
+static gboolean status_flag;
static gboolean list_flag;
static gchar *create_str;
static gchar *delete_str;
@@ -59,6 +60,10 @@ static gboolean call_waiting_disable_flag;
static gboolean call_waiting_query_flag;
static GOptionEntry entries[] = {
+ { "voice-status", 0, 0, G_OPTION_ARG_NONE, &status_flag,
+ "Show status of voice support.",
+ NULL
+ },
{ "voice-list-calls", 0, 0, G_OPTION_ARG_NONE, &list_flag,
"List calls available in a given modem",
NULL
@@ -126,7 +131,8 @@ mmcli_modem_voice_options_enabled (void)
if (checked)
return !!n_actions;
- n_actions = (list_flag +
+ n_actions = (status_flag +
+ list_flag +
!!create_str +
!!delete_str +
hold_and_accept_flag +
@@ -142,6 +148,9 @@ mmcli_modem_voice_options_enabled (void)
exit (EXIT_FAILURE);
}
+ if (status_flag)
+ mmcli_force_sync_operation ();
+
checked = TRUE;
return !!n_actions;
}
@@ -198,6 +207,13 @@ build_call_properties_from_input (const gchar *properties_string)
}
static void
+print_voice_status (void)
+{
+ mmcli_output_string (MMC_F_VOICE_EMERGENCY_ONLY, mm_modem_voice_get_emergency_only (ctx->modem_voice) ? "yes" : "no");
+ mmcli_output_dump ();
+}
+
+static void
output_call_info (MMCall *call)
{
gchar *extra;
@@ -488,6 +504,9 @@ get_modem_ready (GObject *source,
ensure_modem_voice ();
+ if (status_flag)
+ g_assert_not_reached ();
+
/* Request to list call? */
if (list_flag) {
g_debug ("Asynchronously listing calls in modem...");
@@ -634,6 +653,13 @@ mmcli_modem_voice_run_synchronous (GDBusConnection *connection)
ensure_modem_voice ();
+ /* Request to get voice status? */
+ if (status_flag) {
+ g_debug ("Printing voice status...");
+ print_voice_status ();
+ return;
+ }
+
/* Request to list the call? */
if (list_flag) {
GList *result;