Results 1 to 5 of 5

Thread: vb.net VOIP ( voice over ip )

  1. #1

    Thread Starter
    Banned
    Join Date
    Mar 2009
    Posts
    764

    vb.net VOIP ( voice over ip )

    skype (voice over ip)

    walkthrough for using skype with vb.net

    notes : install skype (voip software), when running skype is running, you signed in it

    1 dl skype4com from http://developer.skype.com/accessories
    2 extract the zip file (3 files : chm, dll,msm)
    3 open vb.net, file, new, project, window application
    4 from tool box add :
    textbox name : txtCallee
    3 radio buttons : radTel, ralCell, radSkype
    textbox multiline = true
    button btnCall
    textbox name: txtMsg
    button btnSend
    timer name : ChatTimer, true, interval 1000

    5 project, add reference, browse , skype4com.dll

    6 source code :
    global vars : (add below class (after right click form, view code))
    Dim oSkype As SKYPE4COMLib.Skype = New SKYPE4COMLib.Skype
    Dim oCall As SKYPE4COMLib.Call
    Dim oChat As SKYPE4COMLib.Chat

    Code:
    Private Sub Main_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        If oSkype.Client.IsRunning = False Then
            MsgBox("Skype must be running!")
            End
        End If
        Try
            If oSkype.CurrentUserStatus = SKYPE4COMLib.TUserStatus.cusOffline Then
                MsgBox("Your Skype account must be online!")
                End
            End If
        Catch ex As Exception
            MsgBox("Your Skype account must be online!")
        End Try
    End Sub
    Public Function parseTelNum(ByVal input As String, ByVal defaultIntl As String, ByVal defaultArea As String)
        Dim result As String
        result = input.Replace("-", " ")
        If result.StartsWith("0") Then
            Return "+" & defaultIntl & result.Substring(1)
        ElseIf result.StartsWith("+") Then
            Return result
        Else
            Return "+" & defaultIntl & defaultArea & result
        End If
    End Function
    Private Sub btnCall_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnCall.Click
        If btnCall.Text = "Call" Then
            If txtCallee.Text = " " Then
                Exit Sub
            End If
            If radTel.Checked = True Then
                Try
                    oCall = oSkype.PlaceCall(parseTelNum(txtCallee.Text, "972", "2"))
                    btnCall.Text = "Hang up"
                Catch ex As Exception
                    MsgBox("Couldn't place the call." & vbCrLf & "Please make sure the input you entered is valid!")
                End Try
            ElseIf radCell.Checked = True Then
                    oCall = oSkype.PlaceCall(parseTelNum(txtCallee.Text, "972", "52"))
            Else
                    oCall = oSkype.PlaceCall(txtCallee.Text)
        Else
            oCall.Finish()
            btnCall.Text = "Call"
        End If
    End Sub
    Private Sub btnSend_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnSend.Click
        If txtCallee.Text = " " Or txtMsg.Text = " " Then
            Exit Sub
        End If
        If radTel.Checked = True Then
            Try
                oSkype.SendSms(parseTelNum(txtCallee.Text, "972", "2"), txtMsg.Text)
                txtMsg.Text = ""
            Catch ex As Exception
                MsgBox("Coudn't send the SMS." & vbCrLf & "Please make sure the input you entered is valid!")
            End Try
        ElseIf radCell.Checked = True Then
                oSkype.SendSms(parseTelNum(txtCallee.Text, "972", "52"), txtMsg.Text)
        Else
                oSkype.SendMessage(txtCallee.Text, txtMsg.Text)
                MsgBox("Couldn't sent the message." & vbCrLf & "Please make sure the input you entered is valid!")
    End Sub
    Private Sub ChatTimer_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ChatTimer.Tick
        txtChat.Text = ""
        If txtCallee.Text <> "" Then
            oChat = oSkype.CreateChatWith(txtCallee.Text)
            Try
                Dim temp = oChat.Messages
            Catch ex As Exception
                txtChat.Text = "No such username or no chat available." & vbCrLf & ex.ToString
                Exit Sub
            End Try
            For Each oMsg As SKYPE4COMLib.ChatMessage In oChat.Messages
                If Not oMsg.Body.ToString.StartsWith("<pa") And oMsg.Body.ToString <> "" Then
                    txtChat.Text = txtChat.Text & vbCrLf & oMsg.Sender.FullName & ": " & oMsg.Body
                End If
            Next
            oSkype.ResetCache()
        End If
    End Sub
    you can test on the skype bot "echo123"

    please don't spam

  2. #2
    PowerPoster Nightwalker83's Avatar
    Join Date
    Dec 2001
    Location
    Adelaide, Australia
    Posts
    13,346

    Re: vb.net VOIP ( voice over ip )

    Cool! I might see how I go with doing this in C#.
    when you quote a post could you please do it via the "Reply With Quote" button or if it multiple post click the "''+" button then "Reply With Quote" button.
    If this thread is finished with please mark it "Resolved" by selecting "Mark thread resolved" from the "Thread tools" drop-down menu.
    https://get.cryptobrowser.site/30/4111672

  3. #3

    Thread Starter
    Banned
    Join Date
    Mar 2009
    Posts
    764

    Re: vb.net VOIP ( voice over ip )

    no rate ?

  4. #4
    PowerPoster Nightwalker83's Avatar
    Join Date
    Dec 2001
    Location
    Adelaide, Australia
    Posts
    13,346

    Re: vb.net VOIP ( voice over ip )

    Quote Originally Posted by moti barski View Post
    no rate ?
    Check your visitor messages.
    when you quote a post could you please do it via the "Reply With Quote" button or if it multiple post click the "''+" button then "Reply With Quote" button.
    If this thread is finished with please mark it "Resolved" by selecting "Mark thread resolved" from the "Thread tools" drop-down menu.
    https://get.cryptobrowser.site/30/4111672

  5. #5
    Frenzied Member TheBigB's Avatar
    Join Date
    Mar 2006
    Location
    *Stack Trace*
    Posts
    1,511

    Re: vb.net VOIP ( voice over ip )

    Delete it. They just clutter threads anyway.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width