用 C# 打电话

发布于 2024-10-26 19:52:30 字数 100 浏览 6 评论 0原文

我需要一个相对便宜的解决方案来从 .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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

情魔剑神 2024-11-02 19:52:30

您可以使用 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.

懵少女 2024-11-02 19:52:30

根据您手头拥有的资源、您需要使用它的目的、您拥有的预算类型,有很多不同的选择。有些会按每次调用向您收费,有些则让您在内部运行它,您只需支付前期硬件成本和支持费用。

正如 Tai Squared 所说,Twilio 是一个可靠的答案。我还知道思科有一些自动拨号器选项。

电话树也是我过去使用过的另一种方法,尽管与它们的集成可能很复杂。 http://www.phonetree.com/

祝你好运。

Depending on what resources you have on hand, what you need to use it for, what type of budget you have, there are a bunch of different options. Some will charge you on a per call basis, some let you set something up where you run it in house and you just pay for up front hardware costs and support.

As Tai Squared stated, Twilio is a solid answer. I also know that Cisco has some automated dialer options.

Phone tree is also another that I have used in the past, though integration with them can be hairy. http://www.phonetree.com/

Good luck.

夏有森光若流苏 2024-11-02 19:52:30

另一个解决方案是 http://wwww.talksoftonline.com - 它与大多数调度系统集成,允许导出文件。

Another solution is http://wwww.talksoftonline.com - which integrates with most scheduling systems which allow an export of a file.

你怎么这么可爱啊 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

结束类

The below code was working for a while at the company I work for. But, recently TAPI is unable to initialize because some significant changes were made to our phone system, of which I don't know what was changed, as of yet.

Public Class 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

End Class

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文