server.py 文件源码

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

项目:audiosocket-demo 作者: nexmo-community 项目源码 文件源码
def connect_vapi(self):
        logging.info("Instructing VAPI to connect")
        response = client.create_call({'to': [{
                "type": "websocket",
                "uri": "ws://{host}/socket".format(host=CONFIG.host),
                "content-type": "audio/l16;rate=16000",
                "headers": {
                    "app": "audiosocket"
                }
            }],
            'from': {'type': 'phone', 'number': CONFIG.phone_number},
            'answer_url': ['https://{host}/ncco'.format(host=CONFIG.host)]})
        logging.debug(repr(response))
        self.vapi_connected = True
        return True
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号