Adding Telephony to Java Technology-Based Enterprise Applications

Similar documents
Rhino SIP Servlet Overview and Concepts

Enabling the IP Multimedia Subsystem (IMS) With Java Technology

Telecommunication Services Engineering Lab. Roch H. Glitho

[1]Oracle Communications Converged Application Server. Concepts Release 7.0 E

Oracle Communications Converged Application Server

Overview of the Session Initiation Protocol

Oracle - Developing Applications for the Java EE 7 Platform Ed 1 (Training On Demand)

TSIN02 - Internetworking

Deccansoft Software Services. J2EE Syllabus

BEAWebLogic SIP Server. Technical Product Description

Session Initiation Protocol (SIP)

Oracle WebLogic Server SIP Container

PSD1B Advance Java Programming Unit : I-V. PSD1B- Advance Java Programming

IMS Client Platform and IMS End-to-End

Department of Computer Science. Burapha University 6 SIP (I)

JVA-163. Enterprise JavaBeans

Overview of SIP. Information About SIP. SIP Capabilities. This chapter provides an overview of the Session Initiation Protocol (SIP).

Session Initiation Protocol (SIP) Ragnar Langseth University of Oslo April 26th 2013

SIP SERVICES USING SIP SERVLET API THE INFOLINE SERVICE

Specialized - Mastering JEE 7 Web Application Development

Java EE 6 - Update Harpreet Singh GlassFish Portfolio Product Manager

Chapter 6 Enterprise Java Beans

Oracle Communications Converged Application Server

X-Communicator: Implementing an advanced adaptive SIP-based User Agent for Multimedia Communication

Vision of J2EE. Why J2EE? Need for. J2EE Suite. J2EE Based Distributed Application Architecture Overview. Umair Javed 1

Oracle 10g: Build J2EE Applications

Presence-Based Runtime Composition of IMS Services Deployed in a SIP Servlet Platform

Tuning and development with SIP Servlet on Mobicents. Naoki Nishihara OKI Electric Industry Co.,Ltd Jean Deruelle Mobicents Sip Servlets Lead

Contents at a Glance

Introduction. Enterprise Java Instructor: Please introduce yourself Name Experience in Java Enterprise Edition Goals you hope to achieve

Compliance with RFC 3261

Developing Applications with Java EE 6 on WebLogic Server 12c

Secure Telephony Enabled Middle-box (STEM)

Voice over IP (VoIP)

Tech-invite. RFC 3261's SIP Examples. biloxi.com Registrar. Bob's SIP phone

J2EE Development. Course Detail: Audience. Duration. Course Abstract. Course Objectives. Course Topics. Class Format.

atl IP Telephone SIP Compatibility

The Session Initiation Protocol

J2EE - Version: 25. Developing Enterprise Applications with J2EE Enterprise Technologies

Hands-on Development of Web Applications with Java EE 6

4.2 IMS Service Creation

VoIP Basics. 2005, NETSETRA Corporation Ltd. All rights reserved.

Java- EE Web Application Development with Enterprise JavaBeans and Web Services

Problems on Voice over IP (VoIP)

Media Communications Internet Telephony and Teleconference

SIP Session Initiation Protocol

Information About SIP Compliance with RFC 3261

Advanced Java Programming

(9A05803) WEB SERVICES (ELECTIVE - III)

index_ qxd 7/18/02 11:48 AM Page 259 Index

Java EE Application Assembly & Deployment Packaging Applications, Java EE modules. Model View Controller (MVC)2 Architecture & Packaging EJB Module

Improve and Expand JavaServer Faces Technology with JBoss Seam

Level 1 Technical. Microsoft Lync Basics. Contents

NetBeans IDE Field Guide

Technical White Paper for NAT Traversal

Application Notes for Configuring SIP Trunking between TelePacific SmartVoice SIP Connect and an Avaya IP Office Telephony Solution 1.

White Paper Subcategory. Overview of XML Communication Technologies

VoIP. ALLPPT.com _ Free PowerPoint Templates, Diagrams and Charts

Enterprise Java Unit 1-Chapter 2 Prof. Sujata Rizal Java EE 6 Architecture, Server and Containers

ENSC 833-3: NETWORK PROTOCOLS AND PERFORMANCE. Implement Session Initiation Protocol (SIP) User Agent Prototype

