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; } }
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); }