本文整理汇总了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
示例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
示例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 = []
示例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))
示例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
示例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
示例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))
示例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
示例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[:]
示例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
示例11: __init__
def __init__(self, body = None, number = 0):
SipGenericHF.__init__(self, body)
if body == None:
self.parsed = True
self.number = number
示例12: __init__
def __init__(self, body = None, methods = None):
SipGenericHF.__init__(self, body)
if body == None:
self.parsed = True
self.methods = methods[:]
示例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)
示例14: __init__
def __init__(self, body = None, caps = None):
SipGenericHF.__init__(self, body)
if body == None:
self.parsed = True
self.caps = caps[:]
示例15: __init__
def __init__(self, body):
SipGenericHF.__init__(self, body)
self.parsed = True