Skip to content

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

Description

@intellasoft

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

Activity

  1. jcolp commented on May 18, 2023

    @jcolp
    Member

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

  2. intellasoft commented on May 18, 2023

    @intellasoft
    ContributorAuthor

    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)             }
    
    
  3. jcolp commented on May 18, 2023

    @jcolp
    Member

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

  4. InterLinked1 commented on May 18, 2023

    @InterLinked1
    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.

  5. intellasoft commented on May 18, 2023

    @intellasoft
    ContributorAuthor

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

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

  6. added
    support-level-coreFunctionality with core support level
    and removed on May 18, 2023
  7. jcolp commented on May 18, 2023

    @jcolp
    Member

    You can't, but I did.

  8. intellasoft commented on May 18, 2023

    @intellasoft
    ContributorAuthor

    @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

  9. added 2 commits that reference this issue on May 18, 2023
    3ff2a90
    fe645b3
  10. added a commit that references this issue on May 22, 2023
    ad6ff4c
  11. added 2 commits that reference this issue on May 22, 2023
    67d20b8
    cfae64a
  12. added 6 commits that reference this issue on Jun 30, 2023
    5394753
    229c7a7
    4f62745
    75dfb6d
    2f6aeb7
    867c12c
  13. added 2 commits that reference this issue on Jul 10, 2023
    f7c800e
    ca51a25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions