Ejemplo n.º 1
0
        private static void ActionClientOnChannelDtmfReceivedEvent(IAriClient sender, ChannelDtmfReceivedEvent e)
        {
            // When DTMF received
            switch (e.Digit)
            {
                case "*":
                    sender.Channels.Play(e.Channel.Id, "sound:asterisk-friend");
                    break;
                case "#":
					sender.Channels.Play(e.Channel.Id, "sound:goodbye");
					sender.Channels.Hangup(e.Channel.Id, "normal");
                    break;
                default:
					sender.Channels.Play(e.Channel.Id, string.Format("sound:digits/{0}", e.Digit));
                    break;
            }
        }
Ejemplo n.º 2
0
        private void c_OnChannelDtmfReceivedEvent(object sender, ChannelDtmfReceivedEvent e)
        {
            ConferenceUser confUser = ConferenceUsers.SingleOrDefault(x => x.Channel.Id == e.Channel.Id);
            if (confUser == null) return;

            // Pass digit to conference user
            confUser.KeyPress(e.Digit);
        }