API

概要

API は Sora に対して HTTP 経由で実行できます。

API は DynamoDB や Route53 などの AWS API が独特な仕様なので紹介 を参考にしており、 x-sora-target というヘッダーを使って実行します。

全ての API は POST を使用し、PATH は / です。リクエストの Body には JSON を使用します。

設定

api_port

sora.conf にて API のポート番号を設定してください。

api_port = 3000

api_loopback_address_only

API へのアクセスをループバックアドレスからのみに制限します。 本番環境では可能な限り有効にしてください。

api_loopback_address_only = true

api_cors_origin

API をクロスドメインで使用したい場合に設定します。

api_cors_origin = http://127.0.0.1:5000

こうすることで http://127.0.0.1:5000 から API を叩くことができるようになります。

httpie

ここでの例では httpie という Python のライブラリを使用しています。

シグナリング API

指定したチャネルの接続をすべて切断する

サービス

Sora

バージョン

20151104

オペレーション

DisconnectChannel

x-sora-target

Sora_20151104.DisconnectChannel

キー

channel_id

string

reason (オプション)

object

reason に値を指定した場合、イベントウェブフック connection.destroyed の reason に指定した値が入ってきます。

$ http POST 127.0.0.1:3000 \
    x-sora-target:Sora_20151104.DisconnectChannel \
    channel_id=sora \
    -vvv
POST / HTTP/1.1
Accept: application/json
Accept-Encoding: gzip, deflate
Connection: keep-alive
Content-Length: 22
Content-Type: application/json
Host: 127.0.0.1:3000
User-Agent: HTTPie/0.9.3
x-sora-target: Sora_20151104.DisconnectChannel

{
    "channel_id": "sora"
}

HTTP/1.1 200 OK
content-length: 0
content-type: application/json
date: Sun, 24 Jul 2016 06:04:53 GMT
server: Cowboy

指定したチャネルすべての配信者の接続を切断する

警告

この API は実験的機能のため正式版では仕様が変更される可能性があります

サービス

Sora

バージョン

20151104

オペレーション

DisconnectChannelUpstream

x-sora-target

Sora_20151104.DisconnectChannelUpstream

キー

channel_id

string

reason (オプション)

object

reason に値を指定した場合、イベントウェブフック connection.destroyed の reason に指定した値が入ってきます。

$ http POST 127.0.0.1:3000 \
    x-sora-target:Sora_20151104.DisconnectChannelUpstream \
    channel_id=sora \
    -vvv
POST / HTTP/1.1
Accept: application/json
Accept-Encoding: gzip, deflate
Connection: keep-alive
Content-Length: 22
Content-Type: application/json
Host: 127.0.0.1:3000
User-Agent: HTTPie/0.9.3
x-sora-target: Sora_20151104.DisconnectChannelUpstream

{
    "channel_id": "sora"
}

HTTP/1.1 200 OK
content-length: 0
content-type: application/json
date: Sun, 24 Jul 2016 06:04:53 GMT
server: Cowboy

指定したチャネルすべての視聴者の接続を切断する

警告

この API は実験的機能のため正式版では仕様が変更される可能性があります

サービス

Sora

バージョン

20151104

オペレーション

DisconnectChannelDownstream

x-sora-target

Sora_20151104.DisconnectChannelDownstream

キー

channel_id

string

reason (オプション)

object

reason に値を指定した場合、イベントウェブフック connection.destroyed の reason に指定した値が入ってきます。

$ http POST 127.0.0.1:3000 \
    x-sora-target:Sora_20151104.DisconnectChannelDownstream \
    channel_id=sora \
    -vvv
POST / HTTP/1.1
Accept: application/json
Accept-Encoding: gzip, deflate
Connection: keep-alive
Content-Length: 22
Content-Type: application/json
Host: 127.0.0.1:3000
User-Agent: HTTPie/0.9.3
x-sora-target: Sora_20151104.DisconnectChannelDownstream

{
    "channel_id": "sora"
}

HTTP/1.1 200 OK
content-length: 0
content-type: application/json
date: Sun, 24 Jul 2016 06:04:53 GMT
server: Cowboy

指定したクライアント ID の接続をすべて切断する

サービス

Sora

バージョン

20151104

オペレーション

DisconnectClient

x-sora-target

Sora_20151104.DisconnectClient

キー

channel_id

string

client_id

string

reason (オプション)

object

reason に値を指定した場合、イベントウェブフック connection.destroyed の reason に指定した値が入ってきます。

$ http POST 127.0.0.1:3000/ \
    x-sora-target:Sora_20151104.DisconnectClient \
    channel_id=sora \
    client_id=HMRVPQEXJX03D3B3WE778SJGRC \
    -vvv
POST / HTTP/1.1
Accept: application/json
Accept-Encoding: gzip, deflate
Connection: keep-alive
Content-Length: 75
Content-Type: application/json
Host: 127.0.0.1:3000
User-Agent: HTTPie/2.0.0
x-sora-target: Sora_20151104.DisconnectClient

{
    "channel_id": "sora",
    "client_id": "HMRVPQEXJX03D3B3WE778SJGRC"
}

HTTP/1.1 200 OK
content-length: 0
content-type: application/json
date: Sun, 29 May 2020 05:13:20 GMT
server: Cowboy

指定したコネクション ID の接続を切断する

サービス

Sora

バージョン

20151104

オペレーション

DisconnectConnection

x-sora-target

Sora_20151104.DisconnectConnection

キー

channel_id

string

connection_id

string

reason (オプション)

object

reason に値を指定した場合、イベントウェブフック connection.destroyed の reason に指定した値が入ってきます。

$ http POST 127.0.0.1:3000/ \
    x-sora-target:Sora_20151104.DisconnectConnection \
    channel_id=sora \
    connection_id=HMRVPQEXJX03D3B3WE778SJGRC \
    -vvv
POST / HTTP/1.1
Accept: application/json
Accept-Encoding: gzip, deflate
Connection: keep-alive
Content-Length: 75
Content-Type: application/json
Host: 127.0.0.1:3000
User-Agent: HTTPie/2.0.0
x-sora-target: Sora_20151104.DisconnectConnection

{
    "channel_id": "sora",
    "connection_id": "HMRVPQEXJX03D3B3WE778SJGRC"
}

HTTP/1.1 200 OK
content-length: 0
content-type: application/json
date: Sun, 29 May 2020 05:13:20 GMT
server: Cowboy

旧 API: 指定したクライアント ID の接続を切断する

重要

この API は後方互換性の維持のために残されています

警告

sora.conf にて allow_client_id_assignment を true にしていた場合はこの API は利用できません

サービス

Sora

バージョン

20151104

オペレーション

Disconnect

x-sora-target

Sora_20151104.Disconnect

キー

channel_id

string

client_id

string

reason (オプション)

object

reason に値を指定した場合、イベントウェブフック connection.destroyed の reason に指定した値が入ってきます。

$ http POST 127.0.0.1:3000/ \
    x-sora-target:Sora_20151104.Disconnect \
    channel_id=sora \
    client_id=HMRVPQEXJX03D3B3WE778SJGRC \
    -vvv
POST / HTTP/1.1
Accept: application/json
Accept-Encoding: gzip, deflate
Connection: keep-alive
Content-Length: 75
Content-Type: application/json
Host: 127.0.0.1:3000
User-Agent: HTTPie/0.9.3
x-sora-target: Sora_20151104.Disconnect

{
    "channel_id": "sora",
    "client_id": "HMRVPQEXJX03D3B3WE778SJGRC"
}

HTTP/1.1 200 OK
content-length: 0
content-type: application/json
date: Sun, 29 May 2020 05:13:20 GMT
server: Cowboy

指定したチャネルの接続一覧を取得する

サービス

Sora

バージョン

20151104

オペレーション

ListConnections

x-sora-target

Sora_20151104.ListConnections

キー

channel_id

string

$ http POST 127.0.0.1:3000/ \
    x-sora-target:Sora_20151104.ListConnections \
    channel_id=sora \
    -vvv
POST / HTTP/1.1
Accept: application/json, */*
Accept-Encoding: gzip, deflate
Connection: keep-alive
Content-Length: 22
Content-Type: application/json
Host: 127.0.0.1:3000
User-Agent: HTTPie/2.0.0
x-sora-target: Sora_20151104.ListConnections

{
    "channel_id": "sora"
}

HTTP/1.1 200 OK
access-control-allow-headers: Origin, X-Requested-With, Content-Type, Accept, x-sora-target
access-control-allow-methods: POST, OPTIONS
access-control-allow-origin: http://127.0.0.1:5000
access-control-max-age: 1000
content-length: 361
content-type: application/json
date: Fri, 12 Jun 2020 06:37:58 GMT
server: Cowboy

[
    {
        "channel_id": "sora",
        "client_id": "6DXMKHX8Q106K9YKN693C2D69C",
        "connection_id": "6DXMKHX8Q106K9YKN693C2D69C",
        "multistream": true,
        "role": "sendrecv",
        "simulcast": true,
        "spotlight": false
    },
    {
        "channel_id": "sora",
        "client_id": "QR3H6TYEA907B2HRDF6KCBGWYG",
        "connection_id": "QR3H6TYEA907B2HRDF6KCBGWYG",
        "multistream": true,
        "role": "sendrecv",
        "simulcast": true,
        "spotlight": false
    }
]

すべての接続一覧を取得する

サービス

Sora

バージョン

20151104

オペレーション

ListAllConnections

x-sora-target

Sora_20151104.ListAllConnections

レスポンス項目

リスト

  • role

  • channel_id

  • client_id

  • connection_id

  • multistream

  • simulcast

  • spotlight

$ http POST 127.0.0.1:3000/ \
    x-sora-target:Sora_20151104.ListAllConnections \
    -vvv
POST / HTTP/1.1
Accept: */*
Accept-Encoding: gzip, deflate
Connection: keep-alive
Content-Length: 0
Host: 127.0.0.1:3000
User-Agent: HTTPie/2.0.0
x-sora-target: Sora_20151104.ListAllConnections



HTTP/1.1 200 OK
access-control-allow-headers: Origin, X-Requested-With, Content-Type, Accept, x-sora-target
access-control-allow-methods: POST, OPTIONS
access-control-allow-origin: http://127.0.0.1:5000
access-control-max-age: 1000
content-length: 542
content-type: application/json
date: Fri, 12 Jun 2020 06:38:55 GMT
server: Cowboy

[
    {
        "channel_id": "sora",
        "client_id": "6DXMKHX8Q106K9YKN693C2D69C",
        "connection_id": "6DXMKHX8Q106K9YKN693C2D69C",
        "multistream": true,
        "role": "sendrecv",
        "simulcast": true,
        "spotlight": false
    },
    {
        "channel_id": "sora",
        "client_id": "QR3H6TYEA907B2HRDF6KCBGWYG",
        "connection_id": "QR3H6TYEA907B2HRDF6KCBGWYG",
        "multistream": true,
        "role": "sendrecv",
        "simulcast": true,
        "spotlight": false
    },
    {
        "channel_id": "sora1",
        "client_id": "K3VJGRFG614SV4RRF74QDEYHVC",
        "connection_id": "K3VJGRFG614SV4RRF74QDEYHVC",
        "multistream": true,
        "role": "sendrecv",
        "simulcast": true,
        "spotlight": false
    }
]

指定したチャネルのクライアント情報を取得する

サービス

Sora

バージョン

20170814

オペレーション

ListChannelClients

x-sora-target

Sora_20170814.ListChannelClients

キー

channel_id

string

レスポンス項目

リスト

  • role

  • multistream

  • channel_id

  • client_id

  • connection_id

  • audio

  • video

  • minutes

    • 分単位での接続経過時間

  • event_metadta

    • 認証時に認証サーバから指定した event_metadata

$ http POST 127.0.0.1:3000/ \
    x-sora-target:Sora_20170814.ListChannelClients \
    channel_id=sora \
    -vvv
POST / HTTP/1.1
Accept: application/json, */*
Accept-Encoding: gzip, deflate
Connection: keep-alive
Content-Length: 22
Content-Type: application/json
Host: 127.0.0.1:3000
User-Agent: HTTPie/2.0.0
x-sora-target: Sora_20170814.ListChannelClients

{
    "channel_id": "sora"
}

HTTP/1.1 200 OK
access-control-allow-headers: Origin, X-Requested-With, Content-Type, Accept, x-sora-target
access-control-allow-methods: POST, OPTIONS
access-control-allow-origin: http://127.0.0.1:5000
access-control-max-age: 1000
content-length: 465
content-type: application/json
date: Fri, 12 Jun 2020 06:39:57 GMT
server: Cowboy

[
    {
        "audio": {
            "codec_type": "OPUS"
        },
        "channel_id": "sora",
        "client_id": "6DXMKHX8Q106K9YKN693C2D69C",
        "connection_id": "6DXMKHX8Q106K9YKN693C2D69C",
        "minutes": 2,
        "multistream": true,
        "role": "sendrecv",
        "video": {
            "bit_rate": 3000,
            "codec_type": "VP8"
        }
    },
    {
        "audio": {
            "codec_type": "OPUS"
        },
        "channel_id": "sora",
        "client_id": "QR3H6TYEA907B2HRDF6KCBGWYG",
        "connection_id": "QR3H6TYEA907B2HRDF6KCBGWYG",
        "minutes": 2,
        "multistream": true,
        "role": "sendrecv",
        "video": {
            "bit_rate": 3000,
            "codec_type": "VP8"
        }
    }
]

プッシュ API

シグナリングで使用している WebSocket を活用できる API です。この機能を使うことでアプリ側でプッシュの仕組みを用意する必要がなくなります。

指定したチャネル全員にプッシュ通知を送る

サービス

Sora

バージョン

20160711

オペレーション

PushChannel

x-sora-target

Sora_20160711.PushChannel

キー

channel_id

string

data

object

data には全員に通知する JSON を指定してください。 クライアントには data に指定した JSON が送られます。

$ http POST 127.0.0.1:3000/ \
    x-sora-target:Sora_20160711.PushChannel \
    channel_id=sora \
    data:="{\"spam\": \"egg\"}" \
    -vvv
POST / HTTP/1.1
Accept: application/json
Accept-Encoding: gzip, deflate
Connection: keep-alive
Content-Length: 47
Content-Type: application/json
Host: 127.0.0.1:3000
User-Agent: HTTPie/0.9.4
x-sora-target: Sora_20160711.PushChannel

{
    "channel_id": "sora",
    "data": {
        "spam": "egg"
    }
}

HTTP/1.1 200 OK
content-length: 37
content-type: application/json
date: Sun, 24 Jul 2016 06:26:21 GMT
server: Cowboy

{
    "data": {
        "spam": "egg"
    },
    "type": "push"
}

指定したチャネルのクライアントにプッシュ通知を送る

サービス

Sora

バージョン

20160711

オペレーション

PushClient

x-sora-target

Sora_20160711.PushClient

キー

channel_id

string

client_id

string

data

object

複数の接続に同一の client_id が指定されていた場合、複数の接続にプッシュ通知が送られます。

$ http POST 127.0.0.1:3000/ \
    x-sora-target:Sora_20160711.PushClient \
    channel_id=sora \
    client_id=C0YTCRZM715BKATBXWFPKTYGRM \
    data:="{\"spam\": \"egg\"}" \
    -vvv
POST / HTTP/1.1
Accept: application/json
Accept-Encoding: gzip, deflate
Connection: keep-alive
Content-Length: 100
Content-Type: application/json
Host: 127.0.0.1:3000
User-Agent: HTTPie/0.9.4
x-sora-target: Sora_20160711.PushClient

{
    "channel_id": "sora",
    "client_id": "C0YTCRZM715BKATBXWFPKTYGRM",
    "data": {
        "spam": "egg"
    }
}

HTTP/1.1 200 OK
content-length: 37
content-type: application/json
date: Sun, 24 Jul 2016 07:46:31 GMT
server: Cowboy

{
    "data": {
        "spam": "egg"
    },
    "type": "push"
}

指定したチャネルの接続にプッシュ通知を送る

サービス

Sora

バージョン

20160711

オペレーション

PushConnection

x-sora-target

Sora_20160711.PushConnection

キー

channel_id

string

connection_id

string

data

object

$ http POST 127.0.0.1:3000/ \
    x-sora-target:Sora_20160711.PushConnection \
    channel_id=sora \
    connection_id=C0YTCRZM715BKATBXWFPKTYGRM \
    data:="{\"spam\": \"egg\"}" \
    -vvv
POST / HTTP/1.1
Accept: application/json
Accept-Encoding: gzip, deflate
Connection: keep-alive
Content-Length: 100
Content-Type: application/json
Host: 127.0.0.1:3000
User-Agent: HTTPie/0.9.4
x-sora-target: Sora_20160711.PushConnection

{
    "channel_id": "sora",
    "client_id": "C0YTCRZM715BKATBXWFPKTYGRM",
    "data": {
        "spam": "egg"
    }
}

HTTP/1.1 200 OK
content-length: 37
content-type: application/json
date: Sun, 24 Jul 2016 07:46:31 GMT
server: Cowboy

{
    "data": {
        "spam": "egg"
    },
    "type": "push"
}

指定したチャネルの配信クライアントにプッシュ通知を送る

サービス

Sora

バージョン

20160711

オペレーション

PushUpstream

x-sora-target

Sora_20160711.PushUpstream

キー

channel_id

string

data

object

$ http POST 127.0.0.1:3000/ \
    x-sora-target:Sora_20160711.PushUpstream \
    channel_id=sora \
    data:="{\"spam\": \"egg\"}" \
    -vvv
POST / HTTP/1.1
Accept: application/json
Accept-Encoding: gzip, deflate
Connection: keep-alive
Content-Length: 47
Content-Type: application/json
Host: 127.0.0.1:3000
User-Agent: HTTPie/0.9.4
x-sora-target: Sora_20160711.PushUpstream

{
    "channel_id": "sora",
    "data": {
        "spam": "egg"
    }
}

HTTP/1.1 200 OK
content-length: 37
content-type: application/json
date: Sun, 24 Jul 2016 06:29:08 GMT
server: Cowboy

{
    "data": {
        "spam": "egg"
    },
    "type": "push"
}

指定したチャネルの視聴クライアントにプッシュ通知を送る

サービス

Sora

バージョン

20160711

オペレーション

PushDownstream

x-sora-target

Sora_20160711.PushDownStream

キー

channel_id

string

data

object

$ http POST 127.0.0.1:3000/ \
    x-sora-target:Sora_20160711.PushDownstream \
    channel_id=sora \
    data:="{\"spam\": \"egg\"}" \
    -vvv
POST / HTTP/1.1
Accept: application/json
Accept-Encoding: gzip, deflate
Connection: keep-alive
Content-Length: 47
Content-Type: application/json
Host: 127.0.0.1:3000
User-Agent: HTTPie/0.9.4
x-sora-target: Sora_20160711.PushDownstream

{
    "channel_id": "sora",
    "data": {
        "spam": "egg"
    }
}

HTTP/1.1 200 OK
content-length: 37
content-type: application/json
date: Sun, 24 Jul 2016 06:29:20 GMT
server: Cowboy

{
    "data": {
        "spam": "egg"
    },
    "type": "push"
}

録画 API

録画されたファイルは sora.confarchive_dir に指定したフォルダに置かれます。

音声と映像のコーデック指定はシグナリング開始時に指定してください。

指定したチャネルの録画を開始する

サービス

Sora

バージョン

20161101

オペレーション

StartRecording

x-sora-target

Sora_20161101.StartRecording

キー

channel_id

string

expire_time

integer

  • start_time は録画を開始した時間で Unix Time (UTC) の秒数で返ってきます

  • expire_time を 0 に指定した場合、録画の期限が無くなります

  • expire_time の範囲は 0 から 86400 までで、秒数を指定してください

expire_time が 0:

$ http POST 127.0.0.1:3000/ \
    x-sora-target:Sora_20161101.StartRecording \
    channel_id=sora \
    expire_time:=0 \
    -vvv
POST / HTTP/1.1
Accept: application/json, */*
Accept-Encoding: gzip, deflate
Connection: keep-alive
Content-Length: 41
Content-Type: application/json
Host: 127.0.0.1:3000
User-Agent: HTTPie/0.9.9
x-sora-target: Sora_20161101.StartRecording

