Version: v1.4.0

Methods

Only the built-in attributes come after an underscore; the custom attributes do not.

Lifecycle

Creates a Single AgoraSDK Instance (getAgoraSDKInstanceWin)

This method creates a single AgoraSDK instance.

IAgoraAPI* getAgoraSDKInstanceWin(char const * appId, size_t appId_size);
Parameter Description
appId The App ID. See Get an App ID.

Creates Multiple AgoraSDK Instances (createAgoraSDKInstanceWin)

This method creates multiple AgoraSDK instances.

agora_sdk_win::IAgoraAPI* createAgoraSDKInstanceWin(char const * appId, size_t appId_size);
Parameter Description
appId The App ID. See Get an App ID.

Destroys the AgoraAPIOnlySignal Instance (destroy)

This method destroys the AgoraSDK instance.

public virtual void destroy ();

Set a Callback (callbackSet)

This method sets a callback.

public virtual void callbackSet (ICallBack* handler) ;
Parameter Description
handler A handler of ICallBack.

Avoid using synchronous or block callback operations. Otherwise, the signaling system may crash. To avoid memory leakage, delete the instance pointer which was set by callbackSet the last time your app logged out of the signaling system.

Retrieves the Callback (callbackGet)

This method retrieves an ICallBack object.

public ICallBack* callbackGet () ;
Return Value Description
ICallBack An object of ICallBack.

Login

Log into Agora's Signaling System (login)

Use this method to log into Agora’s signaling system. Users must log in before performing any operations.

public virtual void login (char const * appId, size_t appId_size,char const * account, size_t account_size,char const * token, size_t token_size,uint32_t uid,char const * deviceID, size_t deviceID_size) ;
  • When login is successful, the onLoginSuccess callback function is triggered.
  • When login fails, the onLoginFailed callback function is triggered.
  • When the connection to the server is lost, the onLogout callback function is triggered.
Parameter Description
appId The App ID provided by Agora. For more information, see Get an App ID.
account The user ID defined by the client, which can be up to 128 visible characters (space is not allowed). It can be a uid, nickname, guid, or other content, as long as it is unique. The account parameters in this document follow this rule.
token The SignalingToken generated by App ID and App Certificate. See How to Get and Use a SignalingToken for details.
uid Obsolete: Set it to 0.
deviceID Set it to NULL.

You can skip generating a token in a test environment by setting token to _no_need_token. However, Agora does not recommend this in a production environment. By default, if you are already logged in, the login call will be ignored. To cancel the previous login, you can call logout first without having to wait until it is successfully executed.

Log into Agora's Signaling System (login2)

Use this method to log into Agora’s signaling system. Users must always log in before performing any operations.

public virtual void login2 (char const * appId, size_t appId_size,char const * account, size_t account_size,char const * token, size_t token_size,uint32_t uid,char const * deviceID, size_t deviceID_size,int retry_time_in_s,int retry_count) ;
  • When login is successful, the onLoginSuccess callback function is triggered.
  • When login fails, the onLoginFailed callback function is triggered.
  • When the connection to the server is lost, the onLogout callback function is triggered.
Parameter Description
appId The App ID provided by Agora. For more information, see Get an App ID.
account The user ID defined by the client, which can be up to 128 visible characters (space is not allowed). It can be a uid, nickname, guid, and other content, so long as it is unique. The account parameters in this document follow this rule.
token The SignalingToken generated by App ID and App Certificate. See How to Get and Use a SignalingToken for details.
uid Obsolete: Set it to 0.
deviceID Set it to NULL.
retry_time_in_s The maximum time allowed to re-login, 30 seconds by default.
retry_count The maximum times allowed to re-login, 3 times by default.

You can skip generating the token in a test environment by setting token to _no_need_token. However, Agora does not recommend this in a production environment. onLoginFailed will be triggered and reconnection stopped when either retry_time_in_s or retry_count is reached.

Log out of Agora's Signaling System (logout)

