aboutsummaryrefslogtreecommitdiff
path: root/src/mm-modem-helpers.c
diff options
context:
space:
mode:
authorDylan Van Assche <me@dylanvanassche.be>2021-08-31 17:01:45 +0200
committerAleksander Morgado <aleksander@aleksander.es>2021-09-08 07:59:16 +0000
commit92ad38432c2a14d1ac310b58fde7d9336a45aff9 (patch)
treeae2f6decfb8eccec2ccff69df4cb19a18e04326a /src/mm-modem-helpers.c
parent97d15c49a3c74ff5b006f1f59dfae9d76a955d20 (diff)
mm-modem-helpers: only parse calls in voice mode
Calls in a CLCC response in data-only or fax-only mode do not count as actuall calls.
Diffstat (limited to 'src/mm-modem-helpers.c')
-rw-r--r--src/mm-modem-helpers.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/src/mm-modem-helpers.c b/src/mm-modem-helpers.c
index a01dcbf6..af3682d0 100644
--- a/src/mm-modem-helpers.c
+++ b/src/mm-modem-helpers.c
@@ -645,6 +645,29 @@ mm_3gpp_parse_clcc_response (const gchar *str,
}
call_info->state = call_state[aux];
+ if (!mm_get_uint_from_match_info (match_info, 4, &aux)) {
+ mm_obj_warn (log_object, "couldn't parse mode from +CLCC line");
+ goto next;
+ }
+
+ /*
+ * Skip calls in Fax-only and DATA-only mode (3GPP TS 27.007):
+ * 0: Voice
+ * 1: Data
+ * 2: Fax
+ * 3: Voice followed by data, voice mode
+ * 4: Alternating voice/data, voice mode
+ * 5: Alternating voice/fax, voice mode
+ * 6: Voice followed by data, data mode
+ * 7: Alternating voice/data, data mode
+ * 8: Alternating voice/fax, fax mode
+ * 9: unknown
+ */
+ if (aux != 0 && aux != 3 && aux != 4 && aux != 5) {
+ mm_obj_dbg (log_object, "+CLCC line is not a voice call, skipping.");
+ goto next;
+ }
+
if (g_match_info_get_match_count (match_info) >= 7)
call_info->number = mm_get_string_unquoted_from_match_info (match_info, 6);