private void listener_AssociationRequest(DICOMConnection conn) { //make sure we have the calling AE in our list... ApplicationEntity entity = this._db.GetEntity(conn.CallingAE); if (this._settings.PromiscuousMode) { conn.SendAssociateAC(); } else if (entity != null) { if (conn.CalledAE.Trim() != this._settings.AETitle.Trim()) { this._logger.Log(LogLevel.Error, "Rejecting Association: Called AE (" + conn.CalledAE + ") doesn't match our AE (" + this._settings.AETitle + ")"); conn.SendAssociateRJ(AssociateRJResults.RejectedPermanent, AssociateRJSources.DICOMULServiceProviderPresentation, AssociateRJReasons.CalledAENotRecognized); } else if (conn.RemoteEndPoint.Address.ToString() != entity.Address) { this._logger.Log(LogLevel.Error, "Rejecting Association: Remote Address (" + conn.RemoteEndPoint.Address.ToString() + ") doesn't match AE (" + conn.CallingAE + ")'s Address (" + entity.Address + ")"); conn.SendAssociateRJ(AssociateRJResults.RejectedPermanent, AssociateRJSources.DICOMULServiceProviderPresentation, AssociateRJReasons.CallingAENotRecognized); } else { conn.SendAssociateAC(); } } else { this._logger.Log(LogLevel.Error, "Rejecting Association: Couldn't find entity in list with AE title (" + conn.CallingAE + ")"); conn.SendAssociateRJ(AssociateRJResults.RejectedPermanent, AssociateRJSources.DICOMULServiceProviderPresentation, AssociateRJReasons.CallingAENotRecognized); } }
private void conn_AssociationRequested(DICOMConnection conn) { if (AssociationRequest != null) { AssociationRequest(conn); } else { //No handler set up, so go promiscuous! conn.SendAssociateAC(); } }
static void listener_AssociationRequest(DICOMConnection conn) { //accept anyone! conn.SendAssociateAC(); }