Help with conference demo

Discussion in 'Web Call Server 5' started by Julien, Nov 23, 2017.

  1. Julien

    Julien New Member

    Hello,
    I am porting an existing application to WCS and i'm going to use the conference demo as a starting point.

    I wanted to check all the REST urls called by that demo to know which REST hooks i should setup in my backend application so i created a node.js application to accepts any url that simply returns the body of the received request.
    Then i created an app using the command line in WCS that points to my node.js app and added all rest methods to it.
    After that i try the conference demo adding my app's appKey when connecting to the room but the demo doesn't work, it stays at the "ESTABLISHED" message but never starts broadcasting, while if i remove the appKey and connect to the default app it works fine.
    Is there something specific needed to be done during the REST hooks for the conference demo to work?
    Where can i see the code of the app used by the conference demo, i looked in the /usr/local/FlashphonerWebCallServer folder but couldn't find anything there.
  2. Max

    Max Administrator Staff Member

    Hello

    The Conference app is demo server-side application, deployed on local address: http://localhost:9091/ConferenceApp
    This server-side application is built-in and ensures conference signaling such as delivering events, states, etc.
    We didn't share source code of this application, but we plan to do that in future.

    For now you have two options.
    1. Implement your server-side hooks from scratch.
    So if user A publishes a stream, your hook should keep this in memory, and if user B joined, you have to share the stream with user B, etc.
    This is how ConferenceApp works. It is implemented compeltely based on REST hooks.
    2. Another option, you can implement your own application and delegate all requests to ConferenceApp, then pass-through all responses back to WCS server
    Code:
    WCS - [REST] - [YourApp] - [ConferenceApp]
    So you can intercept REST requestst in middle and modify responses if it is needed. For example you can intercept and record all messages.
  3. Julien

    Julien New Member

    Hi, I was wondering, did you release the code of that application already? If not, any idea when that is happening?
  4. Julien

    Julien New Member

    Yes? No? Maybe?
  5. Max

    Max Administrator Staff Member

    Hello
    This is code of RoomApp
    https://flashphoner.com/downloads/developer/server_side/wcs5/RoomApp-2804.zip
    It can be helpful if you know how Java + Spring works.
    If you are experienced Java developer, you can event build this application resolving dependencies.
    Unfortunately this code has some internal dependencies and can't be compiled as is.
    We will raise internal ticket to share REST apps as a separate project with sources.
  6. Julien

    Julien New Member

    Thank you very much, i'll have a look and get back to you once i have questions.
  7. Julien

    Julien New Member

    Hi,
    I've been going over the code of RoomApp and it is pretty straight forward but i am wondering why i don't see anywhere the hook for "/unPublishStream" handled anywhere.
    The file where all those hooks are handled is room/RoomApp.java but there is no conditional statement to handle what i am guessing should be (method.equals(APIMethods.UN_PUBLISH_STREAM).
    Is it because it is enough to just echo back the request received?
    Seems to me there should be some clean up when that hook happens, no?
  8. Max

    Max Administrator Staff Member

    Hello
    Method unpublishStream is not used in the RoomApp because it is not helpful in such a case.
    When WCS sends /unpublishStream it means that user has pressed 'stop publishing' button or disconnected in browser.
    However it does not mean that stream is really unpublished. It just means that unpublishing process has began for this stream.
    Once the unpublishing process is complete, WCS sends APIMethods.STREAM_STATUS_EVENT stream.status='UNPUBLISHED'
    Here you can see full flow
    https://flashphoner.com/docs/wcs5/w...aming_video-publishing_a_stream-call_flow.htm
    So you have to handle /StreamStatusEvent and check stream final state.
  9. Julien

    Julien New Member

    Hi,
    I understand, that makes sense, thank you.

Share This Page