![]() |
#1 |
Junior Member
Join Date: Feb 2011
Posts: 13
|
Finding out if an IP address is connected
I run a station on SAM and can take requests. The requests play automatically or if I'm around and monitoring the station, I will alter how the requests are played. If a request is old, I always pop over to the shoutcast admin page and make sure the listener that made the request is still connected before playing it. Otherwise I throw it out.
I would like for the automatic request handling to be able to do this as well. Is there a way to query the server via an HTTP request to find out if a particular IP is connected. Should I be listing this in the feature requests? Thanks! |
![]() |
![]() |
![]() |
#2 |
Join Date: Sep 2003
Posts: 27,873
|
at least with v2 DNAS (dunno about the v1), if you use the admin.cgi?sid=X&mode=viewxml&page=3 action (where X would be the stream id), then it will return an xml response like the following:
so if you can pull that, you should be able to easily do something that will parse it and see if the ip you're checking for exists.code: -daz |
![]() |
![]() |
![]() |
#3 |
Junior Member
Join Date: Feb 2011
Posts: 13
|
Unfortunately the host is using 1.9. Maybe I can convince them to upgrade....
|
![]() |
![]() |
![]() |
#4 |
Moderator
Join Date: Feb 2005
Location: USA
Posts: 4,024
|
admin.cgi is available on 1.9 too - Log in, and you should see a link to XML Stats.
|
![]() |
![]() |
![]() |
#5 |
Join Date: Sep 2003
Posts: 27,873
|
thanks for the clarification dotme (wasn't sure, i guess i should install a v1 DNAS at some point if only to see how it compares with admin stuff against v2).
-daz |
![]() |
![]() |
![]() |
#6 |
Moderator
Join Date: Feb 2005
Location: USA
Posts: 4,024
|
Was in a hurry when I posted this morning. The URL format for a 1.x DNAS stats pull is:
http://x.x.x.x:zzzz/admin.cgi?pass=*******&mode=viewxml |
![]() |
![]() |
![]() |
#7 |
Junior Member
Join Date: Feb 2011
Posts: 13
|
Thanks everybody. Now the question is whether or not it's worth it to parse that much XML in order to find one IP versus just going ahead and playing the request. I think maybe I will post in the feature requests as well.
|
![]() |
![]() |
![]() |
#8 |
Join Date: Sep 2003
Posts: 27,873
|
what could be done is just to have the xml output as say te following if an 'iponly' flag is passed on the action
so it could be easily accessed via http://serverip:Port/admin.cgi?pass=...age=3&iponly=1code: that's about as much as i can see as being feasible to implement into a newer 2 DNAS release as anything else is just a bit too specific and i'm not too keen on adding in something for externally querying an ip. [edit] have implemented support for the &iponly=1 option for the next v2 DNAS release so it is there if you can get to use a newer DNAS on your hosting. -daz |
![]() |
![]() |
![]() |
#9 |
Join Date: Sep 2003
Posts: 27,873
|
have you had any chance to try things out with the newer v2 DNAS and the option added? (just curious).
-daz |
![]() |
![]() |
![]() |
#10 |
Junior Member
Join Date: Feb 2011
Posts: 13
|
Actually I have and what I saw was pretty cool, but I'm using SAM 4.7 to broadcast, and it officially doesn't play well with 2.0.
|
![]() |
![]() |
![]() |
#11 |
Join Date: Sep 2003
Posts: 27,873
|
in what way isn't it playing well with the v2 DNAS?
-daz |
![]() |
![]() |
![]() |
#12 |
Junior Member
Join Date: Feb 2011
Posts: 13
|
Well, the first problem I ran into was the statistics gathering. I emailed for assistance and all I got back was that they don't support 2.0 but will in the next release. I can't remember how many years we've been waiting on the next release.
|
![]() |
![]() |
![]() |
#13 |
Join Date: Sep 2003
Posts: 27,873
|
sounds similar to http://forums.winamp.com/showthread.php?t=327260
i've seen a few things saying there's meant to be SAM5 coming out this year though people probably thought the same about SC2 tools coming out, heh. i have tried some aspects of SAM4 with the v2 DNAS and i know streaming worked ok though i never looked any further though if it is the same as the thread i linked to at the start of this post, then hopefully they will resolve things on their end as i'm really not keen on changing the summary page now. -daz |
![]() |
![]() |
![]() |
|
Tags |
http request, ip address |
Thread Tools | Search this Thread |
Display Modes | |
|
|