Measuring concurrent call per sip trunk

Hi there! I need to measure the amount of concurrent call through a sip trunk. I know that the “core show calls or channels” command displays the number of active channels, but it measures the total of the active and cumulative processed calls in the system. Any idea to get these numbers (active and processed call per sip trunk)?

You can use the GROUP function and GROUP_COUNT to do this.

In your inbound and outbound dialplan where you send and recieve calls to this trunk tag the calls and output the count as needed.

exten => _X.,n,Set(GROUP(CallLimit)=TRUNK1)
exten => _X.,n,Log(NOTICE,TRUNK1 Call Count is ${GROUP_COUNT(TRUNK1@CallLimit)})

Thanks for your reply, I will try it. Regards!