Discussion:
[asterisk-users] AMI column widths
Antony Stone
2017-07-07 21:30:19 UTC
Permalink
Hi.

I'm trying to get a list of the channels currently in use on an Asterisk server (1.8.32.1 if it matters) over AMI.

I send the command "sip show channels", and I get back a response along the lines of (* used to protect the innocent...):

Peer User/ANR Call ID Format Hold Last Message Expiry Peer
*8.22.*0.34 02035644444 0221e874158bb62 0x4 (ulaw) No Tx: ACK SIPtrunkNu
*.1*.19.70 (None) 2021549013484-1 0x0 (nothing) No Rx: OPTIONS <guest>
*.34.*.208 200101 ***@192.1 0x4 (ulaw) No Rx: ACK 200101
*.1*.19.70 (None) 149831567021051 0x0 (nothing) No Rx: REGISTER <guest>

So, firstly, the "Call ID" column is clearly truncated, because it should show more than is indicated above,
but more importantly for me, the "Peer" column is truncated, and what should show as "SIPtrunkNumber8"
is only shown as "SIPtrunkNu".

How can I get the full column widths of these items shown in the output?

Note that it is not a solution just to say "don't call it 'SIPtrunkNumber8'; call it 'SIPtrunk8' instead", because
this name has also been modified slightly to conceal the real name of the trunk, which is actually longer
than "SIPtrunkNo8", but still with the most important information at the end.

What I'm looking for is how to get the *full* details of all the channels shown.

I have checked, and there is no "verbose" option to the "sip show channels" command.


Thanks,


Antony.
--
Ramdisk is not an installation procedure.

Please reply to the list;
please *don't* CC me.
--
_____________________________________________________________________
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

Check out the new Asterisk community forum at: https://community.asterisk.org/

New to Asterisk? Start here:
https://wiki.asterisk.org/wiki/display/AST/Getting+Started

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
http://lists.digium.com/mailman/listinfo/asterisk-users
Steve Edwards
2017-07-07 22:01:37 UTC
Permalink
Post by Antony Stone
I'm trying to get a list of the channels currently in use on an Asterisk
server (1.8.32.1 if it matters) over AMI.
Would the AMI 'CoreShowChannel' or the CLI 'core show channels concise'
commands help?
--
Thanks in advance,
-------------------------------------------------------------------------
Steve Edwards ***@sedwards.com Voice: +1-760-468-3867 PST
https://www.linkedin.com/in/steve-edwards-4244281
--
_____________________________________________________________________
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

Check out the new Asterisk community forum at: https://community.asterisk.org/

New to Asterisk? Start here:
https://wiki.asterisk.org/wiki/display/AST/Getting+Started

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
http://lists.digium.com/mailman/listinfo/asterisk-users
Marcelo Terres
2017-07-08 05:15:08 UTC
Permalink
There are no sip show channels on AMI. Also, the output that you sent is
not a AMI output. Are u using AMI ou running commands on console?

Running commands on console and parsing the output is the worst way to
obtain data, first because it is not easily parseable.

Second, it doesn't show you all data.

Third, you can have these truncate problems, because that's not intention
of CLI.

Using proper AMI Actions you will probably achieve your goals

https://wiki.asterisk.org/wiki/display/AST/AMI+Actions

Regards,


On 7 Jul 2017 10:32 pm, "Antony Stone" <***@asterisk.open.source.it>
wrote:

Hi.

I'm trying to get a list of the channels currently in use on an Asterisk
server (1.8.32.1 if it matters) over AMI.

I send the command "sip show channels", and I get back a response along the
lines of (* used to protect the innocent...):

Peer User/ANR Call ID Format Hold
Last Message Expiry Peer
*8.22.*0.34 02035644444 0221e874158bb62 0x4 (ulaw) No
Tx: ACK SIPtrunkNu
*.1*.19.70 (None) 2021549013484-1 0x0 (nothing) No
Rx: OPTIONS <guest>
*.34.*.208 200101 ***@192.1 0x4 (ulaw) No
Rx: ACK 200101
*.1*.19.70 (None) 149831567021051 0x0 (nothing) No
Rx: REGISTER <guest>

So, firstly, the "Call ID" column is clearly truncated, because it should
show more than is indicated above,
but more importantly for me, the "Peer" column is truncated, and what
should show as "SIPtrunkNumber8"
is only shown as "SIPtrunkNu".

How can I get the full column widths of these items shown in the output?

Note that it is not a solution just to say "don't call it
'SIPtrunkNumber8'; call it 'SIPtrunk8' instead", because
this name has also been modified slightly to conceal the real name of the
trunk, which is actually longer
than "SIPtrunkNo8", but still with the most important information at the
end.

What I'm looking for is how to get the *full* details of all the channels
shown.

I have checked, and there is no "verbose" option to the "sip show channels"
command.


Thanks,


Antony.

--
Ramdisk is not an installation procedure.

Please reply to the list;
please *don't* CC
me.

