Koozali.org: home of the SME Server

Obsolete Releases => SME VoIP (Asterisk, SAIL etc) => Topic started by: compsos on June 19, 2011, 07:16:03 AM

Title: XML Provisioning files Sail 3.1.0-120
Post by: compsos 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?
Title: [Solved] XML Provisioning files Sail 3.1.0-120
Post by: compsos 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?
Title: Re: XML Provisioning files Sail 3.1.0-120
Post by: SARK devs 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
Title: [Solved] Re: XML Provisioning files Sail 3.1.0-120
Post by: compsos on July 24, 2011, 05:18:54 AM
Well done. That appears to have cured it.
Title: Re: XML Provisioning files Sail 3.1.0-120
Post by: SARK devs 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