我一直在使用C#构建一个使用Asterisk.NET与星号接口的窗口桌面应用程序,我的第一个问题是接住一个来电并将它传输到特定的exten。我的第一个想法是使用OriginateAction,当调用来时,我使用拨号事件并捕捉它,并使用OriginateAction调用特定的exten。
RedirectAction originateAction = new RedirectAction();
originateAction.Channel = e.Channel;
originateAction.Context = "default";
originateAction.Exten = "203";
originateAction.Priority = 1;
ManagerResponse originateResponse = manager.SendAction(originateAction);
Console.WriteLine(originateResponse);但这不像我的愿望。我的第二个想法是使用RedirectAction:
RedirectAction originateAction = new RedirectAction();
originateAction.Channel = e.Channel;
originateAction.Context = "default";
originateAction.Exten = "203";
originateAction.Priority = 1;
ManagerResponse originateResponse = manager.SendAction(originateAction);
Console.WriteLine(originateResponse);但不起作用。
我在很多网站上都找到了,但是文件很少。
我怎样才能解决这个问题?
谢谢!
发布于 2015-07-18 05:07:50
我建议使用某种动态的拨号计划,而不是被动地“捕捉”电话。为什么不使用AGI脚本呢?
本质上,您的应用程序告诉数据库或其他中央系统在调用匹配某些条件时应该做什么。然后,星号运行当调用到达特定上下文(例如所有传入呼叫)时设置的脚本,然后脚本根据应用程序提供的输入动态地路由调用。
由于您似乎喜欢.NET,这里有一个.NET AGI项目来帮助您入门:AsterNET。看起来,您提到的库Asterisk.NET也能够实现快速CGI ( AGI使用的功能),但上一次发布是在2009年,而AsterNet在3个月前还在运行。
我个人使用phpAGI在我们的呼叫中心做各种整洁的ACD和呼叫路由的事情。
有关AGI的更多信息,请参见官方文件。
编辑:,我可能还应该解释一些基本的调用流术语(从文档中):
您能显示您的事件处理程序代码吗?看上去那个图书馆会说些类似manager.NewChannel += new ManagerEventHandler(new_channel);的话
https://stackoverflow.com/questions/31487810
复制相似问题