# 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/SipWarning.py
# class SipWarning(SipGenericHF):
#     hf_names = ('warning',)
#     code = 399
#     agent = socket.gethostname()
#     text = None
# 
#     def __init__(self, body = None, cself = None, code = None, text = None):
#         SipGenericHF.__init__(self, body)
#         if body != None:
#             return
#         self.parsed = True
#         if cself != None:
#             self.code, self.agent, self.text = \
#               cself.code, cself.agent, cself.text
#         else:
#             self.agent = socket.gethostname()
#             if code != None:
#                 self.code = code
#             self.text = text.replace('"', "'")
# 
#     def parse(self):
#         code, self.agent, text = self.body.split(None, 2)
#         self.text = text.strip('"')
#         self.code = int(code)
#         self.parsed = True
# 
#     def __str__(self):
#         if not self.parsed:
#             return self.body
#         return '%d %s "%s"' % (self.code, self.agent, self.text)
# 
#     def getCopy(self):
#         return self.__class__(cself = self)


from sippy.Time.MonoTime import MonoTime
from sippy.SipHeader import SipHeader
from sippy.SipWarning import SipWarning
class CCEventUpdate(CCEventGeneric):
    name = 'CCEventUpdate'
    max_forwards = None

    def getCopy(self):
        cself = CCEventGeneric.getCopy(self)
        cself.max_forwards = self.max_forwards
        return cself

class CCEventInfo(CCEventGeneric):
    name = 'CCEventInfo'
    pass

class CCEventDisconnect(CCEventGeneric):
    name = 'CCEventDisconnect'
    pass


class CCEventFail(CCEventGeneric):
    name = 'CCEventFail'
    challenges = None
    warning = None

    def getCopy(self):
        cself = CCEventGeneric.getCopy(self)
        if self.challenges != None:
            cself.challenges = [x.getCopy() for x in self.challenges]
        return cself

    def setWarning(self, eistr):

# 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/SipWarning.py
# class SipWarning(SipGenericHF):
#     hf_names = ('warning',)
#     code = 399
#     agent = socket.gethostname()
#     text = None
# 
#     def __init__(self, body = None, cself = None, code = None, text = None):
#         SipGenericHF.__init__(self, body)
#         if body != None:
#             return
#         self.parsed = True
#         if cself != None:
#             self.code, self.agent, self.text = \
#               cself.code, cself.agent, cself.text
#         else:
#             self.agent = socket.gethostname()
#             if code != None:
#                 self.code = code
#             self.text = text.replace('"', "'")
# 
#     def parse(self):
#         code, self.agent, text = self.body.split(None, 2)
#         self.text = text.strip('"')
#         self.code = int(code)
#         self.parsed = True
# 
#     def __str__(self):
#         if not self.parsed:
#             return self.body
#         return '%d %s "%s"' % (self.code, self.agent, self.text)
# 
#     def getCopy(self):
#         return self.__class__(cself = self)


# Path: sippy/CCEvents.py
from sippy.Time.MonoTime import MonoTime
from sippy.SipHeader import SipHeader
from sippy.SipWarning import SipWarning

class CCEventUpdate(CCEventGeneric):
    name = 'CCEventUpdate'
    max_forwards = None

    def getCopy(self):
        cself = CCEventGeneric.getCopy(self)
        cself.max_forwards = self.max_forwards
        return cself

class CCEventInfo(CCEventGeneric):
    name = 'CCEventInfo'
    pass

class CCEventDisconnect(CCEventGeneric):
    name = 'CCEventDisconnect'
    pass


class CCEventFail(CCEventGeneric):
    name = 'CCEventFail'
    challenges = None
    warning = None

    def getCopy(self):
        cself = CCEventGeneric.getCopy(self)
        if self.challenges != None:
            cself.challenges = [x.getCopy() for x in self.challenges]
        return cself

    def setWarning(self, eistr):

        self.warning = SipHeader(body = SipWarning(text = eistr))