Any idea how to detect silence in SIP channel?

I have extension that is connected with other extension how to detect silence in this channel by program or script?

I know I can use a spy channel but it is a human work - any idea how to detect it automatically?

Any idea how to detect silence in SIP channel?