public async Task <string> makeCall(string To, string URL) { string basicAuthUserName = "******"; // The username to use with basic authentication string basicAuthPassword = "******"; // The password to use with basic authentication YtelAPIClient client = new YtelAPIClient(basicAuthUserName, basicAuthPassword); CreateCallsMakecallInput collect = new CreateCallsMakecallInput(); string mfrom = "+19892144063"; collect.From = mfrom; //string to = "+19892144063"; collect.To = To; //string URL = "https://theautomatedrei.com/receiveVoiceCall"; collect.Url = URL; string method = "POST"; collect.Method = method; //string statusCallBackUrl = "StatusCallBackUrl"; //collect.StatusCallBackUrl = statusCallBackUrl; //string statsCallBackMethod = "StatsCallBackMethod"; //collect.StatsCallBackMethod = statsCallBackMethod; string result = await client.Call.CreateCallsMakecallAsync(collect); return(result); }
/// <summary> /// Get client instance /// </summary> /// <returns></returns> public static YtelAPIClient GetClient() { lock (clientSync) { if (client == null) { client = new YtelAPIClient(); } return(client); } }
public async Task <string> SendSMS(string To, string body) { string basicAuthUserName = "******"; // The username to use with basic authentication string basicAuthPassword = "******"; // The password to use with basic authentication YtelAPIClient client = new YtelAPIClient(basicAuthUserName, basicAuthPassword); CreateSmsSendsmsInput collect = new CreateSmsSendsmsInput(); string mfrom = "+19892144063"; collect.From = mfrom; //if(To == null || To == "") //To = "+19892144063"; collect.To = To; //if (body == null || body == "") // body = "Hello Testing"; collect.Body = body; string method = "POST"; collect.Method = method; //string messageStatusCallback = "MessageStatusCallback"; //collect.MessageStatusCallback = messageStatusCallback; bool?smartsms = false; collect.Smartsms = smartsms; bool?deliveryStatus = false; collect.DeliveryStatus = deliveryStatus; string result = await client.SMS.CreateSmsSendsmsAsync(collect); return(result); }
public async Task <string> sendRVM(string To, string URL) { string basicAuthUserName = "******"; // The username to use with basic authentication string basicAuthPassword = "******"; // The password to use with basic authentication YtelAPIClient client = new YtelAPIClient(basicAuthUserName, basicAuthPassword); CreateCallsMakervmInput collect = new CreateCallsMakervmInput(); string mfrom = "+19892144063"; collect.From = mfrom; string RVMID = "+19853284842"; collect.RVMCallerId = RVMID; //string to = "+19892144063"; collect.To = To; //string URL = "https://dl.prokerala.com/downloads/ringtones/files/mp3/meray-paas-tum-ho-pakistani-drama-ost-ringtone-49231.mp3"; collect.VoiceMailURL = URL; string method = "POST"; collect.Method = method; //string statusCallBackUrl = "StatusCallBackUrl"; //collect.StatusCallBackUrl = statusCallBackUrl; //string statsCallBackMethod = "StatsCallBackMethod"; //collect.StatsCallBackMethod = statsCallBackMethod; string result = await client.Call.CreateCallsMakervmAsync(collect); return(result); }