PureConnect

 View Only
Discussion Thread View
  • 1.  How to Disconnect() a call with IceLib?

    Posted 11-29-2017 16:49
    I am having difficulty disconnecting an interaction. I am simply calling the `.Disconnect()` method on the Interaction object but nothing is happening. It could be how I am obtaining the interaction object giving an Id. Here is my code public JsonpResult Disconnect(long interactionId) { var resource = new BaseResource(); try { var interaction = GetInteraction(interactionId); interaction.Disconnect(); resource.IsSuccess = true; resource.HttpCode = 200; } catch (Exception ex) { resource.Error = ex.Message; resource.InnerError = (ex.InnerException == null) ? "" : ex.InnerException.ToString(); resource.HttpCode = (int)System.Net.HttpStatusCode.SeeOther; } return new JsonpResult(resource); } When the call in in "Proceeding" state, the request hangs on the `interaction.Disconnect()` until the other party picks up. But even then, the code proceed but it does not hang up the call. Here is how I fetch for the interaction giving the interactionId. private Interaction GetInteraction(long interactionId) { var id = new InteractionId(interactionId); var interaction = GetInteractionManager().CreateInteraction(id); if (interaction == null) { throw new Exception("Unable to find the interaction"); } return interaction; } What am I doing wrong here? How can I Disconnect() the call?


  • 2.  RE: How to Disconnect() a call with IceLib?

    GENESYS
    Posted 12-11-2017 18:20
    Originally posted by malhayek;36347
    I am having difficulty disconnecting an interaction. I am simply calling the `.Disconnect()` method on the Interaction object but nothing is happening. It could be how I am obtaining the interaction object giving an Id. Here is my code public JsonpResult Disconnect(long interactionId) { var resource = new BaseResource(); try { var interaction = GetInteraction(interactionId); interaction.Disconnect(); resource.IsSuccess = true; resource.HttpCode = 200; } catch (Exception ex) { resource.Error = ex.Message; resource.InnerError = (ex.InnerException == null) ? "" : ex.InnerException.ToString(); resource.HttpCode = (int)System.Net.HttpStatusCode.SeeOther; } return new JsonpResult(resource); } When the call in in "Proceeding" state, the request hangs on the `interaction.Disconnect()` until the other party picks up. But even then, the code proceed but it does not hang up the call. Here is how I fetch for the interaction giving the interactionId. private Interaction GetInteraction(long interactionId) { var id = new InteractionId(interactionId); var interaction = GetInteractionManager().CreateInteraction(id); if (interaction == null) { throw new Exception("Unable to find the interaction"); } return interaction; } What am I doing wrong here? How can I Disconnect() the call?
    Your close change: var interaction = GetInteractionManager().CreateInteraction(id); To: var interaction = interactionManager.CreateInteraction(new InteractionId(id)); I fell into this same trap once, it seems the overload for long does not work so you need to pass in an InteractionId object.


  • 3.  RE: How to Disconnect() a call with IceLib?

    Posted 12-11-2017 22:07
    I don't understand. My code works fine. However, it does not hangup the call until the call is picked up. In another word, when the call is "Proceeding" I can't disconnect it. But I can disconnected it when it connect. Here is the code the GetInteractionManager private InteractionsManager InteractionsManager { get; set; } protected InteractionsManager GetInteractionManager() { if (InteractionsManager == null) { var session = ConnectionManager.GetSessionCapsule(GetDefaultServer()).Session; InteractionsManager = InteractionsManager.GetInstance(session); } if (InteractionsManager == null) { throw new Exception("Unable to create an Interaction Manager instance."); } return InteractionsManager; }