Video Call business logic mainly realizes the call request process Control between two terminal PC, mobile phone, pad and so on, including requesting request, replying to reply, starting start and ending finish can be visualized as the process of dialing, waiting, calling and hanging off.
The following is an example of anychat video calling business logic
1. Business logic Flowchart
Please refer to Http://bbs.anychat.cn/forum.php?mod=viewthread&tid=150&extra=page%3D1
2. API interface and constant definition
Client-related API interfaces and event callbacks
Video Call message notification callback function definition
Typedefvoid (CALLBACK * brac_videocallevent_callback) (DWORD dwEventType, Dworddwuserid, DWORD Dwerrorcode, DWORD DwFlags, DWORD dwparam, LPCTSTR lpuserstr,lpvoid lpuservalue);
Set up a video call message notification callback function
Brac_apidword brac_setvideocalleventcallback (Brac_videocallevent_callback lpfunction,lpvoid lpUserValue);
Video Call event control request, reply, hang up, etc.
Brac_apidword Brac_videocallcontrol (DWORD dwEventType, DWORD Dwuserid, Dworddwerrorcode, DWORD DwFlags, DWORD Dwparam, LPCTSTR lpuserstr);
Server-related API interfaces and event callbacks
Video Call message notification callback function definition
Typedefdword (CALLBACK * bras_onvideocallevent_callback) (DWORD dwEventType, Dworddwsrcuserid, DWORD Dwtaruserid, DWORD Dwerrorcode, DWORD dwFlags, Dworddwparam, LPCTSTR lpuserstr, lpvoid lpuservalue);
Set up a video call message notification callback function
Bras_apidword Bras_setonvideocalleventcallback (bras_onvideocallevent_callbacklpfunction, LPVOID LpUserValue=NULL) ;
Video Call event control request, reply, hang up, etc.
Bras_apidword Bras_videocallcontrol (DWORD dwEventType, DWORD Dwuserid, Dworddwerrorcode, DWORD DwFlags, DWORD Dwparam, LPCTSTR lpuserstr);
Constant definition
/Video Call event type definition Apibras_videocallcontrol incoming parameter, onvideocallevent callback parameter
#defineBRAS_VIDEOCALL_EVENT_REQUEST 1///< Call request
#defineBRAS_VIDEOCALL_EVENT_REPLY 2///< Call request reply
#defineBRAS_VIDEOCALL_EVENT_START 3///< Video Call session start Event
#defineBRAS_VIDEOCALL_EVENT_FINISH 4///< Hang up end call session
3. Related instructions
3.1, client Apibrac_videocallcontrol and callback function Brac_videocallevent_callback in Dwuserid are the caller's user ID
3.2, the callee refused to send a call when the reply reply instructions dwerrorcode=100104
3.3, the callee agreed to send a reply to the call reply instruction dwerrorcode=0 then the server will send a call to both parties start command Dwparam=roomid room number is automatically assigned by the core server
3.4, the end of the call, any party including the business Server can send the end of the finish command and then the server will send the end of the call finish command
3.5, the Business Server can intervene the call process after Bras_onvideocallevent_callback receives the call request instruction returns 0 to allow the call otherwise the error code does not allow the call during the session can send the end finish instruction to force hang up the call of the specified user
3.6, the API interface Dwparam Integer, LPUSERSTR strings are user-defined purposes
3.7, a user can only initiate one call request at the same time can only be called by one user
3.8, Video Call business process can be separated from the business Server by the core server independent support can not need to do two development on the server side.
&4& is about to change the traditional inter-personal business between enterprises instant communication ANYCHATSDK high quality for most industries and enterprises more efficient communication across platforms provides the possibility for communication between various terminals
This article is from "Master no matter" blog, please be sure to keep this source http://8929479.blog.51cto.com/8919479/1583981
Video conferencing, video chat, mobile video, cross-platform video How to develop the process chapter