录音启动录制失败, 返回110错误

调用createChannel方法,回调方法返回:RecordingSDK onError,error:110,stat code:1

@Override
public void onError(int error, int stat_code) {
      log.error("RecordingSDK onError,error:" + error + ",stat code:" + stat_code);
}

查看错误代码解释:
110 :生成的 Token 无效,一般有以下原因:

  • 用户在 Dashboard 上启用了 App Certificate,但仍旧在代码里仅使用了 App ID。当启用了 App Certificate,必须使用 Token
  • 字段 uid为生成 Token 的必须字段,用户在调用 joinChannel 加入频道时必须设置相同的 uid

录制的uid代码里固定用“0”

查看Recording.log提示一下日志:

INFO    (13:40:44:678 |    0)  13819; [vos] selected: 103.246.11.19:4006
ERROR   (13:40:44:678 |    0)  13819; [ch0] login strategy=2
INFO    (13:40:44:678 |    0)  13819; [ds]: ver 1 ds '{"streamType":0,"clientRole":2}'
INFO    (13:40:44:678 |    0)  13819; [ch0] Login VOS (proto:10, cid:3048501016, uid:1151070534, ts:1558330844678, ticket size:80 ds:1 stream:-A-V) 2: 103.246.11.19:4006
INFO    (13:40:44:679 |    1)  13819; add ping address 175.155.75.194
INFO    (13:40:44:679 |    0)  13819; PING 175.155.75.194:0 16(44) bytes of data
INFO    (13:40:44:700 |   21)  13819; [ap/u] **responsed from 220.194.237.6:8000, STUN(2).
INFO    (13:40:44:701 |    1)  13819; [ap/u] **responsed from 223.111.250.6:8000, STUN(2).
INFO    (13:40:44:735 |   34)  13819; [ap/u] **responsed from 42.202.132.197:8000, STUN(2).
INFO    (13:40:44:764 |   29)  13819; [ch0] **VOS response to login request (res 0 elapsed 251, server ts 1558330844753, s-c:-11) from 103.246.11.19:4006, and current dest server 103.246.11.19:4006
INFO    (13:40:44:764 |    0)  13819; [vocs] selected: 118.190.148.38:8000
INFO    (13:40:44:764 |    0)  13819; [vocs] login with multi ip {"vocs_ip":["175.155.75.194"],"vos_ip":["222.213.85.63"]}
INFO    (13:40:44:764 |    0)  13819; [vocs] report bitrate: a/v/t: 50/1000/1050
INFO    (13:40:44:764 |    0)  13819; [vocs] creating channel with 118.190.148.38:8000, ts 1558330844764.......
INFO    (13:40:44:764 |    0)  13819; [vocs] selected: 120.132.29.28:8000
INFO    (13:40:44:764 |    0)  13819; [vocs] login with multi ip {"vocs_ip":["175.155.75.194"],"vos_ip":["222.213.85.63"]}
INFO    (13:40:44:764 |    0)  13819; [vocs] report bitrate: a/v/t: 50/1000/1050
INFO    (13:40:44:764 |    0)  13819; [vocs] creating channel with 120.132.29.28:8000, ts 1558330844764.......
INFO    (13:40:44:765 |    1)  13819; [vocs] selected: 54.223.118.211:8000
INFO    (13:40:44:765 |    0)  13819; [vocs] login with multi ip {"vocs_ip":["175.155.75.194"],"vos_ip":["222.213.85.63"]}
INFO    (13:40:44:765 |    0)  13819; [vocs] report bitrate: a/v/t: 50/1000/1050
INFO    (13:40:44:765 |    0)  13819; [vocs] creating channel with 54.223.118.211:8000, ts 1558330844765.......
ERROR   (13:40:44:825 |   60)  13819; [vocs/u] responsed from 118.190.148.38:8000 with error: 9, elapsed: 312, server ts: 1558330844799. connection aborted
INFO    (13:40:44:825 |    0)  13819; [vocs] 118.190.148.38:8000 is reported failure, and will be disabled for 4000 ms
INFO    (13:40:44:825 |    0)  13820; Error in mediasdk: 110, (null)
INFO    (13:40:44:827 |    2)  13810; event_loop Required to stop :0
INFO    (13:40:44:827 |    0)  13810; event_loop Required to stop :0

1、首先看下 Dashboard 上有没有开启 APP 证书?
2、若没有开,看下你传的 Appid 是否正确?
3、若开了,那么你是怎么计算 token 的?有没有算对?