This method logs out of Agora's Signaling system and triggers the onLogout callback function when called successfully.

public virtual void logout () ;

Queries the User Status (queryUserStatus)

This method checks whether the user is online or not. Calling this method triggers the onQueryUserStatusResult callback function.

public virtual void queryUserStatus (char const * account, size_t account_size) ;
Parameter Description
account Account of the user.

Sets the User Attributes (setAttr)

This method sets the user attributes.

public virtual void setAttr (char const * name, size_t name_size,char const * value, size_t value_size) ;
Parameter Description
name The attribute name, which can be up to 128 visible characters. For example, _conn_timeout is the built-in attribute, which refers to the offline timeout in seconds. It is set to 120 s by default and ranges between 20 s and 120 s. The SDK automatically readjusts any setting below 20 s to be 20 s and any setting exceeding 120 s to be 120 s.
value The attribute value, which can be up to 1024 visible characters.

Retrieves Your User Attributes (getAttr)

This method retrieves your user attributes and triggers the onUserAttrResult callback function when called successfully.

public virtual void getAttr (char const * name, size_t name_size) ;
Parameter Description
name

Attribute name.

It can be up to 128 visible characters

Retrieves all Your Attributes (getAttrAll)

This method retrieves all your attributes. You will receive the onUserAttrAllResult callback function when this method is called successfully.

public virtual void getAttrAll () ;

Retrieves the Attributes of a Specific User (getUserAttr)

This method allows the user to retrieve the attributes of a specific user. The user receives the onUserAttrResult callback function.

public virtual void getUserAttr (char const * account, size_t account_size,char const * name, size_t name_size) ;
Parameter Description
account User ID defined by the client.
name

Attribute name.

It can be up to 128 visible characters

Retrieves all Attributes of a Specific User (getUserAttrAll)

This method allows the user to retrieve all attributes of a specific user. The user will receive the onUserAttrAllResult callback function when this method is called successfully.

public virtual void getUserAttrAll (char const * account, size_t account_size) ;
Parameter Description
account User ID defined by the client.

Remote Calling Process (invoke:req:callID:)

This method is used for the remote calling process and triggers the onInvokeRet callback function when this method is called successfully.

public virtual void invoke (char const * name, size_t name_size,char const * req, size_t req_size,char const * callID, size_t callID_size) ;
Function Parameter Settings and Returns
Queries the user status.
  • name: io.agora.signal.user_query_user_status
  • req: {“account”:account of the user}
  • Returns: status(1:online; 0:offline)
Sets a user attribute.
  • name: io.agora.signal.user_set_attr
  • req: {“name”:attribute name,”value”:attribute value}
Retrieves a user attribute.
  • name: io.agora.signal.user_get_attr
  • req: {“account”:account of the user,”name”:attribute name}
  • Returns: {“value”:attribute value}
Retrieves all attributes of a user.
  • name: io.agora.signal.user_get_attr_all
  • req: {“account”:account of the user}
  • Returns: The JSON value of all attributes
Retrieves the number of the users in a channel.
  • name: io.agora.signal.channel_query_num
  • req: {“name”:channel name}
  • Returns: All users in the channel
Checks if a user is in a specific channel.
  • name: io.agora.signal.channel_query_user_isin
  • req: {“name”:channel name,”account”:account of the user}
  • Returns: isin(1: in the channel; 0:not in the channel)
Retrieves a list of the users in a channel.
  • name: io.agora.signal.channel_query_userlist
  • req: {“name”:channel name}
  • Returns: {“num”:number of the users in the channel,”list”:the latest user}
Retrieves a list of the latest users in a channel.
  • name: io.agora.signal.channel_query_userlist_all
  • req: {“name”:channel name,”num”:number (by default 1000*1000)}
  • Returns: {“num”:number of the users in the channel,”list”:the latest users}
  • Agora recommends using it on the server. If using it on the client, pay attention to the limit on the usage frequency.
Clears all attributes of a specific channel.
  • name: io.agora.signal.channel_clear_attr
  • req: {“channel”:channel name}
