當前位置: 首頁>>代碼示例>>Python>>正文


Python SipGenericHF.SipGenericHF類代碼示例

本文整理匯總了Python中SipGenericHF.SipGenericHF的典型用法代碼示例。如果您正苦於以下問題:Python SipGenericHF類的具體用法?Python SipGenericHF怎麽用?Python SipGenericHF使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


在下文中一共展示了SipGenericHF類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: __init__

 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
開發者ID:LaoHanTeam,項目名稱:sippy,代碼行數:25,代碼來源:SipAddressHF.py

示例2: __init__

 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
開發者ID:BackupTheBerlios,項目名稱:sippy,代碼行數:7,代碼來源:SipReason.py

示例3: __init__

 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 = []
開發者ID:gtkiller,項目名稱:b2bua,代碼行數:27,代碼來源:SipAuthorization.py

示例4: __init__

 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))
開發者ID:biddyweb,項目名稱:b2bua,代碼行數:8,代碼來源:SipContact.py

示例5: __init__

 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
開發者ID:LaoHanTeam,項目名稱:sippy,代碼行數:9,代碼來源:SipCSeq.py

示例6: __init__

 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
開發者ID:BackupTheBerlios,項目名稱:sippy,代碼行數:9,代碼來源:SipServer.py

示例7: __init__

 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))
開發者ID:biddyweb,項目名稱:b2bua,代碼行數:10,代碼來源:SipCiscoGUID.py

示例8: __init__

 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
開發者ID:gtkiller,項目名稱:b2bua,代碼行數:12,代碼來源:SipWWWAuthenticate.py

示例9: __init__

 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[:]
開發者ID:biddyweb,項目名稱:b2bua,代碼行數:13,代碼來源:SipReplaces.py

示例10: __init__

 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
開發者ID:DarthRa,項目名稱:pulsar,代碼行數:20,代碼來源:SipVia.py

示例11: __init__

 def __init__(self, body = None, number = 0):
     SipGenericHF.__init__(self, body)
     if body == None:
         self.parsed = True
         self.number = number
開發者ID:DarthRa,項目名稱:pulsar,代碼行數:5,代碼來源:SipNumericHF.py

示例12: __init__

 def __init__(self, body = None, methods = None):
     SipGenericHF.__init__(self, body)
     if body == None:
         self.parsed = True
         self.methods = methods[:]
開發者ID:biddyweb,項目名稱:b2bua,代碼行數:5,代碼來源:SipAllow.py

示例13: __init__

 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)
開發者ID:biddyweb,項目名稱:b2bua,代碼行數:5,代碼來源:SipCallId.py

示例14: __init__

 def __init__(self, body = None, caps = None):
     SipGenericHF.__init__(self, body)
     if body == None:
         self.parsed = True
         self.caps = caps[:]
開發者ID:biddyweb,項目名稱:b2bua,代碼行數:5,代碼來源:SipSupported.py

示例15: __init__

 def __init__(self, body):
     SipGenericHF.__init__(self, body)
     self.parsed = True
開發者ID:DarthRa,項目名稱:pulsar,代碼行數:3,代碼來源:SipContentType.py


注:本文中的SipGenericHF.SipGenericHF類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。