*CLI> help core show channel
Usage: core show channel <channel>
Shows lots of information about the specified channel.
*CLI>
*CLI> core show channels
Channel Location State Application(Data)
PJSIP/flowroute-0000 1xxxxxxxxxx@from-tru Up Read(digit,custom/no-solicitor
1 active channel
1 active call
11 calls processed
*CLI> core show channel PJSIP/flowroute-0000
PJSIP/flowroute-0000 is not a known channel
*CLI> core show channel PJSIP/flowroute
PJSIP/flowroute is not a known channel
*CLI> core show channel PJSIP
PJSIP is not a known channel
*CLI> core show channel flowroute
flowroute is not a known channel
*CLI> core show channel 0000
0000 is not a known channel
*CLI> core show channel flowroute-0000
flowroute-0000 is not a known channel
The channel displays as “PJSIP/flowroute-0000”
How do I get the channel detail?
*CLI> core show channels concise
PJSIP/flowroute-00000018!from-trunk!1xxxxxxxxxx!19!Up!Read!digit,custom/no-solicitors,1!+1xxxmylandline!!!3!25!!1711399185.41
*CLI> core show channel PJSIP/flowroute-00000018
*..detail provided via console, as expected...*
core show channels concise worked!
It also says “concise” is depreciated which I am sure you know.
Is core show channels concise really being deprecated?!? Pity, because it is handy for returning channel details in an easily parseable format. Here is a Python function for creating a list of dicts, each containing the info for one currently existing channel:
async def get_channels(self) :
"gets information on all currently-existing channels."
result = []
fields = \
(
"channel",
"context",
"exten",
"prio",
"state",
"appl",
"data",
"cid",
"accountcode",
"amaflags",
"duration",
"bridged_context",
)
response = await self.do_command("core show channels concise").split("\012")
for line in response :
line = line.split("!")
if len(line) >= len(fields) :
result.append(dict(zip(fields, line)))
#end if
#end for
return result
#end get_channels