I cleaned up the content on that page; added ```javascript markup where necessary; and clarified what the params to ext are. Thank you for your help!
On Tue, Mar 7, 2017 at 10:23 AM, Marc Priebee <[email protected]> wrote: > https://github.com/zaidka/genieacs/wiki/Extensions > > > > (This is the first page I had to update in a github wiki, so I’m assuming > it did everything I needed to) > > > > Marc > > > > *From:* Users [mailto:[email protected]] *On Behalf Of *Dan > Morphis > *Sent:* Wednesday, 8 March 2017 7:24 a.m. > > *To:* Community support for GenieACS users <[email protected]> > *Subject:* Re: Virtual parameters > > > > Can you share a link to that page? I don't see the page in the wiki. > > > > On Mon, Mar 6, 2017 at 4:51 PM, Marc Priebee <[email protected]> > wrote: > > I’ve created a basic wiki page describing what I’ve found so far. > > > > > > Marc > > > > *From:* Users [mailto:[email protected]] *On Behalf Of *Dan > Morphis > *Sent:* Tuesday, 7 March 2017 6:00 a.m. > > > *To:* Community support for GenieACS users <[email protected]> > *Subject:* Re: Virtual parameters > > > > Marc, > > 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! > > > > -dan > > > > On Sun, Mar 5, 2017 at 12:32 PM, Marc Priebee <[email protected]> > wrote: > > FYI, in case this helps some-one... > > I resolved this after reviewing what the extension-wrapper script does. > The extension scripts require a callback; > > exports.getSIP = function(d, callback) { > console.log("in getSIP with "+d); > var ldap = require('ldapjs'); > let SIPParms = { > "username": '5645195', > "password": 'bleah' > } > callback(null, SIPParms); > } > > (The 1st parameter in the callback is an error value) > > Marc > > > -----Original Message----- > From: Users [mailto:[email protected]] > Sent: Monday, 6 March 2017 7:59 a.m. > To: Community support for GenieACS users <[email protected]> > > Subject: RE: Virtual parameters > > > Hi, > > 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. > > The provision script looks this this.. > 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}, > {value: resp.username}); > declare("InternetGatewayDevice.ManagementServer.Password", {value: 1}, > {value: resp.password}); > > 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" > > The extension looks like this; > exports.start = function(d) { > console.log("in ext script start with "+d); let sipuser = "5645194"; > let sippw = "bleah"; return { > "username": sipuser, > "password": sippw > }; > } > > I get the log message, so it's being called, but the script really isn't > doing enough to be actually timing out. > (Ultimately, my intention is to use the extension to retrieve SIP > parameters from an LDAP directory, and provisioning them into the CPE) > > Regards > Marc > > > -----Original Message----- > From: Users [mailto:[email protected]] On Behalf Of Zaid > Abdulla > Sent: Sunday, 5 March 2017 12:41 a.m. > To: Community support for GenieACS users <[email protected]> > Subject: Re: Virtual parameters > > On Wed, 2017-03-01 at 06:56 -0900, Dan Morphis wrote: > > Can you post your script and some screenshots? > > Here's a sample script: > > declare("InternetGatewayDevice.ManagementServer.PeriodicInformInter > val", null, {value: 300}); > declare("InternetGatewayDevice.ManagementServer.PeriodicInformEnabl > e", null, {value: true}); > declare("InternetGatewayDevice.ManagementServer.ConnectionRequestUs > ername", null, {value: "genieacs"}); > declare("InternetGatewayDevice.ManagementServer.ConnectionRequestPa > ssword", null, {value: "genieacs"}); > declare("InternetGatewayDevice.DeviceInfo.SerialNumber", {value: > 1}); > declare("InternetGatewayDevice.DeviceInfo.ProductClass", {value: > 1}); > declare("InternetGatewayDevice.DeviceInfo.ManufacturerOUI", {value: > 1}); > declare("InternetGatewayDevice.DeviceInfo.Manufacturer", {value: > 1}); > declare("InternetGatewayDevice.WANDevice.*.WANConnectionDevice.1.WA > NPPConnection.*.MACAddress", {value: 1}); > declare("InternetGatewayDevice.WANDevice.*.WANConnectionDevice.1.WA > NPPConnection.*.ExternalIPAddress", {value: Date.now()}); > declare("InternetGatewayDevice.LANDevice.*.WLANConfiguration.*.SSID > ", {value: Date.now()}); > declare("InternetGatewayDevice.LANDevice.*.Hosts.Host.*.HostName", > {value: 1}); > declare("InternetGatewayDevice.LANDevice.*.Hosts.Host.*.IPAddress", > {value: 1}); > declare("InternetGatewayDevice.LANDevice.*.Hosts.Host.*.MACAddress" > , {value: 1}); > > > Heres what I have, and I'm getting an error: Channel has faulted; > > channel="default" retries=0 faultCode="script.ReferenceError" > > faultMessage="maxRevision is not defined" > > That's a bug that was recently fixed. Pull the latest changes. > > -- > Zaid Abdulla <[email protected]> > _______________________________________________ > Users mailing list > [email protected] > http://lists.genieacs.com/mailman/listinfo/users > > 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. > > _______________________________________________ > Users mailing list > [email protected] > http://lists.genieacs.com/mailman/listinfo/users > _______________________________________________ > Users mailing list > [email protected] > http://lists.genieacs.com/mailman/listinfo/users > > > > > _______________________________________________ > Users mailing list > [email protected] > http://lists.genieacs.com/mailman/listinfo/users > > > > _______________________________________________ > Users mailing list > [email protected] > http://lists.genieacs.com/mailman/listinfo/users > >
_______________________________________________ Users mailing list [email protected] http://lists.genieacs.com/mailman/listinfo/users
