예제 #1
0
 def __init__(self, body=None, protocol=None, cause=None, reason=None):
     SipGenericHF.__init__(self, body)
     if body == None:
         self.parsed = True
         self.protocol = protocol
         self.cause = cause
         self.reason = reason
예제 #2
0
 def __init__(self, body=None, username=None, uri=None, realm=None, nonce=None, response=None, \
              password=None, method=None, cself=None):
     SipGenericHF.__init__(self, body)
     if body != None:
         return
     self.parsed = True
     if cself != None:
         self.username = cself.username
         self.uri = cself.uri
         self.realm = cself.realm
         self.nonce = cself.nonce
         self.response = cself.response
         self.qop = cself.qop
         self.cnonce = cself.cnonce
         self.nc = cself.nc
         self.otherparams = cself.otherparams[:]
         return
     self.username = username
     self.uri = uri
     self.realm = realm
     self.nonce = nonce
     if response == None:
         HA1 = DigestCalcHA1('md5', username, realm, password, nonce, '')
         self.response = DigestCalcResponse(HA1, nonce, 0, '', '', method,
                                            uri, '')
     else:
         self.response = response
     self.otherparams = []
예제 #3
0
 def __init__(self, body = None, username = None, uri = None, realm = None, nonce = None, response = None, \
              password = None, method = None, cself = None):
     SipGenericHF.__init__(self, body)
     if body != None:
         return
     self.parsed = True
     if cself != None:
         self.username = cself.username
         self.uri = cself.uri
         self.realm = cself.realm
         self.nonce = cself.nonce
         self.response = cself.response
         self.qop = cself.qop
         self.cnonce = cself.cnonce
         self.nc = cself.nc
         self.otherparams = cself.otherparams[:]
         return
     self.username = username
     self.uri = uri
     self.realm = realm
     self.nonce = nonce
     if response == None:
         HA1 = DigestCalcHA1('md5', username, realm, password, nonce, '')
         self.response = DigestCalcResponse(HA1, nonce, 0, '', '', method, uri, '')
     else:
         self.response = response
     self.otherparams = []
예제 #4
0
파일: SipCallId.py 프로젝트: zhongz/b2bua
 def __init__(self, body=None):
     SipGenericHF.__init__(self, body)
     self.parsed = True
     if body == None:
         self.body = md5(str((random() * 1000000000L) +
                             time())).hexdigest() + '@' + str(
                                 SipConf.my_address)
예제 #5
0
 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(','))
     SipGenericHF.__init__(self, body)
     if body == None:
         self.parsed = True
         self.params = {}
         if sipver == None:
             self.sipver = 'SIP/2.0/UDP'
         else:
             self.sipver = sipver
         if hostname == None:
             self.hostname = SipConf.my_address
             self.port = SipConf.my_port
             self.params['rport'] = None
         else:
             self.hostname = hostname
             self.port = port
         if params != None:
             self.params = params
예제 #6
0
 def __init__(self, body = None, address = None):
     SipGenericHF.__init__(self, body)
     if body != None:
         csvs = []
         pidx = 0
         while 1:
             idx = body.find(',', pidx)
             if idx == -1:
                 break;
             onum = body[:idx].count('<')
             cnum = body[:idx].count('>')
             qnum = body[:idx].count('"')
             if (onum == 0 and cnum == 0 and qnum == 0) or (onum > 0 and \
               onum == cnum and (qnum % 2 == 0)):
                 csvs.append(body[:idx])
                 body = body[idx + 1:]
                 pidx = 0
             else:
                 pidx = idx + 1
         if (len(csvs) > 0):
             csvs.append(body)
             raise ESipHeaderCSV(None, csvs)
     else:
         self.parsed = True
         self.address = address
예제 #7
0
 def __init__(self, body = None, address = None):
     SipGenericHF.__init__(self, body)
     if body != None:
         csvs = []
         pidx = 0
         while 1:
             idx = body.find(',', pidx)
             if idx == -1:
                 break;
             onum = body[:idx].count('<')
             cnum = body[:idx].count('>')
             qnum = body[:idx].count('"')
             if (onum == 0 and cnum == 0 and qnum == 0) or (onum > 0 and \
               onum == cnum and (qnum % 2 == 0)):
                 csvs.append(body[:idx])
                 body = body[idx + 1:]
                 pidx = 0
             else:
                 pidx = idx + 1
         if (len(csvs) > 0):
             csvs.append(body)
             raise ESipHeaderCSV(None, csvs)
     else:
         self.parsed = True
         self.address = address
예제 #8
0
파일: SipReason.py 프로젝트: drlior/b2bua
 def __init__(self, body=None, protocol=None, cause=None, reason=None):
     SipGenericHF.__init__(self, body)
     if body == None:
         self.parsed = True
         self.protocol = protocol
         self.cause = cause
         self.reason = reason
예제 #9
0
 def __init__(self, body = None, address = None):
     if body == '*':
         SipGenericHF.__init__(self, body)
         self.asterisk = True
         return
     SipAddressHF.__init__(self, body, address)
     if body == None and address == None:
         self.address = SipAddress(name = 'Anonymous', url = SipURL(host = SipConf.my_address, port = SipConf.my_port))
예제 #10
0
파일: SipCSeq.py 프로젝트: LaoHanTeam/sippy
 def __init__(self, body = None, cseq = None, method = None):
     SipGenericHF.__init__(self, body)
     if body == None:
         self.parsed = True
         self.method = method
         if cseq != None:
             self.cseq = cseq
         else:
             self.cseq = 1
예제 #11
0
파일: SipCSeq.py 프로젝트: zhongz/b2bua
 def __init__(self, body=None, cseq=None, method=None):
     SipGenericHF.__init__(self, body)
     if body == None:
         self.parsed = True
         self.method = method
         if cseq != None:
             self.cseq = cseq
         else:
             self.cseq = 1
