Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8639581
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T11:02:56+00:00 2026-06-12T11:02:56+00:00

I am new in SIP call using RTP, now I am trying to send

  • 0

I am new in SIP call using RTP, now I am trying to send and receive
voice streams using RTP for sip call. I am done with connecting
two emulators and able to send INVITE and INVITE-ACK using jain sip.

After I got an Ack I want to start RTP for media streaming, I use the RtpPacket
function to send and receive

I use RtpFunction to send media with all RTP header like this:

byte Version;
boolean Padding;
boolean Extension;
byte CC;
boolean Marker;
byte PayloadType;
short SequenceNumber;
int TimeStamp;

Please give some ideas and actual links where I can find an answer.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T11:02:57+00:00Added an answer on June 12, 2026 at 11:02 am

    We send and receive RTP data using RTPpacket.

      import javax.media.rtp.*;
      import javax.media.rtp.rtcp.*;
      import javax.media.rtp.event.*;
      import javax.media.*;
      import javax.media.protocol.*;
      import java.net.InetAddress;
      import javax.media.format.AudioFormat;
      import com.sun.media.ui.*;
      import java.util.Vector;
      public class RTPSourceStream < RTPPlayerWindow > implements ReceiveStreamListener,
          ControllerListener {
              @SuppressWarnings("rawtypes")
              Vector playerlist = new Vector();
              @SuppressWarnings("deprecation")
              SessionManager mgr = null;
              boolean terminatedbyClose = false;
    
              @SuppressWarnings("deprecation")
              public SessionManager createManager(String address,
                  String sport,
                  String sttl,
                  boolean listener,
                  boolean sendlistener) {
                  return createManager(address,
                      new Integer(sport).intValue(),
                      new Integer(sttl).intValue(),
                      listener,
                      sendlistener);
              }
              @SuppressWarnings("deprecation")
              public SessionManager createManager(String address,
                  int port,
                  int ttl,
                  boolean listener,
                  boolean sendlistener) {
                  mgr = (SessionManager) new com.sun.media.rtp.RTPSessionMgr();
                  if (mgr == null) return null;
                  mgr.addFormat(new AudioFormat(AudioFormat.DVI_RTP, 44100, 4, 1), 18);
                  if (listener) mgr.addReceiveStreamListener(this);
                  //  if (sendlistener) new RTPSendStreamWindow(mgr);
                  // ask RTPSM to generate the local participants CNAME
                  String cname = mgr.generateCNAME();
                  String username = null;
                  try {
                      username = System.getProperty("user.name");
                  } catch (SecurityException e) {
                      username = "jmf-user";
                  }
                  // create our local Session Address
                  SessionAddress localaddr = new SessionAddress();
                  try {
                      InetAddress destaddr = InetAddress.getByName(address);
                      SessionAddress sessaddr = new SessionAddress(destaddr,
                          port,
                          destaddr,
                          port + 1);
                      SourceDescription[] userdesclist = new SourceDescription[] {
                          new SourceDescription(SourceDescription
                                  .SOURCE_DESC_EMAIL,
                                  "jmf-user@sun.com",
                                  1,
                                  false),
                              new SourceDescription(SourceDescription
                                  .SOURCE_DESC_CNAME,
                                  cname,
                                  1,
                                  false),
                              new
                          SourceDescription(SourceDescription.SOURCE_DESC_TOOL, "JMF RTP Player v2.0",
                              1,
                              false)
                      };
                      mgr.initSession(localaddr,
                          userdesclist,
                          0.05,
                          0.25);
                      mgr.startSession(sessaddr, ttl, null);
                  } catch (Exception e) {
                      System.err.println(e.getMessage());
                      return null;
                  }
                  return mgr;
              }
              public void update(ReceiveStreamEvent event) {
                  Player newplayer = null;
                  RTPPacket playerWindow = null;
                  // find the sourceRTPSM for this event
                  SessionManager source = (SessionManager) event.getSource();
                  // create a new player if a new recvstream is detected
                  if (event instanceof NewReceiveStreamEvent) {
                      String cname = "Java Media Player";
                      ReceiveStream stream = null;
                      try {
                          // get a handle over the ReceiveStream
                          stream = ((NewReceiveStreamEvent) event)
                              .getReceiveStream();
                          Participant part = stream.getParticipant();
                          if (part != null) cname = part.getCNAME();
                          // get a handle over the ReceiveStream datasource
                          DataSource dsource = stream.getDataSource();
                          // create a player by passing datasource to the 
                          // Media Manager
                          newplayer = Manager.createPlayer(dsource);
                          System.out.println("created player " + newplayer);
                      } catch (Exception e) {
                          System.err.println("NewReceiveStreamEvent exception " +
                              e.getMessage());
                          return;
                      }
                      if (newplayer == null) return;
                      playerlist.addElement(newplayer);
                      newplayer.addControllerListener(this);
                      // send this player to player GUI
                      playerWindow = new RTPPacket(newplayer, cname);
                  }
              }
              public void controllerUpdate(ControllerEvent evt) {
                  // get a handle over controller, remove it from the player
                  // list.
                  // if player list is empty, close the sesssion manager.
                  if ((evt instanceof ControllerClosedEvent) ||
                      (evt instanceof ControllerErrorEvent) ||
                      (evt instanceof DeallocateEvent)) {
                      Player p = (Player) evt.getSourceController();
                      if (!terminatedbyClose) {
                          if (playerlist.contains(p))
                              playerlist.removeElement(p);
                          if ((playerlist.size() == 0) && (mgr != null))
                              mgr.closeSession("All players are closed");
                      }
                  }
              }
              public void closeManager() {
                  terminatedbyClose = true;
                  // first close all the players
                  for (int i = 0; i < playerlist.size(); i++) {
                      ((Player) playerlist.elementAt(i)).close();
                  }
                  if (mgr != null) {
                      mgr.closeSession("RTP Session Terminated");
                      mgr = null;
                  }
              }
              class RTPPacket extends RTPSourceStream {
                  public RTPPacket(Player newplayer, String cname) {
                      // TODO Auto-generated constructor stub
                  }
              }
          }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Im trying to run a VOIP call using built in SIP on android 3.1.
new on ruby and using windows xp and rails 3, i want to send
New to Node.js and Express, I am trying to understand the two seems overlapping
I am new to android and I am implementing VoIP using SIP (Android2.3). I
When using the SIP API, how can I answer a call I'm receiving. Im
I'm trying to build a simple SIP application using JAIN SIP 1.2 and the
I am new to android. I would like to monitor the sip packets that
new to c#. I'm trying to make a simple system where I can search
New programmer here, I am trying to understand and break down this code below
New developer here,Im using the Custom Image Picker by ray wenderlich. But what I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.