SDK Upgrade (Legacy to Active)
Upgrade from .NET SDK Legacy to v4.10.0 or Latest Version
Migrate from legacy .NET SDK to v4.10.0+ — code changes required
Was this page helpful?
Documentation Index
Fetch the complete documentation index at: /docs/llms.txt
Use this file to discover all available pages before exploring further.
Migrate from legacy .NET SDK to v4.10.0+ — code changes required
using System;
using System.Collections.Generic;
using RestSharp;
using Plivo.API;
using System;
using System.Collections.Generic;
using Plivo;
RestAPI plivo = new RestAPI("<auth_id>","<auth_token>");
var api = new PlivoApi("<auth_id>","<auth_token>");
IRestResponse<Call> resp = plivo.make_call(new Dictionary<string, string>()
{params});
var response = api.Call.Create(params);
using System;
using System.Collections.Generic;
using RestSharp;
using Plivo.API;
namespace make_calls
{
class Program
{
static void Main(string[] args)
{
RestAPI plivo = new RestAPI("<auth_id>", "<auth_token>");
IRestResponse<Call> resp = plivo.make_call(new Dictionary<string, string>()
{
{ "from", "2025551212" },
{ "to", "2025552323" },
{ "answer_url", "https://s3.amazonaws.com/static.plivo.com/answer.xml" },
{ "answer_method","GET"},
});
Console.Write(resp.Content);
Console.ReadLine();
}
}
}
using System;
using System.Collections.Generic;
using Plivo;
using Plivo.Exception;
namespace PlivoExamples
{
internal class Program
{
public static void Main(string[] args)
{
var api = new PlivoApi("<auth_id>", "<auth_token>");
try
{
var response = api.Call.Create(
to: new List<String> { "+12025552323" },
from: "+12025551212",
answerMethod: "GET",
answerUrl: "https://s3.amazonaws.com/static.plivo.com/answer.xml"
);
Console.WriteLine(response);
}
catch (PlivoRestException e)
{
Console.WriteLine("Exception: " + e.Message);
}
}
}
}
using System;
using System.Collections.Generic;
using Plivo.XML;
namespace Plivo
{
class MainClass
{
public static void Main(string[] args)
{
Plivo.XML.Response resp = new Plivo.XML.Response();
Plivo.XML.Dial dial = new Plivo.XML.Dial(new
Dictionary<string, string>() {
{"dialMusic", "https://<yourdomain>.com/dial_music/"}
});
dial.AddNumber("12025552323",
new Dictionary<string, string>() { });
resp.Add(dial);
var output = resp.ToString();
Console.WriteLine(output);
}
}
}
using System;
using System.Collections.Generic;
using Plivo.XML;
namespace Plivo
{
class MainClass
{
public static void Main(string[] args)
{
Plivo.XML.Response resp = new Plivo.XML.Response();
Plivo.XML.Dial dial = new Plivo.XML.Dial(new
Dictionary<string, string>() {
{"dialMusic", "https://<yourdomain>.com/dial_music/"}
});
dial.AddNumber("12025552323",
new Dictionary<string, string>() { });
resp.Add(dial);
var output = resp.ToString();
Console.WriteLine(output);
}
}
}
using System;
using System.Collections.Generic;
using Plivo.XML;
namespace Plivo
{
class MainClass
{
public static void Main(string[] args)
{
Plivo.XML.Response resp = new Plivo.XML.Response();
resp.AddConference("My room",
new Dictionary<string, string>()
{
{"startConferenceOnEnter", "true"},
{"endConferenceOnExit", "true"},
{"waitSound", "https://<yourdomain>.com/waitmusic/"}
});
var output = resp.ToString();
Console.WriteLine(output);
}
}
}
using System;
using System.Collections.Generic;
using Plivo.XML;
namespace Plivo
{
class MainClass
{
public static void Main(string[] args)
{
Plivo.XML.Response resp = new Plivo.XML.Response();
resp.AddConference("My room",
new Dictionary<string, string>()
{
{"startConferenceOnEnter", "true"},
{"endConferenceOnExit", "true"},
{"waitSound", "https://<yourdomain>.com/waitmusic/"}
});
var output = resp.ToString();
Console.WriteLine(output);
}
}
}
using System;
using System.Collections.Generic;
using System.Diagnostics;
using RestSharp;
using Plivo.API;
namespace PlivoExamples
{
internal class Program
{
public static void Main(string[] args)
{
string auth_id = "<auth_id>";
string auth_token = "<auth_token>";
RestAPI plivo = new RestAPI(auth_id, auth_token);
IRestResponse<Plivo.API.Record> resp = plivo.record(new Dictionary<string, string>()
{
{ "call_uuid", uuid } // ID of the call
});
Debug.WriteLine(resp.Content);
}
}
}
using System;
using System.Collections.Generic;
using Plivo;
using Plivo.Exception;
namespace PlivoExamples
{
internal class Program
{
public static void Main(string[] args)
{
var api = new PlivoApi("<auth_id>","<auth_token>");
try
{
var response = api.Call.StartRecording(
callUuid:"10c94053-73b4-46fe-b74a-12159d1d3d60"
);
Console.WriteLine(response);
}
catch (PlivoRestException e)
{
Console.WriteLine("Exception: " + e.Message);
}
}
}
}
using System;
using System.Collections.Generic;
using Plivo.XML;
namespace Plivo
{
class MainClass
{
public static void Main(string[] args)
{
Plivo.XML.Response resp = new Plivo.XML.Response();
resp.AddRecord(new Dictionary<string, string>() {
{"action", "https://<yourdomain>.com/get_recording/"},
{"startOnDialAnswer", "true"},
{"redirect", "false"}
});
Plivo.XML.Dial dial = new Plivo.XML.Dial(new
Dictionary<string, string>()
{ });
dial.AddNumber("12025552323",
new Dictionary<string, string>() { });
resp.Add(dial);
var output = resp.ToString();
Console.WriteLine(output);
}
}
}
using System;
using System.Collections.Generic;
using Plivo.XML;
namespace Plivo
{
class MainClass
{
public static void Main(string[] args)
{
Plivo.XML.Response resp = new Plivo.XML.Response();
resp.AddRecord(new Dictionary<string, string>() {
{"action", "https://<yourdomain>.com/get_recording/"},
{"startOnDialAnswer", "true"},
{"redirect", "false"}
});
Plivo.XML.Dial dial = new Plivo.XML.Dial(new
Dictionary<string, string>()
{ });
dial.AddNumber("12025552323",
new Dictionary<string, string>() { });
resp.Add(dial);
var output = resp.ToString();
Console.WriteLine(output);
}
}
}
Was this page helpful?