{
    "channel_id": "sora",
    "expire_time": 0
}

HTTP/1.1 200 OK
access-control-allow-headers: Origin, X-Requested-With, Content-Type, Accept, x-sora-target
access-control-allow-methods: POST, OPTIONS
access-control-allow-origin: http://127.0.0.1:5000
access-control-max-age: 1000
content-length: 82
content-type: application/json
date: Wed, 19 Apr 2017 06:35:38 GMT
server: Cowboy

{
    "channel_id": "sora",
    "expire_time": 0,
    "id": "C0YTCRZM715BKATBXWFPKTYGRM"
}

expire_time が 3600:

$ http POST 127.0.0.1:3000/ \
    x-sora-target:Sora_20161101.StartRecording \
    channel_id=sora \
    expire_time:=3600 \
    -vvv
POST / HTTP/1.1
Accept: application/json, */*
Accept-Encoding: gzip, deflate
Connection: keep-alive
Content-Length: 43
Content-Type: application/json
Host: 127.0.0.1:3000
User-Agent: HTTPie/0.9.9
x-sora-target: Sora_20161101.StartRecording

{
    "channel_id": "sora",
    "expire_time": 3600
}

HTTP/1.1 200 OK
access-control-allow-headers: Origin, X-Requested-With, Content-Type, Accept, x-sora-target
access-control-allow-methods: POST, OPTIONS
access-control-allow-origin: http://127.0.0.1:5000
access-control-max-age: 1000
content-length: 84
content-type: application/json
date: Wed, 19 Apr 2017 06:37:08 GMT
server: Cowboy

{
    "channel_id": "sora",
    "expire_time": 3600,
    "id": "C0YTCRZM715BKATBXWFPKTYGRM"
}

エラー

すでに録画が開始している場合は "STARTED-RECORDING" が返ってきます。

$ http POST 127.0.0.1:3000/ \
        x-sora-target:Sora_20161101.StartRecording \
        channel_id=sora \
        expire_time:=3600 \
        -vvv
POST / HTTP/1.1
Accept: application/json, */*
Accept-Encoding: gzip, deflate
Connection: keep-alive
Content-Length: 43
Content-Type: application/json
Host: 127.0.0.1:3000
User-Agent: HTTPie/0.9.9
x-sora-target: Sora_20161101.StartRecording

{
    "channel_id": "sora",
    "expire_time": 3600
}

HTTP/1.1 400 Bad Request
access-control-allow-headers: Origin, X-Requested-With, Content-Type, Accept, x-sora-target
access-control-allow-methods: POST, OPTIONS
access-control-allow-origin: http://127.0.0.1:5000
access-control-max-age: 1000
content-length: 34
content-type: application/json
date: Wed, 19 Apr 2017 06:44:58 GMT
server: Cowboy

{
    "error_type": "STARTED-RECORDING"
}
  • "STARTED-RECORDING"

    • すでに指定したチャネルでは録画が開始されている

指定したチャネルの録画を停止する

サービス

Sora

バージョン

20161101

オペレーション

StopRecording

x-sora-target

Sora_20161101.StopRecording

キー

channel_id

string

$ http POST 127.0.0.1:3000/ \
    x-sora-target:Sora_20161101.StopRecording \
    channel_id=sora \
    -vvv
POST / HTTP/1.1
Accept: application/json
Accept-Encoding: gzip, deflate
Connection: keep-alive
Content-Length: 22
Content-Type: application/json
Host: 127.0.0.1:3000
User-Agent: HTTPie/0.9.4
x-sora-target: Sora_20161101.StopRecording

{
    "channel_id": "sora"
}

HTTP/1.1 200 OK
content-length: 21
content-type: application/json
date: Fri, 11 Nov 2016 14:29:14 GMT
server: Cowboy

{
    "channel_id": "sora"
}

エラー

  • NOT-STARTED-RECORDING

    • 指定したチャネルの録画が開始されていない

録画が有効かどうかを確認する

サービス

Sora

バージョン

20161101

オペレーション

GetStartedRecording

x-sora-target

Sora_20161101.GetStartedRecording

キー

channel_id

string

$ http POST 127.0.0.1:3000/ \
    x-sora-target:Sora_20161101.GetStartedRecording \
    channel_id=sora \
    -vvv
POST / HTTP/1.1
Accept: application/json
Accept-Encoding: gzip, deflate
Connection: keep-alive
Content-Length: 22
Content-Type: application/json
Host: 127.0.0.1:3000
User-Agent: HTTPie/0.9.4
x-sora-target: Sora_20161101.GetStartedRecording

{
    "channel_id": "sora"
}

HTTP/1.1 200 OK
content-length: 88
content-type: application/json
date: Sat, 19 Nov 2016 13:03:24 GMT
server: Cowboy

{
    "channel_id": "sora",
    "expire_time": 3600,
    "expired_at": 1479563964,
    "start_time": 1479560364
}

エラー

指定したチャネルで録画が開始されていない場合は "NOT-STARTED-RECORDING" が返ってきます

$ http POST 127.0.0.1:3000/ \
    x-sora-target:Sora_20161101.GetStartedRecording \
    channel_id=sora \
    -vvv
POST / HTTP/1.1
Accept: application/json
Accept-Encoding: gzip, deflate
Connection: keep-alive
Content-Length: 22
Content-Type: application/json
Host: 127.0.0.1:3000
User-Agent: HTTPie/0.9.4
x-sora-target: Sora_20161101.GetStartedRecording

{
    "channel_id": "sora"
}

HTTP/1.1 400 Bad Request
content-length: 38
content-type: application/json
date: Sat, 19 Nov 2016 13:03:53 GMT
server: Cowboy

{
    "error_type": "NOT-STARTED-RECORDING"
}
  • NOT-STARTED-RECORDING

    • 指定したチャネルの録画が開始されていない

録画が行われているチャネル一覧を取得する

サービス

Sora

バージョン

20161101

オペレーション

ListStartedRecording

x-sora-target

Sora_20161101.ListStartedRecording

$ http POST 127.0.0.1:3000/ \
    "x-sora-target:Sora_20161101.ListStartedRecording" \
    -vvv
POST / HTTP/1.1
Accept: */*
Accept-Encoding: gzip, deflate
Connection: keep-alive
Content-Length: 0
Host: 127.0.0.1:3000
User-Agent: HTTPie/0.9.4
x-sora-target: Sora_20161101.ListStartedRecording



HTTP/1.1 200 OK
content-length: 168
content-type: application/json
date: Sat, 19 Nov 2016 13:05:38 GMT
server: Cowboy

[
    {
        "channel_id": "sora",
        "expire_time": 3600,
        "expired_at": 1479564309,
        "start_time": 1479560709
    },
    {
        "channel_id": "akane",
        "expire_time": 0,
        "expired_at": 0,
        "start_time": 1479560735
    }
]

現在録画中の状態を取得する

サービス

Sora

バージョン

20161101

オペレーション

ListArchiving

x-sora-target

Sora_20161101.ListArchiving

$ http POST 127.0.0.1:3000/ \
    x-sora-target:Sora_20161101.ListArchiving \
    -vvv
POST / HTTP/1.1
Accept: */*
Accept-Encoding: gzip, deflate
Connection: keep-alive
Content-Length: 0
Host: 127.0.0.1:3000
User-Agent: HTTPie/1.0.2
x-sora-target: Sora_20161101.ListArchiving



HTTP/1.1 200 OK
access-control-allow-headers: Origin, X-Requested-With, Content-Type, Accept, x-sora-target
access-control-allow-methods: POST, OPTIONS
access-control-allow-origin: http://127.0.0.1:5000
access-control-max-age: 1000
content-length: 218
content-type: application/json
date: Mon, 15 Apr 2019 08:39:20 GMT
server: Cowboy

[
    {
        "audio": {
            "codec_type": "OPUS"
        },
        "channel_id": "sora",
        "client_id": "C0YTCRZM715BKATBXWFPKTYGRM",
        "connection_id": "C0YTCRZM715BKATBXWFPKTYGRM",
        "seconds": 146,
        "video": {
            "bit_rate": 1000,
            "codec_type": "VP9"
        }
    }
]
  • seconds は録画を開始してからの経過時間(秒)です

  • video が設定されていない場合は "video": false という値が入ってきます

  • audio が設定されていない場合は "audio": false という値が入ってきます

RTP 転送 API

警告

RTP 転送機能は実験的機能のため正式版では仕様が変更される可能性があります

指定したチャネル ID の配信している映像または音声の RTP を指定した IP アドレスとポートに送信します。

指定したチャネルの RTP を転送を開始する

サービス

Sora

バージョン

20170814

オペレーション

StartForwardingRtp

x-sora-target

Sora_20170814.StartForwardingRtp

キー

channel_id

string

client_id (オプション)

string

connection_id (オプション)

string

ip_address

string

audio_port

integer

video_port

integer

マルチストリームの音声や映像を転送する場合は client_id または connection_id を指定してください。

sora.conf にて allow_client_id_assignmenttrue にしていた場合は client_id は指定できなくなります。

$ http POST 127.0.0.1:3000/ \
    x-sora-target:Sora_20170814.StartForwardingRtp \
    channel_id=sora \
    ip_address=127.0.0.1 \
    audio_port:=60001 \
    video_port:=60003 \
    -vvv

POST / HTTP/1.1
Accept: application/json
Accept-Encoding: gzip, deflate
Connection: keep-alive
Content-Length: 93
Content-Type: application/json
Host: 127.0.0.1:3000
User-Agent: HTTPie/0.9.2
x-sora-target: Sora_20170814.StartForwardingRtp

{
    "audio_port": 60001,
    "channel_id": "sora",
    "ip_address": "127.0.0.1",
    "video_port": 60003
}

HTTP/1.1 200 OK
access-control-allow-headers: Origin, X-Requested-With, Content-Type, Accept, x-sora-target
access-control-allow-methods: POST, OPTIONS
access-control-allow-origin: http://127.0.0.1:5000
access-control-max-age: 1000
content-length: 262
content-type: application/json
date: Wed, 30 Aug 2017 02:08:50 GMT
server: Cowboy

{
    "sdp": "v=0\r\no=- 0 0 IN IP4 0.0.0.0\r\ns=-\r\nt=0 0\r\nm=audio 60001 RTP/SAVPF 109\r\nc=IN IP4 127.0.0.1\r\na=rtpmap:109 opus/48000/2\r\nm=video 60003 RTP/SAVPF 120\r\nc=IN IP4 127.0.0.1\r\na=rtpmap:120 VP9/90000\r\na=fmtp:120 max-fs=12288;max-fr=60\r\n"
}

指定したチャネルの RTP を転送を停止する

サービス

Sora

バージョン

20170814

オペレーション

StopForwardingRtp

x-sora-target

Sora_20170814.StopForwardingRtp

キー

channel_id

string

client_id (オプション)

string

connection_id (オプション)

string

マルチストリームの音声や映像の転送を停止する場合は client_id または connection_id を指定してください。

sora.conf にて allow_client_id_assignmenttrue にしていた場合は client_id は指定できなくなります。

$ http POST 127.0.0.1:3000/ \
    x-sora-target:Sora_20170814.StopForwardingRtp \
    channel_id=sora \
    -vvv

POST / HTTP/1.1
Accept: application/json, */*
Accept-Encoding: gzip, deflate
Connection: keep-alive
Content-Length: 22
Content-Type: application/json
Host: 127.0.0.1:3000
User-Agent: HTTPie/0.9.9
x-sora-target: Sora_20170814.StopForwardingRtp

{
    "channel_id": "sora"
}

HTTP/1.1 200 OK
access-control-allow-headers: Origin, X-Requested-With, Content-Type, Accept, x-sora-target
access-control-allow-methods: POST, OPTIONS
access-control-allow-origin: http://127.0.0.1:5000
access-control-max-age: 1000
content-length: 21
content-type: application/json
date: Fri, 25 Aug 2017 13:32:48 GMT
server: Cowboy

{
    "channel_id": "sora"
}

統計 API

統計項目一覧

  • timestamp

    • API を取得した時点の UTC 時間 RFC3339 形式

  • channel_id

  • client_id

  • connection_id

  • dtls

    • total_received_dtls

      • 受信した DTLS パケットの総数

    • total_sent_dtls

      • 送信した DTLS パケットの総数

  • network_status

    • unstable_level

      • API を取得した時点の不安定レベル

  • packet_loss_simulator

    • total_dropped_received_rtp

      • 受信したがパケロスシミュレータが落とした RTP パケットの総数

    • total_dropped_sent_rtp

      • 送信したがパケロスシミュレータが落とした RTP パケットの総数

  • rtp

    • total_generic_nack_cache_hit

      • 再送要求に答えた総数

    • total_generic_nack_cache_miss

      • 再送要求に答えられなかった総数

    • total_pli_trigger

      • 再送要求が限界に来たため全画面要求(PLI) を送信した総数

    • total_received

    • total_received_byte_size

    • total_received_rtcp

    • total_received_rtcp_bye

    • total_received_rtcp_byte_size

    • total_received_rtcp_psfb_afb

    • total_received_rtcp_psfb_fir

    • total_received_rtcp_psfb_pli

    • total_received_rtcp_rr

    • total_received_rtcp_rtpfb_generic_nack

    • total_received_rtcp_rtpfb_tmmbn

    • total_received_rtcp_rtpfb_tmmbr

    • total_received_rtcp_rtpfb_transport_wide

    • total_received_rtcp_sdes

    • total_received_rtcp_sr

    • total_received_rtcp_unknown

    • total_received_rtcp_xr

    • total_received_rtp

    • total_received_rtp_byte_size

    • total_received_rtp_red

    • total_received_rtp_red_rtx

    • total_received_rtp_red_ulpfec

    • total_received_rtp_rtx

    • total_sent

    • total_sent_byte_size

    • total_sent_rtcp

    • total_sent_rtcp_bye

    • total_sent_rtcp_byte_size

    • total_sent_rtcp_psfb_afb

    • total_sent_rtcp_psfb_fir

    • total_sent_rtcp_psfb_pli

    • total_sent_rtcp_rr

    • total_sent_rtcp_rtpfb_generic_nack

    • total_sent_rtcp_rtpfb_tmmbn

    • total_sent_rtcp_rtpfb_tmmbr

    • total_sent_rtcp_rtpfb_transport_wide

    • total_sent_rtcp_sdes

    • total_sent_rtcp_sr

    • total_sent_rtcp_unknown

    • total_sent_rtcp_xr

    • total_sent_rtp

    • total_sent_rtp_byte_size

  • turn

    • total_received_turn_unknown_stun

    • total_received_turn_invalid_stun

    • total_received_unknown_channel_number

    • total_received_expired_channel_number

    • total_received_allocate_request

    • total_received_binding_request

    • total_received_channel_bind_request

    • total_received_channel_data

    • total_received_create_permission_request

    • total_received_refresh_request

    • total_received_send_indication

    • total_received_turn_binding_error

    • total_received_turn_binding_request

    • total_received_turn_binding_success

    • total_received_turn_unknown

    • total_sent_allocate_error

    • total_sent_allocate_success

    • total_sent_binding_error

    • total_sent_binding_success

    • total_sent_channel_bind_error

    • total_sent_channel_bind_success

    • total_sent_channel_data

    • total_sent_create_permission_error

    • total_sent_create_permission_success

    • total_sent_data_indication

    • total_sent_refresh_error

    • total_sent_refresh_success

    • total_sent_turn_binding_error

    • total_sent_turn_binding_request

    • total_sent_turn_binding_success

    • total_sent_turn_unknown

指定したクライアントの統計情報を取得する

サービス

Sora

バージョン

20170529

オペレーション

GetStatsClient

x-sora-target

Sora_20170529.GetStatsClient

キー

channel_id

string

client_id

string

$ http POST 127.0.0.1:3000/ \
    x-sora-target:Sora_20170529.GetStatsClient \
    channel_id=sora \
    client_id=KD9N57E2RN5T1BDEA7S7SH038M \
    -vvv

POST / HTTP/1.1
Accept: application/json, */*
Accept-Encoding: gzip, deflate
Connection: keep-alive
Content-Length: 65
Content-Type: application/json
Host: 127.0.0.1:3000
User-Agent: HTTPie/2.0.0
x-sora-target: Sora_20170529.GetStatsClient

