Buenas dias, me gustaria saber por que usar un AMI mandando a llamar la funcion *9 para pause y unpause para las grabaciones hay veces que se corta la llamada segun los asesores, pero lo que pasa es que el asesor deja de escuchar al cliente, esta parte la estamos haciendo mediante un webservice y esta programado sobre la informacion de asternet
----Web service---
internal static string SendDtmfOnChannel(string extension, string digits)
{
string responseResult = "Error";
try
{
var channel = GetCurrentChannelExtension(extension);
var digitsArray = digits.ToCharArray();
if(channel!="Error" && digitsArray.Length > 0)
{
var agiRequest = new AgiRequest();
agiRequest.TypeRequest = RequestType.PlayDtmfAction;
//agiRequest.ActionExcecute = "SendDTMF(" + digits + ",250,," + channel + ")";
//agiRequest.ActionExcecute = "PlayDTMF";
//agiRequest.ActionExcecute = "SENDDTMF";
agiRequest.Channel = channel;
//agiRequest.Variable = "action=PlayDTMF,digit=*";
agiRequest.Digit = digitsArray[0].ToString();
var response = new MQClient(prefix).DoInQueue<AgiRequest, AgiResponse>(agiRequest);
if (response.IsSucces)
{
for (int i = 1; i < digitsArray.Length;i++ )
{
System.Threading.Thread.Sleep(500);
agiRequest.Digit = digitsArray[i].ToString();
response = new MQClient(prefix).DoInQueue<AgiRequest, AgiResponse>(agiRequest);
if (response.IsSucces)
responseResult = "Success";
}
}
else
{
responseResult = response.Response.ToString();
NotSucces(response, "error_result.originateaction");
}
}else
{
LogMethods.LogError("No se encontró canal", new Exception("No se encontró canal activo para la extensión " + extension));
}
}
catch (Exception exception)
{
LogMethods.LogError(exception);
throw;
}
return responseResult;
}
---- ASTER.NET
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace AsterNET.Manager.Action
{
/// <summary>
/// The PlayDTMF Plays a dtmf digit on the specified channel.<br/>
/// </summary>
public class PlayDTMFAction : ManagerAction
{
/// <summary>
/// Get the name of this action, i.e. "PlayDTMF".
/// </summary>
override public string Action
{
get { return "PlayDTMF"; }
}
/// <summary>
/// Get/Set Channel on which to play DTMF<br/>
/// This property is required.
/// </summary>
public string Channel { get; set; }
/// <summary>
/// Get/Set digit to play<br/>
/// This property is required.
/// </summary>
public string Digit { get; set; }
/// <summary>
/// Creates a new empty PlayDTMFAction.
/// </summary>
public PlayDTMFAction()
{
}
/// <summary>
/// Creates a new PlayDTMFAction with channel and digit parameter.
/// </summary>
public PlayDTMFAction(string channel, string digit)
{
this.Channel = channel;
this.Digit = digit;
}
}
}