Deletes an attribute of a specific channel.
  • name: io.agora.signal.channel_del_attr
  • req: {“channel”:channel name,”name”:attribute name}
Sets an attribute of a specific channel.
  • name: io.agora.signal.channel_set_attr
  • req: {“channel”:channel name,”name”:attribute name,”value”:value name}

Sends a Point-to-point Message (messageInstantSend)

This method sends a point-to-point message to a specified user.

When this method is called successfully, the sender receives the onMessageSendSuccess callback function, and the receiver receives the onMessageInstantReceive callback function.

If the method fails, the sender receives the onMessageSendError callback function.

public virtual void messageInstantSend (char const * account, size_t account_size,uint32_t uid,char const * msg, size_t msg_size,char const * msgID, size_t msgID_size) ;
Parameter Description
account User ID defined by the client.
uid N/A: Set as 0.
msg Message body. Each message must not exceed 8 KB visible characters.
msgID Message ID. Agora recommends setting it to “”, allowing the SDK to generate and assign the msgID and to ensure its uniqueness.

Channel

Allows a User to Join a Channel (channelJoin)

This method allows a user to join a specified channel.

Once the user joins a channel, the user receives the onChannelJoined callback function, and the other users in the same channel receive the onChannelUserJoined callback function. If the user fails to join a specified channel, the user receives an onChannelJoinFailed callback function.

public virtual void channelJoin (char const * channelID, size_t channelID_size) ;
Parameter Description
channelID

Channel name. It can be up to 128 visible characters and include the following special channel names and attributes:

  • _agora_user_online: All user-online or user-offline events within the current appID will be sent to this channel.
  • _agora_channel_event: All events about a user joining or leaving a channel within the current appID will be sent to this channel.

Special channels are used by servers only to receive login and channel events.

Allows a User to Leave a Channel (channelleave)

This method allows a user to leave the current channel. Once a user has left the channel, the other users in the channel will receive the onChannelUserLeaved callback function.

public virtual void channelLeave (char const * channelID, size_t channelID_size) ;
Parameter Description
channelID

Channel name.

It can be up to 128 visible characters.

Queries the Number of Users in a Channel (channelQueryUserNum)

This method allows a user to query the number of users in a specified channel. The user will receive the onChannelQueryUserNumResult callback function when this method is called successfully.

public virtual void channelQueryUserNum (char const * channelID, size_t channelID_size) ;
Parameter Description
channelID

Channel name.

It can be up to 128 visible characters.

Queries if a User is in a Channel (channelQueryUserIsIn:account:)

This method queries if a specified user is in a specified channel and triggers the onChannelQueryUserIsIn callback function when this method is called successfully.

virtual void channelQueryUserIsIn (char const * channelID, size_t channelID_size,char const * account, size_t account_size) ;
Parameter Description
channelID Channel name. Maximum length is 128 visible characters.
account User ID defined by the client.

Sets the Channel Attributes (channelSetAttr)

This method sets the channel attributes. Whenever a change is made to the attributes, all users in the channel will receive the onChannelAttrUpdated callback function.

public virtual void channelSetAttr (char const * channelID, size_t channelID_size,char const * name, size_t name_size,char const * value, size_t value_size) ;
Parameter Description
channelID Channel name, which can be up to 128 visible characters.
name Attribute name, which can be up to 128 visible characters.
value Attribute value, which can be up to 8096 visible characters.

The following table shows the built-in attributes of the parameter, name:

Attributes Description
_userNotification
  • 1: (Default) The channel sends a callback function that a user has joined or left the channel.
  • 0: The channel does not send a callback function that a user has joined or left the channel.
_channel_ttl Time (s) between the last user leaving a channel and the system destroying the channel. The default value is 7200. A special channel will never be destroyed.
_member_num Number of the users currently in the channel. It is automatically updated by the system.
_auto_update_num

Indicates whether to automatically refresh the number of the users currently in the channel.

  • 0: (Default) Disabled
  • 1 - n: Refreshing frequency (s)
