lukak
Junior Member
Posts: 1
Joined: Aug 2015
|
RE: [SOLVED] cant get XML to display during startup sequence.
(02-04-2015 06:31 PM)cadillackid Wrote: Ok I solved this issue. the simple solution is that for XML to display automatically after the startup, I have to Push it to the phone as opposed to the phone going into browser mode to request the startup URI.
so my action URI stays the same, I still have to use the "Fake" SIP account as the setup_completed URI never executes.. (im guessing because the <MAC>.cfg doesnt exist so it considers it a "failed" setup_completed..
a sample PHP i use to push data to the phone is this:
Code:
############################################################
# Function to push XML data to the phone
############################################################
function phonepush($server_ip,$phone_ip,$data)
{
$xmldata = "xml=".$data;
$postheader = "POST / HTTP/1.1\r\n";
$postheader .= "Host: $phone_ip\r\n";
$postheader .= "Referer: $server_ip\r\n";
$postheader .= "Connection: Keep-Alive\r\n";
$postheader .= "Content-Type: text/xml\r\n";
$postheader .= "Content-Length: ".strlen($xmldata)."\r\n\r\n";
$fp = @fsockopen ( $phone_ip, 80, $errno, $errstr, 5);
if($fp)
{
fputs($fp, $postheader.$xmldata);
flush();
fclose($fp);
}
}
and then sample XML data that is pushed to the phone.
Code:
###########################################################
# Function to display select menu to phone.
###########################################################
function selectnum()
{
$xml = "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n";
$xml .= "<YealinkIPPhoneInputScreen type = \"number\" Timeout = \"0\">\n";
$xml .= "<Title>New Phone</Title>\n";
$xml .= "<Prompt>NewExt:</Prompt>\n";
$xml .= "<URL>http://www.someurl.here</URL>\n";
$xml .= "<Parameter>user</Parameter>\n";
$xml .= "</YealinkIPPhoneInputScreen>\n";
phonepush("server.ip.here","phone.ip.her",$xml);
}
hope this helps someone out that wants to display an XML form on startup.
since I put this in my Model specific config, it loads this XML anytime the phone loads. however once my system generates a <MAC>.cfg for the phone, I blank the values out in the config for
action url setup completed and for action_url register failed. because the phone <MAC>.cfg supercedes the model config file the newphone message is never displayed on a phone that has been configured...
-Christopher
Hi Christopher,
Can you please send me this code? I want to make auto configuration of mac.cfg files, when username and password are inserted.
BR,
Luka
|
|
08-03-2015 07:26 PM |
|