【发布时间】:2018-01-31 03:08:44
【问题描述】:
设置正确的“TwilioAccountSID”、“TwilioAuthToken”和“TwilioNumber”后,网页显示“呼叫您时出现问题 - 请稍后重试。”我可以在其他应用程序中使用其他 Twilio 功能,但 ClickToCall 不起作用。它不会拨出任何一个号码。
示例项目: https://github.com/TwilioDevEd/clicktocall-csharp
Firefox 中的控制台登录:
不推荐使用 getPreventDefault()。使用 defaultPrevented 反而。 jquery-1.10.2.js:5375:28 XML 解析错误:没有根元素 发现地点: http://localhost:57471/01d55b0057f14d8aa4f39e67f234bae7/browserLinkSignalR/abort?transport=webSockets&connectionToken=AQAAANCMnd8BFdERjHoAwE%2FCl%2BsBAAAA9nnpT%2Bd2GEGGBvJN2iSr%2FAAAAAACAAAAAAAQZgAAAAEAACAAAAA5C0avgoOxzy0g8wtuZzNLaBQla80xMib%2FzC%2Ft9UuALwAAAAAOgAAAAAIAACAAAAAVgVKnWONXBwpQ%2FQynRYyeKOOZw8ZnvXuTf7SIoOTAGDAAAAD7kYmTiT%2FoNJJMIKh5KrXfhkyBndCsBDP4QnpepbcwWc6o30MXPHYCyAiJwt2Dy2pAAAAAQWB%2BSLeKghpSzeaKqUHL7LVhQ8%2FfLiCtjRL9V%2BL03xElOpifAfuaJ2NzMxckwj2z3BoQ%2BCb7lW9A6zBQMPSXGQ%3D%3D&requestUrl=http%3A%2F%2Flocalhost%3A1430%2F&browserName=Firefox&userAgent=Mozilla%2F5.0+(Windows+NT+10.0%3B+WOW64%3B+rv%3A54.0)+Gecko%2F20100101+Firefox%2F54.0 第 1 行,第 1 列:abort:1:1 POST XHR http://localhost:1430/CallCenter/Call [HTTP/1.1 500 内部服务器 错误 18ms] 标头 POST 响应调用堆栈 Cache-ControlprivateContent-Length12174Content-Typetext/html; charset=utf-8DateTue,2017 年 8 月 22 日 17:26:58 GMTServerMicrosoft-IIS / 10.0X-ASPNET-Version4.0.30319X供电-ByASP.NETX-SourceFiles =?UTF-8 2 B 4 QzpcVXNlcnNcUmhvZGVzXERvd25sb2Fkc1xjbGlja3RvY2FsbC1jc2hhcnAtbWFzdGVyICgxKVxjbGlja3RvY2FsbC1jc2hhcnAtbWFzdGVyXENsaWNrVG9DYWxsLldlYlxDYWxsQ2VudGVyXENhbGw =?= 接受应用程序/json,文本/javascript,/; q=0.01Accept-Encodinggzip, deflateAccept-Languageen-US,en;q=0.5Connectionkeep-aliveContent-Length52Content-Typeapplication/x-www-form-urlencoded; charset=UTF-8Hostlocalhost:1430Refererhttp://localhost:1430/User-AgentMozilla/5.0 (Windows NT 10.0; WOW64; rv:54.0) Gecko/20100101 Firefox/54.0X-Requested-WithXMLHttpRequest
换行符 67:
计算机日志:
Event code: 3005
Event message: An unhandled exception has occurred.
Event time: 8/24/2017 11:53:34 AM
Event time (UTC): 8/24/2017 3:53:34 PM
Event ID: 9b90d28d894f41a09a832ce672308828
Event sequence: 13
Event occurrence: 1
Event detail code: 0
Application information:
Application domain: /LM/W3SVC/2/ROOT-1-131480635887199949
Trust level: Full
Application Virtual Path: /
Application Path: C:\Users\Rhodes\Documents\Visual Studio 2017\Projects\clicktocall-csharp-master\ClickToCall.Web\
Machine name: DEV-103
Process information:
Process ID: 74140
Process name: iisexpress.exe
Account name: DEV-103\Rhodes
Exception information:
Exception type: NullReferenceException
Exception message: Object reference not set to an instance of an object.
at ClickToCall.Web.Controllers.CallCenterController.<>c__DisplayClass7_0.<IsProduction>b__0(String domain) in C:\Users\Rhodes\Documents\Visual Studio 2017\Projects\clicktocall-csharp-master\ClickToCall.Web\Controllers\CallCenterController.cs:line 68
at System.Linq.Enumerable.Any[TSource](IEnumerable`1 source, Func`2 predicate)
at ClickToCall.Web.Controllers.CallCenterController.IsProduction() in C:\Users\Rhodes\Documents\Visual Studio 2017\Projects\clicktocall-csharp-master\ClickToCall.Web\Controllers\CallCenterController.cs:line 68
at ClickToCall.Web.Controllers.CallCenterController.GetUri(String salesNumber) in C:\Users\Rhodes\Documents\Visual Studio 2017\Projects\clicktocall-csharp-master\ClickToCall.Web\Controllers\CallCenterController.cs:line 54
at ClickToCall.Web.Controllers.CallCenterController.<Call>d__5.MoveNext() in C:\Users\Rhodes\Documents\Visual Studio 2017\Projects\clicktocall-csharp-master\ClickToCall.Web\Controllers\CallCenterController.cs:line 46
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Web.Mvc.Async.TaskAsyncActionDescriptor.EndExecute(IAsyncResult asyncResult)
at System.Web.Mvc.Async.AsyncControllerActionInvoker.<>c__DisplayClass37.<BeginInvokeAsynchronousActionMethod>b__36(IAsyncResult asyncResult)
at System.Web.Mvc.Async.AsyncResultWrapper.WrappedAsyncResult`1.CallEndDelegate(IAsyncResult asyncResult)
at System.Web.Mvc.Async.AsyncResultWrapper.WrappedAsyncResultBase`1.End()
at System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeActionMethod(IAsyncResult asyncResult)
at System.Web.Mvc.Async.AsyncControllerActionInvoker.AsyncInvocationWithFilters.<InvokeActionMethodFilterAsynchronouslyRecursive>b__3d()
at System.Web.Mvc.Async.AsyncControllerActionInvoker.AsyncInvocationWithFilters.<>c__DisplayClass46.<InvokeActionMethodFilterAsynchronouslyRecursive>b__3f()
at System.Web.Mvc.Async.AsyncControllerActionInvoker.<>c__DisplayClass33.<BeginInvokeActionMethodWithFilters>b__32(IAsyncResult asyncResult)
at System.Web.Mvc.Async.AsyncResultWrapper.WrappedAsyncResult`1.CallEndDelegate(IAsyncResult asyncResult)
at System.Web.Mvc.Async.AsyncResultWrapper.WrappedAsyncResultBase`1.End()
at System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeActionMethodWithFilters(IAsyncResult asyncResult)
at System.Web.Mvc.Async.AsyncControllerActionInvoker.<>c__DisplayClass21.<>c__DisplayClass2b.<BeginInvokeAction>b__1c()
at System.Web.Mvc.Async.AsyncControllerActionInvoker.<>c__DisplayClass21.<BeginInvokeAction>b__1e(IAsyncResult asyncResult)
at System.Web.Mvc.Async.AsyncResultWrapper.WrappedAsyncResult`1.CallEndDelegate(IAsyncResult asyncResult)
at System.Web.Mvc.Async.AsyncResultWrapper.WrappedAsyncResultBase`1.End()
at System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeAction(IAsyncResult asyncResult)
at System.Web.Mvc.Controller.<BeginExecuteCore>b__1d(IAsyncResult asyncResult, ExecuteCoreState innerState)
at System.Web.Mvc.Async.AsyncResultWrapper.WrappedAsyncVoid`1.CallEndDelegate(IAsyncResult asyncResult)
at System.Web.Mvc.Async.AsyncResultWrapper.WrappedAsyncResultBase`1.End()
at System.Web.Mvc.Controller.EndExecuteCore(IAsyncResult asyncResult)
at System.Web.Mvc.Controller.<BeginExecute>b__15(IAsyncResult asyncResult, Controller controller)
at System.Web.Mvc.Async.AsyncResultWrapper.WrappedAsyncVoid`1.CallEndDelegate(IAsyncResult asyncResult)
at System.Web.Mvc.Async.AsyncResultWrapper.WrappedAsyncResultBase`1.End()
at System.Web.Mvc.Controller.EndExecute(IAsyncResult asyncResult)
at System.Web.Mvc.Controller.System.Web.Mvc.Async.IAsyncController.EndExecute(IAsyncResult asyncResult)
at System.Web.Mvc.MvcHandler.<BeginProcessRequest>b__5(IAsyncResult asyncResult, ProcessRequestState innerState)
at System.Web.Mvc.Async.AsyncResultWrapper.WrappedAsyncVoid`1.CallEndDelegate(IAsyncResult asyncResult)
at System.Web.Mvc.Async.AsyncResultWrapper.WrappedAsyncResultBase`1.End()
at System.Web.Mvc.MvcHandler.EndProcessRequest(IAsyncResult asyncResult)
at System.Web.Mvc.MvcHandler.System.Web.IHttpAsyncHandler.EndProcessRequest(IAsyncResult result)
at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)
Request information:
Request URL: http://localhost:1430/CallCenter/Call
Request path: /CallCenter/Call
User host address: ::1
User:
Is authenticated: False
Authentication Type:
Thread account name: DEV-103\Rhodes
Thread information:
Thread ID: 8
Thread account name: DEV-103\Rhodes
Is impersonating: False
Stack trace: at ClickToCall.Web.Controllers.CallCenterController.<>c__DisplayClass7_0.<IsProduction>b__0(String domain) in C:\Users\Rhodes\Documents\Visual Studio 2017\Projects\clicktocall-csharp-master\ClickToCall.Web\Controllers\CallCenterController.cs:line 68
at System.Linq.Enumerable.Any[TSource](IEnumerable`1 source, Func`2 predicate)
at ClickToCall.Web.Controllers.CallCenterController.IsProduction() in C:\Users\Rhodes\Documents\Visual Studio 2017\Projects\clicktocall-csharp-master\ClickToCall.Web\Controllers\CallCenterController.cs:line 68
at ClickToCall.Web.Controllers.CallCenterController.GetUri(String salesNumber) in C:\Users\Rhodes\Documents\Visual Studio 2017\Projects\clicktocall-csharp-master\ClickToCall.Web\Controllers\CallCenterController.cs:line 54
at ClickToCall.Web.Controllers.CallCenterController.<Call>d__5.MoveNext() in C:\Users\Rhodes\Documents\Visual Studio 2017\Projects\clicktocall-csharp-master\ClickToCall.Web\Controllers\CallCenterController.cs:line 46
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at System.Web.Mvc.Async.TaskAsyncActionDescriptor.EndExecute(IAsyncResult asyncResult)
at System.Web.Mvc.Async.AsyncControllerActionInvoker.<>c__DisplayClass37.<BeginInvokeAsynchronousActionMethod>b__36(IAsyncResult asyncResult)
at System.Web.Mvc.Async.AsyncResultWrapper.WrappedAsyncResult`1.CallEndDelegate(IAsyncResult asyncResult)
at System.Web.Mvc.Async.AsyncResultWrapper.WrappedAsyncResultBase`1.End()
at System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeActionMethod(IAsyncResult asyncResult)
at System.Web.Mvc.Async.AsyncControllerActionInvoker.AsyncInvocationWithFilters.<InvokeActionMethodFilterAsynchronouslyRecursive>b__3d()
at System.Web.Mvc.Async.AsyncControllerActionInvoker.AsyncInvocationWithFilters.<>c__DisplayClass46.<InvokeActionMethodFilterAsynchronouslyRecursive>b__3f()
at System.Web.Mvc.Async.AsyncControllerActionInvoker.<>c__DisplayClass33.<BeginInvokeActionMethodWithFilters>b__32(IAsyncResult asyncResult)
at System.Web.Mvc.Async.AsyncResultWrapper.WrappedAsyncResult`1.CallEndDelegate(IAsyncResult asyncResult)
at System.Web.Mvc.Async.AsyncResultWrapper.WrappedAsyncResultBase`1.End()
at System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeActionMethodWithFilters(IAsyncResult asyncResult)
at System.Web.Mvc.Async.AsyncControllerActionInvoker.<>c__DisplayClass21.<>c__DisplayClass2b.<BeginInvokeAction>b__1c()
at System.Web.Mvc.Async.AsyncControllerActionInvoker.<>c__DisplayClass21.<BeginInvokeAction>b__1e(IAsyncResult asyncResult)
at System.Web.Mvc.Async.AsyncResultWrapper.WrappedAsyncResult`1.CallEndDelegate(IAsyncResult asyncResult)
at System.Web.Mvc.Async.AsyncResultWrapper.WrappedAsyncResultBase`1.End()
at System.Web.Mvc.Async.AsyncControllerActionInvoker.EndInvokeAction(IAsyncResult asyncResult)
at System.Web.Mvc.Controller.<BeginExecuteCore>b__1d(IAsyncResult asyncResult, ExecuteCoreState innerState)
at System.Web.Mvc.Async.AsyncResultWrapper.WrappedAsyncVoid`1.CallEndDelegate(IAsyncResult asyncResult)
at System.Web.Mvc.Async.AsyncResultWrapper.WrappedAsyncResultBase`1.End()
at System.Web.Mvc.Controller.EndExecuteCore(IAsyncResult asyncResult)
at System.Web.Mvc.Controller.<BeginExecute>b__15(IAsyncResult asyncResult, Controller controller)
at System.Web.Mvc.Async.AsyncResultWrapper.WrappedAsyncVoid`1.CallEndDelegate(IAsyncResult asyncResult)
at System.Web.Mvc.Async.AsyncResultWrapper.WrappedAsyncResultBase`1.End()
at System.Web.Mvc.Controller.EndExecute(IAsyncResult asyncResult)
at System.Web.Mvc.Controller.System.Web.Mvc.Async.IAsyncController.EndExecute(IAsyncResult asyncResult)
at System.Web.Mvc.MvcHandler.<BeginProcessRequest>b__5(IAsyncResult asyncResult, ProcessRequestState innerState)
at System.Web.Mvc.Async.AsyncResultWrapper.WrappedAsyncVoid`1.CallEndDelegate(IAsyncResult asyncResult)
at System.Web.Mvc.Async.AsyncResultWrapper.WrappedAsyncResultBase`1.End()
at System.Web.Mvc.MvcHandler.EndProcessRequest(IAsyncResult asyncResult)
at System.Web.Mvc.MvcHandler.System.Web.IHttpAsyncHandler.EndProcessRequest(IAsyncResult result)
at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)
Ngrok 隧道运行:
【问题讨论】:
-
您是否在服务器上获得任何有关此错误的日志?在这种情况下,很可能是导致问题的服务器。
-
在采用代码并将其部署到服务器之前,我在我的机器上本地运行它。我已经就他们的演示项目联系了 Twilio,但无济于事。我跟着他们的指南去了一个“T”。在我们代码的其他部分,我使用相同的令牌和电话号码拨打电话和短信没有问题。
-
我为 Twilio 工作,并希望为您解决此问题。如果你在本地运行,你能看到服务器日志吗?如果是这样,您能否在遇到错误时使用服务器日志示例更新您的问题?
-
我已经添加了从今天开始的日志,当我再次遇到错误时。
-
好吧,先说一句,我不是 C# 开发人员,也没有开发环境。但是,该错误表明问题出在line 68 of the CallCenterController。您可以在那时进行调试并尝试找出
origin的设置吗?也许你没有从标题中得到任何东西。