From c3c6fdc55e5a45f9bf0611ec0925fd0702aff316 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Fri, 16 May 2025 11:21:01 -0500 Subject: serial-parsers: don't echo-remove strange call start/end URCs Some Sierra devices omit the leading from call start/end URCs like NO CARRIER and CONNECT, which caused the echo-removal code to remove from the response buffer because the leading did not exist. That can break call control and hangup handling on those devices. Signed-off-by: Dan Williams --- src/mm-modem-helpers.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/mm-modem-helpers.c') diff --git a/src/mm-modem-helpers.c b/src/mm-modem-helpers.c index c6fa13fc..d69951be 100644 --- a/src/mm-modem-helpers.c +++ b/src/mm-modem-helpers.c @@ -487,8 +487,12 @@ mm_call_end_regex_get (void) { /* Example: * NO ANSWER + * NO CARRIER + * BUSY + * + * Some Sierra devices omit the leading for in-call responses. */ - return g_regex_new ("\\r\\n(NO CARRIER)|(BUSY)|(NO ANSWER)|(NO DIALTONE)\\r\\n", + return g_regex_new ("(\\r)?\\n(NO CARRIER)|(BUSY)|(NO ANSWER)|(NO DIALTONE)\\r\\n", G_REGEX_DOLLAR_ENDONLY | G_REGEX_RAW | G_REGEX_OPTIMIZE, 0, NULL); -- cgit v1.2.3-70-g09d2