Hello,
I would like to suggest you an implementation of the rpc command dlg.profile_get_size (on a valued profile) that would return a list of values and the number of current dialogs for any of them . This could be usefull if you want to get stats per customer_id/trunks/ips or whatever and don't want to get the whole table but only the size.
Regards, David