Agent event center(AEC)

AEC=agent eventCenter, and it is similar to the WeChat official account development, used to interact with the server program.

1 AEC event notification

You need to implement the server API in a language that you are familiar with. And we call it the AEC URL, which is used to receive event notifications from the starRTC server program.

The starRTC server program will send an HTTP POST request to your AEC URL to exchange data.
After receiving the event notification from the starRTC server program, your server needs to respond according to the corresponding business logic.

2 AEC processing logic

Suppose the AEC URL which you configure (you can configured in the server program configuration file starrtc.conf, and you need to restart the server program after modification): http://www.yoursite.com/eventCenter.php

Then the starRTC server program will send the data to your url when the event occurs.

https://www.yoursite.com/eventCenter.php?data=jsonStr

The data parameter is the information that you need to process the business logic, and it is a json string;

After processing, you need to return a json string of the following specific format to respond to the starRTC server program:

//status: 	"1" of string type indicates success, "0" indicates failure
//data: The data is according to the requirements of different events when it runs successfully . while it fails, you can put error code information.
{"status":"x","data":"xxxxx"}

The AEC URL sample code is as follows:https://github.com/starrtc/starrtc-server/tree/master/server-api

3 Server development process

1,receive data

2,Judge the type of action and respond, such as creating a group action as AEC_GROUP_CREATE, deleting group action as AEC_GROUP_DEL, etc.