_total_member_num Automatically indicates the accumulated number of the users in the channel. Similar to _member_num , _auto_update_num and _auto_update_total_num both need to be set to none zero.
_auto_update_total_num

Indicates whether to automatically refresh the number of the users currently in the channel.

  • 0: (Default) Disabled
  • 1 - n: Refreshing frequency (s) (same as _auto_update_num )
_sendmsg_limit Maximum messages allowed to be sent in the channel.
_setattr_limit Maximum times for updating a channel attribute in a second.

Deletes the Channel Attributes (channelDelAttr)

This method deletes the channel attributes. All users in the channel will receive the onChannelAttrUpdated callback function when this method is called successfully.

public virtual void channelDelAttr (char const * channelID, size_t channelID_size,char const * name, size_t name_size) ;
Parameter Description
channelID

Channel name.

It can be up to 128 visible characters.

name

Attribute name.

It can be up to 128 visible characters.

Deletes all Channel Attributes (channelClearAttr)

This method deletes all attributes of a specified channel. All users in the channel will receive the onChannelAttrUpdated callback function when this method is called successfully.

public virtual void channelClearAttr (char const * channelID, size_t channelID_size) ;
Parameter Description
channelID

Channel name.

It can be up to 128 visible characters.

Sends a Channel Message (messageChannelSend)

This method allows a user to send a channel message, and all users in the same channel receive the onMessageChannelReceive callback function.

The sender receives the onMessageSendSuccess callback function when this method is called successfully, or receives the onMessageSendError callback function if failed.

public virtual void messageInstantSend (char const * account, size_t account_size,uint32_t uid,char const * msg, size_t msg_size,char const * msgID, size_t msgID_size) ;
Parameter Description
channelID Channel name. It can be up to 128 visible characters.
msg Message body. Each channel message must not exceed 8 KB visible characters. Each user cannot send more than 60 messages per second, and the entire channel cannot send more than 1,000 messages per second.
msgID Visible characters. Message ID. Agora recommends setting it to “”, allowing the SDK to generate and assign the msgID and to ensure its uniqueness.

Calling

Initiates a Call (channelInviteUser)

This method initiates a call, that is, invites a user to join a specified channel.

Calling and joining a channel are two separate processes. The user has to call channelJoin() to join the channel. The user can either join the channel before sending a call invitation or send a call invitation before joining the channel (when the counterpart accepts the invitation).

If the call fails, the user will receive the onInviteFailed callback function. Possible reasons include:

  • The other user is offline
  • Local network issues
  • Server errors

If the caller gets a confirmation from the callee, the caller will receive the onInviteReceivedByPeer callback function, and the callee will receive the onInviteReceived callback function.

public virtual void channelInviteUser (char const * channelID, size_t channelID_size,char const * account, size_t account_size,uint32_t uid=0) ;
Parameter Description
channelID

Channel name.

It can be up to 128 visible characters.

account User ID of the other user defined by the client.
uid N/A. Set as 0.

Initiates a Call (channelInviteUser2)

Same as channelInviteUser, except for the parameters.

public virtual void channelInviteUser2 (char const * channelID, size_t channelID_size,char const * account, size_t account_size,char const * extra, size_t extra_size) ;
Parameter Description
channelID Channel name: It can be up to 128 visible characters.
account User ID of the other user defined by the client.
extra

Extra information to send to the user being called. It can be up to 8 KB visible characters and must be in JSON format. For example:

  • {“_require_peer_online”:1} If the counterpart is offline, the onInviteFailed callback function will be triggered immediately.
  • {“_require_peer_online”:0} If the counterpart is offline for more than 20 seconds, the onInviteFailed callback function will be triggered (default).
  • {“destMediaUid” : 123} Specify the uid for joining the corresponding media channel.
  • {“srcNum” : “+123456789”} Specify the phone number to be displayed on the screen of the remote phone.

You do not need to set the _require_peer_online field when making a SIP call.

