From 6917772c86bf35ba157c3712cd48ab2415bfbfaf Mon Sep 17 00:00:00 2001 From: Fabio Souza Date: Mon, 13 Nov 2023 16:49:49 -0300 Subject: [PATCH 1/2] fix login --- baresipy/__init__.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/baresipy/__init__.py b/baresipy/__init__.py index f35a8b3..65caf8d 100644 --- a/baresipy/__init__.py +++ b/baresipy/__init__.py @@ -64,9 +64,12 @@ def __init__(self, user, pwd, gateway, tts=None, debug=False, 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) + self.tts = ResponsiveVoice(gender=ResponsiveVoice.MALE)] + # This string is broken + # self._login = "sip:{u}@{g};auth_pass={p}".format(u=self.user, p=self.pwd, + # g=self.gateway) + self._login = ";auth_pass={p}".format(u=self.user, p=self.pwd, + g=self.gateway) self._prev_output = "" self.running = False self.ready = False From e46735daf277f6aa2515bec8c8bc6e2a5ef468bc Mon Sep 17 00:00:00 2001 From: Fabio Souza <80291827+oornnery@users.noreply.github.com> Date: Thu, 16 Nov 2023 17:09:06 -0300 Subject: [PATCH 2/2] Update __init__.py fix --- baresipy/__init__.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/baresipy/__init__.py b/baresipy/__init__.py index 65caf8d..72e879e 100644 --- a/baresipy/__init__.py +++ b/baresipy/__init__.py @@ -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) @@ -61,15 +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.tts = ResponsiveVoice(gender=ResponsiveVoice.MALE) # This string is broken # self._login = "sip:{u}@{g};auth_pass={p}".format(u=self.user, p=self.pwd, # g=self.gateway) - self._login = ";auth_pass={p}".format(u=self.user, p=self.pwd, - g=self.gateway) + self._login = ";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