呼出验证在给定超时时间内不成功

时间:2019-02-13 11:41:57

标签: ios swift sinch sinch-verification

我正在使用Sinch API提供程序实现从应用程序到电话号码的呼叫。因此,当我打电话给用户时,出现如下错误:

标注更改无法在超时时间内成功

我也得到了这种回应:

2019-02-13 17:01:55.638874+0530 SinchCalloutVerification[3108:669813] Wed Feb 13 17:01:55 2019 | state: Polling {
    RUID = 237614012;
    "sinch_env" = "api.sinch.com";
}
2019-02-13 17:01:55.641445+0530 SinchCalloutVerification[3108:669764] Wed Feb 13 17:01:55 2019 | -[SINVerification initiateWithCompletionHandler:] success: NO, contentLanguage: , error: Error Domain=SINVerificationErrorDomain Code=4 "Callout verification not successful within given timeout" UserInfo={NSLocalizedDescription=Callout verification not successful within given timeout} {
    RUID = 237614012;
    "sinch_env" = "api.sinch.com";
}
2019-02-13 17:01:52.588471+0530 SinchCalloutVerification[3108:669813] Wed Feb 13 17:01:52 2019 | HTTP request (ID=19) response body: {"id":"237614012","method":"callout","status":"DENIED","reason":"Blocked","reference":"A:8fb362fe-edad-425f-9a13-f52a7a8ab07d_VT7zRZ6U0kapF2CmPetWrQ"} {
    RUID = 237614012;
    "sinch_env" = "api.sinch.com";
}

所以我不确定为什么会出现此错误,如果有人有主意,请帮助我。

1 个答案:

答案 0 :(得分:0)

增加通话超时。 该请求需要花费时间才能执行,并且您的请求在请求完成之前会超时。 如果您使用的是NSURLSessions,则这是代码。

let sessionConfig = URLSessionConfiguration.default
sessionConfig.timeoutIntervalForRequest = 40.0
sessionConfig.timeoutIntervalForResource = 60.0
let session = URLSession(configuration: sessionConfig)