public enum AsteriskPBX extends Enum<AsteriskPBX> implements PBX, ChannelHangupListener
| Enum Constant and Description |
|---|
SELF |
| Modifier and Type | Field and Description |
|---|---|
static String |
ACTIVITY_AGI |
| Modifier and Type | Method and Description |
|---|---|
MeetmeRoom |
acquireMeetmeRoom(RoomOwner owner) |
String |
addAsteriskExtension(String extNumber,
int priority,
String command) |
void |
addListener(FilteredManagerListener<ManagerEvent> listener) |
void |
blindTransfer(Call call,
Call.OperandChannel channelToTransfer,
EndPoint transferTarget,
CallerID toCallerID,
boolean autoAnswer,
long timeout,
ActivityCallback<BlindTransferActivity> listener,
String dialOptions)
The BlindTransferActivity is used by the AsteriksPBX to transfer a live
channel to an endpoint that may need to be dialed.
|
BlindTransferActivity |
blindTransfer(Call call,
Call.OperandChannel channelToTransfer,
EndPoint transferTarget,
CallerID toCallerID,
boolean autoAnswer,
long timeout,
String dialOptions)
The BlindTransferActivity is used by the AsteriksPBX to transfer a live
channel to an endpoint that may need to be dialed.
|
BlindTransferActivity |
blindTransfer(Channel agentChannel,
EndPoint transferTarget,
CallerID toCallerID,
boolean autoAnswer,
int timeout,
ActivityCallback<BlindTransferActivity> iCallback,
String dialOptions) |
BridgeActivity |
bridge(Channel lhsChannel,
Channel rhsChannel)
Utility method to bridge two channels
|
CallerID |
buildCallerID(AbstractChannelEvent event)
Convenience method to build a call id from an event.
|
CallerID |
buildCallerID(String number,
String name) |
DialPlanExtension |
buildDialPlanExtension(String extension)
Builds an end point from an end point name.
|
EndPoint |
buildEndPoint(String fullyQualifiedEndPoint)
Builds an end point from a fully qualified end point name.
|
EndPoint |
buildEndPoint(TechType defaultTech,
String endPointName)
Builds an end point from an end point name.
|
EndPoint |
buildEndPoint(TechType defaultTech,
Trunk trunk,
String endPointName) |
Trunk |
buildTrunk(String trunk) |
void |
channelHangup(Channel channel,
Integer cause,
String causeText) |
boolean |
checkDialplanExists(AsteriskSettings profile) |
boolean |
checkDialplanExists(String dialPlan,
String context) |
void |
conference(Channel channelOne,
Channel channelTwo,
Channel channelThree)
Sends a DTMF tone to given channel.
|
void |
conference(Channel channelOne,
Channel channelTwo,
Channel channelThree,
ActivityCallback<Activity> callback)
Sends a DTMF tone to the given channel.
|
boolean |
createAgiEntryPoint()
Creates the set of extensions required to test NJR during the
installation.
|
DialActivity |
dial(EndPoint from,
CallerID fromCallerID,
EndPoint to,
CallerID toCallerID,
ActivityCallback<DialActivity> callback,
Map<String,String> channelVarsToSet,
String dialOptions) |
void |
dial(EndPoint from,
CallerID fromCallerID,
EndPoint to,
CallerID toCallerID,
ActivityCallback<DialActivity> callback,
String dialOptions)
Dials the given phone number using the specified trunk.
|
DialActivity |
dial(EndPoint from,
CallerID fromCallerID,
EndPoint to,
CallerID toCallerID,
String dialOptions)
Dials the given phone number using the specified trunk.
|
DialLocalToAgiActivity |
dialLocalToAgi(EndPoint from,
CallerID fromCallerID,
ActivityCallback<DialLocalToAgiActivity> callback,
Map<String,String> channelVarsToSet) |
DialToAgiActivityImpl |
dialToAgi(EndPoint endPoint,
CallerID callerID,
AgiChannelActivityAction action,
ActivityCallback<DialToAgiActivity> iCallback,
Map<String,String> channelVarsToSet) |
DialToAgiActivityImpl |
dialToAgiWithAbort(EndPoint endPoint,
CallerID callerID,
int timeout,
AgiChannelActivityAction action,
ActivityCallback<DialToAgiActivity> iCallback) |
boolean |
expectRenameEvents() |
ChannelProxy |
findChannel(String channelName,
String uniqueID) |
Channel |
getChannelByEndPoint(EndPoint endPoint)
Returns the channel currently attached to the given end point, if one
exists.
|
List<ChannelProxy> |
getChannelList() |
EndPoint |
getExtensionAgi() |
DialPlanExtension |
getExtensionPark() |
String |
getManagementContext() |
ChannelProxy |
getProxyById(String id) |
static String |
getSIPADDHeader(boolean inherit,
boolean targetIsSIP) |
String |
getVariable(Channel channel,
String name) |
AsteriskVersion |
getVersion() |
void |
hangup(Call call)
Convenience method to hangup the call without having to extract the
channel yourself.
|
void |
hangup(Channel channel)
Hangs up the given channel.
|
void |
hangup(Channel channel,
ActivityCallback<Activity> callback)
Hangs up the given channel.
|
HoldActivity |
hold(Channel channel)
Put the given channel on hold.
|
Channel |
internalRegisterChannel(String channelName,
String uniqueID)
This method is not part of the public API.
|
boolean |
isBridgeSupported()
Returns true if the bridge function is supported.
|
boolean |
isChannel(String channelName) |
boolean |
isConnected() |
boolean |
isMeetmeInstalled() |
boolean |
isMuteSupported()
Returns true if the mute function is supported.
|
JoinActivity |
join(Call lhs,
Call.OperandChannel originatingOperand,
Call rhs,
Call.OperandChannel acceptingOperand,
CallDirection direction)
Joins two calls not returning until the join completes.
|
void |
join(Call lhs,
Call.OperandChannel originatingOperand,
Call rhs,
Call.OperandChannel acceptingOperand,
CallDirection direction,
ActivityCallback<JoinActivity> listener)
Joins two calls not returning until the join completes.
|
void |
moveChannelTo(Channel channel,
String context,
String exten,
int prio) |
boolean |
moveChannelToAgi(Channel channel) |
ParkActivity |
park(Call call,
Channel parkChannel)
Parks a call by moving the parkChannel to the parking lot and hanging up
the hangupChannel.
|
void |
park(Call call,
Channel parkChannel,
ActivityCallback<ParkActivity> callback)
Parks a call by moving the parkChannel to the parking lot and hanging up
the hangupChannel.
|
void |
performPostCreationTasks() |
RedirectToActivity |
redirectToActivity(Channel channel,
ActivityCallback<RedirectToActivity> listener) |
Channel |
registerChannel(String channelName,
String uniqueIdParam) |
Channel |
registerHangupChannel(String channel,
String uniqueId) |
void |
removeListener(FilteredManagerListener<ManagerEvent> listener) |
ManagerResponse |
sendAction(ManagerAction theAction)
sends an action with a default timeout of 30 seconds.
|
ManagerResponse |
sendAction(ManagerAction theAction,
int timeout) |
void |
sendActionNoWait(ManagerAction action) |
void |
sendDTMF(Channel channel,
DTMFTone tone)
Sends a DTMF tone to given channel.
|
void |
sendDTMF(Channel channel,
DTMFTone tone,
ActivityCallback<Activity> callback)
Sends a DTMF tone to the given channel.
|
ResponseEvents |
sendEventGeneratingAction(EventGeneratingAction action) |
ResponseEvents |
sendEventGeneratingAction(EventGeneratingAction action,
int timeout) |
void |
setVariable(Channel channel,
String name,
String value) |
void |
shutdown()
Call this method when shutting down the PBX interface to allow it to
cleanup.
|
void |
split(Call callToSplit) |
SplitActivity |
split(Call callToSplit,
ActivityCallback<SplitActivity> listener)
Splits a call (with two channels) This call returns once the split action
has completed.
|
void |
transferToMusicOnHold(Channel channel) |
static AsteriskPBX |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static AsteriskPBX[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
boolean |
waitForChannelsToQuiescent(List<Channel> channels,
long timeout)
Waits for a channel to become quiescent.
|
boolean |
waitForChannelToQuiescent(Channel channel,
int timeout) |
public static final AsteriskPBX SELF
public static final String ACTIVITY_AGI
public static AsteriskPBX[] values()
for (AsteriskPBX c : AsteriskPBX.values()) System.out.println(c);
public static AsteriskPBX valueOf(String name)
name - the name of the enum constant to be returned.IllegalArgumentException - if this enum type has no constant with the specified nameNullPointerException - if the argument is nullpublic void performPostCreationTasks()
performPostCreationTasks in interface PBXpublic void shutdown()
public boolean isBridgeSupported()
PBXisBridgeSupported in interface PBXpublic BlindTransferActivity blindTransfer(Call call, Call.OperandChannel channelToTransfer, EndPoint transferTarget, CallerID toCallerID, boolean autoAnswer, long timeout, String dialOptions)
PBXblindTransfer in interface PBXchannelToTransfer - the channel which is to be blind transferedtransferTarget - the endPoint to which the channel is to be
tranferred.toCallerID - - the callerID to display to the transferTarget during
the transfer.autoAnswer - - if true then the transferTarget is to be sent an auto
answer headertimeout - - timeout (in seconds) for the blind transfer attempt.
When the timeout is reached the Blind Transfer will be
cancelled.public void blindTransfer(Call call, Call.OperandChannel channelToTransfer, EndPoint transferTarget, CallerID toCallerID, boolean autoAnswer, long timeout, ActivityCallback<BlindTransferActivity> listener, String dialOptions)
PBXblindTransfer in interface PBXchannelToTransfer - the channel which is to be blind transferedtransferTarget - the endPoint to which the channel is to be
transferred.toCallerID - - the callerID to display to the transferTarget during
the transfer.autoAnswer - - if true then the transferTarget is to be sent an auto
answer headertimeout - - timeout for the blind transfer attempt. When the timeout
is reached the Blind Transfer will be cancelled.public BlindTransferActivity blindTransfer(Channel agentChannel, EndPoint transferTarget, CallerID toCallerID, boolean autoAnswer, int timeout, ActivityCallback<BlindTransferActivity> iCallback, String dialOptions) throws PBXException
PBXExceptionpublic BridgeActivity bridge(Channel lhsChannel, Channel rhsChannel) throws PBXException
lhsChannel - rhsChannel - direction - PBXExceptionpublic void split(Call callToSplit) throws PBXException
split in interface PBXPBXExceptionpublic SplitActivity split(Call callToSplit, ActivityCallback<SplitActivity> listener)
PBXpublic RedirectToActivity redirectToActivity(Channel channel, ActivityCallback<RedirectToActivity> listener)
redirectToActivity in interface PBXpublic JoinActivity join(Call lhs, Call.OperandChannel originatingOperand, Call rhs, Call.OperandChannel acceptingOperand, CallDirection direction)
public void join(Call lhs, Call.OperandChannel originatingOperand, Call rhs, Call.OperandChannel acceptingOperand, CallDirection direction, ActivityCallback<JoinActivity> listener)
public void conference(Channel channelOne, Channel channelTwo, Channel channelThree)
PBXconference in interface PBXpublic void conference(Channel channelOne, Channel channelTwo, Channel channelThree, ActivityCallback<Activity> callback)
PBXconference in interface PBXpublic DialActivity dial(EndPoint from, CallerID fromCallerID, EndPoint to, CallerID toCallerID, String dialOptions)
PBXpublic DialLocalToAgiActivity dialLocalToAgi(EndPoint from, CallerID fromCallerID, ActivityCallback<DialLocalToAgiActivity> callback, Map<String,String> channelVarsToSet)
public DialActivity dial(EndPoint from, CallerID fromCallerID, EndPoint to, CallerID toCallerID, ActivityCallback<DialActivity> callback, Map<String,String> channelVarsToSet, String dialOptions)
public void dial(EndPoint from, CallerID fromCallerID, EndPoint to, CallerID toCallerID, ActivityCallback<DialActivity> callback, String dialOptions)
PBXpublic void hangup(Call call) throws PBXException
hangup in interface PBXPBXExceptionpublic void hangup(Channel channel) throws PBXException
PBXhangup in interface PBXPBXExceptionpublic void hangup(Channel channel, ActivityCallback<Activity> callback)
PBXpublic HoldActivity hold(Channel channel)
PBXpublic boolean isMuteSupported()
PBXisMuteSupported in interface PBXpublic ParkActivity park(Call call, Channel parkChannel)
PBXpublic void park(Call call, Channel parkChannel, ActivityCallback<ParkActivity> callback)
PBXpublic void sendDTMF(Channel channel, DTMFTone tone) throws PBXException
PBXsendDTMF in interface PBXPBXExceptionpublic void sendDTMF(Channel channel, DTMFTone tone, ActivityCallback<Activity> callback)
PBXpublic void transferToMusicOnHold(Channel channel) throws PBXException
transferToMusicOnHold in interface PBXPBXExceptionpublic String getManagementContext()
public Channel getChannelByEndPoint(EndPoint endPoint)
PBXgetChannelByEndPoint in interface PBXpublic void channelHangup(Channel channel, Integer cause, String causeText)
channelHangup in interface ChannelHangupListenerpublic DialPlanExtension getExtensionPark()
public EndPoint getExtensionAgi()
getExtensionAgi in interface PBXpublic EndPoint buildEndPoint(String fullyQualifiedEndPoint)
buildEndPoint in interface PBXpublic EndPoint buildEndPoint(TechType defaultTech, String endPointName)
buildEndPoint in interface PBXpublic EndPoint buildEndPoint(TechType defaultTech, Trunk trunk, String endPointName)
buildEndPoint in interface PBXpublic DialPlanExtension buildDialPlanExtension(String extension)
public CallerID buildCallerID(String number, String name)
buildCallerID in interface PBXpublic CallerID buildCallerID(AbstractChannelEvent event)
event - public Channel registerChannel(String channelName, String uniqueIdParam) throws InvalidChannelName
InvalidChannelNamepublic Channel internalRegisterChannel(String channelName, String uniqueID) throws InvalidChannelName
channelName - uniqueID - InvalidChannelNamepublic Channel registerHangupChannel(String channel, String uniqueId) throws InvalidChannelName
InvalidChannelNamepublic ChannelProxy findChannel(String channelName, String uniqueID)
public MeetmeRoom acquireMeetmeRoom(RoomOwner owner)
public void addListener(FilteredManagerListener<ManagerEvent> listener)
public void removeListener(FilteredManagerListener<ManagerEvent> listener)
public ManagerResponse sendAction(ManagerAction theAction) throws IllegalArgumentException, IllegalStateException, IOException, TimeoutException
theAction - IllegalArgumentExceptionIllegalStateExceptionIOExceptionTimeoutExceptionpublic ManagerResponse sendAction(ManagerAction theAction, int timeout) throws IllegalArgumentException, IllegalStateException, IOException, TimeoutException
public ResponseEvents sendEventGeneratingAction(EventGeneratingAction action) throws EventTimeoutException, IllegalArgumentException, IllegalStateException, IOException
public ResponseEvents sendEventGeneratingAction(EventGeneratingAction action, int timeout) throws EventTimeoutException, IllegalArgumentException, IllegalStateException, IOException
public void setVariable(Channel channel, String name, String value) throws PBXException
PBXExceptionpublic void sendActionNoWait(ManagerAction action)
public AsteriskVersion getVersion()
public boolean isConnected()
public boolean isMeetmeInstalled()
public static String getSIPADDHeader(boolean inherit, boolean targetIsSIP)
public boolean waitForChannelsToQuiescent(List<Channel> channels, long timeout)
waitForChannelsToQuiescent in interface PBXchannel - timeout - the time to wait (in milliseconds) for the channel to
become quiescent.public boolean moveChannelToAgi(Channel channel) throws PBXException
PBXExceptionpublic boolean waitForChannelToQuiescent(Channel channel, int timeout)
waitForChannelToQuiescent in interface PBXpublic ChannelProxy getProxyById(String id)
public DialToAgiActivityImpl dialToAgi(EndPoint endPoint, CallerID callerID, AgiChannelActivityAction action, ActivityCallback<DialToAgiActivity> iCallback, Map<String,String> channelVarsToSet)
public DialToAgiActivityImpl dialToAgiWithAbort(EndPoint endPoint, CallerID callerID, int timeout, AgiChannelActivityAction action, ActivityCallback<DialToAgiActivity> iCallback)
public boolean createAgiEntryPoint()
throws IOException,
AuthenticationFailedException,
TimeoutException
profile - dialContext - IllegalStateExceptionIOExceptionAuthenticationFailedExceptionTimeoutExceptionpublic boolean checkDialplanExists(String dialPlan, String context) throws IOException, TimeoutException
IOExceptionTimeoutExceptionpublic boolean checkDialplanExists(AsteriskSettings profile) throws IllegalArgumentException, IllegalStateException, IOException, TimeoutException
public String addAsteriskExtension(String extNumber, int priority, String command) throws Exception
Exceptionpublic Trunk buildTrunk(String trunk)
buildTrunk in interface PBXpublic List<ChannelProxy> getChannelList()
public boolean expectRenameEvents()
Copyright © 2004–2022. All rights reserved.