Implementation of SIP Servlet User Policy
Sangho Shin
Columbia University
Department of Computer Science
ss2020@cs.columbia.edu
December 2002
Contents
1 Introduction 4
1.1 User policy . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
1.2 SIP servlet . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 4
2 Architecture 5
2.1 User policy . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5
2.2 SIP servlet user policy handler . . . . . . . . . . . . . . . . . . . 5
2.3 Servlet Engine . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
2.3.1 Servlet Mapping . . . . . . . . . . . . . . . . . . . . . . . 7
2.3.2 Initialization (init()) . . . . . . . . . . . . . . . . . . . . . 9
2.3.3 processRequest . . . . . . . . . . . . . . . . . . . . . . . . 9
2.3.4 processResponse . . . . . . . . . . . . . . . . . . . . . . . 11
2.3.5 Cleanup . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11
2.4 Servlet Loader . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13
2.4.1 Class reloading . . . . . . . . . . . . . . . . . . . . . . . . 13
2.4.2 Multiple class loading . . . . . . . . . . . . . . . . . . . . 13
2.5 Shared Library . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
2.6 Handling XML . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
2.7 Contacts Information . . . . . . . . . . . . . . . . . . . . . . . . . 15
3 CINEMA web interface for sip servlet 16
3.1 SIP servlet display (Scripts.cgi) . . . . . . . . . . . . . . . . . . . 16
3.2 Registration of new SIP servlet . . . . . . . . . . . . . . . . . . . 16
3.2.1 Uploading SIP servlet . . . . . . . . . . . . . . . . . . . . 18
3.2.2 Editing descriptor . . . . . . . . . . . . . . . . . . . . . . 18
3.3 Editing SIP servlet . . . . . . . . . . . . . . . . . . . . . . . . . . 19
3.4 SIP servlet delete. (ScriptDelete.cgi) . . . . . . . . . . . . . . . . 19
4 Sample SIP Servlets 21
4.1 Forward SIP Servlet . . . . . . . . . . . . . . . . . . . . . . . . . 21
4.2 Originating Call Screen SIP Servlet . . . . . . . . . . . . . . . . . 23
4.3 Forward On No Response SIP Servlet . . . . . . . . . . . . . . . 26
4.4 Combination of three SIP servlets . . . . . . . . . . . . . . . . . . 30
1
CONTENTS CONTENTS
5 SIP Servlet API1.0 Implementation 32
6 Conclusion 34
A Implemented Classes and methods 36
B Diretory Structure 41
2
CONTENTS CONTENTS
NOTICE
This document is written under assumption that readers are familliar with
SIP(Session Initiation Protocol) and SIP Servlet API Sepcification Version 1.0.
Therefore, this document dose not describe SIP(Session Initiation Protocol) or
SIP Servlet API Specification Version 1.0 presicely.
If you are not familliar with SIP or SIP Servlet API, please read RFC 3261 for
SIP and SIP Servlet API Version 1.0 Draft 0.51 or 0.7, first.
And, SIP Servlet API Version 1.0 is very similar with Java Servlet API, and
some classes uses the interfaces in Java Servlet API 2.2. So, I recommend that
readers should read Java Servlet API Specification.
3
Chapter 1
Introduction
1.1 User policy
Policy is SIP transaction handling. That is policy decides how to handle SIP
requests and responses. Low-level policy is transaction policy. This policy con-
trols the modules standard handling of a transaction. High-level policy is user
policy, which implements user specific features, and this user policy is imple-
mented by SIP CGI, CPL, SIP Servlets. I implemented SIP servlet user policy
in this research.
1.2 SIP servlet
A SIP servlet is a Java-based application component, managed by a container,
which performs SIP signaling. SIP servlets can inspect and set message headers
and bodies, and they can proxy and respond to requests and forward responses
upstream.
SIP servlets have ready access a wide variety of APIs, directories, databases,
CORBA, the Java Media Framework, etc. and they can reuse Java security
infrastructure.
Currently, two versions of SIP Servlet API is published. The first version was
published in 1999, and this is not standard version. The second one was pub-
lished in May 2002, which is a standard version (version 1.0 Draft 0.51). This
implementation is based on SIP Servlet API Version 1.0 Draft 0.51.
When I am implementing this version, SIP Servlet API Version 1.0 Draft 0.7 is
published. In this version, some classes and functions are appended. However,
in this implementation, they are not included yet.
4