A Standards Based Software Environment for Providing SIP Application Composition

In the most general sense, a server is a program that provides information

The JSR 281 IMS Services API: Time to Deliver

CO Java EE 7: Back-End Server Application Development

Overview p. 1 Server-side Component Architectures p. 3 The Need for a Server-Side Component Architecture p. 4 Server-Side Component Architecture

Module 3 Web Component

COURSE 9 DESIGN PATTERNS

Interactive Distance Learning based on SIP

SIP Compliance APPENDIX

Implementing a Web Service p. 110 Implementing a Web Service Client p. 114 Summary p. 117 Introduction to Entity Beans p. 119 Persistence Concepts p.

ive JAVA EE C u r r i c u l u m

New Features in EJB 3.1

Oracle Communication and Mobility Server: Introduction Student Guide

Java EE 6: Develop Business Components with JMS & EJBs

Ubiquitous Programmable Internet Telephony End System Services

Enterprise Java and Rational Rose - Part II

Distributed Multitiered Application

Java EE 7: Back-End Server Application Development

Application Notes for Configuring SIP Trunking between CenturyLink SIP Trunk (Legacy Qwest) Service and Avaya IP Office R8.0 (16) Issue 1.

Higher layer protocols

JBoss SOAP Web Services User Guide. Version: M5

Java EE 6: Develop Web Applications with JSF

IP Possibilities Conference & Expo. Minneapolis, MN April 11, 2007

Introduction to componentbased software development

Component-Based Software Engineering. ECE493-Topic 5 Winter Lecture 26 Java Enterprise (Part D)

IP Multimedia Subsystem Part 5 Marek Średniawa

Architect Exam Guide. OCM EE 6 Enterprise. (Exams IZO-807,1ZO-865 & IZO-866) Oracle Press ORACLG. Paul R* Allen and Joseph J.

Fast Track to Java EE 5 with Servlets, JSP & JDBC

IP Multimedia Subsystem Application Servers

Java Enterprise Edition

Internet Telephony: Advanced Services. Overview

J2EE Interview Questions

13. Internet Applications 최양희서울대학교컴퓨터공학부

Innovation Networking App Note

Application Notes for Configuring Tidal Communications tnet Business VoIP with Avaya IP Office using SIP Registration - Issue 1.0

Sun Java TM Composite Applications Platform Suite Implementing Selected EAI Patterns

Request for Comments: Category: Standards Track Columbia U. G. Camarillo Ericsson A. Johnston WorldCom J. Peterson Neustar R.

JavaServer Faces Technology, AJAX, and Portlets: It s Easy if You Know How!

Unofficial IRONTON ITSP Setup Guide

IMS Adoption Fueled by the Open IMS Core Project and MySQL

Transcription:

Adding Telephony to Java Technology-Based Enterprise Applications Jonathan Kaplan & Sreeram Duvur Researcher/Architect Sun Microsystems, Inc. http://glassfish.dev.java.net/ TS-4919 2007 JavaOne SM Conference Session TS-4919

Project SailFin Based on Ericsson s contribution of SIP Servlet technology to GlassFish community Foundation technology for many mobile services Also enables media interactions to be added to Enterprise Web applications 2007 JavaOne SM Conference Session TS-4919 2

Adding Telephony to Java Enterprise Applications Learn about SIP Servlets and how to use them to develop voice-enabled enterprise applications. 2007 JavaOne SM Conference Session TS-4919 3

Agenda SIP Technology Overview Using SIP Servlets Simple Example (Click-to-Dial) Enterprise Example (Conference Manager) Scalability and Reliability 2007 JavaOne SM Conference Session TS-4919 4

Can You Do This on the Java Platform? 2007 JavaOne SM Conference Session TS-4919 5

SIP Technology Makes It Possible Session Initiation Protocol Signaling protocol for Internet multimedia Only responsible for setting up communications Defined by RFCs 3261(sip), 4566(sdp), 3550(rtp) Similar to HTTP Text-based request and response Shared status codes (200 OK, 404 Not Found) State data stored in session (SipSession) Different from HTTP Asynchronous Multiple servlets can receive the same message 2007 JavaOne SM Conference Session TS-4919 6

