public class UserAgent extends Object
| Constructor and Description |
|---|
UserAgent(javax.servlet.sip.Address aor) |
| Modifier and Type | Method and Description |
|---|---|
void |
addCredentials(Credentials credentials) |
Call |
createCall(javax.servlet.sip.SipServletRequest request) |
Call |
createCall(javax.servlet.sip.URI remote) |
javax.servlet.sip.SipServletRequest |
createRequest(String method,
javax.servlet.sip.Address to) |
javax.servlet.sip.SipServletRequest |
createRequest(String method,
String to) |
javax.servlet.sip.SipServletRequest |
createRequest(String method,
UserAgent agent) |
Dialog |
customize(Dialog dialog) |
javax.servlet.sip.SipServletRequest |
customize(javax.servlet.sip.SipServletRequest request) |
javax.servlet.sip.Address |
getAor() |
javax.servlet.sip.Address |
getContact() |
List<Credentials> |
getCredentials() |
String |
getDomain() |
javax.servlet.sip.SipFactory |
getFactory() |
javax.servlet.sip.Address |
getOutboundProxy() |
Registration.Listener |
getRegistrationListener() |
List<javax.servlet.sip.SipServletResponse> |
getResponses(javax.servlet.sip.SipServletRequest request) |
long |
getTimeout() |
void |
handleInitialRequest(javax.servlet.sip.SipServletRequest request) |
boolean |
register(int expires)
Synchronously registers this
UserAgent's contact with the
given expiration value. |
RequestHandler |
send(javax.servlet.sip.SipServletRequest request)
Sends
request. |
javax.servlet.sip.SipServletResponse |
sendSynchronous(javax.servlet.sip.SipServletRequest request)
Sends
request and waits for the final response. |
javax.servlet.sip.SipServletResponse |
sendSynchronous(String method,
javax.servlet.sip.Address to)
Creates a request with the given method and destination URI and waits for the final response.
|
void |
setContact(javax.servlet.sip.Address contact) |
void |
setDefaultHandler(MessageHandler handler) |
void |
setFactory(javax.servlet.sip.SipFactory factory) |
void |
setOutboundProxy(javax.servlet.sip.Address outboundProxy) |
void |
setRegistrationListener(Registration.Listener listener) |
void |
setTimeout(long timeout) |
boolean |
unregister()
Synchronously unregisters this
UserAgent's contact. |
public javax.servlet.sip.SipFactory getFactory()
public void setFactory(javax.servlet.sip.SipFactory factory)
public Registration.Listener getRegistrationListener()
public void setRegistrationListener(Registration.Listener listener)
registrationListener - the registrationListener to setpublic void setContact(javax.servlet.sip.Address contact)
public javax.servlet.sip.Address getContact()
public javax.servlet.sip.Address getOutboundProxy()
public void setOutboundProxy(javax.servlet.sip.Address outboundProxy)
public void handleInitialRequest(javax.servlet.sip.SipServletRequest request)
throws IOException,
javax.servlet.ServletException
IOExceptionjavax.servlet.ServletExceptionpublic void setDefaultHandler(MessageHandler handler)
public boolean register(int expires)
throws IOException,
javax.servlet.ServletException
UserAgent's contact with the
given expiration value.
This method returns either when success, failure or request timeout is
encountered, and the listener, if any, is notified as well.
Authentication is handled automatically if credentials were provided to
this UserAgent.
On success, the registration is maintained in the background by sending
regularly re-REGISTER requests. Subsequent events (end of registration,
failure to register) will only be reported through the listener.expires - the expiration time demanded by this UserAgent.true if registration was successful,
false otherwise.IOExceptionjavax.servlet.ServletExceptionRegistration#register(javax.servlet.sip.URI, int)public boolean unregister()
throws IOException,
javax.servlet.ServletException
UserAgent's contact.
After this method returns, the contact that was previously registered is
unregistered, and no background activity is sustained to register it
again.true if unregistration was successful,
false otherwise or if unregistration was a no-op.IOExceptionjavax.servlet.ServletExceptionpublic Call createCall(javax.servlet.sip.URI remote) throws IOException, javax.servlet.ServletException
IOExceptionjavax.servlet.ServletExceptionpublic Call createCall(javax.servlet.sip.SipServletRequest request) throws IOException, javax.servlet.ServletException
IOExceptionjavax.servlet.ServletExceptionpublic javax.servlet.sip.SipServletRequest customize(javax.servlet.sip.SipServletRequest request)
public javax.servlet.sip.SipServletRequest createRequest(String method, String to) throws javax.servlet.sip.ServletParseException
javax.servlet.sip.ServletParseExceptionpublic javax.servlet.sip.SipServletRequest createRequest(String method, javax.servlet.sip.Address to)
public javax.servlet.sip.SipServletRequest createRequest(String method, UserAgent agent)
public javax.servlet.sip.SipServletResponse sendSynchronous(String method, javax.servlet.sip.Address to) throws IOException, javax.servlet.ServletException
request - null if no response has been received before timeout.IOExceptionjavax.servlet.ServletException#setTimeout()}public javax.servlet.sip.SipServletResponse sendSynchronous(javax.servlet.sip.SipServletRequest request)
throws IOException,
javax.servlet.ServletException
request and waits for the final response.request - null if no response has been received before timeout.IOExceptionjavax.servlet.ServletException#setTimeout()}public RequestHandler send(javax.servlet.sip.SipServletRequest request) throws IOException, javax.servlet.ServletException
request.request - IOExceptionjavax.servlet.ServletExceptionpublic List<javax.servlet.sip.SipServletResponse> getResponses(javax.servlet.sip.SipServletRequest request)
public long getTimeout()
public void setTimeout(long timeout)
public List<Credentials> getCredentials()
public void addCredentials(Credentials credentials)
public javax.servlet.sip.Address getAor()
public String getDomain()
Copyright © 2014. All Rights Reserved.