SONOS getMediaURI endpoint not called by player - sonos

I’m developing a custom music service for SONOS in which custom playlists are provided to be played (Spotify alike).
I’ve implemented the required endpoints and I can see while debugging that the GETLASTUPDATE and GETMETADATA endpoints are called and that the information is show in the APP (Playlists list, track list by playlist and artist and album info).
The issue is, When I try to reproduce a complete playlist or a track I get an
Unable to add songs to Queue
message and no call is done by the app to the API.
What am I missing here?
Below you may find the called the endpoints output.
Request:
<getMetadata xmlns="http://www.sonos.com/Services/1.1">
<id>root</id>
<index>0</index>
<count>100</count>
</getMetadata>
Response:
<ns1:getMetadataResponse>
<ns1:getMetadataResult>
<ns1:index>0</ns1:index>
<ns1:count>9</ns1:count>
<ns1:total>9</ns1:total>
<ns1:mediaCollection>
<ns1:id>PLAYLIST:10:2</ns1:id>
<ns1:itemType>playlist</ns1:itemType>
<ns1:title>Anos 90</ns1:title>
<ns1:summary>Relembre os hits que marcaram os anos 90. Da música pop ao grunge, esta playlist conta com as presenças de Alanis Morissette, Oasis, Pearl Jam e The Cranberries</ns1:summary>
<ns1:canPlay>true</ns1:canPlay>
<ns1:albumArtURI>https://xxx/xxdata/images/playlists/default.jpg</ns1:albumArtURI>
</ns1:mediaCollection>
</ns1:getMetadataResult>
</ns1:getMetadataResponse>
Request:
<getMetadata xmlns="http://www.sonos.com/Services/1.1">
<id>PLAYLIST:10:2</id>
<index>0</index>
<count>100</count>
</getMetadata>
Response:
<ns1:getMetadataResponse>
<ns1:getMetadataResult>
<ns1:index>0</ns1:index>
<ns1:count>100</ns1:count>
<ns1:total>338</ns1:total>
<ns1:mediaMetadata>
<ns1:id>track:300</ns1:id>
<ns1:title>Black Hole Sun</ns1:title>
<ns1:mimeType>audio/mp3</ns1:mimeType>
<ns1:itemType>track</ns1:itemType>
<ns1:trackMetadata>
<ns1:albumId>album:1390</ns1:albumId>
<ns1:duration>253970</ns1:duration>
<ns1:artistId>artist:543</ns1:artistId>
<ns1:artist>Soundgarden</ns1:artist>
<ns1:album>Superunknown</ns1:album>
<ns1:albumArtURI>https://xxxx/musiccover.aspx?pk=xxx-xxx-xxxx-xxxx</ns1:albumArtURI>
</ns1:trackMetadata>
</ns1:mediaMetadata>
<ns1:mediaMetadata>
<ns1:id>track:514</ns1:id>
<ns1:title>Don't Speak</ns1:title>
<ns1:mimeType>audio/mp3</ns1:mimeType>
<ns1:itemType>track</ns1:itemType>
<ns1:trackMetadata>
<ns1:albumId>album:1128</ns1:albumId>
<ns1:duration>207196</ns1:duration>
<ns1:artistId>artist:467</ns1:artistId>
<ns1:artist>No Doubt</ns1:artist>
<ns1:album>Tragic Kingdom</ns1:album>
<ns1:albumArtURI>https://xxxx/musiccover.aspx?pk=xxx-xxx-xxxx-xxxx</ns1:albumArtURI>
</ns1:trackMetadata>
</ns1:mediaMetadata>
</ns1:getMetadataResult>
</ns1:getMetadataResponse>

Is that last snippet your actual response? It could be a number of things, but I think the issue may be that your response claims to return 100 results when it only contains 2. To test this, try to use
<ns1:index>0</ns1:index>
<ns1:count>2</ns1:count>
<ns1:total>2</ns1:total>
<ns1:mediaMetadata>. . . <ns1:mediaMetadata>
<ns1:mediaMetadata>. . . <ns1:mediaMetadata>
instead of count=100, total=338. The player may be trying to enqueue the rest of the tracks and failing to do so, causing the error.
If you use the ... menu on the track from the Sonos app's browse, and select "Play Song" the player should enqueue only the one track and attempt to play it without dealing with the pagination of the playlist container.

Related

JTApi and Missed calls/Previously completed calls

