[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
[RESOLVED] Server initiated pushXML to port 443
Author Message
alisio Offline
Junior Member
**

Posts: 5
Joined: Nov 2012
Reputation: 0
Post: #1
[RESOLVED] Server initiated pushXML to port 443
Hi there!

I can successfully push xml to my yealink phones using port 80, but nothing happens when I try to sendit using port 443

I'm using a function much like this one taken from yealink's TextScreen.php, but changing port to 443 causes the phone to ignore it.

Code:
function push2phone($server,$phone,$data)
{
  $xml = "xml=".$data;
  $post = "POST / HTTP/1.1\r\n";
  $post .= "Host: $phone\r\n";
  $post .= "Referer: $server\r\n";
  $post .= "Connection: Keep-Alive\r\n";
  $post .= "Content-Type: text/xml\r\n";
  $post .= "Content-Length: ".strlen($xml)."\r\n\r\n";
  $fp = @fsockopen ( $phone, 80, $errno, $errstr, 5);
  if($fp)
  {
    fputs($fp, $post.$xml);
    flush();
    fclose($fp);
  }
}

Is is possible? Am I missing something?
(This post was last modified: 01-29-2016 12:04 AM by alisio.)
01-28-2016 04:02 AM
Find all posts by this user    like0    dislike0 Quote this message in a reply
Yealink_Michael Offline
Administrator
*******

Posts: 382
Joined: Jul 2015
Reputation: 2
Post: #2
RE: Server initiated pushXML to port 443
hi

thanks for you information

for this issue, please check if the 443 port is occupied by other applications !

TKS & BR
Michael

Note : Our office will be closed from 4th, Feb. 2016 to 14th, Feb, 2016 due to CNY holidays.
01-28-2016 06:20 AM
Find all posts by this user    like0    dislike0 Quote this message in a reply
alisio Offline
Junior Member
**

Posts: 5
Joined: Nov 2012
Reputation: 0
Post: #3
RE: Server initiated pushXML to port 443
Hi and thanks for your help.

Sorry I don't follow your question. I have nothing using port 443 (don't even have apache enabled) and I cannot occupy 443 port in the phone as far as I know. I am pushing the xml directly to the phone from the server command line using php like this:

[hostname ~]# php TextScreen80.php (testing port 80 works FINE)

[hostname ~]# php TextScreen443.php (testing port 443 FAILS)

It's a really simple hardcoded php from yealink and I'm only changing the ip adress from the server (10.0.0.1), telephone (10.0.0.2) and the port number.

Code:
<?php
#
function push2phone($server,$phone,$data)
{
  $xml = "xml=".$data;
  $post = "POST / HTTP/1.1\r\n";
  $post .= "Host: $phone\r\n";
  $post .= "Referer: $server\r\n";
  $post .= "Connection: Keep-Alive\r\n";
  $post .= "Content-Type: text/xml\r\n";
  $post .= "Content-Length: ".strlen($xml)."\r\n\r\n";
  $fp = @fsockopen ( $phone, 443, $errno, $errstr, 5);
  if($fp)
  {
    fputs($fp, $post.$xml);
    flush();
    fclose($fp);
  }
}
##############################
$xml = "<YealinkIPPhoneTextScreen Beep=\"yes\">\n";
$xml .= "<Title>Push test</Title>\n";
$xml .= "<Text>This is a test for pushing text to a phone.</Text>\n";
$xml .= "</YealinkIPPhoneTextScreen>\n";
push2phone("10.0.0.1","10.0.0.2",$xml);


I enabled loglevel 6 on the phone and I see the following lines when pushing to port 80 using php TextScreen80.php:

Code:
Jan 28 14:03:47 10.0.0.2 mini_httpd[634]: mini_httpd.c(1997):path:/,query:
Jan 28 14:03:47 10.0.0.2 mini_httpd[634]: Receive PushXml Server[10.0.0.1] Request!
Jan 28 14:03:47 10.0.0.2 mini_httpd[634]: Receive PushXml Server[10.0.0.1] Request!
Jan 28 14:03:47 10.0.0.2 syslog: Receive PushXml Server[10.0.0.1] Request!
Jan 28 14:03:47 10.0.0.2 mini_httpd[407]: mini_httpd.c(1510):child process 634 exit!
Jan 28 14:03:47 10.0.0.2 VPM_Msg[507]: The msg:VPM_MSG_OPEN_HANDFREE_MODE, WPARAM 1, LPARAM 0
Jan 28 14:03:47 10.0.0.2 VPM_Msg[507]: The msg:VPM_MSG_SET_VOLUNE, WPARAM 1, LPARAM 13
Jan 28 14:03:47 10.0.0.2 VPM_Msg[507]: The msg:VPM_MSG_SET_VOLUNE, WPARAM 1, LPARAM 13
Jan 28 14:03:48 10.0.0.2 VPM_Msg[507]: The msg:VPM_MSG_PLAY_TONE, WPARAM 82, LPARAM 1
Jan 28 14:03:48 10.0.0.2 VPM_Msg[507]: The msg:VPM_MSG_PLAY_TONE, WPARAM 0, LPARAM 0
Jan 28 14:03:48 10.0.0.2 VPM_Msg[507]: The msg:VPM_MSG_SET_VOLUNE, WPARAM 1, LPARAM 13
Jan 28 14:03:48 10.0.0.2 VPM_Msg[507]: The msg:VPM_MSG_OPEN_HANDSET_MODE, WPARAM 1, LPARAM 0
Jan 28 14:03:48 10.0.0.2 VPM_Msg[507]: The msg:VPM_MSG_SET_VOLUNE, WPARAM 1, LPARAM 18

While using php TextScreen443.php I see only this line and nothing happens on the LCD:
Code:
Jan 28 14:20:54 10.0.0.2 mini_httpds[436]: mini_httpd.c(1510):child process 552 exit!
.

The phone is getting 'something' as the log shows.

I found nothing on the documentation about pushxml port restriction. Any ideas?

Than you btw!
(This post was last modified: 01-28-2016 10:23 PM by alisio.)
01-28-2016 10:16 PM
Find all posts by this user    like0    dislike0 Quote this message in a reply
alisio Offline
Junior Member
**

Posts: 5
Joined: Nov 2012
Reputation: 0
Post: #4
RE: Server initiated pushXML to port 443
Hi again!

I figured out the problem. I forgot to prefix the hostname with 'ssl://' in the fsockopen function (DUH!).

The correct way to push using ssl taking the TextScreen.php sample is:

Code:
<?php
#
function push2phone($server,$phone,$data)
{
  $xml = "xml=".$data;
  $post = "POST / HTTP/1.1\r\n";
  $post .= "Host: $phone\r\n";
  $post .= "Referer: $server\r\n";
  $post .= "Connection: Keep-Alive\r\n";
  $post .= "Content-Type: text/xml\r\n";
  $post .= "Content-Length: ".strlen($xml)."\r\n\r\n";
  $fp = @fsockopen ( 'ssl://'.$phone, 443, $errno, $errstr, 5);
  if($fp)
  {
    fputs($fp, $post.$xml);
    flush();
    fclose($fp);
  }
}
##############################
$xml = "<YealinkIPPhoneTextScreen Beep=\"yes\">\n";
$xml .= "<Title>Push test</Title>\n";
$xml .= "<Text>This is a test for pushing text to a phone.</Text>\n";
$xml .= "</YealinkIPPhoneTextScreen>\n";
push2phone("10.0.0.1","10.0.0.2",$xml);
01-29-2016 12:03 AM
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
  Share Wi/Fi to PC port kevins1701 2 3,306 08-12-2022 01:33 AM
Last Post: seraphim19
  What is alarm server alarm.server.address ? (W59R) Ivan86 0 1,786 08-10-2021 04:42 PM
Last Post: Ivan86
  LDAP server is unavailable Andrei9385 2 6,505 07-16-2021 08:34 PM
Last Post: nolto
  T46s won't try to register to server on local subnet jigjag 0 2,775 09-08-2020 10:52 PM
Last Post: jigjag
  Direct IP Call Outside LAN with specific port BumbleBears 2 5,152 05-28-2020 02:13 PM
Last Post: Lewis-H
  .cfg file needed for Zultys provisioning server jerryp 0 2,949 01-30-2020 09:26 PM
Last Post: jerryp
  Set PC port link to 1Gb from provisioning file avayax 1 4,338 09-10-2019 03:30 PM
Last Post: complex1
  Slow speed on the PC port Sur 4 11,356 04-12-2019 09:28 AM
Last Post: Johnny88
  Daisy chain off of PC port on T23G avayax 2 6,054 01-28-2019 03:37 PM
Last Post: jolouis
  How to specify an IP range in the "PushXML allowed server" field? nSolvePaul 2 5,258 11-02-2018 09:59 AM
Last Post: nSolvePaul

Forum Jump:


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

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