Asterisk-Java

org.asteriskjava.manager.event
Class BridgeEvent

java.lang.Object
  extended by java.util.EventObject
      extended by org.asteriskjava.manager.event.ManagerEvent
          extended by org.asteriskjava.manager.event.BridgeEvent
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
LinkEvent, UnlinkEvent

public class BridgeEvent
extends ManagerEvent

A BridgeEvent is triggered when a link between two voice channels is established ("Link") or discontinued ("Unlink").

As of Asterisk 1.6 the Bridge event is reported directly by Asterisk. Asterisk versions up to 1.4 report individual events: LinkEvent and UnlinkEvent.For maximum compatibily do not use the Link and Unlink events in your code. Just use the Bridge event and check for isLink() and isUnlink().

It is implemented in channel.c

Version:
$Id: BridgeEvent.java 971 2008-02-03 15:14:06Z srt $
Author:
srt
See Also:
Serialized Form

Field Summary
static java.lang.String BRIDGE_STATE_LINK
           
static java.lang.String BRIDGE_STATE_UNLINK
           
static java.lang.String BRIDGE_TYPE_CORE
          A channel.c bridge.
static java.lang.String BRIDGE_TYPE_RTP_DIRECT
          An RTP peer-2-peer bridge (NAT support only).
static java.lang.String BRIDGE_TYPE_RTP_NATIVE
          An RTP native bridge.
static java.lang.String BRIDGE_TYPE_RTP_REMOTE
          A remote (re-invite) bridge.
 
Fields inherited from class java.util.EventObject
source
 
Constructor Summary
BridgeEvent(java.lang.Object source)
           
 
Method Summary
 java.lang.String getBridgeState()
          Returns the bridge state.
 java.lang.String getBridgeType()
          Returns the bridge type.
 java.lang.String getCallerId1()
          Returns the Caller*Id number of the first channel.
 java.lang.String getCallerId2()
          Returns the Caller*Id number of the second channel.
 java.lang.String getChannel1()
          Returns the name of the first channel.
 java.lang.String getChannel2()
          Returns the name of the second channel.
 java.lang.String getUniqueId1()
          Returns the unique id of the first channel.
 java.lang.String getUniqueId2()
          Returns the unique id of the second channel.
 boolean isLink()
          Returns whether the two channels have been linked.
 boolean isUnlink()
          Returns whether the two channels have been unlinked.
 void setBridgeState(java.lang.String bridgeState)
          Sets the bridge state.
 void setBridgeType(java.lang.String bridgeType)
          Sets the bridge type.
 void setCallerId1(java.lang.String callerId1)
          Sets the Caller*Id number of the first channel.
 void setCallerId2(java.lang.String callerId2)
          Sets the Caller*Id number of the second channel.
 void setChannel1(java.lang.String channel1)
          Sets the name of the first channel.
 void setChannel2(java.lang.String channel2)
          Sets the name of the second channel.
 void setUniqueId1(java.lang.String uniqueId1)
          Sets the unique id of the first channel.
 void setUniqueId2(java.lang.String uniqueId2)
          Sets the unique id of the second channel.
 
Methods inherited from class org.asteriskjava.manager.event.ManagerEvent
getDateReceived, getPrivilege, getServer, getTimestamp, setDateReceived, setPrivilege, setServer, setTimestamp, toString
 
Methods inherited from class java.util.EventObject
getSource
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

BRIDGE_STATE_LINK

public static final java.lang.String BRIDGE_STATE_LINK
See Also:
Constant Field Values

BRIDGE_STATE_UNLINK

public static final java.lang.String BRIDGE_STATE_UNLINK
See Also:
Constant Field Values

BRIDGE_TYPE_CORE

public static final java.lang.String BRIDGE_TYPE_CORE
A channel.c bridge.

See Also:
Constant Field Values

BRIDGE_TYPE_RTP_NATIVE

public static final java.lang.String BRIDGE_TYPE_RTP_NATIVE
An RTP native bridge.

