Table of Contents
onInviteGroupProgress()
wrtc.onInviteGroupProgress() is called repetitively while a group call started by wrtc.inviteGroup() or wrtc.addToGroupCall() is established. During setup of the group call the clients involved send back status progress information to the client initiating the group call. Errors ocurred are reported to all group call members. Each time such information is received this function is called.
As long as group call progress is nominal onInviteGroupProgress() occurs only on the client that started the group call. But errors are reported to everyone, then onInviteGroupProgress() occurs on all group call members.
You can use this event to indicate to user group call is being established, and show error if something went wrong.
Argument
wrtc.onInviteGroupProgress(arg)
- arg - JSON structure: {type:…, gid:…, status:…, data:…, from:…}
- type - always "joingroup"
- gid - string containing group ID
- status - string containing progress status (see below)
- data - (optional) JSON structure containing additional data (see below)
- from - string containing address of client reporting
If an error has occurred arg contains: {type:…, gid:…, error:…, data:…, from:…}
- type, gid, data, from - as described above
- error - string containing error message (see below)
arg.status, arg.error
Events resulting in onInviteGroupProgress() only at group call initiator:
| status | description: |
|---|---|
| OK | a group member is prepared to join group call |
| calling | a group member has sent a call to another group member or voice bridge |
| reconnecting | a group member has restarted its connection to another group member |
| recalling | a group member made another group member restart its connection to it |
| gothungup | a group member got her call ended by another group member |
| hungup | a group member has ended the call to another group member |
| talking | a group member has successfully connected to another group member |
| stalled | a group member lost media connection to another group member (and switched to voice fallback) |
| transferred | a group member was successfully transferred (to voice bridge) |
Events resulting in onInviteGroupProgress() at all group members:
| status | description: |
|---|---|
| problems | a group member experiences Internet connection problems |
Errors resulting in onInviteGroupProgress() at all group members:
| error | description: |
|---|---|
| 103: SDP fail | client could not process SDP |
| 104: ICE fail | client lost ICE connection |
| 105: Transfer failed | client could not transfer call |
| 111: Not enough resources | client can't make enough calls to set up group call |
| 112: Group call not supported | client does not support multiple calls |
| 113: Already in group call | client is already in a different group call, cannot join our group |
| 114: offer rejected | client could not accept incoming call due to error or lack of resources |
| 352: invalid group ID | joingroup message with wrong group ID received |
| 353: not in group call | joingroup message received but not in group call |
Other events and errors may also occur.
arg.data
The optional data member of the argument JSON structure may contains furthe data about the occurred event:
- partner - (optional) address of other end of call
- response - (optional) response code
- msg - (optional) response description
Example
wrtc.onInviteGroupProgress = function(arg) {
if (arg.error) {
if ((arg.data) && (arg.data.partner))
window.alert(arg.from + " failed to connect to " + arg.data.partner);
else
window.alert(arg.from + " failed to join group call");
}
}
Alternative
Instead of manually collecting data about progress state of group calls you can use groupCallStat. Read more here.