Generate portable handset names based on reg id

This commit is contained in:
vdutta 2021-10-08 19:40:39 +05:30 committed by Amin Ben Ramdhane
parent 361db56939
commit cd33c79351

View file

@ -16,9 +16,15 @@
static int get_ServicesVoiceServiceDECTPortable_Name(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
{
char *ipui = dmjson_get_value((json_object *)data, 1, "ipui");
char *id = dmjson_get_value((json_object *)data, 1, "id");
dmuci_get_option_value_string("dect", ipui, "name", value);
if ((*value)[0] == '\0')
dmasprintf(value, "DECT%s", instance);
if ((*value)[0] == '\0') {
if (strlen(id))
dmasprintf(value, "DECT%s", id);
else
dmasprintf(value, "DECT%s", instance);
}
return 0;
}