Getting IWS attached data in Custom comand

I tried to get attached data in custom command which should be run before release call using the code below

this.container = container;
IInteractionVoice Context = container.Resolve();
IDictionary<string, object> contextDictionary = (Context.UserData as IDictionary<string, object>);
object caseObject;
if (contextDictionary.TryGetValue(“Case”, out caseObject))
{
ICase theCase = caseObject as ICase;
// Get attached data
string urlField = theCase.MainInteraction.GetAttachedData(“AttachedDataX”) as string;
}

Or Even Parties of interaction but i keep getting null values.
container is passed in constructor.

Have you Sample Genesyslab.Desktop.Modules.ExtensionSample?

Just small update in CustomCommand.cs:

	// Get the parameter
	IInteractionVoice interactionVoice = parameters["CommandParameter"] as IInteractionVoice;
            string strANI = interactionVoice.GetAttachedData("ANI") as string;

	// Prompt the alert dialog
	return MessageBox.Show("Do you really want to release this call from " + strANI + "?\r\nThe call",
		"Release the call?", MessageBoxButton.YesNo) == MessageBoxResult.No;