亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? dtmf.vb

?? 一個完整的VB.NET tapi3.0 程序
?? VB
?? 第 1 頁 / 共 4 頁
字號:
Option Strict Off
Option Explicit On
Friend Class frmDTMF
	Inherits System.Windows.Forms.Form
	'--------------------------------------------------------------------------
	'
	'  Copyright (C) 1997-1999 Microsoft Corporation. All rights reserved.
    '
    '  Adapted by Matthias Moetje (www.terasens.com) for JulMar.ITapi3 library
    '
    '--------------------------------------------------------------------------
	'
	' DTMF = makes Tapi3 outgoing asynchronous call, on which DTMF tones can be generated.
	'
	' This app needs a voice modem to be in the system, because
	' this can generate/detect DTMF tones.
	' Alternatively, the H323 (IP telephony) line exposed by the H323 provider
	' offers DTMF functionality as well.
	' It allows the user to make an outgoing call.
	' On the call, it selects the default terminals for audio+capture and audio+render
	' if it finds any such terminals, and also if the user choses to select them.
	' On the call, it allows the user to generate/detect digits - the user can
	' do that by pressing the corresponding buttons from the form.
	'
	
	
	'
	'user defined types
	'
	
	Enum TestError
		'TErr_NotInitialized = 0
		TErr_Ok = 1
		TErr_Fail = 2
	End Enum
	
	'
	'Constants defined by tapi.h (tapi2.x), tapi3err.h (tapi3.0) or winerror.h
	'for error codes:
	'
	'Note: all tapi constants are defined as VB constants in the file "tapi.txt", which
	'you can find in the subdirectory ..\include that comes with the TAPI3 VB samples.
	'If you use VB6.0, you can open the file tapi.txt using VB's tool "API Text Viewer";
	'then you can use this tool to copy/paste constants in your code.
	'
	
	'tapi3err.h constants
	Const LINEGENERATETERM_DONE As Short = &H1s
	Const LINEGENERATETERM_CANCEL As Short = &H2s
	
	'other constants
	Const NO_ERROR As Short = 0 'Err.Number = 0 when there is no error

	'
	'global variables
	'
	
	'TAPI objects
	Private mbInitialized As Boolean

	'current address + related info
    Private mobjOrigAddress As JulMar.Tapi3.TAddress

	Private mnPreviousAddressIndex As Integer
    Private mvarArrAudioTerminals As Object

    'current call
    Private mobjCall As JulMar.Tapi3.TCall

	
	Private Sub frmDTMF_Load(ByVal eventSender As System.Object, ByVal eventArgs As System.EventArgs) Handles MyBase.Load


		'initialize UI
		pbDial.Enabled = True
		pbDisconnect.Enabled = False
		pbRelease.Enabled = False
		
		pbGenerate.Enabled = False
		pbStartDetect.Enabled = False
		pbStopDetect.Enabled = False
		
		'initialize Tapi
		InitializeTapiObjects()
		
		'populate combo with all addresses , regardless
		'of their possibility to support the Digit Terminal class
        Call PopulateAddressesCombo(mobjTapi, False)

        'Populate Address Type Combo
        Dim i As Long = cmbAddressType.Items.Add("Phone Number")
        VB6.SetItemData(cmbAddressType, i, JulMar.Tapi3.LINEADDRESSTYPES.PhoneNumber)
        i = cmbAddressType.Items.Add("Domain Name")
        VB6.SetItemData(cmbAddressType, i, JulMar.Tapi3.LINEADDRESSTYPES.DomainName)
        i = cmbAddressType.Items.Add("EMail Address")
        VB6.SetItemData(cmbAddressType, i, JulMar.Tapi3.LINEADDRESSTYPES.EmailName)
        i = cmbAddressType.Items.Add("IP Address")
        VB6.SetItemData(cmbAddressType, i, JulMar.Tapi3.LINEADDRESSTYPES.IPAddress)

        cmbAddressType.SelectedIndex = 0


	End Sub
	
	Private Sub frmDTMF_FormClosed(ByVal eventSender As System.Object, ByVal eventArgs As System.Windows.Forms.FormClosedEventArgs) Handles Me.FormClosed
		'release all member data "object" variables
		Call ReleaseAllMembers()
		
		'release combo with addresses
		Call DepopulateAddressesCombo()
	End Sub
	
	'
	'This function is called only once, when the form is loaded.
	'
	'This function populates the combobox with the names of the addresses,
	'and memorize also in the "data" field the index of each address
	'that corresponds to the collection of addresses from objTapi.
	'Then it selects the 1st item in the combo.
	'
	'If bMustSupportDTMF is set on True, only addresses that have
	'the DTMF functionality are put in combo.
	'
	'Note: we use On Erorr Resume Next, because we want to add as many items as possible
	'
	Sub PopulateAddressesCombo(ByRef objTapi As JulMar.Tapi3.TTapi, ByRef bMustSupportDTMF As Boolean)
        On Error Resume Next 'this will catch errors

        Dim nResult As Integer
        Dim nIterator, nCount As Integer
        Dim collobjAddresses() As JulMar.Tapi3.TAddress
        Dim objCrtAddress As JulMar.Tapi3.TAddress

        'don't need to clean combo of previous contents,
        'because this function is called only once
        'cmbAddresses.Clear

        collobjAddresses = objTapi.Addresses
        nResult = PrintT3Result("PopulateAddressesCombo: objTapi.Addresses")

        If nResult = NO_ERROR Then
            'populate combobox with names of all addresses from collobjAddresses
            'attach to each combo item the index of the corresponding address
            nCount = 0
            nCount = collobjAddresses.Length

            For nIterator = 0 To nCount - 1

                objCrtAddress = collobjAddresses(nIterator)

                nResult = PrintT3Result("PopulateAddressesCombo: enumerate addresses")

                If nResult = NO_ERROR Then

                    If (bMustSupportDTMF = False Or bMustSupportDTMF And SupportDTMF(objCrtAddress)) Then

                        Dim NewIndex As Integer = cmbAddresses.Items.Add((objCrtAddress.AddressName))

                        nResult = PrintT3Result("PopulateAddressesCombo: adding addresses in combo")

                        If nResult = NO_ERROR Then
                            VB6.SetItemData(cmbAddresses, NewIndex, nIterator)
                        End If

                    End If
                End If

            Next nIterator
        End If


        ''set selection on 1st item
        'If cmbAddresses.Items.Count > 0 Then
        '    cmbAddresses.SelectedIndex = 0
        '    'This automatically called cmbAddresses_Click
        'End If

    End Sub
	
	Sub DepopulateAddressesCombo()
		cmbAddresses.Items.Clear()
	End Sub
	
    Private Sub cmbAddresses_TextChanged(ByVal eventSender As System.Object, ByVal eventArgs As System.EventArgs) Handles cmbAddresses.TextChanged
        Call ChangeAddress()
    End Sub
	
    Private Sub cmbAddresses_SelectedIndexChanged(ByVal eventSender As System.Object, ByVal eventArgs As System.EventArgs) Handles cmbAddresses.SelectedIndexChanged
        Call ChangeAddress()
    End Sub
	
	Private Sub ChangeAddress()
		On Error Resume Next 'this will catch errors
		
		Dim nResult As Integer
		Dim nOrigAddressIndex As Integer
		
		'pick up the collection of Address objects
        Dim objCollAddresses() As JulMar.Tapi3.TAddress

		
        objCollAddresses = mobjTapi.Addresses
		nResult = PrintT3Result("ChangeAddress: mobjTapi.Addresses")
		If nResult <> NO_ERROR Then
			Call MsgBox("Fatal error: can't get TAPI addresses, exit program", MsgBoxStyle.Critical)
			Stop 'fatal error
		End If
		
		'find index of address selected by the user
		nOrigAddressIndex = FindOriginationAddressIndex()
		
		'
		'pick up the new address - update all related global variables
		'
		
		If mnPreviousAddressIndex <> nOrigAddressIndex Then
			'If a new address was selected, release the previous one
			'and save a "pointer" to the new one, plus related info
			'If the same address was selected, don't release/save it again,
			'just keep the previous one + its related info.
			
			'
			'clean up previous info
			'
			
            'release old terminals
			Call ReleaseAudioTerminals(mvarArrAudioTerminals)
			
			'wipe out other info
			mnPreviousAddressIndex = 0
			
			'
			'save new info
			'
			
			'validate new index
            If nOrigAddressIndex >= objCollAddresses.GetLowerBound(0) And nOrigAddressIndex <= objCollAddresses.GetUpperBound(0) Then

                'save new address
                mobjOrigAddress = objCollAddresses(nOrigAddressIndex)

                'save also the new index
                mnPreviousAddressIndex = nOrigAddressIndex

                'create new terminals
                Call GetAudioTerminals(mobjOrigAddress, mvarArrAudioTerminals)

            End If
			
		End If
		
		'release objects that are not needed anymore
		'(this decrements the reference count)
    End Sub
	
    Function SupportDTMF(ByRef objAddress As JulMar.Tapi3.TAddress) As Boolean
        On Error Resume Next 'this will catch errors

        Dim nResult, nResult1 As Integer

        Dim lGenerateDigitSupport, lMonitorDigitSupport As Integer

        'prepare return value
        SupportDTMF = False

        nResult = PrintT3Result("SupportDTMF: objAddress->Query (ITAddressCapabilities)")

        If nResult = NO_ERROR Then

            lGenerateDigitSupport = objAddress.AddressCapability(JulMar.Tapi3.ADDRESS_CAPABILITY.AC_GENERATEDIGITSUPPORT)
            nResult = PrintT3Result("SupportDTMF: AddressCapability(AC_GENERATEDIGITSUPPORT)")
            nResult1 = nResult
            lMonitorDigitSupport = objAddress.AddressCapability(JulMar.Tapi3.ADDRESS_CAPABILITY.AC_MONITORDIGITSUPPORT)
            nResult = PrintT3Result("SupportDTMF: AddressCapability(AC_MONITORDIGITSUPPORT)")

            If nResult = NO_ERROR And nResult1 = NO_ERROR Then

                If lGenerateDigitSupport <> 0 And lMonitorDigitSupport <> 0 Then
                    SupportDTMF = True
                End If

            End If

        End If


    End Function
	
    Private Sub PrintCallState(ByRef State As JulMar.Tapi3.CALL_STATE)
        Dim strMsg As String

        Select Case State
            Case JulMar.Tapi3.CALL_STATE.CS_CONNECTED
                txtStatus.Text = txtStatus.Text & Chr(13) & Chr(10)
                txtStatus.Text = txtStatus.Text & "call state: CS_CONNECTED"
            Case JulMar.Tapi3.CALL_STATE.CS_DISCONNECTED
                strMsg = "call state: CS_DISCONNECTED" & Chr(13) & Chr(10)
                strMsg = strMsg & "Call was disconnected. "
                strMsg = strMsg & "Now you should Release it. "
                strMsg = strMsg & "Then you can press Dial again or just quit."
                txtStatus.Text = txtStatus.Text & Chr(13) & Chr(10)
                txtStatus.Text = txtStatus.Text & strMsg
            Case JulMar.Tapi3.CALL_STATE.CS_HOLD
                txtStatus.Text = txtStatus.Text & Chr(13) & Chr(10)
                txtStatus.Text = txtStatus.Text & "call state: CS_HOLD"
            Case JulMar.Tapi3.CALL_STATE.CS_IDLE
                txtStatus.Text = txtStatus.Text & Chr(13) & Chr(10)
                txtStatus.Text = txtStatus.Text & "call state: CS_IDLE"
            Case JulMar.Tapi3.CALL_STATE.CS_INPROGRESS
                txtStatus.Text = txtStatus.Text & Chr(13) & Chr(10)
                txtStatus.Text = txtStatus.Text & "call state: CS_INPROGRESS"
            Case JulMar.Tapi3.CALL_STATE.CS_OFFERING
                txtStatus.Text = txtStatus.Text & Chr(13) & Chr(10)
                txtStatus.Text = txtStatus.Text & "call state: CS_OFFERING"
            Case JulMar.Tapi3.CALL_STATE.CS_QUEUED
                txtStatus.Text = txtStatus.Text & Chr(13) & Chr(10)
                txtStatus.Text = txtStatus.Text & "call state: CS_QUEUED"
            Case Else
                txtStatus.Text = txtStatus.Text & Chr(13) & Chr(10)
                txtStatus.Text = txtStatus.Text & "call state: unknown!!"
        End Select

        txtStatus.SelectionStart = Len(txtStatus.Text)
        txtStatus.SelectionLength = 0

    End Sub
	

    Private Sub pbDial_Click(ByVal eventSender As System.Object, ByVal eventArgs As System.EventArgs) Handles pbDial.Click
        On Error Resume Next 'this will catch errors

        Dim nResult As Integer

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产一区二区三区在线看麻豆| 在线综合亚洲欧美在线视频| 欧美日韩久久久| 久久久久久久av麻豆果冻| 亚洲自拍偷拍图区| 成人免费视频网站在线观看| 欧美日韩激情一区| 日韩毛片高清在线播放| 狠狠色狠狠色综合系列| 欧美日韩国产精品自在自线| 国产精品国产三级国产aⅴ入口| 蜜桃av一区二区| 亚洲日本电影在线| 欧美视频日韩视频| 中文欧美字幕免费| 免费在线观看一区| 欧美日韩亚洲不卡| 亚洲在线视频一区| 韩国av一区二区三区| 91女人视频在线观看| 国产校园另类小说区| 国内成人精品2018免费看| 91精品国产综合久久久久久漫画| 亚洲精品美腿丝袜| av不卡免费在线观看| 日本一区二区成人| 粉嫩av亚洲一区二区图片| 欧美精品一区二区三区在线| 日本中文一区二区三区| 欧美二区三区的天堂| 亚洲一二三四区不卡| 欧美视频一区二| 亚洲自拍偷拍欧美| 欧美日韩国产一区| 午夜亚洲福利老司机| 欧美日本一区二区三区四区| 一区二区三区在线播放| 在线区一区二视频| 亚洲韩国精品一区| 69堂亚洲精品首页| 免费人成黄页网站在线一区二区| 欧美一区二区女人| 韩国av一区二区三区四区| 久久久三级国产网站| 高潮精品一区videoshd| 国产精品传媒视频| 欧美最猛性xxxxx直播| 午夜精品一区二区三区三上悠亚| 欧美日韩在线免费视频| 青青草原综合久久大伊人精品 | 国产精品久久久久久久岛一牛影视 | 石原莉奈在线亚洲二区| 欧美色图免费看| 精品在线观看视频| 欧美国产一区视频在线观看| 色屁屁一区二区| 人人爽香蕉精品| 久久人人爽爽爽人久久久| 成人h动漫精品一区二| 亚洲午夜在线观看视频在线| 欧美一二区视频| 国产91精品一区二区麻豆网站| 一色屋精品亚洲香蕉网站| 欧美午夜在线观看| 国产麻豆成人精品| 亚洲一二三区视频在线观看| 精品欧美一区二区三区精品久久 | 日本成人在线电影网| 久久精品这里都是精品| 在线一区二区三区做爰视频网站| 琪琪一区二区三区| 国产精品第五页| 日韩一级二级三级| 色综合久久久网| 国内一区二区在线| 亚洲午夜久久久久久久久久久 | 欧美裸体bbwbbwbbw| 国产精品888| 午夜a成v人精品| 国产精品不卡在线观看| 日韩视频在线观看一区二区| a级精品国产片在线观看| 日本在线不卡视频一二三区| 自拍偷拍亚洲欧美日韩| 日韩你懂的在线观看| 欧美色综合影院| 成人免费毛片a| 国产在线精品免费| 天堂成人免费av电影一区| 自拍偷拍国产精品| 国产色产综合色产在线视频| 日韩小视频在线观看专区| 91福利在线看| 99精品视频一区| 国产剧情av麻豆香蕉精品| 天堂成人免费av电影一区| 亚洲影视在线播放| 一区二区三区久久| 日韩久久一区二区| 欧美国产欧美综合| 久久久.com| 精品国产乱码久久久久久久久 | 日韩精品福利网| 国产精品免费视频网站| 成人久久久精品乱码一区二区三区| 亚洲专区一二三| 欧美国产日韩亚洲一区| 9191国产精品| 99久久婷婷国产综合精品电影| 精品一区二区免费在线观看| 亚洲国产成人tv| 中文字幕欧美国产| 精品999在线播放| 欧美精品色一区二区三区| 色综合色狠狠天天综合色| 丰满少妇久久久久久久| 久久99深爱久久99精品| 午夜久久久久久电影| 亚洲国产精品人人做人人爽| 国产精品的网站| 久久久久久9999| 亚洲精品一区在线观看| 7777精品伊人久久久大香线蕉完整版 | 欧美日韩大陆一区二区| 92精品国产成人观看免费| 国产精品系列在线播放| 国产一区二区在线电影| 美女视频一区二区三区| 亚洲sss视频在线视频| 一区二区三区四区不卡在线| 亚洲欧美一区二区不卡| 国产精品卡一卡二| 成人免费一区二区三区视频| 久久中文娱乐网| 一色桃子久久精品亚洲| 亚洲日本在线视频观看| 1区2区3区精品视频| 中文字幕在线观看一区| 亚洲欧美成人一区二区三区| 亚洲成a人v欧美综合天堂下载| 一区二区三区欧美日| 亚洲成在线观看| 午夜久久久影院| 久久精品国产澳门| 精品无码三级在线观看视频| 美女网站在线免费欧美精品| 激情图区综合网| 国产伦精品一区二区三区视频青涩| 国产最新精品精品你懂的| 秋霞午夜鲁丝一区二区老狼| 国产精品一二三四区| 成人在线综合网站| 日本久久一区二区三区| 欧美图区在线视频| 91精品国产品国语在线不卡| 69堂精品视频| 国产欧美一区二区精品久导航 | 亚洲成人精品在线观看| 免费精品视频最新在线| 国产一区二区成人久久免费影院| 国产精品一线二线三线| 色哟哟在线观看一区二区三区| 99久久精品国产导航| 欧美一区二区视频在线观看2020 | 久久久久99精品一区| 亚洲欧洲日韩综合一区二区| 国产精品理论片| 九九热在线视频观看这里只有精品| 国产剧情av麻豆香蕉精品| 色婷婷综合久久久久中文| 51久久夜色精品国产麻豆| 中文字幕免费一区| 九九在线精品视频| 欧美在线视频不卡| 精品国内片67194| 亚洲欧美日韩久久精品| 看国产成人h片视频| 国产精品资源网| 欧美电视剧在线观看完整版| 国产精品国模大尺度视频| 麻豆91在线播放免费| 91丝袜美腿高跟国产极品老师| 91精品国产91久久久久久一区二区| 国产日产亚洲精品系列| 午夜伊人狠狠久久| 在线免费观看日韩欧美| 久久综合色8888| 亚洲一区二区三区在线看| 国产精一区二区三区| 欧美图区在线视频| 亚洲最快最全在线视频| 成人午夜私人影院| 精品久久久影院| 日韩不卡一区二区| 欧美日韩国产成人在线91| 亚洲欧美日韩在线| 成人免费视频app| 精品人在线二区三区| 亚洲狠狠爱一区二区三区| 欧美三级电影网站|