How to run a custom script after begining of conversation?

How to run a custom script after begining of conversation in FreePBX 12? I need to execute some bash script everytime when conversation begins between 2 users. For example I want to send messages via RabbitMQ to my custom application or somthing other. Is there some way to do this?