Click here to Skip to main content
15,922,427 members
Home / Discussions / .NET (Core and Framework)
   

.NET (Core and Framework)

 
AnswerRe: look for some option witch can pass through firewall Pin
Andy Brummer31-Aug-05 17:55
sitebuilderAndy Brummer31-Aug-05 17:55 
GeneralRe: look for some option witch can pass through firewall Pin
at2000131-Aug-05 23:52
at2000131-Aug-05 23:52 
GeneralRe: look for some option witch can pass through firewall Pin
Andy Brummer1-Sep-05 3:34
sitebuilderAndy Brummer1-Sep-05 3:34 
QuestionExtracting Frames From The AVI Movie Pin
Nabeel Younus Khan31-Aug-05 11:04
Nabeel Younus Khan31-Aug-05 11:04 
QuestionWindows Service arguments Pin
vSoares31-Aug-05 5:44
professionalvSoares31-Aug-05 5:44 
QuestionPicture Box control for .NET PocketPC application Pin
Sevugan31-Aug-05 5:13
Sevugan31-Aug-05 5:13 
AnswerRe: Picture Box control for .NET PocketPC application Pin
Terry Dong31-Aug-05 16:15
Terry Dong31-Aug-05 16:15 
Questiontapi problem Pin
iram130-Aug-05 18:45
iram130-Aug-05 18:45 
The problem is, code does not detected telephone tones(telephone button press).Language is vb.net.
Code is::
Imports TAPI3Lib<br />
Imports SpeechLib<br />
Public Class Form1<br />
    Inherits System.Windows.Forms.Form<br />
<br />
#Region " Windows Form Designer generated code "<br />
<br />
    Public Sub New()<br />
        MyBase.New()<br />
<br />
        'This call is required by the Windows Form Designer.<br />
        InitializeComponent()<br />
        initializetapi3()<br />
        'Add any initialization after the InitializeComponent() call<br />
<br />
    End Sub<br />
    Sub initializetapi3()<br />
        m_TAPI.Initialize()<br />
        'oTAPI = m_TAPI<br />
        cn = New notification<br />
        AddHandler m_TAPI.ITTAPIEventNotification_Event_Event, New TAPI3Lib.ITTAPIEventNotification_EventEventHandler(AddressOf cn.sEvent)<br />
<br />
    End Sub<br />
<br />
    'Form overrides dispose to clean up the component list.<br />
    Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)<br />
        m_TAPI.Shutdown()<br />
        If disposing Then<br />
            If Not (components Is Nothing) Then<br />
                components.Dispose()<br />
            End If<br />
        End If<br />
        MyBase.Dispose(disposing)<br />
    End Sub<br />
<br />
    'Required by the Windows Form Designer<br />
    Private components As System.ComponentModel.IContainer<br />
<br />
    'NOTE: The following procedure is required by the Windows Form Designer<br />
    'It can be modified using the Windows Form Designer.  <br />
    'Do not modify it using the code editor.<br />
    Friend WithEvents Button1 As System.Windows.Forms.Button<br />
    <System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()<br />
        Me.Button1 = New System.Windows.Forms.Button<br />
        Me.SuspendLayout()<br />
        '<br />
        'Button1<br />
        '<br />
        Me.Button1.Location = New System.Drawing.Point(144, 64)<br />
        Me.Button1.Name = "Button1"<br />
        Me.Button1.Size = New System.Drawing.Size(104, 40)<br />
        Me.Button1.TabIndex = 0<br />
        Me.Button1.Text = "answer"<br />
        '<br />
        'Form1<br />
        '<br />
        Me.AutoScaleBaseSize = New System.Drawing.Size(5, 13)<br />
        Me.ClientSize = New System.Drawing.Size(292, 273)<br />
        Me.Controls.Add(Me.Button1)<br />
        Me.Name = "Form1"<br />
        Me.Text = "Form1"<br />
        Me.ResumeLayout(False)<br />
<br />
    End Sub<br />