I'm trying to find a way to use the JTApi to get missed and completed calls from the phone. I know that I could write this code myself and capture them in the callobserver, but I specifically want it to come from the PBX/Phone.
Is this possible?
Cisco JTAPI does not provide access to historical call records, nor is their a programmatic way to query the phone device directly. For 'real-time' call history, you would need to implement full-time call observation and record the call meta-data into your own database.
Historical call records are available via CUCM's 'Call Detail Records' function: https://developer.cisco.com/site/sxml/discover/overview/cdr/
These CDRs are sent from supporting phones to CUCM at the end of every call, and are collected/stored on the CUCM Publisher every 1 minute (by default) as CSV formatted flat files.
There are two main mechanisms for accessing CDRs:
FTP/SSH-FTP delivery: up to three destinations can be configured in the CUCM Serviceability admin pages, where CDR files will be delivered per the configured interval:
CDRonDemand SOAP API: available CDR filenames for a time period (up to one hour) can be listed, and individual files requested for FTP/SSH-FTP delivery to a specified location (i.e. the application host). The service/WSDL is available on the CUCM Publisher at: https://:8443/realtimeservice2/services/CDRonDemandService?wsdl
Example of get_file_list request:
<!--CDRonDemand API - get_file_list - Request (datetime format is in UTC time)-->
<soapenv:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:soap="http://schemas.cisco.com/ast/soap/">
<soapenv:Header/>
<soapenv:Body>
<soap:get_file_list>
<soap:in0>201409121600</soap:in0>
<soap:in1>201409121700</soap:in1>
<soap:in2>true</soap:in2>
</soap:get_file_list>
</soapenv:Body>
</soapenv:Envelope>
Example of get_file request:
<!--CDRonDemand API - get_file - Request-->
<soapenv:Envelope xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:urn="urn:CDRonDemand">
<soapenv:Header/>
<soapenv:Body>
<urn:get_file soapenv:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/">
<in0>sftp-server.server.com</in0>
<in1>user</in1>
<in2>password</in2>
<in3>/tmp</in3>
<in4>cdr_StandAloneCluster_01_201409121628_189</in4>
<in5>true</in5>
</urn:get_file>
</soapenv:Body>
</soapenv:Envelope>
More details on application access to CDRs can be found here: https://developer.cisco.com/site/sxml/

Sonos test suite fails on counting items in new playlist

