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

Add event_sync prosody component #2

Merged
merged 3 commits into from
Jul 9, 2021

Conversation

shawnchin
Copy link
Collaborator

This prosody component sends HTTP POST request with JSON payload to external API when occupant or room events are triggered.

Ref:

@damencho
Copy link

damencho commented Jul 9, 2021

I haven't gone through the code, but it will be quicker to ask :) What's the difference between your HTTP request method and https://github.com/jitsi/jitsi-meet/blob/8d562b9d591083f3f0b963c34cb40957d501f109/resources/prosody-plugins/util.lib.lua#L362 ?

@shawnchin
Copy link
Collaborator Author

shawnchin commented Jul 9, 2021

I actually wrote this about the same time I did the reservations plugin, so they probably use the same method.

If I recall correctly, it is based on http_get_with_retry but with some modifications:

  1. non-blocking, so we pass in callback and timeout_callback rather than wait for results
  2. takes options table as param so we can pass in customised headers, http method, body, etc
  3. uses api_should_retry_for_code so users can influence which http response codes to retry on

Main reason was probably down to having to do POST rather than GET which is what http_get_with_retry does.

I was still learning lua when I wrote that, so might have gotten a bit carried away 😆

@damencho
Copy link

damencho commented Jul 9, 2021

Thank you :)

@damencho damencho merged commit 2ce26d0 into jitsi-contrib:main Jul 9, 2021
@shawnchin shawnchin deleted the event_sync branch May 27, 2022 12:26
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.

2 participants