--
_____________________________________________________________________
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

Check out the new Asterisk community forum at: https://community.asterisk.
org/

New to Asterisk? Start here:
https://wiki.asterisk.org/wiki/display/AST/Getting+Started

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
http://lists.digium.com/mailman/listinfo/asterisk-users
Antony Stone
2017-07-08 08:16:19 UTC
Permalink
Post by Marcelo Terres
There are no sip show channels on AMI. Also, the output that you sent is
not a AMI output. Are u using AMI ou running commands on console?
I'm using AMI.

I have a connection to the Asterisk server on port 5038, initated with:

Action: Login
Username: xxxxx
Secret: yyyyy
Events: off

I receive back:

Response: Success
Message: Authentication accepted

I then issue:

Action: Command
Command: SIP show channels

and I get back:

Response: Follows
Privilege: Command
Peer User/ANR Call ID Format Hold
Last Message Expiry Peer

plus the data I quoted previously.
Post by Marcelo Terres
Running commands on console and parsing the output is the worst way to
obtain data, first because it is not easily parseable.
And also because it is very inefficient with connection setups, I believe.
Post by Marcelo Terres
Second, it doesn't show you all data.
Third, you can have these truncate problems, because that's not intention
of CLI.
Using proper AMI Actions you will probably achieve your goals
https://wiki.asterisk.org/wiki/display/AST/AMI+Actions
Hm, I don't see anything there which will give me a list of the SIP channels
currently in use - what command should I be using for that?


Thanks,


Antony.
Post by Marcelo Terres
Hi.
I'm trying to get a list of the channels currently in use on an Asterisk
server (1.8.32.1 if it matters) over AMI.
I send the command "sip show channels", and I get back a response along the
Peer User/ANR Call ID Format Hold
Last Message Expiry Peer
*8.22.*0.34 02035644444 0221e874158bb62 0x4 (ulaw) No
Tx: ACK SIPtrunkNu
*.1*.19.70 (None) 2021549013484-1 0x0 (nothing) No
Rx: OPTIONS <guest>
Rx: ACK 200101
*.1*.19.70 (None) 149831567021051 0x0 (nothing) No
Rx: REGISTER <guest>
So, firstly, the "Call ID" column is clearly truncated, because it should
show more than is indicated above,
but more importantly for me, the "Peer" column is truncated, and what
should show as "SIPtrunkNumber8"
is only shown as "SIPtrunkNu".
How can I get the full column widths of these items shown in the output?
Note that it is not a solution just to say "don't call it
'SIPtrunkNumber8'; call it 'SIPtrunk8' instead", because
this name has also been modified slightly to conceal the real name of the
trunk, which is actually longer
than "SIPtrunkNo8", but still with the most important information at the end.
What I'm looking for is how to get the *full* details of all the channels shown.
I have checked, and there is no "verbose" option to the "sip show channels" command.
Thanks,
Antony.
--
Having been asked for a reference for this man,
I can confirm that you will be very lucky indeed if you can get him to work for
you.

Please reply to the list;
please *don't* CC me.
--
_____________________________________________________________________
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

Check out the new Asterisk community forum at: https://community.asterisk.org/

New to Asterisk? Start here:
https://wiki.asterisk.org/wiki/display/AST/Getting+Started

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
http://lists.digium.com/mailman/listinfo/asterisk-users
Antony Stone
2017-07-08 08:25:37 UTC
Permalink
Post by Antony Stone
Post by Marcelo Terres
There are no sip show channels on AMI. Also, the output that you sent is
not a AMI output. Are u using AMI ou running commands on console?
I'm using AMI.
Action: Login
Username: xxxxx
Secret: yyyyy
Events: off
Response: Success
Message: Authentication accepted
Action: Command
Command: SIP show channels
Response: Follows
Privilege: Command
Peer User/ANR Call ID Format Hold
Last Message Expiry Peer
plus the data I quoted previously.
Post by Marcelo Terres
Running commands on console and parsing the output is the worst way to
obtain data, first because it is not easily parseable.
And also because it is very inefficient with connection setups, I believe.
Post by Marcelo Terres
Second, it doesn't show you all data.
Third, you can have these truncate problems, because that's not intention
of CLI.
Using proper AMI Actions you will probably achieve your goals
https://wiki.asterisk.org/wiki/display/AST/AMI+Actions
Hm, I don't see anything there which will give me a list of the SIP
channels currently in use - what command should I be using for that?
Hm, Action: CoreShowChannels looks like it can be made to work - it's not
specifically SIP, but I can parse that out of the channel name. Strange that
there is a DAHDIShowChannels command, and a CoreShowChannels, but no
SIPShowChannels..

