Getting Started

Setup

Sign up for a demo

When you sign up for a demo you’ll get credentials to connect to our cloud service.

You’ll also be given a link to download the DLL’s that you’ll need to reference in your Voice Elements Project.

Install Voice Elements

Click through the installer to get everything you need installed to your system. As an added bonus, the demo includes a version of the premise based Voice Elements Server.

Open up the Skeleton Project

In the Voice Elements Developer directory there will be a Visual Studio Solution that contains a basic blueprint for creating your Voice Elements application. It is the “VE.zip” zip file in the C:\Program Files\Inventive Labs\Voice Elements Platform\Voice Elements Developer\Projects directory.

About the Skeleton Application

The skeleton project is a template for a windows service, and contains the basic building blocks for getting connected to a Voice Elements Server and placing calls.

IvrApplication.cs

Connect to a Voice Elements Server:

s_TelephonyServer = new TelephonyServer(@"gtcp://bank.voiceelements.com:54331"); // Connect to our cloud service

The RegisterDnis() method tells your server which phone numbers you would like your application to handle.

You’ll need to register to the new call event to tell your application what you would like to do when you receive a call. As you can see we create a new instance of the SampleIvr class, set the channel resource, and call the RunScript() method of the SampleIvr class. This is where we’ll put all of our logic for handling an inbound call.

s_TelephonyServer.NewCall += new VoiceElements.Client.NewCall(s_TelephonyServer_NewCall);

static void s_TelephonyServer_NewCall(object sender, VoiceElements.Client.NewCallEventArgs e)
{
            SampleIvr Ivr = new SampleIvr();
            Ivr.ChannelResource = e.ChannelResource;

            Ivr.RunScript();
}

The sample IVR class contains all of the logic that we want to run in this call. In this call, we answer the call, play a text to speech message, and hangup. We put all of the logic in the RunScript() method. Notice how we use the Voice Resource to play a message. We use Voice Resource functions to interact with the user.

    public class SampleIvr
    {
        private ChannelResource m_ChannelResource;
        public ChannelResource ChannelResource
        {
            get
            {
                return m_ChannelResource;
            }
            set
            {
                m_ChannelResource = value;
            }
        }

        private VoiceResource m_VoiceResource;
        public VoiceResource VoiceResource
        {
            get;
            set;
        }

        public SampleIvr(ChannelResource channelResource)
        {
            m_ChannelResource = channelResource;
        }

        public void RunScript()
        {
            try
            {
                m_ChannelResource.Answer(); // Answers the phone call
                m_VoiceResource = m_ChannelResource.VoiceResource; // Get the associated voice resource.
                m_VoiceResource.PlayTTS("You've answered your first call from Voice Elements"); // Play TTS
            }
            catch (HangupException hex)
            {
                IvrApplication.Log.Write("Hangup!");
            }
            catch (Exception ex)
            {
                IvrApplication.Log.WriteException(ex, "SampleIvr::RunScript. Unexpected Exception!");
            }
            finally
            {
                try
                {
                    IvrApplication.Log.Write("Hanging up on user!");
                    ChannelResource.Disconnect();
                }
                catch { }

                try
                {
                    ChannelResource.Dispose();
                }
                catch
                { }
            }
        }
    }

What Now?

You’ll want to review our basic functions documentation. It reviews how to dial out, get digits, play files, play text-to-speech, and perform transfers.

Another good resource is to review our VE Sampler project. It contains excellent examples of how to perform common telephony functions. We DO NOT recommend building your application in the VE Sampler because it is an interactive application (not a service). We recommend building your application using the Voice Elements Skeleton Project.

Our Samples contain basic, but fully functional applications that are excellent examples of how you should structure your Voice Elements Application. Many of these Samples can be used as a starting point for your own application.

Our documentation covers other topics more in-depth. A good starting point is to review the documentation on Voice Resources, and our documentation on Channel Resources which are the building blocks for building any Voice Elements application.