net.sf.asterisk.manager
Class Channel

java.lang.Object
  extended by net.sf.asterisk.manager.Channel
All Implemented Interfaces:
java.io.Serializable

public class Channel
extends java.lang.Object
implements java.io.Serializable

Version:
$Id: Channel.java,v 1.13 2005/09/01 19:13:20 srt Exp $
Author:
srt
See Also:
Serialized Form

Constructor Summary
Channel(java.lang.String name, java.lang.String id)
          Creates a new Channel.
Channel(java.lang.String name, java.lang.String id, AsteriskServer server)
          Creates a new Channel on the given server.
 
Method Summary
 void addExtension(Extension extension)
          Adds a visted dialplan entry to the history.
 java.lang.String getAccount()
          Returns the account code used to bill this channel.
 AsteriskServer getAsteriskServer()
          Returns the Asterisk server.
 java.lang.String getCallerId()
          Returns the caller id of this channel.
 java.lang.String getCallerIdName()
          Returns the caller id name of this channel.
 java.lang.String getContext()
          Returns the context of the current extension.
 Extension getCurrentExtension()
          Returns the last visited dialplan entry.
 java.util.Date getDateOfCreation()
          Returns the date this channel has been created.
 java.lang.String getExtension()
          Returns the extension of the current extension.
 java.util.List getExtensions()
          Returns a list of all visited dialplan entries.
 Extension getFirstExtension()
          Returns the first visited dialplan entry.
 java.lang.String getId()
          Returns the unique id of this channel, for example "1099015093.165".
 Channel getLinkedChannel()
          Returns the channel this channel is bridged with, if any.
 java.lang.String getName()
          Returns the name of this channel, for example "SIP/1310-20da".
 java.lang.Integer getPriority()
          Returns the priority of the current extension.
 ChannelStateEnum getState()
          Returns the state of this channel.
 boolean getWasLinked()
          Indicates if this channel was linked to another channel at least once.
 void setAccount(java.lang.String account)
          Sets the account code used to bill this channel.
 void setAsteriskServer(AsteriskServer asteriskServer)
          Sets the Asterisk server.
 void setCallerId(java.lang.String callerId)
          Sets the caller id of this channel.
 void setCallerIdName(java.lang.String callerIdName)
          Sets the caller id of this channel.
 void setDateOfCreation(java.util.Date dateOfCreation)
          Sets the date this channel has been created.
 void setLinkedChannel(Channel linkedChannel)
          Sets the channel this channel is bridged with.
 void setName(java.lang.String name)
          Sets the name of this channel.
 void setState(ChannelStateEnum state)
          Sets the state of this channel.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Channel

public Channel(java.lang.String name,
               java.lang.String id)
Creates a new Channel.

Parameters:
name - name of this channel, for example "SIP/1310-20da".
id - unique id of this channel, for example "1099015093.165".

Channel

public Channel(java.lang.String name,
               java.lang.String id,
               AsteriskServer server)
Creates a new Channel on the given server.

Parameters:
name - name of this channel, for example "SIP/1310-20da".
id - unique id of this channel, for example "1099015093.165".
server - the Asterisk server this channel exists on.
Method Detail

getAsteriskServer

public final AsteriskServer getAsteriskServer()
Returns the Asterisk server.

Returns:
the Asterisk server.

setAsteriskServer

public final void setAsteriskServer(AsteriskServer asteriskServer)
Sets the Asterisk server.

Parameters:
asteriskServer - the Asterisk server to set.

getId

public final java.lang.String getId()
Returns the unique id of this channel, for example "1099015093.165".

Returns:
the unique id of this channel.

getName

public final java.lang.String getName()
Returns the name of this channel, for example "SIP/1310-20da".

Returns:
the name of this channel.

setName

public final void setName(java.lang.String name)
Sets the name of this channel.

Parameters:
name - the name of this channel.

getCallerId

public final java.lang.String getCallerId()
Returns the caller id of this channel.

Returns:
the caller id of this channel.

setCallerId

public final void setCallerId(java.lang.String callerId)
Sets the caller id of this channel.

Parameters:
callerId - the caller id of this channel.

getCallerIdName

public final java.lang.String getCallerIdName()
Returns the caller id name of this channel.

Returns:
the caller id name of this channel.

setCallerIdName

public final void setCallerIdName(java.lang.String callerIdName)
Sets the caller id of this channel.

Parameters:
callerIdName - the caller id name of this channel.

getState

public final ChannelStateEnum getState()
Returns the state of this channel.

Returns:
the state of this channel.

setState

public final void setState(ChannelStateEnum state)
Sets the state of this channel.

Parameters:
state - the state of this channel.

getAccount

public final java.lang.String getAccount()
Returns the account code used to bill this channel.

Returns:
the account code used to bill this channel.

setAccount

public final void setAccount(java.lang.String account)
Sets the account code used to bill this channel.

Parameters:
account - the account code used to bill this channel.

getCurrentExtension

public final Extension getCurrentExtension()
Returns the last visited dialplan entry.

Returns:
the last visited dialplan entry.
Since:
0.2

getFirstExtension

public Extension getFirstExtension()
Returns the first visited dialplan entry.

Returns:
the first visited dialplan entry.
Since:
0.2

getContext

public java.lang.String getContext()
Returns the context of the current extension. This is a shortcut for getCurrentExtension().getContext().

Returns:
the context of the current extension.

getExtension

public java.lang.String getExtension()
Returns the extension of the current extension. This is a shortcut for getCurrentExtension().getExtension().

Returns:
the extension of the current extension.

getPriority

public java.lang.Integer getPriority()
Returns the priority of the current extension. This is a shortcut for getCurrentExtension().getPriority().

Returns:
the priority of the current extension.

getExtensions

public java.util.List getExtensions()
Returns a list of all visited dialplan entries.

Returns:
a list of all visited dialplan entries.
Since:
0.2

addExtension

public void addExtension(Extension extension)
Adds a visted dialplan entry to the history.

Parameters:
extension - the visted dialplan entry to add.
Since:
0.2

getDateOfCreation

public final java.util.Date getDateOfCreation()
Returns the date this channel has been created.

Returns:
the date this channel has been created.

setDateOfCreation

public final void setDateOfCreation(java.util.Date dateOfCreation)
Sets the date this channel has been created.

Parameters:
dateOfCreation - the date this channel has been created.

getLinkedChannel

public final Channel getLinkedChannel()
Returns the channel this channel is bridged with, if any.

Returns:
the channel this channel is bridged with, or null if this channel is currently not bridged to another channel.

setLinkedChannel

public final void setLinkedChannel(Channel linkedChannel)
Sets the channel this channel is bridged with.

Parameters:
linkedChannel - the channel this channel is bridged with.

getWasLinked

public final boolean getWasLinked()
Indicates if this channel was linked to another channel at least once.

Returns:
true if this channel was linked to another channel at least once, false otherwise.
Since:
0.2

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object


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