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

REST API - Cannot set endpointServiceID #2846

Closed
triangle-stream opened this issue Jan 4, 2021 · 14 comments · Fixed by #3051
Closed

REST API - Cannot set endpointServiceID #2846

triangle-stream opened this issue Jan 4, 2021 · 14 comments · Fixed by #3051

Comments

@triangle-stream
Copy link

Hello there,

I'm trying to use the rest api provided by Antmedia in order to add and delete broadcast id's endpoint.
I'm using this reference.

Everything works except setting the endpointServiceId in the POST request (it correctly sets the name, rtmpUrl, etc.).

Here is the POST body:
{
"rtmpUrl": "rtmp://test.test.com",
"endpointServiceId": "test",
"endpointServiceId": "test_ID"
}

After submitting that request, the response is success but Antmedia is assigning a random endpointServiceId (like "customYFS7SD".

Is this the default behaviour from Antmedia?

Thank you,
Marco.

Environment

  • Operating system and version: Ubuntu 18.04
  • Java version: 11
  • Ant Media Server version: Community Edition 2.2.1 20201029_0748

Steps to reproduce

  1. Make a POST request (as provided here;
  2. Antmedia returns Success:true;
  3. enpointServiceId is random.
@triangle-stream
Copy link
Author

No one for this?

@mekya
Copy link
Contributor

mekya commented Feb 16, 2021

Hi @triangle-stream ,

Sorry for being late to respond.

Actually yes this is a default behavior. It's a critical thing that you need to set this on REST call. Maybe we can return assigned endpointServiceId in the returned success message.

@triangle-stream
Copy link
Author

Hello @mekya,

Thank you for your reply.
I think to have something like this would be very helpful when we need to know exactly which RTMP endpoint we are going to edit via REST. Do you think we can do something on this, also on our specific AMS Community?

Thank you!

@mekya
Copy link
Contributor

mekya commented Feb 19, 2021

Hi @triangle-stream ,

It will be great if you make a PR for that. Let me give you some basic instructions.

This adding endpoint REST method returns [Result](https://github.com/ant-media/Ant-Media-Server/blob/master/src/main/java/io/antmedia/rest/model/Result.java) object which has the dataId field.

You can add the endPointServiceId to the Result object as a dataId in the following method.

https://github.com/ant-media/Ant-Media-Server/blob/master/src/main/java/io/antmedia/rest/RestServiceBase.java#L635

@triangle-stream
Copy link
Author

Hello @mekya

Thank you for your answer. Unfortunately I'm not able to code in Java but I think i could start to learn something and try to make a PR.

Is there any documentation regarding this specific topic that you recommend?

@mekya
Copy link
Contributor

mekya commented Mar 4, 2021

Hi @triangle-stream ,

Thank you for your willingness to contribute. Appreciate that.

And it's my turn. I think we can create a community hour together and invite some other guys in the community to show them how to implement this feature.

After the call, we'll make a PR to the master.

Does that make sense?

Regards,
A. Oguz

@triangle-stream
Copy link
Author

Hello @mekya,

I think this is a really good idea! Just let me know what to do and I will do it.

It would be really good to do something that maybe could help someone else in this community (and also for me in order to learn how to solve this).

Thank you!

@mekya
Copy link
Contributor

mekya commented Mar 7, 2021

Hi @triangle-stream ,

Sounds perfect. Can we make it on saturday(Feb 13) next week at 5:00 PM GMT+3?
If it does not fit you, let me know the times that is ok for you.

Regards,
A. Oguz

@triangle-stream
Copy link
Author

I'm in!

Where will this take place? Please let me know if you need an email or something else for detailed info.

Thank you

@mekya
Copy link
Contributor

mekya commented Mar 7, 2021

Perfect. In order to make it easy, we may do it on google meet or similar tool until we develop our tool. I can give a direct link here.

I mean it will be public so no need to restrict anything. Is it OK?

@triangle-stream
Copy link
Author

Hello @mekya

Sorry for the delay. Of course it is ok.

Thank you

@mekya
Copy link
Contributor

mekya commented Mar 12, 2021

Perfect. I've created the event.

https://groups.google.com/g/ant-media-server/c/F7MGTNS5-BI

The meeting link is here -> https://meet.google.com/fdp-bvrv-mgn
March 13, 5:00 PM GMT+3

@triangle-stream
Copy link
Author

triangle-stream commented Mar 13, 2021

The commit works, now we can have endpointServiceId setted from request's post body!

Thank you @mekya

P.S: I'm not closing this as we are waiting to have the meeting's video rec link posted here.

mekya added a commit that referenced this issue Mar 13, 2021
Set endpoint service id via REST method #2846
@mekya
Copy link
Contributor

mekya commented Mar 13, 2021

No worries :)

I've just merged the PR so that it's closed automatically. Please feel free to open it if it does not work for you

Here is the video
https://www.youtube.com/watch?v=fNe-b78ANgY&ab_channel=AntMediaServer

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 a pull request may close this issue.

2 participants