util: Make dtmf tone checking function public

Moves the function out of calls-call.c into util.c
This commit is contained in:
Evangelos Ribeiro Tzaras
2021-11-16 15:18:54 +01:00
parent 4c2717c362
commit afd1034dd1
3 changed files with 22 additions and 11 deletions

View File

@@ -340,16 +340,6 @@ calls_call_get_protocol (CallsCall *self)
return CALLS_CALL_GET_CLASS (self)->get_protocol (self);
}
static inline gboolean
tone_key_is_valid (gchar key)
{
return
(key >= '0' && key <= '9')
|| (key >= 'A' && key <= 'D')
|| key == '*'
|| key == '#';
}
/**
* calls_call_can_dtmf:
* @self: a #CallsCall
@@ -379,7 +369,7 @@ calls_call_send_dtmf_tone (CallsCall *self,
gchar key)
{
g_return_if_fail (CALLS_IS_CALL (self));
g_return_if_fail (tone_key_is_valid (key));
g_return_if_fail (dtmf_tone_key_is_valid (key));
CALLS_CALL_GET_CLASS (self)->send_dtmf_tone (self, key);
}