If anyone has a better idea, please let me know...
Post by Antony Stone
Thanks,
Antony.
Post by Marcelo Terres
Hi.
I'm trying to get a list of the channels currently in use on an Asterisk
server (1.8.32.1 if it matters) over AMI.
I send the command "sip show channels", and I get back a response along
Peer User/ANR Call ID Format Hold
Last Message Expiry Peer
*8.22.*0.34 02035644444 0221e874158bb62 0x4 (ulaw) No
Tx: ACK SIPtrunkNu
*.1*.19.70 (None) 2021549013484-1 0x0 (nothing) No
Rx: OPTIONS <guest>
Rx: ACK 200101
*.1*.19.70 (None) 149831567021051 0x0 (nothing) No
Rx: REGISTER <guest>
So, firstly, the "Call ID" column is clearly truncated, because it should
show more than is indicated above,
but more importantly for me, the "Peer" column is truncated, and what
should show as "SIPtrunkNumber8"
is only shown as "SIPtrunkNu".
How can I get the full column widths of these items shown in the output?
Note that it is not a solution just to say "don't call it
'SIPtrunkNumber8'; call it 'SIPtrunk8' instead", because
this name has also been modified slightly to conceal the real name of the
trunk, which is actually longer
than "SIPtrunkNo8", but still with the most important information at the end.
What I'm looking for is how to get the *full* details of all the channels shown.
I have checked, and there is no "verbose" option to the "sip show channels" command.
Thanks,
Antony.
--
What do you get when you cross a joke with a rhetorical question?

Please reply to the list;
please *don't* CC me.
--
_____________________________________________________________________
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

Check out the new Asterisk community forum at: https://community.asterisk.org/

New to Asterisk? Start here:
https://wiki.asterisk.org/wiki/display/AST/Getting+Started

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
http://lists.digium.com/mailman/listinfo/asterisk-users
Marcelo Terres
2017-07-08 08:40:12 UTC
Permalink
You are using AMI to run CLI commands and that's the problem.

Try to use the equivalent AMI actions to get the information that you want.

My suggestion : get all channels in use (CoreShowChannels) and then filter
just the SIP, since there is not an action to do exactly what you need.
Post by Marcelo Terres
There are no sip show channels on AMI. Also, the output that you sent is
not a AMI output. Are u using AMI ou running commands on console?
I'm using AMI.

I have a connection to the Asterisk server on port 5038, initated with:

Action: Login
Username: xxxxx
Secret: yyyyy
Events: off

I receive back:

Response: Success
Message: Authentication accepted

I then issue:

Action: Command
Command: SIP show channels

and I get back:

Response: Follows
Privilege: Command
Peer User/ANR Call ID Format
Hold
Last Message Expiry Peer

plus the data I quoted previously.
Post by Marcelo Terres
Running commands on console and parsing the output is the worst way to
obtain data, first because it is not easily parseable.
And also because it is very inefficient with connection setups, I believe.
Post by Marcelo Terres
Second, it doesn't show you all data.
Third, you can have these truncate problems, because that's not intention
of CLI.
Using proper AMI Actions you will probably achieve your goals
https://wiki.asterisk.org/wiki/display/AST/AMI+Actions
Hm, I don't see anything there which will give me a list of the SIP channels
currently in use - what command should I be using for that?


Thanks,


Antony.
Post by Marcelo Terres
Hi.
I'm trying to get a list of the channels currently in use on an Asterisk
server (1.8.32.1 if it matters) over AMI.
I send the command "sip show channels", and I get back a response along the
Peer User/ANR Call ID Format Hold
Last Message Expiry Peer
*8.22.*0.34 02035644444 0221e874158bb62 0x4 (ulaw) No
Tx: ACK SIPtrunkNu
*.1*.19.70 (None) 2021549013484-1 0x0 (nothing) No
Rx: OPTIONS <guest>
Rx: ACK 200101
*.1*.19.70 (None) 149831567021051 0x0 (nothing) No
Rx: REGISTER <guest>
So, firstly, the "Call ID" column is clearly truncated, because it should
show more than is indicated above,
but more importantly for me, the "Peer" column is truncated, and what
should show as "SIPtrunkNumber8"
is only shown as "SIPtrunkNu".
How can I get the full column widths of these items shown in the output?
Note that it is not a solution just to say "don't call it
'SIPtrunkNumber8'; call it 'SIPtrunk8' instead", because
this name has also been modified slightly to conceal the real name of the
trunk, which is actually longer
than "SIPtrunkNo8", but still with the most important information at the end.
What I'm looking for is how to get the *full* details of all the channels shown.
I have checked, and there is no "verbose" option to the "sip show channels"
command.
Thanks,
Antony.
--
Having been asked for a reference for this man,
I can confirm that you will be very lucky indeed if you can get him to work
for
you.

Please reply to the list;
please *don't* CC
me.

--
_____________________________________________________________________
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

Check out the new Asterisk community forum at:
https://community.asterisk.org/

New to Asterisk? Start here:
https://wiki.asterisk.org/wiki/display/AST/Getting+Started

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

Continue reading on narkive:
Search results for '[asterisk-users] AMI column widths' (Questions and Answers)
11
replies
note on history of cricket?
started 2006-10-16 05:40:51 UTC
cricket
Loading...