Question

api subscription to department extension not forwarding the call to agents automatically on call arrival

  • 29 April 2019
  • 2 replies
  • 1775 views

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 replies

Userlevel 1
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
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



Reply