Author Topic: IWS Customisation - Add a Make Call Function  (Read 5279 times)

Offline joy900

  • Newbie
  • *
  • Posts: 2
  • Karma: 0
IWS Customisation - Add a Make Call Function
« on: November 11, 2013, 04:37:22 AM »
Hi,

I am completely new to Genesys. I wanted to do a simple IWS customisation but due to limited resources/samples available online, I failed to make it work after trying for a whole week.

What needed is just to add in a make call button (similar to the built-in call button in the DialerRegion).

I have no idea which namespace/method/API I should use. I tried the IAgent, IMedia, IMediaVoice namespaces but have not figured out the correct way to do it. There is a MakeCall() method provided by IMediaVoice interface which I think is what I need, but how to use it?

I am so lost and hopefully someone can put me on the right track. Help greatly appreciated!

--------------------------------------------

IAgent agent;

public MySampleView(IMyExtensionSampleViewModel mySampleViewModel, IObjectContainer container)
{
            this.Model = mySampleViewModel;

            InitializeComponent();

            Width = Double.NaN;
            Height = Double.NaN;
            MinSize = new MSize() { Width = 400.0, Height = 400.0 };
                       
            agent = container.Resolve<IAgent>();
            agent.LoadMediaExtension();
}

private void btnOK_Click(object sender, System.Windows.RoutedEventArgs e)
{
            IMedia media = agent.FirstMediaVoice;
            IMediaVoice mv = (IMediaVoice)media;

            bool status = mv.MakeCall("1000", "", Genesyslab.Enterprise.Model.Interaction.MakeCallType.DirectAgent, null, null, null, "");
}

--------------------------------------------

InteractionWorkspace.Voice.MediaVoice.Voice.MediaVoice: 13-11-11 12:31:28.129 [ 1] INFO  ice.Voice.MediaVoice - MakeCall CallNumber '1000' Location 'place_1000' , CorrelatorData '' [voice, AgentId:test, Switch_UniSIM(2000)]
ESDK: 13-11-11 12:31:28.129 [ 1] DEBUG ESDK - [IVoiceService] AddChannel(SIP Server_UniSIM) [Uri] tcp://10.30.50.20:3000/
ESDK: 13-11-11 12:31:28.134 [ 1] DEBUG ESDK - Adding handler System.Action`1[Genesyslab.Enterprise.Model.Envelope.IEnvelope`1[Genesyslab.Enterprise.Model.Interaction.IInteraction]] to channel [Name] SIP Server_UniSIM (FQN=272ab2d9-7899-41aa-acee-f76fdda1397c)
ESDK: 13-11-11 12:31:28.134 [26] DEBUG ESDK - Found constructor with 1 parameters
ESDK: 13-11-11 12:31:28.134 [26] DEBUG ESDK - Media object MakeCall created
ESDK: 13-11-11 12:31:28.134 [26] DEBUG ESDK - [FindSwitchPolicyForGroupOfDevices] Found Switch Policy SIPSwitch::8.0.4 on [Device] Switch_UniSIM
ESDK: 13-11-11 12:31:28.134 [26] DEBUG ESDK - [GetVirtualDevice] Virtual Device is ?
InteractionWorkspace.Windows.ToolbarWindow: 13-11-11 12:31:28.139 [ 1] DEBUG indows.ToolbarWindow - ToolbarWindow.ArrangeOverride (857,504)
ESDK: 13-11-11 12:31:28.139 [26] WARN  ESDK - [GetVirtualMessage] No Switch Policy profile found for [Request] RequestMakeCall
InteractionWorkspace.Voice.MediaVoice.Voice.MediaVoice: 13-11-11 12:31:28.184 [ 1] ERROR ice.Voice.MediaVoice - MakeCall, Exception  [voice, AgentId:test, Switch_UniSIM(2000)]
Genesyslab.Enterprise.Exceptions.Protocol.ProtocolException: Agent has no valid DN