<br />
#End Region<br />
<br />
    <br />
    Private MediaAudio As Integer<br />
    Private MediaModem As Integer = 24<br />
    Private MediaFax As Integer<br />
    Private MediaVideo As Integer<br />
    Dim MediaTypes As Integer<br />
    Private cn As notification<br />
    'Private WithEvents button1 As System.Windows.Forms.Button<br />
    'Private WithEvents oTAPI As TAPI3Lib.TAPI   ' will hold our TAPI object<br />
    'Private oTAPI As TAPI3Lib.TAPI<br />
    Dim m_TAPI As New TAPIClass<br />
    Private line_token As Integer<br />
    Private oAddress As ITAddress ' will hold our selected address (you can hold many address in an array)<br />
<br />
<br />
    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click<br />
        Dim myspeak As New SpeechLib.SpVoiceClass<br />
        Dim S1 As New SpeechLib.SpFileStream<br />
        Const FILENAME1 = "c:\my.wav"<br />
        Dim ec As IEnumCall = oAddress.EnumerateCalls()<br />
        Dim arg As System.UInt32 = Convert.ToUInt32(0)  'ToDo: Unsigned Integers not supported<br />
        Dim ici As ITCallInfo<br />
        Dim reject = False<br />
        Dim eobj<br />
        Dim aa As New Byte<br />
        Dim val As Integer<br />
<br />
        'Trya<br />
        ec.Next(Convert.ToUInt32(2), ici, arg)<br />
        Dim bc As ITBasicCallControl = CType(ici, TAPI3Lib.ITBasicCallControl)<br />
        ' Dim con As ITBasicCallControl = CType(ici, TAPI3Lib.ITBasicCallControl)<br />
        'If Not reject Then<br />
        MsgBox("hello how r u")<br />
        bc.Answer()<br />
        MsgBox("hello")<br />
        'Dim tone As TAPI3Lib.ITToneDetectionEvent = CType(ici, TAPI3Lib.ITToneDetectionEvent)<br />
        'Dim a = tone.Call()<br />
<br />
<br />
<br />
<br />
<br />
        'Try<br />
        '    S1.Open(FILENAME1, SpeechStreamFileMode.SSFMCreateForWrite)<br />
        '    myspeak.AudioOutputStream = S1<br />
        '    myspeak.Speak("welcome to telemail,how r u girls")<br />
<br />
        '    S1.Close()<br />
        '    MsgBox("file is created")<br />
        '    Sound.PlayWaveFile(FILENAME1)<br />
<br />
        'Catch ex As Exception<br />
        '    MsgBox(e.ToString)<br />
        'End Try<br />
        <br />
       <br />
       <br />
        <br />
    End Sub<br />
<br />
    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load<br />
        ' creating a new instance to first initialize TAPI befor attaching the events<br />
        Try<br />
<br />
            ' a variable to hold supported media types for the address<br />
<br />
            ' initializing TAPI<br />
            '''m_TAPI.Initialize()<br />
            '''oTAPI = m_TAPI<br />
            'm_TAPI = Nothing<br />
            'oTAPI.EventFilter = (TAPI_EVENT.TE_CALLNOTIFICATION Or TAPI_EVENT.TE_CALLSTATE Or TAPI_EVENT.TE_CALLINFOCHANGE)<br />
            ' attaching event sink<br />
            'oTAPI = m_TAPI<br />
            ' getting red of the private instance as we have another global instance (oTAPI)<br />
            'm_TAPI = Nothing<br />
<br />
            Dim AddressCollection As ITCollection = m_TAPI.Addresses()<br />
<br />
            For Each Address As ITAddress In AddressCollection ' looping through address collection<br />
<br />
                If Address.State = ADDRESS_STATE.AS_INSERVICE Then ' checking if address is working <br />
<br />
                    Dim MediaSupport As ITMediaSupport = Address ' extracting meida support interface from the address<br />
<br />
                    MediaTypes = MediaSupport.MediaTypes ' extracting media types supporting<br />
<br />
                    MediaSupport = Nothing ' dispose of the object<br />
<br />
                    'If MediaTypes And MediaModem = MediaModem Then<br />
                    ' the address is a data Modem<br />
                    If MediaTypes = MediaModem Then<br />
                        '   the address supports Audio<br />
                        oAddress = Address ' select this address<br />
                        MsgBox("we have selected this address: " + oAddress.AddressName) ' show the selected address name<br />
                        MsgBox("no is" + CType(MediaTypes, String))<br />
                        Exit For<br />
                    End If<br />
                End If<br />
