Add new voip profile

hi everyone,
i want to add new voip profile with new number and …
as ont page said here:https://forum.huawei.com/enterprise/en/configure-voip-service-on-the-ont/thread/667246548536410112-667213871523442688
i must first define a wlan, and doing WAN port configuration as below:

  • Enable WAN – enable WAN for VoIP service
  • WAN mode: Route WAN – choice of the WAN mode
  • Service type: VOIP – choice of VoIP service
  • VLAN ID: 802 – VoIP VLAN
  • IP address: X.X.1.33 – input the IP address
  • Subnet mask: X.X.0.0 – input the subnet mask
  • Default Gateway: X.X.0.1 – input the default gateway

second, i must do route configuration: add previous section WAN as default route
third voice basic profile configuration
and last step, voip user configuration
i want to do all steps by genieacs, and provision script or every thing else in genieacs
please help me how to do every step, and use crated variable in that step in next steps.
thanks in advance

help please

This is what i use for ONT Huawei

//Create WAN VoIP
declare(“InternetGatewayDevice.WANDevice.1.WANConnectionDevice.”, null, { path: 3 });
declare(“InternetGatewayDevice.WANDevice.1.WANConnectionDevice.3.WANIPConnection.”, null, { path: 1 });
declare(“InternetGatewayDevice.WANDevice.1.WANConnectionDevice.3.WANIPConnection.", { path: now });
declare("InternetGatewayDevice.WANDevice.1.WANConnectionDevice.3.WANIPConnection.
.Name”, { value: now }, { value: “Voip” });
declare(“InternetGatewayDevice.WANDevice.1.WANConnectionDevice.3.WANIPConnection..ConnectionType", { value: now }, { value: “IP_Routed” });
declare("InternetGatewayDevice.WANDevice.1.WANConnectionDevice.3.WANIPConnection.
.NATEnabled”, { value: now }, { value: false });
declare(“InternetGatewayDevice.WANDevice.1.WANConnectionDevice.3.WANIPConnection.*.Enable”, { value: now }, { value: true });

//Configure SIP services
declare(“InternetGatewayDevice.Services”, { value: now });
declare(“InternetGatewayDevice.Services.VoiceService”, { value: now });
declare(“InternetGatewayDevice.Services.VoiceService.1.VoiceProfile”, { value: now });
declare(“InternetGatewayDevice.Services.VoiceService.1.VoiceProfile.1.SIP.OutboundProxy”, { value: now }, { value: “Softswitch IP” });
declare(“InternetGatewayDevice.Services.VoiceService.1.VoiceProfile.1.SIP.ProxyServer”, { value: now }, { value: “Softswitch IP” });
declare(“InternetGatewayDevice.Services.VoiceService.1.VoiceProfile.1.Line.1.SIP.AuthPassword”, { value: now }, { value: TelNumber });
declare(“InternetGatewayDevice.Services.VoiceService.1.VoiceProfile.1.Line.1.SIP.AuthUserName”, { value: now }, { value: TelNumber });
declare(“InternetGatewayDevice.Services.VoiceService.1.VoiceProfile.1.Line.1.SIP.URI”, { value: now }, { value: TelNumber });
declare(“InternetGatewayDevice.Services.VoiceService.1.VoiceProfile.1.Line.1.Enable”, { value: now }, { value: “Enabled” });

Im using DHCP for device IP

//Configure WAN parameters - VLAN, type (DHCP)
declare(“InternetGatewayDevice.WANDevice.1.WANConnectionDevice.3.WANIPConnection.1.AddressingType”, { value: now }, { value: “DHCP” });
declare(“InternetGatewayDevice.WANDevice.1.WANConnectionDevice.3.WANIPConnection.1.X_HW_SERVICELIST”, { value: now }, { value: “VOIP” });
declare(“InternetGatewayDevice.WANDevice.1.WANConnectionDevice.3.WANIPConnection.1.X_HW_VLAN”, { value: now }, { value: SERVICE-VLAN });
declare(“InternetGatewayDevice.WANDevice.1.WANConnectionDevice.3.WANIPConnection”, { value: now });

thank you @Figaro , i will check and report you the result

thank you @Figaro
many question:
what is the mean of “null” in timestamps parameter?
what is the mean of “{path:3}” for values parameter? as i know it shows that we have 3 types of WANConnectionDevice, but why 3 types?
why we check for existing one WANIPConnectionin in 2th declare call? or we create a WANIPConnection here?
what is the meaning of “{path:now}” in 3th declare call?

is square star?

Declare params are outlined in the documentation.

1 Like

no, [ ]

1 Like

hi @akcoder
thnk you for your reply, this document if is not ambigious its absoulutly short, stilled, and abstract. without example.
for example as mentioned in documents about “path attribute”:
"This attribute is special in that it’s not a parameter attribute per se, but it refers to the presence of parameters matching the given path. For example, given the following wildcard path:

InternetGatewayDevice.LANDevice.1.Hosts.Host.*.MACAddress"

as I understand from above, “path attribute” is number of parameter names in CPE that conform this path: “InternetGatewayDevice.LANDevice.1.Hosts.Host.*.MACAddress”
for example result of path maybe 0, 1, 2 , 3 , … or any acceptable integer.
now, i cant understand whats the mean of “{path:now}”
“now” in millisecond from 1970
“path” is a short integer

This function is for declaring parameter values to be set, as well as specify constraints on how recent you’d like the parameter value (or other attributes) to have been refreshed from the device. If the given timestamp is lower than the timestamp of the last refresh from the device, then this function will return the last known value. Otherwise, the value will be fetched from the device before being returned to the caller.

I.e., if the path value of the timestamps argument is Date.now() then you are telling GenieACS that you want it to refresh the path. Same goes with the timestamp value of the timestamps argument.

Example, declare('Some.Path", {timestamp: 1}); Tells GenieACS to return the value for that param if present. If the value isn’t present, then GenieACS will refresh it. Why would you not want to always have the “latest” value? Some values do not change. Things like Model, ProductClass, SerialNumber, etc are static values and will never change (provided your CPE vendor isn’t doing really stupid stuff). So there is no reason to have GenieACS pull the latest value from the CPE.

hi @Figaro ,
thanks for reply, please send your code as a file or every method to preserve code format.
i copied your code and its as below image:

as menstion in document we cant have {timestamp: 1} as second arguman for declare, we can use one attribute(value,writable,object, and path) of second arguman of declare
then as document said we can have “{value:1}” or “{writable:1}” or “{object:1}” or “{path:1}”
its ok?

@akcoder really im confused :grin: :grin: :grin:

@akcoder
or in this example:
declare(“InternetGatewayDevice.WANDevice.1.WANConnectionDevice.1.WANIPConnection.*.Enable”, {path: now, value: now}, {value: false});
i know when this condition “{path: now, value: now}” is true, then declare function set wanipconnection.enable to false or disable it.
but i dont know whats the mean of “{path: now, value: now}”?
i can interpret “{value: now}” as its mean “refresh the value of first arguman from CPE”
but i dont know mean of “{path: now}”
ofcourse now is Date.now()

You absolutely can. I have probably 20-30 declare statements with a timestamp value of 1.

The docs even show you that you can:

// Example: Setting the SSID as the last 6 characters of the serial number
let serial = declare("Device.DeviceInfo.SerialNumber", {value: 1});
declare("Device.LANDevice.1.WLANConfiguration.1.SSID", null, {value: serial.value[0]});

Think about it like this:

declare("Some.Path") will return what ever parameter value exists for that path. If that path doesn’t exist, then GenieACS will refresh the path.

const now = Date.now();
const fiveMinutesAgo = now - (60 * 5 * 1000);

declare("Some.Path", {value: fiveMinutesAgo});

Will return the value at Some.Path. If Some.Path was refreshed within the previous 5 minutes, then the cached value will be returned.

declare("Some.Path.*.*", {path: Date.now()}) will cause GenieACS to refresh the pathsunder Some.Path.*.*

declare("Some.Path", null, {value: 'SomeValue'}) will cause GenieACS to update the param Some.Path

The documentation about object and writable are advanced use cases.

1 Like

it is answer for “path role” in second arguman
then when we use path in second arguman of declare, its mean we want to refresh all pathes included wildcard and alias in first arguman
thank you @akcoder

but here is not “{timestamp: 1}”
its “{value:1}”

You are right. It should be {value: 1}

1 Like