Skip to Content
It is currently July 16th, 2019, 11:25 am

All times are UTC - 6 hours [ DST ]




Post new topic Reply to topic  [ 4 posts ] 
Author Message
PostPosted: April 5th, 2019, 2:41 pm 
Offline
Senior User
Senior User

Joined: September 7th, 2018, 9:00 am
Posts: 99
I'm very concerned

due a PC update and a moving (the radio will be moved in the next week to another city), to avoid to stop the broadcasting, I did copied the config files and database on my PC and activated it instead. So the owner can relocate the radio in the new house, without worries.

My IP is quite different than the original one (I'm in another nation)
This shouldn't have a big impact ...

Everything works fine EXCEPT that into the HTML template header, the JS function request(songID) has the OLD IP in $host$ rather than the new one.

Song requests are consequently disrupt (as far as I don't hard encode my IP)

I'm not figuring out where SAM is getting the old IP :-/
I tried to restart it, without solving the issue ...

Code:
        <script type="text/javascript">
            /**
             * Open a popup window to send a song request to SAM
             */
            function request(songID)
            {
                var samhost = "$host$";
                var samport = "$port$";
                requests(songID, samhost, samport);
            }
        </script>


Top
 Profile  
Reply with quote  
PostPosted: April 5th, 2019, 3:54 pm 
Offline
Senior User
Senior User

Joined: September 7th, 2018, 9:00 am
Posts: 99
Please ignore it.

i did find.
Who came before me, hard encoded it into the template file with the variables.

I do think the reason is that putting the $host$ variable instead the real IP, SAM returns the classical 192.168.1.1 which doesn't make sense


Top
 Profile  
Reply with quote  
PostPosted: April 6th, 2019, 3:16 am 
Offline
Senior User
Senior User

Joined: September 7th, 2018, 9:00 am
Posts: 99
P.S. for that purpose, I find strange nodoby thought to build up a function, in SAM, to get the external IP instead to rely to the ETH IP ... :-/

Hard encoded stuff, is never a good choice


Top
 Profile  
Reply with quote  
PostPosted: April 6th, 2019, 4:00 am 
Offline
SVS Member
SVS Member

Joined: December 6th, 2004, 9:00 am
Posts: 7860
Location: Aachen (Germany)
SAM was built in a time when dialup or at least direct attached ADSL modems were still the major internet connection.
The SAM templates therefore pick the IP on the internet connection as it's external IP, which makes no sense this day and age with shared internet connections through a router being the standard.

The SAM templates haven't been updated for THAT long, so that's really a thing.

_________________
Benedikt Bauer - SVS (Spacial Volunteer Support)

We're offering custom PAL / PHP code and general SAM assistance at palscripts.com

My Project:
Send "Now Playing" from SAM to Twitter and/or Facebook | Sourcecode


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 

All times are UTC - 6 hours [ DST ]


Who is online

Users browsing this forum: No registered users and 12 guests


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 post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group