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: No service_id in the body of the HTTP callback. When triggering the /api/v1/sessions interface, the service_id was not carried back. #3419

Closed
xiangzi1 opened this issue Feb 15, 2023 · 0 comments · Fixed by #3424
Assignees
Labels
Bug It might be a bug. TransByAI Translated by AI/GPT.

Comments

@xiangzi1
Copy link

xiangzi1 commented Feb 15, 2023

Note: Please read FAQ before file an issue, see #2716

Description

Please description your issue here

  1. SRS Version: v5.0.141

  2. SRS Log:

hook callback data
{
	"server_id": "vid-4k7q1c7",
	"action": "on_play",
	"client_id": "k42jf786",
	"ip": "10.67.4.32",
	"vhost": "__defaultVhost__",
	"app": "live",
	"stream": "34020000001320000203_cd35264f57e044e4a862f3c9502729912",
	"tcUrl": "rtmp://__defaultVhost__/live",
	"param": "",
	"pageUrl": "http://10.67.4.32:3003/",
	"stream_url": "/live/34020000001320000203_cd35264f57e044e4a862f3c9502729912",
	"stream_id": "vid-4l10070"
}
  1. SRS Config:
# docker config for srs.
# @see full.conf for detail config.

listen              1935;
max_connections     1000;
# For docker, please use docker logs to manage the logs of SRS.
# See https://docs.docker.com/config/containers/logging/
srs_log_tank        console;
daemon              off;
http_api {
    enabled         on;
    listen          1985;
    raw_api {
        enabled             on;
        allow_reload        on;
    }
}
http_server {
    enabled         on;
    listen          8080;
    dir             ./objs/nginx/html;
}
rtc_server {
    enabled on;
    listen 8000;
    # @see https://github.com/ossrs/srs/wiki/v4_CN_WebRTC#config-candidate
    candidate 10.67.65.8;
}
vhost __defaultVhost__ {
    http_hooks {
        enabled         on;
        on_close        http://10.67.4.32:3009/api/v1/clients;
        on_play         http://10.67.4.32:3009/api/v1/sessions;
        on_stop         http://10.67.4.32:3009/api/v1/sessions;
    }
    http_remux {
        enabled     on;
        mount       [vhost]/[app]/[stream].flv;
    }
    rtc {
        enabled     on;
        # @see https://github.com/ossrs/srs/wiki/v4_CN_WebRTC#rtmp-to-rtc
        rtmp_to_rtc on;
        # @see https://github.com/ossrs/srs/wiki/v4_CN_WebRTC#rtc-to-rtmp
        rtc_to_rtmp off;
        stun_timeout 5;
        stun_strict_check on;
    }
        publish {
        normal_timeout 600000;
    }
}

Replay

Please describe how to replay the bug?

Step 1: Configure the hook interface

on_play         http://10.67.4.32:3009/api/v1/sessions;

Step 2: Hook callback data

Hook callback data
{
	"server_id": "vid-4k7q1c7",
	"action": "on_play",
	"client_id": "k42jf786",
	"ip": "10.67.4.32",
	"vhost": "__defaultVhost__",
	"app": "live",
	"stream": "34020000001320000203_cd35264f57e044e4a862f3c9502729912",
	"tcUrl": "rtmp://__defaultVhost__/live",
	"param": "",
	"pageUrl": "http://10.67.4.32:3003/",
	"stream_url": "/live/34020000001320000203_cd35264f57e044e4a862f3c9502729912",
	"stream_id": "vid-4l10070"
}

Expect

Please describe your expectation.
To handle media service restart exceptions, it is requested to return the unique service_id instead of server_id. In previous versions, server_id was used to handle exceptions, but it has now been assigned as the unique ID for the machine and cannot be changed during service restarts. Therefore, it is preferred to use service_id and it is expected to be returned as well.

TRANS_BY_GPT3

@winlinvip winlinvip changed the title 触发hook /api/v1/sessions 接口时,未将service_id回带过来 API: No service_id in body of HTTP callback. 触发hook /api/v1/sessions 接口时,未将service_id回带过来 Feb 15, 2023
@winlinvip winlinvip added the Bug It might be a bug. label Feb 15, 2023
@winlinvip winlinvip changed the title API: No service_id in body of HTTP callback. 触发hook /api/v1/sessions 接口时,未将service_id回带过来 API: No service_id in the body of the HTTP callback. When triggering the /api/v1/sessions interface, the service_id was not carried back. 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
Labels
Bug It might be a bug. TransByAI Translated by AI/GPT.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants