rem: if (_tag->len) { if (str_duplicate(&res->id.loc_tag, _tag) < 0) { free_dlg(res); return -5; }
add: tag.s = tm_tags; tag.len = TOTAG_VALUE_LEN; calc_crc_suffix(_req, tm_tag_suffix); if (str_duplicate(&res->id.loc_tag, &tag) < 0) { free_dlg(res); return -5;
context: int new_dlg_uas(struct sip_msg* _req, int _code, str* _tag, dlg_t** _d){	dlg_t* res;	if (!_req || !_tag || !_d) {		LOG(L_ERR, "new_dlg_uas(): Invalid parameter value\n");		return -1;	}	if ((_code < 200) || (_code > 299)) {		DBG("new_dlg_uas(): Not a 2xx, no dialog created\n");		return -2;	}	res = (dlg_t*)shm_malloc(sizeof(dlg_t));	if (res == 0) {		LOG(L_ERR, "new_dlg_uac(): No memory left\n");		return -3;	}	     /* Clear everything */	memset(res, 0, sizeof(dlg_t));		if (request2dlg(_req, res) < 0) {		LOG(L_ERR, "new_dlg_uas(): Error while converting request to dialog\n");		return -4;	}	if (_tag->len) {		if (str_duplicate(&res->id.loc_tag, _tag) < 0) {			free_dlg(res);			return -5;		}	}		*_d = res;	(*_d)->state = DLG_CONFIRMED;	if (calculate_hooks(*_d) < 0) {		LOG(L_ERR, "new_dlg_uas(): Error while calculating hooks\n");		shm_free(*_d);		return -6;	}	return 0;}