Soak rajma overnight. Drain and add it to pressure cooker. Cover with water. Pressure cook for 3 to 4 whistle, simmer for 10 mins. Turn off the heat and let the steam escape all by itself.
Take onions, tomatoes and ginger in a blender. Puree till smooth.
Heat oil in a kadai. Add whole spices and let them sizzle.
Add in pureed masala and mix well.
Cook that for few mins till the raw smell leaves from it.