broadband-modem,modem-helpers: generalize call end regex creation
Signed-off-by: Dan Williams <dan@ioncontrol.co>
This commit is contained in:
@@ -8473,8 +8473,7 @@ set_voice_in_call_unsolicited_events_handlers (MMBroadbandModem *self,
|
||||
g_autoptr(GRegex) in_call_event_regex = NULL;
|
||||
guint i;
|
||||
|
||||
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);
|
||||
in_call_event_regex = mm_call_end_regex_get ();
|
||||
|
||||
ports[0] = MM_PORT_SERIAL_AT (ports_ctx->primary);
|
||||
ports[1] = MM_PORT_SERIAL_AT (ports_ctx->secondary);
|
||||
|
||||
@@ -482,6 +482,20 @@ mm_at_quote_string (const gchar *input)
|
||||
|
||||
/*****************************************************************************/
|
||||
|
||||
GRegex *
|
||||
mm_call_end_regex_get (void)
|
||||
{
|
||||
/* Example:
|
||||
* <CR><LF>NO ANSWER<CR><LF>
|
||||
*/
|
||||
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);
|
||||
}
|
||||
|
||||
/*****************************************************************************/
|
||||
|
||||
GRegex *
|
||||
mm_voice_ring_regex_get (void)
|
||||
{
|
||||
|
||||
@@ -85,6 +85,12 @@ gchar *mm_bcd_to_string (const guint8 *bcd,
|
||||
*/
|
||||
gchar *mm_at_quote_string (const gchar *input);
|
||||
|
||||
/*****************************************************************************/
|
||||
/* CALL specific helpers and utilities */
|
||||
/*****************************************************************************/
|
||||
|
||||
GRegex *mm_call_end_regex_get (void);
|
||||
|
||||
/*****************************************************************************/
|
||||
/* VOICE specific helpers and utilities */
|
||||
/*****************************************************************************/
|
||||
|
||||
Reference in New Issue
Block a user