{
    "channel_id": "sora",
    "client_id": "KD9N57E2RN5T1BDEA7S7SH038M"
}

HTTP/1.1 200 OK
access-control-allow-headers: Origin, X-Requested-With, Content-Type, Accept, x-sora-target
access-control-allow-methods: POST, OPTIONS
access-control-allow-origin: http://127.0.0.1:5000
access-control-max-age: 1000
content-length: 2784
content-type: application/json
date: Tue, 09 Jun 2020 05:38:14 GMT
server: Cowboy

[
    {
        "channel_id": "sora",
        "client_id": "KD9N57E2RN5T1BDEA7S7SH038M",
        "connection_id": "KD9N57E2RN5T1BDEA7S7SH038M",
        "dtls": {
            "total_received_dtls": 2,
            "total_sent_dtls": 2
        },
        "network_status": {
            "unstable_level": 0
        },
        "packet_loss_simulator": {
            "total_dropped_received_rtp": 0,
            "total_dropped_sent_rtp": 0
        },
        "rtp": {
            "total_generic_nack_cache_hit": 0,
            "total_generic_nack_cache_miss": 0,
            "total_pli_trigger": 0,
            "total_received": 5361,
            "total_received_byte_size": 4232942,
            "total_received_rtcp": 98,
            "total_received_rtcp_bye": 0,
            "total_received_rtcp_byte_size": 6572,
            "total_received_rtcp_psfb_afb": 0,
            "total_received_rtcp_psfb_fir": 0,
            "total_received_rtcp_psfb_pli": 0,
            "total_received_rtcp_rr": 6,
            "total_received_rtcp_rtpfb_generic_nack": 0,
            "total_received_rtcp_rtpfb_tmmbn": 0,
            "total_received_rtcp_rtpfb_tmmbr": 0,
            "total_received_rtcp_rtpfb_transport_wide": 0,
            "total_received_rtcp_sdes": 92,
            "total_received_rtcp_sr": 92,
            "total_received_rtcp_unknown": 0,
            "total_received_rtcp_xr": 0,
            "total_received_rtp": 5263,
            "total_received_rtp_byte_size": 4226370,
            "total_received_rtp_red": 0,
            "total_received_rtp_red_rtx": 0,
            "total_received_rtp_red_ulpfec": 0,
            "total_received_rtp_rtx": 3,
            "total_sent": 44,
            "total_sent_byte_size": 2936,
            "total_sent_rtcp": 44,
            "total_sent_rtcp_bye": 0,
            "total_sent_rtcp_byte_size": 2936,
            "total_sent_rtcp_psfb_afb": 38,
            "total_sent_rtcp_psfb_fir": 0,
            "total_sent_rtcp_psfb_pli": 0,
            "total_sent_rtcp_rr": 44,
            "total_sent_rtcp_rtpfb_generic_nack": 0,
            "total_sent_rtcp_rtpfb_tmmbn": 0,
            "total_sent_rtcp_rtpfb_tmmbr": 0,
            "total_sent_rtcp_rtpfb_transport_wide": 0,
            "total_sent_rtcp_sdes": 0,
            "total_sent_rtcp_sr": 0,
            "total_sent_rtcp_unknown": 0,
            "total_sent_rtcp_xr": 0,
            "total_sent_rtp": 0,
            "total_sent_rtp_byte_size": 0
        },
        "timestamp": "2020-06-09T05:38:15Z",
        "turn": {
            "total_received_allocate_request": 14,
            "total_received_binding_request": 0,
            "total_received_channel_bind_request": 1,
            "total_received_channel_data": 5392,
            "total_received_create_permission_request": 2,
            "total_received_expired_channel_number": 0,
            "total_received_refresh_request": 0,
            "total_received_send_indication": 8,
            "total_received_turn_binding_error": 0,
            "total_received_turn_binding_request": 18,
            "total_received_turn_binding_success": 16,
            "total_received_turn_invalid_stun": 0,
            "total_received_turn_unknown": 0,
            "total_received_turn_unknown_stun": 0,
            "total_received_unknown_channel_number": 0,
            "total_sent_allocate_error": 10,
            "total_sent_allocate_success": 2,
            "total_sent_binding_error": 0,
            "total_sent_binding_success": 0,
            "total_sent_channel_bind_error": 0,
            "total_sent_channel_bind_success": 1,
            "total_sent_channel_data": 75,
            "total_sent_create_permission_error": 0,
            "total_sent_create_permission_success": 2,
            "total_sent_data_indication": 5,
            "total_sent_refresh_error": 0,
            "total_sent_refresh_success": 0,
            "total_sent_turn_binding_error": 0,
            "total_sent_turn_binding_request": 16,
            "total_sent_turn_binding_success": 3,
            "total_sent_turn_unknown": 0
        }
    }
]

指定した接続の統計情報を取得する

サービス

Sora

バージョン

20170529

オペレーション

GetStatsConnection

x-sora-target

Sora_20170529.GetStatsConnection

キー

channel_id

string

connection_id

string

$ http POST 127.0.0.1:3000/ \
    x-sora-target:Sora_20170529.GetStatsConnection \
    channel_id=sora \
    connection_id=KD9N57E2RN5T1BDEA7S7SH038M -vvv

POST / HTTP/1.1
Accept: application/json, */*
Accept-Encoding: gzip, deflate
Connection: keep-alive
Content-Length: 69
Content-Type: application/json
Host: 127.0.0.1:3000
User-Agent: HTTPie/2.0.0
x-sora-target: Sora_20170529.GetStatsConnection

{
    "channel_id": "sora",
    "connection_id": "KD9N57E2RN5T1BDEA7S7SH038M"
}

HTTP/1.1 200 OK
access-control-allow-headers: Origin, X-Requested-With, Content-Type, Accept, x-sora-target
access-control-allow-methods: POST, OPTIONS
access-control-allow-origin: http://127.0.0.1:5000
access-control-max-age: 1000
content-length: 2800
content-type: application/json
date: Tue, 09 Jun 2020 05:39:52 GMT
server: Cowboy

{
    "channel_id": "sora",
    "client_id": "KD9N57E2RN5T1BDEA7S7SH038M",
    "connection_id": "KD9N57E2RN5T1BDEA7S7SH038M",
    "dtls": {
        "total_received_dtls": 2,
        "total_sent_dtls": 2
    },
    "network_status": {
        "unstable_level": 0
    },
    "packet_loss_simulator": {
        "total_dropped_received_rtp": 0,
        "total_dropped_sent_rtp": 0
    },
    "rtp": {
        "total_generic_nack_cache_hit": 0,
        "total_generic_nack_cache_miss": 0,
        "total_pli_trigger": 0,
        "total_received": 22383,
        "total_received_byte_size": 17661215,
        "total_received_rtcp": 418,
        "total_received_rtcp_bye": 0,
        "total_received_rtcp_byte_size": 28060,
        "total_received_rtcp_psfb_afb": 0,
        "total_received_rtcp_psfb_fir": 0,
        "total_received_rtcp_psfb_pli": 0,
        "total_received_rtcp_rr": 25,
        "total_received_rtcp_rtpfb_generic_nack": 0,
        "total_received_rtcp_rtpfb_tmmbn": 0,
        "total_received_rtcp_rtpfb_tmmbr": 0,
        "total_received_rtcp_rtpfb_transport_wide": 0,
        "total_received_rtcp_sdes": 393,
        "total_received_rtcp_sr": 393,
        "total_received_rtcp_unknown": 0,
        "total_received_rtcp_xr": 0,
        "total_received_rtp": 21965,
        "total_received_rtp_byte_size": 17633155,
        "total_received_rtp_red": 0,
        "total_received_rtp_red_rtx": 0,
        "total_received_rtp_red_ulpfec": 0,
        "total_received_rtp_rtx": 3,
        "total_sent": 185,
        "total_sent_byte_size": 12350,
        "total_sent_rtcp": 185,
        "total_sent_rtcp_bye": 0,
        "total_sent_rtcp_byte_size": 12350,
        "total_sent_rtcp_psfb_afb": 160,
        "total_sent_rtcp_psfb_fir": 0,
        "total_sent_rtcp_psfb_pli": 0,
        "total_sent_rtcp_rr": 185,
        "total_sent_rtcp_rtpfb_generic_nack": 0,
        "total_sent_rtcp_rtpfb_tmmbn": 0,
        "total_sent_rtcp_rtpfb_tmmbr": 0,
        "total_sent_rtcp_rtpfb_transport_wide": 0,
        "total_sent_rtcp_sdes": 0,
        "total_sent_rtcp_sr": 0,
        "total_sent_rtcp_unknown": 0,
        "total_sent_rtcp_xr": 0,
        "total_sent_rtp": 0,
        "total_sent_rtp_byte_size": 0
    },
    "timestamp": "2020-06-09T05:39:52Z",
    "turn": {
        "total_received_allocate_request": 15,
        "total_received_binding_request": 0,
        "total_received_channel_bind_request": 1,
        "total_received_channel_data": 22491,
        "total_received_create_permission_request": 2,
        "total_received_expired_channel_number": 0,
        "total_received_refresh_request": 2,
        "total_received_send_indication": 12,
        "total_received_turn_binding_error": 0,
        "total_received_turn_binding_request": 61,
        "total_received_turn_binding_success": 54,
        "total_received_turn_invalid_stun": 0,
        "total_received_turn_unknown": 0,
        "total_received_turn_unknown_stun": 0,
        "total_received_unknown_channel_number": 0,
        "total_sent_allocate_error": 11,
        "total_sent_allocate_success": 2,
        "total_sent_binding_error": 0,
        "total_sent_binding_success": 0,
        "total_sent_channel_bind_error": 0,
        "total_sent_channel_bind_success": 1,
        "total_sent_channel_data": 293,
        "total_sent_create_permission_error": 0,
        "total_sent_create_permission_success": 2,
        "total_sent_data_indication": 9,
        "total_sent_refresh_error": 0,
        "total_sent_refresh_success": 2,
        "total_sent_turn_binding_error": 0,
        "total_sent_turn_binding_request": 54,
        "total_sent_turn_binding_success": 7,
        "total_sent_turn_unknown": 0
    }
}

旧 API: 指定したクライアントの統計情報を取得する

重要

この API は後方互換性の維持のために残されています

警告

sora.conf にて allow_client_id_assignment を true にしていた場合はこの API は利用できません

サービス

Sora

バージョン

20170529

オペレーション

GetStats

x-sora-target

Sora_20170529.GetStats

キー

channel_id

string

client_id

string

$ http POST 127.0.0.1:3000/ \
    x-sora-target:Sora_20170529.GetStats \
    channel_id=sora \
    client_id=WZXPMM6K8113K83VB8G9XZDTFW -vvv

POST / HTTP/1.1
Accept: application/json, */*
Accept-Encoding: gzip, deflate
Connection: keep-alive
Content-Length: 65
Content-Type: application/json
Host: 127.0.0.1:3000
User-Agent: HTTPie/2.0.0
x-sora-target: Sora_20170529.GetStats

{
    "channel_id": "sora",
    "client_id": "WZXPMM6K8113K83VB8G9XZDTFW"
}

HTTP/1.1 200 OK
access-control-allow-headers: Origin, X-Requested-With, Content-Type, Accept, x-sora-target
access-control-allow-methods: POST, OPTIONS
access-control-allow-origin: http://127.0.0.1:5000
access-control-max-age: 1000
content-length: 2770
content-type: application/json
date: Tue, 09 Jun 2020 05:42:39 GMT
server: Cowboy

{
    "channel_id": "sora",
    "client_id": "WZXPMM6K8113K83VB8G9XZDTFW",
    "connection_id": "WZXPMM6K8113K83VB8G9XZDTFW",
    "dtls": {
        "total_received_dtls": 2,
        "total_sent_dtls": 2
    },
    "network_status": {
        "unstable_level": 0
    },
    "packet_loss_simulator": {
        "total_dropped_received_rtp": 0,
        "total_dropped_sent_rtp": 0
    },
    "rtp": {
        "total_generic_nack_cache_hit": 0,
        "total_generic_nack_cache_miss": 0,
        "total_pli_trigger": 0,
        "total_received": 1105,
        "total_received_byte_size": 845972,
        "total_received_rtcp": 20,
        "total_received_rtcp_bye": 0,
        "total_received_rtcp_byte_size": 1304,
        "total_received_rtcp_psfb_afb": 0,
        "total_received_rtcp_psfb_fir": 0,
        "total_received_rtcp_psfb_pli": 0,
        "total_received_rtcp_rr": 2,
        "total_received_rtcp_rtpfb_generic_nack": 0,
        "total_received_rtcp_rtpfb_tmmbn": 0,
        "total_received_rtcp_rtpfb_tmmbr": 0,
        "total_received_rtcp_rtpfb_transport_wide": 0,
        "total_received_rtcp_sdes": 18,
        "total_received_rtcp_sr": 18,
        "total_received_rtcp_unknown": 0,
        "total_received_rtcp_xr": 0,
        "total_received_rtp": 1085,
        "total_received_rtp_byte_size": 844668,
        "total_received_rtp_red": 0,
        "total_received_rtp_red_rtx": 0,
        "total_received_rtp_red_ulpfec": 0,
        "total_received_rtp_rtx": 0,
        "total_sent": 9,
        "total_sent_byte_size": 606,
        "total_sent_rtcp": 9,
        "total_sent_rtcp_bye": 0,
        "total_sent_rtcp_byte_size": 606,
        "total_sent_rtcp_psfb_afb": 8,
        "total_sent_rtcp_psfb_fir": 0,
        "total_sent_rtcp_psfb_pli": 0,
        "total_sent_rtcp_rr": 9,
        "total_sent_rtcp_rtpfb_generic_nack": 0,
        "total_sent_rtcp_rtpfb_tmmbn": 0,
        "total_sent_rtcp_rtpfb_tmmbr": 0,
        "total_sent_rtcp_rtpfb_transport_wide": 0,
        "total_sent_rtcp_sdes": 0,
        "total_sent_rtcp_sr": 0,
        "total_sent_rtcp_unknown": 0,
        "total_sent_rtcp_xr": 0,
        "total_sent_rtp": 0,
        "total_sent_rtp_byte_size": 0
    },
    "timestamp": "2020-06-09T05:42:40Z",
    "turn": {
        "total_received_allocate_request": 11,
        "total_received_binding_request": 0,
        "total_received_channel_bind_request": 1,
        "total_received_channel_data": 1113,
        "total_received_create_permission_request": 2,
        "total_received_expired_channel_number": 0,
        "total_received_refresh_request": 0,
        "total_received_send_indication": 7,
        "total_received_turn_binding_error": 0,
        "total_received_turn_binding_request": 7,
        "total_received_turn_binding_success": 6,
        "total_received_turn_invalid_stun": 0,
        "total_received_turn_unknown": 0,
        "total_received_turn_unknown_stun": 0,
        "total_received_unknown_channel_number": 0,
        "total_sent_allocate_error": 7,
        "total_sent_allocate_success": 2,
        "total_sent_binding_error": 0,
        "total_sent_binding_success": 0,
        "total_sent_channel_bind_error": 0,
        "total_sent_channel_bind_success": 1,
        "total_sent_channel_data": 19,
        "total_sent_create_permission_error": 0,
        "total_sent_create_permission_success": 2,
        "total_sent_data_indication": 5,
        "total_sent_refresh_error": 0,
        "total_sent_refresh_success": 0,
        "total_sent_turn_binding_error": 0,
        "total_sent_turn_binding_request": 6,
        "total_sent_turn_binding_success": 2,
        "total_sent_turn_unknown": 0
    }
}

すべての接続の統計情報を取得する

サービス

Sora

バージョン

20171101

オペレーション

GetStatsAllConnections

x-sora-target

Sora_20171101.GetStatsAllConnections

$ http POST 127.0.0.1:3000/ \
    x-sora-target:Sora_20171101.GetStatsAllConnections -vvv

