adding endpoints for webrtc

This commit is contained in:
balzack 2023-03-19 21:46:10 -07:00
parent aacd546210
commit 9084ca4196
7 changed files with 122 additions and 10 deletions

View File

@ -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

View File

@ -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) {
}

View File

@ -0,0 +1,9 @@
package databag
import (
"net/http"
)
//AddRing adds ring event from contact
func AddRing(w http.ResponseWriter, r *http.Request) {
}

View File

@ -0,0 +1,9 @@
package databag
import (
"net/http"
)
//EndCall termines an active call
func EndCall(w http.ResponseWriter, r *http.Request) {
}

View File

@ -0,0 +1,9 @@
package databag
import (
"net/http"
)
//KeepCall keeps the call alive
func KeepCall(w http.ResponseWriter, r *http.Request) {
}

View File

@ -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) {
}

View File

@ -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,
},
}