用 C# 打电话
我需要一个相对便宜的解决方案来从 .net 平台(特别是 C#)拨打电话。它必须能够拨打一个号码并确定线路是否已断开、是否有人接听以及是否有人接听可能会播放一条消息。感谢您提供任何信息。
I need a relatively inexpensive solution to make phone calls from the .net platform (C# in particular). it has to be able to dial a number and determine if the line is disconnected, if someone answered, and if someone answer possibly play a message. Thanks for any info.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

发布评论
评论(4)
懵少女2024-11-02 19:52:30
根据您手头拥有的资源、您需要使用它的目的、您拥有的预算类型,有很多不同的选择。有些会按每次调用向您收费,有些则让您在内部运行它,您只需支付前期硬件成本和支持费用。
正如 Tai Squared 所说,Twilio 是一个可靠的答案。我还知道思科有一些自动拨号器选项。
电话树也是我过去使用过的另一种方法,尽管与它们的集成可能很复杂。 http://www.phonetree.com/
祝你好运。
你怎么这么可爱啊2024-11-02 19:52:30
下面的代码在我工作的公司工作了一段时间。但是,最近 TAPI 无法初始化,因为我们的电话系统进行了一些重大更改,但到目前为止我还不知道更改了什么。
公共类MakeACall
Private m_tobj As TAPIClass
Private m_array_ITAdresses(10) As ITAddress
Private m_bcc As ITBasicCallControl
Public Sub New()
initializetapi3()
End Sub
Dim m_nIPPHONEline As Integer
Dim m_nGetIPPhoneLineNumber As Integer
Public Sub initializetapi3()
Try
For Each ob1 As ITAddress In m_array_ITAdresses
Next
m_tobj = New TAPIClass()
m_tobj.Initialize()
Dim ea As IEnumAddress = m_tobj.EnumerateAddresses()
Dim ln As ITAddress
Dim arg3 As UInteger = 0
m_nGetIPPhoneLineNumber = -1 'Must initialze to -1 because the phone lines start counting from zero.
m_nIPPHONEline = -1
'm_tobj.EventFilter = DirectCast(TAPI_EVENT.TE_CALLNOTIFICATION | TAPI_EVENT.TE_DIGITEVENT |TAPI_EVENT.TE_PHONEEVENT |TAPI_EVENT.TE_CALLSTATE |TAPI_EVENT.TE_GENERATEEVENT |TAPI_EVENT.TE_GATHERDIGITS | TAPI_EVENT.TE_REQUEST, integer)
For i As Integer = 0 To 10
ea.Next(1, ln, arg3)
m_array_ITAdresses(i) = ln
If (ln Is Nothing) = False Then
m_nGetIPPhoneLineNumber += 1
If m_array_ITAdresses(i).AddressName.ToUpper().IndexOf("IP PHONE") > -1 Then
m_nIPPHONEline = m_nGetIPPhoneLineNumber
End If
End If
Next
Catch ex As Exception
End Try
End Sub
Public Sub MakeCall(ByVal stPhoneNumber As String)
If stPhoneNumber.Length > 6 Then
Try
m_bcc = m_array_ITAdresses(m_nIPPHONEline).CreateCall(stPhoneNumber, TapiConstants.LINEADDRESSTYPE_IPADDRESS, TapiConstants.TAPIMEDIATYPE_AUDIO)
m_bcc.Connect(False)
Catch ex As Exception
MessageBox.Show("Failed to create call.")
End Try
End If
m_tobj.Shutdown()
End Sub
结束类
~没有更多了~
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
您可以使用 Twilio 拨打电话。他们有一个REST API,您可以从您的应用程序调用。请查看拨打电话部分。
我与 Twilio 没有任何关系 - 它只是我使用的一项有用的服务。
You can use Twilio to make outgoing calls. They have a REST API you can call from your application. Check out the Making Calls section.
I'm not associated with Twilio - it's just a useful service I use.