Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Call Parking Action Improved by Adding Additional Parameter #229

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 30 additions & 2 deletions Asterisk.2013/Asterisk.NET/Manager/Action/ParkAction.cs
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
namespace AsterNET.Manager.Action
namespace AsterNET.Manager.Action
{
/// <summary>
/// The ParkAction allows to send a Channel to a Parking lot.<br />
/// A successful login is the precondition for sending for that
/// </summary>
public class ParkAction : ManagerAction
{

/// <summary>
/// Creates a new ParkAction.
/// </summary>
Expand Down Expand Up @@ -34,6 +35,23 @@ public ParkAction(string channel, string channel2, string timeout, string parkin
this.Parkinglot = parkinglot;
}

/// <summary>
/// Creates a new ParkAction with announce channel .<br />
/// </summary>
/// <param name="callerChannel">Set the Channel which should be parked</param>
/// <param name="calleeChannel">Set the Channel where the Call will end up after the timeout is reached.</param>
/// <param name="timeout">Timeout in milliseconds, after timeout is reached call will come back to channel2</param>
/// <param name="announceChannel">If specified, then this channel will receive an announcement when Channel is parked</param>
/// <param name="parkinglot">Set the Parking lot.</param>
public ParkAction(string callerChannel, string calleeChannel, string announceChannel, string timeout, string parkinglot)
{
Channel = callerChannel;
TimeoutChannel = calleeChannel;
AnnounceChannel = announceChannel;
Timeout = timeout;
Parkinglot = parkinglot;
}

/// <summary>
/// Get the name of this action, i.e. "Park".
/// </summary>
Expand All @@ -52,6 +70,16 @@ public override string Action
/// </summary>
public string Channel2 { get; set; }
Copy link
Collaborator

@Deantwo Deantwo Feb 7, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The copy way didn't work?

public string Channel2 { get { return TimeoutChannel; } set { TimeoutChanne = value; } }


/// <summary>
/// Set the Channel where the Call will end up after the timeout is reached.
/// </summary>
public string TimeoutChannel { get; set; }

/// <summary>
/// Set the Announcement Channel to receive the AMI Announcement.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe add the full parameter description shown on the Asterisk Documentation:
https://wiki.asterisk.org/wiki/display/AST/Asterisk+12+ManagerAction_Park

Channel name to use when constructing the dial string that will be dialed if the parked channel times out. If TimeoutChannel is in a two party bridge with Channel, then TimeoutChannel will receive an announcement and be treated as having parked Channel in the same manner as the Park Call DTMF feature.

/// </summary>
public string AnnounceChannel { get; set; }

/// <summary>
/// Timeout in msec, after timeout is reached call will come back to channel2
/// </summary>
Expand All @@ -62,4 +90,4 @@ public override string Action
/// </summary>
public string Parkinglot { get; set; }
}
}
}