Fields Summary |
---|
private Hashtable | listeningPointsCurrent listening points. |
private Vector | sipProvidersVector of SIP providers. |
protected boolean | stackInitializedFlag indicating the provider has been initialized. |
protected String | routerPathPathto router. |
protected EventScanner | eventScannerCurrent eventscanner. |
protected SipListener | sipListenerCurrent SIP listener. |
protected StackConnector | sipStackConnectorConnector for SIP stack. |
private String | logFilenameName of the logfile used to log messages |
protected String | outboundProxyOutbound proxy for this stack |
protected int | outboundPortOutbound proxy port for this stack |
Methods Summary |
---|
public synchronized ListeningPoint | createListeningPoint(int port, java.lang.String transport)Creates a new peer ListeningPoint on this SipStack on a specified
host, port and transport and returns a reference to the newly created
ListeningPoint object. The newly created ListeningPoint is implicitly
attached to this SipStack upon execution of this method, by adding the
ListeningPoint to the {@link SipStack#getListeningPoints()} of this
SipStack, once it has been successfully created.
if (transport == null)
throw new NullPointerException("null transport");
if (port <= 0)
throw new IllegalArgumentException("bad port");
if (!Utils.equalsIgnoreCase(transport, "UDP") &&
!Utils.equalsIgnoreCase(transport, "TCP"))
throw new TransportNotSupportedException
("bad transport " + transport);
if (Logging.REPORT_LEVEL <= Logging.INFORMATION) {
Logging.report(Logging.INFORMATION, LogChannels.LC_JSR180,
"createListeningPoint " + transport + " / " + port);
}
String key = ListeningPoint.makeKey
(super.stackAddress, port, transport);
ListeningPoint lip = (ListeningPoint)listeningPoints.get(key);
if (lip != null) {
return lip;
} else {
try {
MessageProcessor messageProcessor =
this.createMessageProcessor(port, transport);
lip = new ListeningPoint(this, this.getIPAddress(), port,
transport);
lip.messageProcessor = messageProcessor;
messageProcessor.setListeningPoint(lip);
this.listeningPoints.put(key, lip);
return lip;
} catch (java.io.IOException ex) {
throw new IllegalArgumentException(ex.getMessage());
}
}
|
public SipProvider | createSipProvider(ListeningPoint listeningPoint)Creates a new peer SipProvider on this SipStack on a specified
ListeningPoint and returns a reference to the newly created SipProvider
object. The newly created SipProvider is implicitly attached to this
SipStack upon execution of this method, by adding the SipProvider to the
{@link SipStack#getSipProviders()} of this SipStack, once it has been
successfully created.
if (listeningPoint == null)
throw new NullPointerException("null listeningPoint");
if (listeningPoint.sipProviderImpl != null) {
throw new ObjectInUseException
("Provider already attached!");
}
SipProvider provider = new SipProvider(this);
provider.setListeningPoint(listeningPoint);
this.sipProviders.addElement(provider);
return provider;
|
public void | deleteListeningPoint(ListeningPoint listeningPoint)Deletes the specified peer ListeningPoint attached to this SipStack. The
specified ListeningPoint is implicitly detached from this SipStack upon
execution of this method, by removing the ListeningPoint from the
{@link SipStack#getListeningPoints()} of this SipStack.
if (listeningPoint == null)
throw new NullPointerException("null listeningPoint arg");
ListeningPoint lip = (ListeningPoint) listeningPoint;
// Stop the message processing thread in the listening point.
lip.messageProcessor.stop();
String key = lip.getKey();
this.listeningPoints.remove(key);
|
public void | deleteSipProvider(SipProvider sipProvider)Deletes the specified peer SipProvider attached to this SipStack. The
specified SipProvider is implicitly detached from this SipStack upon
execution of this method, by removing the SipProvider from the
{@link SipStack#getSipProviders()} of this SipStack. Deletion of a
SipProvider does not automatically delete the ListeningPoint from the
SipStack.
if (sipProvider == null)
throw new NullPointerException("null provider arg");
SipProvider sipProviderImpl = (SipProvider) sipProvider;
if (sipProviderImpl.listeningPoint.messageProcessor.inUse()) {
throw new ObjectInUseException("Provider in use");
}
sipProviderImpl.sipListener = null;
sipProviders.removeElement(sipProvider);
|
public java.lang.String | getDefaultTransport()The default transport to use for via headers.
if (isTransportEnabled("udp"))
return "udp";
else if (isTransportEnabled("tcp"))
return "tcp";
else
return null;
|
public java.lang.String | getIPAddress()Gets the IP Address that identifies this SipStack instance. Every Sip
Stack object must have an IP Address and only a single SipStack object
can service a single IP Address. This value is set using the Properties
object passed to the {@link
SipFactory#createSipStack} method upon
creation of the SIP Stack object.
return super.getHostAddress();
|
public ListeningPoint | getListeningPoint(int port, java.lang.String transport)Gets the listening point for a given transport and port.
String key = ListeningPoint.makeKey
(super.stackAddress, port, transport);
if (Logging.REPORT_LEVEL <= Logging.INFORMATION) {
Logging.report(Logging.INFORMATION, LogChannels.LC_JSR180,
"getListeningPoint " + port + "/" + transport);
}
return (ListeningPoint) listeningPoints.get(key);
|
public java.util.Enumeration | getListeningPoints()Returns an Iterator of existing ListeningPoints created by this
SipStack. All of the peer SipProviders of this SipStack will be
proprietary objects belonging to the same stack vendor.
return this.listeningPoints.elements();
|
public java.lang.String | getOutboundProxy()Gets the outbound proxy specification. Return null if no outbound
proxy is specified.
return this.outboundProxy;
|
public Router | getRouter()Gets the Router object that identifies the default
Routing policy of this
SipStack. It also provides means to set an outbound proxy. This value is
set using the Properties object passed to the
{@link SipFactory#createSipStack} method upon
creation of the SIP Stack object.
return super.getRouter();
|
public SipListener | getSipListener()Gets the sip listener for the stack.
return this.sipListener;
|
public java.util.Enumeration | getSipProviders()Returns an Iterator of existing peer SipProviders that have been
created by this SipStack. All of the peer SipProviders of this
SipStack will be proprietary objects belonging to the same stack vendor.
return this.sipProviders.elements();
|
public java.lang.String | getStackName()Gets the user friendly name that identifies this SipStack instance. This
value is set using the Properties object passed to the
{@link SipFactory#createSipStack} method upon
creation of the SIP Stack object.
return this.stackName;
|
public boolean | isRetransmissionFilterActive()This method returns the value of the retransmission filter helper
function for User Agent Client and User Agent Server applications. This
value is set using the Properties object passed to the
{@link SipFactory#createSipStack} method upon
creation of the SIP Stack
object.
The default value of the retransmission filter boolean is
false.
When retransmissions are handled by the SipProvider the application will
not receive {@link Timeout#RETRANSMIT} notifications encapsulated in
{@link gov.nist.siplite.TimeoutEvent}'s. However an application will get
notified when a the underlying transaction expired with
{@link Timeout#TRANSACTION} notifications encapsulated in a
{@link gov.nist.siplite.TimeoutEvent}.
return this.retransmissionFilter;
|
public void | setStackConnector(StackConnector stackConnector)Constructor.
this.sipStackConnector = stackConnector;
|
public void | stopStack()Stops the SIP stack processing.
super.stopStack();
this.eventScanner.stop();
this.sipStackConnector.releaseInstance();
|
public void | transactionErrorEvent(SIPTransactionErrorEvent transactionErrorEvent)Invoked when an error has ocurred with a transaction.
Transaction transaction =
(Transaction) transactionErrorEvent.getSource();
|