Skip to main content
The First Step
December 10, 2020
Question

Issue answer (200OK) on INVITE on supervise by party

Hi community,


I have issue regarding using sip server in C# to answer the call that has been supervised by party and send to my device.

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.

Issue:

We successfully registering extension programmatically in code. After every call, we supervise by party and receive event “INVITE”, on which we are trying to respond with “TRYING” and “200OK (SDP)”, in order to answer the call and receive the RTP data. After send 200OK on the INVITE we receive this error:


"errorCode" : "TAS-119",

"message" : "Can't reach deviceId specified in request".


Our registered device is online after registration.

Can you provide me more information what we’re doing wrong or any suggestion how to continue. In attachments I have add the Wireshark trace from the network and the error description that we receive after super-vise by party.


Code flow:

- Making CreateSipRegistrationRequest

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;


- With received response (SipInfoResponse), we connect our TcpClient to the specif IP and port

- After successful connection from our TcpClient we send REGISTER sip message

- We are receiving TRYING and 401 Unauthorized with specific nonce,

- With that specific nonce from 401 message, we are creating authorization header and send REGISTER sip message again, on which we are receiving 200 OK.
- On this way we register our device.

After this we are trying to make test call, and supervise the call. On create call with RingCentral phone, we are receiving events for the call event, after answer the call from the other side, we try to super-vise the call.

We are supervising the call with specific code:


PartySuperviseRequest superviseCallSessionRequest = new PartySuperviseRequest
                        {
                            mode = LISTEN_MODE,
                            supervisorDeviceId = DeviceId,
                            agentExtensionId = !string.IsNullOrEmpty(message.ExtensionId) ? message.ExtensionId : !string.IsNullOrEmpty(message.FromExtension) ? message.FromExtension : message.ToExtension,
                        };
                        var account = Client.Restapi().Account().Get().Result;
                        var result = Client.Restapi().Account(account.id.ToString()).Telephony().Sessions(message.TelephoneSessionId).Parties(partyId).Supervise().Post(superviseCallSessionRequest).Result;


After this call, we receive sip INVITE on our extension set for supervise. We have the network in the wireshark trace bellow. On this INVITE we are trying to send 200 OK in order to answer the call. After sending this 200OK, we recive the specific 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" : [
      {
         "errorCode" : "TAS-119",
         "message" : "Can't reach deviceId specified in request"
      }
   ]
}


If we are doing the supervise with active RingCentral phone (windiows) application, it's working fine, because the answering of the call is done from the RingCentral Phone application. In order to support multiple simultaneous calls, we are trying to create active sip server.


I have Wireshark trace from the traffic during registration and answer of the call.


Wireshark Trace

https://drive.google.com/file/d/1Q0dVG6m-25gPNSVSpxWoRK_YgmMx0OUO/view?usp=sharing


Response from supervise by party

https://drive.google.com/file/d/1AlVtn3fwfoAOr3vIKOKpl7Dptyqc56H8/view?usp=sharing

    14 replies

    The First Step
    December 11, 2020

    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:

    1607702035753.png
    1607702078084.png

    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.

    PhongVu
    Community Manager
    Community Manager
    December 11, 2020

    Do you use Glip? Just send you a test message.

    Employee
    December 30, 2020
    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.

    The First Step
    August 19, 2022

    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.