SIP RTP J2ME development

Posted on 2008-10-13
Medium Priority
Last Modified: 2013-11-24
Dear All,
am facing a problem with my code, am trying to initiate an RTP session. I succeeded with implementation of SIP authentication and registry but i cannot get the RTP steam ?
i would appreciate if someone can review my code and pinpoint the errors am facing.
Enclosed both Class for the RTP and the error am getting.
and would be more appreciated if someone can pinpoint a workable sourcecode or document of a complete SIP and RTP under JAVA J2ME.
package sip_server2;
//package com.ctimn;
import java.io.*;
import javax.microedition.io.*;
import javax.microedition.midlet.*;
import javax.microedition.lcdui.*;
public class SocketListener extends Thread{
   private Form outputForm;
   private boolean shutdownFlag = false;
   private StreamConnectionNotifier notifier;
   public SocketListener(Form outputForm){
      this.outputForm = outputForm;
   private StreamConnectionNotifier createNotifier() throws IOException {
      return (StreamConnectionNotifier)
              Connector.open("socket://", Connector.READ_WRITE, true);
  // "sip://1006@"
   public void run(){
      System.out.println("socketListener is working"); 
      String dataIn = null;
      String dataOut = null;
      int counter = 1;
      StringItem item = new StringItem("Listening to Socket", "");
      StreamConnection connection = null;
      try {
         notifier = createNotifier();
         while (true) {
            try {
               connection = notifier.acceptAndOpen();
            } catch (InterruptedIOException x){
               if (shutdownFlag){
               } else {
                  notifier = createNotifier();
            catch(Exception e){    System.out.println("there is no error"+e.getMessage()) ;
            DataInputStream is = connection.openDataInputStream();
            DataOutputStream os = connection.openDataOutputStream();
            try {
               dataIn = is.readUTF();
               item = new StringItem("Msg: ", "'"+dataIn+"'");
               dataOut = "Message " + counter + " from the server.";
            } finally {
               System.out.println("finaly try"); 
      } catch (IOException x) {
         System.out.println("Problems sending or receiving data.");
     // catch(Exception e){
       // System.out.println("there is no error"+e.getMessage()) ;
    // }
   public void shutdown(){
      shutdownFlag = true;
//Java 2 Micro Edition
//James P. White and David A. Hemphill
//ISBN: 1930110332
The Exeption:
Problems sending or receiving data.
TCP open
javax.microedition.io.ConnectionNotFoundException: TCP open
        at com.sun.midp.io.j2me.socket.Protocol.connect(Protocol.java:216)
        at com.sun.midp.io.ConnectionBaseAdapter.openPrim(ConnectionBaseAdapter.java:103)
        at com.sun.midp.io.j2me.socket.Protocol.openPrim(+108)
        at javax.microedition.io.Connector.openPrim(Connector.java:329)
        at javax.microedition.io.Connector.open(Connector.java:222)
        at sip_server2.SocketListener.createNotifier(SocketListener.java:22)
        at sip_server2.SocketListener.run(SocketListener.java:43)

Open in new window

Question by:deniro1974
1 Comment

Accepted Solution

waleed hassan earned 2000 total points
ID: 22747956

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Are you developing a Java application and want to create Excel Spreadsheets? You have come to the right place, this article will describe how you can create Excel Spreadsheets from a Java Application. For the purposes of this article, I will be u…
Hey there Heard about jingle, the add on for XMPP that enables point to point audio between two XMPP clients. No server config necessary. Actually quite a cool feature. However, how good is it if you can not use those voice capabilities to do a P…
Viewers learn how to read error messages and identify possible mistakes that could cause hours of frustration. Coding is as much about debugging your code as it is about writing it. Define Error Message: Line Numbers: Type of Error: Break Down…
The viewer will learn how to implement Singleton Design Pattern in Java.
Suggested Courses
Course of the Month14 days, 21 hours left to enroll

840 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question