See Also:
Constant Field Values

BRIDGE_TYPE_RTP_DIRECT

public static final java.lang.String BRIDGE_TYPE_RTP_DIRECT
An RTP peer-2-peer bridge (NAT support only).

See Also:
Constant Field Values

BRIDGE_TYPE_RTP_REMOTE

public static final java.lang.String BRIDGE_TYPE_RTP_REMOTE
A remote (re-invite) bridge.

See Also:
Constant Field Values
Constructor Detail

BridgeEvent

public BridgeEvent(java.lang.Object source)
Method Detail

getBridgeState

public java.lang.String getBridgeState()
Returns the bridge state.

Returns:
"Link" if the two channels have been linked, "Unlink" if they have been unlinked.
Since:
1.0.0
See Also:
BRIDGE_STATE_LINK, BRIDGE_STATE_UNLINK

setBridgeState

public void setBridgeState(java.lang.String bridgeState)
Sets the bridge state.

Parameters:
bridgeState - "Link" if the two channels have been linked, "Unlink" if they have been unlinked.
Since:
1.0.0

getBridgeType

public java.lang.String getBridgeType()
Returns the bridge type.

Available since Asterisk 1.6.

Returns:
the bridge type.
Since:
1.0.0
See Also:
BRIDGE_TYPE_CORE, BRIDGE_TYPE_RTP_NATIVE, BRIDGE_TYPE_RTP_DIRECT, BRIDGE_TYPE_RTP_REMOTE

setBridgeType

public void setBridgeType(java.lang.String bridgeType)
Sets the bridge type.

Parameters:
bridgeType - the bridge type.
Since:
1.0.0

getUniqueId1

public java.lang.String getUniqueId1()
Returns the unique id of the first channel.

Returns:
the unique id of the first channel.

setUniqueId1

public void setUniqueId1(java.lang.String uniqueId1)
Sets the unique id of the first channel.

Parameters:
uniqueId1 - the unique id of the first channel.

getUniqueId2

public java.lang.String getUniqueId2()
Returns the unique id of the second channel.

Returns:
the unique id of the second channel.

setUniqueId2

public void setUniqueId2(java.lang.String uniqueId2)
Sets the unique id of the second channel.

Parameters:
uniqueId2 - the unique id of the second channel.

getChannel1

public java.lang.String getChannel1()
Returns the name of the first channel.

Returns:
the name of the first channel.

setChannel1

public void setChannel1(java.lang.String channel1)
Sets the name of the first channel.

Parameters:
channel1 - the name of the first channel.

getChannel2

public java.lang.String getChannel2()
Returns the name of the second channel.

Returns:
the name of the second channel.

setChannel2

public void setChannel2(java.lang.String channel2)
Sets the name of the second channel.

Parameters:
channel2 - the name of the second channel.

getCallerId1

public java.lang.String getCallerId1()
Returns the Caller*Id number of the first channel.

Returns:
the Caller*Id number of the first channel.
Since:
0.2

setCallerId1

public void setCallerId1(java.lang.String callerId1)
Sets the Caller*Id number of the first channel.

Parameters:
callerId1 - the Caller*Id number of the first channel.
Since:
0.2

getCallerId2

public java.lang.String getCallerId2()
Returns the Caller*Id number of the second channel.

Returns:
the Caller*Id number of the second channel.
Since:
0.2

setCallerId2

public void setCallerId2(java.lang.String callerId2)
Sets the Caller*Id number of the second channel.

Parameters:
callerId2 - the Caller*Id number of the second channel.
Since:
0.2

isLink

public boolean isLink()
Returns whether the two channels have been linked.

Returns:
true the two channels have been linked, false if they have been unlinked.
Since:
1.0.0

isUnlink

public boolean isUnlink()
Returns whether the two channels have been unlinked.

Returns:
true the two channels have been unlinked, false if they have been linked.
Since:
1.0.0

Asterisk-Java

Copyright © 2004-2009 Stefan Reuter. All Rights Reserved.