Skip to content

[bug]: Strange warning - 'T' option is not compatible with remote console mode and has no effect. #102

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
1 task done
intellasoft opened this issue May 18, 2023 · 7 comments · Fixed by #103
Closed
1 task done
Assignees
Labels
bug support-level-core Functionality with core support level

Comments

@intellasoft
Copy link
Contributor

intellasoft commented May 18, 2023

Severity

Trivial

Versions

18, 19, 20, 21

Components/Modules

cli

Operating Environment

Any

Frequency of Occurrence

Constant

Issue Description

root# asterisk -rvvvv -T
'T' option is not compatible with remote console mode and has no effect.

Asterisk 18.14.0, Copyright (C) 1999 - 2022, Sangoma Technologies Corporation and others.
Created by Mark Spencer <markster@digium.com>
Asterisk comes with ABSOLUTELY NO WARRANTY; type 'core show warranty' for details.
This is free software, with components licensed under the GNU General Public
License version 2 and other licenses; you are welcome to redistribute it under
certain conditions. Type 'core show license' for details.
=========================================================================
Connected to Asterisk 18.14.0 currently running on IS-COMM-NYC-01 (pid = 26094)
[2023-05-18 14:27:18.293-0400] VERBOSE[21689][C-00001348]: <PJSIP/c30081-101-00001d9f> Playing 'vm-Old.ulaw' (language 'en')
[2023-05-18 14:27:18.878-0400] VERBOSE[21689][C-00001348]: <PJSIP/c30081-101-00001d9f> Spawn extension (checkOwnVoicemail, s, 18) exited non-zero
[2023-05-18 14:27:18.878-0400] VERBOSE[21689][C-00001348]: <PJSIP/c30081-101-00001d9f> Got SoftHangup Request (0x7ffab049f6d0) (cause: 16)

But.. the -T option does have an effect. It turns on timestamps for all console messages, even if asterisk is not configured to do so by default.

@InterLinked1

Relevant log output

No response

Asterisk Issue Guidelines

  • Yes, I have read the Asterisk Issue Guidelines
@jcolp
Copy link
Member

jcolp commented May 18, 2023

@InterLinked1 This warning came from you. Can you clarify why you thought T didn't work on remote console, and if you were incorrect?

@intellasoft
Copy link
Contributor Author

Hmm. I don't recall that was something I came up with...
Related to logging... the thing I definitely do remember was adding support for respecting logger.conf whether or not you're in the console or not for things like timestamp format.

commit a0009c807eb6ad01ea0827b2b14ea3bd433ddc69
Author: Mark Murawski <markm@intellasoft.net>
Date:   Fri Mar 19 10:11:26 2021 -0400

    logger: Console sessions will now respect logger.conf dateformat= option

    The 'core' console (ie: asterisk -c) does read logger.conf and does
    use the dateformat= option.

    Whereas 'remote' consoles (ie: asterisk -r -T) does not read logger.conf
    and uses a hard coded dateformat option for printing received verbose messages:
      main/logger.c: static char dateformat[256] = "%b %e %T"

    This change will load logger.conf for each remote console session and
    use the dateformat= option to set the per-line timestamp for verbose messages

    Change-Id: I3ea10990dbd920e9f7ce8ff771bc65aa7f4ea8c1
    ASTERISK-25358: #close
    Reported-by: Igor Liferenko

This change is a fix, so that logger.conf gets used with the -T option... It definitely does have a behavior effect when used.

But.. I did find:

commit 09e989f972e2583df4e9bf585c246c37322d8d2f
Author: Naveen Albert <asterisk@phreaknet.org>
Date:   Sat Mar 5 11:43:13 2022 +0000

    asterisk.c: Warn of incompatibilities with remote console.

    Some command line options to Asterisk only apply when Asterisk
    is started and cannot be used with remote console mode. If a
    user tries to use any of these, they are currently simply
    silently ignored.

    This prints out a warning if incompatible options are used,
    informing users that an option used cannot be used with remote
    console mode. Additionally, some clarifications are added to
    the help text and man page.

    ASTERISK-22246
    ASTERISK-26582

    Change-Id: I980a5380ef2c19e8ea348596396d5382893c4337

09e989f972e main/asterisk.c (Naveen Albert      2022-03-05 11:43:13 +0000 3775)             case 'T': /* timestamp */
09e989f972e main/asterisk.c (Naveen Albert      2022-03-05 11:43:13 +0000 3776)             case 't': /* cache record files */
09e989f972e main/asterisk.c (Naveen Albert      2022-03-05 11:43:13 +0000 3777)             case 'U': /* run user */
09e989f972e main/asterisk.c (Naveen Albert      2022-03-05 11:43:13 +0000 3778)                 fprintf(stderr, "'%c' option is not compatible with remote console mode and has no effect.\n", c);
09e989f972e main/asterisk.c (Naveen Albert      2022-03-05 11:43:13 +0000 3779)                 didwarn = 1;
09e989f972e main/asterisk.c (Naveen Albert      2022-03-05 11:43:13 +0000 3780)             }