Sends a DTMF (Dual-tone Multi-frequency) Message to the Other User (channelInviteDTMF)

This method sends a DTMF message to the other user by calling through the SIP gateway. The receiver will receive the onInviteMsg callback function.

public virtual void channelInviteDTMF (char const * channelID, size_t channelID_size,char const * phoneNum, size_t phoneNum_size,char const * dtmf, size_t dtmf_size) ;
Parameter Description
channelID

Channel name.

It can be up to 128 visible characters.

phoneNum Phone number of the other user.
dtmf Subsequent analog phone number (DTMF) to be entered after the call gets through.

Accepts a Call (channelInviteAccept)

This method accepts the received call request or invitation. Once this method is called, the other user will receive the onInviteAcceptedByPeer callback function.

public virtual void channelInviteAccept (char const * channelID, size_t channelID_size,char const * account, size_t account_size,uint32_t uid,char const * extra, size_t extra_size) ;
Parameter Description
channelID

Channel name.

It can be up to 128 visible characters.

account The caller’s user ID.
uid

N/A.

Set as 0.

extra

In JSON format. Can be “”.

User-defined information.

Can be used for a SIP call.

Rejects a Call (channelInviteRefuse)

This method rejects a call invitation or request. Once this method is called, the other user will receive the onInviteRefusedByPeer callback function.

public virtual void channelInviteRefuse (char const * channelID, size_t channelID_size,char const * account, size_t account_size,uint32_t uid,char const * extra, size_t extra_size) ;
Parameter Description
channelID Channel name. It can be up to 128 visible characters.
account User ID of the other user defined by the client.
uid N/A: Set as 0.
extra Extra information. It can be up to 8 KB visible characters and must be in the JSON format.

Ends a Call (channelInviteEnd)

This method ends a call after the call has been connected. The user receives the onInviteEndByMyself callback function, and the other user receives the onInviteEndByPeer callback function.

public virtual void channelInviteEnd (char const * channelID, size_t channelID_size,char const * account, size_t account_size,uint32_t uid) ;
Parameter Description
channelID

Channel name.

It can be up to 128 visible characters.

account User ID of the other user defined by the client.
uid

N/A.

Set as 0.

Miscellaneous

Retrieves the User Status (getStatus)

This method retrieves the user status.

public virtual int getStatus () ;
Return Value Description
LOGIN_STATE_NOT_LOGIN 0: The user has not logged in.
LOGIN_STATE_LOGINING 1: The user is logging in.
LOGIN_STATE_LOGINED 2: The user has logged in.
LOGIN_STATE_RECONNECTING 3: The user is reconnecting.

Retrieves the SDK Version (getSdkVersion)

This method retrieves the version of the SDK.

public virtual int getSdkVersion () ;
Return Value Description
The SDK version. For example, 1010104019 means version 1.1.4.19.

Sends a Channel Message (messageChannelSendForce)

This method sends a channel message without joining a channel. Agora does not recommend using this method at the application level.

public virtual void messageChannelSendForce (char const * channelID, size_t channelID_size,char const * msg, size_t msg_size,char const * msgID, size_t msgID_size) ;
Parameter Description
channelID The channel ID.
msg The message to send.
msgID Message ID. Agora recommends setting it to “”, allowing the SDK to generate and assign the msgID and to ensure its uniqueness.

Obsolete Interfaces

Interfaces Prototype
messageDTMFSend public virtual void messageDTMFSend (uint32_t uid,char const * msg, size_t msg_size,char const * msgID, size_t msgID_size) ;
channelInvitePhone public virtual void channelInvitePhone (char const * channelID, size_t channelID_size,char const * phoneNum, size_t phoneNum_size,uint32_t uid=0) ;
channelInvitePhone2 public virtual void channelInvitePhone2 (char const * channelID, size_t channelID_size,char const * phoneNum, size_t phoneNum_size,char const * sourcesNum, size_t sourcesNum_size) ;
channelInvitePhone3 public virtual void channelInvitePhone3 (char const * channelID, size_t channelID_size,char const * phoneNum, size_t phoneNum_size,char const * sourcesNum, size_t sourcesNum_size,char const * extra, size_t extra_size) ;
isOnline public virtual bool isOnline () ;

