[YMCS/YDMP Free Trial Program]Yealink would like to offer Free Trial Program of Yealink device management service for our current eligible customers. You can see the details below.
https://www.yealink.com/ydmp-freetrial-2020


Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[SOLVED] cant get XML to display during startup sequence.
Author Message
cadillackid Offline
Junior Member
**

Posts: 26
Joined: Jan 2015
Reputation: 0
Post: #1
[SOLVED] cant get XML to display during startup sequence.
I have a custom script that I run to configure my new phones to my system. it basically looks for the input of an extension number from the user and then builds the MAC.cfg file based on what is input. the script works great, except that it will not run automatically when a new phone is plugged into the system or one is factory defaulted.

my y000000000028.cfg is as follows
Code:
#!version:1.0.0.1
# action_url.setup_completed = http://172.16.4.2/yealink/newphone.php?user=none
# action_url.ip_change = http://172.16.4.2/yealink/newphone.php
action_url.register_failed = http://172.16.4.2/yealink/newphone.php?user=none
# sip account
account.1.enable = 1
account.1.label = Unregistered
account.1.auth_name = unregistered
account.1.user_name = unregistered
account.1.password = none
account.1.sip_server.1.address = 172.16.4.2
account.1.sip_server.1.expires = 300
account.1.sip_server.1.retry_counts = 0
push_xml.server = 172.16.4.2
features.action_uri_limit_ip = any
#syslog.mode = 1
#syslog.server = 172.16.4.2
#syslog.level = 6
phone_setting.custom_softkey_enable = 1
programablekey.2.type = 27
programablekey.2.value = http://172.16.4.2/yealink/newphone.php?user=none

the script worlks perfectly if it is placed in a softkey or linekey on the phone, but wont display when the phone boots up.

the setup_completed uri would NEVER trigger it..
I then put in a fake SIP account and a trigger on register failed, I can see the script being requested from my web server but it still never displays on the phone screen.

below is the GET from my apache.. it is identical whether automatically called from the register fail or the Softkey.. yet only the softkey one works..
Code:
172.16.4.122 - - [02/Feb/2015:17:06:16 -0500] "GET /yealink/newphone.php?user=none HTTP/1.1" 200 254 "-" "Yealink SIP-T46G 28.72.0.26 00:15:65:76:3d:21"
if I wait for the phone to come up then Manually call the script by pressing my Softkey (as you see I have progammed). the script works perfect. so I know the script is coded right..

is it not possible to display XML to the phone on startup or register fail?

as mentioned above the script is requested from the web server just not displayed. I did not see anything regarding auto provisioning in my syslog and I have set to syslog level 6..

below is the XML being output from the server to the phone. again it works when used with softkey but not from register fail. even though the call makes itto my web server
Code:
<?xml version="1.0" encoding="utf-8"?>
<YealinkIPPhoneInputScreen type = "number" Timeout = "0">
<Title>New Phone</Title>
<Prompt>NewExt:</Prompt>
<URL>http://172.16.4.2/yealink/newphone.php</URL>
<Parameter>user</Parameter>
</YealinkIPPhoneInputScreen>
(This post was last modified: 02-04-2015 06:31 PM by cadillackid.)
02-03-2015 06:09 AM
Find all posts by this user    like0    dislike0 Quote this message in a reply
CWR Offline
Moderator
*****

Posts: 717
Joined: May 2013
Reputation: 7
Post: #2
RE: cant get XML to display during startup sequence.
Maybe the RPS could be helpful in your case:
http://yealink.com/product_info.aspx?Pro...cateid=217

Craig Reilly
MCSA, 3cx Advanced Certified
Scottsdale, AZ
02-03-2015 06:52 AM
Find all posts by this user    like0    dislike0 Quote this message in a reply
cadillackid Offline
Junior Member
**

Posts: 26
Joined: Jan 2015
Reputation: 0
Post: #3
RE: cant get XML to display during startup sequence.
the only issue with using RPS is that not always upon initial installation is there internet access at the site. we want to simply drop ship phones.. (or allow customer to buy their own phones), and not tie a specific extension to a MAC address..

with our aastra phones, we plug them in, they get the new phone screen, they type the extension in, if the extension is already registered to another phone, they are asked if they wish to replace the existing phone.. if they say yes and the existing phone is plugged in, it will delete the existing config file, and send a reboot to the phone.. the phone reboots to a bare master config which nullifies all Account values so the old phone doesnt try to register to the server... (we do this Now with our aastras)

obviously a workaround in my case is to blank the phone and put a button on it that says 'NewPhone' and lock out anything else.. im just trying to make it similar for training purposes in a customer site that has mixed phone types.

FWIW.. Aastra XML and Yealink XML are darn near identical.. in fact an Aastra Formatted XML file will display on a Yealink... interesting tidbit...
-Christopher
02-03-2015 07:00 AM
Find all posts by this user    like0    dislike0 Quote this message in a reply
CWR Offline
Moderator
*****

Posts: 717
Joined: May 2013
Reputation: 7
Post: #4
RE: cant get XML to display during startup sequence.
That makes a lot of sense... was just throwing it out there.

Good luck on this endeavor... I love the idea.

Craig Reilly
MCSA, 3cx Advanced Certified
Scottsdale, AZ
02-03-2015 07:11 AM
Find all posts by this user    like0    dislike0 Quote this message in a reply
cadillackid Offline
Junior Member
**

Posts: 26
Joined: Jan 2015
Reputation: 0
Post: #5
[SOLVED] RE: cant get XML to display during startup sequence.
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
02-04-2015 06:31 PM
Find all posts by this user    like0    dislike0 Quote this message in a reply
lukak Offline
Junior Member
**

Posts: 1
Joined: Aug 2015
Reputation: 0
Post: #6
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
Find all posts by this user    like0    dislike0 Quote this message in a reply
Post Reply 


Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  Provisioning only works on startup Snapdragons 3 9,688 09-29-2020 12:49 AM
Last Post: Jay_Yealink
  [SOLVED] T48S AutoProvisioning ldap.host not used BryanLee 1 6,185 07-19-2018 03:13 PM
Last Post: BryanLee
  [SOLVED] Modify softkey Wengel 1 8,533 02-21-2017 11:56 AM
Last Post: Wengel
  What's display voice mail in config file avayax 1 7,681 02-21-2017 08:30 AM
Last Post: complex1
  SIP-T20P not provisioning [solved] tonyg@guadagnoconsulting.com 1 7,863 06-29-2016 08:13 PM
Last Post: tonyg@guadagnoconsulting.com
  Softkey Speed-dial display in on-talking cadillackid 3 11,698 12-23-2015 01:30 AM
Last Post: DeepB
Thumbs Up [SOLVED] Auto provision Yealink EXP38 jldalla 1 7,099 09-29-2015 09:06 AM
Last Post: jldalla
  T48G Display Missed Call Popup key for provisioning tomp 5 13,772 12-11-2014 09:06 PM
Last Post: James_Yealink
Question [Solved] T46G: Make remote pronebook emty over provisioning. Kamiware 2 10,167 09-05-2014 03:10 PM
Last Post: Kamiware
  [SOLVED]T41 /T42 Doesn't support autoprovisioning multicast paging line key types. blendedtech 2 10,134 08-20-2014 07:00 PM
Last Post: Yealink Support

Forum Jump:


User(s) browsing this thread: 1 Guest(s)

Contact Us   Yealink   Return to Top   Return to Content   Lite (Archive) Mode   RSS Syndication