FSK tone generation and comparision

I am working on a project using Asterisk. I have configured asterisk and the basic requirements of my project are now fulfilled. Now I have another problem. I have to generate FSK Tone and play it on the phone of caller. And somehow, I will recieve that tone back to my system and then I have to compare that FSK tone with the original. Is there any way to generate the FSK tone and then compare it.
Atif Majid