POST / HTTP/1.1
Accept: */*
Accept-Encoding: gzip, deflate
Connection: keep-alive
Content-Length: 0
Host: 127.0.0.1:3000
User-Agent: HTTPie/2.0.0
x-sora-target: Sora_20171101.GetStatsAllConnections



HTTP/1.1 200 OK
access-control-allow-headers: Origin, X-Requested-With, Content-Type, Accept, x-sora-target
access-control-allow-methods: POST, OPTIONS
access-control-allow-origin: http://127.0.0.1:5000
access-control-max-age: 1000
content-length: 5592
content-type: application/json
date: Tue, 09 Jun 2020 05:43:53 GMT
server: Cowboy

[
    {
        "channel_id": "sora",
        "client_id": "WZXPMM6K8113K83VB8G9XZDTFW",
        "connection_id": "WZXPMM6K8113K83VB8G9XZDTFW",
        "dtls": {
            "total_received_dtls": 2,
            "total_sent_dtls": 2
        },
        "network_status": {
            "unstable_level": 0
        },
        "packet_loss_simulator": {
            "total_dropped_received_rtp": 0,
            "total_dropped_sent_rtp": 0
        },
        "rtp": {
            "total_generic_nack_cache_hit": 0,
            "total_generic_nack_cache_miss": 0,
            "total_pli_trigger": 0,
            "total_received": 13730,
            "total_received_byte_size": 10747862,
            "total_received_rtcp": 259,
            "total_received_rtcp_bye": 0,
            "total_received_rtcp_byte_size": 17338,
            "total_received_rtcp_psfb_afb": 8,
            "total_received_rtcp_psfb_fir": 0,
            "total_received_rtcp_psfb_pli": 0,
            "total_received_rtcp_rr": 24,
            "total_received_rtcp_rtpfb_generic_nack": 0,
            "total_received_rtcp_rtpfb_tmmbn": 0,
            "total_received_rtcp_rtpfb_tmmbr": 0,
            "total_received_rtcp_rtpfb_transport_wide": 0,
            "total_received_rtcp_sdes": 235,
            "total_received_rtcp_sr": 235,
            "total_received_rtcp_unknown": 0,
            "total_received_rtcp_xr": 0,
            "total_received_rtp": 13471,
            "total_received_rtp_byte_size": 10730524,
            "total_received_rtp_red": 0,
            "total_received_rtp_red_rtx": 0,
            "total_received_rtp_red_ulpfec": 0,
            "total_received_rtp_rtx": 0,
            "total_sent": 728,
            "total_sent_byte_size": 373228,
            "total_sent_rtcp": 124,
            "total_sent_rtcp_bye": 0,
            "total_sent_rtcp_byte_size": 8336,
            "total_sent_rtcp_psfb_afb": 100,
            "total_sent_rtcp_psfb_fir": 0,
            "total_sent_rtcp_psfb_pli": 1,
            "total_sent_rtcp_rr": 116,
            "total_sent_rtcp_rtpfb_generic_nack": 0,
            "total_sent_rtcp_rtpfb_tmmbn": 0,
            "total_sent_rtcp_rtpfb_tmmbr": 0,
            "total_sent_rtcp_rtpfb_transport_wide": 0,
            "total_sent_rtcp_sdes": 7,
            "total_sent_rtcp_sr": 7,
            "total_sent_rtcp_unknown": 0,
            "total_sent_rtcp_xr": 0,
            "total_sent_rtp": 604,
            "total_sent_rtp_byte_size": 364892
        },
        "timestamp": "2020-06-09T05:43:54Z",
        "turn": {
            "total_received_allocate_request": 15,
            "total_received_binding_request": 0,
            "total_received_channel_bind_request": 1,
            "total_received_channel_data": 13799,
            "total_received_create_permission_request": 2,
            "total_received_expired_channel_number": 0,
            "total_received_refresh_request": 2,
            "total_received_send_indication": 10,
            "total_received_turn_binding_error": 0,
            "total_received_turn_binding_request": 40,
            "total_received_turn_binding_success": 37,
            "total_received_turn_invalid_stun": 0,
            "total_received_turn_unknown": 0,
            "total_received_turn_unknown_stun": 0,
            "total_received_unknown_channel_number": 0,
            "total_sent_allocate_error": 11,
            "total_sent_allocate_success": 2,
            "total_sent_binding_error": 0,
            "total_sent_binding_success": 0,
            "total_sent_channel_bind_error": 0,
            "total_sent_channel_bind_success": 1,
            "total_sent_channel_data": 799,
            "total_sent_create_permission_error": 0,
            "total_sent_create_permission_success": 2,
            "total_sent_data_indication": 8,
            "total_sent_refresh_error": 0,
            "total_sent_refresh_success": 2,
            "total_sent_turn_binding_error": 0,
            "total_sent_turn_binding_request": 37,
            "total_sent_turn_binding_success": 5,
            "total_sent_turn_unknown": 0
        }
    },
    {
        "channel_id": "sora",
        "client_id": "3G6WGDG68H66QEYSKD5ZM3KRSR",
        "connection_id": "3G6WGDG68H66QEYSKD5ZM3KRSR",
        "dtls": {
            "total_received_dtls": 2,
            "total_sent_dtls": 2
        },
        "network_status": {
            "unstable_level": 0
        },
        "packet_loss_simulator": {
            "total_dropped_received_rtp": 0,
            "total_dropped_sent_rtp": 0
        },
        "rtp": {
            "total_generic_nack_cache_hit": 0,
            "total_generic_nack_cache_miss": 0,
            "total_pli_trigger": 0,
            "total_received": 621,
            "total_received_byte_size": 368336,
            "total_received_rtcp": 17,
            "total_received_rtcp_bye": 0,
            "total_received_rtcp_byte_size": 1022,
            "total_received_rtcp_psfb_afb": 1,
            "total_received_rtcp_psfb_fir": 0,
            "total_received_rtcp_psfb_pli": 0,
            "total_received_rtcp_rr": 7,
            "total_received_rtcp_rtpfb_generic_nack": 0,
            "total_received_rtcp_rtpfb_tmmbn": 0,
            "total_received_rtcp_rtpfb_tmmbr": 0,
            "total_received_rtcp_rtpfb_transport_wide": 0,
            "total_received_rtcp_sdes": 10,
            "total_received_rtcp_sr": 10,
            "total_received_rtcp_unknown": 0,
            "total_received_rtcp_xr": 0,
            "total_received_rtp": 604,
            "total_received_rtp_byte_size": 367314,
            "total_received_rtp_red": 0,
            "total_received_rtp_red_rtx": 0,
            "total_received_rtp_red_ulpfec": 0,
            "total_received_rtp_rtx": 3,
            "total_sent": 624,
            "total_sent_byte_size": 372536,
            "total_sent_rtcp": 14,
            "total_sent_rtcp_bye": 0,
            "total_sent_rtcp_byte_size": 1040,
            "total_sent_rtcp_psfb_afb": 6,
            "total_sent_rtcp_psfb_fir": 0,
            "total_sent_rtcp_psfb_pli": 0,
            "total_sent_rtcp_rr": 7,
            "total_sent_rtcp_rtpfb_generic_nack": 0,
            "total_sent_rtcp_rtpfb_tmmbn": 0,
            "total_sent_rtcp_rtpfb_tmmbr": 0,
            "total_sent_rtcp_rtpfb_transport_wide": 0,
            "total_sent_rtcp_sdes": 7,
            "total_sent_rtcp_sr": 7,
            "total_sent_rtcp_unknown": 0,
            "total_sent_rtcp_xr": 0,
            "total_sent_rtp": 610,
            "total_sent_rtp_byte_size": 371496
        },
        "timestamp": "2020-06-09T05:43:54Z",
        "turn": {
            "total_received_allocate_request": 11,
            "total_received_binding_request": 0,
            "total_received_channel_bind_request": 1,
            "total_received_channel_data": 629,
            "total_received_create_permission_request": 2,
            "total_received_expired_channel_number": 0,
            "total_received_refresh_request": 0,
            "total_received_send_indication": 7,
            "total_received_turn_binding_error": 0,
            "total_received_turn_binding_request": 7,
            "total_received_turn_binding_success": 6,
            "total_received_turn_invalid_stun": 0,
            "total_received_turn_unknown": 0,
            "total_received_turn_unknown_stun": 0,
            "total_received_unknown_channel_number": 0,
            "total_sent_allocate_error": 7,
            "total_sent_allocate_success": 2,
            "total_sent_binding_error": 0,
            "total_sent_binding_success": 0,
            "total_sent_channel_bind_error": 0,
            "total_sent_channel_bind_success": 1,
            "total_sent_channel_data": 634,
            "total_sent_create_permission_error": 0,
            "total_sent_create_permission_success": 2,
            "total_sent_data_indication": 5,
            "total_sent_refresh_error": 0,
            "total_sent_refresh_success": 0,
            "total_sent_turn_binding_error": 0,
            "total_sent_turn_binding_request": 6,
            "total_sent_turn_binding_success": 2,
            "total_sent_turn_unknown": 0
        }
    }
]

統計情報を取得する

警告

この API は実験的機能のため正式版では仕様が変更される可能性があります

サービス

Sora

バージョン

20171010

オペレーション

GetStatsReport

x-sora-target

Sora_20171010.GetStatsReport

Sora の起動している間の統計情報を取得することができます。この統計情報は Sora を止めたり再起動したりすることでクリアされますので注意してください。

レスポンス項目

  • total_connection_created

    • 現在までの接続が作成された数

  • total_connection_updated

    • 現在までの接続が更新された数

  • total_connection_destroyed

    • 現在までの接続が破棄された数

  • total_successful_connections

    • 現在までの接続が成功した数

  • total_ongoing_connections

    • 現在接続している数

  • total_failed_connections

    • 現在までの接続が失敗した数

  • total_duration_sec

    • 現在までの合計接続時間 (秒)

  • total_turn_udp_connections

    • 現在までの TURN-UDP での接続数

  • total_turn_tcp_connections

    • 現在までの TURN-TCP または TURN-TLS での接続数

  • average_duration_sec

    • 平均接続時間 (秒)

  • average_setup_time_msec

    • 平均セットアップ時間 (ミリ秒)

$ http POST 127.0.0.1:3000/ \
    x-sora-target:Sora_20171010.GetStatsReport \
    -vvv

POST / HTTP/1.1
Accept: */*
Accept-Encoding: gzip, deflate
Connection: keep-alive
Content-Length: 0
Host: 127.0.0.1:3000
User-Agent: HTTPie/0.9.9
x-sora-target: Sora_20171010.GetStatsReport



HTTP/1.1 200 OK
access-control-allow-headers: Origin, X-Requested-With, Content-Type, Accept, x-sora-target
access-control-allow-methods: POST, OPTIONS
access-control-allow-origin: http://127.0.0.1:5000
access-control-max-age: 1000
content-length: 172
content-type: application/json
date: Tue, 10 Oct 2017 10:23:22 GMT
server: Cowboy

{
    "average_duration_sec": 24,
    "average_setup_time_msec": 77,
    "total_duration_sec": 48,
    "total_failed_connections": 0,
    "total_ongoing_connections": 1,
    "total_successful_connections": 3,
    "total_turn_udp_connections": 2,
    "total_turn_tcp_connections": 1
}

ライセンス API

現在利用しているライセンス情報を取得する

サービス

Sora

バージョン

20171218

オペレーション

GetLicense

x-sora-target

Sora_20171218.GetLicense

$ http POST 127.0.0.1:3000/
    x-sora-target:Sora_20171218.GetLicense -vvv
POST / HTTP/1.1
Accept: */*
Accept-Encoding: gzip, deflate
Connection: keep-alive
Content-Length: 0
Host: 127.0.0.1:3000
User-Agent: HTTPie/0.9.9
x-sora-target: Sora_20171218.GetLicense



HTTP/1.1 200 OK
access-control-allow-headers: Origin, X-Requested-With, Content-Type, Accept, x-sora-target
access-control-allow-methods: POST, OPTIONS
access-control-allow-origin: http://127.0.0.1:5000
access-control-max-age: 1000
content-length: 174
content-type: application/json
date: Fri, 05 Jan 2018 06:41:35 GMT
server: Cowboy

{
    "max_connections": 100,
    "product_name": "Sora",
    "serial_code": "123ABC-SRA-E001-20180101-100",
    "type": "Experimental"
}

ライセンスを更新する

サービス

Sora

バージョン

20171218

オペレーション

UpdateLicense

x-sora-target

Sora_20171218.UpdateLicense

sora.conflicense_file に設定したファイルを新規のライセンスとして読み込みます。 ライセンスが壊れていたり、見つからない場合はエラーになります

$ http POST 127.0.0.1:3000/ x-sora-target:Sora_20171218.UpdateLicense -vvv

POST / HTTP/1.1
Accept: */*
Accept-Encoding: gzip, deflate
Connection: keep-alive
Content-Length: 0
Host: 127.0.0.1:3000
User-Agent: HTTPie/0.9.9
x-sora-target: Sora_20171218.UpdateLicense



HTTP/1.1 200 OK
access-control-allow-headers: Origin, X-Requested-With, Content-Type, Accept, x-sora-target
access-control-allow-methods: POST, OPTIONS
access-control-allow-origin: http://127.0.0.1:5000
access-control-max-age: 1000
content-length: 379
content-type: application/json
date: Fri, 05 Jan 2018 06:44:47 GMT
server: Cowboy

{
    "new_license": {
        "max_connections": 100,
        "product_name": "Sora",
        "serial_code": "123ABC-SRA-E001-20180101-100",
        "type": "Experimental"
    },
    "old_license": {
        "max_connections": 100,
        "product_name": "Sora",
        "serial_code": "123ABC-SRA-E002-20190101-100",
        "type": "Experimental"
    }
}

スポットライト API

警告

スポットライト機能は実験的機能のため正式版では仕様が変更される可能性があります

指定した参加者にスポットライトをフォーカスし続ける

サービス

Sora

バージョン

20200807

オペレーション

FocusSpotlightFixed

x-sora-target

Sora_20200807.FocusSpotlightFixed

指定した Connection ID のクライアントが常にフォーカスが当たるようにします。 これは UnfocusSpotlight API が呼ばれるまで当たり続けます。

キー

channel_id

string

connection_id

string

http POST 127.0.0.1:3000/ x-sora-target:Sora_20200807.FocusSpotlightFixed \
    channel_id=sora connection_id=7QSNT842FS0J9E6BZDBC2DRYY8 -vvv
POST / HTTP/1.1
Accept: application/json, */*
Accept-Encoding: gzip, deflate
Connection: keep-alive
Content-Length: 69
Content-Type: application/json
Host: 127.0.0.1:3000
User-Agent: HTTPie/2.0.0
x-sora-target: Sora_20200807.FocusSpotlightFixed

{
    "channel_id": "sora",
    "connection_id": "7QSNT842FS0J9E6BZDBC2DRYY8"
}

HTTP/1.1 200 OK
access-control-allow-headers: Origin, X-Requested-With, Content-Type, Accept, x-sora-target
access-control-allow-methods: POST, OPTIONS
access-control-allow-origin: http://127.0.0.1:5000
access-control-max-age: 1000
content-length: 66
content-type: application/json
date: Wed, 09 Sep 2020 08:27:57 GMT
server: Cowboy

{
    "channel_id": "sora",
    "connection_id": "7QSNT842FS0J9E6BZDBC2DRYY8"
}

指定した参加者にスポットライトをフォーカスする

サービス

Sora

バージョン

20200807

オペレーション

FocusSpotlight

x-sora-target

Sora_20200807.FocusSpotlight

指定した Connection ID のクライアントを強制的にフォーカスが当たった状態にします。

キー

channel_id

string

connection_id

string

http POST 127.0.0.1:3000/ x-sora-target:Sora_20200807.FocusSpotlight \
    channel_id=sora connection_id=74Z2G1JS7S67DE226T8R1H3YGW -vvv
POST / HTTP/1.1
Accept: application/json, */*
Accept-Encoding: gzip, deflate
Connection: keep-alive
Content-Length: 69
Content-Type: application/json
Host: 127.0.0.1:3000
User-Agent: HTTPie/2.0.0
x-sora-target: Sora_20200807.FocusSpotlight

{
    "channel_id": "sora",
    "connection_id": "74Z2G1JS7S67DE226T8R1H3YGW"
}

HTTP/1.1 200 OK
access-control-allow-headers: Origin, X-Requested-With, Content-Type, Accept, x-sora-target
access-control-allow-methods: POST, OPTIONS
access-control-allow-origin: http://127.0.0.1:5000
access-control-max-age: 1000
content-length: 66
content-type: application/json
date: Wed, 09 Sep 2020 08:33:54 GMT
server: Cowboy

{
    "channel_id": "sora",
    "connection_id": "74Z2G1JS7S67DE226T8R1H3YGW"
}

指定した参加者からスポットライトのフォーカスを外す

サービス

Sora

バージョン

20200807

オペレーション

UnfocusSpotlight

x-sora-target

Sora_20200807.UnfocusSpotlight

指定した Connection ID のフォーカスを外します。

この API は FocusSpotlightFixed でフォーカスを当て続けてているのを解除する場合にも利用します。

キー

channel_id

string

connection_id

string

http POST 127.0.0.1:3000/ x-sora-target:Sora_20200807.UnfocusSpotlight \
    channel_id=sora connection_id=74Z2G1JS7S67DE226T8R1H3YGW -vvv
