Tutorial: RCC

The scope of this tutorial is to learn, how to create a source module which uses the RCC Api.

We will make use of the json_api framework, which allows us to encapsulate our code in a seperate source file, with well defined interfaces to the rest of the App.
The tutorial is based on a newly created innovaphone App with the Visual Studio plugin.

Basic ideas

The messages related to the RCC Api are identified by a property "api" having the value "RCC". The json_api within the AppWebsocket library is used to route all messages with this property to the code, which registered to handle this Api.

There may be multiple PBXs, from which a AppWebsocket connection is established, which provides this Api, so one object is used to keep a list of all these connections an other global information.

For each AppWebsocket connection another object is used to keep the status information

Step by step

The used file and class names in this example are based on a newly created App with the name NewApp1 and the company name innovaphone.

Your filenames might be different according to your settings.

Define the data structures in a new header file rccapi.h

Add sceleton implementations to the functions of the new classes

Add the new files to the makefile

In NewApp1.mak add the following rule

APP_OBJS += $(OUTDIR)/obj/rccapi.o
$(OUTDIR)/obj/rccapi.o: NewApp1/rccapi.cpp

At this point the project should run a build without an error. You should check this.

Integrate the new code in NewApp1

Run the new code

Run the App and check in the log file what is happening.