# Path: sippy/SipHeader.py
# class SipHeader(object):
#     name = None
#     body = None
# 
#     def __init__(self, s = None, name = None, body = None, bodys = None, fixname = False):
#         if s != None:
#             name, bodys = [x.strip() for x in s.split(':', 1)]
#         if name != None:
#             self.name = name.lower()
#         if body == None:
#             try:
#                 try:
#                     body = hf_types[self.name](bodys)
#                 except KeyError:
#                     body = SipGenericHF(bodys, name)
#             except ESipHeaderCSV as einst:
#                 einst.name = self.name
#                 raise einst
#         self.body = body
#         # If no name is provided use canonic name from the body-specific
#         # class.
#         if self.name == None or fixname:
#             self.name = body.hf_names[0]
# 
#     def __str__(self):
#         return str(self.body.getCanName(self.name)) + ': ' + str(self.body)
# 
#     def localStr(self, local_addr = None, local_port = None, compact = False):
#         return str(self.body.getCanName(self.name, compact)) + ': ' + \
#           self.body.localStr(local_addr, local_port)
# 
#     def getBody(self):
#         if not self.body.parsed:
#             self.body.parse()
#         return self.body
# 
#     def getBCopy(self):
#         return self.body.getCopy()
# 
#     def getCopy(self):
#         cself = self.__class__(name = self.name, body = self.body.getCopy())
#         return cself 


from sippy.SipHeader import SipHeader
from sippy.SipConf import SipConf
    from urllib import unquote
    from urllib.parse import unquote
from socket import getaddrinfo, SOCK_STREAM, AF_INET, AF_INET6
                self.crt_set = True
            elif a == 'expires':
                self.expires = int(v)
                if self.expires < 0:
                    self.expires = None
            elif a == 'hs_scodes':
                self.params['huntstop_scodes'] = tuple([int(x) for x in v.split(',') if len(x.strip()) > 0])
            elif a == 'np_expires':
                self.no_progress_expires = int(v)
                if self.no_progress_expires < 0:
                    self.no_progress_expires = None
            elif a == 'nr_expires':
                self.no_reply_expires = int(v)
                if self.no_reply_expires < 0:
                    self.no_reply_expires = None
            elif a == 'forward_on_fail':
                self.forward_on_fail = True
            elif a == 'auth':
                self.user, self.passw = v.split(':', 1)
            elif a == 'cli':
                self.cli = v
                if len(self.cli) == 0:
                    self.cli = None
                self.cli_set = True
            elif a == 'cnam':
                caller_name = unquote(v)
                if len(caller_name) == 0:
                    caller_name = None
                self.params['caller_name'] = caller_name
            elif a == 'ash':

# Path: sippy/SipHeader.py
# class SipHeader(object):
#     name = None
#     body = None
# 
#     def __init__(self, s = None, name = None, body = None, bodys = None, fixname = False):
#         if s != None:
#             name, bodys = [x.strip() for x in s.split(':', 1)]
#         if name != None:
#             self.name = name.lower()
#         if body == None:
#             try:
#                 try:
#                     body = hf_types[self.name](bodys)
#                 except KeyError:
#                     body = SipGenericHF(bodys, name)
#             except ESipHeaderCSV as einst:
#                 einst.name = self.name
#                 raise einst
#         self.body = body
#         # If no name is provided use canonic name from the body-specific
#         # class.
#         if self.name == None or fixname:
#             self.name = body.hf_names[0]
# 
#     def __str__(self):
#         return str(self.body.getCanName(self.name)) + ': ' + str(self.body)
# 
#     def localStr(self, local_addr = None, local_port = None, compact = False):
#         return str(self.body.getCanName(self.name, compact)) + ': ' + \
#           self.body.localStr(local_addr, local_port)
# 
#     def getBody(self):
#         if not self.body.parsed:
#             self.body.parse()
#         return self.body
# 
#     def getBCopy(self):
#         return self.body.getCopy()
# 
#     def getCopy(self):
#         cself = self.__class__(name = self.name, body = self.body.getCopy())
#         return cself 


# Path: sippy/B2BRoute.py
from sippy.SipHeader import SipHeader
from sippy.SipConf import SipConf
    from urllib import unquote
    from urllib.parse import unquote
from socket import getaddrinfo, SOCK_STREAM, AF_INET, AF_INET6

                self.crt_set = True
            elif a == 'expires':
                self.expires = int(v)
                if self.expires < 0:
                    self.expires = None
            elif a == 'hs_scodes':
                self.params['huntstop_scodes'] = tuple([int(x) for x in v.split(',') if len(x.strip()) > 0])
            elif a == 'np_expires':
                self.no_progress_expires = int(v)
                if self.no_progress_expires < 0:
                    self.no_progress_expires = None
            elif a == 'nr_expires':
                self.no_reply_expires = int(v)
                if self.no_reply_expires < 0:
                    self.no_reply_expires = None
            elif a == 'forward_on_fail':
                self.forward_on_fail = True
            elif a == 'auth':
                self.user, self.passw = v.split(':', 1)
            elif a == 'cli':
                self.cli = v
                if len(self.cli) == 0:
                    self.cli = None
                self.cli_set = True
            elif a == 'cnam':
                caller_name = unquote(v)
                if len(caller_name) == 0:
                    caller_name = None
                self.params['caller_name'] = caller_name
            elif a == 'ash':

                ash = SipHeader(unquote(v))