Finding out which extensions belongs to a Callgroup


I’m trying to figure out a way to get the information of which extensions belongs to a group.
Is there a way to do it without checking for each and every extension ‘Callgroup’ item using, let’s say, “sip show peer XXXX”?

I can’t think of an easy way to do the other way around.

I made a shellscript that generates a text files with the Callgroups info, but I hope there’s a more elegant way.

Any ideas?

Thank you.