alexaActions.py 文件源码

python
阅读 16 收藏 0 点赞 0 评论 0

项目:alexa-spark 作者: ismailakkila 项目源码 文件源码
def startJoinMeetingAction(startJoinRoomIdVal):
    getRoomDetailsResponse = sparkApi.get('rooms', {'roomId': startJoinRoomIdVal, 'showSipAddress': 'true'})
    if getRoomDetailsResponse != 'Error':
        roomSipVal = getRoomDetailsResponse['sipAddress']
        try:
            client = TwilioRestClient(main.twilio_AccountSid, main.twilio_AuthToken)
            call = client.calls.create(url=main.twilioXmlPath + '/' + roomSipVal, to=main.cellPhoneE164, from_=main.twilioNumber)
            callStatus = client.calls.get(call.sid).status
            if callStatus != 'failed':
                speechOutput = "Calling your cellphone now"
            else:
                speechOutput = "There is a problem connecting you to the Spark room. Please try again in a few minutes."
        except TwilioRestException as e:
            speechOutput = "There is a problem connecting to Twilio. Please try again in a few minutes."

    else:
        speechOutput = "There is a problem connecting to Cisco Spark. Please try again in a few minutes."
    return speechOutput
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号