Twilio发起和终止使用Java的SIP URI
问题描述:
我实际上在寻找给定中继线的终止和起始SIP URI。Twilio发起和终止使用Java的SIP URI
我迄今发现的最接近的是:
getCredential
public Credential getCredential(String credentialSid)
Gets the credentials from the credential list
Returns:
the credentials
我如何获得一个credentialSid
,并且,什么是credentialSid
?
SID是安全标识符?
还看到:Twilio: cannot rename subdomain null for SIP termination
答
您可以了解SIP Credentials via the API。
而这个例子中的一个用Java:
// Install the Java helper library from twilio.com/docs/java/install
import com.twilio.sdk.TwilioRestClient;
import com.twilio.sdk.TwilioRestException;
import com.twilio.sdk.resource.instance.sip.Credential;
public class Example {
// Find your Account Sid and Token at twilio.com/user/account
public static final String ACCOUNT_SID = "None";
public static final String AUTH_TOKEN = "your_auth_token";
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
Credential credential = client.getAccount().getCredentialList("CL32a3c49700934481addd5ce1659f04d2").getCredential("SC32a3c49700934481addd5ce1659f04d2");
System.out.println(credential.getUsername());
}
}
希望这有助于!