Callback Functions

The following callback functions are related to Agora’s signaling system.

The Connection with the Agora’s Signaling System has been Lost (onReconnecting)

This callback function is triggered when the connection to Agora’s signaling system has been lost after login.

public virtual void onReconnecting(uint32_t nretry) {}
Parameter Description
nretry The current reconnection number.

An Error has Occurred During SDK Runtime (onError)

This callback function returns a detailed description of the error.

public virtual void onError(char const * name, size_t name_size,int ecode,char const * desc, size_t desc_size) {}
Parameter Description
name Error type.
ecode

Error code. For more information, see Error Codes and Warning Codes.

  • GENERAL_E = 1000: General error.
  • GENERAL_E_FAILED = 1001: Operation failed.
  • GENERAL_E_UNKNOWN = 1002: General error - unknown.
  • GENERAL_E_NOT_LOGIN = 1003: Not logged in.
  • GENERAL_E_WRONG_PARAM = 1004: Wrong parameter.
  • GENERAL_E_LARGE_PARAM = 1005: Large parameter.
desc Description of the error.

The User Status (onQueryUserStatusResult)

This callback function returns the query result of the user status and is triggered when queryUserStatus is called.

public virtual void onQueryUserStatusResult(char const * name, size_t name_size,char const * status, size_t status_size) {}
Parameter Description
name Account of the user.
status

Status of the user: Whether the user is online.

  • 1: User is online.
  • 0: User is offline.

The Application has Reconnected to the Agora’s Signaling System (onReconnected)

This callback function is triggered when the application has reconnected to Agora’s signaling system. When the reconnection fails, the onLogout callback function will be triggered instead.

public virtual void onReconnected(int fd) {}
Parameter Description
fd Agora internal use only.

A User has Logged into the Agora’s Signaling System (onLoginSuccess)

This callback function is triggered when a user has logged into Agora’s signaling system.

public virtual void onLoginSuccess(uint32_t uid,int fd) {}
Parameter Description
fd Agora internal use only.

A User has Logged out of Agora’s Signaling System (onLogout)

This callback function is triggered when a user has logged out of Agora’s signaling system.

public virtual void onLogout(int ecode) {}
Parameter Description
ecode Error code

A User has Failed to Log into Agora’s Signaling System (onLoginFailed)

This callback function is triggered when a user has failed to log into Agora’s signaling system.

public virtual void onLoginFailed(int ecode) {}
Parameter Description
ecode Error code

The Remote Calling Process has Succeeded (onInvokeRet)

This callback function is triggered when the remote calling process has succeeded.

void onInvokeRet(String callID, String err, String resp);
Parameter Description
callID Call ID introduced by invoke()
err Error code
resp Returned JSON value

A User has Joined a Channel (onChannelJoined)

This callback function is triggered when a user has joined a channel.

public virtual void onChannelJoined(char const * channelID, size_t channelID_size) {}
Parameter Description
channelID Channel name

A User has Failed to Join a Channel (onChannelJoinFailed)

This callback function is triggered when the user has failed to join a channel.

public virtual void onChannelJoinFailed(char const * channelID, size_t channelID_size,int ecode) {}
Parameter Description
channelID Channel name
ecode Error code

A User has Left a Channel (onChannelLeaved)

This callback function is triggered when a user has left a channel.

public virtual void onChannelLeaved(char const * channelID, size_t channelID_size,int ecode) {}
Parameter Description
channelID Channel name
ecode Error code

Another User has Joined the Channel (onChannelUserJoined)

This callback function is triggered when another user has joined the channel.

public virtual void onChannelUserJoined(char const * account, size_t account_size,uint32_t uid) {}
Parameter Description
account User ID defined by the client.
uid N/A: Set as 0.

