How can we help you today?
Start a new topic
Answered

fetch mil minibroweser and exit

Hi,


i want to use this:

 

<?xml version="1.0" encoding="UTF-8"?>
  <SnomIPPhoneText>
   <if condition="$(set:user_active1)==on">
    <fetch mil="1000">http://127.0.0.1/minibrowser.htm?url=http://[server address]/exit.xml&amp;settings=save&amp;user_active1=off</fetch>
    <led number="3">Off</led>
    <text>User 1 inactive</text>
  </if>
  <if condition="$(set:user_active1)==off">
    <fetch mil="1000">http://127.0.0.1/minibrowser.htm?url=http://[server address]exit.xml&amp;settings=save&amp;user_active1=on</fetch>
    <led number="3">On</led>
    <text>User 1 active</text>
  </if>
</SnomIPPhoneText>

 

i want to set a action url to this php file and i should toogle the identity on and off and show led status.


it was working realy well some years ago. now with current version i get any time a 401 whatever it means:


Nov 27 13:35:29 [DEBUG2] PHN: TMR: 'Minibrowser Load URL' 0x944b24

Nov 27 13:35:29 [NOTICE] PHN: Fetching URL: http://127.0.0.1:80/minibrowser.htm?...

Nov 27 13:35:29 [DEBUG2] WEBCLIENT: Send TCP none

Nov 27 13:35:29 [DEBUG2] WEBCLIENT: Socket 74018 connecting

Nov 27 13:35:29 [DEBUG2] PHN: WEB: HTTP accepting from tcp:127.0.0.1:56046

Nov 27 13:35:29 [DEBUG2] PHN: WEB: HTTP 74019/80 accepted from tcp:127.0.0.1:56046

Nov 27 13:35:29 [DEBUG2] PHN: WEB: HTTP 74019/80 connected

Nov 27 13:35:29 [DEBUG2] WEBCLIENT: Socket 74018 connected

Nov 27 13:35:29 [INFO ] PHN: WEB: Request 74019/364/0: GET /minibrowser.htm?url=http%3A%2F%2F192.168.61.19%2Fsnom%2Fexit.xml&settings=save&user_active1=off&creation=2015-11-27T12%3A35%3A28Z HTTP/1.1

Nov 27 13:35:29 [INFO ] PHN: WEB: 74019 Basic authentication.

Nov 27 13:35:29 [INFO ] PHN: Authentication triggered. Set flag back.

Nov 27 13:35:29 [NOTICE] WEBCLIENT: handle_challenge: http server is asking for credentials!

Nov 27 13:35:29 [NOTICE] WEBCLIENT: handle_challenge: local challenge not allowed.

Nov 27 13:35:29 [NOTICE] PHN: Could not access requested minibrowser xml http://127.0.0.1:80/minibrowser.htm?url=http%3A%2F%2F192.168.61.19%2Fsnom%2Fexit.xml&settings=save&user_active1=off&creation=2015-11-27T12%3A35%3A28Z. HTTP status code: 401

Nov 27 13:35:29 [DEBUG2] WEBCLIENT: Socket 74018 disconnected


how can i fix it?





Best Answer

Hello,



You can use this code:


 

<?xml version="1.0" encoding="UTF-8"?>
<SnomIPPhoneText id=main"">
 <if condition="$(set:user_active[1])==on">
  <fetch mil="1000">snom://mb_exit#set:user_active1=off</fetch>
  <led number="3">Off</led>
  <text>User 1 inactive</text>
 </if>
 <if condition="$(set:user_active[1])==off">
  <fetch mil="1000">snom://mb_exit#set:user_active1=on</fetch>
  <led number="3">On</led>
  <text>User 1 active</text>
 </if>
</SnomIPPhoneText>

 

Don't forget to add the server hosting the XML into the mb_trusted_hosts setting.



Are you passing the loging creds to the phone?

 

Hello

I didnt see any PHP only XML.
And the first argument for an URI starting with a questionmark (?) and not with an: &amp;


 

http://[server address]/exit.xml&amp;settings=save&amp;user_active1=off

 

Maybe it works after correction?

okay after add username and passwort to the url it is working, it was never needed before, because its lokal (127.0.0.1).

so second problem ist, it should exit the minibrowser after 1 second (fetch), but i need to press cancel button, exit is not working anymore. why?

 

Answer

Hello,



You can use this code:


 

<?xml version="1.0" encoding="UTF-8"?>
<SnomIPPhoneText id=main"">
 <if condition="$(set:user_active[1])==on">
  <fetch mil="1000">snom://mb_exit#set:user_active1=off</fetch>
  <led number="3">Off</led>
  <text>User 1 inactive</text>
 </if>
 <if condition="$(set:user_active[1])==off">
  <fetch mil="1000">snom://mb_exit#set:user_active1=on</fetch>
  <led number="3">On</led>
  <text>User 1 active</text>
 </if>
</SnomIPPhoneText>

 

Don't forget to add the server hosting the XML into the mb_trusted_hosts setting.


how can i set this "mb_trusted_hosts" i dont find any field on the web gui

 

This setting isn't manageable via web GUI, you should configure it via provisioning or via single setting HTTP request ( http://phone_ip/settings.htm?settings=save&mb_trusted_hosts=your.server.name , see here 


1 person likes this
thx its working well!

 

Login or Signup to post a comment