Video Call transaction logic first of all the two terminals (PC, mobile phone, pad, etc.) between the call pleading process control, including the Request, Reply (Reply), start (start) and finished (finish) and other processes, can be visually understood as the process of the Call: Dial, wait, Call, hang up.
The following is an example of Anychat Video Call transaction logic:
1. Transaction Logic Flowchart
See http://bbs.anychat.cn/forum.php?mod=viewthread&tid=150&extra=page=1
2, API interface and constant definition
Client about API interface and things callback:
Video Call audio tells the callback function definition
typedef void (CALLBACK *brac_videocallevent_callback) (DWORD dwEventType, DWORD Dwuserid, Dworddwerrorcode, DWORD DwFlags, DWORD dwparam, LPCTSTR lpuserstr, Lpvoidlpuservalue);
Set Video call audio to tell callback function
Brac_api Dwordbrac_setvideocalleventcallback (Brac_videocallevent_callback lpfunction, LPVOIDlpUserValue);
Video Call thing manipulation (pleading, replying, hanging off, etc.)
Brac_api Dwordbrac_videocallcontrol (DWORD dwEventType, DWORD Dwuserid, DWORD Dwerrorcode,dword DwFlags, DWORD Dwparam, LPCTSTR lpuserstr);
Server about API interface and things callback:
Video Call audio tells the callback function definition
typedef DWORD (CALLBACK *bras_onvideocallevent_callback) (DWORD dwEventType, DWORD Dwsrcuserid, Dworddwtaruserid, DWORD Dwerrorcode, DWORD DwFlags, DWORD Dwparam, LPCTSTRLPUSERSTR, LPVOID lpuservalue);
Set Video call audio to tell callback function
Bras_api dwordbras_setonvideocalleventcallback (bras_onvideocallevent_callback LpFunction,LPVOID LpUserValue=NULL) ;
Video Call thing manipulation (pleading, replying, hanging off, etc.)
Bras_api Dwordbras_videocallcontrol (DWORD dwEventType, DWORD Dwuserid, DWORD Dwerrorcode,dword DwFlags, DWORD Dwparam, LPCTSTR lpuserstr);
Constant definition
/Video Call thing type definition (api:bras_videocallcontrol incoming parameter, onvideocallevent callback parameter)
#defineBRAS_VIDEOCALL_EVENT_REQUEST 1///< Call pleading
#defineBRAS_VIDEOCALL_EVENT_REPLY 2///< Call pleading reply
#defineBRAS_VIDEOCALL_EVENT_START 3///< Video Call session start things
#defineBRAS_VIDEOCALL_EVENT_FINISH 4///< Hang Up (finished) Call session
3, the relevant instructions
3.1, the Client API (Brac_videocallcontrol) and the callback function (Brac_videocallevent_callback) in the Dwuserid are the other party (callee) user ID;
3.2, the caller rebuffed the call, send a reply (Reply) instructions, dwerrorcode=100104;
3.3, the callee agreed to the call, send a reply (Reply) instructions, dwerrorcode=0, and then the server will send to both sides of the call beginning (start) instructions, Dwparam=roomid, room number by the central server automatically assigned;
3.4, after the call, either party (including the Transaction Server) can send complete instructions, and then the server will send to both sides of the call completion (finish) instructions;
3.5, the Transaction server can interfere with the call process: After the Bras_onvideocallevent_callback received the call request instruction, return 0 means to accept the call, otherwise the error code, do not accept the call; In the session process can send the finished command, Forcibly hangs up the call of the specified user;
3.6, the API Interface Dwparam (integer), Lpuserstr (string) are user-defined use;
3.7, a user together can only suggest a call to plead, also together can only be a user call;
3.8. The video call transaction process can be separated from the transactional server and supported independently by the central server, without the need to develop two times on the server side.
Video through the process API call operation control