Another User has Left the Channel (onChannelUserLeaved)

This callback function is triggered when another user has left the channel.

public virtual void onChannelUserLeaved(char const * account, size_t account_size,uint32_t uid) {}
Parameter Description
account User ID defined by the client.
uid N/A: Set as 0.

The User List in the Channel (onChannelUserList)

A user will receive this callback function after joining a channel.

The retrieved user list includes a maximum of the latest 200 users in the channel.

public virtual void onChannelUserList(int n,char** accounts,uint32_t* uids) {}
Parameter Description
n Number of users in the channel.
account User ID defined by the client.
uid List of users in the channel.

The Number of Users in a Channel (onChannelQueryUserNumResult)

This callback function is triggered when a user has queried the number of users in a channel.

public virtual void onChannelQueryUserNumResult(char const * channelID, size_t channelID_size,int ecode,int num) {}
Parameter Description
channelID Channel name
ecode Error code
num The query result

The Queried User is in the Channel (onChannelQueryUserIsIn)

This callback function is triggered when a user has queried whether he/she is in the channel.

public virtual void onChannelQueryUserIsIn(char const * channelID, size_t channelID_size,char const * account, size_t account_size,int isIn) {}
Parameter Description
channelID Channel name.
account User ID defined by the client.
isIn

Whether the user is in the channel:

  • 1: In the channel
  • 0: Not in the channel

The Channel Attribute has Changed (onChannelAttrUpdated)

This callback function is triggered when the channel attribute has changed.

public virtual void onChannelAttrUpdated(char const * channelID, size_t channelID_size,char const * name, size_t name_size,char const * value, size_t value_size,char const * type, size_t type_size) {}
Parameter Description
channelID Channel name.
name Attribute name.
value Attribute value.
type

Change types:

  • “update”: Update
  • “del”: Delete
  • “clear”: Delete all
  • “set”: N/A

A Call Request has been Received (onInviteReceived)

This callback function is received by the callee when the callee has received a call invitation or request.

public virtual void onInviteReceived(char const * channelID, size_t channelID_size,char const * account, size_t account_size,uint32_t uid,char const * extra, size_t extra_size) {}
Parameter Description
channelID Channel name.
account User ID of the caller defined by the client.
uid N/A: Set it to 0.
extra Extra information to send to the callee. It can be up to 8 KB visible characters and must be in JSON format.

The Callee has Received the Call Request (onInviteReceivedByPeer)

This callback function is received by the caller when the callee has received the call invitation or request.

public virtual void onInviteReceivedByPeer(char const * channelID, size_t channelID_size,char const * account, size_t account_size,uint32_t uid) {}
Parameter Description
channelID Channel name. It can be up to 128 visible characters.
account User ID of the callee defined by the client.
uid N/A: Set as 0.

The Callee has Accepted the Call Request (onInviteAcceptedByPeer)

This callback function is received by the caller when the callee has accepted the call invitation or request.

public virtual void onInviteAcceptedByPeer(char const * channelID, size_t channelID_size,char const * account, size_t account_size,uint32_t uid,char const * extra, size_t extra_size) {}
Parameter Description
channelID Channel name. It can be up to 128 visible characters.
account User ID of the callee defined by the client.
uid N/A: Set as 0
extra Extra information to send to the user being called. It must be in JSON format.

The Callee has Rejected the Call Request (onInviteRefusedByPeer)

This callback function is received by the caller when the callee has rejected the call invitation or request.

public virtual void onInviteRefusedByPeer(char const * channelID, size_t channelID_size,char const * account, size_t account_size,uint32_t uid,char const * extra, size_t extra_size) {}
Parameter Description
channelID Channel name.
account User ID of the callee defined by the client.
uid N/A: Set as 0.
extra Extra information: NULL or in JSON format.

A Call has Failed (onInviteFailed)

This callback function is triggered when a call has failed.