<br />
                'End If<br />
<br />
            Next Address<br />
<br />
<br />
            'If Not oAddress Is Nothing Then<br />
            ' registering notifications for the selected address<br />
            line_token = m_TAPI.RegisterCallNotifications(oAddress, True, True, MediaTypes, 2)<br />
            m_TAPI.EventFilter = TAPI_EVENT.TE_CALLNOTIFICATION Or TAPI_EVENT.TE_DIGITEVENT Or TAPI_EVENT.TE_PHONEEVENT Or TAPI_EVENT.TE_CALLSTATE Or TAPI_EVENT.TE_GENERATEEVENT Or TAPI_EVENT.TE_GATHERDIGITS Or TAPI_EVENT.TE_REQUEST Or TAPI_EVENT.TE_TONEEVENT Or TAPI_EVENT.TE_CALLMEDIA<br />
<br />
           Catch ex As Exception<br />
            MsgBox("Error occured:" & vbCrLf & ex.Message, MsgBoxStyle.Critical, "VBCITY.VBTAPI")<br />
        End Try<br />
    End Sub<br />
<br />
<br />
<br />
    Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)<br />
<br />
    End Sub<br />
End Class<br />
''-----------------------------SOUND CLASS-------------------------------<br />
Public Class Sound<br />
    Declare Auto Function PlaySound Lib "winmm.dll" (ByVal name _<br />
         As String, ByVal hmod As Integer, ByVal flags As Integer) As Integer<br />
<br />
<br />
    Public Const SND_FILENAME = &H20000 ' name is file name <br />
<br />
    Public Shared Sub PlayWaveFile(ByVal fileWaveFullPath As String)<br />
        Try<br />
            PlaySound(fileWaveFullPath, 0, SND_FILENAME)<br />
        Catch<br />
        End Try<br />
    End Sub<br />
End Class<br />
Class notification<br />
    'Implements TAPI3Lib.ITTAPIEventNotification<br />
    'Implements TAPI3Lib.ITDigitDetectionEvent<br />
<br />
<br />
<br />
    'Delegate Sub listshow(ByVal str As String)<br />
    'Publicmsgbox As listshow<br />
<br />
<br />
    Public Sub sEvent(ByVal te As TAPI3Lib.TAPI_EVENT, ByVal eobj As Object)<br />
        'Implements ITTAPIEventNotification.Event,ITDetectTone<br />
        Dim aa As New Byte<br />
        Dim val As Integer<br />
<br />
        Select Case te<br />
<br />
<br />
            Case TAPI3Lib.TAPI_EVENT.TE_CALLNOTIFICATION<br />
                MsgBox("call notification event has occured")<br />
<br />
<br />
            Case TAPI3Lib.TAPI_EVENT.TE_DIGITEVENT<br />
                MsgBox("digit is detected")<br />
                Dim dd As TAPI3Lib.ITDigitDetectionEvent = CType(eobj, TAPI3Lib.ITDigitDetectionEvent)<br />
                'MsgBox("my digit")<br />
                MsgBox(("Dialed digit" + dd.ToString()))<br />
<br />
<br />
<br />
<br />
        'aa = dd.Digit()<br />
        'val = dd.DigitMode<br />
        'MsgBox(val)<br />
        'Select Case val<br />
        '    Case val = 1<br />
        '        MsgBox("u have enter 1")<br />
        'End Select<br />
<br />
        ''''''''''''<br />
<br />
            Case TAPI_EVENT.TE_CALLMEDIA<br />
                MsgBox("media is changed")<br />
<br />
<br />
            Case TAPI_EVENT.TE_PHONEEVENT<br />
                MsgBox("phone event is occured")<br />
            Case TAPI_EVENT.TE_TONEEVENT<br />
                MsgBox("tone is detected")<br />
            Case TAPI3Lib.TAPI_EVENT.TE_GENERATEEVENT<br />
                Dim dg As TAPI3Lib.ITDigitGenerationEvent = CType(eobj, TAPI3Lib.ITDigitGenerationEvent)<br />
