<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:12.0pt;
        font-family:"Times New Roman",serif;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
p
        {mso-style-priority:99;
        mso-margin-top-alt:auto;
        margin-right:0cm;
        mso-margin-bottom-alt:auto;
        margin-left:0cm;
        font-size:12.0pt;
        font-family:"Times New Roman",serif;}
span.m7266849147686568341im
        {mso-style-name:m_7266849147686568341im;}
span.EmailStyle19
        {mso-style-type:personal-reply;
        font-family:"Calibri",sans-serif;
        color:#1F497D;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-family:"Calibri",sans-serif;
        mso-fareast-language:EN-US;}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="EN-NZ" link="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US"><a href="https://github.com/zaidka/genieacs/wiki/Extensions">https://github.com/zaidka/genieacs/wiki/Extensions</a><o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US">(This is the first page I had to update in a github wiki, so I’m assuming it did everything I needed to)<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US">Marc<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D;mso-fareast-language:EN-US"><o:p> </o:p></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:users-bounces@lists.genieacs.com]
<b>On Behalf Of </b>Dan Morphis<br>
<b>Sent:</b> Wednesday, 8 March 2017 7:24 a.m.<br>
<b>To:</b> Community support for GenieACS users <users@lists.genieacs.com><br>
<b>Subject:</b> Re: Virtual parameters<o:p></o:p></span></p>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<p class="MsoNormal">Can you share a link to that page? I don't see the page in the wiki.<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<p class="MsoNormal">On Mon, Mar 6, 2017 at 4:51 PM, Marc Priebee <<a href="mailto:Marc.Priebee@spark.co.nz" target="_blank">Marc.Priebee@spark.co.nz</a>> wrote:<o:p></o:p></p>
<blockquote style="border:none;border-left:solid #CCCCCC 1.0pt;padding:0cm 0cm 0cm 6.0pt;margin-left:4.8pt;margin-right:0cm">
<div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><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.</span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D"> </span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D"> </span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D">Marc</span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1F497D"> </span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><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.genieacs.com</a>]
<b>On Behalf Of </b>Dan Morphis<br>
<b>Sent:</b> Tuesday, 7 March 2017 6:00 a.m.</span><o:p></o:p></p>
<div>
<div>
<p class="MsoNormal"><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<o:p></o:p></p>
</div>
</div>
<div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"> <o:p></o:p></p>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">Marc,<o:p></o:p></p>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"> 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!<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"> <o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">-dan<o:p></o:p></p>
</div>
</div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"> <o:p></o:p></p>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">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:<o:p></o:p></p>
<blockquote style="border:none;border-left:solid #CCCCCC 1.0pt;padding:0cm 0cm 0cm 6.0pt;margin-left:4.8pt;margin-top:5.0pt;margin-right:0cm;margin-bottom:5.0pt">
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">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="m7266849147686568341im">Marc</span><br>
<br>
<br>
<span class="m7266849147686568341im">-----Original Message-----</span><br>
<span class="m7266849147686568341im">From: Users [mailto:<a href="mailto:users-bounces@lists.genieacs.com" target="_blank">users-bounces@lists.genieacs.com</a>]</span><br>
<span class="m7266849147686568341im">Sent: Monday, 6 March 2017 7:59 a.m.</span><br>
<span class="m7266849147686568341im">To: Community support for GenieACS users <<a href="mailto:users@lists.genieacs.com" target="_blank">users@lists.genieacs.com</a>></span><o:p></o:p></p>
<div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">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("InternetGatewayDevice.DeviceInfo.SerialNumber", {value: 1}); log("provision with "+serial.value[0]); let resp = ext("testext", "start", serial.value[0]); log("provision back from extension"); declare("InternetGatewayDevice.ManagementServer.Username",
 {value: 1},<br>
  {value: resp.username});<br>
declare("InternetGatewayDevice.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.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("InternetGatewayDevice.ManagementServer.PeriodicInformInter<br>
val", null, {value: 300});<br>
    declare("InternetGatewayDevice.ManagementServer.PeriodicInformEnabl<br>
e", null, {value: true});<br>
    declare("InternetGatewayDevice.ManagementServer.ConnectionRequestUs<br>
ername", null, {value: "genieacs"});<br>
    declare("InternetGatewayDevice.ManagementServer.ConnectionRequestPa<br>
ssword", null, {value: "genieacs"});<br>
    declare("InternetGatewayDevice.DeviceInfo.SerialNumber", {value:<br>
1});<br>
    declare("InternetGatewayDevice.DeviceInfo.ProductClass", {value:<br>
1});<br>
    declare("InternetGatewayDevice.DeviceInfo.ManufacturerOUI", {value:<br>
1});<br>
    declare("InternetGatewayDevice.DeviceInfo.Manufacturer", {value:<br>
1});<br>
    declare("InternetGatewayDevice.WANDevice.*.WANConnectionDevice.1.WA<br>
NPPConnection.*.MACAddress", {value: 1});<br>
    declare("InternetGatewayDevice.WANDevice.*.WANConnectionDevice.1.WA<br>
NPPConnection.*.ExternalIPAddress", {value: Date.now()});<br>
    declare("InternetGatewayDevice.LANDevice.*.WLANConfiguration.*.SSID<br>
", {value: Date.now()});<br>
    declare("InternetGatewayDevice.LANDevice.*.Hosts.Host.*.HostName",<br>
{value: 1});<br>
    declare("InternetGatewayDevice.LANDevice.*.Hosts.Host.*.IPAddress",<br>
{value: 1});<br>
    declare("InternetGatewayDevice.LANDevice.*.Hosts.Host.*.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.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>
_______________________________________________<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/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>
_______________________________________________<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/mailman/listinfo/users</a><br>
_______________________________________________<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/mailman/listinfo/users</a><o:p></o:p></p>
</div>
</div>
</blockquote>
</div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"> <o:p></o:p></p>
</div>
</div>
</div>
</div>
</div>
<p class="MsoNormal" style="margin-bottom:12.0pt"><br>
_______________________________________________<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" target="_blank">http://lists.genieacs.com/mailman/listinfo/users</a><o:p></o:p></p>
</blockquote>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
</div>
</body>
</html>