亚洲欧美第一页_禁久久精品乱码_粉嫩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一区二区三区免费野_久草精品视频
精品日韩一区二区| 中文字幕一区二区在线观看| 一区二区三区毛片| 欧美夫妻性生活| 日本一不卡视频| 欧美在线观看禁18| 亚洲视频一区在线| 国产一区二区三区黄视频 | 亚洲精品国产无天堂网2021| 99久久精品费精品国产一区二区| 91在线免费播放| 欧美一二区视频| 国产一区二区三区四| 国产欧美1区2区3区| 色综合久久六月婷婷中文字幕| 亚洲精品少妇30p| 欧美喷水一区二区| 国产精品一级片| 亚洲人成精品久久久久| 精品美女被调教视频大全网站| 日韩美女啊v在线免费观看| 91精品国产黑色紧身裤美女| 成人午夜激情片| 精品亚洲aⅴ乱码一区二区三区| 亚洲人精品午夜| 中文字幕亚洲欧美在线不卡| 亚洲二区在线观看| 色综合色综合色综合色综合色综合| 亚洲男人都懂的| 久久精品夜夜夜夜久久| 欧美理论电影在线| 一本到三区不卡视频| 国产精品一区二区免费不卡| 天天影视涩香欲综合网| 五月婷婷欧美视频| 欧美国产国产综合| 精品久久一区二区| 欧美精品一区二区三区久久久| 欧美性色综合网| 日本伦理一区二区| 在线中文字幕一区| 色老汉av一区二区三区| 欧洲一区在线电影| 99国产精品久久久久久久久久 | 中文字幕亚洲精品在线观看| 26uuu欧美| 日韩电影在线观看电影| 亚洲国产wwwccc36天堂| 一区二区三区在线视频免费观看| 国产日本欧洲亚洲| 国产精品久久久一区麻豆最新章节| 精品日韩成人av| 国产女人18水真多18精品一级做| 精品国产一区二区三区四区四| 精品美女被调教视频大全网站| 欧美xxxxx牲另类人与| 久久亚洲一级片| 国产精品久久久久久久久动漫| 日韩美女久久久| 亚洲bt欧美bt精品| 国产美女精品一区二区三区| 国产iv一区二区三区| 色噜噜偷拍精品综合在线| 在线观看av不卡| 日韩欧美成人激情| 久久久99久久精品欧美| 亚洲日本va午夜在线影院| 午夜一区二区三区视频| 精品一区二区三区在线视频| 96av麻豆蜜桃一区二区| 欧美一区二区三区在线电影| 欧美国产乱子伦| 日韩精品一二三| 91丝袜美女网| 国产日韩av一区| 日本麻豆一区二区三区视频| 国产乱对白刺激视频不卡| 99久久婷婷国产综合精品电影| 欧美性猛交xxxxxx富婆| 国产精品九色蝌蚪自拍| 毛片不卡一区二区| 欧美日韩国产免费一区二区| 亚洲色图视频网| av中文字幕一区| 日本一区二区在线不卡| 国产一区二区三区不卡在线观看| 91国产免费看| 综合久久综合久久| 国产剧情一区二区| 欧美一卡二卡三卡四卡| 亚洲成人av电影在线| 91老司机福利 在线| 中文字幕一区二区三| 国产91清纯白嫩初高中在线观看 | 久久草av在线| 精品日韩99亚洲| 国产在线视频不卡二| 久久综合久久久久88| 国产激情一区二区三区桃花岛亚洲| 欧美一级一区二区| 久久成人免费日本黄色| 久久日韩精品一区二区五区| 国产一本一道久久香蕉| 1024成人网| 欧美一区二区三区在线观看视频| 免费黄网站欧美| 国产女主播一区| 欧美自拍丝袜亚洲| 精品亚洲国内自在自线福利| 国产精品久99| 欧美日韩亚洲综合一区二区三区| 日本不卡视频一二三区| 国产午夜精品理论片a级大结局| 国产乱子伦视频一区二区三区| 最新日韩在线视频| 欧美日韩二区三区| 丁香网亚洲国际| 天堂成人免费av电影一区| 久久久久亚洲蜜桃| 欧美日韩精品系列| 成人av资源在线| 性久久久久久久久久久久| 欧美电视剧免费观看| 99精品久久久久久| 视频在线观看91| 亚洲人成7777| 国产精品日韩成人| 在线观看欧美精品| 高清beeg欧美| 韩国欧美一区二区| 久久国产福利国产秒拍| 亚洲精品视频免费看| 国产精品国产a| 国产丝袜在线精品| 2024国产精品| 69堂国产成人免费视频| av午夜精品一区二区三区| 国产盗摄一区二区三区| 国产精品资源在线观看| 毛片av一区二区| 亚洲国产日韩综合久久精品| 国产精品传媒在线| 1区2区3区精品视频| 国产精品久久久久桃色tv| 国产精品视频免费看| 中文字幕成人av| 成人免费一区二区三区视频| 中文成人av在线| 综合电影一区二区三区| 一区二区三区四区av| 亚洲国产精品久久久久婷婷884 | 欧美日本高清视频在线观看| 欧美日韩综合一区| 日韩视频免费观看高清完整版| 欧美三级韩国三级日本三斤| 欧美一区二区精品在线| 亚洲精品一区二区在线观看| 国产蜜臀97一区二区三区| 亚洲人成7777| 日本va欧美va精品| av电影一区二区| 欧美肥大bbwbbw高潮| 欧美激情中文不卡| 亚洲综合另类小说| 国产精品一区免费在线观看| 99久久99久久综合| 精品久久五月天| 一区二区三区四区激情 | 国产电影一区在线| 欧美精品欧美精品系列| 国产欧美日韩卡一| 日本特黄久久久高潮| 日本久久电影网| 国产欧美日韩视频一区二区| 美腿丝袜亚洲色图| 欧美视频一区二区三区| 中文字幕在线一区免费| 久久99日本精品| 欧美丝袜丝交足nylons| 亚洲人成小说网站色在线 | 欧美日韩高清一区二区三区| 国产精品伦理一区二区| 国产一区二区视频在线播放| 欧美精三区欧美精三区| 亚洲国产视频网站| 日本韩国欧美国产| 亚洲免费观看高清完整版在线观看熊| 国产一区二区三区免费看| 日韩一区国产二区欧美三区| 日韩国产精品久久久久久亚洲| 色综合久久中文综合久久97| 国产精品国产三级国产aⅴ入口| 国产精品亚洲专一区二区三区| 欧美xxxxx裸体时装秀| 日韩av电影天堂| 精品伦理精品一区| 国产1区2区3区精品美女| 日本一区二区电影| 欧美亚洲自拍偷拍| 久久精品国产久精国产|