Skip to content

caller.py assumes a lot on the environment #1

@dhrp

Description

@dhrp

rtlite.app.sip.caller has a couple of issues

  • it assumes socket(gethostbyname(socket.gethostname)) returns an IP, but not all machines have their /etc/hosts file setup correctly for this to work. caller.py currently throws something like
socket.gaierror: [Errno 8] nodename nor servname provided, or not known
  • it assumes os.getlogin() works, but this doesn't work when you're not logged in as a user (e.g. when you're running in a Docker container).

I did a quick looks and it seems to be hard to make these things work in a true cross-platform way, so I suggest catching the errors, outputting a helpful message and quitting. And then adding a flag for setting hostname and user.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions