#NEWLINE# def recvResponse( self , resp ) : #NEWLINE# #INDENT# body = resp . getBody ( ) #NEWLINE# ( code , reason ) = resp . getSCode ( ) #NEWLINE# scode = ( code , reason , body ) #NEWLINE# if ( code < 200 ) : #NEWLINE# #INDENT# self . ua . equeue . append ( CCEventRing ( scode , rtime = resp . rtime , origin = self . ua . origin ) ) #NEWLINE# return None #NEWLINE# #UNINDENT# if ( ( code >= 200 ) and ( code < 300 ) ) : #NEWLINE# #INDENT# event = CCEventConnect ( scode , rtime = resp . rtime , origin = self . ua . origin ) #NEWLINE# if ( body != None ) : #NEWLINE# #INDENT# if ( self . ua . on_remote_sdp_change != None ) : #NEWLINE# #INDENT# self . ua . on_remote_sdp_change ( body , ( lambda x : self . ua . delayed_remote_sdp_update ( event , x ) ) ) #NEWLINE# return ( UaStateConnected , ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# self . ua . rSDP = body . getCopy ( ) #NEWLINE# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# self . ua . rSDP = None #NEWLINE# #UNINDENT# self . ua . equeue . append ( event ) #NEWLINE# return ( UaStateConnected , ) #NEWLINE# #UNINDENT# if ( ( code in ( 301 , 302 ) ) and ( resp . countHFs ( 'contact' ) > 0 ) ) : #NEWLINE# #INDENT# scode = ( code , reason , body , resp . getHFBody ( 'contact' ) . getUrl ( ) . getCopy ( ) ) #NEWLINE# self . ua . equeue . append ( CCEventRedirect ( scode , rtime = resp . rtime , origin = self . ua . origin ) ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( code in ( 408 , 481 ) ) : #NEWLINE# #INDENT# event = CCEventDisconnect ( rtime = resp . rtime , origin = self . ua . origin ) #NEWLINE# try : #NEWLINE# #INDENT# event . reason = resp . getHFBody ( 'reason' ) #NEWLINE# #UNINDENT# except : #NEWLINE# #INDENT# pass #NEWLINE# #UNINDENT# self . ua . equeue . append ( event ) #NEWLINE# self . ua . cancelCreditTimer ( ) #NEWLINE# self . ua . disconnect_ts = resp . rtime #NEWLINE# return ( UaStateDisconnected , self . ua . disc_cbs , resp . rtime , self . ua . origin ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# event = CCEventFail ( scode , rtime = resp . rtime , origin = self . ua . origin ) #NEWLINE# try : #NEWLINE# #INDENT# event . reason = resp . getHFBody ( 'reason' ) #NEWLINE# #UNINDENT# except : #NEWLINE# #INDENT# pass #NEWLINE# #UNINDENT# self . ua . equeue . append ( event ) #NEWLINE# #UNINDENT# #UNINDENT# return ( UaStateConnected , )