private void CancelClients(RequestProxy requestProxy, SipMessageReader message) { lock (requestProxy) { var proxies = requestProxy.GetAllProxie(); for (int i = 0; i < proxies.Count; i++) { if (proxies[i].IsFinalReceived == false && proxies[i].IsCancelSent == false) { proxies[i].IsCancelSent = true; if (Transaction.GetTransactionKind(proxies[i].TransactionId) == Transaction.Kind.InviteClient) { var writer = GetWriter(); proxies[i].GenerateCancel(writer, message); int transactionKId = Transaction.GetRelaytedCancelClientKId(proxies[i].TransactionId); requestProducer.SendRequest(proxies[i].ToConnectionAddresses, writer, transactionKId); } } } } }