Icecast Streaming Media Server Forum Index Icecast Streaming Media Server
Icecast is a Xiph Foundation Project
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Use of listener_remove w/o listener_add?

 
Post new topic   Reply to topic    Icecast Streaming Media Server Forum Index -> Icecast Server
View previous topic :: View next topic  
Author Message
iunderwood



Joined: 23 Aug 2008
Posts: 114
Location: Leicester, MA

PostPosted: Mon Sep 01, 2008 4:32 am    Post subject: Use of listener_remove w/o listener_add? Reply with quote

I'm curious if it's possible to use the listener_remove option w/o using the listener_add option.

The reason I'm asking on this is because I'm considering a feature for my XOOPS module that won't require authentication against the website for a public stream, but could send back some accounting information when a listener disconnects.

If this is possible, it might also be good to send the useragent and ip in the remove request as well. If not, it's no big deal.
_________________
++I;
Back to top
View user's profile Send private message
karlH
Code Warrior
Code Warrior


Joined: 13 Jun 2005
Posts: 5476
Location: UK

PostPosted: Mon Sep 01, 2008 4:01 pm    Post subject: Reply with quote

The triggers for auth url are independent, so you can use listen remove only. The two pieces of data that you mentioned are not in the POST for listener_remove but if there is call for them then it can be added.

karl.
Back to top
View user's profile Send private message Send e-mail Visit poster's website
iunderwood



Joined: 23 Aug 2008
Posts: 114
Location: Leicester, MA

PostPosted: Tue Sep 02, 2008 1:51 pm    Post subject: Reply with quote

Interestingly, I can't seem to make this work w/ 2.3.2.

If I use listener_add, I can get the accounting data fine, but not if I omit that option.
_________________
++I;
Back to top
View user's profile Send private message
karlH
Code Warrior
Code Warrior


Joined: 13 Jun 2005
Posts: 5476
Location: UK

PostPosted: Tue Sep 02, 2008 4:13 pm    Post subject: Reply with quote

You're saying that your listener_remove url is issued when listener_add is defined but not when listener_add is removed. If so then you need to provide information about the setup, xml settings, logs. At least then we'll know what issues are involved instead of just a useless "not working" type statement.

karl.
Back to top
View user's profile Send private message Send e-mail Visit poster's website
iunderwood



Joined: 23 Aug 2008
Posts: 114
Location: Leicester, MA

PostPosted: Tue Sep 02, 2008 5:31 pm    Post subject: Reply with quote

Yeah ... I guess that kind of debugging info would be helpful.

The specific problem is with mountpoint /rgr-64k.aacp which isn't sending anything back. Mountpoint /rgr-64k.ogg works fine.

Here is the XML config ... PWs/IPs changed:

Code:
<icecast>

    <limits>
        <sources>7</sources>
    </limits>

    <authentication>
        <source-password>pw</source-password>
        <admin-user>god</admin-user>
        <admin-password>admin</admin-password>
    </authentication>

    <hostname>68.x.x.x</hostname>

    <listen-socket>
        <port>2112</port>
   <shoutcast-mount>/rgr-128k.mp3</shoutcast-mount>
    </listen-socket>

    <mount>
      <mount-name>/testing.ogg</mount-name>

      <password>testrun</password>

      <max-listeners>10</max-listeners>
    </mount>

    <mount>
      <mount-name>/incoming.ogg</mount-name>

      <max-listeners>3</max-listeners>

      <fallback-mount>/fallback.ogg</fallback-mount>
      <fallback-override>1</fallback-override>

      <hidden>1</hidden>
    </mount>

    <mount>
      <mount-name>/fallback.ogg</mount-name>

      <password>S</password>

      <hidden>1</hidden>     
    </mount>

    <mount>
      <mount-name>/rgr-64k.ogg</mount-name>
      <password>T</password>
      <authentication type="url">
        <option name="listener_add" value="http://dev/modules/uhq_iceauth/auth.php"/>
        <option name="listener_remove" value="http://dev/modules/uhq_iceauth/auth.php"/>
        <option name="username" value="user"/>
        <option name="password" value="pass"/>
        <option name="auth_header" value="icecast-auth-user: OK"/>
      </authentication>

    </mount>

    <mount>
      <mount-name>/rgr-32k.ogg</mount-name>
      <password>T</password>
      <authentication type="url">
        <option name="listener_add" value="http://dev/modules/uhq_iceauth/auth.php"/>
        <option name="listener_remove" value="http://dev/modules/uhq_iceauth/auth.php"/>
        <option name="username" value="user"/>
        <option name="password" value="pass"/>
        <option name="auth_header" value="icecast-auth-user: OK"/>
      </authentication>
    </mount>

    <mount>
      <mount-name>/rgr-64k.aacp</mount-name>
      <password>T</password>
      <authentication type="url">
        <option name="listener_remove" value="http://dev/modules/uhq_iceauth/auth.php"/>
        <option name="username" value="user"/>
        <option name="password" value="pass"/>
        <option name="auth_header" value="icecast-auth-user: OK"/>
      </authentication>
    </mount>

    <mount>
      <mount-name>/rgr-128k.mp3</mount-name>
      <password>T</password>

    </mount>

    <fileserve>1</fileserve>

    <paths>
        <logdir>./logs</logdir>
        <webroot>./web</webroot>
        <adminroot>./admin</adminroot>
        <alias source="/" dest="/status.xsl"/>
    </paths>

    <logging>
        <accesslog>access.log</accesslog>
        <errorlog>error.log</errorlog>
         <loglevel>4</loglevel> <!-- 4 Debug, 3 Info, 2 Warn, 1 Error -->
    </logging>

</icecast>


And the error log:

Code:

[2008-09-02  13:22:44] INFO auth/auth.c Authentication thread started
[2008-09-02  13:22:44] INFO auth/auth.c Authentication thread started
[2008-09-02  13:22:44] INFO auth/auth.c Authentication thread started
[2008-09-02  13:22:44] INFO stats/stats.c stats thread started
[2008-09-02  13:22:44] INFO fserve/fserve.c file serving thread started
[2008-09-02  13:22:44] INFO main/main.c Icecast 2.3.2 server started
[2008-09-02  13:22:44] INFO connection/connection.c No SSL capability
[2008-09-02  13:22:44] INFO yp/yp.c YP update thread started
[2008-09-02  13:22:44] WARN source/source.c unable to open file "./web/fallback.ogg"
[2008-09-02  13:23:34] INFO connection/connection.c Source logging in at mountpoint "/fallback.ogg"
[2008-09-02  13:23:34] INFO format-vorbis/format_vorbis.c seen initial vorbis header
[2008-09-02  13:23:35] INFO source/source.c listener count on /fallback.ogg now 0
[2008-09-02  13:23:40] INFO connection/connection.c Source logging in at mountpoint "/rgr-64k.ogg"
[2008-09-02  13:23:40] INFO connection/connection.c Source logging in at mountpoint "/rgr-64k.aacp"
[2008-09-02  13:23:40] INFO admin/admin.c Received admin command metadata on mount "/rgr-64k.aacp"
[2008-09-02  13:23:40] INFO admin/admin.c Metadata on mountpoint /rgr-64k.aacp changed to ""
[2008-09-02  13:23:40] INFO format-vorbis/format_vorbis.c seen initial vorbis header
[2008-09-02  13:23:40] INFO connection/connection.c Source logging in at mountpoint "/rgr-32k.ogg"
[2008-09-02  13:23:40] INFO source/source.c listener count on /fallback.ogg now 1
[2008-09-02  13:23:40] INFO format-vorbis/format_vorbis.c seen initial vorbis header
[2008-09-02  13:23:40] INFO source/source.c listener count on /rgr-64k.aacp now 0
[2008-09-02  13:23:40] INFO source/source.c listener count on /rgr-64k.ogg now 0
[2008-09-02  13:23:41] INFO source/source.c listener count on /rgr-32k.ogg now 0
[2008-09-02  13:23:41] INFO format-vorbis/format_vorbis.c seen initial vorbis header
[2008-09-02  13:23:41] INFO format-vorbis/format_vorbis.c seen initial vorbis header
[2008-09-02  13:23:41] INFO format-vorbis/format_vorbis.c seen initial vorbis header
[2008-09-02  13:23:41] INFO admin/admin.c Received admin command metadata on mount "/rgr-64k.aacp"
[2008-09-02  13:23:41] INFO admin/admin.c Metadata on mountpoint /rgr-64k.aacp changed to "RGR - [Waiting For Signal]"
[2008-09-02  13:23:41] INFO format-vorbis/format_vorbis.c seen initial vorbis header
[2008-09-02  13:24:20] INFO source/source.c listener count on /rgr-64k.aacp now 1
[2008-09-02  13:24:41] INFO source/source.c listener count on /rgr-64k.aacp now 0
[2008-09-02  13:25:35] INFO format-vorbis/format_vorbis.c seen initial vorbis header
[2008-09-02  13:25:40] INFO auth/auth.c adding client for authentication
[2008-09-02  13:25:40] INFO auth/auth.c auth on /rgr-64k.ogg has 1 pending
[2008-09-02  13:25:41] INFO source/source.c listener count on /rgr-64k.ogg now 1
[2008-09-02  13:26:41] INFO auth/auth.c auth on /rgr-64k.ogg has 1 pending
[2008-09-02  13:26:41] INFO source/source.c listener count on /rgr-64k.ogg now 0
[2008-09-02  13:27:34] INFO format-vorbis/format_vorbis.c seen initial vorbis header

