public class Account
extends java.lang.Object
Constructor and Description |
---|
Account(long handle)
Constructor storing the pointer/address to the underlying native object
|
Modifier and Type | Method and Description |
---|---|
long |
accountID()
Gets the ID of the account
|
java.lang.String |
accountName()
Gets the account name
|
void |
accountName(java.lang.String value)
Configures the account name
|
int |
actualRegistrationExpiry() |
Result |
chatSessionEnd(java.lang.String pPeer)
End a chat session
NOT MPLEMENTED!
|
void |
clearMediaCodecs()
Clears the account's codec list
Equivalent to providing an empty list to mediaCodecs.
|
AccountConfig |
configuration()
Gets a COPY of the account configuration
Changes in the returned configuration are not handled!
|
void |
configuration(AccountConfig value)
Sets the account configuration
All changes checks and actions are taken automatically - e.g.
|
Call |
createCall(java.lang.String calleeNumber,
boolean handlingVoipPhoneCallEvents,
boolean video)
Creates and starts an outgoing call
Creates a call originating from the specified user and starts it.
|
Message |
createMessage(MessageType type)
Creates a new EMPTY chat message with the given type
Creates and returns a new empty chat message from the given type that has to be filled in and then sent!
|
Result |
createUser()
Creates a new user account
Creates a new protocol user, based on the assigned configuration, that can be used to register on a server for
incoming calls, create outgoing calls, subscribe for presence, etc.
|
void |
dropProbeEventListener(SIPProbeEventsHandler value)
Removes a specific already added SIP probe event listener
All added/left listeners will be notified for each event.
|
void |
dropStatusEventListener(AccountEventsHandler value)
Removes a specific already added account event listener
All added/left listeners will be notified for each event.
|
protected void |
finalize()
Ensures the underlying native object destruction
|
java.lang.String |
generateUUID(boolean noPrefix,
int bufLen)
Generate a random UUID
Generates a valid RFC 4122 (RFC 2141) UUID URN that can be used for RFC 5626 (SIP Outbound).
|
java.util.List<Call> |
getActiveCalls()
Gets a list with all account's active/ongoing calls
|
long |
handle()
Gets the pointer/address to the underlying native object
|
java.util.List<AudioVideoCodecs> |
mediaCodecs()
Gets the account's codecs allowed to be used
The order in which codecs are added is important.
|
void |
mediaCodecs(java.util.List<AudioVideoCodecs> value)
Configures the account's codecs allowed to be used
The order in which codecs are added is important.
|
Result |
probeSipTransport(java.lang.String domain,
java.lang.String outboundProxy,
java.lang.String username,
java.lang.String authUsername,
java.lang.String password)
Probes for available transports for the given SIP settings
Probes consecutively for transport availability over SIP with the given account settings.
|
Result |
registerAccount()
Registers the user to the configured service
Starts the user's registration process.
|
AccountStatus |
registrationStatus()
Gets the current account registration status
|
Result |
relinquishCallOwnership(Call call) |
Result |
removeUser()
Destroys an user account object
Destroys an user account object and all related structures.
|
Result |
replaceUserRegistration()
Replace user registration
For protocols such as AX2 there is no "binding" and this operation does not apply.
|
Result |
setPresenceStatus(ContactStateType status,
java.lang.String message)
Start a presence publication for the user
Use this function to publish the user's status on the server (if the server supports it).
|
void |
setProbeEventListener(SIPProbeEventsHandler value)
Adds a new SIP probe event listener
All added listeners will be notified for each event.
|
void |
setStatusEventListener(AccountEventsHandler value)
Adds a new account event listener
All added listeners will be notified for each event.
|
Result |
setTlsConfig(SecureUserConfigType userConf,
java.lang.String fileName,
java.lang.String passPhrase)
Configure TLS for a user
Not only configuring a certificates for TLS is needed but also to run without one or to assign the user to a
global TLS transport.
|
Result |
stopPushAndUnregister(boolean shouldRegister) |
Result |
terminateConnection()
Terminates user's TCP-based connection
Destroys the currently used TCP-based connection.
|
Result |
unRegister()
Cancels registration and/or unregisters the user
If the user account is in the process of registration this function will cancel it.
|
long |
userHandle()
Gets the underlying user handler ID
Internally assigned on successful createUser invocation and invalidated on removeUser.
|
public Account(long handle)
handle
- Pointer/address to the underlying native objectpublic long handle()
protected void finalize()
finalize
in class java.lang.Object
public long userHandle()
public AccountConfig configuration()
AccountConfig
public void configuration(AccountConfig value)
value
- The account configurationAccountConfig
public long accountID()
public java.lang.String accountName()
public void accountName(java.lang.String value)
value
- The account's namepublic AccountStatus registrationStatus()
AccountStatus
public java.util.List<AudioVideoCodecs> mediaCodecs()
AudioVideoCodecs
public void mediaCodecs(java.util.List<AudioVideoCodecs> value)
value
- The full list with codecs to be usedAudioVideoCodecs
public int actualRegistrationExpiry()
public Result registerAccount()
Result
public Result unRegister()
Result
public Result createUser()
configuration removeUser
public Result removeUser()
createUser
public void clearMediaCodecs()
mediaCodecs
public void setStatusEventListener(AccountEventsHandler value)
value
- The account event listener to be addeddropStatusEventListener
public void dropStatusEventListener(AccountEventsHandler value)
value
- The account event listener to be removedsetStatusEventListener
public Call createCall(java.lang.String calleeNumber, boolean handlingVoipPhoneCallEvents, boolean video)
calleeNumber
- The number/user to call. The actual address is created from this ID and the account's
configued domain.handlingVoipPhoneCallEvents
- Indicator whether to handle/receive call specific eventsvideo
- Indicator whether to initiate a video call, if supportedCallEventsHandler
public java.util.List<Call> getActiveCalls()
Call
public Message createMessage(MessageType type)
type
- The type of message to be createdMessageType
public Result chatSessionEnd(java.lang.String pPeer)
pPeer
- The Peer with whom to terminate the chat sessionResult
public Result setPresenceStatus(ContactStateType status, java.lang.String message)
status
- Status of the usermessage
- If not NULLor empty, this will be published in the PIDFResult
public Result stopPushAndUnregister(boolean shouldRegister)
public java.lang.String generateUUID(boolean noPrefix, int bufLen)
noPrefix
- Set to 0 for full URN, 1 for a UUID without prefixbufLen
- Available bytes in the buffer (64 bytes or more are sufficient)public Result replaceUserRegistration()
registerAccount unRegister
public void setProbeEventListener(SIPProbeEventsHandler value)
value
- The SIP probe event listener to be addeddropProbeEventListener
public void dropProbeEventListener(SIPProbeEventsHandler value)
value
- The SIP probe event listener to be removedsetProbeEventListener
public Result probeSipTransport(java.lang.String domain, java.lang.String outboundProxy, java.lang.String username, java.lang.String authUsername, java.lang.String password)
domain
- Domain (SIP user creation: realm entry)outboundProxy
- Outbound proxy (SIP user creation: server entry)username
- UsernameauthUsername
- Authentication usernamepassword
- Authentication passwordResult
public Result terminateConnection()
public Result setTlsConfig(SecureUserConfigType userConf, java.lang.String fileName, java.lang.String passPhrase)
userConf
- The TLS server mode setting:
fileName
- Used to point to a PEM or PKCS#12 certificate to load for this user, depending on @p userConf.passPhrase
- Used to provide the encryption pass phrase in case a certificate is being loaded
verifyUserCertificate