/* Return: TRUE if there is an MGCP response code at offset in tvb, otherwise FALSE  */
static gboolean is_mgcp_rspcode(tvbuff_t *tvb, gint offset, gint maxlength)
/* Return: TRUE if there is an MGCP response code at offset in tvb, otherwise FALSE  */
static gboolean is_mgcp_rspcode(tvbuff_t *tvb, gint offset, gint maxlength)
{
	gboolean returnvalue = FALSE;
	guint8 word[4];
	if (tvb_captured_length_remaining(tvb, offset) < (gint)sizeof(word))
		return FALSE;
	if (maxlength >= 3)
	{
		tvb_get_nstringz0(tvb, offset, sizeof(word), word);
		if (g_ascii_isdigit(word[0]) && g_ascii_isdigit(word[1]) && g_ascii_isdigit(word[2]))
		{
			returnvalue = TRUE;
		}
	}
	if (returnvalue && maxlength >= 4)
	{
		char next = tvb_get_guint8(tvb, 3);
		if ((next != ' ') && (next != '\t'))
		{
			returnvalue = FALSE;
		}
	}
	return returnvalue;
}