54
Cmpe 491 Special Project In Cmpe 491 Special Project In Computer Engineering Computer Engineering SIP User Agent In SIP User Agent In JAVA JAVA Alp Eren YILMAZ & Serdar YALÇINKAYA

Cmpe 491 Special Project In Computer Engineering SIP User Agent In JAVA Alp Eren YILMAZ & Serdar YALÇINKAYA

  • View
    217

  • Download
    1

Embed Size (px)

Citation preview

Cmpe 491 Special Project InCmpe 491 Special Project InComputer EngineeringComputer Engineering

SIP User Agent In JAVASIP User Agent In JAVA

Alp Eren YILMAZ

&

Serdar YALÇINKAYA

Our Agenda - IOur Agenda - I

Introduction to SIP – Alp Eren A Sample of SIP Call – Alp ErenBehaviors of SIP User Agents – Alp ErenSIP Programming – Alp ErenSIP Servers – SerdarSIP Message Structure - Serdar

Our Agenda – IIOur Agenda – II

Evaluation of Tested User Agents - SerdarProposed System - Serdar

– Overview of the System– Development Steps– Typical GUI of the Sytem

Questions

Introduction to SIP:Introduction to SIP:

Session Initiation Protocol (SIP)Session Initiation Protocol (SIP) is an application – layer control (signaling) protocol for creating, modifying and terminating sessions with one or more participants. These sessions includes Internet telephone calls, multimedia distributions and multimedia conferences.

 

Important Properties of SIP :Important Properties of SIP :

The ability of establishing and modifying peer – to – peer multimedia sessions independently of underlying transport protocols and characteristic of session

SIP supports the personal mobility by assigning a single SIP Uniform Resource Identifier (URI)

SIP Communication Messages:SIP Communication Messages:

REGISTRATION – Locate the userINVITE – Initiate the sessionACK – Acknowledge of the INVITEBYE – Termination of the sessionCANCEL – Cancel pending requestOPTIONS – Capability check

Complementary IETF Protocols :Complementary IETF Protocols :

Resources Reservation Protocol – RSVP Real Time Protocol – RTP Real Time Streaming Protocol – RTSPSession Announcement Protocol – SAPSession Description Protocol – SDP

Protocol Layers:Protocol Layers:

Syntax and Encoding LayerTransportation LayerTransaction LayerUser Transaction Layer

Typical SIP Call :Typical SIP Call :

The caller agent Alp @boun.edu.tr– PC user (Soft Phone)

The called party Serdar @ibm.com.tr– SIP Phone user

Two Proxy Servers

Alp ‘s PC @boun.edu..tr

Serdar’s SIP Phone

Typical SIP Call :Typical SIP Call :

Message Sequence:Message Sequence:

SIP User SIP User Agent BehaviorsAgent Behaviors::

Three common characterisctic :

• Generating the request

• Sending the request

• Processing the responses

SIP Programming:SIP Programming:

SIP has texture encoding feature.[1]

SIP allows third parties or user to program

SIP follows HTTP programming model

SIP Programming:SIP Programming:

Programming Mechanisms:Programming Mechanisms:

In order to develop services programmers needs APIs Three mechanisms suggested in IETF:[2]

– SIP Call Processing Language ( SIP – CPL )– SIP Common Gateway Interface ( SIP – CGI )– SIP Servlet

Other efforts – Parlay– JAIN™

Call Processing Language (CPL) :Call Processing Language (CPL) :

Designed by the IETF to support sophisticated telephony services– May be used by both SIP or H.323.

XML based scripting language for describing controlling call services[3]

– Simple Syntax– Extendible– Easily edited by GUI tools

Scripts runs on network SIP signaling server to create end user services– Lightweight CPL interpreter is need to parser & validate scripts.

CPL Example :CPL Example :

A simple script that blocks anonymous callers [4];

<?xml version="1.0" ?><!DOCTYPE cpl PUBLIC "-//IETF//DTD RFCxxxx CPL 1.0//EN" "cpl.dtd"><cpl>  <incoming>    <address-switch field="origin" subfield="user">      <address is="anonymous">        <reject status="reject"          reason="I don't accept anonymous calls" />      </address>    </address-switch>  </incoming></cpl>

Common Gateway Interface (CGI) :Common Gateway Interface (CGI) :

Almost identical to HTTP CGI [5]

Language independent ( Perl, Tcl, C, C++, ... )– Any binary may be executed as a separate program

Suitable for services that contains substantial web content

Passes message parameters through environmental variables to a separate program.

– More flexible but more risky

Feb. 1, 2001: RFC 3050 (Common Gateway Interface for SIP) published [6]

Java Servlets :Java Servlets :

Similar to HTTP servlets Instead of using a separate process, messages are passed to

a class The class runs within a JVM (Java Virtual Machine) on

server Security provided by Java Portable between OSs & servers

JAINJAIN™™ SIP API: SIP API:

Low level API that maps to IETF - RFC 2543 Interfaces for services across circuit switched and packet

networks Three major objectives :

– Service Portability – Write Once Run Anywhere– Network Converges – Any underlying network architecture

IP, ATM,Wireless,...– Service Provider Access by Anyone

