# Path: sippy/SipGenericHF.py
# class SipGenericHF(object):
#     hf_names = None	# Set this in each subclass!!
#     body = None
#     parsed = False
# 
#     def __init__(self, body, name = None):
#         self.body = body
#         if name != None:
#             self.hf_names = (name.lower(),)
# 
#     def parse(self):
#         pass
# 
#     def localStr(self, local_addr = None, local_port = None):
#         return self.__str__()
# 
#     def __str__(self):
#         return self.body
# 
#     def getCopy(self):
#         return self.__class__(self.body)
# 
#     def getCanName(self, name, compact = False):
#         return name.capitalize()
# 
# Path: sippy/ESipHeaderCSV.py
# class ESipHeaderCSV(Exception):
#     def __init__(self, name, bodys):
#         Exception.__init__(self)
#         self.name = name
#         self.bodys = bodys


from random import random
from hashlib import md5
from time import time
from sippy.SipGenericHF import SipGenericHF
from sippy.SipConf import SipConf
from sippy.ESipHeaderCSV import ESipHeaderCSV
#
# 1. Redistributions of source code must retain the above copyright notice, this
# list of conditions and the following disclaimer.
#
# 2. Redistributions in binary form must reproduce the above copyright notice,
# this list of conditions and the following disclaimer in the documentation and/or
# other materials provided with the distribution.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
# ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
# ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.


class SipVia(SipGenericHF):
    hf_names = ('via', 'v')

    sipver = None
    hostname = None
    port = None
    params = None

    def __init__(self, body = None, sipver = None, hostname = None, port = None, params = None):
        if body != None and body.find(',') > -1:

# Path: sippy/SipGenericHF.py
# class SipGenericHF(object):
#     hf_names = None	# Set this in each subclass!!
#     body = None
#     parsed = False
# 
#     def __init__(self, body, name = None):
#         self.body = body
#         if name != None:
#             self.hf_names = (name.lower(),)
# 
#     def parse(self):
#         pass
# 
#     def localStr(self, local_addr = None, local_port = None):
#         return self.__str__()
# 
#     def __str__(self):
#         return self.body
# 
#     def getCopy(self):
#         return self.__class__(self.body)
# 
#     def getCanName(self, name, compact = False):
#         return name.capitalize()
# 
# Path: sippy/ESipHeaderCSV.py
# class ESipHeaderCSV(Exception):
#     def __init__(self, name, bodys):
#         Exception.__init__(self)
#         self.name = name
#         self.bodys = bodys


# Path: sippy/SipVia.py
from random import random
from hashlib import md5
from time import time
from sippy.SipGenericHF import SipGenericHF
from sippy.SipConf import SipConf
from sippy.ESipHeaderCSV import ESipHeaderCSV

#
# 1. Redistributions of source code must retain the above copyright notice, this
# list of conditions and the following disclaimer.
#
# 2. Redistributions in binary form must reproduce the above copyright notice,
# this list of conditions and the following disclaimer in the documentation and/or
# other materials provided with the distribution.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
# ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
# ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.


class SipVia(SipGenericHF):
    hf_names = ('via', 'v')

    sipver = None
    hostname = None
    port = None
    params = None

    def __init__(self, body = None, sipver = None, hostname = None, port = None, params = None):
        if body != None and body.find(',') > -1:

            raise ESipHeaderCSV(None, body.split(','))