POST / HTTP/1.1
Accept: application/json, */*
Accept-Encoding: gzip, deflate
Connection: keep-alive
Content-Length: 69
Content-Type: application/json
Host: 127.0.0.1:3000
User-Agent: HTTPie/2.0.0
x-sora-target: Sora_20200807.UnfocusSpotlight

{
    "channel_id": "sora",
    "connection_id": "74Z2G1JS7S67DE226T8R1H3YGW"
}

HTTP/1.1 200 OK
access-control-allow-headers: Origin, X-Requested-With, Content-Type, Accept, x-sora-target
access-control-allow-methods: POST, OPTIONS
access-control-allow-origin: http://127.0.0.1:5000
access-control-max-age: 1000
content-length: 66
content-type: application/json
date: Wed, 09 Sep 2020 08:34:56 GMT
server: Cowboy

{
    "channel_id": "sora",
    "connection_id": "74Z2G1JS7S67DE226T8R1H3YGW"
}

スポットライトのフォーカス数を変更する

サービス

Sora

バージョン

20200807

オペレーション

ChangeSpotlightNumber

x-sora-target

Sora_20200807.ChangeSpotlightNumber

フォーカスする最大数を変更します。最小は 1 で最大は 8 です

フォーカス変更後に参加する場合で spotlight_number を指定する場合は 変更後の値 を指定する必要があります。

キー

channel_id

string

spotlight_number

integer (1 ~ 8)

http POST 127.0.0.1:3000/ x-sora-target:Sora_20200807.ChangeSpotlightNumber \
    channel_id=sora spotlight_number:=1 -vvv
POST / HTTP/1.1
Accept: application/json, */*
Accept-Encoding: gzip, deflate
Connection: keep-alive
Content-Length: 45
Content-Type: application/json
Host: 127.0.0.1:3000
User-Agent: HTTPie/2.0.0
x-sora-target: Sora_20200807.ChangeSpotlightNumber

{
    "channel_id": "sora",
    "spotlight_number": 1
}

HTTP/1.1 200 OK
access-control-allow-headers: Origin, X-Requested-With, Content-Type, Accept, x-sora-target
access-control-allow-methods: POST, OPTIONS
access-control-allow-origin: http://127.0.0.1:5000
access-control-max-age: 1000
content-length: 42
content-type: application/json
date: Wed, 09 Sep 2020 08:35:36 GMT
server: Cowboy

{
    "channel_id": "sora",
    "spotlight_number": 1
}

指定した参加者の受信している映像ストリームのクオリティを変更する

サービス

Sora

バージョン

20200807

オペレーション

RequestSpotlightQuality

x-sora-target

Sora_20200807.RequestSpotlightQuality

スポットライトのフォーカスとは別に、画質を受信ストリームすべて、またはストリームごと変更可能です。 現時点では low か middle のみ指定可能です。

キー

channel_id

string

connection_id

string

stream_id (オプション)

string

quality

string (low / middle / high)

http POST 127.0.0.1:3000/ x-sora-target:Sora_20200807.RequestSpotlightQuality =
    channel_id=sora connection_id=DRPBMP6FEH49S5CSB04EDSTQ38 quality=low -vvv
POST / HTTP/1.1
Accept: application/json, */*
Accept-Encoding: gzip, deflate
Connection: keep-alive
Content-Length: 87
Content-Type: application/json
Host: 127.0.0.1:3000
User-Agent: HTTPie/2.0.0
x-sora-target: Sora_20200807.RequestSpotlightQuality

{
    "channel_id": "sora",
    "connection_id": "DRPBMP6FEH49S5CSB04EDSTQ38",
    "quality": "low"
}

HTTP/1.1 200 OK
access-control-allow-headers: Origin, X-Requested-With, Content-Type, Accept, x-sora-target
access-control-allow-methods: POST, OPTIONS
access-control-allow-origin: http://127.0.0.1:5000
access-control-max-age: 1000
content-length: 82
content-type: application/json
date: Wed, 09 Sep 2020 08:47:49 GMT
server: Cowboy

{
    "channel_id": "sora",
    "connection_id": "DRPBMP6FEH49S5CSB04EDSTQ38",
    "quality": "low"
}

指定した参加者の受信している映像ストリームのクオリティをリセットする

サービス

Sora

バージョン

20200807

オペレーション

ResetSpotlightQuality

x-sora-target

Sora_20200807.ResetSpotlightQuality

RequestSpotlightQuality で変更された画質をリセットします。

キー

channel_id

string

connection_id

string

stream_id (オプション)

string

http POST 127.0.0.1:3000/ x-sora-target:Sora_20200807.ResetSpotlightQuality \
    channel_id=sora connection_id=DRPBMP6FEH49S5CSB04EDSTQ38 -vvv
POST / HTTP/1.1
Accept: application/json, */*
Accept-Encoding: gzip, deflate
Connection: keep-alive
Content-Length: 69
Content-Type: application/json
Host: 127.0.0.1:3000
User-Agent: HTTPie/2.0.0
x-sora-target: Sora_20200807.ResetSpotlightQuality

{
    "channel_id": "sora",
    "connection_id": "DRPBMP6FEH49S5CSB04EDSTQ38"
}

HTTP/1.1 200 OK
access-control-allow-headers: Origin, X-Requested-With, Content-Type, Accept, x-sora-target
access-control-allow-methods: POST, OPTIONS
access-control-allow-origin: http://127.0.0.1:5000
access-control-max-age: 1000
content-length: 66
content-type: application/json
date: Wed, 09 Sep 2020 08:48:35 GMT
server: Cowboy

{
    "channel_id": "sora",
    "connection_id": "DRPBMP6FEH49S5CSB04EDSTQ38"
}

スポットライトレガシー API

警告

スポットライトレガシー機能は今後廃止予定です

指定した参加者を強制的に画面に表示する

サービス

Sora

バージョン

20180404

オペレーション

CastSpotlight

x-sora-target

Sora_20180404.CastSpotlight

キー

channel_id

string

connection_id

string

$ http POST 127.0.0.1:3000/ x-sora-target:Sora_20180404.CastSpotlight \
                            channel_id=sora \
                            connection_id=KD9N57E2RN5T1BDEA7S7SH038M \
                            -vvv
POST / HTTP/1.1
Accept: application/json, */*
Accept-Encoding: gzip, deflate
Connection: keep-alive
Content-Length: 75
Content-Type: application/json
Host: 127.0.0.1:3000
User-Agent: HTTPie/0.9.9
x-sora-target: Sora_20180404.CastSpotlight

{
    "channel_id": "sora",
    "connection_id": "KD9N57E2RN5T1BDEA7S7SH038M"
}

HTTP/1.1 200 OK
access-control-allow-headers: Origin, X-Requested-With, Content-Type, Accept, x-sora-target
access-control-allow-methods: POST, OPTIONS
access-control-allow-origin: http://127.0.0.1:5000
access-control-max-age: 1000
content-length: 72
content-type: application/json
date: Fri, 27 Apr 2018 02:01:35 GMT
server: Cowboy

{
    "channel_id": "sora",
    "connection_id": "KD9N57E2RN5T1BDEA7S7SH038M"
}

指定した参加者を常に画面に表示する

サービス

Sora

バージョン

20180404

オペレーション

CastAlwaysSpotlight

x-sora-target

Sora_20180404.CastAlwaysSpotlight

キー

channel_id

string

connection_id

string

spotlight_id (オプション)

string

spotlight_id を指定しない場合はどこかのスポットライトに入ります。

$ http POST 127.0.0.1:3000/ x-sora-target:Sora_20180404.CastAlwaysSpotlight \
                            channel_id=sora \
                            connection_id=KD9N57E2RN5T1BDEA7S7SH038M \
                            spotlight_id=spotlight-1 \
                            -vvv
POST / HTTP/1.1
Accept: application/json, */*
Accept-Encoding: gzip, deflate
Connection: keep-alive
Content-Length: 106
Content-Type: application/json
Host: 127.0.0.1:3000
User-Agent: HTTPie/0.9.9
x-sora-target: Sora_20180404.CastAlwaysSpotlight

{
    "channel_id": "sora",
    "connection_id": "af9103b1-2412-4a3c-88b2-cc4d84114d98",
    "spotlight_id": "spotlight-1"
}

HTTP/1.1 200 OK
access-control-allow-headers: Origin, X-Requested-With, Content-Type, Accept, x-sora-target
access-control-allow-methods: POST, OPTIONS
access-control-allow-origin: http://127.0.0.1:5000
access-control-max-age: 1000
content-length: 101
content-type: application/json
date: Wed, 25 Apr 2018 07:11:30 GMT
server: Cowboy

{
    "channel_id": "sora",
    "connection_id": "KD9N57E2RN5T1BDEA7S7SH038M",
    "spotlight_id": "spotlight-1"
}

指定した参加者を常に画面に表示する状態を解除する

サービス

Sora

バージョン

20180404

オペレーション

CancelSpotlight

x-sora-target

Sora_20180404.CancelSpotlight

キー

channel_id

string

connection_id

string

$ http POST 127.0.0.1:3000/ x-sora-target:Sora_20180404.CancelSpotlight \
                            channel_id=sora \
                            connection_id=KD9N57E2RN5T1BDEA7S7SH038M \
                            -vvv
POST / HTTP/1.1
Accept: application/json, */*
Accept-Encoding: gzip, deflate
Connection: keep-alive
Content-Length: 75
Content-Type: application/json
Host: 127.0.0.1:3000
User-Agent: HTTPie/0.9.9
x-sora-target: Sora_20180404.CancelSpotlight

{
    "channel_id": "sora",
    "connection_id": "KD9N57E2RN5T1BDEA7S7SH038M"
}

HTTP/1.1 200 OK
access-control-allow-headers: Origin, X-Requested-With, Content-Type, Accept, x-sora-target
access-control-allow-methods: POST, OPTIONS
access-control-allow-origin: http://127.0.0.1:5000
access-control-max-age: 1000
content-length: 72
content-type: application/json
date: Wed, 25 Apr 2018 07:12:01 GMT
server: Cowboy

{
    "channel_id": "sora",
    "connection_id": "KD9N57E2RN5T1BDEA7S7SH038M"
}

指定したスポットライトチャネルのビットレートを下げる

サービス

Sora

バージョン

20181023

オペレーション

DowngradeSpotlightBitRate

x-sora-target

Sora_20181023.DowngradeSpotlightBitRate

キー

channel_id

string

現時点ではどの程度下げるかどうかは指定することはできません。

$ http POST 127.0.0.1:3000/ \
    x-sora-target:Sora_20181023.DowngradeSpotlightBitRate \
    channel_id=sora \
    -vvv

指定したスポットライトチャネルのビットレートを戻す

サービス

Sora

バージョン

20181023

オペレーション

ResetSpotlightBitRate

x-sora-target

Sora_20181023.ResetSpotlightBitRate

キー

channel_id

string

$ http POST 127.0.0.1:3000/ \
    x-sora-target:Sora_20181023.ResetSpotlightBitRate \
    channel_id=sora \
    -vvv

サイマルキャスト API

警告

サイマルキャスト機能は実験的機能のため正式版では仕様が変更される可能性があります

指定した参加者の視聴する映像の画質を変更する

サービス

Sora

バージョン

20180820

オペレーション

ChangeSimulcastQuality

x-sora-target

Sora_20180820.ChangeSimulcastQuality

キー

channel_id

string

connection_id

string

stream_id (オプション)

string

quality

string (high | middle | low)

$ http POST 127.0.0.1:3000/ \
    x-sora-target:Sora_20180820.ChangeSimulcastQuality \
    channel_id=sora \
    connection_id=KD9N57E2RN5T1BDEA7S7SH038M \
    quality=high \
    -vvv
POST / HTTP/1.1
Accept: application/json, */*
Accept-Encoding: gzip, deflate
Connection: keep-alive
Content-Length: 98
Content-Type: application/json
Host: 127.0.0.1:3000
User-Agent: HTTPie/1.0.2
x-sora-target: Sora_20180820.ChangeSimulcastQuality

{
    "channel_id": "sora",
    "connection_id": "KD9N57E2RN5T1BDEA7S7SH038M",
    "quality": "high"
}

HTTP/1.1 200 OK
access-control-allow-headers: Origin, X-Requested-With, Content-Type, Accept, x-sora-target
access-control-allow-methods: POST, OPTIONS
access-control-allow-origin: http://127.0.0.1:5000
access-control-max-age: 1000
content-length: 93
content-type: application/json
date: Thu, 04 Apr 2019 05:36:44 GMT
server: Cowboy

{
    "channel_id": "sora",
    "connection_id": "KD9N57E2RN5T1BDEA7S7SH038M",
    "quality": "high"
}

RTP ストリーム停止/再開 API

警告

この API は実験的機能のため正式版では仕様が変更される可能性があります

指定した接続からのストリームを停止する

現時点では映像のみを停止します

サービス

Sora

バージョン

20200401

オペレーション

PauseRtpStream

x-sora-target

Sora_20200401.PauseRtpStream

この API はマルチストリームでのみ利用可能です。スポットライトには対応しておりません。

キー

channel_id

string

connection_id

string

stream_id

string

  • connection_id

    • RTP ストリームの受信を停止を実行する接続の connection_id を指定します

  • stream_id

    • 受信を停止する RTP ストリームを配信している接続の connection_id を指定します

映像自体は Sora までは届いていますが、実際の配信が一時停止されるという仕組みになっています。

$ http POST 127.0.0.1:3000/ x-sora-target:Sora_20200401.PauseRtpStream \
      channel_id=sora \
      connection_id=3X0W1C23KS1TQAAYMKA9TXJS4G \
      stream_id=VTGYC92AZX6M72K860BPREFTMC \
      -vvv
POST / HTTP/1.1
Accept: application/json, */*
Accept-Encoding: gzip, deflate
Connection: keep-alive
Content-Length: 96
Content-Type: application/json
Host: 127.0.0.1:3000
User-Agent: HTTPie/2.0.0
x-sora-target: Sora_20200401.PauseRtpStream

{
    "channel_id": "sora",
    "connection_id": "VTGYC92AZX6M72K860BPREFTMC",
    "stream_id": "3X0W1C23KS1TQAAYMKA9TXJS4G"
}

HTTP/1.1 200 OK
access-control-allow-headers: Origin, X-Requested-With, Content-Type, Accept, x-sora-target
access-control-allow-methods: POST, OPTIONS
access-control-allow-origin: http://127.0.0.1:5000
access-control-max-age: 1000
content-length: 91
content-type: application/json
date: Thu, 16 Apr 2020 02:06:39 GMT
server: Cowboy

{
    "channel_id": "sora",
    "stream_id": "VTGYC92AZX6M72K860BPREFTMC",
    "connection_id": "3X0W1C23KS1TQAAYMKA9TXJS4G"
}

指定した接続からのストリームを再開する

サービス

Sora

バージョン

20200401

オペレーション

ResumeRtpStream

x-sora-target

Sora_20200401.ResumeRtpStream

この API はマルチストリームでのみ利用可能です。スポットライトには対応しておりません。

キー

channel_id

string

connection_id

string

stream_id

string

  • connection_id

    • RTP ストリームの受信を停止を実行する接続の connection_id を指定します

  • stream_id

    • 受信を停止する RTP ストリームを配信している接続の connection_id を指定します

映像自体は Sora までは届いていますが、実際の配信が一時停止されるという仕組みになっています。

$ http POST 127.0.0.1:3000/ x-sora-target:Sora_20200401.ResumeRtpStream \
      channel_id=sora \
      connection_id=3X0W1C23KS1TQAAYMKA9TXJS4G \
      stream_id=VTGYC92AZX6M72K860BPREFTMC \
      -vvv
POST / HTTP/1.1
Accept: application/json, */*
Accept-Encoding: gzip, deflate
Connection: keep-alive
Content-Length: 96
Content-Type: application/json
Host: 127.0.0.1:3000
User-Agent: HTTPie/2.0.0
x-sora-target: Sora_20200401.ResumeRtpStream

{
    "channel_id": "sora",
    "stream_id": "VTGYC92AZX6M72K860BPREFTMC",
    "connection_id": "3X0W1C23KS1TQAAYMKA9TXJS4G"
}

HTTP/1.1 200 OK
access-control-allow-headers: Origin, X-Requested-With, Content-Type, Accept, x-sora-target
access-control-allow-methods: POST, OPTIONS
access-control-allow-origin: http://127.0.0.1:5000
access-control-max-age: 1000
content-length: 91
content-type: application/json
date: Thu, 16 Apr 2020 02:07:27 GMT
server: Cowboy

{
    "channel_id": "sora",
    "stream_id": "VTGYC92AZX6M72K860BPREFTMC",
    "connection_id": "3X0W1C23KS1TQAAYMKA9TXJS4G"
}

指定したチャネルの停止しているストリーム一覧を返します

サービス

Sora

バージョン

20200401

オペレーション

ListPauseRtpStreams

x-sora-target

Sora_20200401.ListPauseRtpStreams

キー

channel_id

string

$ http POST 127.0.0.1:3000/ x-sora-target:Sora_20200401.ListPauseRtpStreams \
    channel_id=sora \
    -vvv
