webrtc janus服務器調試工具 admin api 詳解(一)

引言:

最近在調試janus服務器, 在外網測試的時候出現一些問題, 但是一直不清楚到底是什麼地方出現問題,就一直追日誌, 突然偶然的機會了解到admin api, 使用之後確實能找到不少問題, 對janus服務器的理解, 對janus服務器的調試都幫助很大。

開啓Admin api

Admin默認是關閉的, 打開也比較容易

1:
Janus.jcfg 裏 general設置塊裏
admin_secret 這個字段就是admin的密碼。
因爲admin不光是查詢相關狀態也能實時修改一些設置,狀態,信息。
2:
janus.transport.http.jcfg裏 admin設置塊裏
Admin_http 改成true
默認端口7088 不需要更改,但有防火牆記得把他下行tcp打開。
3:
在janus/share/janus/demo 目錄下,使用
python -m SimpleHTTPServer 8888 或者
python3 -m http.server 8888

這樣,admin api功能就打開了。
首頁如圖:
在這裏插入圖片描述

功能模塊簡介

Server info

主要是展示janus服務器的一些配置,列出一些我覺得比較重要的字段
Server Info

Version :版本
version_string: 版本字符串
log-path: 日誌路徑
data_channels: 是否開啓
session-timeout: session超時時間
candidates-timeout: 候選人超時時間
local-ip: 本地ip(內網)
public-ip: 公網ip
ice-lite: 是否開啓 ice-lite
ice-tcp: 是否開啓 ice-tcp
full-trickle: 是否開啓 full-trickle
rfc-4588: 是否支持 rfc-4588
stun-server: stun-server 地址:端口號
turn-server: trun-server 地址:端口號

Dependencies
依賴庫的版本,好些問題就出在依賴庫的版本上,這裏都有展示所依賴的版本號,比較貼心
glib2 2.54.3
jansson 2.7
libnice 0.1.16.1
libsrtp libsrtp 1.5.4
libcurl 7.47.0
crypto OpenSSL 1.0.2g 1 Mar 2016

Plugins

所有開啓的插件
Name Author Description Version
JANUS VoiceMail plugin Meetecho s.r.l. This is a plugin implementing a very simple VoiceMail service for Janus, recording Opus streams. 0.0.7
JANUS AudioBridge plugin Meetecho s.r.l. This is a plugin implementing an audio conference bridge for Janus, mixing Opus streams. 0.0.10
JANUS EchoTest plugin Meetecho s.r.l. This is a trivial EchoTest plugin for Janus, just used to showcase the plugin interface. 0.0.7
JANUS Record&Play plugin Meetecho s.r.l. This is a trivial Record&Play plugin for Janus, to record WebRTC sessions and replay them. 0.0.4
JANUS TextRoom plugin Meetecho s.r.l. This is a plugin implementing a text-only room for Janus, using DataChannels. 0.0.2
JANUS VideoRoom plugin Meetecho s.r.l. This is a plugin implementing a videoconferencing SFU (Selective Forwarding Unit) for Janus, that is an audio/video router. 0.0.9
JANUS VideoCall plugin Meetecho s.r.l. This is a simple video call plugin for Janus, allowing two WebRTC peers to call each other through a server. 0.0.6
JANUS NoSIP plugin Meetecho s.r.l. This is a simple RTP bridging plugin that leaves signalling details (e.g., SIP) up to the application. 0.0.1
JANUS Streaming plugin Meetecho s.r.l. This is a streaming plugin for Janus, allowing WebRTC peers to watch/listen to pre-recorded files or media generated by an external source. 0.0.8
JANUS SIP plugin Meetecho s.r.l. This is a simple SIP plugin for Janus, allowing WebRTC peers to register at a SIP server and call SIP user agents through a Janus instance. 0.0.7

Transports
開啓的transport 方式
Name Author Description Version
JANUS REST (HTTP/HTTPS) transport plugin Meetecho s.r.l. This transport plugin adds REST (HTTP/HTTPS) support to the Janus API via libmicrohttpd. 0.0.2
JANUS WebSockets transport plugin Meetecho s.r.l. This transport plugin adds WebSockets support to the Janus API via libwebsockets. 0.0.1
Event handlers
開啓的事件,我沒有開啓暫不列出。


Settings


實時生效更改一些配置,這項比較有用 列出一些常用的更改選 項
session_timeout: 更改session超時時間
log_level: 日誌等級, 共8級, 選0到7即可,數字越高越詳細
0 no debuging
1 fatal error
2 non-fatal error
3 warning
4 informational message
5 verbose message
6 overly version message
7 debug message(includes .c filename ,function and line number)
log_timestamps: 日誌時間戳
locking_debug: 鎖debug 開關, 互斥鎖 鎖定/解決鎖定都 會打印一行
refcount_debug: 打開 引用器debug, 開啓時引用計數器增加/減少時都會在控制檯打印一行
libnice_debug: 打開 libnice debug日誌
Plugins
向插件改送消息, 沒用過, 這塊不怎麼清楚

Handles

這塊是在調試中最重要的一塊,後面我也跟據我的操作詳細的解說 , 這有3 塊內容
Sessions
點擊該按鈕會實時顯示當前所有的session
Handles
點擊該按鈕會實時顯示當前所有的handles
Handle Info
點擊該按鈕會實時顯示當前的handle的info信息

裏面有3個小選項
Autorefresh 自動更新
Prettify 顯示方式,json還是表格
Start capture 調用capture功能, 結合Wireshark使用

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章