Exemplo n.º 1
0
 public ISvamletResponse Hangup(HangupCause cause)
 {
     SetAction(new SvamletActionModel {
         Name = "hangup", Barge = Barge, HangupCause = (int)cause
     });
     return(Build());
 }
Exemplo n.º 2
0
 protected internal static AttendedTransferResult Failed(HangupCause hangupCause)
 {
     return(new AttendedTransferResult()
     {
         Status = AttendedTransferResultStatus.Failed, HangupCause = hangupCause
     });
 }
Exemplo n.º 3
0
 public Task Hangup(HangupCause hangupCause = FreeSwitch.HangupCause.NormalClearing)
 {
     return
         (RunIfAnswered(
              () =>
              eventSocket.SendApi("uuid_kill {0} {1}".Fmt(UUID, hangupCause.ToString().ToUpperWithUnderscores())),
              true));
 }
Exemplo n.º 4
0
        public static Task <CommandReply> Hangup(
            this EventSocket eventSocket, string uuid, HangupCause hangupCause = HangupCause.NormalClearing)
        {
            if (uuid == null)
            {
                throw new ArgumentNullException("uuid");
            }

            return
                (eventSocket.SendCommand(
                     "sendmsg {0}\ncall-command: hangup\nhangup-cause: {1}".Fmt(uuid, hangupCause.ToString().ToUpperWithUnderscores())));
        }
        public override bool ParseParameter(string name, string value)
        {
            if (name == "hangupcause" || name == "hangup-cause")
            {
                var cause = value.UnderscoreToCamelCase();
                _hangupCause = Enumm.Parse<HangupCause>(cause);
            }
            else
                return base.ParseParameter(name, value);

            return true;
        }
Exemplo n.º 6
0
        public override bool ParseParameter(string name, string value)
        {
            if (name == "hangupcause" || name == "hangup-cause")
            {
                var cause = value.UnderscoreToCamelCase();
                _hangupCause = Enumm.Parse <HangupCause>(cause);
            }
            else
            {
                return(base.ParseParameter(name, value));
            }

            return(true);
        }
        public override bool ParseCommand(string name, string value)
        {
            if (name == "hangupcause" || name == "hangup-cause")
            {
                string cause = StringHelper.UpperCaseToCamelCase(value);
                try
                {
                    _hangupCause = (HangupCause)Enum.Parse(typeof(HangupCause), cause, true);
                }
                catch (ArgumentException)
                {
                    _hangupCause = HangupCause.Unknown;
                }
            }
            else
            {
                return(base.ParseCommand(name, value));
            }

            return(true);
        }
Exemplo n.º 8
0
        public static Task<CommandReply> Hangup(
            this EventSocket eventSocket, string uuid, HangupCause hangupCause = HangupCause.NormalClearing)
        {
            if (uuid == null)
            {
                throw new ArgumentNullException("uuid");
            }

            return
                eventSocket.SendCommand(
                    "sendmsg {0}\ncall-command: hangup\nhangup-cause: {1}".Fmt(uuid, hangupCause.ToString().ToUpperWithUnderscores()));
        }
Exemplo n.º 9
0
 /// <summary>
 /// Initializes a new instance of the <see cref="Hangup"/> class.
 /// </summary>
 /// <param name="cause">Why call was hung up.</param>
 public Hangup(HangupCause cause)
 {
     Cause = cause;
 }
Exemplo n.º 10
0
 public Task Hangup(HangupCause hangupCause = FreeSwitch.HangupCause.NormalClearing)
 {
     return
         RunIfAnswered(
             () =>
             eventSocket.SendApi("uuid_kill {0} {1}".Fmt(UUID, hangupCause.ToString().ToUpperWithUnderscores())),
             true);
 }
Exemplo n.º 11
0
 /// <summary>
 /// Initializes a new instance of the <see cref="Hangup"/> class.
 /// </summary>
 /// <param name="cause">Why call was hung up.</param>
 public Hangup(HangupCause cause)
 {
     Cause = cause;
 }