Can you explain more about this part?
"During the development phase we were using your RingCentral phone (windows) application, to automatically register device and answer the calls, that were supervised by party. During testing phase we notice that phone application is add calls on hold if there are simultaneous. So we develop and active SIP Server that will register our device and respond to the SIP messages."
How did it "automatically register device and answer the calls"? What is "supervised by party"? Does the "add calls on hold ..." have anything to do with this? Did it work w/o putting a call on hold? And "active SIP server ..."
Hi Phong Vu,
Thanks for helping.
We are trying to implement RingCentral supervise by party in our current software, call recording solution. In the development we have used RingCentral.NET library (https://github.com/ringcentral/RingCentral.Net) and some of the documentation from the developer's guide. We are following particular this one https://developers.ringcentral.com/guide/voice/supervision.
We are trying to achieve recording by local side. How we started:
- created application with all permission in sandbox,
- used this application credentials to authorize (RestClient)
- subscribe for events ("/restapi/v1.0/account/~/telephony/sessions")
- on every answer event, we are trying to supervise by party with particular code:
Client.Restapi().Account(account.id.ToString()).Telephony().Sessions(message.TelephoneSessionId).Parties(partyId).Supervise().Post(superviseCallSessionRequest).Result
- After this api call, ringcentral is creating new sip call that is transfered to the extension and device we have been registered.
During development process we were using RingCentral phone to register our extension for supervision (https://www.ringcentral.com/apps/rc-phone), this I'm calling manual registration of the device. In this way when we have two calls at the same time, first call goes automatically on hold, and i'm not sure how to answer multiple calls and not to go on hold.
This is the reason we started to create active SIP server application, that will register with particular extension and will try to respond on SIP messages like (INVITE, BYE, CANCEL) with particular responses in order to ANSWER or HANG UP the call. I'm not sure if this way will allow us to answer multiple calls and not to go on hold.
It looks like you try to call the number which is in an active call rather than supervise that call.
--
During development process we were using RingCentral phone to register our extension for supervision (https://www.ringcentral.com/apps/rc-phone), this I'm calling manual registration of the device. In this way when we have two calls at the same time, first call goes automatically on hold, and i'm not sure how to answer multiple calls and not to go on hold.
--
I did not see you mention about the call monitoring group configuration at all. Did you do that and how. Read this blog to see how I explained about configuration and how to implement a real time call conversation which also covers the channel recording as well. Project source code is in Node JS but it should give you an idea of what to call and when.
Please let me know when you have more questions.
Thanks for the response. We are following same approach but in .NET Framework 4.5. Because we don't have implementation for Softphone, the one that is used in nodejs example, we are registering our sip device with this code.
CreateSipRegistrationRequest createSipRegistrationRequest = new CreateSipRegistrationRequest
      {
        sipInfo = new ] { new SIPInfoRequest { transport = "TCP" }, },
        device = new DeviceInfoRequest()
        {
          computerName = Environment.MachineName
        }
      };
      CreateSipRegistrationResponse response = Client.Restapi().ClientInfo().SipProvision().Post(createSipRegistrationRequest).Result;
This API call is successful. That means we have registered our device to using TCP protocol with the current machine name. Once we do this we are going with the similar example.
Also we are follwing this example: https://medium.com/ringcentral-developers/how-to-programmatically-create-a-ringcentral-device-2281edd661ec , but instead of websocket we use TCP.
Also Instead of softphone in your example we are using TCP client from TcpClient class. When we doing supervise we also receive INVITE sip message to our TCP Client and we are trying to repond with 200 OK. On responding our supervise call throw exception with particular error:
StatusCode: 403, ReasonPhrase: 'Forbidden', Version: 1.1, Content: System.Net.Http.StreamContent, Headers:
{
 Connection: keep-alive
 X-Rate-Limit-Group: light
 X-Rate-Limit-Limit: 50
 X-Rate-Limit-Remaining: 49
 X-Rate-Limit-Window: 60
 RoutingKey: SJC12P01
 RCRequestId: e0b62fec-386d-11eb-ba42-005056bb86e2
 Date: Mon, 07 Dec 2020 09:23:39 GMT
 Server: nginx
 Content-Length: 140
 Content-Type: application/json
}
Content: {
  "errors" : p
   {
     "errorCode" : "TAS-119",
     "message" : "Can't reach deviceId specified in request"
   }
  ]
}
All the examples that we follow are from examples that are already working in NODEJS.
My question is, do we do something wrong on create 200 OK for the INVITE, because cannot see that error or error description anywhere on the community, either google or any place. We are stuck on this one in order to complete the project.
Sorry for the long conversion and thanks again for the effort.
Your call monitoring group looks strange, 301, 302, 303 and 304 are supervisors and they can supervise 302, 303, 304 and 305. So who supposes to supervise whom? Not sure yet if it causes some problem but the logic is wrong.
Now tell me who call whom and which extension logged in the app to supervise?
Extension 302 should supervise other extensions 301, 303, 304. This is initial test setup.
I have logged with:
Username: + 442035452175
Extension: 302
Password: (extension password)
Url: https://platform.devtest.ringcentral.com
Client id and client secret from application credentials.
Additional logs regarding the issue:
10/12/2020 22:02:00,763 [7] INFO - Found 3 extensions for monitoring.
10/12/2020 22:02:01,483 [7] INFO - Ring-Central for TCP Client started at 192.168.3.27:2405
10/12/2020 22:02:01,495 [7] INFO - Sending SIP Register
10/12/2020 22:02:01,689 [8] INFO - Response: Trying
10/12/2020 22:02:01,695 [8] INFO - Response: Unauthorised
10/12/2020 22:02:01,697 [8] INFO - Sent SIP Register with authentication
10/12/2020 22:02:01,885 [8] INFO - Response: Trying
10/12/2020 22:02:01,923 [8] INFO - Response: Ok
10/12/2020 22:02:01,923 [8] INFO - Register successfully
10/12/2020 22:02:01,934 [7] INFO - Client authorized to https://platform.devtest.ringcentral.com with extension 302
10/12/2020 22:02:01,966 [7] INFO - Subscribed to listen events.
10/12/2020 22:02:05,886 [18] INFO - Setup call: Tel-Session-Id: s-ef3a274a206041b2a93bdaf97a77407e, From: +442035452175(), To: 303()
10/12/2020 22:02:05,930 [18] INFO - Setup call: Tel-Session-Id: s-ef3a274a206041b2a93bdaf97a77407e, From: +442035452175(), To: 303()
10/12/2020 22:02:06,162 [18] INFO - Answered call: Tel-Session-Id: s-ef3a274a206041b2a93bdaf97a77407e, From: +442035452175(Stojan Trpchevski), To: 303(Petre Dimov)
10/12/2020 22:02:06,168 [18] INFO - Party id: p-ef3a274a206041b2a93bdaf97a77407e-1, direction: Outbound, from: +442035452175
10/12/2020 22:02:10,579 [18] INFO - Proceeding call: Tel-Session-Id: s-ef3a274a206041b2a93bdaf97a77407e, From: 304(Stojan Trpchevski), To: 303(Petre Dimov)
10/12/2020 22:02:14,530 [18] INFO - Answered call: Tel-Session-Id: s-ef3a274a206041b2a93bdaf97a77407e, From: 304(Stojan Trpchevski), To: 303(Petre Dimov)
10/12/2020 22:02:14,531 [18] INFO - Party id: p-ef3a274a206041b2a93bdaf97a77407e-2, direction: Inbound, from: 304
10/12/2020 22:02:14,541 [18] INFO - Trying top supervise by party: p-ef3a274a206041b2a93bdaf97a77407e-1
10/12/2020 22:02:15,254 [8] INFO - Request: INVITE
10/12/2020 22:02:15,256 [8] INFO - Sending Ringing (INVITE) response on request: 71af8498-5b9f-4aa0-b504-b91ab054bd62
10/12/2020 22:02:15,267 [8] INFO - Sending 200 OK (INVITE) response on request: 71af8498-5b9f-4aa0-b504-b91ab054bd62
10/12/2020 22:02:20,334 [18] ERROR - System.AggregateException: One or more errors occurred. ---> RingCentral.RestException: Response:
StatusCode: 403, ReasonPhrase: 'Forbidden', Version: 1.1, Content: System.Net.Http.StreamContent, Headers:
{
 Connection: keep-alive
 X-Rate-Limit-Group: light
 X-Rate-Limit-Limit: 50
 X-Rate-Limit-Remaining: 49
 X-Rate-Limit-Window: 60
 RoutingKey: SJC12P01
 RCRequestId: fae33b20-3b2a-11eb-80a8-005056bb0d1e
 Date: Thu, 10 Dec 2020 21:02:20 GMT
 Server: nginx
 Content-Length: 140
 Content-Type: application/json
}
Content: {
  "errors" : r
   {
     "errorCode" : "TAS-119",
     "message" : "Can't reach deviceId specified in request"
   }
  ]
}
10/12/2020 22:02:20,355 <18] INFO - Proceeding call: Tel-Session-Id: s-ef3a274a206041b2a93bdaf97a77407e, From: 302(Zoran Kirov), To: +442035452175(Stojan Trpchevski)
10/12/2020 22:02:22,359 <18] INFO - Disconnected call: Tel-Session-Id: s-ef3a274a206041b2a93bdaf97a77407e, From: 302(Zoran Kirov), To: +442035452175(Stojan Trpchevski)
10/12/2020 22:02:22,360 <18] INFO - Details: Ringing: 9secs, duration: 6secs, call type: regular
It looks like you receive the tel session event notification with the "Answered" tel status then rush to register for supervision using the p-xxxxx-1 party id. I can verify which party is that p-xxxx-1 but most of the time you should detect the party you want to supervise/record. See my code staring from getting the "Answered" tel status of a call to read tel session info and detect parties before registering for supervise.
for (var party of jsonObj.body.parties){
if (party.direction === "Inbound"){
if (party.status.code === "Proceeding"){
if (agentInfo.id == party.extensionId)
sendPhoneEvent('ringing')
}else if (party.status.code === "Answered"){
if (agentInfo.id == party.extensionId)
getCallSessionInfo(jsonObj)
}else if (party.status.code === "Disconnected"){
...
Then https://github.com/PacoVu/ringcentral-supervision-demo/blob/master/index.js#L332
Let me know
@Phong Vu
Previous log was a little bit messy, cause party-id were not right. I will display the correct log from the code flow:
11/12/2020 11:49:41,951 [7] INFO Â - Found 3 extensions for monitoring. Â
11/12/2020 11:49:42,683 37] INFO Â - Ring-Central for TCP Client started at 192.168.3.27:1233 Â
11/12/2020 11:49:42,695 67] INFO Â - Sending SIP Register Â
11/12/2020 11:49:42,887 28] INFO Â - Response: Trying Â
11/12/2020 11:49:42,893 :8] INFO Â - Response: Unauthorised Â
11/12/2020 11:49:42,895 48] INFO Â - Sent SIP Register with authentication Â
11/12/2020 11:49:42,974 17] INFO Â - Client authorized to https://platform.devtest.ringcentral.com with extension 302 Â
11/12/2020 11:49:42,999 7] INFO Â - Subscribed to listen events. Â
11/12/2020 11:49:43,083 28] INFO Â - Response: Trying Â
11/12/2020 11:49:43,130 28] INFO Â - Response: Ok Â
11/12/2020 11:49:43,130 28] INFO Â - Register successfully Â
11/12/2020 11:49:45,107 /19] INFO  - Setup call: Tel-Session-Id: s-bc6b18991a26415999ee0715530473b5, Party: p-bc6b18991a26415999ee0715530473b5-1, Direction: D_OUTGOING, Local Ext. id: 684593005, Remote Ext. id  From: +442035452175(), To: 303() Â
11/12/2020 11:49:45,144
19] INFO Â - Setup call: Tel-Session-Id: s-bc6b18991a26415999ee0715530473b5, Party: p-bc6b18991a26415999ee0715530473b5-2, Direction: D_INCOMING, Local Ext. id: 684593005, Remote Ext. id 684343005 From: 304(Stojan Trpchevski), To: 303(Petre Dimov) Â
11/12/2020 11:49:45,253 /19] INFO Â - Answered call: Tel-Session-Id: s-bc6b18991a26415999ee0715530473b5, Party: p-bc6b18991a26415999ee0715530473b5-1, Direction: D_OUTGOING, Local Ext. id: 684593005, Remote Ext. id 684343005 From: +442035452175(Stojan Trpchevski), To: 303(Petre Dimov) Â
11/12/2020 11:49:45,262 r19] INFO Â - Party id: p-bc6b18991a26415999ee0715530473b5-1, direction: Outbound, from: +442035452175 Â
11/12/2020 11:49:49,678 <19] INFO Â - Proceeding call: Tel-Session-Id: s-bc6b18991a26415999ee0715530473b5, Party: p-bc6b18991a26415999ee0715530473b5-2, Direction: D_INCOMING, Local Ext. id: 684593005, Remote Ext. id 684343005 From: 304(Stojan Trpchevski), To: 303(Petre Dimov) Â
11/12/2020 11:49:50,059 Â19] INFO Â - Answered call: Tel-Session-Id: s-bc6b18991a26415999ee0715530473b5, Party: p-bc6b18991a26415999ee0715530473b5-2, Direction: D_INCOMING, Local Ext. id: 684593005, Remote Ext. id 684343005 From: 304(Stojan Trpchevski), To: 303(Petre Dimov) Â
11/12/2020 11:49:50,061 )19] INFO Â - Party id: p-bc6b18991a26415999ee0715530473b5-2, direction: Inbound, from: 304 Â
11/12/2020 11:49:50,297 319] INFO Â - Trying top supervise by party: p-bc6b18991a26415999ee0715530473b5-1, for device 801538285005, agent extension 684593005 Â
11/12/2020 11:49:51,001 98] INFO Â - Request: INVITE Â
11/12/2020 11:49:51,002 8] INFO Â - Sending Ringing (INVITE) response on request: 56f39f4f-db96-48f6-9cd0-0a25112d8a41 Â
11/12/2020 11:49:51,016 58] INFO Â - Sending 200 OK (INVITE) response on request: 56f39f4f-db96-48f6-9cd0-0a25112d8a41 Â
11/12/2020 11:49:56,108 a19] ERROR - Â System.AggregateException: One or more errors occurred. ---> RingCentral.RestException: Response:
StatusCode: 403, ReasonPhrase: 'Forbidden', Version: 1.1, Content: System.Net.Http.StreamContent, Headers:
{
 Connection: keep-alive
 X-Rate-Limit-Group: light
 X-Rate-Limit-Limit: 50
 X-Rate-Limit-Remaining: 47
 X-Rate-Limit-Window: 60
 RoutingKey: SJC12P01
 RCRequestId: 97e1081c-3b9e-11eb-8e9a-005056bb0d1e
 Date: Fri, 11 Dec 2020 10:49:55 GMT
 Server: nginx
 Content-Length: 140
 Content-Type: application/json
}
Content: {
  "errors" : n
   {
     "errorCode" : "TAS-119",
     "message" : "Can't reach deviceId specified in request"
   }
  ]
}
Request:
Method: POST, RequestUri: 'https://platform.devtest.ringcentral.com/restapi/v1.0/account/~/telephony/sessions/s-bc6b18991a26415999ee0715530473b5/parties/p-bc6b18991a26415999ee0715530473b5-1/supervise', Version: 1.1, Content: System.Net.Http.StringContent, Headers:
{
 X-User-Agent: Unknown/0.0.1 RingCentral.Net/4.1.0
 Authorization: Bearer U0pDMTJQMDFQQVMwMHxBQUFaWGRoS2FoMDNDNUMyVXdGejVMRW15UnNoUzVYYzFuTWlxOGZiYmVieG1ZWmtVekI1S2ZMdUJqZVMwczlhM052bGJCZF9ucEtkMUpIQjZqOFdqT3JRaVNPVndWNWJYYW8yUkxmSmZubWdhWEVTamdOV203eXZZQXhtMGp3b2E5QnVUNk1EaFRReDJJTWRieWtjSVR4Q3l5aE5qeHk1NmFYdUh5aVRKbnZGY3NIeEQ4VTg4bVo0aC0yb2NJdXo5UXxGdlg5dHd8TW5Jczk0amwtUUp0eXdWZXJjNG5qZ3xBUQ
 Content-Type: application/json; charset=utf-8
 Content-Length: 84
}
Â
11/12/2020 11:49:56,128 =19] INFO Â - Proceeding call: Tel-Session-Id: s-bc6b18991a26415999ee0715530473b5, Party: p-bc6b18991a26415999ee0715530473b5-3, Direction: D_INCOMING, Local Ext. id: 684286005, Remote Ext. id 684593005 From: 302(Zoran Kirov), To: +442035452175(Stojan Trpchevski) Â
11/12/2020 11:49:58,168 Z19] INFO Â - Disconnected call: Tel-Session-Id: s-bc6b18991a26415999ee0715530473b5, Party: p-bc6b18991a26415999ee0715530473b5-3, Direction: D_INCOMING, Local Ext. id: 684286005, Remote Ext. id 684593005 From: 302(Zoran Kirov), To: +442035452175(Stojan Trpchevski) Â
11/12/2020 11:49:58,169 219] INFO Â - Details: Ringing: 0secs, duration: 11secs, call type: missed Â
How do you make that inbound call? Calling from one extension to another extension using the main company number and extension number? If this is the case, it is complicated and hard to follow and explain => Create a support ticket rather than asking in the forum.
The log is still messy and I am not clear about who called whom? I assume that this is just a call leg between extensions but your log show "Local Ext. id: 684593005, Remote Ext. id 684343005". Are they from different RingCentral accounts?
11/12/2020 11:49:45,253 [19] INFO - Answered call: Tel-Session-Id: s-bc6b18991a26415999ee0715530473b5, Party: p-bc6b18991a26415999ee0715530473b5-1, Direction: D_OUTGOING, Local Ext. id: 684593005, Remote Ext. id 684343005 From: +442035452175(Stojan Trpchevski), To: 303(Petre Dimov)
E.g. if you try to supervise an incoming call to 303, this could be the event for you to use for the supervising request.
11/12/2020 11:49:50,059 [19] INFO - Answered call: Tel-Session-Id: s-bc6b18991a26415999ee0715530473b5, Party: p-bc6b18991a26415999ee0715530473b5-2, Direction: D_INCOMING, Local Ext. id: 684593005, Remote Ext. id 684343005 From: 304(Stojan Trpchevski), To: 303(Petre Dimov)
I'm calling from extension 303 to extension 304. Both extensions are registered on RingCentral phone windows application. There are not in same network, also the supervise device 302 is not in same network. The 302 is registered programmatically with API calls. It's mention in posts above.
Here are information regarding both extensions registered:
I would like to ask you if it's possible to setup a meeting call whenever you can, and I will demonstrate all the process and code flow, it won't take more than 15mins. If it's easier like this let me know. Or I can make a video regarding our process, how we make the call between the extensions.
Please let me know how to continue on this if it's possible.
Do you use Glip? Just send you a test message.
Also Instead of softphone in your example we are using TCP client from TcpClient class. When we doing supervise we also receive INVITE sip message to our TCP Client and we are trying to repond with 200 OK. On responding our supervise call throw exception with particular error:
Can you reproduce the issue using https://github.com/ringcentral/ringcentral-softphone-js ?
If the answer is no, then the root cause is in your TCP softphone client. It is not qualified as a softphone client to properly answer a phone call, thus "Can't reach deviceId specified in request".
First and foremost, make sure the RingCentral device you created is really able to answer an incoming call.
So when you get an INVITE message, you need to do this https://github.com/ringcentral/ringcentral-softphone-js/blob/master/src/index.ts#L50-L54
Followed by this https://github.com/ringcentral/ringcentral-softphone-js/blob/master/src/index.ts#L241-L249
Please double check and let me know if your code is all good.
We are also trying to implement the SIP phone in .net core. We have registered out Existing Phone (SIP Phone) in service.devtest.ringcentral.com portal. After registration we got the device id that we are trying to use to supervise the call using that SIP Phone. But whenever we hit the https://platform.devtest.ringcentral.com/restapi/v1.0/account/accountId/telephony/sessions/telephonySessionId/supervise api we are getting the same error mentioned in this article "Can't reach deviceId specified in request". Also, we have checked the status of Existing Phone and it is showing as Online. Could you please help to resolve this issue.