diff --git a/doc/CHANNELING-API.txt b/doc/CHANNELING-API.txt index 50a07ba6..1f23cef4 100644 --- a/doc/CHANNELING-API.txt +++ b/doc/CHANNELING-API.txt @@ -605,22 +605,24 @@ Chat messages and status information } - Request being called from audio mixer + Request an automatic callback, by sending a chat message with the AutoCall + document in Status. { "Type": "Chat", "Chat": { - "Message": null, + "Message": "Call me back", "Status": { - "type": "conference", - "id": "my-conference-room" + "AutoCall": { + "Type": "conference", + "Id": "my-conference-room" } } } - This can be sent to any participant that has a "Status" containing the "isMixer" - flag with a "true" value. The peer will then try to establish a peer connection - to the caller which it needs to pick up to join an audio conference. + For example this can be sent to sessions which have "autoCalls" set in session + status. The peer will then try to establish a peer connection to the caller which + the client eeds to pick up automatically. Data channel only messages diff --git a/src/app/spreed-webrtc-server/channeling.go b/src/app/spreed-webrtc-server/channeling.go index 3ad86555..c07c3753 100644 --- a/src/app/spreed-webrtc-server/channeling.go +++ b/src/app/spreed-webrtc-server/channeling.go @@ -106,6 +106,7 @@ type DataChatStatus struct { SeenMids []string `json:",omitempty"` FileInfo *DataFileInfo `json:",omitempty"` ContactRequest *DataContactRequest `json:",omitempty"` + AutoCall *DataAutoCall `json:",omitempty"` } type DataFileInfo struct { @@ -123,6 +124,11 @@ type DataContactRequest struct { Token string `json:",omitempty"` } +type DataAutoCall struct { + Id string + Type string +} + type DataIncoming struct { Type string Hello *DataHello diff --git a/static/js/directives/buddylist.js b/static/js/directives/buddylist.js index 6bdcfe95..191ab81a 100644 --- a/static/js/directives/buddylist.js +++ b/static/js/directives/buddylist.js @@ -59,8 +59,10 @@ define(['underscore', 'text!partials/buddylist.html'], function(_, template) { $scope.updateAutoAccept(id); mediaStream.api.sendChat(id, null, { - type: "conference", - id: mediaStream.connector.roomid + AutoCall: { + Type: "conference", + Id: mediaStream.connector.roomid + } }) }; diff --git a/static/js/services/buddylist.js b/static/js/services/buddylist.js index ab9cebad..1bcedd03 100644 --- a/static/js/services/buddylist.js +++ b/static/js/services/buddylist.js @@ -464,7 +464,7 @@ define(['underscore', 'modernizr', 'avltree', 'text!partials/buddy.html', 'text! } else { var scope = buddyData.get(id); var template = buddyActions; - if (scope.status.isMixer) { + if (scope.status.autoCalls && _.indexOf(scope.status.autoCalls, "conference") !== -1) { template = buddyActionsForAudioMixer; } //console.log("scope", scope, id);