There are a number of ways to do this. But perhaps the simplest would be:
event manager applet get-voice-info
event none
action 001 cli command "enable"
action 002 cli command "show voice port summary"
action 003 puts $_cli_result
action 004 cli command "show call active voice compact"
action 005 puts $_cli_result
Run this with:
event manager run get-voice-info