add: PROTO_UDP,
context: static int m_store(struct sip_msg* msg, char* str1, char* str2){	str body, str_hdr, sruri, ctaddr;	struct to_body to, *pto, *pfrom;	db_key_t db_keys[NR_KEYS];	db_val_t db_vals[NR_KEYS];	int nr_keys = 0, val, lexpire;	t_content_type ctype;	char buf[512], buf1[1024], *p;	DBG("MSILO: m_store: ------------ start ------------\n");			// extract message body - after that whole SIP MESSAGE is parsed	/* get the message's body */	body.s = get_body( msg );	if (body.s==0) 	{		LOG(L_ERR,"MSILO:m_store: ERROR cannot extract body from msg\n");		goto error;	}		/* content-length (if present) must be already parsed */	if (!msg->content_length) 	{		LOG(L_ERR,"MSILO:m_store: ERROR no Content-Length header found!\n");		goto error;	}	body.len = get_content_length( msg );	// check if the body of message contains something	if(body.len <= 0)	{		DBG("MSILO: m_store: body of the message is empty!\n");		goto error;	}		// check TO header	if(!msg->to || !msg->to->body.s)	{		DBG("MSILO: m_store: cannot find 'to' header!\n");		goto error;	}	if(msg->to->parsed != NULL)	{		pto = (struct to_body*)msg->to->parsed;		DBG("MSILO:m_store: 'To' header ALREADY PARSED: <%.*s>\n",			pto->uri.len, pto->uri.s );		}	else	{		DBG("MSILO:m_store: 'To' header NOT PARSED ->parsing ...\n");		memset( &to , 0, sizeof(to) );		parse_to(msg->to->body.s, msg->to->body.s+msg->to->body.len+1, &to);		if(to.uri.len > 0) // && to.error == PARSE_OK)		{			DBG("MSILO:m_store: 'To' parsed OK <%.*s>.\n", 				to.uri.len, to.uri.s);			pto = &to;		}		else		{			DBG("MSILO:m_store: ERROR 'To' cannot be parsed\n");			goto error;		}	}		if(pto->uri.len == reg_addr.len && 			!strncasecmp(pto->uri.s, reg_addr.s, reg_addr.len))	{		DBG("MSILO:m_store: message to MSILO REGISTRAR!\n");		goto error;	}	db_keys[nr_keys] = DB_KEY_TO;		db_vals[nr_keys].type = DB_STR;	db_vals[nr_keys].nul = 0;	db_vals[nr_keys].val.str_val.s = pto->uri.s;	db_vals[nr_keys].val.str_val.len = pto->uri.len;	nr_keys++;	// check FROM header	if(!msg->from || !msg->from->body.s)	{		DBG("MSILO:m_store: ERROR cannot find 'from' header!\n");		goto error;	}	if(msg->from->parsed != NULL)		DBG("MSILO:m_store: 'From' header ALREADY PARSED\n");		else	{		DBG("MSILO:m_store: 'From' header NOT PARSED\n");		/* parsing from header */		if ( parse_from_header( msg )==-1 ) 		{			DBG("MSILO:m_store: ERROR cannot parse FROM header\n");			goto error;		}	}	pfrom = (struct to_body*)msg->from->parsed;	DBG("MSILO:m_store: 'From' header: <%.*s>\n",pfrom->uri.len,pfrom->uri.s);			if(reg_addr.s && pfrom->uri.len == reg_addr.len && 			!strncasecmp(pfrom->uri.s, reg_addr.s, reg_addr.len))	{		DBG("MSILO:m_store: message from MSILO REGISTRAR!\n");		goto error;	}	db_keys[nr_keys] = DB_KEY_FROM;		db_vals[nr_keys].type = DB_STR;	db_vals[nr_keys].nul = 0;	db_vals[nr_keys].val.str_val.s = pfrom->uri.s;	db_vals[nr_keys].val.str_val.len = pfrom->uri.len;	nr_keys++;	// chech for RURI	sruri.len = 0;	if(msg->new_uri.len > 0)	{		DBG("MSILO:m_store: NEW R-URI found - check if is AoR!\n");		p = msg->new_uri.s;		while((p < msg->new_uri.s+msg->new_uri.len) && *p!='@')			p++;		if(p < msg->new_uri.s+msg->new_uri.len && p > msg->new_uri.s)		{			DBG("MSILO:m_store: NEW R-URI used\n");			sruri.s = msg->new_uri.s;			sruri.len = msg->new_uri.len;		}	}		if(sruri.len == 0 && msg->first_line.u.request.uri.len > 0 )	{		DBG("MSILO:m_store: R-URI found - check if is AoR!\n");		p = msg->first_line.u.request.uri.s;		while((p < msg->first_line.u.request.uri.s+				msg->first_line.u.request.uri.len) && *p!='@')			p++;		if(p<msg->first_line.u.request.uri.s+msg->first_line.u.request.uri.len			&& p > msg->first_line.u.request.uri.s)		{			DBG("MSILO:m_store: R-URI used\n");			sruri.s = msg->first_line.u.request.uri.s;			sruri.len = msg->first_line.u.request.uri.len;		}	}		if (sruri.len == 0)	{		DBG("MSILO:m_store: TO used as R-URI\n");		sruri.s = pto->uri.s;		sruri.len = pto->uri.len;	}		db_keys[nr_keys] = DB_KEY_RURI;		db_vals[nr_keys].type = DB_STR;	db_vals[nr_keys].nul = 0;	db_vals[nr_keys].val.str_val.s = sruri.s;	db_vals[nr_keys].val.str_val.len = sruri.len;	nr_keys++;	/* add the message's body in SQL query */		db_keys[nr_keys] = DB_KEY_BODY;		db_vals[nr_keys].type = DB_BLOB;	db_vals[nr_keys].nul = 0;	db_vals[nr_keys].val.blob_val.s = body.s;	db_vals[nr_keys].val.blob_val.len = body.len;	nr_keys++;		lexpire = expire_time;	// add 'content-type'	/* parse the content-type header */	if (parse_content_type_hdr(msg)==-1 ) 	{		LOG(L_ERR,"MSILO:m_store: ERROR cannot parse Content-Type header\n");		goto error;	}	/** check the content-type value */	if(msg->content_type && msg->content_type->body.len > 0		&& get_content_type(msg)!=CONTENT_TYPE_TEXT_PLAIN		&& get_content_type(msg)!=CONTENT_TYPE_MESSAGE_CPIM )	{		if(m_extract_content_type(msg->content_type->body.s, 				msg->content_type->body.len, &ctype, CT_TYPE) != -1)		{			DBG("MSILO:m_store: 'content-type' found\n");			db_keys[nr_keys] = DB_KEY_CTYPE;			db_vals[nr_keys].type = DB_STR;			db_vals[nr_keys].nul = 0;			db_vals[nr_keys].val.str_val.s = ctype.type.s;			db_vals[nr_keys].val.str_val.len = ctype.type.len;			nr_keys++;		}	}	// check 'expires'	// no more parseing - already done by get_body()	// if(parse_headers(msg, HDR_EXPIRES,0)!=-1)	if(msg->expires && msg->expires->body.len > 0)	{		DBG("MSILO:m_store: 'expires' found\n");		val = atoi(msg->expires->body.s);		if(val > 0)			lexpire = (expire_time<=val)?expire_time:val;	}	/** current time */	val = (int)time(NULL);		/** add expiration time */	db_keys[nr_keys] = DB_KEY_EXP_TIME;	db_vals[nr_keys].type = DB_INT;	db_vals[nr_keys].nul = 0;	db_vals[nr_keys].val.int_val = val+lexpire;	nr_keys++;	/** add incoming time */	db_keys[nr_keys] = DB_KEY_INC_TIME;	db_vals[nr_keys].type = DB_INT;	db_vals[nr_keys].nul = 0;	db_vals[nr_keys].val.int_val = val;	nr_keys++;	if(db_insert(db_con, db_keys, db_vals, nr_keys) < 0)	{		LOG(L_ERR, "MSILO:m_store: error storing message\n");		goto error;	}	DBG("MSILO:m_store: message stored. T:<%.*s> F:<%.*s>\n",		pto->uri.len, pto->uri.s, pfrom->uri.len, pfrom->uri.s);	if(reg_addr.len > 0 && reg_addr.len+33+2*CRLF_LEN < 1024)	{		DBG("MSILO:m_store: sending info message.\n");		strcpy(buf1,"Content-Type: text/plain"CRLF"Contact: ");		str_hdr.len = 24 + CRLF_LEN + 9;		strncat(buf1,reg_addr.s,reg_addr.len);		str_hdr.len += reg_addr.len;		strcat(buf1, CRLF);		str_hdr.len += CRLF_LEN;		str_hdr.s = buf1;			strncpy(buf, "User [", 6);		body.len = 6;		if(pto->uri.len+75 < 512)		{			strncpy(buf+body.len, pto->uri.s, pto->uri.len);			body.len += pto->uri.len;		}		strncpy(buf+body.len, " is offline.", 12);		body.len += 12;		strncpy(buf+body.len, " The message will be delivered", 30);		body.len += 30;		strncpy(buf+body.len, " when user goes online.", 23);		body.len += 23;		body.s = buf;		// look for Contact header		ctaddr.s = NULL;		if(parse_headers(msg,HDR_CONTACT,0)!=-1 && msg->contact 				&& msg->contact->body.s && msg->contact->body.len>0)		{			ctaddr.s = msg->contact->body.s;			ctaddr.len = msg->contact->body.len;			while((*(ctaddr.s)==' ' || *(ctaddr.s)=='\t' || *(ctaddr.s)=='<')					&& ctaddr.len>0)			{				ctaddr.s++;				ctaddr.len--;			}			p = ctaddr.s;			while(p<ctaddr.s+ctaddr.len && *p!='>')					p++;			if(p<ctaddr.s+ctaddr.len)				ctaddr.len = p-ctaddr.s;			DBG("MSILO:m_store: contact [%.*s]\n",ctaddr.len,ctaddr.s);		}				// tmb.t_uac(&msg_type,&pfrom->uri,&str_hdr,&body,&reg_addr,0,0,0);		tmb.t_uac_dlg(&msg_type,  /* Type of the message */				(ctaddr.s)?&ctaddr:0,              /* Real destination */				(ctaddr.s)?&ctaddr:&pfrom->uri,    /* Request-URI */				&pfrom->uri,      /* To */				&reg_addr,        /* From */				NULL,             /* To tag */				NULL,             /* From tag */				NULL,             /* CSeq */				NULL,             /* Call-ID */				&str_hdr,         /* Optional headers including CRLF */				&body,            /* Message body */				NULL,             /* Callback function */				NULL              /* Callback parameter */			);	}		return 1;error:	return -1;}