From a7a8fc909abeb0abe092feb2603d27216f0e1325 Mon Sep 17 00:00:00 2001 From: Bob Ham Date: Tue, 4 Feb 2020 11:21:34 +0000 Subject: [PATCH] broadband-modem: add optional extra carriage return to in-call URC regex The BroadMobi BM818 has inconsitent line endings and the in-call URC regex can miss events, particularly NO CARRIER, because the regex doesn't match. To fix this we add an optional carriage return to the regex. This will match for the BM818's output. --- src/mm-broadband-modem.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/mm-broadband-modem.c b/src/mm-broadband-modem.c index 61ceae8b..6b7687f3 100644 --- a/src/mm-broadband-modem.c +++ b/src/mm-broadband-modem.c @@ -7633,7 +7633,7 @@ set_voice_in_call_unsolicited_events_handlers (MMBroadbandModem *self, GRegex *in_call_event_regex; guint i; - in_call_event_regex = g_regex_new ("\\r\\n(NO CARRIER|BUSY|NO ANSWER|NO DIALTONE)\\r\\n$", + in_call_event_regex = g_regex_new ("\\r\\n(NO CARRIER|BUSY|NO ANSWER|NO DIALTONE)(\\r)?\\r\\n$", G_REGEX_RAW | G_REGEX_OPTIMIZE, 0, NULL); ports[0] = MM_PORT_SERIAL_AT (ports_ctx->primary);