Asterisk SS7 event handling

Hi All,

In asterisk we are looking for a way to work on SS7 events and with work I mean performing different tasks on particular events.
Say on asterisk I get a call on extension 100, so for this I may receive events ‘IAM’ and it starts ringing on my asterisk flow so before this call gets picked by dial plan I need to perform some db query say fetch some details about the calling party number and after some processing carry on to ACM and ANM events and once calling party releases the call, before raising releasing event perform some query and on release set release cause and disconnect.

thanks in advance…