Auto DJ Threw API

Read 5187 times
 hi guys 

hoping some one can help me fix this issue as im a bit stumped.

in v2 i was using the basic api files that you could download to control the auto dj ,

linked in this kb -> https://secure.centova.com/pages/faqs/display/stopping_starting_the_autodj_102

since moving to v3 i cant get it to work , nor can i find a basic  file like they provided in v2 ( above link )

using the v2 version it shows everything as ' offline '  so theres no option to stop as it automatically wants you to start it.

is there a way of editing/updating the v2 files or does some one have a working code for v3 that allows people to log in and  disable / enable the auto dj.  i tried to read threw all the kb about api but got lost so thought one of you guys might still use this function instead of the new inbuilt function.

although i know that there is a feature in cent for this im finding that its not working past the 1st few accounts created and tends to ban people attempting to log in to adjust the source, which makes that feature a bit useless

Cheers ESH
Looks like the API has changed ..

V2 API response array(2) {
  • => array(16) { ["mount"]=> string(7) "/stream" ["listenercount"]=> string(1) "0" ["genre"]=> string(11) "Unspecified" ["url"]=> string(17) "http://localhost/" ["title"]=> string(11) "Stream Name" ["currentsong"]=> string(44) "Far East Movement - Like A G6 (Cahill Radio)" ["bitrate"]=> string(3) "128" ["sourceconnected"]=> string(1) "1" ["serverstate"]=> string(1) "1" ["sourcestate"]=> string(1) "1" ["reseller"]=> string(1) "0" ["ipaddress"]=> string(14) "216.172.106.76" ["port"]=> string(4) "9008" ["proxy"]=> string(1) "0" ["servertype"]=> string(9) "ShoutCast" ["sourcetype"]=> string(6) "icescc" } [1]=> array(1) {
  • => string(0) "" } }


v3 API response
array(1) { ["status"]=> array(18) { ["mount"]=> string(7) "/stream" ["listenercount"]=> string(1) "0" ["genre"]=> string(11) "Unspecified" ["url"]=> string(26) "http://shellshockradio.com" ["title"]=> string(25) "[/::Shell Shock Radio::\]" ["currentsong"]=> string(16) "Seether - Remedy" ["bitrate"]=> string(3) "256" ["sourceconnected"]=> string(1) "1" ["serverstate"]=> string(1) "1" ["appstate"]=> array(1) { ["icescc"]=> string(1) "1" } ["sourcestate"]=> string(1) "1" ["reseller"]=> string(0) "" ["useserver"]=> string(1) "1" ["ipaddress"]=> string(14) "216.172.106.76" ["port"]=> string(4) "8000" ["proxy"]=> string(1) "0" ["servertype"]=> string(9) "ShoutCast" ["sourcetype"]=> string(6) "icescc" } }
You need to update class_HTTPRetriever.php and ccapiclient.php
Also use this page('index',$server->data['status']['serverstate'],$server->data['status']['sourcestate']);
as the "index" page.

This should fix the issue with the autodj .. It works for me you can find  class_HTTPRetriever.php and ccapiclient.php in /usr/local/centovacast/extra/billing/ihost/centovacast/ Let me know if this works for you.
cheers for the responce duck

i tried having a look in the location you provided  /usr/local/centovacast/extra/billing/ihost/centovacast/

but i cant see those 2 files i only see   class_APIClient + class_BackendCentovaCast

so im unable to even try as i cant update those files, could you possibly link me to them already updated  so i can then upload then , i did a system search for those files and it only comes back with

/usr/local/centovacast/system/class_HTTPRetriever.php
/usr/local/centovacast/web/class_HTTPRetriever.php

&

ccapiclient.php   didnt show up except the old version thats on my web site.
+1 for you duck that did the trick and is now working a treat and displays the streams online and allows all functions to work  :)

very greatful and many thanks , 

Last Edit: March 27, 2013, 08:34:38 pm by E.S.H
Glad I could help :)