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
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 = []
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 = []
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)
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
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
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))
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
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
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
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))
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))
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
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
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 __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[:]
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
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
def __init__(self, body = None, number = 0): SipGenericHF.__init__(self, body) if body == None: self.parsed = True self.number = number
def __init__(self, body=None, number=0): SipGenericHF.__init__(self, body) if body == None: self.parsed = True self.number = number
def __init__(self, body = None, methods = None): SipGenericHF.__init__(self, body) if body == None: self.parsed = True self.methods = methods[:]
def __init__(self, body): SipGenericHF.__init__(self, body) self.parsed = True
def __init__(self, body=None, caps=None): SipGenericHF.__init__(self, body) if body == None: self.parsed = True self.caps = caps[:]
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)
def __init__(self, body=None, methods=None): SipGenericHF.__init__(self, body) if body == None: self.parsed = True self.methods = methods[:]
def __init__(self, body = None, caps = None): SipGenericHF.__init__(self, body) if body == None: self.parsed = True self.caps = caps[:]