<div dir="ltr">I tried to pass in an object for ext args and wasn't able to get that to work. I also didn't spend a whole lot of time on it. Here is how I'm passing args, and it works fine.<div><br></div><div>//prov script</div><div><div>let serialNumber = declare("DeviceID.SerialNumber", {value: 1});</div><div>let productClass = declare("DeviceID.ProductClass", {value: 1});</div><div>let oui = declare("DeviceID.OUI", {value: 1});</div></div><div>let userConfig = ext('cpe-config', 'getPppoe', serialNumber.value[0], oui.value[0], productClass.value[0]);<br></div><div><br></div><div>//ext script</div><div><div style="color:rgb(212,212,212);background-color:rgb(30,30,30);font-family:"droid sans mono","courier new",monospace,"droid sans fallback";font-size:14px;line-height:19px"><div>  <span style="color:rgb(86,156,214)">const</span> <span style="color:rgb(156,220,254)">serial</span> = <span style="color:rgb(156,220,254)">args</span>[<span style="color:rgb(181,206,168)">0</span>];</div><div>  <span style="color:rgb(86,156,214)">const</span> <span style="color:rgb(156,220,254)">oui</span> = <span style="color:rgb(156,220,254)">args</span>[<span style="color:rgb(181,206,168)">1</span>];</div><div>  <span style="color:rgb(86,156,214)">const</span> <span style="color:rgb(156,220,254)">productClass</span> = <span style="color:rgb(156,220,254)">args</span>[<span style="color:rgb(181,206,168)">2</span>];</div></div></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Mar 13, 2017 at 6:38 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="#0563C1" vlink="#954F72">
<div class="m_-3691200565705097167WordSection1">
<p class="MsoNormal">Hi,<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">I’m having a problem with passing arguments into an extension script from a provision.<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">In the provision, I have…<u></u><u></u></p>
<p class="MsoNormal">let serial = declare("<wbr>InternetGatewayDevice.<wbr>DeviceInfo.SerialNumber", {value: 1});<u></u><u></u></p>
<p class="MsoNormal">let remoteID = serial.value[0];<u></u><u></u></p>
<p class="MsoNormal">let updAttributes = {<u></u><u></u></p>
<p class="MsoNormal">  remoteID: remoteID,<u></u><u></u></p>
<p class="MsoNormal">  DeviceRadio: null,<u></u><u></u></p>
<p class="MsoNormal">  VoiceProfile: null<u></u><u></u></p>
<p class="MsoNormal">};<u></u><u></u></p>
<p class="MsoNormal">….<u></u><u></u></p>
<p class="MsoNormal">updAttributes.deviceRadio = radioRSRP.value[0]+"#"+<wbr>radioRSRQ.value[0]+"#"+<wbr>radioRSSI.value[0];<u></u><u></u></p>
<p class="MsoNormal">let resp = ext("EID", "set", updAttributes)<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">And in the extension (EID, set function)<u></u><u></u></p>
<p class="MsoNormal">function set(updAttributes, callback) {<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">        console.log("** DEBUG ** in EID set for updAttributes="+JSON.<wbr>stringify(updAttributes));<u></u><u></u></p>
<p class="MsoNormal">        callback(null, updateAttributes.remoteID);<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">}<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">What gets logged is <u></u><u></u></p>
<p class="MsoNormal">** DEBUG ** in EID set for updAttributes=["[object Object]"]<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">I’ve tried change the JSON.stringify in the script to String(updAttributes) and also combining the JSON.stringify and String, but I cannot seem to get access to the updAttributes object.<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">I also noted that if I passed 2 arguments such as let resp = ext("EID", "set", remoteID, updAttributes), they appear in the script as a single argument..something like this;<u></u><u></u></p>
<p class="MsoNormal">BoLTE2799000000,[object Object]<u></u><u></u></p>
<p class="MsoNormal">In the first parameter of the function<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal">Marc<u></u><u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
<p class="MsoNormal"><u></u> <u></u></p>
</div>
<br>
<p style="font-size:8pt;line-height:10pt;font-family:'Arial',serif;color:#696969">
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.</p>
<br>
</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>