Esempio n. 1
0
    static void Main()
    {
        var response = new VoiceResponse();
        var refer    = new Refer();

        refer.Sip(new Uri("sip:[email protected]?X-AcctNumber=123456&X-ReasonForCalling=billing-question"));
        response.Append(refer);

        Console.WriteLine(response.ToString());
    }
Esempio n. 2
0
    static void Main()
    {
        var response = new VoiceResponse();
        var refer    = new Refer(action: new Uri("/handleRefer"), method: Twilio.Http.HttpMethod.Post);

        refer.Sip(new Uri("sip:[email protected]"));
        response.Append(refer);

        Console.WriteLine(response.ToString());
    }
Esempio n. 3
0
    static void Main()
    {
        var response = new VoiceResponse();
        var refer    = new Refer();

        refer.Sip(new Uri("sip:[email protected]?User-to-User=123456789%3Bencoding%3Dhex"));
        response.Append(refer);

        Console.WriteLine(response.ToString());
    }
Esempio n. 4
0
    static void Main()
    {
        var response = new VoiceResponse();
        var refer    = new Refer();

        refer.Sip(new Uri("sip:[email protected]"));
        response.Append(refer);

        Console.WriteLine(response.ToString());
    }
Esempio n. 5
0
        public void TestElementWithChildren()
        {
            var elem = new Refer();

            elem.Sip(new Uri("https://example.com"));

            Assert.AreEqual(
                "<?xml version=\"1.0\" encoding=\"utf-8\"?>" + Environment.NewLine +
                "<Refer>" + Environment.NewLine +
                "  <Sip>https://example.com</Sip>" + Environment.NewLine +
                "</Refer>",
                elem.ToString()
                );
        }