예제 #12
0
 def __init__(self, body=None, name=None):
     SipGenericHF.__init__(self, body)
     self.parsed = True
     if body != None:
         self.name = body
     elif name != None:
         self.name = name
     else:
         self.name = SipConf.my_uaname
예제 #13
0
 def __init__(self, body=None, name=None):
     SipGenericHF.__init__(self, body)
     self.parsed = True
     if body != None:
         self.name = body
     elif name != None:
         self.name = name
     else:
         self.name = SipConf.my_uaname
예제 #14
0
 def __init__(self, body = None, ciscoGUID = None):
     SipGenericHF.__init__(self, body)
     if body != None:
         return
     self.parsed = True
     if ciscoGUID != None:
         self.ciscoGUID = ciscoGUID
     else:
         s = md5(str((random() * 1000000000L) + time())).hexdigest()
         self.ciscoGUID = (long(s[0:8], 16), long(s[8:16], 16), long(s[16:24], 16), long(s[24:32], 16))
예제 #15
0
 def __init__(self, body=None, address=None):
     if body == '*':
         SipGenericHF.__init__(self, body)
         self.asterisk = True
         return
     SipAddressHF.__init__(self, body, address)
     if body == None and address == None:
         self.address = SipAddress(name='Anonymous',
                                   url=SipURL(host=SipConf.my_address,
                                              port=SipConf.my_port))
예제 #16
0
 def __init__(self, body = None, realm = None, nonce = None):
     SipGenericHF.__init__(self, body)
     if body != None:
         return
     self.parsed = True
     if nonce == None:
         ctime = time()
         nonce = md5(str((random() * 1000000000L) + ctime)).hexdigest() + hex(int(ctime))[2:]
     if realm == None:
         realm = SipConf.my_address
     self.realm = realm
     self.nonce = nonce
예제 #17
0
 def __init__(self, body=None, realm=None, nonce=None):
     SipGenericHF.__init__(self, body)
     if body != None:
         return
     self.parsed = True
     if nonce == None:
         ctime = time()
         nonce = md5(str((random() * 1000000000L) + ctime)).hexdigest() + hex(int(ctime))[2:]
     if realm == None:
         realm = SipConf.my_address
     self.realm = realm
     self.nonce = nonce
예제 #18
0
파일: SipWarning.py 프로젝트: nbxorg/b2bua
 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('"', "'")
예제 #19
0
 def __init__(self, body = None, call_id = None, from_tag = None, to_tag = None, \
   early_only = False, params = None):
     SipGenericHF.__init__(self, body)
     if body != None:
         return
     self.parsed = True
     self.params = []
     self.call_id = call_id
     self.from_tag = from_tag
     self.to_tag = to_tag
     self.early_only = early_only
     if params != None:
         self.params = params[:]
예제 #20
0
 def __init__(self, body = None, call_id = None, from_tag = None, to_tag = None, \
   early_only = False, params = None):
     SipGenericHF.__init__(self, body)
     if body != None:
         return
     self.parsed = True
     self.params = []
     self.call_id = call_id
     self.from_tag = from_tag
     self.to_tag = to_tag
     self.early_only = early_only
     if params != None:
         self.params = params[:]
예제 #21
0
파일: SipVia.py 프로젝트: DarthRa/pulsar
 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(','))
     SipGenericHF.__init__(self, body)
     if body == None:
         self.parsed = True
         self.params = {}
         if sipver == None:
             self.sipver = 'SIP/2.0/UDP'
         else:
             self.sipver = sipver
         if hostname == None:
             self.hostname = SipConf.my_address
             self.port = SipConf.my_port
             self.params['rport'] = None
         else:
             self.hostname = hostname
             self.port = port
         if params != None:
             self.params = params
예제 #22
0
파일: SipHeader.py 프로젝트: nbxorg/b2bua
 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, einst:
             einst.name = self.name
             raise einst
예제 #23
0
 def __init__(self, body = None, number = 0):
     SipGenericHF.__init__(self, body)
     if body == None:
         self.parsed = True
         self.number = number
예제 #24
0
 def __init__(self, body=None, number=0):
     SipGenericHF.__init__(self, body)
     if body == None:
         self.parsed = True
         self.number = number
예제 #25
0
파일: SipAllow.py 프로젝트: biddyweb/b2bua
 def __init__(self, body = None, methods = None):
     SipGenericHF.__init__(self, body)
     if body == None:
         self.parsed = True
         self.methods = methods[:]
예제 #26
0
 def __init__(self, body):
     SipGenericHF.__init__(self, body)
     self.parsed = True
예제 #27
0
 def __init__(self, body=None, caps=None):
     SipGenericHF.__init__(self, body)
     if body == None:
         self.parsed = True
         self.caps = caps[:]
예제 #28
0
 def __init__(self, body):
     SipGenericHF.__init__(self, body)
     self.parsed = True
예제 #29
0
파일: SipCallId.py 프로젝트: biddyweb/b2bua
 def __init__(self, body = None):
     SipGenericHF.__init__(self, body)
     self.parsed = True
     if body == None:
         self.body = md5(str((random() * 1000000000L) + time())).hexdigest() + '@' + str(SipConf.my_address)
예제 #30
0
파일: SipAllow.py 프로젝트: drlior/b2bua
 def __init__(self, body=None, methods=None):
     SipGenericHF.__init__(self, body)
     if body == None:
         self.parsed = True
         self.methods = methods[:]
예제 #31
0
 def __init__(self, body = None, caps = None):
     SipGenericHF.__init__(self, body)
     if body == None:
         self.parsed = True
         self.caps = caps[:]