A set top box comprising: a communication interface configured to enable communication with an IP Multimedia Subsystem, IMS, gateway; a web browser configured to generate a web page displayable on a display screen of or connected to said set top box; an embedded Open IPTV Terminal Function, OITF, system connected to said communication interface; and a script-based IMS application configured to be run by said web browser and comprising: a signal generator configured to generate IP television, IPTV, session signals destined to said IMS gateway to set-up and control an IPTV session; and an address provider configured to provide, to said OITF system, address information associated with media data available from a media server in a global network connected to said home network and received from said IMS gateway, wherein said OITF system is configured to generate, based on said address information from said script-based IMS application, a media request for said media data within said IPTV session and destined to said media server wherein said script-based IMS application is configured to receive, from said IMS gateway, a service provider selection page comprising, for each available service provider present in said global network, a provider identifier associated with the service provider but pointing towards said IMS gateway and transmit, to said IMS gateway, a service provider command, generated based on a user input, pointing back to the IMS gateway and comprising a provider identifier of a selected service provider, wherein the user input is configured to trigger the script-based IMS application to generate said service provider command comprising the provider identifier of the selected service provider. a communication interface configured to enable communication with an IP Multimedia Subsystem, IMS, gateway; a web browser configured to generate a web page displayable on a display screen of or connected to said set top box; an embedded Open IPTV Terminal Function, OITF, system connected to said communication interface; and a script-based IMS application configured to be run by said web browser and comprising: a signal generator configured to generate IP television, IPTV, session signals destined to said IMS gateway to set-up and control an IPTV session; and an address provider configured to provide, to said OITF system, address information associated with media data available from a media server in a global network connected to said home network and received from said IMS gateway, wherein said OITF system is configured to generate, based on said address information from said script-based IMS application, a media request for said media data within said IPTV session and destined to said media server a signal generator configured to generate IP television, IPTV, session signals destined to said IMS gateway to set-up and control an IPTV session; and an address provider configured to provide, to said OITF system, address information associated with media data available from a media server in a global network connected to said home network and received from said IMS gateway, wherein said OITF system is configured to generate, based on said address information from said script-based IMS application, a media request for said media data within said IPTV session and destined to said media server wherein said script-based IMS application is configured to receive, from said IMS gateway, a service provider selection page comprising, for each available service provider present in said global network, a provider identifier associated with the service provider but pointing towards said IMS gateway and transmit, to said IMS gateway, a service provider command, generated based on a user input, pointing back to the IMS gateway and comprising a provider identifier of a selected service provider, wherein the user input is configured to trigger the script-based IMS application to generate said service provider command comprising the provider identifier of the selected service provider.