User Registration SIP Registrar/Proxy REGISTER 407 Authenticate sip:alice@wonderland.com REGISTER + RESPONSE OK SUBSCRIBE sip:bob@... OK NOTIFY OK REGISTER 407 Authenticate REGISTER + RESPONSE OK sip:bob@bigcats.com 2007 JavaOne SM Conference Session TS-4919 7

A Simple Call SIP Registrar/Proxy INVITE INVITE sip:alice@wonderland.com RINGING OK ACK BYE OK RTP RINGING OK ACK BYE OK sip:bob@bigcats.com 2007 JavaOne SM Conference Session TS-4919 8

Agenda SIP Technology Overview Using SIP Servlets Simple Example (Click-to-Dial) Enterprise Example (Conference Manager) Scalability and Reliability 2007 JavaOne SM Conference Session TS-4919 9

SIP Servlets API SIP Servlets process SIP message Based on the Generic Servlet model Defined by Java Specification Request (JSR) 116 Defines high-level objects Message, Request, and Response SIPApplicationSession, SipSession, SipFactory Timers Work together with HTTP Servlets HTTP Servlets can initiate calls Send an HTTP URL in a SIP Redirect Share session data 2007 JavaOne SM Conference Session TS-4919 10

Writing SIP Applications Application contains one or more SIP Servlets to handle SIP protocol messages Packaged and deployed as SIP Archive.sar is similar to.war web archive format sip.xml: SIP-specific deployment descriptor SIP Servlets have different methods for handling each type of SIP message e.g., servlet must contain doinvite() method to process an INVITE message No context roots! 2007 JavaOne SM Conference Session TS-4919 11

SIP Application Composition A message may be seen by multiple SIP Applications simultaneously e.g., CallFilter and CallForward Both applications express interest in INVITE Message <sip-app> <servlet> <servlet-name>callfilter <servlet-class>com.acme.callfilter <servlet-mapping> <servlet-name>callfilter <pattern> <equal><var>request.method <value>invite <sip-app> <servlet> <servlet-name>callforward <servlet-class>com.acme.callforward <servlet-mapping> <servlet-name>callforward <pattern> <equal><var>request.method <value>invite INVITE message is seen by both applications. Order is important! 2007 JavaOne SM Conference Session TS-4919 12

Session Management Every established dialog results in a SIPSession Tracks one point-to-point communication session Similar to HttpSession Can be explicitly invalidated or timed out SIPApplicationSession Groups many protocol sessions A SIP application can have many simultaneous sessions Unique to each active invocation of application Reclaimed by explicit invalidation or timer All child sessions must also be ready for reclamation 2007 JavaOne SM Conference Session TS-4919 13

JSR 289: SIP Servlets 1.1 Convergence: combine Java Platform, Enterprise Edition (Java EE platform) and SIP Java EE platform services in SIP applications Dependency injection Invoke Web Services Transactions, Enterprise JavaBeans (EJB ) technology, and Java Persistence API Java EE platform Connectors and Message Driven Beans associated with SIP Sessions Co-packaging SIP services in Java EE platform applications Initiate calls from servlets and EJBs Share state between SIP and web sessions 2007 JavaOne SM Conference Session TS-4919 14

Converged Sessions HttpSession and SIPSession objects are interlinked HttpSession httpsession=req.getsession(); ConvergedHttpSession convsession = (ConvergedHttpSession) httpsession; SipApplicationSession appsession = convsession.getapplicationsession(); Iterator<SipSession> sipsessions = appsession.getsessions( SIP ); 2007 JavaOne SM Conference Session TS-4919 15

Agenda SIP Technology Overview Using SIP Servlets Simple Example (Click-to-Dial) Enterprise Example (Conference Manager) Scalability and Reliability 2007 JavaOne SM Conference Session TS-4919 16

Click-to-Dial Launch and register SIP softphone Click on a registered attendee to place a call Calls your phone first When you answer, calls the other person When they answer, starts the call 2007 JavaOne SM Conference Session TS-4919 17

Click-to-Dial Application Server REGISTER OK REGISTER sip:alice@wonderland.com HTTP POST INVITE sip:alice@... OK ACK OK INVITE sip:bob@... OK ACK sip:bob@bigcats.com RTP 2007 JavaOne SM Conference Session TS-4919 18

