org.speechforge.zanzibar.sip
Class SipServer

java.lang.Object
  extended by org.speechforge.zanzibar.sip.SipServer
All Implemented Interfaces:
org.speechforge.cairo.sip.SessionListener

public class SipServer
extends java.lang.Object
implements org.speechforge.cairo.sip.SessionListener

SipServer is the sip agent for the speech client. It implements SessionListner, so it is notified with Significant SIP events. It also provides methods to initiate SIP requets (i.e. invite and bye). Before using this agent, the following properties need to be set either by calling setters and then startup()(perhaps with Spring) OR use the 4 parameter constructor and the setDaultCairoServer method mySipAddress - the sip address of the agent stackName - a name for the agents sip stack port - the port used by this sip agent transport - transport too use (udp or tcp) cairoSipHostName - the host name of the speech servers sip agent (RM in cairo) cairoSipPort - the port used by the speech servers sip agent cairoSipAddress - the sip address of the speech server

Author:
Spencer Lord <salord@users.sourceforge.net>

Field Summary
(package private)  org.speechforge.cairo.sip.SdpMessage _response
           
(package private)  org.speechforge.cairo.sip.SipSession _session
           
(package private)  boolean responded
           
(package private)  java.util.Map<java.lang.String,org.speechforge.zanzibar.sip.SipServer.SessionPair> waitingList
           
 
Constructor Summary
SipServer()
           
SipServer(java.lang.String mySipAddress, java.lang.String stackName, int port, java.lang.String transport)
           
 
Method Summary
 java.lang.String getCairoSipAddress()
           
 java.lang.String getCairoSipHostName()
           
 int getCairoSipPort()
           
 SpeechletService getDialogService()
           
 java.lang.String getMySipAddress()
           
 int getPort()
           
 java.lang.String getStackName()
           
 java.lang.String getTransport()
           
 void processByeRequest(org.speechforge.cairo.sip.SipSession session)
           
 void processInfoRequest(org.speechforge.cairo.sip.SipSession session, java.lang.String contentType, java.lang.String contentSubType, java.lang.String content)
           
 org.speechforge.cairo.sip.SdpMessage processInviteRequest(org.speechforge.cairo.sip.SdpMessage request, org.speechforge.cairo.sip.SipSession session)
           
 org.speechforge.cairo.sip.SdpMessage processInviteResponse(boolean ok, org.speechforge.cairo.sip.SdpMessage response, org.speechforge.cairo.sip.SipSession session)
           
 void processTimeout(javax.sip.TimeoutEvent event)
           
 org.speechforge.cairo.sip.SdpMessage sendInviteWithoutProxy(java.lang.String to, org.speechforge.cairo.sip.SdpMessage message, java.lang.String peerAddress, int peerPort)
           
 void setCairoSipAddress(java.lang.String cairoSipAddress)
           
 void setCairoSipHostName(java.lang.String cairoSipHostName)
           
 void setCairoSipPort(int cairoSipPort)
           
 void setDefaultCairoServer(java.lang.String cairoSipAddress, java.lang.String cairoSipHostName, int cairoSipPort)
           
 void setDialogService(SpeechletService dialogService)
           
 void setMySipAddress(java.lang.String mySipAddress)
           
 void setPort(int port)
           
 void setStackName(java.lang.String stackName)
           
 void setTransport(java.lang.String transport)
           
 void shutdown()
           
 void startup()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

responded

boolean responded

_response

org.speechforge.cairo.sip.SdpMessage _response

_session

org.speechforge.cairo.sip.SipSession _session

waitingList

java.util.Map<java.lang.String,org.speechforge.zanzibar.sip.SipServer.SessionPair> waitingList
Constructor Detail

SipServer

public SipServer()

SipServer

public SipServer(java.lang.String mySipAddress,
                 java.lang.String stackName,
                 int port,
                 java.lang.String transport)
          throws javax.sip.SipException
Throws:
javax.sip.SipException
Method Detail

startup

public void startup()
             throws javax.sip.SipException
Throws:
javax.sip.SipException

setDefaultCairoServer

