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
api subscription to department extension not forwarding the call to agents automatically on call arrival
Tags: sdk
Apr 28, 2019 at 9:22pm   •   2 replies  •  0 likes
bruno-dmello

steps

1. I am subscribed to all the following extensions : departments, individual extension ids

2. whenever we recieve a call and the caller types the extension id for individual agent , we recieve the agents presence in subscription properly..

3. when I select on department 's extension on call, the call is not forwarded to agent directly, and I am not receiving that notification in callback for that agent. Instead I receive notification object for department extension as :

{


"uuid": "*",

"event": "/restapi/v1.0/account/*/extension/*/presence?detailedTelephonyState=true",

"timestamp": "*",

"subscriptionId": "*",

"ownerId": "*",

"body": {


"extensionId": *,

"sequence": *,

"presenceStatus": "Offline"

}

}

4. even when the presence of agent extension is already enabled


So I am not able to figure out if this is right way to do things.

My aim is to recieve department call and get the presence of agent using subscription api to whom the call is forwarded to.


2 Answers
answered on Apr 29, 2019 at 8:16pm  
I didn't configured anything or any api to control thing, I only made sure that under group section-> the list of users are active as well as call handling is set to simultaneous type.  

the overall procedure coded is a follows: 
1. get the list of extensions by department :
/account/~/extension?type=Department
2. then I loop over its data to get members of all department
getCallMembersExtensions = (allExtensions) => {
return (extensionResults)=>{
let extensionDetails = extensionResults.json();
let memberList = extensionDetails.records.map(({id}) => {
allExtensions.push(this.getPresenceLink(id))
return platform.get('/account/~/department/${id}/members')
})
return Promise.all(memberList)
}
}
4. prepare the presence links  
getMemberPresence = (allExtensions) => {
return (memberDetails) => {
console.log("memberDetails", memberDetails);
memberDetails.map((memberDatum) => {
let memberJson = memberDatum.json();
return memberJson.records.map((r) => {
allExtensions.push(this.getPresenceLink(r.id))
})
})
5. set the presence

subscription
.setEventFilters([...allExtensions, '/account/~/presence'])
.register().then(function (response) {
console.log('Success: Subscription is listening');
}).catch(function(e) {
console.log('Subscription Error: ', e);
});
5. listen to the events,
const subscription = getRcsdk().createSubscription();
subscription.on(subscription.events.notification, function(accountPresence) {
  console.log("accountPresence", accountPresence)
});
here I receive notifications for both direct agent extension on call or call queue extensions. but in case of call queue extension  , I receive this data
{
  "uuid": "*",
  "event": "/restapi/v1.0/account/*/extension/*/presence?detailedTelephonyState=true",
  "timestamp": "*",
  "subscriptionId": "*",
  "ownerId": "*",
  "body": {
    "extensionId": *,
    "sequence": *,
    "presenceStatus": "Offline"
  }
no caller info, nothing else.. moreover I was expecting that it forwards the call to particular agent(as the agent's ext id is also being listened, I may recieve a notification in callback for same, but this is not happening).
please let me know if I am missing something




 0
answered on Apr 29, 2019 at 10:15am  
How do you implement the call forwarding? Via Active Call Control API or using preconfigured forwarding rules?

Can you explain more on this? 

3. when I select on department 's extension on call, the call is not forwarded to agent directly, and I am not receiving that notification in callback for that agent.

How do you select and how do you forward the call. Would be helpful if you provide some codes

 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