From 5316e9e4e56faa606c2ae4f19087ae98b8c3944d Mon Sep 17 00:00:00 2001 From: Aleksander Morgado Date: Wed, 16 Oct 2019 18:03:53 +0200 Subject: simtech: handle 'MISSED_CALL' URCs https://source.puri.sm/Librem5/ModemManager/issues/6 --- plugins/simtech/mm-modem-helpers-simtech.c | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) (limited to 'plugins/simtech/mm-modem-helpers-simtech.c') diff --git a/plugins/simtech/mm-modem-helpers-simtech.c b/plugins/simtech/mm-modem-helpers-simtech.c index 4da3c988..d452e0b6 100644 --- a/plugins/simtech/mm-modem-helpers-simtech.c +++ b/plugins/simtech/mm-modem-helpers-simtech.c @@ -151,6 +151,36 @@ out: /*****************************************************************************/ +/* + * MISSED_CALL: 11:01AM 07712345678 + */ +GRegex * +mm_simtech_get_missed_call_urc_regex (void) +{ + return g_regex_new ("\\r\\nMISSED_CALL:\\s*(.+)\\r\\n", + G_REGEX_RAW | G_REGEX_OPTIMIZE, 0, NULL); +} + +gboolean +mm_simtech_parse_missed_call_urc (GMatchInfo *match_info, + gchar **details, + GError **error) +{ + gchar *str; + + str = mm_get_string_unquoted_from_match_info (match_info, 1); + if (!str) { + g_set_error (error, MM_CORE_ERROR, MM_CORE_ERROR_FAILED, + "Couldn't read missed call URC details"); + return FALSE; + } + + *details = str; + return TRUE; +} + +/*****************************************************************************/ + /* * Using TWO instead of one... * +CRING: VOICE -- cgit v1.2.3-70-g09d2