e->command = "core show channels [concise|verbose|count]"; e->usage "Usage: core show channels [concise|verbose|count]\n" " Lists currently defined channels and some information about them. If\n" " 'concise' is specified, the format is abridged and in a more easily\n" " machine parsable format. If 'verbose' is specified, the output includes\n" " more and longer fields. If 'count' is specified only the channel and call\n" " count is output.\n" " The 'concise' option is deprecated and will be removed from future versions\n" " of Asterisk.\n"; return NULL; case CLI_GENERATE: return NULL; } if (a->argc == e->args) { if (!strcasecmp(a->argv[e->args-1],"concise")) concise = 1; else if (!strcasecmp(a->argv[e->args-1],"verbose")) verbose = 1; else if (!strcasecmp(a->argv[e->args-1],"count")) count = 1; else return CLI_SHOWUSAGE; } else if (a->argc != e->args - 1) return CLI_SHOWUSAGE; if (!count) { if (!concise && !verbose) ast_cli(a->fd, FORMAT_STRING2, "Channel", "Location", "State", "Application(Data)"); else if (verbose) ast_cli(a->fd, VERBOSE_FORMAT_STRING2, "Channel", "Context", "Extension", "Priority", "State", "Application", "Data", "CallerID", "Duration", "Accountcode", "PeerAccount", "BridgedTo"); } From: asterisk-users-bounces at lists.digium.com [mailto:asterisk-users-bounces at lists.digium.com] On Behalf Of Bryant Zimmerman Sent: Tuesday, January 24, 2012 4:29 PM To: asterisk-users at lists.digium.com Subject: Re: [asterisk-users] Is there a sip show equivelant. Is there a way to get a parsable concise feed back from the "sip show peers" command that is more like the "core show channels concise" command The issue is the sip show peers uses space delimiter to display the the list but some feilds have values some times and not others. If not what is the exact character count for each column so I can pull back the data that way. Also I have been looking through the code trying to figure out exactly wich fileds are present in the "core show channels concise" command. It appears that they are different from the "core show channels verbose" command. What are the exact fields in the "core show channels concise" and why is there no duration? Thanks Bryant ------=_NextPart_000_01A2_01CCDAB7.A3B76FC0 Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: quoted-printable <html xmlns:v=3D"urn:schemas-microsoft-com:vml" xmlns:o=3D"urn:schemas-microsoft-com:office:office" xmlns:w=3D"urn:schemas-microsoft-com:office:word" xmlns:m=3D"http://schemas.microsoft.com/office/2004/12/omml" xmlns=3D"http://www.w3.org/TR/REC-html40"><head><meta http-equiv=3DContent-Type content=3D"text/html; charset=3Dus-ascii"><meta name=3DGenerator content=3D"Microsoft Word 14 (filtered medium)"><style><!-- /* Font Definitions */ @font-face {font-family:Calibri; panose-1:2 15 5 2 2 2 4 3 2 4;} @font-face {font-family:Tahoma; panose-1:2 11 6 4 3 5 4 4 2 4;} /* Style Definitions */ p.MsoNormal, li.MsoNormal, div.MsoNormal {margin:0in; margin-bottom:.0001pt; font-size:12.0pt; font-family:"Times New Roman","serif";} a:link, span.MsoHyperlink {mso-style-priority:99; color:blue; text-decoration:underline;} a:visited, span.MsoHyperlinkFollowed {mso-style-priority:99; color:purple; text-decoration:underline;} span.EmailStyle17 {mso-style-type:personal-reply; font-family:"Calibri","sans-serif"; color:#1F497D;} .MsoChpDefault {mso-style-type:export-only; font-family:"Calibri","sans-serif";} @page WordSection1 {size:8.5in 11.0in; margin:1.0in 1.0in 1.0in 1.0in;} div.WordSection1 {page:WordSection1;} --></style><!--[if gte mso 9]><xml> <o:shapedefaults v:ext=3D"edit" spidmax=3D"1026" /> </xml><![endif]--><!--[if gte mso 9]><xml> <o:shapelayout v:ext=3D"edit"> <o:idmap v:ext=3D"edit" data=3D"1" /> </o:shapelayout></xml><![endif]--></head><body lang=3DEN-US link=3Dblue vlink=3Dpurple><div class=3DWordSection1><p class=3DMsoNormal><span style=3D'font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>Question 1 – no <o:p></o:p></span></p><p class=3DMsoNormal><span style=3D'font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>The format is this<o:p></o:p></span></p><p class=3DMsoNormal><span style=3D'font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>#define FORMAT2 "%-25.25s %-39.39s %-3.3s %-10.10s %-3.3s %-8s %-11s %-32.32s %s\n"<o:p></o:p></span></p><p class=3DMsoNormal><span style=3D'font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p> </o:p></span></p><p class=3DMsoNormal><span style=3D'font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>Question 2<o:p></o:p></span></p><p class=3DMsoNormal><span style=3D'font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>debsphone2*CLI> core show channels concise<o:p></o:p></span></p><p class=3DMsoNormal><span style=3D'font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>SIP/1104-0000051b!default!99!2!Up!Playback!tt-monkeys!1104!!!3!3!(None)!1327444435.1307<o:p></o:p></span></p><p class=3DMsoNormal><span style=3D'font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>debsphone2*CLI> core show channels verbose<o:p></o:p></span></p><p class=3DMsoNormal><span style=3D'font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>Channel Context Extension Prio State Application Data CallerID Duration Accountcode PeerAccount BridgedTo<o:p></o:p></span></p><p class=3DMsoNormal><span style=3D'font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>SIP/1104-0000051b default 99 2 Up Playback tt-monkeys 1104 00:00:08 (None)<o:p></o:p></span></p><p class=3DMsoNormal><span style=3D'font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>1 active channel<o:p></o:p></span></p><p class=3DMsoNormal><span style=3D'font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>1 active call<o:p></o:p></span></p><p class=3DMsoNormal><span style=3D'font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p> </o:p></span></p><p class=3DMsoNormal><span style=3D'font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'>From cli.c (asterisk 10)<o:p></o:p></span></p><p class=3DMsoNormal><span style=3D'font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'> e->command =3D "core show channels [concise|verbose|count]";<o:p></o:p></span></p><p class=3DMsoNormal><span style=3D'font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'> e->usage =3D<o:p></o:p></span></p><p class=3DMsoNormal><span style=3D'font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'> "Usage: core show channels [concise|verbose|count]\n"<o:p></o:p></span></p><p class=3DMsoNormal><span style=3D'font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'> " Lists currently defined channels and some information about them. If\n"<o:p></o:p></span></p><p class=3DMsoNormal><span style=3D'font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'> " 'concise' is specified, the format is abridged and in a more easily\n"<o:p></o:p></span></p><p class=3DMsoNormal><span style=3D'font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'> " machine parsable format. If 'verbose' is specified, the output includes\n"<o:p></o:p></span></p><p class=3DMsoNormal><span style=3D'font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'> " more and longer fields. If 'count' is specified only the channel and call\n"<o:p></o:p></span></p><p class=3DMsoNormal><span style=3D'font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'> " count is output.\n"<o:p></o:p></span></p><p class=3DMsoNormal><span style=3D'font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'> " The 'concise' option is deprecated and will be removed from future versions\n"<o:p></o:p></span></p><p class=3DMsoNormal><span style=3D'font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'> " of Asterisk.\n";<o:p></o:p></span></p><p class=3DMsoNormal><span style=3D'font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'> return NULL;<o:p></o:p></span></p><p class=3DMsoNormal><span style=3D'font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p> </o:p></span></p><p class=3DMsoNormal><span style=3D'font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'> case CLI_GENERATE:<o:p></o:p></span></p><p class=3DMsoNormal><span style=3D'font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'> return NULL;<o:p></o:p></span></p><p class=3DMsoNormal><span style=3D'font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'> }<o:p></o:p></span></p><p class=3DMsoNormal><span style=3D'font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p> </o:p></span></p><p class=3DMsoNormal><span style=3D'font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'> if (a->argc =3D=3D e->args) {<o:p></o:p></span></p><p class=3DMsoNormal><span style=3D'font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'> if (!strcasecmp(a->argv[e->args-1],"concise"))<o:p></o:p></span></p><p class=3DMsoNormal><span style=3D'font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'> concise =3D 1;<o:p></o:p></span></p><p class=3DMsoNormal><span style=3D'font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'> else if (!strcasecmp(a->argv[e->args-1],"verbose"))<o:p></o:p></span></p><p class=3DMsoNormal><span style=3D'font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'> verbose =3D 1;<o:p></o:p></span></p><p class=3DMsoNormal><span style=3D'font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'> else if (!strcasecmp(a->argv[e->args-1],"count"))<o:p></o:p></span></p><p class=3DMsoNormal><span style=3D'font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'> count =3D 1;<o:p></o:p></span></p><p class=3DMsoNormal><span style=3D'font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'> else<o:p></o:p></span></p><p class=3DMsoNormal><span style=3D'font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'> return CLI_SHOWUSAGE;<o:p></o:p></span></p><p class=3DMsoNormal><span style=3D'font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'> } else if (a->argc !=3D e->args - 1)<o:p></o:p></span></p><p class=3DMsoNormal><span style=3D'font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'> return CLI_SHOWUSAGE;<o:p></o:p></span></p><p class=3DMsoNormal><span style=3D'font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p> </o:p></span></p><p class=3DMsoNormal><span style=3D'font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'> if (!count) {<o:p></o:p></span></p><p class=3DMsoNormal><span style=3D'font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'> if (!concise && !verbose)<o:p></o:p></span></p><p class=3DMsoNormal><span style=3D'font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'> ast_cli(a->fd, FORMAT_STRING2, "Channel", "Location", "State", "Application(Data)");<o:p></o:p></span></p><p class=3DMsoNormal><span style=3D'font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'> else if (verbose)<o:p></o:p></span></p><p class=3DMsoNormal><span style=3D'font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'> ast_cli(a->fd, VERBOSE_FORMAT_STRING2, "Channel", "Context", "Extension", "Priority", "State", "Application", "Data",<o:p></o:p></span></p><p class=3DMsoNormal><span style=3D'font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'> "CallerID", "Duration", "Accountcode", "PeerAccount", "BridgedTo");<o:p></o:p></span></p><p class=3DMsoNormal><span style=3D'font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'> }<o:p></o:p></span></p><p class=3DMsoNormal><span style=3D'font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D'><o:p> </o:p></span></p><p class=3DMsoNormal><b><span style=3D'font-size:10.0pt;font-family:"Tahoma","sans-serif"'>From:</span></b><span style=3D'font-size:10.0pt;font-family:"Tahoma","sans-serif"'> asterisk-users-bounces at lists.digium.com [mailto:asterisk-users-bounces at lists.digium.com] <b>On Behalf Of </b>Bryant Zimmerman<br><b>Sent:</b> Tuesday, January 24, 2012 4:29 PM<br><b>To:</b> asterisk-users at lists.digium.com<br><b>Subject:</b> Re: [asterisk-users] Is there a sip show equivelant.<o:p></o:p></span></p><p class=3DMsoNormal><o:p> </o:p></p><p class=3DMsoNormal style=3D'margin-bottom:12.0pt'><span style=3D'font-size:10.0pt;font-family:"Arial","sans-serif"'>Is there a way to get a parsable concise feed back from the "sip show peers" command that is more like the "core show channels concise" command The issue is the sip show peers uses space delimiter to display the the list but some feilds have values some times and not others. If not what is the exact character count for each column so I can pull back the data that way. <br><br>Also I have been looking through the code trying to figure out exactly wich fileds are present in the "core show channels concise" command. It appears that they are different from the "core show channels verbose" command. What are the exact fields in the "core show channels concise" and why is there no duration?<o:p></o:p></span></p><div><p class=3DMsoNormal><span style=3D'font-size:10.0pt;font-family:"Arial","sans-serif"'>Thanks<br><br>Bryant<o:p></o:p></span></p></div></div></body></html> ------=_NextPart_000_01A2_01CCDAB7.A3B76FC0--