【发布时间】:2018-11-13 16:19:24
【问题描述】:
我在启用 'RecordParticipantsOnConnect' 时遇到问题,如下所述:https://www.twilio.com/docs/video/api/recordings-resource 在我的 twilio 实现中,但我似乎无法让它工作,我在哪里将 RecordParticipantsOnConnect 设置为 true?
他们说你在创建房间时需要传递这个选项,但我没有创建任何房间,它是自动完成的,我只是将房间名称作为字符串传递,我得到了令牌:
class TwilioServices
ACCOUNT_SID = ENV['TWILIO_ACCOUNT_SID']
API_KEY_SID = ENV['TWILIO_API_KEY_SID']
API_KEY_SECRET = ENV['TWILIO_API_KEY_SECRET']
def self.get_token(type, room)
# Create an Access Token
token = Twilio::JWT::AccessToken.new ACCOUNT_SID, API_KEY_SID, API_KEY_SECRET, ttl: 7200, identity: type,
# Grant access to Video
grant = Twilio::JWT::AccessToken::VideoGrant.new
grant.room = room
token.add_grant grant
# Serialize the token as a JWT
token.to_jwt
end
end
我该如何解决?
【问题讨论】:
标签: ruby-on-rails twilio twilio-api