Parsing ISUP message type (IAM, ACM, REL, etc...)

Hi all,

can anyone tell, is there any possibility in asterisk to capture the ISUP message type (ACM, ANM, REL, etc) in a variable so it would be possible to take an action later based on what type is it?

Here we have a task: asterisk with libss7 dials a subscriber sending IAM message type to the other end and as soon as it receives back ACM it should release the call.

How is possible to capture the ACM message and release the call?

Thanks ahead.