Not logged in. · Lost password · Register
Forum: MatriX RSS
Avatar
david.felix #1
Member since Jul 2015 · 23 posts
Group memberships: Members
Show profile · Link to this post
Subject: problem with jingle audio
Hi i have written the below code for audio chat but and i have call the subroutine inside the audio button event handler. but when i click on the button nothing happens. I know there suppose to be a callback method just like OnMessage callback to notify the responder. But i dont know that handler and i do not know if my written codes are correct.

  1. Private Sub audio()
  2.         'jingle audo definition begins
  3.         Dim jingleaudio As New Matrix.Xmpp.Jingle.Jingle()
  4.         jingleaudio.Action = Matrix.Xmpp.Jingle.Action.SessionInitiate
  5.         jingleaudio.Initiator = New Matrix.Jid(xc.Username)
  6.         jingleaudio.Responder = New Matrix.Jid("user2@server")
  7.         Dim rand As New Random()
  8.         jingleaudio.Sid = rand.Next(20)
  9.         'jingleaudio.GenerateSid()
  10.         'content type starts
  11.         Dim content As New Matrix.Xmpp.Jingle.Content()
  12.         content.Name = "Audio call"
  13.         content.Creator = Creator.Initiator
  14.         'jingle description begins
  15.         Dim description As Description = New Matrix.Xmpp.Jingle.Apps.Rtp.Description()
  16.         description.Media = Media.Audio
  17.         Dim pay As New PayloadType()
  18.         pay.Id = 96
  19.         pay.Name = "speex"
  20.         pay.Clockrate = 16000
  21.         description.AddPayloadType(pay)
  22.  
  23.         pay = New PayloadType()
  24.         pay.Id = 97
  25.         pay.Name = "speex"
  26.         pay.Clockrate = 8000
  27.         description.AddPayloadType(pay)
  28.  
  29.         pay = New PayloadType()
  30.         pay.Id = 18
  31.         pay.Name = "G729"
  32.         description.AddPayloadType(pay)
  33.  
  34.         pay = New PayloadType()
  35.         pay.Id = 0
  36.         pay.Name = "PCMU"
  37.         description.AddPayloadType(pay)
  38.  
  39.         pay = New PayloadType()
  40.         pay.Id = 98
  41.         pay.Name = "x-ISAC"
  42.         pay.Clockrate = 8000
  43.         description.AddPayloadType(pay)
  44.         content.Description = description
  45.         'transport method begins
  46.         Dim transportudp As Transports.TransportIceUdp = New Matrix.Xmpp.Jingle.Transports.TransportIceUdp()
  47.         transportudp.Pwd = rand.Next(21)
  48.         transportudp.Ufrag = rand.Next(4)
  49.         Dim candidate As New Candidates.CandidateIceUdp()
  50.         candidate.Foundation = 1
  51.         candidate.Component = 1
  52.         candidate.Generation = 0
  53.         candidate.Id = rand.Next(10)
  54.         candidate.IPAddress = IPAddress.Parse("0:0:0:0:0:0:0:1")
  55.         candidate.Port = 5222
  56.         candidate.Priority = 2130706431
  57.         candidate.Protocol = Protocol.Udp
  58.         candidate.Type = CandidateType.Host
  59.         transportudp.AddCandidate(candidate)
  60.         content.TransportIceUdp = transportudp
  61.         jingleaudio.Content = content
  62.         'query the jingle iq from server
  63.         Dim jingleiq As New JingleIq() With {.To = "user2@server", .From = New Matrix.Jid(xc.Username), .Type = IqType.Set, .Jingle = jingleaudio}
  64.         xc.Send(jingleiq)

Please kindly help me out.

God bless

Thanks.
This post was edited on 2015-08-16, 13:13 by Alex.
Avatar
Alex #2
Member since Feb 2003 · 4328 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
You are sending an Iq, you the receiver must handle this packet in an OnIq callback.
Iqs go usually to a full Jid. In libe 63 you send it to a bare Jid user2@server. This must be a full Jid (including the resource).

Alex
Avatar
david.felix #3
Member since Jul 2015 · 23 posts
Group memberships: Members
Show profile · Link to this post
Okay i will correct that line on 63. But please can you simply provide me with a snippet of how the receiver can handle that on the iq callback?

This is the iq callback i have written but i do not know which code should go there.

  1. Private Sub xc_oniq(sender As Object, e As IqEventArgs)
  2.    If e.Iq.Type = IqType.Get Then
  3.  
  4.    End If
  5. End Sub

Thanks a lot. I sent you a message to find out how you are doing.

I will definitely acknowledge you when i completed my project and i will definitely purchase a license.

Thanks a lot once again.
This post was edited 3 times, last on 2015-08-17, 19:02 by Alex.
Avatar
Alex #4
Member since Feb 2003 · 4328 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
just add an OnIq handler and then check if iq-Query is of type Jingle.

Alex
Avatar
david.felix #5
Member since Jul 2015 · 23 posts
Group memberships: Members
Show profile · Link to this post
i have added the on_iq handler but if iq is of type jingle, what should i do? That is my major problem. I do not know what to do next if the iqtype if jingle.

And on the iqtype, i only have get, result, error and set.

Please kindly help me with a snippet here. Please.
Thanks a lot. God bless you abundantly!
Avatar
Alex #6
Member since Feb 2003 · 4328 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
Please study the Jingle protocols which you can find here:
http://xmpp.org/xmpp-protocols/xmpp-extensions/

In the documentation you can find many examples.

MatriX handles only the XMPP packets for Jingle. It has no funcionality to transfer voice or video data. For this you have to add another library.

Alex
Avatar
david.felix #7
Member since Jul 2015 · 23 posts
Group memberships: Members
Show profile · Link to this post
Thanks a lot. But please i have study it and it seems confusing to me. Please kindly help me with at least a snippet i can use to do this or recommend which library i have to use. Please.

Thanks a lot for your kind and quick response.
Avatar
Alex #8
Member since Feb 2003 · 4328 posts · Location: Germany
Group memberships: Administrators, Members
Show profile · Link to this post
sorry, but I have no code example which shows you how to setup a complete phone call.

There was a similar question in this thread where we added a small list of libraries. There are probably much more available.
http://forum.ag-software.net/thread/1688-Voice-in-xmpp

Alex
Close Smaller – Larger + Reply to this post:
Verification code: VeriCode Please enter the word from the image into the text field below. (Type the letters only, lower case is okay.)
Smileys: :-) ;-) :-D :-p :blush: :cool: :rolleyes: :huh: :-/ <_< :-( :'( :#: :scared: 8-( :nuts: :-O
Special characters:
Forum: MatriX RSS