question

david-southern11373 avatar image
david-southern11373 asked dave-southern12365 answered

master in legs in sdk

I'm trying to find the 'master' flag in the C# sdk for the call log record 'leg' subtype, but I'm not seeing it. Am I just blind, or has the element been omitted from the sdk or removed from the API?

sdk
1 |3000

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.

Tyler Liu avatar image
Tyler Liu answered
Could you please post some sample data?

It might be omitted from the API Server side. In order to confirm it, you can make API call without auto converting result to C# objects:  https://github.com/ringcentral/ringcentral-csharp-client#what-if-i-want-plain-http-without-those-fan...

Then you can if the data is included in server response.

Let me know what you find.
1 |3000

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.

david-southern11373 avatar image
david-southern11373 answered Tyler Liu commented
Thanks Tyler.  Here's an example pulled from the API:

[{"startTime":"2018-09-17T22:52:44.723Z","duration":33,"type":"Voice","direction":"Outbound","action":"VoIP Call","result":"Hang Up","to":{"phoneNumber":"+15084941229","name":"WIRELESS CALLER","location":"Framingham, MA"},"from":{"phoneNumber":"+15088094487","name":"Patient Unit 5 410","device":{"uri":"https://platform.ringcentral.com/restapi/v1.0/account/62100168016/device/802202037016","id":"802202037016"}},"extension":{"uri":"https://platform.ringcentral.com/restapi/v1.0/account/62100168016/extension/62194396016","id":62194396016},"transport":"VoIP","legType":"SipToPstnUnmetered","master":true}]

 
1 comment
1 |3000

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.

Hi David, from the data you posted, I see there is a   "master": true    property. 

What is the issue? If you invoke the C# API with model instead, there isn't master information?

Could you please show me the code? Thanks.
0 Likes 0 ·
david-southern11373 avatar image
david-southern11373 answered
Sorry - just now getting back to this.  :)

So here's an example of the code we're using:

//add the leg data
                        foreach (RingCentral.CallLogRecordLegInfo leg in log.legs)
                        {
                            var logLeg = new legInfo()
                            {
                                action = leg.action,
                                call_Id = log.id,   //extracted from the parent call log record.
                                direction = leg.direction,
                                duration = leg.duration,
                                legType = leg.legType,
                                result = leg.result,
                                startTime = leg.startTime,
                                transport = leg.transport,
                                type = leg.type,
                                
                            };

The 'log' variable is of type RingCentral.CallLogRecord.  If I look at the 'leg' variable I don't see a 'master' property on there.  
1 |3000

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.

Tyler Liu avatar image
Tyler Liu answered
Hi David, thank you very much for the feedback!

The C# code is auto generated according to swagger spec. I just check the swagger spec and there isn't a master property at all. So the issue is the swagger spec. 

I will escalate this issue and push them to fix it as soon as possible.
1 |3000

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.

david-southern11373 avatar image
david-southern11373 answered
Thanks Tyler.  I was afraid I was going to have to go into the source code myself and add that property.  :)
1 |3000

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.

david-southern11373 avatar image
david-southern11373 answered Tyler Liu commented
Hey Tyler - do you have an update on this?  

Thanks!

2 comments
1 |3000

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.

I will release a new version next week.

For now there is a quick and easy workaround:

     namespace RingCentral {     public partial class CallLogRecordLegInfo     { 
        public bool? @master { get; set; } 
    }
}


0 Likes 0 ·
CallLogRecordLegInfo  is a partial class so that you can extend it freely without modifying the original code.
0 Likes 0 ·
dave-southern12365 avatar image
dave-southern12365 answered Tyler Liu commented
Thanks Tyler. I'll look to see that SDK update.  Is there some mailing list I should be on to be able to know when new updates to the SDK are posted?

1 comment
1 |3000

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.

Just released 3.1.0-rc2 please have a test.

Not sure if you can subscribe to nuget feeds:  https://github.com/NuGet/NuGetGallery/issues/2992
0 Likes 0 ·
dave-southern12365 avatar image
dave-southern12365 answered
Sounds good... I'll probably take a look at it tomorrow.
1 |3000

Up to 8 attachments (including images) can be used with a maximum of 1.0 MiB each and 10.0 MiB total.

Developer sandbox tools

Using the RingCentral Phone for Desktop, you can dial or receive test calls, send and receive test SMS or Fax messages in your sandbox environment.

Download RingCentral Phone for Desktop:

Tip: switch to the "sandbox mode" before logging in the app:

  • On MacOS: press "fn + command + f2" keys
  • On Windows: press "Ctrl + F2" keys