<br />
<br />
                MsgBox("digit dialed!")<br />
                MsgBox(("Dialed digit" + dg.ToString()))<br />
            Case TAPI3Lib.TAPI_EVENT.TE_PHONEEVENT<br />
                MsgBox("A phone event!")<br />
            Case TAPI3Lib.TAPI_EVENT.TE_GATHERDIGITS<br />
                MsgBox("Gather digit event!")<br />
<br />
            Case TAPI3Lib.TAPI_EVENT.TE_CALLSTATE<br />
                MsgBox("welcome to call state")<br />
                Dim a As TAPI3Lib.ITCallStateEvent = CType(eobj, TAPI3Lib.ITCallStateEvent)<br />
                Dim b As TAPI3Lib.ITCallInfo = a.Call<br />
<br />
                Select Case b.CallState<br />
                    Case TAPI3Lib.CALL_STATE.CS_INPROGRESS<br />
                        MsgBox("dialing")<br />
                    Case TAPI3Lib.CALL_STATE.CS_CONNECTED<br />
                        MsgBox("Connected")<br />
<br />
                    Case TAPI3Lib.CALL_STATE.CS_DISCONNECTED<br />
                        MsgBox("Disconnected")<br />
                    Case TAPI3Lib.CALL_STATE.CS_OFFERING<br />
                        MsgBox("A party wants to communicate with you!")<br />
                    Case TAPI3Lib.CALL_STATE.CS_IDLE<br />
                        MsgBox("Call is created!")<br />
                    Case CALL_STATE.CS_HOLD<br />
                        MsgBox("hold the call")<br />
                End Select<br />
        End Select<br />
    End Sub 'Event<br />
<br />
<br />
<br />
<br />
<br />
<br />
End Class 'callnotification<br />
<br />
<br />

Question.Net and Memory Resources Pin
Stanciu Vlad30-Aug-05 10:49
Stanciu Vlad30-Aug-05 10:49 
AnswerRe: .Net and Memory Resources Pin
Dave Kreskowiak30-Aug-05 12:04
mveDave Kreskowiak30-Aug-05 12:04 
GeneralRe: .Net and Memory Resources Pin
Stanciu Vlad30-Aug-05 19:40
Stanciu Vlad30-Aug-05 19:40 
GeneralRe: .Net and Memory Resources Pin
immes31-Aug-05 0:08
immes31-Aug-05 0:08 
GeneralRe: .Net and Memory Resources Pin
Stanciu Vlad31-Aug-05 1:48
Stanciu Vlad31-Aug-05 1:48 
GeneralRe: .Net and Memory Resources Pin
Dave Kreskowiak31-Aug-05 2:09
mveDave Kreskowiak31-Aug-05 2:09 
GeneralRe: .Net and Memory Resources Pin
S. Senthil Kumar31-Aug-05 7:56
S. Senthil Kumar31-Aug-05 7:56 
GeneralRe: .Net and Memory Resources Pin
Dave Kreskowiak31-Aug-05 12:35
mveDave Kreskowiak31-Aug-05 12:35 
QuestionTime Zone Abbreviation Pin
Rabbit1730-Aug-05 8:31
Rabbit1730-Aug-05 8:31 
AnswerRe: Time Zone Abbreviation Pin
Matt Casto1-Sep-05 6:22
Matt Casto1-Sep-05 6:22 
QuestionPorting .Net aplication to linux Pin
ediazc30-Aug-05 7:45
ediazc30-Aug-05 7:45 
Question.NET app run on Win2003 from another Win2003? Pin
CherezZaboro30-Aug-05 4:20
CherezZaboro30-Aug-05 4:20 
AnswerRe: .NET app run on Win2003 from another Win2003? Pin
Dave Kreskowiak30-Aug-05 9:53
mveDave Kreskowiak30-Aug-05 9:53 
QuestionMicrosoft .NET Passport Pin
Dario Solera30-Aug-05 1:24
Dario Solera30-Aug-05 1:24 
AnswerRe: Microsoft .NET Passport Pin
Dave Kreskowiak30-Aug-05 10:04
mveDave Kreskowiak30-Aug-05 10:04 
GeneralRe: Microsoft .NET Passport Pin
Dario Solera30-Aug-05 11:25
Dario Solera30-Aug-05 11:25 
QuestionUSB Flash Drive or CF access Pin
LiamD30-Aug-05 0:37
LiamD30-Aug-05 0:37 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.