You are on page 1of 6

Hermes.

Net V4

IVR How to : Create and call a DLL in OnData

Hermes.Net V4/v5

Auteur : Hicham Lhachimi


Version: 1.0

Copyright © 2001-2008 VOCALCOM S.A., 7 rue de Tilsitt 75017 PARIS – FRANCE. Tous droits réservés. 1/6
Hermes.Net V4

Desciption

This technical note explains how to create a DLL in C # and use it in an IVR function.

Create a DLL

In Visual Studio, create a new project of type « Class Library »

In « solution explorer » window, select the file « Class1.CS » (of course this file can be renamed as you need to).

Copyright © 2001-2008 VOCALCOM S.A., 7 rue de Tilsitt 75017 PARIS – FRANCE. Tous droits réservés. 2/6
Hermes.Net V4

Here is the code used in our DLL example.

using System;
using System.Collections.Generic;
using System.Text;

namespace Hello_DLL
{
public class CallClass
{
public static string SayHello(string name)
{
return("Hello" + name);
}
}
}

Once your code is completed (or for single test), then build the DLL

Result of the compilator :

Copyright © 2001-2008 VOCALCOM S.A., 7 rue de Tilsitt 75017 PARIS – FRANCE. Tous droits réservés. 3/6
Hermes.Net V4

Use of the DLL in OnData


Copy the generated DLL in Ondata directory  "Hello_DLL.dll" in « d:\hermes_net_v4\OnData\Service\ »

Copyright © 2001-2008 VOCALCOM S.A., 7 rue de Tilsitt 75017 PARIS – FRANCE. Tous droits réservés. 4/6
Hermes.Net V4

In IVR_PLUGINS subfolder, open "IVR_EXTERNAL_FCT.DEF" file and add following ligne


« D:\hermes_net_v4\OnData\Service\Hello_DLL.dll » and save. This will inform OnData the path of your new dll.

Open the file "IVR_EXTERNAL_FCT.CS" to add your function prototype provided by your DLL.

Copyright © 2001-2008 VOCALCOM S.A., 7 rue de Tilsitt 75017 PARIS – FRANCE. Tous droits réservés. 5/6
Hermes.Net V4

Test of the DLL integration

For test purposes, you will find in folder "d:\hermes_net_v4\OnData\" a test program called
« Test_Ivr_Custom_Cde.exe ».
Fill function name and parameters and click Call, which will have the effect of calling the created function.

Same using Hello_DLL function described in your document.

To call this function from an IVR use document : 28_Custom_Functions_IVR_EN ».

Copyright © 2001-2008 VOCALCOM S.A., 7 rue de Tilsitt 75017 PARIS – FRANCE. Tous droits réservés. 6/6

You might also like