Koozali.org: home of the SME Server

XML Provisioning files Sail 3.1.0-120

Offline compsos

  • *
  • 472
  • +0/-0
XML Provisioning files Sail 3.1.0-120
« on: June 19, 2011, 07:16:03 AM »
Hi Jeff
Just had a run in with Snom M9s. This system also has a Snom MP which is being provisioned by a htm file and worked almost out of the box. But the M9s are xml provisioned and somewhat different.

It appears the file generator is reading the 1st line ["snom-m9-$MAC.xml" OK to generate the file but enters a blank line at the beginning of the file. The M9 refuses to read an XML file starting with a blank line. Other phones using cfg files do not notice the blank line.

Is there a patch or work around to stop this happening on every commit?
Regards

Gordon............

Offline compsos

  • *
  • 472
  • +0/-0
[Solved] XML Provisioning files Sail 3.1.0-120
« Reply #1 on: July 23, 2011, 04:11:47 AM »
Basically the problem is that when the files are dreated or updated in the tftpboot directory the first line is blank
Code: [Select]

<?xml version="1.0" encoding="utf-8"?>
So far have not found the cause. The field in the sark.db is fine. It particularly affects phones working on xml files as they do not comply.
Any clues on where the extra "/n" could be?
« Last Edit: July 24, 2011, 05:19:50 AM by compsos »
Regards

Gordon............

Offline SARK devs

  • *****
  • 2,806
  • +1/-0
    • http://sarkpbx.com
Re: XML Provisioning files Sail 3.1.0-120
« Reply #2 on: July 24, 2011, 02:15:22 AM »
Here is a fix for you to try...

grab /opt/sark/generator/tftpSQL.php using your favourite editor.

At or around line 110 find

Code: [Select]
$row['provision'] = preg_replace ( ' /\["(.*)"/ ',"", $row['provision'] );
replace it with

Code: [Select]
$row['provision'] = preg_replace ( ' /\["(.*)"\n/ ',"", $row['provision'] );
Save it back, issue a commit and then let me know if it worked for you.

Kind Regards

S

Offline compsos

  • *
  • 472
  • +0/-0
[Solved] Re: XML Provisioning files Sail 3.1.0-120
« Reply #3 on: July 24, 2011, 05:18:54 AM »
Well done. That appears to have cured it.
Regards

Gordon............

Offline SARK devs

  • *****
  • 2,806
  • +1/-0
    • http://sarkpbx.com
Re: XML Provisioning files Sail 3.1.0-120
« Reply #4 on: July 24, 2011, 09:21:43 AM »
Thanks for letting me know; I'll commit it to svn so that you get it in the next out.

Best

jeff