|
Asterisk-Java | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.asteriskjava.manager.ManagerConnectionFactory
public class ManagerConnectionFactory
This factory is the canonical way to obtain new
ManagerConnections.
It creates new connections in state
ManagerConnectionState.INITIAL. Before
you can start using such a connection (i.e. sending
ManagerActions you must
ManagerConnection.login() to change its state
to ManagerConnectionState.CONNECTED.
Example:
ManagerConnectionFactory factory;
ManagerConnection connection;
factory = new ManagerConnectionFactory("localhost", "manager", "secret");
connection = factory.createManagerConnection();
connection.login();
...
connection.logoff();
If want you can use the factory to create multiple connections to the same
server by calling createManagerConnection() multiple times.
ManagerConnection| Constructor Summary | |
|---|---|
ManagerConnectionFactory(java.lang.String hostname,
int port,
java.lang.String username,
java.lang.String password)
Creates a new ManagerConnectionFactory with the given connection data. |
|
ManagerConnectionFactory(java.lang.String hostname,
java.lang.String username,
java.lang.String password)
Creates a new ManagerConnectionFactory with the given connection data and the default port 5038. |
|
| Method Summary | |
|---|---|
ManagerConnection |
createManagerConnection()
Returns a new ManagerConnection in state ManagerConnectionState.CONNECTED. |
ManagerConnection |
createSecureManagerConnection()
Returns a new SSL secured ManagerConnection in state ManagerConnectionState.CONNECTED. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public ManagerConnectionFactory(java.lang.String hostname,
java.lang.String username,
java.lang.String password)
hostname - the hostname of the Asterisk server to connect to.username - the username to use for login as defined in Asterisk's manager.conf.password - the password to use for login as defined in Asterisk's manager.conf.
public ManagerConnectionFactory(java.lang.String hostname,
int port,
java.lang.String username,
java.lang.String password)
hostname - the hostname of the Asterisk server to connect to.port - the port where Asterisk listens for incoming Manager API
connections, usually 5038.username - the username to use for login as defined in Asterisk's manager.conf.password - the password to use for login as defined in Asterisk's manager.conf.| Method Detail |
|---|
public ManagerConnection createManagerConnection()
ManagerConnectionState.CONNECTED.
public ManagerConnection createSecureManagerConnection()
ManagerConnectionState.CONNECTED.
|
Asterisk-Java | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||