From 6d85146bba3edceeaf9f23e0e7a5281fda527d59 Mon Sep 17 00:00:00 2001 From: Marco Bascetta Date: Tue, 5 May 2015 18:00:09 +0200 Subject: core: handle incoming calls (RING/CRING, CLIP, NO CARRIER). --- src/mm-modem-helpers.c | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) (limited to 'src/mm-modem-helpers.c') diff --git a/src/mm-modem-helpers.c b/src/mm-modem-helpers.c index 36eb0390..7ba00f9e 100644 --- a/src/mm-modem-helpers.c +++ b/src/mm-modem-helpers.c @@ -348,6 +348,32 @@ mm_voice_cring_regex_get (void) NULL); } +GRegex * +mm_voice_clip_regex_get (void) +{ + /* Example: + * +CLIP: "+393351391306",145,,,,0 + * \_ Number \_ Type \_ Validity + */ + + return g_regex_new ("\\r\\n\\+CLIP:\\s*\"(\\S+)\",\\s*(\\d+),\\s*,\\s*,\\s*,\\s*(\\d+)\\r\\n", + G_REGEX_RAW | G_REGEX_OPTIMIZE, + 0, + NULL); +} + +GRegex * +mm_voice_nocarrier_regex_get (void) +{ + /* Example: + * NO CARRIER + */ + return g_regex_new ("\\r\\n\\NO CARRIER\\r\\n", + G_REGEX_RAW | G_REGEX_OPTIMIZE, + 0, + NULL); +} + GRegex * mm_voice_dtmf_regex_get (void) { -- cgit v1.2.3-70-g09d2