@jcolp
Copy link
Member

jcolp commented May 18, 2023

I'm not sure what you' referring to. I didn't tag you or anything. Naveen Albert is InterLinked.

@InterLinked1
Copy link
Contributor

@InterLinked1 This warning came from you. Can you clarify why you thought T didn't work on remote console, and if you were incorrect?

Probably just an oversight. I just tested this and the 'T' option does seem to have some special handling at least for verbose messages. I can fix the warning if you assign this to me.

@intellasoft
Copy link
Contributor Author

@jcolp Whoops sorry. I didn't process the tag aspect. Still getting familiar with github.

I can't change assignments I don't believe.

@jcolp jcolp added support-level-core Functionality with core support level and removed triage labels May 18, 2023
@jcolp
Copy link
Member

jcolp commented May 18, 2023

You can't, but I did.

@intellasoft
Copy link
Contributor Author

@InterLinked1 Here's something to check out.

If you run asterisk out of the box without any special options or logging setup.. timestamps only print to the log file, and then when you connect via asterisk -r, there's no timestamps on verbose messages, you only get timestamps on errors,warnings,notices

If you do asterisk -rT, then you do get timestampes on all verbose messages

InterLinked1 added a commit to InterLinked1/asterisk that referenced this issue May 18, 2023
Commit 09e989f
categorized the T option as not being compatible
with remote consoles, but they do affect verbose
messages with remote console. This fixes this.

Resolves: asterisk#102
InterLinked1 added a commit to InterLinked1/asterisk that referenced this issue May 18, 2023
Commit 09e989f
categorized the T option as not being compatible
with remote consoles, but they do affect verbose
messages with remote console. This fixes this.

Resolves: asterisk#102
gtjoseph pushed a commit that referenced this issue May 22, 2023
Commit 09e989f
categorized the T option as not being compatible
with remote consoles, but they do affect verbose
messages with remote console. This fixes this.

Resolves: #102
asteriskteam pushed a commit that referenced this issue May 22, 2023
Commit 09e989f
categorized the T option as not being compatible
with remote consoles, but they do affect verbose
messages with remote console. This fixes this.

Resolves: #102
asteriskteam pushed a commit that referenced this issue May 22, 2023
Commit 09e989f
categorized the T option as not being compatible
with remote consoles, but they do affect verbose
messages with remote console. This fixes this.

Resolves: #102
asterisk-org-access-app bot pushed a commit that referenced this issue Jun 30, 2023
Commit 09e989f
categorized the T option as not being compatible
with remote consoles, but they do affect verbose
messages with remote console. This fixes this.

Resolves: #102
(cherry picked from commit 67d20b8)
asterisk-org-access-app bot pushed a commit that referenced this issue Jun 30, 2023
Commit 09e989f
categorized the T option as not being compatible
with remote consoles, but they do affect verbose
messages with remote console. This fixes this.

Resolves: #102
(cherry picked from commit 67d20b8)
asterisk-org-access-app bot pushed a commit that referenced this issue Jun 30, 2023
Commit 09e989f
categorized the T option as not being compatible
with remote consoles, but they do affect verbose
messages with remote console. This fixes this.

Resolves: #102
(cherry picked from commit 67d20b8)
asterisk-org-access-app bot pushed a commit that referenced this issue Jun 30, 2023
Commit 09e989f
categorized the T option as not being compatible
with remote consoles, but they do affect verbose
messages with remote console. This fixes this.

Resolves: #102
(cherry picked from commit 67d20b8)
asterisk-org-access-app bot pushed a commit that referenced this issue Jun 30, 2023
Commit 09e989f
categorized the T option as not being compatible
with remote consoles, but they do affect verbose
messages with remote console. This fixes this.

Resolves: #102
(cherry picked from commit 67d20b8)
asterisk-org-access-app bot pushed a commit that referenced this issue Jun 30, 2023
Commit 09e989f
categorized the T option as not being compatible
with remote consoles, but they do affect verbose
messages with remote console. This fixes this.

Resolves: #102
(cherry picked from commit cfae64a)
asterisk-org-access-app bot pushed a commit that referenced this issue Jul 10, 2023
Commit 09e989f
categorized the T option as not being compatible
with remote consoles, but they do affect verbose
messages with remote console. This fixes this.

Resolves: #102
(cherry picked from commit 67d20b8)
asterisk-org-access-app bot pushed a commit that referenced this issue Jul 10, 2023
Commit 09e989f
categorized the T option as not being compatible
with remote consoles, but they do affect verbose
messages with remote console. This fixes this.

Resolves: #102
(cherry picked from commit cfae64a)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug support-level-core Functionality with core support level
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants