0

这个 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>
4

1 回答 1

1

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

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

    }
于 2018-09-24T21:15:37.500 回答