UAS received an INVITE from UAC, responded to UAC with 100 Trying and attempted to forward the INVITE to the next node and there wan't any response from next node, hence, re transmission occurred. During the process UAS received CANCEL request for the initial INVITE request, what behavior is expected by UAS according to RFC 3261 ?

1.Should UAS respond to CANCEL request with 200 Ok and forward CANCEL to next node ? Since, no response received from next node for the initial INVITE, should UAS keep re transmitting both CANCEL and INVITE requests ? and eventually respond to UAC with 487 Request Terminated when time out occurs ?

The UAS should send the CANCEL request and halt the INVITE re-transmissions to the next node. If the next node did not receive the original INVITE it will get an unmatched CANCEL request which can be safely ignored.