[Home]

Summary:ASTERISK-05928: [patch]show channels concise output delimiter problem/change
Reporter:Matt Florell (mflorell)Labels:
Date Opened:2005-12-29 11:32:14.000-0600Date Closed:2008-01-15 16:47:03.000-0600
Priority:MinorRegression?No
Status:Closed/CompleteComponents:Core/General
Versions:Frequency of
Occurrence
Related
Issues:
Environment:Attachments:( 0) cli_chan_concise_delimiter.patch
Description:In the output for "show channels concise" in the Asterisk CLI, the fields are delimited by the colon ":" This would not be a problem if there were no fields containing colons, but often SIP and IAX2 trunks will contain colons to denote the port used for the connection and/or the password for the account:
  IAX2/ASTtest1:test@10.10.10.12:4569/1234

This offsets the data by one or two fields causing problems with parsing of the data in an automated fashion.

The larger problem is what delimited can be safely used for this data output. In our systems we've manually changed the delimiter to the exclamation point "!" since this is used nowhere in channel names or statuses, but this might cause problems for other people.

The patch posted here is against today's general SVN trunk but patches against 1.2.X just fine and is so simple and small it can be easily changed to use a different delimiter.
Comments:By: Olle Johansson (oej) 2006-01-03 04:34:46.000-0600

This does intentionally break backwards compatibility for a good cause. I recommend this patch, but we need to make a note about it.

By: Denis Smirnov (mithraen) 2006-01-03 08:37:36.000-0600

I think that using '|' is better

By: Matt Florell (mflorell) 2006-01-03 08:47:35.000-0600

Pipe delimited won't work either:
    Zap/r3/913125551212|60|o

That shows up in the 7th field for an outbound Zap dial with dial options and would throw off the fields after it so pipe delimited "|" is out of the question as well.

By: opsys (opsys) 2006-01-31 00:51:41.000-0600

What about '%' or ',', we could convert all , used in context,ext,pri to | as they should be anyway

By: Matt Florell (mflorell) 2006-01-31 08:27:05.000-0600

The percent sign '%' might work as I don't think it exists in any other content that would be displayed in this command, although it is a valid URL element which I guess could potentially cause issues in some situations.

As for comma, There is still the issue of Local/ channels having a comma and a number denote each leg of the Local/ call(Local/95551212@default-d419,1). Also, changing the commas in the context,ext,pri would require several code changes in many places.

My vote still goes for the exclamation point '!'. We've been using it for quite a while now in production and it works great for us.

By: Kevin P. Fleming (kpfleming) 2006-02-14 16:23:17.000-0600

Changed in trunk, along with a note in UPGRADE.txt. I can't really see that any of the available characters are any better than '!', so I went with that.

By: Digium Subversion (svnbot) 2008-01-15 16:47:03.000-0600

Repository: asterisk
Revision: 10085

U   trunk/UPGRADE.txt
U   trunk/cli.c

------------------------------------------------------------------------
r10085 | kpfleming | 2008-01-15 16:47:02 -0600 (Tue, 15 Jan 2008) | 2 lines

use a delimiter for 'show channels concise' that will not appear in the field contents (issue ASTERISK-5928, with UPGRADE.txt addition)

------------------------------------------------------------------------

http://svn.digium.com/view/asterisk?view=rev&revision=10085