-
Notifications
You must be signed in to change notification settings - Fork 13k
chore: New Backend Architecture for Voice Calls #36718
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
133 commits
Select commit
Hold shift + click to select a range
9a74aba
Partial implementation; media signaling and media calls collection
pierre-lehnen-rc f1436bf
started work on media-signaling-server
pierre-lehnen-rc 8b44642
split channels into a new model, send offer request to caller
pierre-lehnen-rc 5c911f3
call acceptance
pierre-lehnen-rc c062c57
split files
pierre-lehnen-rc 8ed0635
service, endpoints and streams
pierre-lehnen-rc 866d7d2
dependencies
pierre-lehnen-rc e6fb9d9
client call state
pierre-lehnen-rc abfbd3f
integrating
pierre-lehnen-rc e9938bd
integrating
pierre-lehnen-rc 9271940
webrtc processor, some fixes and reorganization
pierre-lehnen-rc 0374b5a
accept calls, exchange offers and answers
pierre-lehnen-rc 9046b76
first working state
pierre-lehnen-rc 1f2642c
call by extension
pierre-lehnen-rc b5f5cba
missed a file
pierre-lehnen-rc abc9062
simplifying everything
pierre-lehnen-rc 4d4b53c
moving test code to a separate branch
pierre-lehnen-rc fc8fd1a
rebase conflict oopsie
pierre-lehnen-rc df797ec
rejection and handling of temporary data
pierre-lehnen-rc 8339874
client side timeouts
pierre-lehnen-rc eb4a7b7
handle actor signals through agents and contracts
pierre-lehnen-rc 566f9a7
use a signal to request calls too
pierre-lehnen-rc 378abb9
report webrtc states
pierre-lehnen-rc 7553d66
house cleaning
pierre-lehnen-rc 8ed2343
serialization and type validation
pierre-lehnen-rc a1c6907
Multi session
pierre-lehnen-rc 834fd5a
active state
pierre-lehnen-rc 4afb2af
organized global media signaling server functions
pierre-lehnen-rc ebf940e
renamed package
pierre-lehnen-rc 2c3f20e
expire old calls
pierre-lehnen-rc 739304a
update comment
pierre-lehnen-rc eab5358
unneeded dependency
pierre-lehnen-rc f0731b6
dev dependencies
pierre-lehnen-rc d5d3673
removing comments
pierre-lehnen-rc b3bb38a
missed a couple
pierre-lehnen-rc 2f606ec
rename and move token function
pierre-lehnen-rc 79b882b
clarify cronjob interval with a comment
pierre-lehnen-rc 5ea0a46
remove token function
pierre-lehnen-rc 2a1e9dd
remove unnecessary warn
pierre-lehnen-rc fb08a4d
use setTimeout instead of cronjob
pierre-lehnen-rc af06988
Merge branch 'develop' into feat/media-calls
pierre-lehnen-rc 2ddda61
starting
pierre-lehnen-rc c34e723
creating providers after all
pierre-lehnen-rc 48d9afd
sip calls coming in
pierre-lehnen-rc af98f4f
answering call
pierre-lehnen-rc bf0de5f
make calls?
pierre-lehnen-rc 2c33f86
refactor
pierre-lehnen-rc 222f80e
working again
pierre-lehnen-rc 8ba970e
removed some duplicated stuff
pierre-lehnen-rc 79cb7fa
file organization
pierre-lehnen-rc 9a06186
settings
pierre-lehnen-rc bad1bf5
logs
pierre-lehnen-rc 25d9eb1
small adjustments
pierre-lehnen-rc 65f6f50
reorganization to better accomodate sip integration
pierre-lehnen-rc 23cc986
Merge branch 'feat/media-calls' into feat/media-calls-sip
pierre-lehnen-rc c71572d
ice configuration
pierre-lehnen-rc 2c65b97
Merge branch 'feat/media-calls' into feat/media-calls-sip
pierre-lehnen-rc d0e2279
ice gathering timeout on session
pierre-lehnen-rc 7e0a724
Merge remote-tracking branch 'origin/feat/media-calls' into feat/medi…
pierre-lehnen-rc 98c11e6
Merge branch 'develop' into feat/media-calls
pierre-lehnen-rc f2a1487
habemos audio
pierre-lehnen-rc e42bca5
support accepting a call after the webrtc negotiation is complete
pierre-lehnen-rc bb9cec7
Merge branch 'feat/media-calls' into feat/media-calls-sip
pierre-lehnen-rc 79025c8
removing some dead code
pierre-lehnen-rc c3b547d
Merge branch 'feat/media-calls' into feat/media-calls-sip
pierre-lehnen-rc 86f1192
simplifying
pierre-lehnen-rc f3b9666
small fixes
pierre-lehnen-rc 808db2f
importing fixes from sip branch
pierre-lehnen-rc 1bdf18f
Merge branch 'feat/media-calls' into feat/media-calls-sip
pierre-lehnen-rc 0176bc0
better error handling
pierre-lehnen-rc 08e298f
better error handling
pierre-lehnen-rc cfdd6fa
Merge branch 'feat/media-calls' into feat/media-calls-sip
pierre-lehnen-rc 41832bb
fix merge mess up
pierre-lehnen-rc b2c9d71
hangup, cancel and rejection
pierre-lehnen-rc fc161d6
patched drachtio-srf to fix types
pierre-lehnen-rc d370c03
webrtc improvements
pierre-lehnen-rc 9ed9ca5
renamed `onHold` to `held` and improved some comments
pierre-lehnen-rc 1cf44bb
allow passing the inputTrack as param when creating a new call;
pierre-lehnen-rc 246f70d
feat: webrtc renegotiation (#36874)
pierre-lehnen-rc 0cfb569
Merge branch 'develop' into feat/media-calls
pierre-lehnen-rc b8f1097
Merge branch 'feat/media-calls' into feat/media-calls-sip
pierre-lehnen-rc 0274eb6
feat: media call transfer (#36898)
pierre-lehnen-rc 4c8c523
Merge branch 'feat/media-calls-backend' into feat/media-calls
pierre-lehnen-rc 4a85e27
Merge branch 'develop' into feat/media-calls
pierre-lehnen-rc fb3abc3
improving code quality + applying some suggestions from code review
pierre-lehnen-rc 69e4896
better state and presence management
pierre-lehnen-rc e5b269d
changes from code review
pierre-lehnen-rc 05c4be8
strip sensitive data from logs
pierre-lehnen-rc 6a3831e
code review
pierre-lehnen-rc d41cca7
dockerfiles
pierre-lehnen-rc 21a1a28
unregisterPeerEvents
pierre-lehnen-rc 1f3e97b
hangup call on unavailable response from a signed client
pierre-lehnen-rc 6fed7a8
code review
pierre-lehnen-rc acf08fa
better handling of call expiration
pierre-lehnen-rc fabc48b
improved client side state handling
pierre-lehnen-rc b5a91fe
logs
pierre-lehnen-rc 3c5258c
Merge branch 'develop' into feat/media-calls
pierre-lehnen-rc dcfd74e
handle situation where ICE Gathering time outs with no candidates
pierre-lehnen-rc 3e0a01d
ice candidate count
pierre-lehnen-rc 433d3ce
endSession
pierre-lehnen-rc 0eeb087
code review
pierre-lehnen-rc e29335b
fix: getUserMedia being called too early
pierre-lehnen-rc 2711aed
Merge branch 'feat/media-calls' into feat/media-calls-sip
pierre-lehnen-rc 90c5795
basic changes to reflect merged code
pierre-lehnen-rc e95286b
improve handling of input tracks
pierre-lehnen-rc f9abc9f
bug fixes
pierre-lehnen-rc 1973027
fix presence check on transfered calls
pierre-lehnen-rc 5601d9e
Merge branch 'feat/media-calls' into feat/media-calls-sip
pierre-lehnen-rc fb0dbe0
working on sip transfers and renegotiations
pierre-lehnen-rc a207464
Merge branch 'develop' into feat/media-calls-backend
pierre-lehnen-rc 5f9f7e3
Merge branch 'develop' into feat/media-calls
pierre-lehnen-rc 40b9514
permissions
pierre-lehnen-rc 75eac3d
Merge branch 'feat/media-calls-backend' into feat/media-calls-sip
pierre-lehnen-rc 72eb15c
transfer incoming calls
pierre-lehnen-rc 6645d60
dtmf
pierre-lehnen-rc 66e625f
Merge branch 'feat/media-calls' into feat/media-calls-sip
pierre-lehnen-rc 5b69163
fix request type
pierre-lehnen-rc 8a73fb3
await DTMF
pierre-lehnen-rc 8646b5d
private settings
pierre-lehnen-rc faa17d3
removing comments
pierre-lehnen-rc 0394760
cleanup
pierre-lehnen-rc 2201225
Merge branch 'develop' into feat/media-calls-backend
pierre-lehnen-rc 3667697
make media call director non-static
pierre-lehnen-rc 5fce441
fix merge error
pierre-lehnen-rc ca91b95
fix freeswitch parseChannelUsername regex
pierre-lehnen-rc 7c17e53
fix yarn patch?
pierre-lehnen-rc 913b644
callee negotiation
pierre-lehnen-rc eb340ca
yarn patch again
pierre-lehnen-rc 854fa42
caller renegotiation
pierre-lehnen-rc 231532c
changes from code review
pierre-lehnen-rc d2c849a
maybe this works?
pierre-lehnen-rc 02da243
back to home
pierre-lehnen-rc 880a07c
removed comment
pierre-lehnen-rc File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,56 @@ | ||
| diff --git a/lib/@types/index.d.ts b/lib/@types/index.d.ts | ||
| index f71a82f458c1432202be8d4585fc70ba94bee4a4..b874ee9e1fa8a051f06d4824fc12161acfadb78a 100644 | ||
| --- a/lib/@types/index.d.ts | ||
| +++ b/lib/@types/index.d.ts | ||
| @@ -119,12 +119,12 @@ declare namespace Srf { | ||
| on(messageType: "modify", callback: (req: SrfRequest, res: SrfResponse) => void): void; | ||
| once(messageType: string, callback: (msg: SrfResponse) => void): void; | ||
| listeners(messageType: string): any[]; | ||
| - request(opts?: SrfRequest): Promise<SrfResponse>; | ||
| - request(opts: SrfRequest, callback?: (err: any, msg: SrfResponse) => void): void; | ||
| + request(opts?: Partial<SrfRequest>): Promise<SrfResponse>; | ||
| + request(opts: Partial<SrfRequest>, callback?: (err: any, msg: SrfResponse) => void): void; | ||
| } | ||
|
|
||
| export interface CreateUASOptions { | ||
| - localSdp: string; | ||
| + localSdp: string | (() => string | Promise<string>); | ||
| headers?: SipMessageHeaders; | ||
| } | ||
|
|
||
| @@ -135,6 +135,8 @@ declare namespace Srf { | ||
| localSdp?: string; | ||
| proxy?: string; | ||
| auth?: { username: string; password: string; }; | ||
| + callingName?: string; | ||
| + callingNumber?: string; | ||
| } | ||
|
|
||
| export interface CreateB2BUAOptions { | ||
| @@ -155,7 +157,7 @@ declare class Srf extends EventEmitter { | ||
| constructor(); | ||
| constructor(tags: string | string[]); | ||
| connect(config?: Srf.SrfConfig): Promise<void>; | ||
| - disconnect(): void; | ||
| + disconnect(socket?: Socket): void; | ||
| use(callback: (req: Srf.SrfRequest, res: Srf.SrfResponse, next: Function) => void): void; | ||
| use(messageType: string, callback: (req: Srf.SrfRequest, res: Srf.SrfResponse, next: Function) => void): void; | ||
| invite(callback: (req: Srf.SrfRequest, res: Srf.SrfResponse) => void): void; | ||
| @@ -164,12 +166,12 @@ declare class Srf extends EventEmitter { | ||
| proxyRequest(req: Srf.SrfRequest, destination: string | string[], opts?: Srf.ProxyRequestOptions, callback?: (err: any, results: string) => void): void; | ||
| createUAS(req: Srf.SrfRequest, res: Srf.SrfResponse, opts: Srf.CreateUASOptions): Promise<Srf.Dialog>; | ||
| createUAS(req: Srf.SrfRequest, res: Srf.SrfResponse, opts: Srf.CreateUASOptions, callback?: (err: any, dialog: Srf.Dialog) => void): this; | ||
| - createUAC(uri: string | Srf.CreateUACOptions, opts?: Srf.CreateUACOptions, progressCallbacks?: { cbRequest?: (req: Srf.SrfRequest) => void; cbProvisional?: (provisionalRes: Srf.SrfResponse) => void; }): Promise<Srf.Dialog>; | ||
| - createUAC(uri: string | Srf.CreateUACOptions, opts?: Srf.CreateUACOptions, progressCallbacks?: { cbRequest?: (req: Srf.SrfRequest) => void; cbProvisional?: (provisionalRes: Srf.SrfResponse) => void; }, callback?: (err: any, dialog: Srf.Dialog) => void): this; | ||
| - createB2BUA(req: Srf.SrfRequest, res: Srf.SrfResponse, uri: string, opts: Srf.CreateB2BUAOptions, progressCallbacks?: { cbRequest?: (req: Srf.SrfRequest) => void; cbProvisional?: (provisionalRes: Response) => void; cbFinalizedUac?: (uac: Srf.Dialog) => void; }): Promise<{ uas: Srf.Dialog; uac: Srf.Dialog }>; | ||
| - createB2BUA(req: Srf.SrfRequest, res: Srf.SrfResponse, uri: string, opts: Srf.CreateB2BUAOptions, progressCallbacks?: { cbRequest?: (req: Srf.SrfRequest) => void; cbProvisional?: (provisionalRes: Response) => void; cbFinalizedUac?: (uac: Srf.Dialog) => void; }, callback?: (err: any, dialog: Srf.Dialog) => void): this; | ||
| + createUAC(uri: string | Srf.CreateUACOptions, opts?: Srf.CreateUACOptions, progressCallbacks?: { cbRequest?: (error: unknown, req: Srf.SrfRequest) => void; cbProvisional?: (provisionalRes: Srf.SrfResponse) => void; }): Promise<Srf.Dialog>; | ||
| + createUAC(uri: string | Srf.CreateUACOptions, opts?: Srf.CreateUACOptions, progressCallbacks?: { cbRequest?: (error: unknown, req: Srf.SrfRequest) => void; cbProvisional?: (provisionalRes: Srf.SrfResponse) => void; }, callback?: (err: any, dialog: Srf.Dialog) => void): this; | ||
| + createB2BUA(req: Srf.SrfRequest, res: Srf.SrfResponse, uri: string, opts: Srf.CreateB2BUAOptions, progressCallbacks?: { cbRequest?: (error: unknown, req: Srf.SrfRequest) => void; cbProvisional?: (provisionalRes: Response) => void; cbFinalizedUac?: (uac: Srf.Dialog) => void; }): Promise<{ uas: Srf.Dialog; uac: Srf.Dialog }>; | ||
| + createB2BUA(req: Srf.SrfRequest, res: Srf.SrfResponse, uri: string, opts: Srf.CreateB2BUAOptions, progressCallbacks?: { cbRequest?: (error: unknown, req: Srf.SrfRequest) => void; cbProvisional?: (provisionalRes: Response) => void; cbFinalizedUac?: (uac: Srf.Dialog) => void; }, callback?: (err: any, dialog: Srf.Dialog) => void): this; | ||
| on(event: 'connect', listener: (err: Error, hostPort: string) => void): this; | ||
| - on(event: 'error', listener: (err: Error) => void): this; | ||
| + on(event: 'error', listener: (err: Error, socket?: Socket) => void): this; | ||
| on(event: 'disconnect', listener: () => void): this; | ||
| on(event: 'message', listener: (req: Srf.SrfRequest, res: Srf.SrfResponse) => void): this; | ||
| on(event: 'request', listener: (req: Srf.SrfRequest, res: Srf.SrfResponse) => void): this; | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,9 +1,16 @@ | ||
| import type { IMediaCall } from '@rocket.chat/core-typings'; | ||
| import type { ClientMediaSignalBody } from '@rocket.chat/media-signaling'; | ||
|
|
||
| import { logger } from '../logger'; | ||
|
|
||
| export class BaseCallProvider { | ||
| public get callId(): string { | ||
| return this.call._id; | ||
| } | ||
|
|
||
| constructor(public readonly call: IMediaCall) {} | ||
|
|
||
| public async reactToCallChanges(params: { dtmf?: ClientMediaSignalBody<'dtmf'> }): Promise<void> { | ||
| logger.debug({ msg: 'BaseCallProvider.reactToCallChanges', callId: this.callId, params }); | ||
| } | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think if all we're changing is types, we could get away with module / namespace / interface augmentation. 🤔