POST / HTTP/1.1
Accept: application/json, */*
Accept-Encoding: gzip, deflate
Connection: keep-alive
Content-Length: 22
Content-Type: application/json
Host: 127.0.0.1:3000
User-Agent: HTTPie/2.0.0
x-sora-target: Sora_20200401.ListPauseRtpStreams

{
    "channel_id": "sora"
}

HTTP/1.1 200 OK
access-control-allow-headers: Origin, X-Requested-With, Content-Type, Accept, x-sora-target
access-control-allow-methods: POST, OPTIONS
access-control-allow-origin: http://127.0.0.1:5000
access-control-max-age: 1000
content-length: 111
content-type: application/json
date: Thu, 09 Apr 2020 07:10:18 GMT
server: Cowboy

[
    {
        "channel_id": "sora",
        "stream_id": "Y46ZJMZSS5341CG25CDG3KM678",
        "role": "sendrecv",
        "connection_id": "AVPE53PCHD17XAW8YR71NZYHM0"
    }
]

リモート統計情報 API

警告

この API は実験的機能のため正式版では仕様が変更される可能性があります

全てのリモート統計情報を取得する

サービス

Sora

バージョン

20200225

オペレーション

GetAllRemoteStats

x-sora-target

Sora_20200225.GetAllRemoteStats

$ http POST 127.0.0.1:3000/ x-sora-target:Sora_20200225.GetAllRemoteStats -vvv
OST / HTTP/1.1
Accept: */*
Accept-Encoding: gzip, deflate
Connection: keep-alive
Content-Length: 0
Host: 127.0.0.1:3000
User-Agent: HTTPie/2.0.0
x-sora-target: Sora_20200225.GetAllRemoteStats



HTTP/1.1 200 OK
access-control-allow-headers: Origin, X-Requested-With, Content-Type, Accept, x-sora-target
access-control-allow-methods: POST, OPTIONS
access-control-allow-origin: http://127.0.0.1:5000
access-control-max-age: 1000
content-length: 9444
content-type: application/json
date: Thu, 09 Apr 2020 07:31:33 GMT
server: Cowboy

[
    {
        "channel_id": "sora",
        "connection_id": "HMRVPQEXJX03D3B3WE778SJGRC",
        "remote_stats": [
            {
                "audioLevel": 0,
                "id": "RTCAudioSource_1",
                "kind": "audio",
                "timestamp": 1586417492054.487,
                "totalAudioEnergy": 0,
                "totalSamplesDuration": 24.930000000001098,
                "trackIdentifier": "8de161d9-c93f-4c8a-ab0e-c4cb1ed45543",
                "type": "media-source"
            },
            {
                "base64Certificate": "MIIBFjCBvaADAgECAgkAvREZhM8QonowCgYIKoZIzj0EAwIwETEPMA0GA1UEAwwGV2ViUlRDMB4XDTIwMDQwODA3MzEwN1oXDTIwMDUwOTA3MzEwN1owETEPMA0GA1UEAwwGV2ViUlRDMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEObaQG5SUlwAfRydt90MtcSWPEqcD2bFOaeiS7kRuhK6Y3pdi2Y51OY9g03CJlfLRs/QO7FKSq0JmzZVNK1/fAjAKBggqhkjOPQQDAgNIADBFAiB24aTZEz60OXYKdaCjGRpaq23ssPBaWcUIg5gl6QyFqAIhAJrL8uVs6lJB8kuzY+8JF2eqHbw6GS36DEX8Iz2teQdP",
                "fingerprint": "1B:FD:64:BF:B3:9F:14:1D:B4:78:A7:DD:F6:62:8D:9E:D7:48:C8:56:D6:1B:6D:04:4D:CA:5D:DB:6A:B3:89:C3",
                "fingerprintAlgorithm": "sha-256",
                "id": "RTCCertificate_1B:FD:64:BF:B3:9F:14:1D:B4:78:A7:DD:F6:62:8D:9E:D7:48:C8:56:D6:1B:6D:04:4D:CA:5D:DB:6A:B3:89:C3",
                "timestamp": 1586417492054.487,
                "type": "certificate"
            },
            {
                "base64Certificate": "MIICHjCCAbugAwIBAgIGANT1xzg7MBQGCCqGSM49BAMCBggqhkjOPQMBBzBiMSAwHgYJKoZIhvcNAQkBFhFzb3JhQHNoaWd1cmVkby5qcDEYMBYGA1UEAwwPV2ViUlRDIFNGVSBTb3JhMQswCQYDVQQGEwJKUDEXMBUGA1UECgwOU2hpZ3VyZWRvIGluYy4wHhcNMjAwNDA4MjM1OTU5WhcNMjAwNDE2MjM1OTU5WjBiMSAwHgYJKoZIhvcNAQkBFhFzb3JhQHNoaWd1cmVkby5qcDEYMBYGA1UEAwwPV2ViUlRDIFNGVSBTb3JhMQswCQYDVQQGEwJKUDEXMBUGA1UECgwOU2hpZ3VyZWRvIGluYy4wWTATBgcqhkjOPQIBBggqhkjOPQMBBwNCAAR7ZWYKDfuQtwRhv1Nq9dKU6WJFc1h+3r3nU8yGqcWfK86CdDAGELs+l0g7BcDepxqAOPIaKHIqzpexB/CtNvnTo1MwUTAfBgNVHSMEGDAWgBSiuSarsmBIo/SqAa1/KISQW6Mn5TAdBgNVHQ4EFgQUorkmq7JgSKP0qgGtfyiEkFujJ+UwDwYDVR0TAQH/BAUwAwEB/zAUBggqhkjOPQQDAgYIKoZIzj0DAQcDRwAwRAIgDMUIcnpvrOoX3ThAOr289DJXGHiHKobhLQUZBhRd+YYCIBQp4hrXSkgXiyELOf2+kaaLNuwqQlKO6A6AWj90as54",
                "fingerprint": "FA:66:5F:F0:4B:10:F3:3C:71:26:A2:33:FF:C1:1B:D0:9E:C5:71:11:68:F3:41:82:84:11:8F:5D:D6:54:86:AE",
                "fingerprintAlgorithm": "sha-256",
                "id": "RTCCertificate_FA:66:5F:F0:4B:10:F3:3C:71:26:A2:33:FF:C1:1B:D0:9E:C5:71:11:68:F3:41:82:84:11:8F:5D:D6:54:86:AE",
                "timestamp": 1586417492054.487,
                "type": "certificate"
            },
            {
                "clockRate": 48000,
                "id": "RTCCodec_audio_u7Lulw_Inbound_109",
                "mimeType": "audio/opus",
                "payloadType": 109,
                "timestamp": 1586417492054.487,
                "type": "codec"
            },
            {
                "clockRate": 48000,
                "id": "RTCCodec_audio_u7Lulw_Outbound_109",
                "mimeType": "audio/opus",
                "payloadType": 109,
                "timestamp": 1586417492054.487,
                "type": "codec"
            },
            {
                "clockRate": 90000,
                "id": "RTCCodec_video_8IGSWf_Inbound_116",
                "mimeType": "video/red",
                "payloadType": 116,
                "timestamp": 1586417492054.487,
                "type": "codec"
            },
            {
                "clockRate": 90000,
                "id": "RTCCodec_video_8IGSWf_Inbound_117",
                "mimeType": "video/ulpfec",
                "payloadType": 117,
                "timestamp": 1586417492054.487,
                "type": "codec"
            },
            {
                "clockRate": 90000,
                "id": "RTCCodec_video_8IGSWf_Inbound_120",
                "mimeType": "video/VP9",
                "payloadType": 120,
                "timestamp": 1586417492054.487,
                "type": "codec"
            },
            {
                "clockRate": 90000,
                "id": "RTCCodec_video_8IGSWf_Inbound_96",
                "mimeType": "video/rtx",
                "payloadType": 96,
                "timestamp": 1586417492054.487,
                "type": "codec"
            },
            {
                "clockRate": 90000,
                "id": "RTCCodec_video_8IGSWf_Inbound_97",
                "mimeType": "video/rtx",
                "payloadType": 97,
                "timestamp": 1586417492054.487,
                "type": "codec"
            },
            {
                "clockRate": 90000,
                "id": "RTCCodec_video_8IGSWf_Outbound_116",
                "mimeType": "video/red",
                "payloadType": 116,
                "timestamp": 1586417492054.487,
                "type": "codec"
            },
            {
                "clockRate": 90000,
                "id": "RTCCodec_video_8IGSWf_Outbound_117",
                "mimeType": "video/ulpfec",
                "payloadType": 117,
                "timestamp": 1586417492054.487,
                "type": "codec"
            },
            {
                "clockRate": 90000,
                "id": "RTCCodec_video_8IGSWf_Outbound_120",
                "mimeType": "video/VP9",
                "payloadType": 120,
                "timestamp": 1586417492054.487,
                "type": "codec"
            },
            {
                "clockRate": 90000,
                "id": "RTCCodec_video_8IGSWf_Outbound_96",
                "mimeType": "video/rtx",
                "payloadType": 96,
                "timestamp": 1586417492054.487,
                "type": "codec"
            },
            {
                "clockRate": 90000,
                "id": "RTCCodec_video_8IGSWf_Outbound_97",
                "mimeType": "video/rtx",
                "payloadType": 97,
                "timestamp": 1586417492054.487,
                "type": "codec"
            },
            {
                "availableOutgoingBitrate": 500000,
                "bytesReceived": 7166,
                "bytesSent": 1590493,
                "consentRequestsSent": 13,
                "currentRoundTripTime": 0,
                "id": "RTCIceCandidatePair_kJFGYHCn_K+hhYOVG",
                "localCandidateId": "RTCIceCandidate_kJFGYHCn",
                "nominated": true,
                "priority": 179616219446525440,
                "remoteCandidateId": "RTCIceCandidate_K+hhYOVG",
                "requestsReceived": 5,
                "requestsSent": 1,
                "responsesReceived": 14,
                "responsesSent": 5,
                "state": "succeeded",
                "timestamp": 1586417492054.487,
                "totalRoundTripTime": 0.005,
                "transportId": "RTCTransport_audio_u7Lulw_1",
                "type": "candidate-pair",
                "writable": true
            },
            {
                "candidateType": "host",
                "deleted": false,
                "id": "RTCIceCandidate_K+hhYOVG",
                "ip": "192.168.1.6",
                "isRemote": true,
                "port": 59924,
                "priority": 2114002687,
                "protocol": "udp",
                "timestamp": 1586417492054.487,
                "transportId": "RTCTransport_audio_u7Lulw_1",
                "type": "remote-candidate"
            },
            {
                "candidateType": "relay",
                "deleted": false,
                "id": "RTCIceCandidate_kJFGYHCn",
                "ip": "203.0.113.1",
                "isRemote": false,
                "networkType": "wifi",
                "port": 11490,
                "priority": 41820159,
                "protocol": "udp",
                "relayProtocol": "udp",
                "timestamp": 1586417492054.487,
                "transportId": "RTCTransport_audio_u7Lulw_1",
                "type": "local-candidate"
            },
            {
                "bytesReceived": 0,
                "headerBytesReceived": 0,
                "id": "RTCInboundRTPAudioStream_1872341764",
                "isRemote": false,
                "jitter": 0,
                "kind": "audio",
                "mediaType": "audio",
                "packetsLost": 0,
                "packetsReceived": 0,
                "ssrc": 1872341764,
                "timestamp": 1586417492054.487,
                "transportId": "RTCTransport_audio_u7Lulw_1",
                "type": "inbound-rtp"
            },
            {
                "detached": false,
                "echoReturnLoss": -30,
                "echoReturnLossEnhancement": 0.17551203072071075,
                "ended": false,
                "id": "RTCMediaStreamTrack_sender_1",
                "kind": "audio",
                "mediaSourceId": "RTCAudioSource_1",
                "remoteSource": false,
                "timestamp": 1586417492054.487,
                "trackIdentifier": "8de161d9-c93f-4c8a-ab0e-c4cb1ed45543",
                "type": "track"
            },
            {
                "detached": false,
                "ended": false,
                "frameHeight": 480,
                "frameWidth": 640,
                "framesSent": 743,
                "hugeFramesSent": 1,
                "id": "RTCMediaStreamTrack_sender_2",
                "kind": "video",
                "mediaSourceId": "RTCVideoSource_2",
                "remoteSource": false,
                "timestamp": 1586417492054.487,
                "trackIdentifier": "034ef502-977d-47b5-b0dd-f8f2f9c3efd4",
                "type": "track"
            },
            {
                "id": "RTCMediaStream_YzrwqojxygQekopjqDgu02X6YXRhCKMxQ995",
                "streamIdentifier": "YzrwqojxygQekopjqDgu02X6YXRhCKMxQ995",
                "timestamp": 1586417492054.487,
                "trackIds": [
                    "RTCMediaStreamTrack_sender_1",
                    "RTCMediaStreamTrack_sender_2"
                ],
                "type": "stream"
            },
            {
                "bytesSent": 3738,
                "codecId": "RTCCodec_audio_u7Lulw_Outbound_109",
                "headerBytesSent": 29904,
                "id": "RTCOutboundRTPAudioStream_3503369952",
                "isRemote": false,
                "kind": "audio",
                "mediaSourceId": "RTCAudioSource_1",
                "mediaType": "audio",
                "packetsSent": 1246,
                "retransmittedBytesSent": 0,
                "retransmittedPacketsSent": 0,
                "ssrc": 3503369952,
                "timestamp": 1586417492054.487,
                "trackId": "RTCMediaStreamTrack_sender_1",
                "transportId": "RTCTransport_audio_u7Lulw_1",
                "type": "outbound-rtp"
            },
            {
                "bytesSent": 1489072,
                "codecId": "RTCCodec_video_8IGSWf_Outbound_120",
                "encoderImplementation": "libvpx",
                "firCount": 0,
                "framesEncoded": 743,
                "headerBytesSent": 35236,
                "id": "RTCOutboundRTPVideoStream_1584733228",
                "isRemote": false,
                "keyFramesEncoded": 1,
                "kind": "video",
                "mediaSourceId": "RTCVideoSource_2",
                "mediaType": "video",
                "nackCount": 16,
                "packetsSent": 1665,
                "pliCount": 0,
                "qpSum": 100700,
                "qualityLimitationReason": "none",
                "qualityLimitationResolutionChanges": 0,
                "retransmittedBytesSent": 0,
                "retransmittedPacketsSent": 0,
                "ssrc": 1584733228,
                "timestamp": 1586417492054.487,
                "totalEncodeTime": 1.982,
                "totalEncodedBytesTarget": 1562761,
                "totalPacketSendDelay": 43.955,
                "trackId": "RTCMediaStreamTrack_sender_2",
                "transportId": "RTCTransport_audio_u7Lulw_1",
                "type": "outbound-rtp"
            },
            {
                "dataChannelsClosed": 0,
                "dataChannelsOpened": 0,
                "id": "RTCPeerConnection",
                "timestamp": 1586417492054.487,
                "type": "peer-connection"
            },
            {
                "codecId": "RTCCodec_audio_u7Lulw_Outbound_109",
                "id": "RTCRemoteInboundRtpAudioStream_3503369952",
                "jitter": 0.002125,
                "kind": "audio",
                "localId": "RTCOutboundRTPAudioStream_3503369952",
                "packetsLost": 9,
                "roundTripTime": 0.001,
                "ssrc": 3503369952,
                "timestamp": 1586417491669.581,
                "transportId": "RTCTransport_audio_u7Lulw_1",
                "type": "remote-inbound-rtp"
            },
            {
                "codecId": "RTCCodec_video_8IGSWf_Outbound_120",
                "id": "RTCRemoteInboundRtpVideoStream_1584733228",
                "jitter": 0.005044444444444444,
                "kind": "video",
                "localId": "RTCOutboundRTPVideoStream_1584733228",
                "packetsLost": 0,
                "roundTripTime": 0.001,
                "ssrc": 1584733228,
                "timestamp": 1586417491669.512,
                "transportId": "RTCTransport_audio_u7Lulw_1",
                "type": "remote-inbound-rtp"
            },
            {
                "bytesReceived": 7166,
                "bytesSent": 1590493,
                "dtlsCipher": "TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256",
                "dtlsState": "connected",
                "id": "RTCTransport_audio_u7Lulw_1",
                "localCertificateId": "RTCCertificate_1B:FD:64:BF:B3:9F:14:1D:B4:78:A7:DD:F6:62:8D:9E:D7:48:C8:56:D6:1B:6D:04:4D:CA:5D:DB:6A:B3:89:C3",
                "remoteCertificateId": "RTCCertificate_FA:66:5F:F0:4B:10:F3:3C:71:26:A2:33:FF:C1:1B:D0:9E:C5:71:11:68:F3:41:82:84:11:8F:5D:D6:54:86:AE",
                "selectedCandidatePairChanges": 1,
                "selectedCandidatePairId": "RTCIceCandidatePair_kJFGYHCn_K+hhYOVG",
                "srtpCipher": "AES_CM_128_HMAC_SHA1_80",
                "timestamp": 1586417492054.487,
                "tlsVersion": "FEFD",
                "type": "transport"
            },
            {
                "framesPerSecond": 29,
                "height": 480,
                "id": "RTCVideoSource_2",
                "kind": "video",
                "timestamp": 1586417492054.487,
                "trackIdentifier": "034ef502-977d-47b5-b0dd-f8f2f9c3efd4",
                "type": "media-source",
                "width": 640
            }
        ],
        "timestamp": "2020-04-09T07:31:32.056Z"
    }
]

指定したチャネルのリモート統計情報を取得する

サービス

Sora

バージョン

20200225

オペレーション

GetChannelRemoteStats

x-sora-target

Sora_20200225.GetChannelRemoteStats

キー

channel_id

string

