As an alternative to get the stats of active dialogs, I added an rpc command that scans the internal dialog hash table:
* https://github.com/kamailio/kamailio/commit/ebb149066690f7d96f45e1639e0c5ca9...
It is slightly slower, given the scan in real time, that the stats using the core counters, but should be fast enough not to affect the performances.
It can be used to compare the results eventually and detect when an anomaly in the counter based stats happen.