【问题标题】:How to implement Twilio Conference HangUpOnStar in C#如何在 C# 中实现 Twilio Conference HangUpOnStar
【发布时间】:2018-09-24 00:54:40
【问题描述】:

这个 Twilio TwiML 在 C# 中的等价物是什么?我最感兴趣的是在 C# 中实现 hangupOnStar 并将调用传递给另一个 URL。

<?xml version="1.0" encoding="UTF-8" ?>
<Response>
<Dial hangupOnStar="true">
    <Conference>ConferenceOne</Conference>
</Dial>
<Gather action="http://example.ngrok.io/Conference/Join" numDigits="1">
    <Say>To mute all participants, press one</Say>
    <Say>To leave the conference, press two</Say>
</Gather>
</Response>

【问题讨论】:

  • 还是一样。您只需要使用 TwiML C# 库编写 C# 代码即可生成所需的 TwiML。

标签: c# twilio twilio-twiml conference


【解决方案1】:

“hanguponstar”必须添加到“Dial”示例中:

var dial = new Dial(hangupOnStar: true);

// POST: Conference/Connect
    [HttpPost]
    public ActionResult Connect(string digits)
    {
        var isMuted = digits.Equals("1"); // Listener
        var canControlConferenceOnEnter = digits.Equals("3"); // Moderator

        var response = new VoiceResponse();
        response.Say("You have joined the conference");

        var dial = new Dial(hangupOnStar: true);
        dial.Conference("ConferenceRoom",
            waitUrl: new Uri("http://twimlets.com/holdmusic?Bucket=com.twilio.music.rock"),                
            muted: isMuted,
            startConferenceOnEnter: canControlConferenceOnEnter,
            endConferenceOnExit: canControlConferenceOnEnter);
            response.Append(dial);
        response.Gather();

        return TwiML(response);

    }

【讨论】:

    猜你喜欢
    • 2019-11-16
    • 2019-05-13
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多