public void setDefaultCairoServer(java.lang.String cairoSipAddress,
                                  java.lang.String cairoSipHostName,
                                  int cairoSipPort)

sendInviteWithoutProxy

public org.speechforge.cairo.sip.SdpMessage sendInviteWithoutProxy(java.lang.String to,
                                                                   org.speechforge.cairo.sip.SdpMessage message,
                                                                   java.lang.String peerAddress,
                                                                   int peerPort)
                                                            throws javax.sip.SipException
Throws:
javax.sip.SipException

shutdown

public void shutdown()
              throws javax.sip.ObjectInUseException
Throws:
javax.sip.ObjectInUseException

processInviteResponse

public org.speechforge.cairo.sip.SdpMessage processInviteResponse(boolean ok,
                                                                  org.speechforge.cairo.sip.SdpMessage response,
                                                                  org.speechforge.cairo.sip.SipSession session)
Specified by:
processInviteResponse in interface org.speechforge.cairo.sip.SessionListener

processTimeout

public void processTimeout(javax.sip.TimeoutEvent event)
Specified by:
processTimeout in interface org.speechforge.cairo.sip.SessionListener

processByeRequest

public void processByeRequest(org.speechforge.cairo.sip.SipSession session)
                       throws java.rmi.RemoteException,
                              java.lang.InterruptedException
Specified by:
processByeRequest in interface org.speechforge.cairo.sip.SessionListener
Throws:
java.rmi.RemoteException
java.lang.InterruptedException

processInviteRequest

public org.speechforge.cairo.sip.SdpMessage processInviteRequest(org.speechforge.cairo.sip.SdpMessage request,
                                                                 org.speechforge.cairo.sip.SipSession session)
                                                          throws javax.sdp.SdpException,
                                                                 org.speechforge.cairo.sip.ResourceUnavailableException,
                                                                 java.rmi.RemoteException
Specified by:
processInviteRequest in interface org.speechforge.cairo.sip.SessionListener
Throws:
javax.sdp.SdpException
org.speechforge.cairo.sip.ResourceUnavailableException
java.rmi.RemoteException

getCairoSipAddress

public java.lang.String getCairoSipAddress()
Returns:
the cairoSipAddress

setCairoSipAddress

public void setCairoSipAddress(java.lang.String cairoSipAddress)
Parameters:
cairoSipAddress - the cairoSipAddress to set

getCairoSipHostName

public java.lang.String getCairoSipHostName()
Returns:
the cairoSipHostName

setCairoSipHostName

public void setCairoSipHostName(java.lang.String cairoSipHostName)
Parameters:
cairoSipHostName - the cairoSipHostName to set

getCairoSipPort

public int getCairoSipPort()
Returns:
the cairoSipPort

setCairoSipPort

public void setCairoSipPort(int cairoSipPort)
Parameters:
cairoSipPort - the cairoSipPort to set

getMySipAddress

public java.lang.String getMySipAddress()
Returns:
the mySipAddress

setMySipAddress

public void setMySipAddress(java.lang.String mySipAddress)
Parameters:
mySipAddress - the mySipAddress to set

getPort

public int getPort()
Returns:
the port

setPort

public void setPort(int port)
Parameters:
port - the port to set

getStackName

public java.lang.String getStackName()
Returns:
the stackName

setStackName

public void setStackName(java.lang.String stackName)
Parameters:
stackName - the stackName to set

getTransport

public java.lang.String getTransport()
Returns:
the transport

setTransport

public void setTransport(java.lang.String transport)
Parameters:
transport - the transport to set

getDialogService

public SpeechletService getDialogService()
Returns:
the dialogService

setDialogService

public void setDialogService(SpeechletService dialogService)
Parameters:
dialogService - the dialogService to set

processInfoRequest

public void processInfoRequest(org.speechforge.cairo.sip.SipSession session,
                               java.lang.String contentType,
                               java.lang.String contentSubType,
                               java.lang.String content)
Specified by:
processInfoRequest in interface org.speechforge.cairo.sip.SessionListener


Copyright 2008-2008-2009 SpeechForge. All Rights Reserved.