Пример #1
0
/*
 * Generate a From tag
 */
void generate_fromtag(str* tag, str* callid)
{
	     /* calculate from tag from callid */
	crcitt_string_array(&from_tag[MD5_LEN + 1], callid, 1);
	tag->s = from_tag; 
	tag->len = FROM_TAG_LEN;
}
Пример #2
0
static void generate_tag(str* tag, str* src, str* callid)
{
	int len;

	MD5StringArray(from_tag, src, 1);
	len = MD5_LEN;

	/* calculate from tag from callid */
	if(callid)
	{
		from_tag[len++] = '-';
		crcitt_string_array(&from_tag[MD5_LEN + 1], callid, 1);
		len+= CRC16_LEN;
	}
	tag->s = from_tag;
	tag->len = len;
	LM_DBG("from_tag = %.*s\n", tag->len, tag->s);
}