$ http POST 127.0.0.1:3000/ x-sora-target:Sora_20200225.GetChannelRemoteStats \
    channel_id=sora \
    -vvv
POST / HTTP/1.1
Accept: application/json, */*
Accept-Encoding: gzip, deflate
Connection: keep-alive
Content-Length: 22
Content-Type: application/json
Host: 127.0.0.1:3000
User-Agent: HTTPie/2.0.0
x-sora-target: Sora_20200225.GetChannelRemoteStats

{
    "channel_id": "sora"
}

HTTP/1.1 200 OK
access-control-allow-headers: Origin, X-Requested-With, Content-Type, Accept, x-sora-target
access-control-allow-methods: POST, OPTIONS
access-control-allow-origin: http://127.0.0.1:5000
access-control-max-age: 1000
content-length: 9479
content-type: application/json
date: Thu, 09 Apr 2020 07:32:36 GMT
server: Cowboy

[
    {
        "channel_id": "sora",
        "connection_id": "HMRVPQEXJX03D3B3WE778SJGRC",
        "remote_stats": [
            {
                "audioLevel": 0,
                "id": "RTCAudioSource_1",
                "kind": "audio",
                "timestamp": 1586417557067.526,
                "totalAudioEnergy": 0,
                "totalSamplesDuration": 89.95000000000911,
                "trackIdentifier": "8de161d9-c93f-4c8a-ab0e-c4cb1ed45543",
                "type": "media-source"
            },
            {
                "base64Certificate": "MIIBFjCBvaADAgECAgkAvREZhM8QonowCgYIKoZIzj0EAwIwETEPMA0GA1UEAwwGV2ViUlRDMB4XDTIwMDQwODA3MzEwN1oXDTIwMDUwOTA3MzEwN1owETEPMA0GA1UEAwwGV2ViUlRDMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEObaQG5SUlwAfRydt90MtcSWPEqcD2bFOaeiS7kRuhK6Y3pdi2Y51OY9g03CJlfLRs/QO7FKSq0JmzZVNK1/fAjAKBggqhkjOPQQDAgNIADBFAiB24aTZEz60OXYKdaCjGRpaq23ssPBaWcUIg5gl6QyFqAIhAJrL8uVs6lJB8kuzY+8JF2eqHbw6GS36DEX8Iz2teQdP",
                "fingerprint": "1B:FD:64:BF:B3:9F:14:1D:B4:78:A7:DD:F6:62:8D:9E:D7:48:C8:56:D6:1B:6D:04:4D:CA:5D:DB:6A:B3:89:C3",
                "fingerprintAlgorithm": "sha-256",
                "id": "RTCCertificate_1B:FD:64:BF:B3:9F:14:1D:B4:78:A7:DD:F6:62:8D:9E:D7:48:C8:56:D6:1B:6D:04:4D:CA:5D:DB:6A:B3:89:C3",
                "timestamp": 1586417557067.526,
                "type": "certificate"
            },
            {
                "base64Certificate": "MIICHjCCAbugAwIBAgIGANT1xzg7MBQGCCqGSM49BAMCBggqhkjOPQMBBzBiMSAwHgYJKoZIhvcNAQkBFhFzb3JhQHNoaWd1cmVkby5qcDEYMBYGA1UEAwwPV2ViUlRDIFNGVSBTb3JhMQswCQYDVQQGEwJKUDEXMBUGA1UECgwOU2hpZ3VyZWRvIGluYy4wHhcNMjAwNDA4MjM1OTU5WhcNMjAwNDE2MjM1OTU5WjBiMSAwHgYJKoZIhvcNAQkBFhFzb3JhQHNoaWd1cmVkby5qcDEYMBYGA1UEAwwPV2ViUlRDIFNGVSBTb3JhMQswCQYDVQQGEwJKUDEXMBUGA1UECgwOU2hpZ3VyZWRvIGluYy4wWTATBgcqhkjOPQIBBggqhkjOPQMBBwNCAAR7ZWYKDfuQtwRhv1Nq9dKU6WJFc1h+3r3nU8yGqcWfK86CdDAGELs+l0g7BcDepxqAOPIaKHIqzpexB/CtNvnTo1MwUTAfBgNVHSMEGDAWgBSiuSarsmBIo/SqAa1/KISQW6Mn5TAdBgNVHQ4EFgQUorkmq7JgSKP0qgGtfyiEkFujJ+UwDwYDVR0TAQH/BAUwAwEB/zAUBggqhkjOPQQDAgYIKoZIzj0DAQcDRwAwRAIgDMUIcnpvrOoX3ThAOr289DJXGHiHKobhLQUZBhRd+YYCIBQp4hrXSkgXiyELOf2+kaaLNuwqQlKO6A6AWj90as54",
                "fingerprint": "FA:66:5F:F0:4B:10:F3:3C:71:26:A2:33:FF:C1:1B:D0:9E:C5:71:11:68:F3:41:82:84:11:8F:5D:D6:54:86:AE",
                "fingerprintAlgorithm": "sha-256",
                "id": "RTCCertificate_FA:66:5F:F0:4B:10:F3:3C:71:26:A2:33:FF:C1:1B:D0:9E:C5:71:11:68:F3:41:82:84:11:8F:5D:D6:54:86:AE",
                "timestamp": 1586417557067.526,
                "type": "certificate"
            },
            {
                "clockRate": 48000,
                "id": "RTCCodec_audio_u7Lulw_Inbound_109",
                "mimeType": "audio/opus",
                "payloadType": 109,
                "timestamp": 1586417557067.526,
                "type": "codec"
            },
            {
                "clockRate": 48000,
                "id": "RTCCodec_audio_u7Lulw_Outbound_109",
                "mimeType": "audio/opus",
                "payloadType": 109,
                "timestamp": 1586417557067.526,
                "type": "codec"
            },
            {
                "clockRate": 90000,
                "id": "RTCCodec_video_8IGSWf_Inbound_116",
                "mimeType": "video/red",
                "payloadType": 116,
                "timestamp": 1586417557067.526,
                "type": "codec"
            },
            {
                "clockRate": 90000,
                "id": "RTCCodec_video_8IGSWf_Inbound_117",
                "mimeType": "video/ulpfec",
                "payloadType": 117,
                "timestamp": 1586417557067.526,
                "type": "codec"
            },
            {
                "clockRate": 90000,
                "id": "RTCCodec_video_8IGSWf_Inbound_120",
                "mimeType": "video/VP9",
                "payloadType": 120,
                "timestamp": 1586417557067.526,
                "type": "codec"
            },
            {
                "clockRate": 90000,
                "id": "RTCCodec_video_8IGSWf_Inbound_96",
                "mimeType": "video/rtx",
                "payloadType": 96,
                "timestamp": 1586417557067.526,
                "type": "codec"
            },
            {
                "clockRate": 90000,
                "id": "RTCCodec_video_8IGSWf_Inbound_97",
                "mimeType": "video/rtx",
                "payloadType": 97,
                "timestamp": 1586417557067.526,
                "type": "codec"
            },
            {
                "clockRate": 90000,
                "id": "RTCCodec_video_8IGSWf_Outbound_116",
                "mimeType": "video/red",
                "payloadType": 116,
                "timestamp": 1586417557067.526,
                "type": "codec"
            },
            {
                "clockRate": 90000,
                "id": "RTCCodec_video_8IGSWf_Outbound_117",
                "mimeType": "video/ulpfec",
                "payloadType": 117,
                "timestamp": 1586417557067.526,
                "type": "codec"
            },
            {
                "clockRate": 90000,
                "id": "RTCCodec_video_8IGSWf_Outbound_120",
                "mimeType": "video/VP9",
                "payloadType": 120,
                "timestamp": 1586417557067.526,
                "type": "codec"
            },
            {
                "clockRate": 90000,
                "id": "RTCCodec_video_8IGSWf_Outbound_96",
                "mimeType": "video/rtx",
                "payloadType": 96,
                "timestamp": 1586417557067.526,
                "type": "codec"
            },
            {
                "clockRate": 90000,
                "id": "RTCCodec_video_8IGSWf_Outbound_97",
                "mimeType": "video/rtx",
                "payloadType": 97,
                "timestamp": 1586417557067.526,
                "type": "codec"
            },
            {
                "availableOutgoingBitrate": 500000,
                "bytesReceived": 23270,
                "bytesSent": 5816552,
                "consentRequestsSent": 39,
                "currentRoundTripTime": 0.001,
                "id": "RTCIceCandidatePair_kJFGYHCn_K+hhYOVG",
                "localCandidateId": "RTCIceCandidate_kJFGYHCn",
                "nominated": true,
                "priority": 179616219446525440,
                "remoteCandidateId": "RTCIceCandidate_K+hhYOVG",
                "requestsReceived": 18,
                "requestsSent": 1,
                "responsesReceived": 40,
                "responsesSent": 18,
                "state": "succeeded",
                "timestamp": 1586417557067.526,
                "totalRoundTripTime": 0.02,
                "transportId": "RTCTransport_audio_u7Lulw_1",
                "type": "candidate-pair",
                "writable": true
            },
            {
                "candidateType": "host",
                "deleted": false,
                "id": "RTCIceCandidate_K+hhYOVG",
                "ip": "192.168.1.6",
                "isRemote": true,
                "port": 59924,
                "priority": 2114002687,
                "protocol": "udp",
                "timestamp": 1586417557067.526,
                "transportId": "RTCTransport_audio_u7Lulw_1",
                "type": "remote-candidate"
            },
            {
                "candidateType": "relay",
                "deleted": false,
                "id": "RTCIceCandidate_kJFGYHCn",
                "ip": "203.0.113.1",
                "isRemote": false,
                "networkType": "wifi",
                "port": 11490,
                "priority": 41820159,
                "protocol": "udp",
                "relayProtocol": "udp",
                "timestamp": 1586417557067.526,
                "transportId": "RTCTransport_audio_u7Lulw_1",
                "type": "local-candidate"
            },
            {
                "bytesReceived": 0,
                "headerBytesReceived": 0,
                "id": "RTCInboundRTPAudioStream_1872341764",
                "isRemote": false,
                "jitter": 0,
                "kind": "audio",
                "mediaType": "audio",
                "packetsLost": 0,
                "packetsReceived": 0,
                "ssrc": 1872341764,
                "timestamp": 1586417557067.526,
                "transportId": "RTCTransport_audio_u7Lulw_1",
                "type": "inbound-rtp"
            },
            {
                "detached": false,
                "echoReturnLoss": -30,
                "echoReturnLossEnhancement": 0.17551203072071075,
                "ended": false,
                "id": "RTCMediaStreamTrack_sender_1",
                "kind": "audio",
                "mediaSourceId": "RTCAudioSource_1",
                "remoteSource": false,
                "timestamp": 1586417557067.526,
                "trackIdentifier": "8de161d9-c93f-4c8a-ab0e-c4cb1ed45543",
                "type": "track"
            },
            {
                "detached": false,
                "ended": false,
                "frameHeight": 480,
                "frameWidth": 640,
                "framesSent": 2694,
                "hugeFramesSent": 1,
                "id": "RTCMediaStreamTrack_sender_2",
                "kind": "video",
                "mediaSourceId": "RTCVideoSource_2",
                "remoteSource": false,
                "timestamp": 1586417557067.526,
                "trackIdentifier": "034ef502-977d-47b5-b0dd-f8f2f9c3efd4",
                "type": "track"
            },
            {
                "id": "RTCMediaStream_YzrwqojxygQekopjqDgu02X6YXRhCKMxQ995",
                "streamIdentifier": "YzrwqojxygQekopjqDgu02X6YXRhCKMxQ995",
                "timestamp": 1586417557067.526,
                "trackIds": [
                    "RTCMediaStreamTrack_sender_1",
                    "RTCMediaStreamTrack_sender_2"
                ],
                "type": "stream"
            },
            {
                "bytesSent": 13491,
                "codecId": "RTCCodec_audio_u7Lulw_Outbound_109",
                "headerBytesSent": 107928,
                "id": "RTCOutboundRTPAudioStream_3503369952",
                "isRemote": false,
                "kind": "audio",
                "mediaSourceId": "RTCAudioSource_1",
                "mediaType": "audio",
                "packetsSent": 4497,
                "retransmittedBytesSent": 0,
                "retransmittedPacketsSent": 0,
                "ssrc": 3503369952,
                "timestamp": 1586417557067.526,
                "trackId": "RTCMediaStreamTrack_sender_1",
                "transportId": "RTCTransport_audio_u7Lulw_1",
                "type": "outbound-rtp"
            },
            {
                "bytesSent": 5450632,
                "codecId": "RTCCodec_video_8IGSWf_Outbound_120",
                "encoderImplementation": "libvpx",
                "firCount": 0,
                "framesEncoded": 2694,
                "headerBytesSent": 128156,
                "id": "RTCOutboundRTPVideoStream_1584733228",
                "isRemote": false,
                "keyFramesEncoded": 1,
                "kind": "video",
                "mediaSourceId": "RTCVideoSource_2",
                "mediaType": "video",
                "nackCount": 50,
                "packetsSent": 6059,
                "pliCount": 0,
                "qpSum": 341943,
                "qualityLimitationReason": "none",
                "qualityLimitationResolutionChanges": 0,
                "retransmittedBytesSent": 0,
                "retransmittedPacketsSent": 0,
                "ssrc": 1584733228,
                "timestamp": 1586417557067.526,
                "totalEncodeTime": 7.137,
                "totalEncodedBytesTarget": 5539369,
                "totalPacketSendDelay": 165.797,
                "trackId": "RTCMediaStreamTrack_sender_2",
                "transportId": "RTCTransport_audio_u7Lulw_1",
                "type": "outbound-rtp"
            },
            {
                "dataChannelsClosed": 0,
                "dataChannelsOpened": 0,
                "id": "RTCPeerConnection",
                "timestamp": 1586417557067.526,
                "type": "peer-connection"
            },
            {
                "codecId": "RTCCodec_audio_u7Lulw_Outbound_109",
                "id": "RTCRemoteInboundRtpAudioStream_3503369952",
                "jitter": 0.0022083333333333334,
                "kind": "audio",
                "localId": "RTCOutboundRTPAudioStream_3503369952",
                "packetsLost": 43,
                "roundTripTime": 0.001,
                "ssrc": 3503369952,
                "timestamp": 1586417556799.463,
                "transportId": "RTCTransport_audio_u7Lulw_1",
                "type": "remote-inbound-rtp"
            },
            {
                "codecId": "RTCCodec_video_8IGSWf_Outbound_120",
                "id": "RTCRemoteInboundRtpVideoStream_1584733228",
                "jitter": 0.004677777777777778,
                "kind": "video",
                "localId": "RTCOutboundRTPVideoStream_1584733228",
                "packetsLost": 0,
                "roundTripTime": 0.001,
                "ssrc": 1584733228,
                "timestamp": 1586417556799.403,
                "transportId": "RTCTransport_audio_u7Lulw_1",
                "type": "remote-inbound-rtp"
            },
            {
                "bytesReceived": 23270,
                "bytesSent": 5816552,
                "dtlsCipher": "TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256",
                "dtlsState": "connected",
                "id": "RTCTransport_audio_u7Lulw_1",
                "localCertificateId": "RTCCertificate_1B:FD:64:BF:B3:9F:14:1D:B4:78:A7:DD:F6:62:8D:9E:D7:48:C8:56:D6:1B:6D:04:4D:CA:5D:DB:6A:B3:89:C3",
                "remoteCertificateId": "RTCCertificate_FA:66:5F:F0:4B:10:F3:3C:71:26:A2:33:FF:C1:1B:D0:9E:C5:71:11:68:F3:41:82:84:11:8F:5D:D6:54:86:AE",
                "selectedCandidatePairChanges": 1,
                "selectedCandidatePairId": "RTCIceCandidatePair_kJFGYHCn_K+hhYOVG",
                "srtpCipher": "AES_CM_128_HMAC_SHA1_80",
                "timestamp": 1586417557067.526,
                "tlsVersion": "FEFD",
                "type": "transport"
            },
            {
                "framesPerSecond": 30,
                "height": 480,
                "id": "RTCVideoSource_2",
                "kind": "video",
                "timestamp": 1586417557067.526,
                "trackIdentifier": "034ef502-977d-47b5-b0dd-f8f2f9c3efd4",
                "type": "media-source",
                "width": 640
            }
        ],
        "timestamp": "2020-04-09T07:32:37.069Z"
    }
]

指定した接続のリモート統計情報を取得する

サービス

Sora

バージョン

20200225

オペレーション

GetConnectionRemoteStats

x-sora-target

Sora_20200225.GetConnectionRemoteStats

キー

channel_id

string

connection_id

string

$ http POST 127.0.0.1:3000/ x-sora-target:Sora_20200225.GetConnectionRemoteStats \
    channel_id=sora \
    connection_id=HMRVPQEXJX03D3B3WE778SJGRC \
    -vvv
POST / HTTP/1.1
Accept: application/json, */*
Accept-Encoding: gzip, deflate
Connection: keep-alive
Content-Length: 69
Content-Type: application/json
Host: 127.0.0.1:3000
User-Agent: HTTPie/2.0.0
x-sora-target: Sora_20200225.GetConnectionRemoteStats

{
    "channel_id": "sora",
    "connection_id": "HMRVPQEXJX03D3B3WE778SJGRC"
}

