News & Announcements User Community Developer Community

Welcome to the RingCentral Community

Please note the community is currently under maintenance and is read-only.

Search
Make sure to review our Terms of Use and Community Guidelines.
  Please note the community is currently under maintenance and is read-only.
Home » Developers
Ringout CallerId not working in Java SDK
Tags: ringout
Oct 19, 2021 at 6:19am   •   4 replies  •  0 likes
Scott Haley

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);

4 Answers
answered on Oct 21, 2021 at 3:28pm  

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




 0
answered on Oct 19, 2021 at 10:39am  

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 "

}


 0
on Oct 19, 2021 at 10:57am   •  0 likes

Did you check if the feature of that phone number?

answered on Oct 19, 2021 at 8:47am  

I got it from the local site's number


 0
on Oct 19, 2021 at 9:20am   •  0 likes

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

answered on Oct 19, 2021 at 7:37am  

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


 0



A new Community is coming to RingCentral!

Posts are currently read-only as we transition into our new platform.

We thank you for your patience
during this downtime.

Try Workflow Builder

Did you know you can easily automate tasks like responding to SMS, team messages, and more? Plus it's included with RingCentral Video and RingEX plans!

Try RingCentral Workflow Builder

PRODUCTS
RingEX
Message
Video
Phone
OPEN ECOSYSTEM
Developer Platform
APIs
Integrated Apps
App Gallery
Developer support
Games and rewards

RESOURCES
Resource center
Blog
Product Releases
Accessibility
QUICK LINKS
App Download
RingCentral App login
Admin Portal Login
Contact Sales
© 1999-2024 RingCentral, Inc. All rights reserved. Legal Privacy Notice Site Map Contact Us