<div dir="ltr">Can you share a link to that page? I don't see the page in the wiki.</div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Mar 6, 2017 at 4:51 PM, Marc Priebee <span dir="ltr"><<a href="mailto:Marc.Priebee@spark.co.nz" target="_blank">Marc.Priebee@spark.co.nz</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">





<div lang="EN-NZ" link="blue" vlink="purple">
<div class="m_7266849147686568341WordSection1">
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d">I’ve created a basic wiki page describing what I’ve found so far.<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d">Marc<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d"><u></u> <u></u></span></p>
<p class="MsoNormal"><b><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif">From:</span></b><span lang="EN-US" style="font-size:11.0pt;font-family:"Calibri",sans-serif"> Users [mailto:<a href="mailto:users-bounces@lists.genieacs.com" target="_blank">users-bounces@lists.<wbr>genieacs.com</a>]
<b>On Behalf Of </b>Dan Morphis<br>
<b>Sent:</b> Tuesday, 7 March 2017 6:00 a.m.</span></p><div><div class="h5"><br>
<b>To:</b> Community support for GenieACS users <<a href="mailto:users@lists.genieacs.com" target="_blank">users@lists.genieacs.com</a>><br>
<b>Subject:</b> Re: Virtual parameters<u></u><u></u></div></div><p></p><div><div class="h5">
<p class="MsoNormal"><u></u> <u></u></p>
<div>
<p class="MsoNormal">Marc,<u></u><u></u></p>
<div>
<p class="MsoNormal"> Would you be so kind as to update the wiki with this information? Where you place extension scripts on disk, how to call and get the value back, etc. I'm sure many people would find this information very useful!<u></u><u></u></p>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<div>
<p class="MsoNormal">-dan<u></u><u></u></p>
</div>
</div>
<div>
<p class="MsoNormal"><u></u> <u></u></p>
<div>
<p class="MsoNormal">On Sun, Mar 5, 2017 at 12:32 PM, Marc Priebee <<a href="mailto:Marc.Priebee@spark.co.nz" target="_blank">Marc.Priebee@spark.co.nz</a>> wrote:<u></u><u></u></p>
<blockquote style="border:none;border-left:solid #cccccc 1.0pt;padding:0cm 0cm 0cm 6.0pt;margin-left:4.8pt;margin-right:0cm">
<p class="MsoNormal">FYI, in case this helps some-one...<br>
<br>
I resolved this after reviewing what the extension-wrapper script does. The extension scripts require a callback;<br>
<br>
exports.getSIP = function(d, callback) {<br>
        console.log("in getSIP with "+d);<br>
        var ldap = require('ldapjs');<br>
        let SIPParms = {<br>
                "username": '5645195',<br>
                "password": 'bleah'<br>
        }<br>
        callback(null, SIPParms);<br>
}<br>
<br>
(The 1st parameter in the callback is an error value)<br>
<br>
<span class="m_7266849147686568341im">Marc</span><br>
<br>
<br>
<span class="m_7266849147686568341im">-----Original Message-----</span><br>
<span class="m_7266849147686568341im">From: Users [mailto:<a href="mailto:users-bounces@lists.genieacs.com" target="_blank">users-bounces@lists.<wbr>genieacs.com</a>]</span><br>
<span class="m_7266849147686568341im">Sent: Monday, 6 March 2017 7:59 a.m.</span><br>
<span class="m_7266849147686568341im">To: Community support for GenieACS users <<a href="mailto:users@lists.genieacs.com" target="_blank">users@lists.genieacs.com</a>></span><u></u><u></u></p>
<div>
<div>
<p class="MsoNormal">Subject: RE: Virtual parameters<br>
<br>
<br>
Hi,<br>
<br>
I'm also struggling with this, except I'm trying to use an extension script rather than virtual parameters. The documentation refers to them as similar, but the extension section of the docs is TODO, and I can't find any examples anywhere.<br>
<br>
The provision script looks this this..<br>
let serial = declare("<wbr>InternetGatewayDevice.<wbr>DeviceInfo.SerialNumber", {value: 1}); log("provision with "+serial.value[0]); let resp = ext("testext", "start", serial.value[0]); log("provision back from extension"); declare("<wbr>InternetGatewayDevice.<wbr>ManagementServer.Username",
 {value: 1},<br>
  {value: resp.username});<br>
declare("<wbr>InternetGatewayDevice.<wbr>ManagementServer.Password", {value: 1},<br>
  {value: resp.password});<br>
