/* Check for a valid incoming CAPI message. Return: 0 = Invalid message 1 = Valid message, no B-Channel-data 2 = Valid message, B-Channel-data  */
int actcapi_chkhdr(act2000_card *card, actcapi_msghdr *hdr)
/* Check for a valid incoming CAPI message. Return: 0 = Invalid message 1 = Valid message, no B-Channel-data 2 = Valid message, B-Channel-data  */
int actcapi_chkhdr(act2000_card *card, actcapi_msghdr *hdr)
{
	int i;
	if (hdr->applicationID != 1)
		return 0;
	if (hdr->len < 9)
		return 0;
	for (i = 0; i < num_valid_imsg; i++)
		if ((hdr->cmd.cmd == valid_msg[i].cmd.cmd) &&
		    (hdr->cmd.subcmd == valid_msg[i].cmd.subcmd)) {
			return (i?1:2);
		}
	return 0;
}