Question 1 - no 

The format is this

#define FORMAT2 "%-25.25s %-39.39s %-3.3s %-10.10s %-3.3s %-8s %-11s
%-32.32s %s\n"

 

Question 2

debsphone2*CLI> core show channels concise

SIP/1104-0000051b!default!99!2!Up!Playback!tt-monkeys!1104!!!3!3!(None)!1327
444435.1307

debsphone2*CLI> core show channels verbose

Channel              Context              Extension        Prio State
Application  Data                      CallerID        Duration Accountcode
PeerAccount BridgedTo

SIP/1104-0000051b    default              99                  2 Up
Playback     tt-monkeys                1104            00:00:08
(None)

1 active channel

1 active call

 

>From cli.c (asterisk 10)

            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: [email protected]
[mailto:[email protected]] On Behalf Of Bryant
Zimmerman
Sent: Tuesday, January 24, 2012 4:29 PM
To: [email protected]
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

--
_____________________________________________________________________
-- Bandwidth and Colocation Provided by http://www.api-digital.com --
New to Asterisk? Join us for a live introductory webinar every Thurs:
               http://www.asterisk.org/hello

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users

Reply via email to