Skip to content
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

fix login #13

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions baresipy/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@


class BareSIP(Thread):
def __init__(self, user, pwd, gateway, tts=None, debug=False,
def __init__(self, user, pwd, gateway, transport='tcp', reg=60, tts=None, debug=False,
block=True, config_path=None, sounds_path=None):
config_path = config_path or join("~", ".baresipy")
self.config_path = expanduser(config_path)
Expand Down Expand Up @@ -61,12 +61,17 @@ def __init__(self, user, pwd, gateway, tts=None, debug=False,
self.user = user
self.pwd = pwd
self.gateway = gateway
self.transport = transport
self.reg = reg
if tts:
self.tts = tts
else:
self.tts = ResponsiveVoice(gender=ResponsiveVoice.MALE)
self._login = "sip:{u}@{g};auth_pass={p}".format(u=self.user, p=self.pwd,
g=self.gateway)
# This string is broken
# self._login = "sip:{u}@{g};auth_pass={p}".format(u=self.user, p=self.pwd,
# g=self.gateway)
self._login = "<sip:{u}@{g};transport={t}>;auth_pass={p};regint={r}".format(u=self.user, p=self.pwd,
g=self.gateway,t=self.transport, r=self.reg)
self._prev_output = ""
self.running = False
self.ready = False
Expand Down