Yealink Forums

Full Version: Auto Provisioning and Chunked transfer encoding
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
Hello Yealink Community,

I'm trying to provision Yealink T26P from dynamically generated config file, which is sent from server as a chunked response.

Static config file can be fetched without problems:

Code:
autop[482]: http.c(1443): dns timeout:5
autop[482]: error.c(111): dns count:1,RetryTimes=2, Timeout=2
autop[482]: http.c(358): device mac:00:15:65:47:29:bf
autop[482]: http.c(704): UserAgent is yealink SIP-T26P 6.70.13.9 00:15:65:47:29:bf
autop[482]: http.c(3505): query header:#012GET /yealink/y000000000004.cfg HTTP/1.1#015#012Host: test.com#015#012User-Agent: yealink SIP-T26P 6.70.13.9 00:15:65:47:29:bf#015#012Accept: */*#015#012Connection: Keep-Alive#015#012#015
autop[482]: http.c(3542): ***send data***#012......
autop[482]: http.c(3650): recv header:#012HTTP/1.1 200 OK
autop[482]: http.c(2299): Server: nginx/0.7.65
autop[482]: http.c(2299): Date: Sun, 20 Oct 2013 10:21:36 GMT
autop[482]: http.c(2299): Content-Type: text/xml
autop[482]: http.c(2299): Content-Length: 361
autop[482]: http.c(2299): Last-Modified: Sat, 19 Oct 2013 20:19:26 GMT
autop[482]: http.c(2299): Connection: keep-alive
autop[482]: http.c(2299): Accept-Ranges: bytes
autop[482]: http.c(2299):
autop[482]: [./src/fileStream.cpp     :972 ] IFO Open URL OK

But phone cannot fetch dynamically generated file, and it not provide much information about why exactly it cannot be fetched:

Code:
autop[482]: http.c(358): device mac:00:15:65:47:29:bf
autop[482]: http.c(704): UserAgent is yealink SIP-T26P 6.70.13.9 00:15:65:47:29:bf
autop[482]: http.c(3505): query header:#012GET /yealink/sip-t26p/y000000000004.cfg HTTP/1.1#015#012Host: test.com#015#012User-Agent: yealink SIP-T26P 6.70.13.9 00:15:65:47:29:bf#015#012Accept: */*#015#012Connection: Keep-Alive#015
autop[482]: http.c(3542): ***send data***#012......
autop[482]: http.c(3650): recv header:#012HTTP/1.1 200 OK
autop[482]: http.c(2299): Server: nginx/0.7.65
autop[482]: http.c(2299): Date: Sun, 20 Oct 2013 10:16:47 GMT
autop[482]: http.c(2299): Content-Type: text/xml
autop[482]: http.c(2299): Transfer-Encoding: chunked
autop[482]: http.c(2299): Connection: keep-alive
autop[482]: http.c(2299): Status: 200 OK
autop[482]: http.c(2299): Accept-Ranges: bytes
autop[482]: http.c(2299): Last-Modified: Sun, 20 Oct 2013 10:16:47 GMT
autop[482]: http.c(2299): Content-Lenght: 361
autop[482]: http.c(2299): Content-Disposition: attachment
autop[482]: http.c(2299): Content-Transfer-Encoding: binary
autop[482]: http.c(2299): Cache-Control: private
autop[482]: http.c(2299): X-UA-Compatible: IE=Edge
autop[482]: http.c(2299): X-Request-Id: 6b5ee4db6fee7f30f82ef1f8a534c053
autop[482]: http.c(2299): X-Runtime: 0.045505
autop[482]: http.c(2299):
autop[482]: [./src/fileStream.cpp     :972 ] IFO Open URL Fail
autop[482]: [./src/autoParser.cpp     :621 ] IFO Failed connect to server ! Try [1] times ...
autop[482]: [./src/autoParser.cpp     :626 ] WAR Can't connect server !!

I think that Phone simply does not support Chunked transfer encoding.
Any chance that phone will support it in near future?
Hi bearded,

Yes, we don't support Chunked transfer encoding now.
Can you tell me why do you want to use this chunked response?
Is it convenience for your controls?
Hello Yealink Support,

The problem is that Ruby on Rails framework uses Chunked response by default, and there is not easy way to disable it (at least I did not find it yet).