HTTP/1.1 200 OK
access-control-allow-headers: Origin, X-Requested-With, Content-Type, Accept, x-sora-target
access-control-allow-methods: POST, OPTIONS
access-control-allow-origin: http://127.0.0.1:5000
access-control-max-age: 1000
content-length: 9473
content-type: application/json
date: Thu, 09 Apr 2020 07:33:41 GMT
server: Cowboy

{
    "channel_id": "sora",
    "connection_id": "HMRVPQEXJX03D3B3WE778SJGRC",
    "stats": [
        {
            "audioLevel": 0,
            "id": "RTCAudioSource_1",
            "kind": "audio",
            "timestamp": 1586417622080.464,
            "totalAudioEnergy": 0,
            "totalSamplesDuration": 154.96000000000404,
            "trackIdentifier": "8de161d9-c93f-4c8a-ab0e-c4cb1ed45543",
            "type": "media-source"
        },
        {
            "base64Certificate": "MIIBFjCBvaADAgECAgkAvREZhM8QonowCgYIKoZIzj0EAwIwETEPMA0GA1UEAwwGV2ViUlRDMB4XDTIwMDQwODA3MzEwN1oXDTIwMDUwOTA3MzEwN1owETEPMA0GA1UEAwwGV2ViUlRDMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEObaQG5SUlwAfRydt90MtcSWPEqcD2bFOaeiS7kRuhK6Y3pdi2Y51OY9g03CJlfLRs/QO7FKSq0JmzZVNK1/fAjAKBggqhkjOPQQDAgNIADBFAiB24aTZEz60OXYKdaCjGRpaq23ssPBaWcUIg5gl6QyFqAIhAJrL8uVs6lJB8kuzY+8JF2eqHbw6GS36DEX8Iz2teQdP",
            "fingerprint": "1B:FD:64:BF:B3:9F:14:1D:B4:78:A7:DD:F6:62:8D:9E:D7:48:C8:56:D6:1B:6D:04:4D:CA:5D:DB:6A:B3:89:C3",
            "fingerprintAlgorithm": "sha-256",
            "id": "RTCCertificate_1B:FD:64:BF:B3:9F:14:1D:B4:78:A7:DD:F6:62:8D:9E:D7:48:C8:56:D6:1B:6D:04:4D:CA:5D:DB:6A:B3:89:C3",
            "timestamp": 1586417622080.464,
            "type": "certificate"
        },
        {
            "base64Certificate": "MIICHjCCAbugAwIBAgIGANT1xzg7MBQGCCqGSM49BAMCBggqhkjOPQMBBzBiMSAwHgYJKoZIhvcNAQkBFhFzb3JhQHNoaWd1cmVkby5qcDEYMBYGA1UEAwwPV2ViUlRDIFNGVSBTb3JhMQswCQYDVQQGEwJKUDEXMBUGA1UECgwOU2hpZ3VyZWRvIGluYy4wHhcNMjAwNDA4MjM1OTU5WhcNMjAwNDE2MjM1OTU5WjBiMSAwHgYJKoZIhvcNAQkBFhFzb3JhQHNoaWd1cmVkby5qcDEYMBYGA1UEAwwPV2ViUlRDIFNGVSBTb3JhMQswCQYDVQQGEwJKUDEXMBUGA1UECgwOU2hpZ3VyZWRvIGluYy4wWTATBgcqhkjOPQIBBggqhkjOPQMBBwNCAAR7ZWYKDfuQtwRhv1Nq9dKU6WJFc1h+3r3nU8yGqcWfK86CdDAGELs+l0g7BcDepxqAOPIaKHIqzpexB/CtNvnTo1MwUTAfBgNVHSMEGDAWgBSiuSarsmBIo/SqAa1/KISQW6Mn5TAdBgNVHQ4EFgQUorkmq7JgSKP0qgGtfyiEkFujJ+UwDwYDVR0TAQH/BAUwAwEB/zAUBggqhkjOPQQDAgYIKoZIzj0DAQcDRwAwRAIgDMUIcnpvrOoX3ThAOr289DJXGHiHKobhLQUZBhRd+YYCIBQp4hrXSkgXiyELOf2+kaaLNuwqQlKO6A6AWj90as54",
            "fingerprint": "FA:66:5F:F0:4B:10:F3:3C:71:26:A2:33:FF:C1:1B:D0:9E:C5:71:11:68:F3:41:82:84:11:8F:5D:D6:54:86:AE",
            "fingerprintAlgorithm": "sha-256",
            "id": "RTCCertificate_FA:66:5F:F0:4B:10:F3:3C:71:26:A2:33:FF:C1:1B:D0:9E:C5:71:11:68:F3:41:82:84:11:8F:5D:D6:54:86:AE",
            "timestamp": 1586417622080.464,
            "type": "certificate"
        },
        {
            "clockRate": 48000,
            "id": "RTCCodec_audio_u7Lulw_Inbound_109",
            "mimeType": "audio/opus",
            "payloadType": 109,
            "timestamp": 1586417622080.464,
            "type": "codec"
        },
        {
            "clockRate": 48000,
            "id": "RTCCodec_audio_u7Lulw_Outbound_109",
            "mimeType": "audio/opus",
            "payloadType": 109,
            "timestamp": 1586417622080.464,
            "type": "codec"
        },
        {
            "clockRate": 90000,
            "id": "RTCCodec_video_8IGSWf_Inbound_116",
            "mimeType": "video/red",
            "payloadType": 116,
            "timestamp": 1586417622080.464,
            "type": "codec"
        },
        {
            "clockRate": 90000,
            "id": "RTCCodec_video_8IGSWf_Inbound_117",
            "mimeType": "video/ulpfec",
            "payloadType": 117,
            "timestamp": 1586417622080.464,
            "type": "codec"
        },
        {
            "clockRate": 90000,
            "id": "RTCCodec_video_8IGSWf_Inbound_120",
            "mimeType": "video/VP9",
            "payloadType": 120,
            "timestamp": 1586417622080.464,
            "type": "codec"
        },
        {
            "clockRate": 90000,
            "id": "RTCCodec_video_8IGSWf_Inbound_96",
            "mimeType": "video/rtx",
            "payloadType": 96,
            "timestamp": 1586417622080.464,
            "type": "codec"
        },
        {
            "clockRate": 90000,
            "id": "RTCCodec_video_8IGSWf_Inbound_97",
            "mimeType": "video/rtx",
            "payloadType": 97,
            "timestamp": 1586417622080.464,
            "type": "codec"
        },
        {
            "clockRate": 90000,
            "id": "RTCCodec_video_8IGSWf_Outbound_116",
            "mimeType": "video/red",
            "payloadType": 116,
            "timestamp": 1586417622080.464,
            "type": "codec"
        },
        {
            "clockRate": 90000,
            "id": "RTCCodec_video_8IGSWf_Outbound_117",
            "mimeType": "video/ulpfec",
            "payloadType": 117,
            "timestamp": 1586417622080.464,
            "type": "codec"
        },
        {
            "clockRate": 90000,
            "id": "RTCCodec_video_8IGSWf_Outbound_120",
            "mimeType": "video/VP9",
            "payloadType": 120,
            "timestamp": 1586417622080.464,
            "type": "codec"
        },
        {
            "clockRate": 90000,
            "id": "RTCCodec_video_8IGSWf_Outbound_96",
            "mimeType": "video/rtx",
            "payloadType": 96,
            "timestamp": 1586417622080.464,
            "type": "codec"
        },
        {
            "clockRate": 90000,
            "id": "RTCCodec_video_8IGSWf_Outbound_97",
            "mimeType": "video/rtx",
            "payloadType": 97,
            "timestamp": 1586417622080.464,
            "type": "codec"
        },
        {
            "availableOutgoingBitrate": 500000,
            "bytesReceived": 39588,
            "bytesSent": 10044330,
            "consentRequestsSent": 64,
            "currentRoundTripTime": 0.001,
            "id": "RTCIceCandidatePair_kJFGYHCn_K+hhYOVG",
            "localCandidateId": "RTCIceCandidate_kJFGYHCn",
            "nominated": true,
            "priority": 179616219446525440,
            "remoteCandidateId": "RTCIceCandidate_K+hhYOVG",
            "requestsReceived": 31,
            "requestsSent": 1,
            "responsesReceived": 65,
            "responsesSent": 31,
            "state": "succeeded",
            "timestamp": 1586417622080.464,
            "totalRoundTripTime": 0.028,
            "transportId": "RTCTransport_audio_u7Lulw_1",
            "type": "candidate-pair",
            "writable": true
        },
        {
            "candidateType": "host",
            "deleted": false,
            "id": "RTCIceCandidate_K+hhYOVG",
            "ip": "192.168.1.6",
            "isRemote": true,
            "port": 59924,
            "priority": 2114002687,
            "protocol": "udp",
            "timestamp": 1586417622080.464,
            "transportId": "RTCTransport_audio_u7Lulw_1",
            "type": "remote-candidate"
        },
        {
            "candidateType": "relay",
            "deleted": false,
            "id": "RTCIceCandidate_kJFGYHCn",
            "ip": "203.0.113.1",
            "isRemote": false,
            "networkType": "wifi",
            "port": 11490,
            "priority": 41820159,
            "protocol": "udp",
            "relayProtocol": "udp",
            "timestamp": 1586417622080.464,
            "transportId": "RTCTransport_audio_u7Lulw_1",
            "type": "local-candidate"
        },
        {
            "bytesReceived": 0,
            "headerBytesReceived": 0,
            "id": "RTCInboundRTPAudioStream_1872341764",
            "isRemote": false,
            "jitter": 0,
            "kind": "audio",
            "mediaType": "audio",
            "packetsLost": 0,
            "packetsReceived": 0,
            "ssrc": 1872341764,
            "timestamp": 1586417622080.464,
            "transportId": "RTCTransport_audio_u7Lulw_1",
            "type": "inbound-rtp"
        },
        {
            "detached": false,
            "echoReturnLoss": -30,
            "echoReturnLossEnhancement": 0.17551203072071075,
            "ended": false,
            "id": "RTCMediaStreamTrack_sender_1",
            "kind": "audio",
            "mediaSourceId": "RTCAudioSource_1",
            "remoteSource": false,
            "timestamp": 1586417622080.464,
            "trackIdentifier": "8de161d9-c93f-4c8a-ab0e-c4cb1ed45543",
            "type": "track"
        },
        {
            "detached": false,
            "ended": false,
            "frameHeight": 480,
            "frameWidth": 640,
            "framesSent": 4642,
            "hugeFramesSent": 2,
            "id": "RTCMediaStreamTrack_sender_2",
            "kind": "video",
            "mediaSourceId": "RTCVideoSource_2",
            "remoteSource": false,
            "timestamp": 1586417622080.464,
            "trackIdentifier": "034ef502-977d-47b5-b0dd-f8f2f9c3efd4",
            "type": "track"
        },
        {
            "id": "RTCMediaStream_YzrwqojxygQekopjqDgu02X6YXRhCKMxQ995",
            "streamIdentifier": "YzrwqojxygQekopjqDgu02X6YXRhCKMxQ995",
            "timestamp": 1586417622080.464,
            "trackIds": [
                "RTCMediaStreamTrack_sender_1",
                "RTCMediaStreamTrack_sender_2"
            ],
            "type": "stream"
        },
        {
            "bytesSent": 23244,
            "codecId": "RTCCodec_audio_u7Lulw_Outbound_109",
            "headerBytesSent": 185952,
            "id": "RTCOutboundRTPAudioStream_3503369952",
            "isRemote": false,
            "kind": "audio",
            "mediaSourceId": "RTCAudioSource_1",
            "mediaType": "audio",
            "packetsSent": 7748,
            "retransmittedBytesSent": 0,
            "retransmittedPacketsSent": 0,
            "ssrc": 3503369952,
            "timestamp": 1586417622080.464,
            "trackId": "RTCMediaStreamTrack_sender_1",
            "transportId": "RTCTransport_audio_u7Lulw_1",
            "type": "outbound-rtp"
        },
        {
            "bytesSent": 9413867,
            "codecId": "RTCCodec_video_8IGSWf_Outbound_120",
            "encoderImplementation": "libvpx",
            "firCount": 0,
            "framesEncoded": 4642,
            "headerBytesSent": 220876,
            "id": "RTCOutboundRTPVideoStream_1584733228",
            "isRemote": false,
            "keyFramesEncoded": 2,
            "kind": "video",
            "mediaSourceId": "RTCVideoSource_2",
            "mediaType": "video",
            "nackCount": 91,
            "packetsSent": 10442,
            "pliCount": 0,
            "qpSum": 578791,
            "qualityLimitationReason": "none",
            "qualityLimitationResolutionChanges": 0,
            "retransmittedBytesSent": 0,
            "retransmittedPacketsSent": 0,
            "ssrc": 1584733228,
            "timestamp": 1586417622080.464,
            "totalEncodeTime": 12.09,
            "totalEncodedBytesTarget": 9513352,
            "totalPacketSendDelay": 289.948,
            "trackId": "RTCMediaStreamTrack_sender_2",
            "transportId": "RTCTransport_audio_u7Lulw_1",
            "type": "outbound-rtp"
        },
        {
            "dataChannelsClosed": 0,
            "dataChannelsOpened": 0,
            "id": "RTCPeerConnection",
            "timestamp": 1586417622080.464,
            "type": "peer-connection"
        },
        {
            "codecId": "RTCCodec_audio_u7Lulw_Outbound_109",
            "id": "RTCRemoteInboundRtpAudioStream_3503369952",
            "jitter": 0.002,
            "kind": "audio",
            "localId": "RTCOutboundRTPAudioStream_3503369952",
            "packetsLost": 79,
            "roundTripTime": 0.001,
            "ssrc": 3503369952,
            "timestamp": 1586417621929.611,
            "transportId": "RTCTransport_audio_u7Lulw_1",
            "type": "remote-inbound-rtp"
        },
        {
            "codecId": "RTCCodec_video_8IGSWf_Outbound_120",
            "id": "RTCRemoteInboundRtpVideoStream_1584733228",
            "jitter": 0.005655555555555555,
            "kind": "video",
            "localId": "RTCOutboundRTPVideoStream_1584733228",
            "packetsLost": 0,
            "roundTripTime": 0.001,
            "ssrc": 1584733228,
            "timestamp": 1586417621929.561,
            "transportId": "RTCTransport_audio_u7Lulw_1",
            "type": "remote-inbound-rtp"
        },
        {
            "bytesReceived": 39588,
            "bytesSent": 10044330,
            "dtlsCipher": "TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256",
            "dtlsState": "connected",
            "id": "RTCTransport_audio_u7Lulw_1",
            "localCertificateId": "RTCCertificate_1B:FD:64:BF:B3:9F:14:1D:B4:78:A7:DD:F6:62:8D:9E:D7:48:C8:56:D6:1B:6D:04:4D:CA:5D:DB:6A:B3:89:C3",
            "remoteCertificateId": "RTCCertificate_FA:66:5F:F0:4B:10:F3:3C:71:26:A2:33:FF:C1:1B:D0:9E:C5:71:11:68:F3:41:82:84:11:8F:5D:D6:54:86:AE",
            "selectedCandidatePairChanges": 1,
            "selectedCandidatePairId": "RTCIceCandidatePair_kJFGYHCn_K+hhYOVG",
            "srtpCipher": "AES_CM_128_HMAC_SHA1_80",
            "timestamp": 1586417622080.464,
            "tlsVersion": "FEFD",
            "type": "transport"
        },
        {
            "framesPerSecond": 30,
            "height": 480,
            "id": "RTCVideoSource_2",
            "kind": "video",
            "timestamp": 1586417622080.464,
            "trackIdentifier": "034ef502-977d-47b5-b0dd-f8f2f9c3efd4",
            "type": "media-source",
            "width": 640
        }
    ],
    "timestamp": "2020-04-09T07:33:42.081Z"
}

その他の API

指定した接続のビットレートを動的に変更する

警告

この API は実験的機能のため正式版では仕様が変更される可能性があります

サービス

Sora

バージョン

20190327

オペレーション

ChangeUpstreamVideoBitRate

x-sora-target

Sora_20190327.ChangeUpstreamVideoBitRate

この API は片方向とマルチストリームでのみ利用可能です。スポットライトには対応しておりません。

キー

channel_id

string

connection_id

string

bit_rate

integer (1 - 30000)

$ http POST 127.0.0.1:3000/ x-sora-target:Sora_20190327.ChangeUpstreamVideoBitRate \
    channel_id=sora \
    connection_id=HMRVPQEXJX03D3B3WE778SJGRC \
    bit_rate:=300 \
    -vvv
POST / HTTP/1.1
Accept: application/json, */*
Accept-Encoding: gzip, deflate
Connection: keep-alive
Content-Length: 96
Content-Type: application/json
Host: 127.0.0.1:3000
User-Agent: HTTPie/1.0.2
x-sora-target: Sora_20190327.ChangeUpstreamVideoBitRate

{
    "bit_rate": 300,
    "channel_id": "sora",
    "connection_id": "HMRVPQEXJX03D3B3WE778SJGRC"
}

HTTP/1.1 200 OK
access-control-allow-headers: Origin, X-Requested-With, Content-Type, Accept, x-sora-target
access-control-allow-methods: POST, OPTIONS
access-control-allow-origin: http://127.0.0.1:5000
access-control-max-age: 1000
content-length: 91
content-type: application/json
date: Wed, 27 Mar 2020 08:38:03 GMT
server: Cowboy

{
    "bit_rate": 300,
    "channel_id": "sora",
    "connection_id": "HMRVPQEXJX03D3B3WE778SJGRC"
}