Heat the oil in a pan; add chana dal and stir till it becomes golden brown in color.
Add chopped onion, ginger, garlic, curry leaves, red chilies, asafoetida and fry for a few minutes, and then add the chopped tomatoes and fry for about 5 minutes to soften them.
Remove from the flame and allow cooling.
Put the tomato mixture in a blender; add salt,sugar and then grind to make smooth paste.
Prepare the tempering by heating the oil in a small pan and then add mustard seeds,urad dal red chilies,curry leaves and fry it till seeds crackle.
Pour the tempering over the chutney and mix well. Serve with Idli, dosa.