Three SIP APIs under JAIN initiative;

– JAIN™ SIP API (JSR 32) : Low level API for almost any signaling protocol ( SIP, H.323, ... ) Requires extensive knowledge of SIP. Avaliable at Final Release, http://jcp.org/jsr/stage/final.jsp

– JAIN™ SIP Lite : High Level API for rapid application development

– Especially User Agent development Under development , http://jcp.org/jsr/detail/125.jsp

– SIP Servlets : [7]

API for SIP servlets Under development, http://jcp.org/jsr/detail/116.jsp

JAINJAIN™™ SIP API: ( Cont.) SIP API: ( Cont.)

Conclusion:Conclusion:

The proposed user agent client will be implemented by using the JAIN SIP API [9] that is released in December 2001.

GUI is designed by using Java Swing

SIP ServersSIP Servers

Three types of servers:– Registrars– Proxy– Redirect

RegistrarsRegistrars

Registrars keep track of users within their assigned network domain

Registrars take register requests and stores the information in the SIP message in a location service

RegistrarsRegistrars

Registrar first looks at the Request-URI if it has access to a location service

responsible for the domainif not, act like a proxy server and

forward the message

RegistrarRegistrar

When gets a register message, it should authenticate the user agent client.

Registrar takes the address in the TO field Checks this address in its location service

for the set of bindings Compares the contact addresses If exists overwrite, else create new binding

RegistrarRegistrar

Checks expiration interval of binding – if it is not refreshed then remove

The registrar must send a 200 (OK) response back if everything Ok

If it fails then a 404 (not found) response is sent.

ProxyProxy

Proxy servers are application-layer routers

that forward the SIP requests and responses to

the proper destinations.

ProxyProxy

Proxies will make routing decisions and modify messages

Responses will route the same proxies in reverse order

ProxyProxy

Two kinds of proxy:– Stateless– Stateful

Stateless ProxyStateless Proxy

Acts as a simple forwarding element Decides the route for the request &

forwards itThen forget all information about the

message

Stateful ProxyStateful Proxy

Remembers information (transaction state) about each incoming and outgoing (processed incoming request) request

This information is used to process future messages related to that particular request

Proxy can decide to fork an incoming request, which must be handled statefully

Stateful ProxyStateful Proxy

Creates new server transactions for requests Check validity of messageDecide route

RedirectRedirect

Redirect servers are useful for reducing the load of the proxy servers that are responsible for routing requests by relying on redirection

Servers push redirect information in the response

Client got the redirection & will send a new request based on the new routing information

SIP MessagesSIP Messages

SIP messages are text based

generic message = start line message header CRLF [message body]

SIP MessagesSIP Messages

Two groups of messages:

– Requests– Responses

RequestsRequests

RegisterInviteAckCancelByeOptions

Requests-RegisterRequests-Register

Register provides a new binding between an

address and one or more contact addresses Can remove previous bindings Query which bindings are currently in place

Requests-InviteRequests-Invite

Invite indicates that the user is being invited to participate in a session

The message body contains a description of the session to which the callee is being invited

SDP is used generally

Requests-AckRequests-Ack

Indicates that the caller has received a final response to the Invite

Ack may contain a body with the final session description

Empty body indicates the session description in the Invite will be used

Requests-Cancel & ByeRequests-Cancel & Bye

The Cancel request cancels a pending request with given Call-ID, To, From and CSeq

Bye indicates to the server that the call will be ended

Requests-OptionsRequests-Options

Options allows a client to query a client or server for their capabilities

Client discovers information about

methods, content types, extensions, codecs etc. supported without actually ”ringing” the other party

ResponsesResponses

SIP Version – Status Code – Reason Phrase3-digit Status CodeThe first digit describes the class of the

response

Responses-Status CodeResponses-Status Code

1xx: Informational 2xx: Success 3xx: Redirection 4xx: Client Error 5xx: Server Error 6xx: Global Failure

Responses-ExamplesResponses-Examples

100 – Trying 180 – Ringing 200 – OK 300 – Multiple Choices 301 – Moved Temporarily 400 – Bad Request 401 – Unauthorized 500 – Internal Server Error 504 – Gateway Time-out 600 – Busy Everywhere

SDPSDP

SDP is intended for describing multimedia sessions for the purposes of session announcement, session invitation, and other forms of multimedia session initiation.

SDPSDP

The purpose of SDP is to convey information about media streams in multimedia sessions to allow the recipients of a session description to participate in the session

SDP includes description ofSDP includes description of

Media to use (codec, sampling rate)

Media destination (IP address and port number)

Session name and purposeTimes the session is activeContact information

User Agents- EZ-PhoneUser Agents- EZ-Phone

User Agents- UbiquityUser Agents- Ubiquity

User Agents- UbiquityUser Agents- Ubiquity

Proposed User AgentProposed User Agent

Implementing a JAVA based User Agent

providing functions: Registering Making, canceling, forwarding, ending a call Address book Debugging Window (Optional) Video Conferencing

Proposed User AgentProposed User Agent

Proposed User AgentProposed User Agent

Proposed User AgentProposed User Agent