Wash and pressure cook the dal with 1 cup water and a pinch of turmeric powder. Mash well and set aside.
In a pan, add all ingredients except coconut and roast till dal turns golden. Add coconut and stir for a minute. Cool and grind to a smooth paste with little water.
Soak the tamarind in 2 cups of warm water and extract the tamarind juice. If using tamarind paste, dissolve in 2 cups warm water.
Add this tamarind water to a vessel, along with tomato, turmeric powder, asafoetida, few curry leaves, salt and 1 cup water. Bring to boil.
Once it comes boil, reduce the heat to low and let it simmer for 8-10 minutes or until the tomatoes have become soft.
Add the ground paste, jaggery and simmer again for 4-5 minutes. Then add the cooked dal and adjust the salt.
Simmer till the rasam starts to froth up. Remove from heat and add the coriander leaves.
In a small pan, heat ghee and add mustard seeds. When it splutters, add red chilly, jeera and curry leaves. Pour over the rasam.