Registrar SIP Servlet public class RegistrarServlet extends SipServlet { protected void doregister(sipservletrequest req) { // get the data model from the servlet context Model m = (Model) servletctx.getattribute("model"); // find Alice's object in the database Person a = m.getperson(req.getfrom()); // store the updated phone number for this person a.settelephone(req.getfrom().geturi()); m.updateperson(a); } } // send an OK response SipServletResponse resp = req.createresponse(sc_ok); resp.send(); 2007 JavaOne SM Conference Session TS-4919 19

PlaceCall HTTP Servlet @Resource private SipFactory sipfactory; protected void processrequest(httpservletrequest req, HttpServletResponse resp){ // get registered SIP addresses from database Person alice = model.getperson(request.getsession()); Address a = alice.gettelephone(); Address b = getaddress(request.getattribute( to )); // create a new INVITE request to Alice SipServletRequest req = sipfactory.createrequest(appsession, "INVITE", b, a); // store Bob's address in the sip session req.getsession().setattribute("addr", b); } // send the request req.send(); 2007 JavaOne SM Conference Session TS-4919 20

HandleCall: SIP Servlet protected void dosuccessresponse(sipservletresponse resp){ // retrieve the addresses from the session Address a = (Address) session.getremoteparty(); Address b = (Address) session.getattribute( addr ); // send an invite to Bob SipServletRequest invite = sf.createrequest(appsession,"invite", a, b); invite.setcontent(resp.getcontent(),"application/sdp"); // link the sessions session.setattribute("linked",invite.getsession()); invite.getsession().setattribute("linked", session); } invite.send(); 2007 JavaOne SM Conference Session TS-4919 21

DEMO Click-to-Dial 2007 JavaOne SM Conference Session TS-4919 22

Agenda SIP Technology Overview Using SIP Servlets Simple Example (Click-to-Dial) Enterprise Example (Conference Manager) Scalability and Reliability 2007 JavaOne SM Conference Session TS-4919 23

Sun Labs Conference Manager Integrates VoIP-based telephony Implemented on top of SailFin prototype Converged SIP and web application Demonstrates possibilities of JSR 289 Uses Sun Labs Voice Bridge Pure Java technology RTP Mixing Advanced audio features Based on research into the most common problems in distributed meetings 2007 JavaOne SM Conference Session TS-4919 24

DEMO Conference Manager 2007 JavaOne SM Conference Session TS-4919 25

Architecture Traditional Web App HTTP Web Web App JSP Servlet Conference Session Bean Database Conference Entities JSP = JavaServer Pages Permissions Users 2007 JavaOne SM Conference Session TS-4919 26

Integrating a Media Gateway Runs as a separate process Choose strategy based on interface to gateway SIP-based gateway Back-to-back user agent e.g., MSML, MSCML Other gateways Java EE platform Connector, Message-Driven EJB technology e.g., MGCP, Sun Labs Voice Bridge Coming Soon: JSR 309 2007 JavaOne SM Conference Session TS-4919 27

Java EE Platform Connector Interfaces public interface BridgeConnection { // place a new call and return a call id public String placecall(callparticipant participant); // mute or unmute the given call public void setmute(string callid, boolean ismuted)... } // get the next message from the bridge public BridgeMessage nextmessage(); public interface BridgeMessageListener { // called when a message is received from the bridge public void onmessage(bridgemessage message); } 2007 JavaOne SM Conference Session TS-4919 28

Architecture Java EE Platform Connector HTTP Web Web App JSP Servlet Conference Session Bean Message Driven Bean Database Entities Permissions Conference Users Voice Bridge Connector JCA Connector Voice Bridge JCA = J2EE Connector Architecture 2007 JavaOne SM Conference Session TS-4919 29

Incoming Call Application Server Voice Bridge INVITE sip:alice@wonderland.com TRYING OK ACK BYE OK RTP PREPAR E OK CALL STATUS END 2007 JavaOne SM Conference Session TS-4919 30

SIP Servlet for Incoming Call protected void doinvite(sipservletrequest req) { // notify that we are trying SipServletResponse response = req.createresponse(sipservletresponse.sc_trying); response.send(); // place the call in the bridge BridgeConnection bc = bcf.getconnection(); String callid = bc.placecall(cp); } // setup the session SipApplicationSession s = req.getapplicationsession(); Map callmap = (Map) s.getattribute( callmap ); callmap.put(callid, req.getsession()); req.getsession().setattribute( req, req); 2007 JavaOne SM Conference Session TS-4919 31

Managing Conference State SipSession One per call Maintain user-specific state e.g., name, speaking, mute SipApplicationSession One per conference Maintain conference-wide state e.g., user list, voting state 2007 JavaOne SM Conference Session TS-4919 32

Message-Driven Bean for Call Status @MessageDriven public class StatusBean implements BridgeMessageListener { @EJB private CallHandlerLocal callhandler; @Resource private SipSessionsUtil ssu; public void onmessage(bridgemessage message) { // get the call from the session Call call = getcall(ssu, message.getcallid()); // handle status updates switch (message.getcode()) { case STARTEDSPEAKING: callhandler.speaking(call, true); break; case ENDED: callhandler.callended(call);... 2007 JavaOne SM Conference Session TS-4919 33

Architecture SIP Servlet PSTN Gateway HTTP SIP Web Web App JSP Servlet Conference Session Bean Call Handler Servlet SIP Application Session SIP Servlet RTP Conference State Message Driven Bean Database Entities Permissions Conference Users Voice Bridge Connector JCA Connector Voice Bridge 2007 JavaOne SM Conference Session TS-4919 34

Putting It All Together: Placing a Call HTTP Servlet 2. HTTP Servlet processes request 1. User selects conference call in web UI SIP Servlet Message-Driven Bean JCA Connector Voice Bridge 2007 JavaOne SM Conference Session TS-4919 35

Putting It All Together: Placing a Call HTTP Servlet 3. SIP Servlet places request to SIP gateway, user s phone rings SIP Servlet Message-Driven Bean SIP PSTN JCA Connector Voice Bridge 2007 JavaOne SM Conference Session TS-4919 36

Putting It All Together: Placing a Call HTTP Servlet 4. JCA Connector places call into conference on Voice Bridge, starts RTP mixing. SIP Servlet Message-Driven Bean JCA Connector SIP PSTN Voice Bridge 2007 JavaOne SM Conference Session TS-4919 37

Putting It All Together: Placing a Call HTTP Servlet SIP Servlet Message-Driven Bean SIP RTP PSTN JCA Connector Voice Bridge 5. Status comes back to a message-driven bean, which completes the SIP negotiation 2007 JavaOne SM Conference Session TS-4919 38

Agenda SIP Technology Overview Using SIP Servlets Simple Example (Click-to-Dial) Enterprise Example (Conference Manager) Scalability and Reliability 2007 JavaOne SM Conference Session TS-4919 39

Scalability SIP Load Balancing works on header fields Session-Id stored in Via header Call-Id From and To headers Other policies like actual server load Usually sticky SIPSessions Complexities for conference calls Conference calls with thousands of callers Callers are scattered across the world For performance reasons good to direct all calls in a conference call to same server instance in cluster 2007 JavaOne SM Conference Session TS-4919 40

Scalability Too many callers in a conference Centralized audio mixing can get expensive User s voice quality experience can degrade Solution: hierarchical mixing with careful handling of timestamps Participants are from scattered geographies Aggregate users based on source IP address Local audio mixing and upstream transmission Receive remote mixed stream and match with locally mixed audio 2007 JavaOne SM Conference Session TS-4919 41

Summary JSR 289 brings communications to enterprise Java applications Java EE platform enables development of powerful communications applications From click-to-dial to multi-user collaboration Add multimedia to existing applications Just the beginning Need a better multi-user collaboration frameworks 2007 JavaOne SM Conference Session TS-4919 42

For More Information Project SailFin http://sailfin.dev.java.net GlassFish Project http://glassfish.dev.java.net SIP Servlets 1.1 http://jcp.org/en/jsr/detail?id=289 Conference Manager http://research.sun.com/projects/mc/confmgr.html 2007 JavaOne SM Conference Session TS-4919 43

Q&A Jonathan Kaplan & Sreeram Duvur 2007 JavaOne SM Conference Session TS-4919 44

Adding Telephony to Java Technology-Based Enterprise Applications Jonathan Kaplan & Sreeram Duvur Researcher/Architect Sun Microsystems, Inc. http://glassfish.dev.java.net/ TS-4919 2007 JavaOne SM Conference Session TS-4919