Server stack trace:
  at Genesyslab.Enterprise.Protocols.VoiceProtocolRequest.MakeCall(Object[] list)
  at Genesyslab.Enterprise.Protocols.VoiceProtocolRequest.Parse(String command, Object[] list)
  at Genesyslab.Enterprise.Protocols.ProtocolRequest.With(Object[] list)
  at Genesyslab.Enterprise.Extensions.InteractionServiceExtensions.MakeCall(Object[] list)
  at System.Runtime.Remoting.Messaging.StackBuilderSink._PrivateProcessMessage(IntPtr md, Object[] args, Object server, Int32 methodPtr, Boolean fExecuteInContext, Object[]& outArgs)
  at System.Runtime.Remoting.Messaging.StackBuilderSink.PrivateProcessMessage(RuntimeMethodHandle md, Object[] args, Object server, Int32 methodPtr, Boolean fExecuteInContext, Object[]& outArgs)
  at System.Runtime.Remoting.Messaging.StackBuilderSink.AsyncProcessMessage(IMessage msg, IMessageSink replySink)

Exception rethrown at [0]:
  at System.Runtime.Remoting.Proxies.RealProxy.EndInvokeHelper(Message reqMsg, Boolean bProxyCase)
  at System.Runtime.Remoting.Proxies.RemotingProxy.Invoke(Object NotUsed, MessageData& msgData)
  at Genesyslab.Enterprise.Extensions.Proxy`1.EMethodDelegate.EndInvoke(IAsyncResult result)
  at Genesyslab.Enterprise.Extensions.Proxy`1.BeginInvoke(IThreadSafeDictionary`2 proxyDict, EMethodDelegate functionDelegate, AsyncCallback callBack, Object context, String correlatorData, Object[] list)
  at Genesyslab.Enterprise.Extensions.InteractionServiceExtensions.BeginMakeCall(IVoiceService service, IAgent agent, IClientChannel channel, String otherDN, MakeCallType makeCallType, String location, KeyValueCollection userData, KeyValueCollection reasons, KeyValueCollection extensions, Int32 timeOut, AsyncCallback callBack, Object context, String correlatorData)
  at Genesyslab.Enterprise.Extensions.InteractionServiceExtensions.MakeCall(IVoiceService service, IAgent agent, IClientChannel channel, String otherDN, MakeCallType makeCallType, String location, KeyValueCollection userData, KeyValueCollection reasons, KeyValueCollection extensions, Int32 timeOut, String correlatorData)
  at Genesyslab.Enterprise.Extensions.InteractionServiceExtensions.MakeCall(IVoiceService service, IAgent agent, IClientChannel channel, String otherDN, MakeCallType makeCallType, String location, KeyValueCollection userData, KeyValueCollection reasons, KeyValueCollection extensions, String correlatorData)
  at Genesyslab.Desktop.Modules.Voice.Model.Agents.MediaVoice.MakeCall(String phoneNumber, String location, MakeCallType makeTypeCall, KeyValueCollection userData, KeyValueCollection reasons, KeyValueCollection extensions, String correlatorData)
false

Offline Kubig

  • Hero Member
  • *****
  • Posts: 2752
  • Karma: 44
Re: IWS Customisation - Add a Make Call Function
« Reply #1 on: November 11, 2013, 10:18:00 AM »
Without deep knowledge how Genesys works or without training for developers is very hard to do anything in Genesys, especially in Genesys SDK. I would recommend to you contact Genesys and visit the training for clearly understanding of Genesys processes and mechanism. As next thing is necessary to understand WPF mechanism, especially MVVM of course.

Back to the issue, from exception you can see what is the root cause - Agent has no valid DN - may be bad initialization of requested objects or bad using objects. For me is little strange that you are using interfaces without any DI resolving, etc. I never tried similiar funcionality, because cannot see any advantage or business needs for doing this, with respect to that IWS has this funcionality at this time.

Offline joy900

  • Newbie
  • *
  • Posts: 2
  • Karma: 0
Re: IWS Customisation - Add a Make Call Function
« Reply #2 on: November 12, 2013, 02:17:36 AM »
I wish I could attend some training sessions too but training is not an option at the moment.

IWS does come with the functionality to make call by typing the contact number into the search field at the ToolbarDialerRegion. The reason I need to add in a make call button with similar functionality is because I need to programatically add a prefix to the contact number entered by the agent based on the department selected from a combo box.

Alternatively, I can pass in my <prefix><contact number entered> value into the search field. But I have no idea how to acess the existing textbox either. Is it possible to access and set the value of the ToolbarDialerRegion's search field?

Offline Kubig

  • Hero Member
  • *****
  • Posts: 2752
  • Karma: 44
Re: IWS Customisation - Add a Make Call Function
« Reply #3 on: November 12, 2013, 05:22:23 AM »
For this purpose there are commands. Use commands (BeforeMakeCall or something like that) and put your behavior before the call is maded, it is a much easier way All about commands are in the dev guide.