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

API: After the on_stop event triggered by the HTTP Callback, the client id returned is different from the client id that triggered the on_play event, and it is always 09o0x492. #2626

Closed
fapjsc opened this issue Sep 22, 2021 · 2 comments · Fixed by #2665
Assignees
Labels
API HTTP-API, HTTP-Callback, etc. Bug It might be a bug. TransByAI Translated by AI/GPT.
Milestone

Comments

@fapjsc
Copy link

fapjsc commented Sep 22, 2021

Note: Issues that do not provide the following information will be deleted directly (Please follow the issue template, or we will delete it)'

Make sure to maintain the markdown structure.

Note: For inquiries and discussions, please submit them to the SRS forum (Please ask questions at) http://bbs.ossrs.net

Make sure to maintain the markdown structure.

Description

Please describe the issue you encountered here.

  1. After the HTTP Callback triggers the on_stop event, the client id returned is different from the client id that triggered the on_play event, and it is always 09o0x492.
  2. This situation only occurs with RTC, the callback for playing FLV is normal.

Make sure to maintain the markdown structure.

example =>

  • a. When the user starts playing, the on_play event is triggered, and the client id returned is aaaa.
  • b. When the user stops playing, the on_stop event is triggered, and the client id returned is 09o0x492.
  • c. When the user plays again, the on_play event is triggered again, and the client id returned is bbbb.
  • d. When the user stops playing again, the on_stop event is triggered again, and the client id returned is 09o0x492.

Make sure to maintain the markdown structure.

  1. SRS version: 4.0.161
  2. The log for SRS is as follows:

Make sure to maintain the markdown structure.

![Screenshot 2021-09-22 7 20 21 PM](https://user-images.githubusercontent.com/74793624/134357729-aa7245a5-5adf-48c6-af39-cc8107dc3ba2.png)

Make sure to maintain the markdown structure.

  1. The configuration of SRS is as follows (Config):

Make sure to maintain the markdown structure.

listen              1935;
max_connections     1000;
daemon              off;
srs_log_tank        console;

http_server {
    enabled         on;
    listen          8080;
    dir             ./objs/nginx/html;
}

http_api {
    enabled         on;
    listen          1985;
}
stats {
    network         0;
}
rtc_server {
    enabled on;
    # Listen at udp://8000
    listen 6666;
    #
    # The $CANDIDATE means fetch from env, if not configed, use * as default.
    #
    # The * means retrieving server IP automatically, from all network interfaces,
    # @see https://github.com/ossrs/srs/wiki/v4_CN_RTCWiki#config-candidate
    candidate 192.168.10.105;
}

vhost __defaultVhost__ {
    rtc {
        enabled     on;
    }
    http_remux {
        enabled     on;
        mount       [vhost]/[app]/[stream].flv;
    }
    http_hooks {
        enabled       on;
	on_connect    http://host.docker.internal:8085/api/v1/clients;
	on_close      http://host.docker.internal:8085/api/v1/clients;
        on_publish    http://host.docker.internal:8085/api/v1/streams;
	on_unpublish  http://host.docker.internal:8085/api/v1/streams;
	on_play       http://host.docker.internal:8085/api/v1/sessions;
	on_stop       http://host.docker.internal:8085/api/v1/sessions;
    }
}

Replay

Make sure to maintain the markdown structure.

How to replay bug?

Make sure to maintain the markdown structure.

1. Configure conf and set up call back API server

  1. Open the official player and play the flv file to trigger the on_play and on_stop callbacks => Normal
  2. Play the rtc stream to trigger the callbacks. The client id in the on_play callback is different from the client id in the on_stop callback, and the client id returned in the on_stop callback is always a fixed value (09o0x492).

Expected behavior (Expect)

Please describe your expectation:

  1. The client id that triggers the callbacks on_play and on_stop for the same user should have the same value.
    2.example =>

Please describe your expectation:
a. When the user plays, it triggers on_play callback and returns the client id as "aaaa".
b. When the user stops playing, it triggers on_stop callback and returns the client id as "aaaa".
c. When the user plays again, it triggers on_play callback again and returns the client id as "bbbb".
d. When the user stops playing again, it triggers on_stop callback and returns the client id as "bbbb".

TRANS_BY_GPT3

@fapjsc
Copy link
Author

fapjsc commented Sep 22, 2021

Screenshot 2021-09-22 7:20:21 PM

TRANS_BY_GPT3

@winlinvip winlinvip added API HTTP-API, HTTP-Callback, etc. Bug It might be a bug. labels Sep 23, 2021
@winlinvip winlinvip added this to the 4.0 milestone Sep 23, 2021
@winlinvip winlinvip changed the title HTTP Callback 触发on_stop事件后,回传的client id与触发on_play的client id不一致,且每次都是09o0x492 API: HTTP Callback 触发on_stop事件后,回传的client id与触发on_play的client id不一致,且每次都是09o0x492 Sep 23, 2021
@duiniuluantanqin
Copy link
Member

duiniuluantanqin commented Oct 18, 2021

Fixed #2665

@winlinvip winlinvip changed the title API: HTTP Callback 触发on_stop事件后,回传的client id与触发on_play的client id不一致,且每次都是09o0x492 API: After the on_stop event triggered by the HTTP Callback, the client id returned is different from the client id that triggered the on_play event, and it is always 09o0x492. Jul 29, 2023
@winlinvip winlinvip added the TransByAI Translated by AI/GPT. label Jul 29, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment