Wednesday, July 1, 2009

Design Documentation

Ok. So, First of all there is the "good old" login panel with all the usual username password verification. New users can register themselves.
On successful login, the user can view the home page.
The home page consists of 3 panels :
  • Status Panel: Shows Invites to conferences and their corresponding dtmf code (which is used to join a particular conference).
  • Create Conference Panel: Appears when user clicks on Create Conference. This panel requires the user to enter conference details and send invites to other users. (As the conference is created, Create Conference is replaced by Delete/Remove Conference and View Conference Details.
  • Conference Detail Panel: Appears when user clicks on View Conference Details. Here, the list of people having joined the conference is displayed. The Conference Administrator can mute out or remove people from the conference from here, if he so wishes.

Tuesday, June 16, 2009

Snapshot

The Status shows when a call is coming...so that it can be accepted or rejected.
In a ongoing call the user can enable the chat panel...through which he can send/receive chat messages




Friday, June 12, 2009

Problem: RTP Implementation

There are two programs which should enable RTP sessions. I am using LinPhone from a different machine to call my application. The call gets successfully completed as there are no exceptions thrown at the server console and even the Linphone shows 'Connected' status.

Problem: On speaking using a microphone on either of the ends, no voice is heard.

Thanks.


AudioSipServlet.java:

package org.example.servlet.sip;

import java.io.IOException;
import javax.servlet.sip.ConvergedHttpSession;
import org.mobicents.mscontrol.MsPeer;
import org.mobicents.mscontrol.MsPeerFactory;
import org.mobicents.mscontrol.MsProvider;
import org.mobicents.mscontrol.MsSession;
import org.mobicents.mscontrol.MsConnection;
import org.mobicents.mscontrol.MsLink;


import javax.servlet.ServletException;
import javax.servlet.sip.SipApplicationSession;
import javax.servlet.sip.SipFactory;
import javax.servlet.sip.SipServletMessage;
import javax.servlet.sip.SipServletRequest;
import javax.servlet.sip.SipServletResponse;
import javax.servlet.sip.SipSession;
import javax.servlet.sip.SipURI;


public class AudioSipServlet extends javax.servlet.sip.SipServlet implements
javax.servlet.Servlet {

// The SipFactory is used to create SIP request and SIP URIs
public static final String PR_JNDI_NAME = "media/trunk/PacketRelay/$";


protected void doInvite(SipServletRequest request) throws ServletException,
IOException {



log(" 1 Received INVITE request" + request.getMethod());
SipServletResponse response = request
.createResponse(SipServletResponse.SC_RINGING);
response.send();
Object sdpObj = request.getContent();
byte[] sdpBytes = (byte[]) sdpObj;
String sdp = new String(sdpBytes);
try {
String user = request.getFrom().getDisplayName();
if (user == null && request.getFrom().getURI() instanceof SipURI) {
user = ((SipURI) request.getFrom().getURI()).getUser();
}
/* MsPeerFactory - to get MsPeer instance */
/* MsPeer - returns an instance of a Peer object */
MsPeer mspeer = MsPeerFactory
.getPeer("org.mobicents.mscontrol.impl.MsPeerImpl");

/*
* Returns an instance of Provider object which contains the desired
* service name
*/

MsProvider msprovider = mspeer.getProvider();

/*
* MsSession provides a transient association of connections for
* real-time communication interchange
*/
/* createSession() - creates a session with no links */

MsSession mssession = msprovider.createSession();

/*
* createNetworkConnection(identifier) - specifies the identifier of
* media server endpoint
*/
MsConnection msconnection = mssession
.createNetworkConnection(PR_JNDI_NAME);

MediaConnectionListener listener = new MediaConnectionListener(request);
msconnection.addConnectionListener(listener);
msconnection.modify("$", sdp);
//request.getSession().setAttribute("msconnection", msconnection);
log (" 1 No exceptions");
} catch (Exception e) {
e.printStackTrace();

}

}


//log("Current Status: " + appSession.getAttribute("status").toString());

}




MediaConnectionListener.java:

package org.example.servlet.sip;

import java.io.IOException;

import javax.servlet.sip.SipServletRequest;
import javax.servlet.sip.SipServletResponse;

import org.apache.log4j.Logger;
import org.mobicents.mscontrol.MsConnection;
import org.mobicents.mscontrol.MsConnectionEvent;
import org.mobicents.mscontrol.MsConnectionListener;
import org.mobicents.mscontrol.MsEndpoint;
import org.mobicents.mscontrol.MsProvider;
import org.mobicents.mscontrol.MsSession;
import org.mobicents.mscontrol.MsNotifyEvent;

import javax.servlet.sip.SipServletMessage;
import org.mobicents.mscontrol.MsNotificationListener;



public class MediaConnectionListener implements MsConnectionListener,
MsNotificationListener {
private static Logger logger = Logger
.getLogger(MediaConnectionListener.class);

private SipServletMessage sipMessage;
private MsProvider provider;

public MediaConnectionListener(SipServletMessage message) {
System.out.println("2 Media Connection Listener");
this.sipMessage = message;

}

public void connectionCreated(MsConnectionEvent event) {
logger.info("connection created " + event);
}

public void connectionInitialized(MsConnectionEvent arg0) {
logger.info("connection initialized " + arg0);
}

public void connectionDisconnected(MsConnectionEvent arg0) {
logger.info("connection disconnected " + arg0);
}

public void connectionFailed(MsConnectionEvent arg0) {
logger.error("connection failed " + arg0);
if (sipMessage instanceof SipServletRequest) {
SipServletRequest inviteRequest = (SipServletRequest) sipMessage;
try {
inviteRequest.createResponse(
SipServletResponse.SC_SERVER_INTERNAL_ERROR).send();
} catch (IOException e) {
logger
.error(
"Exception in sending the error response",
e);
}
}

}

public void connectionHalfOpen(MsConnectionEvent arg0) {
logger.info("connection half opened" + arg0);
}

public void connectionOpen(MsConnectionEvent event) {
System.out.println("connection open");
if (sipMessage instanceof SipServletRequest) {
SipServletRequest request = (SipServletRequest) sipMessage;
connectionOpenRequest(event, request);
}

else {
SipServletResponse response = (SipServletResponse) sipMessage;
connectionOpenResponse(event, response);
}
}

public void connectionOpenResponse(MsConnectionEvent event,
SipServletResponse response) {
System.out.println("connection open response");
String sdp = event.getConnection().getLocalDescriptor();
SipServletRequest ack = response.createAck();

try {
ack.setContent(sdp, "application/sdp");
ack.send();
} catch (Exception e) {
logger.error(e);
}

provider = ConferenceCenter.getInstance().getProvider();
MsConnection msconnection = event.getConnection();
MsEndpoint msendpoint = msconnection.getEndpoint();
MsSession mssession = msconnection.getSession();

}

public void connectionOpenRequest(MsConnectionEvent event,
SipServletRequest inviteRequest) {

logger.info("connection open request" + event);
String sdp = event.getConnection().getLocalDescriptor();
SipServletResponse sipServletResponse = inviteRequest
.createResponse(SipServletResponse.SC_OK);
try {
sipServletResponse.setContent(sdp, "application/sdp");
sipServletResponse.send();
} catch (Exception e) {
logger.error(e);
}

}

public SipServletMessage getSipMessage() {
return sipMessage;
}

public void connectionModeRecvOnly(MsConnectionEvent arg0) {
// TODO Auto-generated method stub

}

public void connectionModeSendOnly(MsConnectionEvent arg0) {
// TODO Auto-generated method stub

}

public void update(MsNotifyEvent evt) {
logger.info(evt);
}

public void connectionModeSendRecv(MsConnectionEvent arg0) {
// TODO Auto-generated method stub

}

}

Monday, June 8, 2009

Update - 2

URL for online code repository: http://jvprism.googlecode.com/svn/trunk/

Deliverables completed:
- Login page
- Registration page
- Home page

The current repository includes
  • jboss-web.xml for mapping to a connection pool.
  • Prism.java for successful connection between our app. and a client.
  • Functionalities of other servlets are defined within.
Initially we tried working on Seam Framework but faced difficulties and hence had to switch over to normal JSPs.
Our Seam query was posted on the following forum:

http://seamframework.org/Community/LoginMethod

Replies till now have not been satisfactory. Do let us know if someone at your end could help us with our query.

Currently, working on
  • Enabling media sessions
  • Chat using SIP
We will be updating you on our progress.

Tuesday, June 2, 2009

Update 1

The problem posted on the blog pertaining to Eclipse was with the required plugins for SIP etc. The problem has been sorted.

Deliverables by Friday(06/05/2009):

Registration Page

Login Page

Home page
, will show

- a list of contacts(add, remove, edit, features will be present)
- Current status
- Text box for dialing a specific URI
- Chat option along with with a text box

Will be using MySQl as the backend.

Wednesday, May 27, 2009

Problem configuring Eclipse Ganymede

We have figured out how the telco framework will interact with the server layer and the media layer (and even the coding part,partially) but just cant set up eclipse and all the tools to start working need some help. can somebody help us over an IRC session ?

Monday, May 25, 2009

Setting Up the Tools

mobicents: http://sourceforge.net/project/showfiles.php?group_id=102670 [mobicents-all with JBoss 4.2.3GA]
[for eclipse server adapter to be selected is JBoss 4.2]

jboss tools for eclipse ganymede: http://www.jboss.org/tools/download.html

plug for developing Jain-SLEE applications : https://mobicents.dev.java.net/

Friday, May 22, 2009

Hi

First Post
"Hello World!"