

def recvResponse(self, resp, tr):
    (code, reason) = resp.getSCode()
    if (code < 200):
        return None
    if (self.te != None):
        self.te.cancel()
        self.te = None
    if ((code >= 200) and (code < 300)):
        if (resp.countHFs('contact') > 0):
            self.ua.rTarget = resp.getHFBody('contact').getUrl().getCopy()
        self.ua.routes = [x.getCopy() for x in resp.getHFBodys('record-route')]
        self.ua.routes.reverse()
        if (len(self.ua.routes) > 0):
            if (not self.ua.routes[0].getUrl().lr):
                self.ua.routes.append(SipRoute(address=SipAddress(url=self.ua.rTarget)))
                self.ua.rTarget = tr.ua.routes.pop(0).getUrl()
                self.ua.rAddr = self.ua.rTarget.getAddr()
            elif (self.ua.outbound_proxy != None):
                self.ua.routes.append(SipRoute(address=SipAddress(url=self.ua.rTarget)))
                self.ua.rTarget = self.ua.routes[0].getUrl().getCopy()
                self.ua.rTarget.lr = False
                self.ua.rTarget.other = tuple()
                self.ua.rTarget.headers = tuple()
            else:
                self.ua.rAddr = self.ua.routes[0].getAddr()
        else:
            self.ua.rAddr = self.ua.rTarget.getAddr()
        self.ua.rUri.setTag(resp.getHFBody('to').getTag())
        req = self.ua.genRequest('BYE')
        self.ua.lCSeq += 1
        self.ua.global_config['_sip_tm'].newTransaction(req, laddress=self.ua.source_address, compact=self.ua.compact_sip)
        return (UaStateDisconnected,)
    return (UaStateDead,)

dataset/ETHPy150Open sippy/b2bua/sippy/UacStateCancelling.py UacStateCancelling.recvResponse/VarMisuse@219/257 `self`->`tr`