从状态回调中仅获取错误条件

Getting only error conditions from status callback

我在调用时使用了状态回调,它运行良好,但我只想获得 "error" 条件,例如 busyfailed 无应答已取消。如果我仅指定 completed 作为我的 StatusCallbackEvent,我可以获得这些,但我也不想接收 completed 事件。我传递什么只得到错误?

我正在使用 Python 6.x 帮助程序库。

这里是 Twilio 开发人员布道者。

来自the documentation on making calls and status callbacks

The completed event is fired when the call is completed, regardless of the termination status: busy, canceled, completed, failed, or no-answer. If no StatusCallbackEvent is specified, completed will be fired by default.

在获取通话结束的状态回调时,无法不收到completed事件。我建议在您收到此回调的应用程序中尽早检查参数,如果您不想处理它,请尽早 return。