I have a container (music show) with 19 tracks in it and 1 item for recommendations section for this show. So totaly there are 20 items. But if I am adding this show to playlist, only tracks will be processed and playlsit will contain 19 tracks. Sonos controller is working fine with it, but Test Suite fails with checking total items after adding show to playlist with message
FAIL The seed playlist and newly created playlist should have the same
quantity of items inside. (expected 19 != actual 20)
As the result Test Suite fails with 1 error. Is it O.K. to send test suite report with such fail? Or you will deny new service with such fail?
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/"
xmlns:ns1="http://www.sonos.com/Services/1.1">
<SOAP-ENV:Body>
<ns1:getMetadataResponse>
<ns1:getMetadataResult>
<ns1:index>0</ns1:index>
<ns1:count>20</ns1:count>
<ns1:total>20</ns1:total>
<ns1:mediaCollection>
<ns1:id>CONTAINER:RECOMMENDATIONS:594</ns1:id>
<ns1:itemType>collection</ns1:itemType>
<ns1:displayType>grid</ns1:displayType>
<ns1:title>Recommendations</ns1:title>
<ns1:canPlay>false</ns1:canPlay>
<ns1:canAddToFavorites>false</ns1:canAddToFavorites>
</ns1:mediaCollection>
<ns1:mediaMetadata>
<ns1:id>TRACK:11422:594</ns1:id>
<ns1:itemType>track</ns1:itemType>
<ns1:displayType>list</ns1:displayType>
<ns1:title>He Ain't Give You None</ns1:title>
<ns1:summary>The Radiators</ns1:summary>
<ns1:mimeType>audio/mp3</ns1:mimeType>
<ns1:trackMetadata>
<ns1:artist>The Radiators</ns1:artist>
<ns1:duration>531</ns1:duration>
<ns1:rating>0</ns1:rating>
<ns1:canPlay>true</ns1:canPlay>
<ns1:canSkip>true</ns1:canSkip>
</ns1:trackMetadata>
</ns1:mediaMetadata>
<ns1:mediaMetadata>
<ns1:id>TRACK:58012:594</ns1:id>
<ns1:itemType>track</ns1:itemType>
<ns1:displayType>list</ns1:displayType>
<ns1:title>Alimony</ns1:title>
<ns1:summary>The Radiators</ns1:summary>
<ns1:mimeType>audio/mp3</ns1:mimeType>
<ns1:trackMetadata>
<ns1:artist>The Radiators</ns1:artist>
<ns1:duration>632</ns1:duration>
<ns1:rating>0</ns1:rating>
<ns1:canPlay>true</ns1:canPlay>
<ns1:canSkip>true</ns1:canSkip>
</ns1:trackMetadata>
</ns1:mediaMetadata>
[MORE ITEMS HERE]
</ns1:getMetadataResult>
</ns1:getMetadataResponse>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>
I am taking some liberties in answering your question since it seems to be directed at Sonos, so apologies in advance. It is very unlikely that your service will be rejected for a bug that happens to be inside Sonos test suite.
So my two cents, go for it and submit your service.
I believe that the issue here is that a playlist is defined as container specifically full of track elements (http://musicpartners.sonos.com/node/286) and your playlist contains a collection. This is why this is failing to generate the correct count in the test.

Bit rate error when trying to dial out to an ISDN line using Polycom XML API

I am having a problem connecting to an ISDN line using Polycom's XML API on an RMX_2000. Below is the request I am sending, and the response. I can do the same action from the RMX Manager, for the same number, in the same conference, and it works. When I trace the XML from the RMX Manager, I get an ADD_PARTY request that looks exactly like my constructed request, except with a lot more elements. I've reviewed and don't see any that seem like they could be relevant, and I am loath to manually code every single element, knowing that it is a long shot that it will even help. The same request (variant) works fine for IP and registered number requests, but no matter what I do, always get the bit rate error below. Can anyone tell me what I am doing wrong?
<TRANS_CONF_1>
<TRANS_COMMON_PARAMS>
<MCU_TOKEN>304</MCU_TOKEN>
<MCU_USER_TOKEN>304</MCU_USER_TOKEN>
<MESSAGE_ID>1</MESSAGE_ID>
</TRANS_COMMON_PARAMS>
<ACTION>
<ADD_PARTY>
<ID>18466</ID>
<PARTY>
<ID>0</ID>
<NAME>isdn</NAME>
<PHONE_LIST>
<PHONE1>12345678910</PHONE1>
</PHONE_LIST>
<INTERFACE>isdn</INTERFACE>
<CONNECTION>dial_out</CONNECTION>
<MEET_ME_METHOD>party</MEET_ME_METHOD>
<NUM_TYPE>taken_from_service</NUM_TYPE>
<MULTI_RATE>auto</MULTI_RATE>
<ALIAS>
<NAME>12345678910</NAME>
<ALIAS_TYPE>323_id</ALIAS_TYPE>
</ALIAS>
<VIDEO_BIT_RATE>automatic</VIDEO_BIT_RATE>
<ENHANCED_VIDEO>false</ENHANCED_VIDEO>
<UNDEFINED>false</UNDEFINED>
</PARTY>
</ADD_PARTY>
</ACTION>
</TRANS_CONF_1>
Here is the response:
<RESPONSE_TRANS_CONF>
<RETURN_STATUS>
<ID>1015</ID>
<DESCRIPTION>Conference bit rate must be set to a minimum of 128Kbps to enable ISDN participant connection</DESCRIPTION>
<YOUR_TOKEN1>0</YOUR_TOKEN1>
<YOUR_TOKEN2>0</YOUR_TOKEN2>
<MESSAGE_ID>1</MESSAGE_ID>
<DESCRIPTION_EX></DESCRIPTION_EX>
</RETURN_STATUS>
<ACTION>
<ADD_PARTY/>
</ACTION>
</RESPONSE_TRANS_CONF>
Thanks to a little help from someone at Polycom, I found out that the following node is required for this:
auto
I added that to the PARTY node, and now all is well.
After alot of troubleshooting and wiresharking on this error I found a combination of 2 properties being the issue
Reservation object needs
<TRANSFER_RATE>384</TRANSFER_RATE>
Party object needs
<NET_CHANNEL_NUMBER>auto</NET_CHANNEL_NUMBER>

SoundCloud created_at[from] query resolving in a 503 error

Using the JavaScript SDK, I am trying to search for all tracks in a given genre from a given date going forward (using the 'created_at[from]' /tracks filter).
My JavaScript for this is:
SC.get('/tracks', { genres: 'metal', created_at: {from: '2014-02-26 00:00:01'} }, function(tracks) {
console.log(tracks);
});
The request URL resolves as:
http://api.soundcloud.com/tracks?genres=metal&created_at[from]=2014-02-26%2000%3A00%3A01&client_id=MY_ID
and I get a 503. (I omitted posting my client_id here intentionally)
What am I doing wrong here?
Looks like they changed the filter or its a bug or they are working on it:
When i call:
http://api.soundcloud.com/tracks?limit=1&genres=metal&client_id=b45b1aa10f1ac2941910a7f0d10f8e28&created_at=2010-10-10
I am getting:
invalid filter.created_at=2010-10-10;
valid values are: last_year, last_two_weeks, last_week, last_day, last_hour
Then, when i call for last hour:
http://api.soundcloud.com/tracks?limit=1&genres=metal&client_id=b45b1aa10f1ac2941910a7f0d10f8e28&created_at=last_hour
I am getting a: 503 - Service Unavailable
When i change it to last_year, it works as expected,
and i get following xml (or json):
<tracks next-href="http://api.soundcloud.com/tracks?client_id=b45b1aa10f1ac2941910a7f0d10f8e28&created_at=last_year&genres=metal&limit=1&offset=1" type="array">
<track>
<kind>track</kind>
<id type="integer">103909859</id>
<created-at type="datetime">2013-08-04T01:30:44Z</created-at>
<user-id type="integer">29394873</user-id>
<duration type="integer">248917</duration>
<commentable type="boolean">true</commentable>
<state>finished</state>
<original-content-size type="integer">4696472</original-content-size>
<sharing>public</sharing>
<tag-list>
exotoxis metal femalevocals rock shredding army god double bass
</tag-list>
<permalink>army-of-god</permalink>
<streamable type="boolean">true</streamable>
<embeddable-by>all</embeddable-by>
<downloadable type="boolean">false</downloadable>
<purchase-url nil="true"/>
<label-id nil="true"/>
<purchase-title nil="true"/>
<genre>Metal</genre>
<title>Army Of God</title>
<description>
For more Information plea
EDIT:
I'd say you are right and SC Team should give an answer on that.

highrise API, put unprocessable entity , 37 Signals

i´m playing arround with the HIGHRISE API, and they understood the meaning of rest, its pretty cool and at some points gracefully forgivingly, but
has anybody any idea why the xml i PUT is not accepted ?
here is some relevant logging :
2014-02-23 00:00:04] app.INFO: Updating:Person:Highrise-API = people/11834527375.xml [] []
[2014-02-23 00:00:04] app.INFO: request body is :
<?xml version="1.0" encoding="UTF-8"?>
<person>
<first-name><![CDATA[Johnny]]></first-name>
<last-name><![CDATA[B. Good]]></last-name>
<visible-to><![CDATA[Everyone]]></visible-to>
<subject_datas type="array">
<subject_data>
<subject_field_id type="integer"><![CDATA[43212]]></subject_field_id>
<value><![CDATA[dsa328394OOKD323H]]></value>
</subject_data>
<subject_data>
<subject_field_id type="integer"><![CDATA[470259]]></subject_field_id>
<value><![CDATA[provider://w184071823/fmdks/2032]]></value>
</subject_data>
<subject_data>
<subject_field_id type="integer"><![CDATA[469130]]></subject_field_id>
<value><![CDATA[CORE]]></value>
</subject_data>
<subject_data>
<subject_field_id type="integer"><![CDATA[469132]]></subject_field_id>
<value><![CDATA[Way too cool]]></value>
</subject_data>
</subject_datas>
<contact-data>
<phone-numbers>
<phone-number type="array">
<number><![CDATA[081 6418273]]></number>
<location><![CDATA[Work]]></location>
</phone-number>
</phone-numbers>
<addresses type="array">
<address>
<city><![CDATA[New York City]]></city>
<country><![CDATA[US]]></country>
<state><![CDATA[New York]]></state>
<street><![CDATA[Siplingerstreet 11]]></street>
<zip><![CDATA[87527]]></zip>
<location><![CDATA[Work]]></location>
</address>
</addresses>
</contact-data>
</person>
[] []
[2014-02-23 00:00:04] app.INFO: request set [] []
[2014-02-23 00:00:04] app.ERROR: Guzzle/3.8.1 curl/7.28.1 PHP/5.4.10 - [2014-02-22T23:00:04+00:00] "PUT /people/11834527375.xml HTTP/1.1" 422 103 [] []
[2014-02-23 00:00:04] app.INFO: Caught client-error-exception in HighriseService updatePerson(): exception 'Guzzle\Http\Exception\ClientErrorResponseException' with message 'Client error response
[status code] 422
[reason phrase] Unprocessable Entity
i dont see the error :/
I´m very sure the subject_field_id´s are correct and those custom fields are set
Posting e.g saving that xml works, i saw from the response that are fields were set,
only thing i can guess is, that i´m trying to PUT a version where nothing has changed,
is that the problem ?
because my code only checks if that person exists at all and if so update it instead of creating
You should get back some XML in the body of the response. It should look like this:
<?xml version="1.0" encoding="UTF-8"?>
<errors>
<error>Phone number '555-555-5555' has already been taken</error>
</errors>
If you include the id for the existing phone number in your PUT request, then we know that you want to update the existing address, rather than adding a new one: https://github.com/basecamp/highrise-api/blob/master/sections/people.md#update-person
Contact data and Subject data that include an id will be updated, data that doesn’t will be assumed to be new and created from scratch. To remove a piece of data, prefix its id with a minus sign (e.g. -1).