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

@@ -254,3 +254,22 @@ get_protocol_from_address_with_fallback (const char *target)
return protocol;
}
/**
* dtmf_tone_is_valid:
* @key:
*
* Checks if @key is a valid DTMF keytone
*
* Returns: %TRUE if @key is 0-9, A-D, * or #, %FALSE otherwise
*/
gboolean
dtmf_tone_key_is_valid (gchar key)
{
return
(key >= '0' && key <= '9')
|| (key >= 'A' && key <= 'D')
|| key == '*'
|| key == '#';
}