Original filename: Client to TCS 7605717390.pcapng.gz
Command: callflow Client\ to\ TCS\ 7605717390.pcapng.gz
Also tried callflow 'Client to TCS 7605717390.pcapng.gz' with similar result
Result:
callflow Client\ to\ TCS\ 7605717390.pcapng.gz
basename: extra operand `TCS'
Try `basename --help' for more information.
/usr/local/share/callflow/scripts/pcap-parser.sh: line 5: $DESTDIR/callflow.long: ambiguous redirect
tshark: "Client" is a directory (folder), not a file.
tshark: "Client" is a directory (folder), not a file.
/usr/local/share/callflow/scripts/pcap-parser.sh: line 188: $DESTDIR/callflow.short: ambiguous redirect
sort: stat failed: 7605717390.pcapng/callflow.short: No such file or directory
basename: extra operand `TCS'
Try `basename --help' for more information.
md5sum: Client: Is a directory
md5sum: to: Is a directory
md5sum: TCS: Is a directory
md5sum: 7605717390.pcapng.gz: No such file or directory
/usr/local/bin/callflow: line 98: $DESTDIR/metadb: ambiguous redirect
/usr/local/bin/callflow: line 436: [: too many arguments
sed: couldn't edit Client: not a regular file
/usr/local/bin/callflow: line 445: [: too many arguments
sed: couldn't edit Client: not a regular file
/usr/local/bin/callflow: line 463: $DESTDIR/callflow.long: ambiguous redirect
/usr/local/bin/callflow: line 469: $DESTDIR/frames/callflow.css: ambiguous redirect
awk: /usr/local/share/callflow/scripts/list-nodes.awk:6: fatal: cannot open file `Client' for reading (Inappropriate ioctl for device)
callflow: warning: no "order" file found -- using auto generated
cat: Client: Is a directory
cat: to: Is a directory
cat: TCS: Is a directory
cat: 7605717390.pcapng/callflow.short: No such file or directory
/usr/local/bin/callflow: line 561: $DESTDIR/callflow.svg: ambiguous redirect
Please check the current version available in the repository. It has a solution for this.
Not sure about the spaces in filenames though. For this moment the solution is to replace the spaces with e.g. "_"
I updated to callflow version 20141023 and it still failed on quoted or
escaped filenames.
Last edit: Calvin E. 2017-03-08
Please use the version from svn:
cat callflow.version
20170115.08
Only thing left is to release it.
Similar failures on 20170115.226. I'm nearly finished editing the variable quoting within bin/callflow and scripts/pcap-parser.sh, all that's left to fix is how the file name is passed to inkscape and tar/zip. I expect to have a patch ready today.
Also, my TShark version 1.8.10 doesn't support gui.column.format; that was resolved by changing the option to column.format instead.
There's a comment in callflow asking what a particular sed expression is doing:
This removes the extension from the filename, e.g. filename.pcap.gz becomes filenam.pcap, and filename.trace becomes filename.
I've changed ls to basename in the command above, so the DESTDIR is within the current directory, not where the pcap itself is. This way my web interface can upload the pcap to a temp folder that's regularly purged, and I can run callflow from the intended destination directly.
Last edit: Calvin E. 2017-03-10
Here's an svn diff for my changes:
And this too:
Calvin, thanks for the patch. However, do not provide the various changes in one big patch. Provide a patch per related change,please.
Having said that, feedback on your patch:
Prevent spaces to be used in the patch or filename. Using spaces makes processing files only more cumbersome.
Patch is not needed, when no spaces are used in the filename. Have your web frontend modify the filename, so there are no spaces anymore.
If you want this, do not change the current behavior. Provide a patch that adds an option that specifies the output directory.
This is too specific (for two nodes only, normally there are many, many more nodes involved). Add one or more firewalls (in the order file) to the right of the picture, that makes the diagram wider.
If you look in the history, you'll see that the filename location was recently changed to the current location.
The most left part of the URI provides the usefull information. As such a width of 250 should be sufficient. In case it is still too small, add firewalls (as explained in the previous item) to obtain a wider diagram.
A better solution might be to be able to specify the width of the diagram on the command line.
Robert, thank you for the feedback. This is my first open source contribution and I appreciate the opportunity to learn from your comments
Regarding the adjustment to the output directory, I agree this should be a separate patch for a new command line argument, e.g. --outputdir.
The change to the filename alignment was not solely for the case of two nodes; that's simply how the issue first presented itself in my environment. I deal with a lot of very long filenames, which were still being cut off even when more than two nodes were present.
This was elaborated upon in the source comments:
Adding firewalls is certainly one way to handle that, but I'm doing all that I can to save my end users from editing order files unless absolutely necessary. I'm also trying to keep any middleware as simple as possible by addressing issues within callflow itself.
Perhaps this could become another command line argument, i.e. --titlealign or --titlepos with options for leftmargin, center, default (2nd column).
The change is simply an increase in the max allowed when specifying the width on the command line:
Although the leftmost part of the R-URI may be most commonly used, in our environment we deal with very long registration contacts, and I was making room to still see the SDP after that. Also keeping non-technical end users away from the order files.
Adding a line break between the R-URI and the SDP would be another way to keep that tidy.
Saving this for last:
This is not a tenable solution. The issue is not about spaces, this is an issue of properly quoting variables to safely handle user input without unexpected failure. Although not common in Unix-like environments, there are many characters allowed in Windows and Mac environments which will cause scripts to fail when this is not taken into consideration.
I frequently deal with filenames containing characters like @(){}[] and often with justifiable purpose. E.g. capture tools which use the R-URI, Call-ID, Contact, or To as the filename. Renaming these files breaks continuity with other people involved in the work.
Putting the onus on end users or middleware to only provide "safe" file names forces every other user to solve the problem repeatedly, indefinitely. Adding some quotes to callflow fixes it permanently for all users.
Since I'm starting to get philosophical about this I'll return to the concrete with two things:
http://www.linfo.org/file_name.html Although specific characters are forbidden and others are discouraged, I'm aware of no standard that spaces and other punctuation cannot be used, especially in cross-platform environments like SIP and the Internet where the characters are commonplace in filenames on other platforms.
And more importantly, https://en.wikipedia.org/wiki/Robustness_principle
I'll re-post this patch without the un-related changes.
Last edit: Calvin E. 2017-03-18
I rather prevent filenames with spaces, as such add a check for invalid characters in the filename, and if there are reject the file. Or rename the file to only use valid characters.