I was a bit wondered that Yealink phone does not support it because I did not had such problem with phones like Aastra, Cisco, Gigaset, Grandstream, Panasonic, Polycom and Snom.

So for me it would be very great if Yealink phone could support Chunked response as well, because in other case I will need to rework whole provisioning for all supported brands Sad
I ran into the same problem a few days ago when testing RPS. I had been using older firmware version 61.0.129 which was sent to me as a Beta to add initial RPS support, and funny enough that worked just fine with Chunked transfers. Neither of the official 70 and 71 firmwares do though it seems as Support just confirmed...

We're using a PHP/Apache setup, so for us the easy solution was just to force Apache to drop into HTTP 1.0 compatibility mode by adding:

SetEnv downgrade-1.0

to a .htaccess file. Not sure if that will help you with your Rails setup or not but gives you an idea of a possible workaround without having to rebuild everything from scratch.
Hi bearded,

Because your firmware adds some special features and if you want to add this feature, you can contact with the technican of your distributor.
I will also double check with our R&D about this feature in your version.
I did a typo in HTTP Header, wrote 'Content-Lenght', so now problem is solved, and I just need to sleep more... Smile
Hi bearded,

Sorry for the mistake. I double check with our R&D colleagues about Chunked transfer encoding. And they confirm that yealink phone can support this encoding.
(10-26-2013 09:35 AM)Yealink Support Wrote: [ -> ]Hi bearded,

Sorry for the mistake. I double check with our R&D colleagues about Chunked transfer encoding. And they confirm that yealink phone can support this encoding.

Hello Yealink Support,

From what I saw in Wireshark - phone does not support it.
I think your R&D colleagues should make a real test of this feature, because "can support" and "support" are different things.

Here is a piece of code, which gives them an easy way to check the problem.

Code:
def send_yealink_common_cfg
  _config = [
    '#!version:1.0.0.1',
    '',
    'lang.gui = Russian',
    ''
  ].join("\n")

#  response.headers['Accept-Ranges'] = 'bytes'
#  response.headers['Content-Length'] = _config.bytesize.to_s
#  response.headers['Last-Modified'] = Time.now.httpdate

  send_data _config, filename: "#{params[:id].downcase}.cfg", type: 'text/xml', disposition: 'inline'
end

Best wishes to your company and distributors with their own firmware.
Hello,

I'm facing a similar problem with my SIP-T32G phone with the 32.70.0.171 RPS firmware version. There are any solution to this problem?

The syslog I got:
Aug 1 00:12:33 autop[504]: http.c(3505): query header: GET /001122334455.cfg HTTP/1.1^M Host: 12.115.34.34:9090^M User-Agent: Yealink SIP-T32G 32.70.0.171 00:11:22:33:44:55^M Accept: */*^M Connection: Keep-Alive^M ^M
Aug 1 00:12:33 autop[504]: http.c(3542): ***send data*** ......
Aug 1 00:12:37 autop[504]: http.c(3650): recv header: HTTP/1.1 200 OK
Aug 1 00:12:37 autop[504]: http.c(2299): Server: nginx/1.4.5
Aug 1 00:12:37 autop[504]: http.c(2299): Date: Tue, 06 May 2014 15:29:14 GMT
Aug 1 00:12:37 autop[504]: http.c(2299): Content-Type: application/octet-stream
Aug 1 00:12:37 autop[504]: http.c(2299): Transfer-Encoding: chunked
Aug 1 00:12:37 autop[504]: http.c(2299): Connection: keep-alive
Aug 1 00:12:37 autop[504]: http.c(2299):
Aug 1 00:12:37 autop[504]: [./src/fileStream.cpp :954 ] IFO Open URL Fail
Aug 1 00:12:37 autop[504]: [./src/autoParser.cpp :621 ] IFO Failed connect to server ! Try [1] times ...
Aug 1 00:12:37 autop[504]: [./src/autoParser.cpp :626 ] WAR Can't connect server !!
Aug 1 00:12:37 autop[504]: [./src/autoServer.cpp :755 ] IFO Upgrade finished [FAIL] !
Aug 1 00:12:37 autop[504]: [./src/autoServer.cpp :843 ] IFO <<<<<< Autoprovision End >>>>>>
Sorry. I think you should change to use "Content-Length" header.
Pages: 1 2
Reference URL's