public virtual void onInviteFailed(char const * channelID, size_t channelID_size,char const * account, size_t account_size,uint32_t uid,int ecode,char const * extra, size_t extra_size) {}
Parameter Description
channelID Channel name.
account User ID of the callee defined by the client.
uid N/A: Set as 0.
ecode Error code.
extra Extra information: NULL or in JSON format.

The Callee has Ended the Call (onInviteEndByPeer)

This callback function is triggered when the callee has ended the call.

public virtual void onInviteEndByPeer(char const * channelID, size_t channelID_size,char const * account, size_t account_size,uint32_t uid,char const * extra, size_t extra_size) {}
Parameter Description
channelID Channel name
account User ID of the callee defined by the client.
msg Message body
extra

Extra information the caller wants to deliver to the callee.

For example, this is a video call or voice call.

It must be in JSON format.

The Caller has Ended the Call (onInviteEndByMyself)

This callback function is triggered when the caller has ended the call.

public virtual void onInviteEndByMyself(char const * channelID, size_t channelID_size,char const * account, size_t account_size,uint32_t uid) {}
Parameter Description
channelID Channel name. It can be up to 128 visible characters.
account User ID of the caller defined by the client.
uid N/A: Set as 0.

A DTMF Message sent by the Callee has been Received (onInviteMsg)

This callback function is triggered when the caller has received the DTMF message sent by the callee.

public virtual void onInviteMsg(char const * channelID, size_t channelID_size, char const * account, size_t account_size, int uid, String msgType, String msgData, String extra)
Parameter Description
channelID Channel name. It can be up to 128 visible characters.
account User ID of the callee defined by the client.
uid N/A: Set as 0.
msgType Message type (DTMF).
msgData Detailed DTMF message. Supported strings include: 0-9, * and #.
extra Extra information of the call, which can be a string, a JSON string, or NULL.

The User has Failed to Send a Message (onMessageSendError)

This callback function is triggered when the user has failed to send a message.

public virtual void onMessageSendError(char const * messageID, size_t messageID_size,int ecode) {}
Parameter Description
messageID Message ID
ecode Error code

The User has Successfully Sent a Message (onMessageSendSuccess)

This callback function is triggered when the user has successfully sent a message.

public virtual void onMessageSendSuccess(char const * messageID, size_t messageID_size) {}
Parameter Description
messageID Message ID

A Message has been Received (onMessageInstantReceive)

This callback function notifies a user that a message has been received.

public virtual void onMessageInstantReceive(char const * account, size_t account_size,uint32_t uid,char const * msg, size_t msg_size) {}
Parameter Description
account User ID defined by the clients.
uid N/A: Set as 0.
msg Message body.

A Channel Message has been Received (onMessageChannelReceive)

This callback function is triggered when a channel message has been received.

public virtual void onMessageChannelReceive(char const * channelID, size_t channelID_size,char const * account, size_t account_size,uint32_t uid,char const * msg, size_t msg_size) {}
Parameter Description
channelID Channel name.
account User ID defined by the clients.
uid N/A: Set as 0.
msg Message body.

A Line has been Created in a Log File (onLog)

This callback function is triggered when a line has been created in a log file.

public virtual void onLog(char const * txt, size_t txt_size) {}
Parameter Description
txt Line in the log file

An Attribute of a Specified User (onUserAttrResult)

This callback function is triggered when the user has queried an attribute of a specified user.

public virtual void onUserAttrResult(char const * account, size_t account_size,char const * name, size_t name_size,char const * value, size_t value_size) {}
Parameter Description
account User ID of the specified user defined by the client.
name Attribute name.
value Value of the attribute.

All Attributes of a Specified User (onUserAttrAllResult)

This callback function is triggered when a user has queried all attributes of a specified user.

public virtual void onUserAttrAllResult(char const * account, size_t account_size,char const * value, size_t value_size) {}
Parameter Description
account User ID of the specified user defined by the client.
value JSON values of all attributes of the user.

Error Codes and Warning Codes

See Error Codes and Warning Codes.