Skip to content
Snippets Groups Projects
Commit 2dba6d03 authored by Joshua Colp's avatar Joshua Colp Committed by Gerrit Code Review
Browse files

Merge "sip_to_pjsip: Parse register even with transport."

parents 71b37510 3eb02235
Branches
Tags
No related merge requests found
...@@ -926,6 +926,17 @@ class Registration: ...@@ -926,6 +926,17 @@ class Registration:
the right of the user, then finish by using rpartition calls to remove the right of the user, then finish by using rpartition calls to remove
everything to the left of the user. everything to the left of the user.
""" """
self.peer = ''
self.protocol = 'udp'
protocols = ['udp', 'tcp', 'tls']
for protocol in protocols:
position = user_part.find(protocol + '://')
if -1 < position:
post_transport = user_part[position + 6:]
self.peer, sep, self.protocol = user_part[:position + 3].rpartition('?')
user_part = post_transport
break
colons = user_part.count(':') colons = user_part.count(':')
if (colons == 3): if (colons == 3):
# :domainport:secret:authuser # :domainport:secret:authuser
...@@ -946,11 +957,7 @@ class Registration: ...@@ -946,11 +957,7 @@ class Registration:
# Invalid setting # Invalid setting
raise raise
pre_domain, sep, self.domain = pre_auth.partition('@') self.user, sep, self.domain = pre_auth.partition('@')
self.peer, sep, post_peer = pre_domain.rpartition('?')
transport, sep, self.user = post_peer.rpartition('://')
self.protocol = transport if transport else 'udp'
def write(self, pjsip, nmapped): def write(self, pjsip, nmapped):
""" """
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment