Skip to content
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

VideoSIPGW updates #2201

Merged
merged 8 commits into from Nov 21, 2017
Merged

VideoSIPGW updates #2201

merged 8 commits into from Nov 21, 2017

Conversation

damencho
Copy link
Member

No description provided.

@damencho damencho force-pushed the sipgw-updates branch 3 times, most recently from 79d2ed1 to 15a534e Compare November 21, 2017 18:06
Also explains enabling the people search service and the request/response that are made around sipgw jibri service.
No invitation is sent when there is nobody to invite.
this.props._conference,
this.state.inviteItems.filter(
i => i.type === 'videosipgw'));
&& this.props.inviteRooms(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is a type "room" and the function is called inviteRooms, but you filter for videosipgw. What is the difference between room and videosipgw?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The invitation works with 3 types returned - user, room and videosipgw. User is a regular participant, room is like a chat room with multiple participants like in Stride. And also we videosipgw. So let's say we have chat room (type===room) and conference room (type=== videosipgw).
I agree its a little confusing and I also was wondering about that. If you have an idea how to improve it?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we can imagine what it would be like with different names, like specifically calling them chatRoom and conferenceRoom/videoRoom/sipGW instead of using the general term room.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, I will address that.

* the global sip gw availability in redux or show appropriate notification
* for sip gw sessions.
* Captures invitation actions that create sip gw sessions or display
* appropriate error/warning notifications.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe the second paragraph here isn't needed.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This describes the SIP_GW_INVITE_ROOMS case.

if (toDispatch) {
dispatch(toDispatch);
}
});
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you tell me how the timing of the join flow works? connection.initJitsiConference is called, which the browser takes over (async), but in the same stack as the call to connection.initJitsiConference the action CONFERENCE_WILL_JOIN is dispatched? I want to make sure it is guaranteed these conference listeners are set before the video sip gw events can be fired.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So after we call initJitsiConference we fire the CONFERENCE_WILL_JOIN action, and after the call for initJitsiConference returns the conference object we call on it join.
Basically I was added the same that mobile is currently doing:

dispatch(_conferenceWillJoin(conference));

const newSession = action.conference
.createVideoSIPGWSession(sipAddress, displayName);

if (newSession instanceof Error) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why did you choose returning an error over other possible implementations, such as returning a failed promise?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cause we are creating a session and returning it, there is no network operation involved and no need for any promise. This was the initial implementation.
But we can change the API of lib-jitsi-meet to be promised base, do you think its better that way?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If it was the implementation that was already there then no I don't think you should change it right now so that I don't keep asking you to make additional changes. However, I do think it's better to be consistent with what returns because if a promise is always returned then errors can be handled in a catch.

type: SIP_GW_AVAILABILITY_CHANGED,
status
};
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's okay style-wise to have actions inside the middleware if they're not intended to be used publicly?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The _availabilityChanged is private. And the intention is just to notify the reducer to store it in the state for future reference (showing notifications, handled in SIP_GW_INVITE_ROOMS case up in the code).

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Right, what I'm asking is in terms of style/organization, normally all actions go into an actions.js file but this is a special case because the action is meant to be private. So I want to ask specifically if you've given thought about if it's okay or not to have an action in a middleware file. If you've given it thought and it's fine then I'm okay with it (and someone else can just change it when they want).

@damencho
Copy link
Member Author

How does it look now, any better?

this.props._conference,
this.state.inviteItems.filter(
i => i.type === 'videosipgw'));

invitePeople(
invitePeopleAndChatRooms(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just noticed, the other actions are put onto this.props but invitePeopleAndChatRooms isn't. Do you care?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My mistake here. Damyan showed this is a function and shouldn't be mapped to props.

@virtuacoplenny virtuacoplenny merged commit 7b1b873 into master Nov 21, 2017
@damencho damencho deleted the sipgw-updates branch November 22, 2017 16:29
guusdk pushed a commit to guusdk/jitsi-meet that referenced this pull request Apr 5, 2018
* Adds initial documentation for sipgw jibri.

Also explains enabling the people search service and the request/response that are made around sipgw jibri service.

* Fixes add people dialog to invite users and rooms.

No invitation is sent when there is nobody to invite.

* Reuse some recording strings, by using arguments.

* Make sure web also dispatches CONFERENCE_WILL_JOIN.

* Introduces new feature videosipgw.

* Fixes lint errors.

* Renames methods to use people, chatRooms and videoRooms.

* Updates to latest lib-jitsi-meet (dc3397b18b).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants