本文整理汇总了Java中com.twilio.sdk.resource.instance.Call类的典型用法代码示例。如果您正苦于以下问题:Java Call类的具体用法?Java Call怎么用?Java Call使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Call类属于com.twilio.sdk.resource.instance包,在下文中一共展示了Call类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: main
import com.twilio.sdk.resource.instance.Call; //导入依赖的package包/类
public static void main(String[] args) throws TwilioRestException {
TwilioRestClient client = new TwilioRestClient(ACCOUNT_SID, AUTH_TOKEN);
// Build a filter for the CallList
List<NameValuePair> params = new ArrayList<NameValuePair>();
params.add(new BasicNameValuePair("Url", "http://demo.twilio.com/docs/voice.xml"));
params.add(new BasicNameValuePair("To", "+14155551212"));
params.add(new BasicNameValuePair("SendDigits", "1234#"));
params.add(new BasicNameValuePair("From", "+18668675310"));
params.add(new BasicNameValuePair("Method", "GET"));
CallFactory callFactory = client.getAccount().getCallFactory();
Call call = callFactory.create(params);
System.out.println(call.getSid());
}
开发者ID:TwilioDevEd,项目名称:api-snippets,代码行数:17,代码来源:example-3.6.x.java
示例2: main
import com.twilio.sdk.resource.instance.Call; //导入依赖的package包/类
public static void main(String[] args) throws TwilioRestException {
TwilioRestClient client = new TwilioRestClient(ACCOUNT_SID, AUTH_TOKEN);
// Build a filter for the CallList
List<NameValuePair> params = new ArrayList<NameValuePair>();
params.add(new BasicNameValuePair("Url", "http://demo.twilio.com/docs/voice.xml"));
params.add(new BasicNameValuePair("To", "+14155551212"));
params.add(new BasicNameValuePair("From", "+18668675310"));
params.add(new BasicNameValuePair("Method", "GET"));
params.add(new BasicNameValuePair("StatusCallback", "https://www.myapp.com/events"));
params.add(new BasicNameValuePair("StatusCallbackMethod", "POST"));
params.add(new BasicNameValuePair("StatusCallbackEvent", "initiated"));
params.add(new BasicNameValuePair("StatusCallbackEvent", "ringing"));
params.add(new BasicNameValuePair("StatusCallbackEvent", "answered"));
params.add(new BasicNameValuePair("StatusCallbackEvent", "completed"));
CallFactory callFactory = client.getAccount().getCallFactory();
Call call = callFactory.create(params);
System.out.println(call.getSid());
}
开发者ID:TwilioDevEd,项目名称:api-snippets,代码行数:22,代码来源:example-4.6.x.java
示例3: main
import com.twilio.sdk.resource.instance.Call; //导入依赖的package包/类
public static void main(String[] args) throws TwilioRestException {
TwilioRestClient client = new TwilioRestClient(ACCOUNT_SID, AUTH_TOKEN);
// Build a filter for the CallList
List<NameValuePair> params = new ArrayList<NameValuePair>();
params.add(new BasicNameValuePair("Url", "http://www.example.com/sipdial.xml"));
params.add(new BasicNameValuePair("To", "sip:[email protected]"));
params.add(new BasicNameValuePair("From", "Jack"));
params.add(new BasicNameValuePair("SipAuthPassword", "secret"));
params.add(new BasicNameValuePair("SipAuthUsername", "jack"));
CallFactory callFactory = client.getAccount().getCallFactory();
Call call = callFactory.create(params);
System.out.println(call.getSid());
}
开发者ID:TwilioDevEd,项目名称:api-snippets,代码行数:17,代码来源:example-2.6.x.java
示例4: main
import com.twilio.sdk.resource.instance.Call; //导入依赖的package包/类
public static void main(String[] args) throws TwilioRestException {
TwilioRestClient client = new TwilioRestClient(ACCOUNT_SID, AUTH_TOKEN);
// Build a filter for the CallList
Map<String, String> params = new HashMap<String, String>();
params.put("Status", "completed");
params.put("StartTime>", "2009-07-06");
CallList calls = client.getAccount().getCalls(params);
// Loop over calls and print out a property for each one.
for (Call call : calls) {
System.out.println(call.getTo());
}
}
开发者ID:TwilioDevEd,项目名称:api-snippets,代码行数:18,代码来源:list-get-example-3.6.x.java
示例5: main
import com.twilio.sdk.resource.instance.Call; //导入依赖的package包/类
public static void main(String[] args) throws TwilioRestException {
TwilioRestClient client = new TwilioRestClient(ACCOUNT_SID, AUTH_TOKEN);
// Build a filter for the CallList
Map<String, String> params = new HashMap<String, String>();
params.put("Status", "busy");
params.put("To", "+15558675310");
CallList calls = client.getAccount().getCalls(params);
// Loop over calls and print out a property for each one.
for (Call call : calls) {
System.out.println(call.getStartTime());
}
}
开发者ID:TwilioDevEd,项目名称:api-snippets,代码行数:18,代码来源:list-get-example-6.6.x.java
示例6: main
import com.twilio.sdk.resource.instance.Call; //导入依赖的package包/类
public static void main(String[] args) throws TwilioRestException {
TwilioRestClient client = new TwilioRestClient(ACCOUNT_SID, AUTH_TOKEN);
// Build a filter for the CallList
Map<String, String> params = new HashMap<String, String>();
params.put("Status", "completed");
params.put("StartTime", "2009-07-06");
CallList calls = client.getAccount().getCalls(params);
// Loop over calls and print out a property for each one.
for (Call call : calls) {
System.out.println(call.getDirection());
}
}
开发者ID:TwilioDevEd,项目名称:api-snippets,代码行数:18,代码来源:list-get-example-2.6.x.java
示例7: main
import com.twilio.sdk.resource.instance.Call; //导入依赖的package包/类
public static void main(String[] args) throws TwilioRestException {
TwilioRestClient client = new TwilioRestClient(ACCOUNT_SID, AUTH_TOKEN);
// Build a filter for the CallList
Map<String, String> params = new HashMap<String, String>();
params.put("Status", "in-progress");
params.put("StartTime>", "2009-07-04");
params.put("StartTime<", "2009-07-06");
CallList calls = client.getAccount().getCalls(params);
// Loop over calls and print out a property for each one.
for (Call call : calls) {
System.out.println(call.getTo());
}
}
开发者ID:TwilioDevEd,项目名称:api-snippets,代码行数:19,代码来源:list-get-example-4.6.x.java
示例8: makeCall
import com.twilio.sdk.resource.instance.Call; //导入依赖的package包/类
public void makeCall(String url, String to, String from) {
try {
TwilioRestClient client = new TwilioRestClient(ACCOUNT_SID, AUTH_TOKEN);
List<NameValuePair> params = new ArrayList<NameValuePair>();
params.add(new BasicNameValuePair("Url", url));
params.add(new BasicNameValuePair("To", to));
params.add(new BasicNameValuePair("From", from));
CallFactory callFactory = client.getAccount().getCallFactory();
Call call = callFactory.create(params);
}
catch (TwilioRestException e) {
System.out.println(e.getErrorMessage());
}
}
开发者ID:Brodan,项目名称:warm-transfers-java,代码行数:17,代码来源:TwilioCallerServlet.java
示例9: makeCall
import com.twilio.sdk.resource.instance.Call; //导入依赖的package包/类
/**
* Makes a twilio outgoing phone call
* @param toPhone the target phone number
* @param twmlUrl the twml to execute (ie "http://demo.twilio.com/docs/voice.xml")
* @return
*/
public Call makeCall(final Phone toPhone,
final Url twmlUrl) throws TwilioRestException {
Preconditions.checkArgument(toPhone != null,"The destination phone must NOT be null!");
Preconditions.checkArgument(twmlUrl != null,"A twml URL is needed!");
Preconditions.checkState(_apiData.existsAccountData() && _apiData.canMakeVoicePhoneCalls(),"The API is NOT configured properly to make phone calls");
TwilioRestClient client = _createTwilioRESTClient();
List<NameValuePair> params = new ArrayList<NameValuePair>();
params.add(new BasicNameValuePair("To",toPhone.asString()));
params.add(new BasicNameValuePair("From",_apiData.getVoicePhone().asString()));
params.add(new BasicNameValuePair("Method","GET"));
params.add(new BasicNameValuePair("FallbackMethod","GET"));
params.add(new BasicNameValuePair("StatusCallbackMethod","GET"));
params.add(new BasicNameValuePair("Record","false"));
params.add(new BasicNameValuePair("Url",twmlUrl.asString()));
// Make the call
CallFactory callFactory = client.getAccount().getCallFactory();
Call call = callFactory.create(params);
log.info("Call stablished with id={}",call.getSid());
return call;
}
开发者ID:opendata-euskadi,项目名称:r01fb,代码行数:30,代码来源:TwilioService.java
示例10: main
import com.twilio.sdk.resource.instance.Call; //导入依赖的package包/类
public static void main(String[] args) throws TwilioRestException {
TwilioRestClient client = new TwilioRestClient(ACCOUNT_SID, AUTH_TOKEN);
Account mainAccount = client.getAccount();
CallFactory callFactory = mainAccount.getCallFactory();
Map<String, String> callParams = new HashMap<String, String>();
final String toNumber = "4153263626";
final String fromNumber = "3109862198";
callParams.put("To", toNumber); // Replace with your phone number
callParams.put("From", fromNumber); // Replace with a Twilio number
callParams.put("Url", URL);
// callParams.put("Url", "http://demo.twilio.com/welcome/voice?fromNumber="+toNumber);
// Make the call
Call call = callFactory.create(callParams);
// Print the call SID (a 32 digit hex like CA123..)
System.out.println("sid - " + call.getSid());
System.out.println("dir - " + call.getDirection());
System.out.println("fro - " + call.getFrom());
System.out.println("answered by - " + call.getAnsweredBy());
System.out.println("price" + call.getPrice());
System.out.println("status - " + call.getStatus());
System.out.println("to - " + call.getTo());
System.out.println("callerName " + call.getCallerName());
System.out.println("start time - " + call.getStartTime());
System.out.println("duration - " + call.getDuration());
}
开发者ID:ongoingjourney,项目名称:MyExperiments,代码行数:26,代码来源:MakeCall.java
示例11: main
import com.twilio.sdk.resource.instance.Call; //导入依赖的package包/类
public static void main(String[] args) throws TwilioRestException {
TwilioRestClient client = new TwilioRestClient(ACCOUNT_SID, AUTH_TOKEN);
// Get an object from its sid. If you do not have a sid,
// check out the list resource examples on this page
Call call = client.getAccount().getCall("CAe03b7cd806070d1f32bdb7f1046a41c0");
FeedbackFactory factory = call.getFeedbackFactory();
// Build a filter for the AccountList
List<NameValuePair> params = new ArrayList<NameValuePair>();
params.add(new BasicNameValuePair("QualityScore", "3"));
params.add(new BasicNameValuePair("Issue", "imperfect-audio"));
factory.create(params);
}
开发者ID:TwilioDevEd,项目名称:api-snippets,代码行数:16,代码来源:instance-post-example-1.6.x.java
示例12: main
import com.twilio.sdk.resource.instance.Call; //导入依赖的package包/类
public static void main(String[] args) throws TwilioRestException {
TwilioRestClient client = new TwilioRestClient(ACCOUNT_SID, AUTH_TOKEN);
// Get an object from its sid. If you do not have a sid,
// check out the list resource examples on this page
Call call = client.getAccount().getCall("CAe1644a7eed5088b159577c5802d8be38");
// Build a filter for the CallList
List<NameValuePair> params = new ArrayList<NameValuePair>();
params.add(new BasicNameValuePair("Url", "http://demo.twilio.com/docs/voice.xml"));
params.add(new BasicNameValuePair("Method", "POST"));
call.update(params);
}
开发者ID:TwilioDevEd,项目名称:api-snippets,代码行数:14,代码来源:example-1.6.x.java
示例13: main
import com.twilio.sdk.resource.instance.Call; //导入依赖的package包/类
public static void main(String[] args) throws TwilioRestException {
TwilioRestClient client = new TwilioRestClient(ACCOUNT_SID, AUTH_TOKEN);
// Get an object from its sid. If you do not have a sid,
// check out the list resource examples on this page
Call call = client.getAccount().getCall("CAe1644a7eed5088b159577c5802d8be38");
// Build a filter for the CallList
List<NameValuePair> params = new ArrayList<NameValuePair>();
params.add(new BasicNameValuePair("Status", "completed"));
call.update(params);
}
开发者ID:TwilioDevEd,项目名称:api-snippets,代码行数:13,代码来源:list-get-example-2.6.x.java
示例14: main
import com.twilio.sdk.resource.instance.Call; //导入依赖的package包/类
public static void main(String[] args) throws TwilioRestException {
TwilioRestClient client = new TwilioRestClient(ACCOUNT_SID, AUTH_TOKEN);
// Build a filter for the CallList
List<NameValuePair> params = new ArrayList<NameValuePair>();
params.add(new BasicNameValuePair("Url", "http://demo.twilio.com/docs/voice.xml"));
params.add(new BasicNameValuePair("To", "+14155551212"));
params.add(new BasicNameValuePair("From", "+15017122661"));
CallFactory callFactory = client.getAccount().getCallFactory();
Call call = callFactory.create(params);
System.out.println(call.getSid());
}
开发者ID:TwilioDevEd,项目名称:api-snippets,代码行数:15,代码来源:example-1.6.x.java
示例15: main
import com.twilio.sdk.resource.instance.Call; //导入依赖的package包/类
public static void main(String[] args) throws TwilioRestException {
TwilioRestClient client = new TwilioRestClient(ACCOUNT_SID, AUTH_TOKEN);
// Build a filter for the CallList
List<NameValuePair> params = new ArrayList<NameValuePair>();
params.add(new BasicNameValuePair("Url", "http://demo.twilio.com/docs/voice.xml"));
params.add(new BasicNameValuePair("To", "client:charlie"));
params.add(new BasicNameValuePair("From", "+15017122661"));
CallFactory callFactory = client.getAccount().getCallFactory();
Call call = callFactory.create(params);
System.out.println(call.getSid());
}
开发者ID:TwilioDevEd,项目名称:api-snippets,代码行数:15,代码来源:example-2.6.x.java
示例16: main
import com.twilio.sdk.resource.instance.Call; //导入依赖的package包/类
public static void main(String[] args) throws TwilioRestException {
TwilioRestClient client = new TwilioRestClient(ACCOUNT_SID, AUTH_TOKEN);
// Build a filter for the CallList
List<NameValuePair> params = new ArrayList<NameValuePair>();
params.add(new BasicNameValuePair("Url", "http://demo.twilio.com/docs/voice.xml"));
params.add(new BasicNameValuePair("To", "+15005550003"));
params.add(new BasicNameValuePair("From", "+15005550006"));
CallFactory callFactory = client.getAccount().getCallFactory();
Call call = callFactory.create(params);
System.out.println(call.getSid());
}
开发者ID:TwilioDevEd,项目名称:api-snippets,代码行数:15,代码来源:test-calls-example-2.6.x.java
示例17: main
import com.twilio.sdk.resource.instance.Call; //导入依赖的package包/类
public static void main(String[] args) throws TwilioRestException {
TwilioRestClient client = new TwilioRestClient(ACCOUNT_SID, AUTH_TOKEN);
// Build a filter for the CallList
List<NameValuePair> params = new ArrayList<NameValuePair>();
params.add(new BasicNameValuePair("Url", "http://demo.twilio.com/docs/voice.xml"));
params.add(new BasicNameValuePair("To", "+14108675310"));
params.add(new BasicNameValuePair("From", "+15005550006"));
CallFactory callFactory = client.getAccount().getCallFactory();
Call call = callFactory.create(params);
System.out.println(call.getSid());
}
开发者ID:TwilioDevEd,项目名称:api-snippets,代码行数:15,代码来源:test-calls-example-1.6.x.java
示例18: main
import com.twilio.sdk.resource.instance.Call; //导入依赖的package包/类
public static void main(String[] args) throws TwilioRestException {
TwilioRestClient client = new TwilioRestClient(ACCOUNT_SID, AUTH_TOKEN);
// Build a filter for the CallList
List<NameValuePair> params = new ArrayList<NameValuePair>();
params.add(new BasicNameValuePair("Url", "http://www.example.com/sipdial.xml"));
params.add(new BasicNameValuePair("To", "sip:[email protected]?hatchkey=4815162342"));
params.add(new BasicNameValuePair("From", "Jack"));
CallFactory callFactory = client.getAccount().getCallFactory();
Call call = callFactory.create(params);
System.out.println(call.getSid());
}
开发者ID:TwilioDevEd,项目名称:api-snippets,代码行数:15,代码来源:example-3.6.x.java
示例19: main
import com.twilio.sdk.resource.instance.Call; //导入依赖的package包/类
public static void main(String[] args) throws TwilioRestException {
TwilioRestClient client = new TwilioRestClient(ACCOUNT_SID, AUTH_TOKEN);
// Build a filter for the CallList
List<NameValuePair> params = new ArrayList<NameValuePair>();
params.add(new BasicNameValuePair("Url", "http://www.example.com/sipdial.xml"));
params.add(new BasicNameValuePair("To", "sip:[email protected]"));
params.add(new BasicNameValuePair("From", "Jack"));
CallFactory callFactory = client.getAccount().getCallFactory();
Call call = callFactory.create(params);
System.out.println(call.getSid());
}
开发者ID:TwilioDevEd,项目名称:api-snippets,代码行数:15,代码来源:example-1.6.x.java
示例20: main
import com.twilio.sdk.resource.instance.Call; //导入依赖的package包/类
public static void main(String[] args) throws TwilioRestException {
TwilioRestClient client = new TwilioRestClient(ACCOUNT_SID, AUTH_TOKEN);
// Get an object from its sid. If you do not have a sid,
// check out the list resource examples on this page
Call call = client.getAccount().getCall("CA42ed11f93dc08b952027ffbc406d0868");
System.out.println(call.getTo());
}
开发者ID:TwilioDevEd,项目名称:api-snippets,代码行数:10,代码来源:instance-get-example-1.6.x.java
注:本文中的com.twilio.sdk.resource.instance.Call类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论