Exemple #1
0
        public void Llamar(String Telefono, String Extension, Boolean Sincronico = false)
        {
            OriginateAction o = new OriginateAction();

            o.Channel               = "SIP/" + Extension;
            o.Context               = "from-internal";
            o.Exten                 = Prefijo + Limpiar(Telefono);
            o.CallerId              = Limpiar(Telefono);
            o.Priority              = "1";
            o.Timeout               = 15000;
            o.Async                 = true;
            o.Account               = "";
            Conn.Dial              += new DialEventHandler(Conn_Dial);
            Conn.Status            += new StatusEventHandler(Conn_Status);
            Conn.OriginateResponse += new OriginateResponseEventHandler(Conn_OriginateResponse);
            ResponseEvents response = Conn.SendEventGeneratingAction(o, 15000);

            Channel  = response.Events[0].Channel;
            UniqueId = response.Events[0].UniqueId;
            Monitorear(Channel);
            DestChannel = "";

            //ManagerResponse SD = Conn.SendAction(new AgiAction(Canal, "exec(\"SENDDTMF\",\"3\")"));
            //ManagerResponse SD2 = Conn.SendAction(new AgiAction(Canal, "exec(\"SENDDTMF\",\"4\")"));
            //ManagerResponse SD3 = Conn.SendAction(new AgiAction(Canal, "exec(\"SENDDTMF\",\"2\")"));
            //ManagerResponse SD4 = Conn.SendAction(new AgiAction(Canal, "exec(\"SENDDTMF\",\"7\")"));
            //ManagerResponse SD5 = Conn.SendAction(new AgiAction(Canal, "exec(\"SENDDTMF\",\"#\")"));
            //Conn.SendAction(new StatusAction());
            //return new Result { Canal = Channel, UniqueId = UniqueId, Error = "", Status = "", DestChannel = DestChannel };
        }
 /// <summary>
 /// Creates a new EventTimeoutException with the given message and partial result.
 /// </summary>
 /// <param name="message">message with details about the timeout.</param>
 /// <param name="partialResult">the ResponseEvents object filled with the parts that
 /// have been received before the timeout occured.
 /// </param>
 public EventTimeoutException(string message, ResponseEvents partialResult)
     : base(message)
 {
     this.partialResult = partialResult;
 }
Exemple #3
0
 /// <summary>
 /// Creates a new EventTimeoutException with the given message and partial result.
 /// </summary>
 /// <param name="message">message with details about the timeout.</param>
 /// <param name="partialResult">the ResponseEvents object filled with the parts that
 /// have been received before the timeout occured.
 /// </param>
 public EventTimeoutException(string message, ResponseEvents partialResult) : base(message)
 {
     this.partialResult = partialResult;
 }