diff --git a/doc/api.oa3 b/doc/api.oa3 index 2dbc6a86..98b8c7a6 100644 --- a/doc/api.oa3 +++ b/doc/api.oa3 @@ -3649,13 +3649,6 @@ paths: description: account disabled '500': description: internal server error - requestBody: - content: - application/json: - schema: - type: array - items: - type: string /talk/calls/{callId}: put: @@ -3717,6 +3710,42 @@ paths: '500': description: internal server error + /talk/ring: + post: + tags: + - talk + description: Create a ring event in contact + operationId: add-ring + parameters: + - name: contact + in: query + description: contact token + required: true + schema: + type: string + - name: calleeToken + in: query + description: token for the contact to connect with + required: true + schema: + type: string + - name: index + in: query + description: index of current ring + required: true + schema: + type: integer + format: int32 + responses: + '201': + description: entry created + '401': + description: permission denied + '410': + description: account disabled + '500': + description: internal server error + /talk/signal: get: tags: @@ -4589,3 +4618,4 @@ components: type: http scheme: bearer + diff --git a/net/server/internal/api_addCall.go b/net/server/internal/api_addCall.go new file mode 100644 index 00000000..708cf4af --- /dev/null +++ b/net/server/internal/api_addCall.go @@ -0,0 +1,9 @@ +package databag + +import ( + "net/http" +) + +//AddCall adds an active call with ice signal and relay +func AddCall(w http.ResponseWriter, r *http.Request) { +} diff --git a/net/server/internal/api_addRing.go b/net/server/internal/api_addRing.go new file mode 100644 index 00000000..2a87b698 --- /dev/null +++ b/net/server/internal/api_addRing.go @@ -0,0 +1,9 @@ +package databag + +import ( + "net/http" +) + +//AddRing adds ring event from contact +func AddRing(w http.ResponseWriter, r *http.Request) { +} diff --git a/net/server/internal/api_endCall.go b/net/server/internal/api_endCall.go new file mode 100644 index 00000000..e17e8aa0 --- /dev/null +++ b/net/server/internal/api_endCall.go @@ -0,0 +1,9 @@ +package databag + +import ( + "net/http" +) + +//EndCall termines an active call +func EndCall(w http.ResponseWriter, r *http.Request) { +} diff --git a/net/server/internal/api_keepCall.go b/net/server/internal/api_keepCall.go new file mode 100644 index 00000000..b496e42b --- /dev/null +++ b/net/server/internal/api_keepCall.go @@ -0,0 +1,9 @@ +package databag + +import ( + "net/http" +) + +//KeepCall keeps the call alive +func KeepCall(w http.ResponseWriter, r *http.Request) { +} diff --git a/net/server/internal/api_signal.go b/net/server/internal/api_signal.go new file mode 100644 index 00000000..8623e3dd --- /dev/null +++ b/net/server/internal/api_signal.go @@ -0,0 +1,10 @@ +package databag + +import ( + "net/http" +) + +//Signal handler for websocket connection with call events +func Signal(w http.ResponseWriter, r *http.Request) { +} + diff --git a/net/server/internal/routers.go b/net/server/internal/routers.go index a42fb5c0..fee6ee68 100644 --- a/net/server/internal/routers.go +++ b/net/server/internal/routers.go @@ -798,9 +798,45 @@ var endpoints = routes{ }, route{ - "Relay", + "Activity", strings.ToUpper("Get"), - "/relay", - Relay, + "/activity", + Activity, }, + + route{ + "AddCall", + strings.ToUpper("Post"), + "/talk/call", + AddCall, + }, + + route{ + "KeepCall", + strings.ToUpper("Put"), + "/talk/call/{callId}", + KeepCall, + }, + + route{ + "EndCall", + strings.ToUpper("Delete"), + "/talk/call/{callId}", + EndCall, + }, + + route{ + "AddRing", + strings.ToUpper("Post"), + "/talk/ring", + AddRing, + }, + + route{ + "Signal", + strings.ToUpper("Get"), + "/signal", + Signal, + }, + }