Skip to main content

When I try to set the outbound callerId property in the RequestBody and submit the request, nothing happens. The call does not even initiate the first leg of the call. If I remove it, everything works fine. Here is how I am calling it using the Java SDK.


MakeRingOutCallerIdInfo ringOutCallId = new MakeRingOutCallerIdInfo();

ringOutCallId.phoneNumber = callerId;

// Set call body

GetRingOutStatusResponse response = null;

// setup the parameters for the API call

MakeRingOutRequest requestBody = new MakeRingOutRequest();

requestBody.from(new MakeRingOutCallerInfoRequestFrom().phoneNumber(from = from.substring(0,2).contains("+1") ? from : "+1"+from));

requestBody.to(new MakeRingOutCallerInfoRequestTo().phoneNumber(to = to.substring(0,2).contains("+1") ? to : "+1"+to));

requestBody.callerId(new MakeRingOutCallerIdInfo().phoneNumber(callerId = callerId.substring(0,2).contains("+1") ? callerId : "+1"+callerId));

requestBody.playPrompt = false;

// Make the call to Ring Central

response = restClient.restapi().account().extension().ringout().post(requestBody);

Where did you get the callerId from? Is that one of the callerIds belong to the authenticated user extension?


I got it from the local site's number


Check the API response, it could be something like this if the callerId does not belong to the user

{
"errorCode" : "RNG-102",
"message" : "Caller ID should be one of company direct numbers",
"errors" : [ {
"errorCode" : "RNG-102",
"message" : "Caller ID should be one of company direct numbers"
} ]
}

You then need to read the user phone numbers and detect the number feature to see if it is callerId

screen-shot-2021-10-19-at-92027-am.png


I am getting the following error:

{

"errorCode" : "TEL-107",

"message" : "Caller ID: [+1xxxxxxxxxx] is not allowed",

"errors" : [ {

"errorCode" : "TEL-107",

"message" : "Caller ID: [+1xxxxxxxxxx ] is not allowed",

"parameterValue" : "+1xxxxxxxxxx "

} ],

"parameterValue" : "+1xxxxxxxxxx "

}


Did you check if the feature of that phone number?


You can check what callerIDs are allowed to be used for your logged in extension by using this api:
GEThttps://platform.devtest.ringcentral.com/restapi/v1.0/account/accountId/extension/extensionId/caller-id


You can choose one of the numbers from the response list as your callerID for ring-out api.

https://developers.ringcentral.com/api-reference/User-Settings/readExtensionCallerId




Reply