Hello Ionut,
writing also via email and sr-dev, just in case you are not receiving the github notification, as I mentioned you on the issue:
* https://github.com/kamailio/kamailio/issues/1955
As I went through the code, It seemed that trace type (per message, transaction or dialog) was not used for KEMI function. I pushed a patch, it would be good that you take a look and eventually test and see if works as expected.
Furthermore, I noticed linking local variables to a shared memory structure. I made some notes on the github.
Let's discuss further via the github portal, the message here being sent to make you aware.
Cheers, Daniel