That should at least be more helpful.
_________________
++I;
Back to top
View user's profile Send private message
karlH
Code Warrior
Code Warrior


Joined: 13 Jun 2005
Posts: 5476
Location: UK

PostPosted: Tue Sep 02, 2008 8:22 pm    Post subject: Reply with quote

so I guess this is win32. The odd thing that stands out is that the log does not match the xml, you have log level 4 but no DBUG lines in the error log. I also don't see and "auth on /rgr-64k.aacp has X pending" like to have on th ogg mountpoint., which tells me that icecast doesn't have authentication for that mountpoint. Be absolutely sure that you have the correct xml and that you have restarted icecast after saving the changes.

karl.
Back to top
View user's profile Send private message Send e-mail Visit poster's website
iunderwood



Joined: 23 Aug 2008
Posts: 114
Location: Leicester, MA

PostPosted: Wed Sep 03, 2008 2:42 am    Post subject: Reply with quote

Sure enough, I did forget to restart.

In this snippet, I log into rgr-64k.aacp, and then follow that up with moving to the ogg mount:

Code:

[2008-09-02  22:29:54] DBUG stats/stats.c update node clients (6)
[2008-09-02  22:29:54] DBUG stats/stats.c update node connections (25)
[2008-09-02  22:29:54] DBUG admin/admin.c Admin request (/admin/stats.xml)
[2008-09-02  22:29:54] DBUG admin/admin.c Got command (stats.xml)
[2008-09-02  22:29:54] DBUG admin/admin.c Stats request, sending xml stats
[2008-09-02  22:29:54] DBUG fserve/fserve.c Adding client to file serving engine
[2008-09-02  22:29:54] DBUG stats/stats.c update node client_connections (21)
[2008-09-02  22:29:54] DBUG stats/stats.c update node clients (5)
[2008-09-02  22:29:55] DBUG admin/admin.c Admin request (/admin/buildm3u)
[2008-09-02  22:29:55] DBUG admin/admin.c Got command (buildm3u)
[2008-09-02  22:29:55] DBUG fserve/fserve.c Adding client to file serving engine
[2008-09-02  22:29:55] DBUG stats/stats.c update node clients (6)
[2008-09-02  22:29:55] DBUG stats/stats.c update node connections (26)
[2008-09-02  22:29:55] DBUG stats/stats.c update node client_connections (22)
[2008-09-02  22:29:55] DBUG stats/stats.c update node clients (5)
[2008-09-02  22:29:56] DBUG stats/stats.c update node total_bytes_read (282422)
[2008-09-02  22:29:56] DBUG stats/stats.c update node total_bytes_sent (0)
[2008-09-02  22:29:56] DBUG stats/stats.c update node total_bytes_read (147693)
[2008-09-02  22:29:56] DBUG stats/stats.c update node total_bytes_sent (0)
[2008-09-02  22:29:56] DBUG stats/stats.c update node total_bytes_read (248906)
[2008-09-02  22:29:56] DBUG stats/stats.c update node total_bytes_sent (0)
[2008-09-02  22:29:57] DBUG stats/stats.c update node total_bytes_read (371708)
[2008-09-02  22:29:57] DBUG stats/stats.c update node total_bytes_sent (342232)
[2008-09-02  22:30:00] DBUG auth/auth.c max on /rgr-64k.aacp is -1 (cur 0)
[2008-09-02  22:30:00] DBUG auth/auth.c Added client to /rgr-64k.aacp
[2008-09-02  22:30:00] DBUG auth/auth.c client authenticated, passed to source
[2008-09-02  22:30:00] DBUG stats/stats.c update node clients (6)
[2008-09-02  22:30:00] DBUG stats/stats.c update node connections (27)
[2008-09-02  22:30:00] DBUG stats/stats.c update node client_connections (23)
[2008-09-02  22:30:00] DBUG source/source.c Client added
[2008-09-02  22:30:00] INFO source/source.c listener count on /rgr-64k.aacp now 1
[2008-09-02  22:30:00] DBUG format/format.c processing pending client headers
[2008-09-02  22:30:00] DBUG stats/stats.c update node listener_peak (1)
[2008-09-02  22:30:00] DBUG stats/stats.c update node listeners (1)
[2008-09-02  22:30:00] DBUG stats/stats.c update node listeners (2)
[2008-09-02  22:30:00] DBUG stats/stats.c update node listener_connections (2)
[2008-09-02  22:30:01] DBUG stats/stats.c update node total_bytes_read (323292)
[2008-09-02  22:30:01] DBUG stats/stats.c update node total_bytes_sent (8729)
[2008-09-02  22:30:01] DBUG stats/stats.c update node total_bytes_read (168811)
[2008-09-02  22:30:01] DBUG stats/stats.c update node total_bytes_sent (0)
[2008-09-02  22:30:01] DBUG stats/stats.c update node total_bytes_read (282663)
[2008-09-02  22:30:01] DBUG stats/stats.c update node total_bytes_sent (0)
[2008-09-02  22:30:02] DBUG stats/stats.c update node total_bytes_read (418724)
[2008-09-02  22:30:02] DBUG stats/stats.c update node total_bytes_sent (389298)
[2008-09-02  22:30:06] DBUG stats/stats.c update node total_bytes_read (363789)
[2008-09-02  22:30:06] DBUG stats/stats.c update node total_bytes_sent (105399)
[2008-09-02  22:30:06] DBUG stats/stats.c update node total_bytes_read (316300)
[2008-09-02  22:30:06] DBUG stats/stats.c update node total_bytes_sent (0)
[2008-09-02  22:30:06] DBUG stats/stats.c update node total_bytes_read (189860)
[2008-09-02  22:30:06] DBUG stats/stats.c update node total_bytes_sent (0)
[2008-09-02  22:30:07] DBUG stats/stats.c update node total_bytes_read (461543)
[2008-09-02  22:30:07] DBUG stats/stats.c update node total_bytes_sent (431967)
[2008-09-02  22:30:11] DBUG stats/stats.c update node total_bytes_read (350159)
[2008-09-02  22:30:11] DBUG stats/stats.c update node total_bytes_sent (0)
[2008-09-02  22:30:11] DBUG stats/stats.c update node total_bytes_read (404660)
[2008-09-02  22:30:11] DBUG stats/stats.c update node total_bytes_sent (147402)
[2008-09-02  22:30:11] DBUG stats/stats.c update node total_bytes_read (210888)
[2008-09-02  22:30:11] DBUG stats/stats.c update node total_bytes_sent (0)
[2008-09-02  22:30:12] DBUG stats/stats.c update node total_bytes_read (508776)
[2008-09-02  22:30:12] DBUG stats/stats.c update node total_bytes_sent (479215)
[2008-09-02  22:30:14] DBUG admin/admin.c Admin request (/admin/buildm3u)
[2008-09-02  22:30:14] DBUG admin/admin.c Got command (buildm3u)
[2008-09-02  22:30:14] DBUG fserve/fserve.c Adding client to file serving engine
[2008-09-02  22:30:14] DBUG stats/stats.c update node clients (7)
[2008-09-02  22:30:14] DBUG stats/stats.c update node connections (28)
[2008-09-02  22:30:14] DBUG stats/stats.c update node client_connections (24)
[2008-09-02  22:30:14] DBUG stats/stats.c update node clients (6)
[2008-09-02  22:30:16] DBUG stats/stats.c update node total_bytes_read (444408)
[2008-09-02  22:30:16] DBUG stats/stats.c update node total_bytes_sent (186604)
[2008-09-02  22:30:16] DBUG stats/stats.c update node total_bytes_read (227805)
[2008-09-02  22:30:16] DBUG stats/stats.c update node total_bytes_sent (0)
[2008-09-02  22:30:16] INFO auth/auth.c adding client for authentication
[2008-09-02  22:30:16] DBUG auth/auth.c ...refcount on auth_t /rgr-64k.ogg is now 2
[2008-09-02  22:30:16] INFO auth/auth.c auth on /rgr-64k.ogg has 1 pending
[2008-09-02  22:30:16] DBUG auth/auth.c 1 client(s) pending on /rgr-64k.ogg
[2008-09-02  22:30:16] DBUG stats/stats.c update node clients (7)
[2008-09-02  22:30:16] DBUG stats/stats.c update node connections (29)
[2008-09-02  22:30:16] DBUG stats/stats.c update node client_connections (25)
[2008-09-02  22:30:16] DBUG stats/stats.c update node total_bytes_read (384029)
[2008-09-02  22:30:16] DBUG stats/stats.c update node total_bytes_sent (0)
[2008-09-02  22:30:16] DBUG client/client.c Client connection died
[2008-09-02  22:30:16] DBUG source/source.c Client removed
[2008-09-02  22:30:16] INFO source/source.c listener count on /rgr-64k.aacp now 0
[2008-09-02  22:30:16] DBUG stats/stats.c update node clients (6)
[2008-09-02  22:30:16] DBUG stats/stats.c update node listeners (1)
[2008-09-02  22:30:16] DBUG stats/stats.c update node listeners (0)
[2008-09-02  22:30:17] DBUG auth/auth.c max on /rgr-64k.ogg is -1 (cur 0)
[2008-09-02  22:30:17] DBUG auth/auth.c Added client to /rgr-64k.ogg
[2008-09-02  22:30:17] DBUG auth/auth.c client authenticated, passed to source
[2008-09-02  22:30:17] DBUG source/source.c Client added
[2008-09-02  22:30:17] INFO source/source.c listener count on /rgr-64k.ogg now 1
[2008-09-02  22:30:17] DBUG stats/stats.c update node total_bytes_read (555916)
[2008-09-02  22:30:17] DBUG stats/stats.c update node total_bytes_sent (526426)
[2008-09-02  22:30:17] DBUG stats/stats.c update node listener_peak (1)
[2008-09-02  22:30:17] DBUG stats/stats.c update node listeners (1)
[2008-09-02  22:30:17] DBUG format/format.c processing pending client headers
[2008-09-02  22:30:17] DBUG stats/stats.c update node listeners (2)
[2008-09-02  22:30:17] DBUG stats/stats.c update node listener_connections (3)
[2008-09-02  22:30:21] DBUG stats/stats.c update node total_bytes_read (483000)
[2008-09-02  22:30:21] DBUG stats/stats.c update node total_bytes_sent (188004)
[2008-09-02  22:30:21] DBUG stats/stats.c update node total_bytes_read (248972)
[2008-09-02  22:30:21] DBUG stats/stats.c update node total_bytes_sent (0)
[2008-09-02  22:30:21] DBUG stats/stats.c update node total_bytes_read (417760)
[2008-09-02  22:30:21] DBUG stats/stats.c update node total_bytes_sent (87030)
[2008-09-02  22:30:22] DBUG stats/stats.c update node total_bytes_read (603012)
[2008-09-02  22:30:22] DBUG stats/stats.c update node total_bytes_sent (573577)
[2008-09-02  22:30:26] DBUG stats/stats.c update node total_bytes_read (523547)
[2008-09-02  22:30:26] DBUG stats/stats.c update node total_bytes_sent (188004)
[2008-09-02  22:30:26] DBUG stats/stats.c update node total_bytes_read (451552)
[2008-09-02  22:30:26] DBUG stats/stats.c update node total_bytes_sent (121452)
[2008-09-02  22:30:26] DBUG stats/stats.c update node total_bytes_read (270117)
[2008-09-02  22:30:26] DBUG stats/stats.c update node total_bytes_sent (0)
[2008-09-02  22:30:27] DBUG stats/stats.c update node total_bytes_read (645893)
[2008-09-02  22:30:27] DBUG stats/stats.c update node total_bytes_sent (616358)
[2008-09-02  22:30:30] DBUG client/client.c Client connection died
[2008-09-02  22:30:30] DBUG auth/auth.c ...refcount on auth_t /rgr-64k.ogg is now 2
[2008-09-02  22:30:30] INFO auth/auth.c auth on /rgr-64k.ogg has 1 pending
[2008-09-02  22:30:30] DBUG source/source.c Client removed
[2008-09-02  22:30:30] INFO source/source.c listener count on /rgr-64k.ogg now 0
[2008-09-02  22:30:30] DBUG auth/auth.c 1 client(s) pending on /rgr-64k.ogg
[2008-09-02  22:30:31] DBUG stats/stats.c update node listeners (1)
[2008-09-02  22:30:31] DBUG stats/stats.c update node listeners (0)
[2008-09-02  22:30:31] DBUG stats/stats.c update node total_bytes_read (564412)
[2008-09-02  22:30:31] DBUG stats/stats.c update node total_bytes_sent (188004)
[2008-09-02  22:30:31] DBUG stats/stats.c update node total_bytes_read (287006)
[2008-09-02  22:30:31] DBUG stats/stats.c update node total_bytes_sent (0)
[2008-09-02  22:30:31] DBUG stats/stats.c update node total_bytes_read (485273)
[2008-09-02  22:30:31] DBUG stats/stats.c update node total_bytes_sent (152389)
[2008-09-02  22:30:31] DBUG auth/auth.c ...refcount on auth_t /rgr-64k.ogg is now 1
[2008-09-02  22:30:31] DBUG stats/stats.c update node clients (5)
[2008-09-02  22:30:32] DBUG stats/stats.c update node total_bytes_read (692865)

I can email you the whole file if you'd like.
_________________
++I;
Back to top
View user's profile Send private message
karlH
Code Warrior
Code Warrior


Joined: 13 Jun 2005
Posts: 5476
Location: UK

PostPosted: Wed Sep 03, 2008 1:20 pm    Post subject: Reply with quote

ok, it's confirmed, there is an issue with listener_remove only setups. the listener_add needs to be defined for the auth to be referenced. As a workaround you can define a listener_add url to return the required header to always accept the incoming listener (they are still subject to other limits like max-listeners).

I think I have a fairly simple patch for this but I want to check a couple of things first, but if you use the kh tree then that should be working as the auth is handled differently there.

karl.
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    Icecast Streaming Media Server Forum Index -> Icecast Server All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2002 phpBB Group
subRebel style by ktauber