<br>
If I remove the extension, (and set static values) the provision works as expected. But when I call the extension, I get the following error; Channel has faulted; channel="default" retries=0 faultCode="timeout" faultMessage="Extension timed out"<br>
<br>
The extension looks like this;<br>
exports.start = function(d) {<br>
 console.log("in ext script start with "+d);  let sipuser = "5645194";  let sippw = "bleah";  return {<br>
  "username": sipuser,<br>
  "password": sippw<br>
 };<br>
}<br>
<br>
I get the log message, so it's being called, but the script really isn't doing enough to be actually timing out.<br>
(Ultimately, my intention is to use the extension to retrieve SIP parameters from an LDAP directory, and provisioning them into the CPE)<br>
<br>
Regards<br>
Marc<br>
<br>
<br>
-----Original Message-----<br>
From: Users [mailto:<a href="mailto:users-bounces@lists.genieacs.com" target="_blank">users-bounces@lists.<wbr>genieacs.com</a>] On Behalf Of Zaid Abdulla<br>
Sent: Sunday, 5 March 2017 12:41 a.m.<br>
To: Community support for GenieACS users <<a href="mailto:users@lists.genieacs.com" target="_blank">users@lists.genieacs.com</a>><br>
Subject: Re: Virtual parameters<br>
<br>
On Wed, 2017-03-01 at 06:56 -0900, Dan Morphis wrote:<br>
> Can you post your script and some screenshots?<br>
<br>
Here's a sample script:<br>
<br>
    declare("<wbr>InternetGatewayDevice.<wbr>ManagementServer.<wbr>PeriodicInformInter<br>
val", null, {value: 300});<br>
    declare("<wbr>InternetGatewayDevice.<wbr>ManagementServer.<wbr>PeriodicInformEnabl<br>
e", null, {value: true});<br>
    declare("<wbr>InternetGatewayDevice.<wbr>ManagementServer.<wbr>ConnectionRequestUs<br>
ername", null, {value: "genieacs"});<br>
    declare("<wbr>InternetGatewayDevice.<wbr>ManagementServer.<wbr>ConnectionRequestPa<br>
ssword", null, {value: "genieacs"});<br>
    declare("<wbr>InternetGatewayDevice.<wbr>DeviceInfo.SerialNumber", {value:<br>
1});<br>
    declare("<wbr>InternetGatewayDevice.<wbr>DeviceInfo.ProductClass", {value:<br>
1});<br>
    declare("<wbr>InternetGatewayDevice.<wbr>DeviceInfo.ManufacturerOUI", {value:<br>
1});<br>
    declare("<wbr>InternetGatewayDevice.<wbr>DeviceInfo.Manufacturer", {value:<br>
1});<br>
    declare("<wbr>InternetGatewayDevice.<wbr>WANDevice.*.<wbr>WANConnectionDevice.1.WA<br>
NPPConnection.*.MACAddress", {value: 1});<br>
    declare("<wbr>InternetGatewayDevice.<wbr>WANDevice.*.<wbr>WANConnectionDevice.1.WA<br>
NPPConnection.*.<wbr>ExternalIPAddress", {value: Date.now()});<br>
    declare("<wbr>InternetGatewayDevice.<wbr>LANDevice.*.WLANConfiguration.<wbr>*.SSID<br>
", {value: Date.now()});<br>
    declare("<wbr>InternetGatewayDevice.<wbr>LANDevice.*.Hosts.Host.*.<wbr>HostName",<br>
{value: 1});<br>
    declare("<wbr>InternetGatewayDevice.<wbr>LANDevice.*.Hosts.Host.*.<wbr>IPAddress",<br>
{value: 1});<br>
    declare("<wbr>InternetGatewayDevice.<wbr>LANDevice.*.Hosts.Host.*.<wbr>MACAddress"<br>
, {value: 1});<br>
<br>
> Heres what I have, and I'm getting an error: Channel has faulted;<br>
> channel="default" retries=0 faultCode="script.<wbr>ReferenceError"<br>
> faultMessage="maxRevision is not defined"<br>
<br>
That's a bug that was recently fixed. Pull the latest changes.<br>
<br>
--<br>
Zaid Abdulla <<a href="mailto:zaid@genieacs.com" target="_blank">zaid@genieacs.com</a>><br>
______________________________<wbr>_________________<br>
Users mailing list<br>
<a href="mailto:Users@lists.genieacs.com" target="_blank">Users@lists.genieacs.com</a><br>
<a href="http://lists.genieacs.com/mailman/listinfo/users" target="_blank">http://lists.genieacs.com/<wbr>mailman/listinfo/users</a><br>
<br>
This communication, including any attachments, is confidential. If you are not the intended recipient, you should not read it - please contact me immediately, destroy it, and do not copy or use any part of this communication or disclose anything about it. Thank
 you. Please note that this communication does not designate an information system for the purposes of the Electronic Transactions Act 2002.<br>
<br>
______________________________<wbr>_________________<br>
Users mailing list<br>
<a href="mailto:Users@lists.genieacs.com" target="_blank">Users@lists.genieacs.com</a><br>
<a href="http://lists.genieacs.com/mailman/listinfo/users" target="_blank">http://lists.genieacs.com/<wbr>mailman/listinfo/users</a><br>
______________________________<wbr>_________________<br>
Users mailing list<br>
<a href="mailto:Users@lists.genieacs.com" target="_blank">Users@lists.genieacs.com</a><br>
<a href="http://lists.genieacs.com/mailman/listinfo/users" target="_blank">http://lists.genieacs.com/<wbr>mailman/listinfo/users</a><u></u><u></u></p>
</div>
</div>
</blockquote>
</div>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
</div></div></div>
</div>

<br>______________________________<wbr>_________________<br>
Users mailing list<br>
<a href="mailto:Users@lists.genieacs.com">Users@lists.genieacs.com</a><br>
<a href="http://lists.genieacs.com/mailman/listinfo/users" rel="noreferrer" target="_blank">http://lists.genieacs.com/<wbr>mailman/listinfo/users</a><br>
<br></blockquote></div><br></div>