simtech: handle 'MISSED_CALL' URCs

https://source.puri.sm/Librem5/ModemManager/issues/6
This commit is contained in:
Aleksander Morgado
2019-10-16 18:04:47 +02:00
parent eb66e8ae68
commit 5316e9e4e5
4 changed files with 103 additions and 0 deletions
@@ -151,6 +151,36 @@ out:
/*****************************************************************************/
/*
* <CR><LF>MISSED_CALL: 11:01AM 07712345678<CR><LF>
*/
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 <CR> instead of one...
* <CR><CR><LF>+CRING: VOICE<CR><CR><LF>