libbbf changes for asterisk UCI config restructuring

This commit is contained in:
Hemlata 2021-11-16 17:07:02 +00:00 committed by Amin Ben Ramdhane
parent 428f8d50c8
commit cf1780fc70
12 changed files with 2098 additions and 316 deletions

View file

@ -122,6 +122,7 @@ endif #BBF_TR181
if BBF_TR104
libbbfdm_la_SOURCES += \
../dmtree/vendor/iopsys/tr104/servicesvoiceservicecallcontrol.c \
../dmtree/vendor/iopsys/tr104/servicesvoiceservicecalllog.c \
../dmtree/vendor/iopsys/tr104/servicesvoiceservicedect.c
endif #BBF_TR104

View file

@ -1046,7 +1046,7 @@
"name": "sip_options"
},
"option": {
"name": "rtpstart"
"name": "rtp_start"
}
}
}
@ -1074,7 +1074,7 @@
"name": "sip_options"
},
"option": {
"name": "rtpend"
"name": "rtp_end"
}
}
}
@ -2080,7 +2080,7 @@
"uci": {
"file": "asterisk",
"section": {
"type": "tel_line"
"type": "extension"
},
"dmmapfile": "dmmap_asterisk"
}
@ -2150,7 +2150,7 @@
"uci": {
"file": "asterisk",
"section": {
"type": "tel_line",
"type": "extension",
"index": "@i-1"
},
"option": {
@ -2239,7 +2239,7 @@
"uci": {
"file": "asterisk",
"section": {
"type": "tel_line",
"type": "extension",
"index": "@i-1"
},
"option": {
@ -3558,7 +3558,7 @@
"index": "@i-1"
},
"option": {
"name": "enabled"
"name": "enable"
}
}
}
@ -4136,7 +4136,7 @@
"index": "@i-1"
},
"option": {
"name": "enabled"
"name": "enable"
}
}
}
@ -7744,7 +7744,7 @@
"uci": {
"file": "asterisk",
"section": {
"type": "tel_line"
"type": "line"
},
"dmmapfile": "dmmap_asterisk"
}
@ -7765,11 +7765,11 @@
"uci": {
"file": "asterisk",
"section": {
"type": "tel_line",
"type": "line",
"index": "@i-1"
},
"option": {
"name": "enabled"
"name": "enable"
}
}
}
@ -7891,11 +7891,11 @@
"uci": {
"file": "asterisk",
"section": {
"type": "tel_line",
"type": "line",
"index": "@i-1"
},
"option": {
"name": "sip_account"
"name": "provider"
}
}
}
@ -7915,7 +7915,22 @@
{
"max": 256
}
]
],
"mapping": [
{
"type": "uci",
"uci": {
"file": "asterisk",
"section": {
"type": "line",
"index": "@i-1"
},
"option": {
"name": "calling_features"
}
}
}
]
},
"Device.Services.VoiceService.{i}.CallControl.Line.{i}.Stats.": {
"type": "object",
@ -8179,7 +8194,22 @@
"cwmp",
"usp"
],
"datatype": "boolean"
"datatype": "boolean",
"mapping": [
{
"type": "uci",
"uci": {
"file": "asterisk",
"section": {
"type": "extension",
"index": "@i-1"
},
"option": {
"name": "enable"
}
}
}
]
},
"QuiescentMode": {
"type": "boolean",
@ -8339,7 +8369,22 @@
{
"max": 256
}
]
],
"mapping": [
{
"type": "uci",
"uci": {
"file": "asterisk",
"section": {
"type": "extension",
"index": "@i-1"
},
"option": {
"name": "calling_features"
}
}
}
]
},
"CallWaitingStatus": {
"type": "string",
@ -8684,7 +8729,22 @@
],
"list": {
"datatype": "string"
}
},
"mapping": [
{
"type": "uci",
"uci": {
"file": "asterisk",
"section": {
"type": "group",
"index": "@i-1"
},
"option": {
"name": "extensions"
}
}
}
]
},
"RingType": {
"type": "string",
@ -8911,7 +8971,22 @@
"cwmp",
"usp"
],
"datatype": "boolean"
"datatype": "boolean",
"mapping": [
{
"type": "uci",
"uci": {
"file": "asterisk",
"section": {
"type": "incoming_map",
"index": "@i-1"
},
"option": {
"name": "enable"
}
}
}
]
},
"Alias": {
"type": "string",
@ -8950,11 +9025,11 @@
"uci": {
"file": "asterisk",
"section": {
"type": "sip_service_provider",
"type": "incoming_map",
"index": "@i-1"
},
"option": {
"name": "call_lines"
"name": "line"
}
}
}
@ -8974,7 +9049,22 @@
{
"max": 256
}
]
],
"mapping": [
{
"type": "uci",
"uci": {
"file": "asterisk",
"section": {
"type": "incoming_map",
"index": "@i-1"
},
"option": {
"name": "extension"
}
}
}
]
},
"Order": {
"type": "unsignedInt",
@ -9024,7 +9114,7 @@
"uci": {
"file": "asterisk",
"section": {
"type": "sip_service_provider"
"type": "outgoing_map"
},
"dmmapfile": "dmmap_asterisk"
}
@ -9038,7 +9128,22 @@
"cwmp",
"usp"
],
"datatype": "boolean"
"datatype": "boolean",
"mapping": [
{
"type": "uci",
"uci": {
"file": "asterisk",
"section": {
"type": "outgoing_map",
"index": "@i-1"
},
"option": {
"name": "enable"
}
}
}
]
},
"Alias": {
"type": "string",
@ -9101,7 +9206,22 @@
{
"max": 256
}
]
],
"mapping": [
{
"type": "uci",
"uci": {
"file": "asterisk",
"section": {
"type": "outgoing_map",
"index": "@i-1"
},
"option": {
"name": "extension"
}
}
}
]
},
"Line": {
"type": "string",
@ -9117,7 +9237,22 @@
{
"max": 256
}
]
],
"mapping": [
{
"type": "uci",
"uci": {
"file": "asterisk",
"section": {
"type": "outgoing_map",
"index": "@i-1"
},
"option": {
"name": "line"
}
}
}
]
},
"Order": {
"type": "unsignedInt",
@ -9568,7 +9703,7 @@
"uci": {
"file": "asterisk",
"section": {
"type": "advanced_features"
"type": "calling_features"
},
"dmmapfile": "dmmap_asterisk"
}
@ -9598,7 +9733,23 @@
"cwmp",
"usp"
],
"datatype": "boolean"
"datatype": "boolean",
"mapping": [
{
"type": "uci",
"uci": {
"file": "asterisk",
"section": {
"type": "set",
"index": "@i-1"
},
"option": {
"name": "caller_id_enable"
}
}
}
]
},
"CallerIDNameEnable": {
"type": "boolean",
@ -9609,7 +9760,22 @@
"cwmp",
"usp"
],
"datatype": "boolean"
"datatype": "boolean",
"mapping": [
{
"type": "uci",
"uci": {
"file": "asterisk",
"section": {
"type": "set",
"index": "@i-1"
},
"option": {
"name": "caller_name_enable"
}
}
}
]
},
"CallWaitingEnable": {
"type": "boolean",
@ -9620,7 +9786,22 @@
"cwmp",
"usp"
],
"datatype": "boolean"
"datatype": "boolean",
"mapping": [
{
"type": "uci",
"uci": {
"file": "asterisk",
"section": {
"type": "set",
"index": "@i-1"
},
"option": {
"name": "call_waiting_enable"
}
}
}
]
},
"CallForwardUnconditionalEnable": {
"type": "boolean",
@ -9631,7 +9812,23 @@
"cwmp",
"usp"
],
"datatype": "boolean"
"datatype": "boolean",
"mapping": [
{
"type": "uci",
"uci": {
"file": "asterisk",
"section": {
"type": "set",
"index": "@i-1"
},
"option": {
"name": "call_forward_unconditional"
}
}
}
]
},
"CallForwardUnconditionalNumber": {
"type": "string",
@ -9658,7 +9855,22 @@
"cwmp",
"usp"
],
"datatype": "boolean"
"datatype": "boolean",
"mapping": [
{
"type": "uci",
"uci": {
"file": "asterisk",
"section": {
"type": "set",
"index": "@i-1"
},
"option": {
"name": "call_forward_on_busy"
}
}
}
]
},
"CallForwardOnBusyNumber": {
"type": "string",
@ -9697,7 +9909,22 @@
"cwmp",
"usp"
],
"datatype": "boolean"
"datatype": "boolean",
"mapping": [
{
"type": "uci",
"uci": {
"file": "asterisk",
"section": {
"type": "set",
"index": "@i-1"
},
"option": {
"name": "call_forward_on_no_answer"
}
}
}
]
},
"CallForwardOnNoAnswerNumber": {
"type": "string",
@ -9747,7 +9974,22 @@
"cwmp",
"usp"
],
"datatype": "boolean"
"datatype": "boolean",
"mapping": [
{
"type": "uci",
"uci": {
"file": "asterisk",
"section": {
"type": "set",
"index": "@i-1"
},
"option": {
"name": "mwi_enable"
}
}
}
]
},
"VMWIEnable": {
"type": "boolean",
@ -9791,7 +10033,22 @@
"cwmp",
"usp"
],
"datatype": "boolean"
"datatype": "boolean",
"mapping": [
{
"type": "uci",
"uci": {
"file": "asterisk",
"section": {
"type": "set",
"index": "@i-1"
},
"option": {
"name": "anonymous_call_enable"
}
}
}
]
},
"DoNotDisturbEnable": {
"type": "boolean",
@ -9802,7 +10059,22 @@
"cwmp",
"usp"
],
"datatype": "boolean"
"datatype": "boolean",
"mapping": [
{
"type": "uci",
"uci": {
"file": "asterisk",
"section": {
"type": "set",
"index": "@i-1"
},
"option": {
"name": "dnd_enable"
}
}
}
]
},
"RepeatDialEnable": {
"type": "boolean",
@ -9824,7 +10096,22 @@
"cwmp",
"usp"
],
"datatype": "boolean"
"datatype": "boolean",
"mapping": [
{
"type": "uci",
"uci": {
"file": "asterisk",
"section": {
"type": "set",
"index": "@i-1"
},
"option": {
"name": "voice_mail_enable"
}
}
}
]
},
"CallPickUpEnable": {
"type": "boolean",
@ -9846,7 +10133,22 @@
"cwmp",
"usp"
],
"datatype": "boolean"
"datatype": "boolean",
"mapping": [
{
"type": "uci",
"uci": {
"file": "asterisk",
"section": {
"type": "set",
"index": "@i-1"
},
"option": {
"name": "ccbs_enable"
}
}
}
]
},
"IIFCEnable": {
"type": "boolean",
@ -12557,7 +12859,7 @@
"name": "sip_options"
},
"option": {
"name": "dtmfmode"
"name": "dtmf_mode"
}
}
}
@ -12654,7 +12956,7 @@
"name": "sip_options"
},
"option": {
"name": "rtpstart"
"name": "rtp_start"
}
}
}
@ -12686,7 +12988,7 @@
"name": "sip_options"
},
"option": {
"name": "rtpend"
"name": "rtp_end"
}
}
}
@ -12829,7 +13131,7 @@
"name": "tel_options"
},
"option": {
"name": "jbimpl"
"name": "jb_impl"
}
}
}
@ -12856,7 +13158,7 @@
"name": "tel_options"
},
"option": {
"name": "jbmaxsize"
"name": "jb_maxsize"
}
}
}

File diff suppressed because it is too large Load diff

View file

@ -17,6 +17,8 @@ extern DMOBJ tServicesVoiceServiceCallControlObj[];
extern DMLEAF tServicesVoiceServiceCallControlLineParams[];
extern DMLEAF tServicesVoiceServiceCallControlIncomingMapParams[];
extern DMLEAF tServicesVoiceServiceCallControlOutgoingMapParams[];
extern DMLEAF tServicesVoiceServiceCallControlGroupParams[];
extern DMLEAF tServicesVoiceServiceCallControlExtensionParams[];
extern DMLEAF tServicesVoiceServiceCallControlNumberingPlanParams[];
extern DMOBJ tServicesVoiceServiceCallControlCallingFeaturesObj[];
extern DMOBJ tServicesVoiceServiceCallControlCallingFeaturesSetObj[];

View file

@ -14,27 +14,26 @@
/*************************************************************
* ENTRY METHOD
**************************************************************/
/*#Device.Services.VoiceService.{i}.POTS.FXS.{i}.!UCI:asterisk/tel_line/dmmap_asterisk*/
/*#Device.Services.VoiceService.{i}.POTS.FXS.{i}.!UCI:asterisk/extension/dmmap_asterisk*/
static int browseServicesVoiceServicePOTSFXSInst(struct dmctx *dmctx, DMNODE *parent_node, void *prev_data, char *prev_instance)
{
char *inst = NULL;
struct dmmap_dup *p = NULL;
LIST_HEAD(dup_list);
synchronize_specific_config_sections_with_dmmap("asterisk", "tel_line", "dmmap_asterisk", &dup_list);
synchronize_specific_config_sections_with_dmmap("asterisk", "extension", "dmmap_asterisk", &dup_list);
list_for_each_entry(p, &dup_list, list) {
char *line_name = NULL;
dmuci_get_value_by_section_string(p->config_section, "name", &line_name);
if (line_name && (*line_name == '\0' || strcasestr(line_name, "DECT") == NULL)) {
char *line_type = NULL;
dmuci_get_value_by_section_string(p->config_section, "type", &line_type);
if (line_type && (strcasecmp(line_type, "fxs") == 0)) {
inst = handle_instance(dmctx, parent_node, p->dmmap_section, "fxsinstance", "fxsalias");
if (DM_LINK_INST_OBJ(dmctx, parent_node, (void *)p, inst) == DM_STOP)
break;
}
if (line_name && *line_name)
dmfree(line_name);
if (line_type && *line_type)
dmfree(line_type);
}
free_dmmap_config_dup_list(&dup_list);
return 0;
@ -121,7 +120,7 @@ static int get_ServicesVoiceServicePOTSFXS_TerminalType(char *refparam, struct d
return 0;
}
/*#Device.Services.VoiceService.{i}.POTS.FXS.{i}.VoiceProcessing.TransmitGain!UCI:asterisk/tel_line,@i-1/txgain*/
/*#Device.Services.VoiceService.{i}.POTS.FXS.{i}.VoiceProcessing.TransmitGain!UCI:asterisk/extension,@i-1/txgain*/
static int get_ServicesVoiceServicePOTSFXSVoiceProcessing_TransmitGain(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
{
*value = dmuci_get_value_by_section_fallback_def(((struct dmmap_dup *)data)->config_section, "txgain", "0");
@ -142,7 +141,7 @@ static int set_ServicesVoiceServicePOTSFXSVoiceProcessing_TransmitGain(char *ref
return 0;
}
/*#Device.Services.VoiceService.{i}.POTS.FXS.{i}.VoiceProcessing.ReceiveGain!UCI:asterisk/tel_line,@i-1/rxgain*/
/*#Device.Services.VoiceService.{i}.POTS.FXS.{i}.VoiceProcessing.ReceiveGain!UCI:asterisk/extension,@i-1/rxgain*/
static int get_ServicesVoiceServicePOTSFXSVoiceProcessing_ReceiveGain(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
{
*value = dmuci_get_value_by_section_fallback_def(((struct dmmap_dup *)data)->config_section, "rxgain", "0");
@ -163,7 +162,7 @@ static int set_ServicesVoiceServicePOTSFXSVoiceProcessing_ReceiveGain(char *refp
return 0;
}
/*#Device.Services.VoiceService.{i}.POTS.FXS.{i}.VoiceProcessing.EchoCancellationEnable!UCI:asterisk/tel_line,@i-1/echo_cancel*/
/*#Device.Services.VoiceService.{i}.POTS.FXS.{i}.VoiceProcessing.EchoCancellationEnable!UCI:asterisk/extension,@i-1/echo_cancel*/
static int get_ServicesVoiceServicePOTSFXSVoiceProcessing_EchoCancellationEnable(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
{
*value = dmuci_get_value_by_section_fallback_def(((struct dmmap_dup *)data)->config_section, "echo_cancel", "1");

View file

@ -18,8 +18,8 @@ static int get_reserved_port_range(char **value)
{
char *start = NULL, *end = NULL;
dmuci_get_option_value_string("asterisk", "sip_options", "rtpstart", &start);
dmuci_get_option_value_string("asterisk", "sip_options", "rtpend", &end);
dmuci_get_option_value_string("asterisk", "sip_options", "rtp_start", &start);
dmuci_get_option_value_string("asterisk", "sip_options", "rtp_end", &end);
if (start && *start && end && *end) {
dmasprintf(value, "%s-%s", start, end);
dmfree(start);
@ -29,13 +29,13 @@ static int get_reserved_port_range(char **value)
return 0;
}
/*#Device.Services.VoiceService.{i}.ReservedPorts.WANPortRange!UCI:asterisk/sip_advanced,sip_options/rtpstart*/
/*#Device.Services.VoiceService.{i}.ReservedPorts.WANPortRange!UCI:asterisk/sip_advanced,sip_options/rtp_start*/
static int get_ServicesVoiceServiceReservedPorts_WANPortRange(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
{
return get_reserved_port_range(value);
}
/*#Device.Services.VoiceService.{i}.ReservedPorts.LANPortRange!UCI:asterisk/sip_advanced,sip_options/rtpend*/
/*#Device.Services.VoiceService.{i}.ReservedPorts.LANPortRange!UCI:asterisk/sip_advanced,sip_options/rtp_end*/
static int get_ServicesVoiceServiceReservedPorts_LANPortRange(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
{
return get_reserved_port_range(value);

View file

@ -79,24 +79,10 @@ static int addObjServicesVoiceServiceSIPClient(char *refparam, struct dmctx *ctx
dmuci_set_value(TR104_UCI_PACKAGE, new_sec_name, "", "sip_service_provider");
dmuci_set_value(TR104_UCI_PACKAGE, new_sec_name, "name", value);
dmuci_set_value(TR104_UCI_PACKAGE, new_sec_name, "enabled", "0");
dmuci_set_value(TR104_UCI_PACKAGE, new_sec_name, "enable", "0");
dmuci_set_value(TR104_UCI_PACKAGE, new_sec_name, "codec0", "alaw");
dmuci_set_value(TR104_UCI_PACKAGE, new_sec_name, "ptime_alaw", "20");
dmuci_set_value(TR104_UCI_PACKAGE, new_sec_name, "cbbs_key", "5");
dmuci_set_value(TR104_UCI_PACKAGE, new_sec_name, "cbbs_maxretry", "5");
dmuci_set_value(TR104_UCI_PACKAGE, new_sec_name, "cbbs_retrytime", "300");
dmuci_set_value(TR104_UCI_PACKAGE, new_sec_name, "cbbs_waittime", "30");
dmuci_set_value(TR104_UCI_PACKAGE, new_sec_name, "autoframing", "1");
dmuci_set_value(TR104_UCI_PACKAGE, new_sec_name, "cfim_on", "*21*");
dmuci_set_value(TR104_UCI_PACKAGE, new_sec_name, "cfim_off", "#21#");
dmuci_set_value(TR104_UCI_PACKAGE, new_sec_name, "cfbs_on", "*61*");
dmuci_set_value(TR104_UCI_PACKAGE, new_sec_name, "cfbs_off", "#61#");
dmuci_set_value(TR104_UCI_PACKAGE, new_sec_name, "cw_on", "*43*");
dmuci_set_value(TR104_UCI_PACKAGE, new_sec_name, "cw_off", "#43#");
dmuci_set_value(TR104_UCI_PACKAGE, new_sec_name, "cw_status", "*#43#");
dmuci_set_value(TR104_UCI_PACKAGE, new_sec_name, "call_return", "*69");
dmuci_set_value(TR104_UCI_PACKAGE, new_sec_name, "redial", "*66");
dmuci_set_value(TR104_UCI_PACKAGE, new_sec_name, "is_fax", "0");
dmuci_set_value(TR104_UCI_PACKAGE, new_sec_name, "support_fax", "0");
dmuci_set_value(TR104_UCI_PACKAGE, new_sec_name, "transport", "udp");
dmuci_add_section_bbfdm("dmmap_asterisk", "sip_service_provider", &dmmap);
@ -165,10 +151,10 @@ static int delObjServicesVoiceServiceSIPNetworkFQDNServer(char *refparam, struct
/*************************************************************
* GET & SET PARAM
**************************************************************/
/*#Device.Services.VoiceService.{i}.SIP.Client.{i}.Enable!UCI:asterisk/sip_service_provider,@i-1/enabled*/
/*#Device.Services.VoiceService.{i}.SIP.Client.{i}.Enable!UCI:asterisk/sip_service_provider,@i-1/enable*/
static int get_ServicesVoiceServiceSIPClient_Enable(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
{
*value = dmuci_get_value_by_section_fallback_def(((struct dmmap_dup *)data)->config_section, "enabled", "1");
*value = dmuci_get_value_by_section_fallback_def(((struct dmmap_dup *)data)->config_section, "enable", "1");
return 0;
}
@ -183,7 +169,7 @@ static int set_ServicesVoiceServiceSIPClient_Enable(char *refparam, struct dmctx
break;
case VALUESET:
string_to_bool(value, &b);
dmuci_set_value_by_section(((struct dmmap_dup *)data)->config_section, "enabled", b ? "1" : "0");
dmuci_set_value_by_section(((struct dmmap_dup *)data)->config_section, "enable", b ? "1" : "0");
break;
}
return 0;
@ -194,7 +180,7 @@ static int get_ServicesVoiceServiceSIPClient_Status(char *refparam, struct dmctx
struct uci_section *section = ((struct dmmap_dup *)data)->config_section;
char *enabled = NULL;
dmuci_get_value_by_section_string(section, "enabled", &enabled);
dmuci_get_value_by_section_string(section, "enable", &enabled);
if (enabled && *enabled == '0') {
*value = "Disabled";
@ -427,10 +413,10 @@ static int get_ServicesVoiceServiceSIPClientContact_UserAgent(char *refparam, st
return 0;
}
/*#Device.Services.VoiceService.{i}.SIP.Network.{i}.Enable!UCI:asterisk/sip_service_provider,@i-1/enabled*/
/*#Device.Services.VoiceService.{i}.SIP.Network.{i}.Enable!UCI:asterisk/sip_service_provider,@i-1/enable*/
static int get_ServicesVoiceServiceSIPNetwork_Enable(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
{
*value = dmuci_get_value_by_section_fallback_def(((struct dmmap_dup *)data)->config_section, "enabled", "1");
*value = dmuci_get_value_by_section_fallback_def(((struct dmmap_dup *)data)->config_section, "enable", "1");
return 0;
}
@ -445,7 +431,7 @@ static int set_ServicesVoiceServiceSIPNetwork_Enable(char *refparam, struct dmct
break;
case VALUESET:
string_to_bool(value, &b);
dmuci_set_value_by_section(((struct dmmap_dup *)data)->config_section, "enabled", b ? "1" : "0");
dmuci_set_value_by_section(((struct dmmap_dup *)data)->config_section, "enable", b ? "1" : "0");
break;
}
return 0;

View file

@ -14,12 +14,12 @@
/*************************************************************
* GET & SET PARAM
**************************************************************/
/*#Device.Services.VoiceService.{i}.VoIPProfile.{i}.DTMFMethod!UCI:asterisk/sip_advanced,sip_options/dtmfmode*/
/*#Device.Services.VoiceService.{i}.VoIPProfile.{i}.DTMFMethod!UCI:asterisk/sip_advanced,sip_options/dtmf_mode*/
static int get_ServicesVoiceServiceVoIPProfile_DTMFMethod(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
{
char *method = NULL;
dmuci_get_option_value_string(TR104_UCI_PACKAGE, "sip_options", "dtmfmode", &method);
dmuci_get_option_value_string(TR104_UCI_PACKAGE, "sip_options", "dtmf_mode", &method);
if (method && *method) {
if (strcasecmp(method, "inband") == 0)
*value = "InBand";
@ -48,17 +48,17 @@ static int set_ServicesVoiceServiceVoIPProfile_DTMFMethod(char *refparam, struct
new_value = "rfc4733";
else if (strcasecmp(value, "SIPInfo") == 0)
new_value = "info";
dmuci_set_value(TR104_UCI_PACKAGE, "sip_options", "dtmfmode", new_value);
dmuci_set_value(TR104_UCI_PACKAGE, "sip_options", "dtmf_mode", new_value);
break;
}
return 0;
}
/*#Device.Services.VoiceService.{i}.VoIPProfile.{i}.RTP.LocalPortMin!UCI:asterisk/sip_advanced,sip_options/rtpstart*/
/*#Device.Services.VoiceService.{i}.VoIPProfile.{i}.RTP.LocalPortMin!UCI:asterisk/sip_advanced,sip_options/rtp_start*/
static int get_ServicesVoiceServiceVoIPProfileRTP_LocalPortMin(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
{
*value = dmuci_get_option_value_fallback_def("asterisk", "sip_options", "rtpstart", "1024");
*value = dmuci_get_option_value_fallback_def("asterisk", "sip_options", "rtp_start", "1024");
return 0;
}
@ -70,16 +70,16 @@ static int set_ServicesVoiceServiceVoIPProfileRTP_LocalPortMin(char *refparam, s
return FAULT_9007;
break;
case VALUESET:
dmuci_set_value("asterisk", "sip_options", "rtpstart", value);
dmuci_set_value("asterisk", "sip_options", "rtp_start", value);
break;
}
return 0;
}
/*#Device.Services.VoiceService.{i}.VoIPProfile.{i}.RTP.LocalPortMax!UCI:asterisk/sip_advanced,sip_options/rtpend*/
/*#Device.Services.VoiceService.{i}.VoIPProfile.{i}.RTP.LocalPortMax!UCI:asterisk/sip_advanced,sip_options/rtp_end*/
static int get_ServicesVoiceServiceVoIPProfileRTP_LocalPortMax(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
{
*value = dmuci_get_option_value_fallback_def("asterisk", "sip_options", "rtpend", "1024");
*value = dmuci_get_option_value_fallback_def("asterisk", "sip_options", "rtp_end", "1024");
return 0;
}
@ -91,7 +91,7 @@ static int set_ServicesVoiceServiceVoIPProfileRTP_LocalPortMax(char *refparam, s
return FAULT_9007;
break;
case VALUESET:
dmuci_set_value("asterisk", "sip_options", "rtpend", value);
dmuci_set_value("asterisk", "sip_options", "rtp_end", value);
break;
}
return 0;
@ -139,12 +139,12 @@ static int set_ServicesVoiceServiceVoIPProfileRTP_TelephoneEventPayloadType(char
return 0;
}
/*#Device.Services.VoiceService.{i}.VoIPProfile.{i}.RTP.JitterBufferType!UCI:asterisk/tel_advanced,tel_options/jbimpl*/
/*#Device.Services.VoiceService.{i}.VoIPProfile.{i}.RTP.JitterBufferType!UCI:asterisk/tel_advanced,tel_options/jb_impl*/
static int get_ServicesVoiceServiceVoIPProfileRTP_JitterBufferType(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
{
char *tmp = NULL;
dmuci_get_option_value_string("asterisk", "tel_options", "jbimpl", &tmp);
dmuci_get_option_value_string("asterisk", "tel_options", "jb_impl", &tmp);
if (tmp && *tmp) {
if (strcasecmp(tmp, "adaptive") == 0)
*value = "Dynamic";
@ -165,16 +165,16 @@ static int set_ServicesVoiceServiceVoIPProfileRTP_JitterBufferType(char *refpara
return FAULT_9007;
break;
case VALUESET:
dmuci_set_value("asterisk", "tel_options", "jbimpl", (strcasecmp(value, "Dynamic") == 0) ? "adaptive" : "fixed");
dmuci_set_value("asterisk", "tel_options", "jb_impl", (strcasecmp(value, "Dynamic") == 0) ? "adaptive" : "fixed");
break;
}
return 0;
}
/*#Device.Services.VoiceService.{i}.VoIPProfile.{i}.RTP.JitterBufferMaxSize!UCI:asterisk/tel_advanced,tel_options/jbmaxsize*/
/*#Device.Services.VoiceService.{i}.VoIPProfile.{i}.RTP.JitterBufferMaxSize!UCI:asterisk/tel_advanced,tel_options/jb_maxsize*/
static int get_ServicesVoiceServiceVoIPProfileRTP_JitterBufferMaxSize(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
{
*value = dmuci_get_option_value_fallback_def("asterisk", "tel_options", "jbmaxsize", "0");
*value = dmuci_get_option_value_fallback_def("asterisk", "tel_options", "jb_maxsize", "0");
return 0;
}
@ -186,7 +186,7 @@ static int set_ServicesVoiceServiceVoIPProfileRTP_JitterBufferMaxSize(char *refp
return FAULT_9007;
break;
case VALUESET:
dmuci_set_value("asterisk", "tel_options", "jbmaxsize", value);
dmuci_set_value("asterisk", "tel_options", "jb_maxsize", value);
break;
}
return 0;

View file

@ -0,0 +1,637 @@
/*
* Copyright (C) 2021 iopsys Software Solutions AB
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License version 2.1
* as published by the Free Software Foundation
*
* Author Amin Ben Ramdhane <amin.benramdhane@pivasoftware.com>
*/
#include "servicesvoiceservicecallcontrol.h"
#include "common.h"
/*#Device.Services.VoiceService.{i}.CallControl.Extension.{i}.ComfortNoise!UCI:asterisk/extension,@i-1/comfort_noise*/
static int get_ServicesVoiceServiceCallControlExtension_ComfortNoise(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
{
dmuci_get_value_by_section_string(((struct dmmap_dup *)data)->config_section, "comfort_noise", value);
return 0;
}
static int set_ServicesVoiceServiceCallControlExtension_ComfortNoise(char *refparam, struct dmctx *ctx, void *data, char *instance, char *value, int action)
{
bool b;
switch (action) {
case VALUECHECK:
if (dm_validate_boolean(value))
return FAULT_9007;
break;
case VALUESET:
string_to_bool(value, &b);
dmuci_set_value_by_section(((struct dmmap_dup *)data)->config_section, "comfort_noise", b ? "1" : "0");
break;
}
return 0;
}
/*#Device.Services.VoiceService.{i}.CallControl.Extension.{i}.TXGain!UCI:asterisk/extension,@i-1/txgain*/
static int get_ServicesVoiceServiceCallControlExtension_TXGain(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
{
dmuci_get_value_by_section_string(((struct dmmap_dup *)data)->config_section, "txgain", value);
return 0;
}
static int set_ServicesVoiceServiceCallControlExtension_TXGain(char *refparam, struct dmctx *ctx, void *data, char *instance, char *value, int action)
{
switch (action) {
case VALUECHECK:
if (dm_validate_string(value, -1, 32, NULL, NULL))
return FAULT_9007;
break;
case VALUESET:
dmuci_set_value_by_section(((struct dmmap_dup *)data)->config_section, "txgain", value);
break;
}
return 0;
}
/*#Device.Services.VoiceService.{i}.CallControl.Extension.{i}.RXGain!UCI:asterisk/extension,@i-1/rxgain*/
static int get_ServicesVoiceServiceCallControlExtension_RXGain(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
{
dmuci_get_value_by_section_string(((struct dmmap_dup *)data)->config_section, "rxgain", value);
return 0;
}
static int set_ServicesVoiceServiceCallControlExtension_RXGain(char *refparam, struct dmctx *ctx, void *data, char *instance, char *value, int action)
{
switch (action) {
case VALUECHECK:
if (dm_validate_string(value, -1, 32, NULL, NULL))
return FAULT_9007;
break;
case VALUESET:
dmuci_set_value_by_section(((struct dmmap_dup *)data)->config_section, "rxgain", value);
break;
}
return 0;
}
/*#Device.Services.VoiceService.{i}.CallControl.Extension.{i}.EchoCancel!UCI:asterisk/extension,@i-1/echo_cancel*/
static int get_ServicesVoiceServiceCallControlExtension_EchoCancel(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
{
dmuci_get_value_by_section_string(((struct dmmap_dup *)data)->config_section, "echo_cancel", value);
return 0;
}
static int set_ServicesVoiceServiceCallControlExtension_EchoCancel(char *refparam, struct dmctx *ctx, void *data, char *instance, char *value, int action)
{
bool b;
switch (action) {
case VALUECHECK:
if (dm_validate_boolean(value))
return FAULT_9007;
break;
case VALUESET:
string_to_bool(value, &b);
dmuci_set_value_by_section(((struct dmmap_dup *)data)->config_section, "echo_cancel", b ? "1" : "0");
break;
}
return 0;
}
/*#Device.Services.VoiceService.{i}.CallControl.Extension.{i}.Type!UCI:asterisk/extension,@i-1/type*/
static int get_ServicesVoiceServiceCallControlExtension_Type(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
{
dmuci_get_value_by_section_string(((struct dmmap_dup *)data)->config_section, "type", value);
return 0;
}
static int set_ServicesVoiceServiceCallControlExtension_Type(char *refparam, struct dmctx *ctx, void *data, char *instance, char *value, int action)
{
switch (action) {
case VALUECHECK:
if (dm_validate_string(value, -1, 32, NULL, NULL))
return FAULT_9007;
break;
case VALUESET:
dmuci_set_value_by_section(((struct dmmap_dup *)data)->config_section, "type", value);
break;
}
return 0;
}
/*#Device.Services.VoiceService.{i}.CallControl.CallingFeatures.Set.{i}.CBBSType!UCI:asterisk/calling_features/cbbs_type*/
static int get_ServicesVoiceServiceCallControlCallingFeaturesSet_CBBSType(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
{
dmuci_get_value_by_section_string(((struct dmmap_dup *)data)->config_section, "cbbs_type", value);
return 0;
}
static int set_ServicesVoiceServiceCallControlCallingFeaturesSet_CBBSType(char *refparam, struct dmctx *ctx, void *data, char *instance, char *value, int action)
{
switch (action) {
case VALUECHECK:
if (dm_validate_string(value, -1, 32, NULL, NULL))
return FAULT_9007;
break;
case VALUESET:
dmuci_set_value_by_section(((struct dmmap_dup *)data)->config_section,"cbbs_type", value);
break;
}
return 0;
}
/*#Device.Services.VoiceService.{i}.CallControl.CallingFeatures.Set.{i}.InternalService!UCI:asterisk/calling_features/internal_service*/
static int get_ServicesVoiceServiceCallControlCallingFeaturesSet_InternalService(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
{
dmuci_get_value_by_section_string(((struct dmmap_dup *)data)->config_section, "internal_service", value);
return 0;
}
static int set_ServicesVoiceServiceCallControlCallingFeaturesSet_InternalService(char *refparam, struct dmctx *ctx, void *data, char *instance, char *value, int action)
{
bool b;
switch (action) {
case VALUECHECK:
if (dm_validate_boolean(value))
return FAULT_9007;
break;
case VALUESET:
string_to_bool(value, &b);
dmuci_set_value_by_section(((struct dmmap_dup *)data)->config_section, "internal_service", b ? "1" : "0");
break;
}
return 0;
}
/*#Device.Services.VoiceService.{i}.CallControl.CallingFeatures.Set.{i}.CallReturnEnable!UCI:asterisk/calling_features/callreturn_enable*/
static int get_ServicesVoiceServiceCallControlCallingFeaturesSet_CallReturnEnable(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
{
dmuci_get_value_by_section_string(((struct dmmap_dup *)data)->config_section, "callreturn_enable", value);
return 0;
}
static int set_ServicesVoiceServiceCallControlCallingFeaturesSet_CallReturnEnable(char *refparam, struct dmctx *ctx, void *data, char *instance, char *value, int action)
{
bool b;
switch (action) {
case VALUECHECK:
if (dm_validate_boolean(value))
return FAULT_9007;
break;
case VALUESET:
string_to_bool(value, &b);
dmuci_set_value_by_section(((struct dmmap_dup *)data)->config_section, "callreturn_enable", b ? "1" : "0");
break;
}
return 0;
}
/*#Device.Services.VoiceService.{i}.CallControl.CallingFeatures.Set.{i}.MOHPassThrough!UCI:asterisk/calling_features/moh_passthrough*/
static int get_ServicesVoiceServiceCallControlCallingFeaturesSet_MOHPassThrough(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
{
*value = dmuci_get_value_by_section_fallback_def(((struct dmmap_dup *)data)->config_section, "moh_passthrough", "1");
return 0;
}
static int set_ServicesVoiceServiceCallControlCallingFeaturesSet_MOHPassThrough(char *refparam, struct dmctx *ctx, void *data, char *instance, char *value, int action)
{
bool b;
switch (action) {
case VALUECHECK:
if (dm_validate_boolean(value))
return FAULT_9007;
break;
case VALUESET:
string_to_bool(value, &b);
dmuci_set_value_by_section(((struct dmmap_dup *)data)->config_section, "moh_passthrough", b ? "1" : "0");
break;
}
return 0;
}
/*#Device.Services.VoiceService.{i}.CallControl.CallingFeatures.Set.{i}.CBBSKey!UCI:asterisk/calling_features/cbbs_key*/
static int get_ServicesVoiceServiceCallControlCallingFeaturesSet_CBBSKey(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
{
*value = dmuci_get_value_by_section_fallback_def(((struct dmmap_dup *)data)->config_section, "cbbs_key", "");
return 0;
}
static int set_ServicesVoiceServiceCallControlCallingFeaturesSet_CBBSKey(char *refparam, struct dmctx *ctx, void *data, char *instance, char *value, int action)
{
switch (action) {
case VALUECHECK:
if (dm_validate_string(value, -1, 32, NULL, NULL))
return FAULT_9007;
break;
case VALUESET:
dmuci_set_value_by_section(((struct dmmap_dup *)data)->config_section, "cbbs_key", value);
break;
}
return 0;
}
/*#Device.Services.VoiceService.{i}.CallControl.CallingFeatures.Set.{i}.CBBSMaxRetry!UCI:asterisk/calling_features/cbbs_maxretry*/
static int get_ServicesVoiceServiceCallControlCallingFeaturesSet_CBBSMaxRetry(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
{
*value = dmuci_get_value_by_section_fallback_def(((struct dmmap_dup *)data)->config_section, "cbbs_maxretry", "0");
return 0;
}
static int set_ServicesVoiceServiceCallControlCallingFeaturesSet_CBBSMaxRetry(char *refparam, struct dmctx *ctx, void *data, char *instance, char *value, int action)
{
switch (action) {
case VALUECHECK:
if (dm_validate_string(value, -1, 32, NULL, NULL))
return FAULT_9007;
break;
case VALUESET:
dmuci_set_value_by_section(((struct dmmap_dup *)data)->config_section, "cbbs_maxretry", value);
break;
}
return 0;
}
/*#Device.Services.VoiceService.{i}.CallControl.CallingFeatures.Set.{i}.CBBSRetryTime!UCI:asterisk/calling_features/cbbs_retrytime*/
static int get_ServicesVoiceServiceCallControlCallingFeaturesSet_CBBSRetryTime(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
{
*value = dmuci_get_value_by_section_fallback_def(((struct dmmap_dup *)data)->config_section, "cbbs_retrytime", "0");
return 0;
}
static int set_ServicesVoiceServiceCallControlCallingFeaturesSet_CBBSRetryTime(char *refparam, struct dmctx *ctx, void *data, char *instance, char *value, int action)
{
switch (action) {
case VALUECHECK:
if (dm_validate_string(value, -1, 32, NULL, NULL))
return FAULT_9007;
break;
case VALUESET:
dmuci_set_value_by_section(((struct dmmap_dup *)data)->config_section, "cbbs_retrytime", value);
break;
}
return 0;
}
/*#Device.Services.VoiceService.{i}.CallControl.CallingFeatures.Set.{i}.CBBSWaitTime!UCI:asterisk/calling_features/cbbs_waittime*/
static int get_ServicesVoiceServiceCallControlCallingFeaturesSet_CBBSWaitTime(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
{
*value = dmuci_get_value_by_section_fallback_def(((struct dmmap_dup *)data)->config_section, "cbbs_waittime", "0");
return 0;
}
static int set_ServicesVoiceServiceCallControlCallingFeaturesSet_CBBSWaitTime(char *refparam, struct dmctx *ctx, void *data, char *instance, char *value, int action)
{
switch (action) {
case VALUECHECK:
if (dm_validate_string(value, -1, 32, NULL, NULL))
return FAULT_9007;
break;
case VALUESET:
dmuci_set_value_by_section(((struct dmmap_dup *)data)->config_section, "cbbs_waittime", value);
break;
}
return 0;
}
/*#Device.Services.VoiceService.{i}.CallControl.CallingFeatures.Set.{i}.CFIMOn!UCI:asterisk/calling_features/cfim_on*/
static int get_ServicesVoiceServiceCallControlCallingFeaturesSet_CFIMOn(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
{
*value = dmuci_get_value_by_section_fallback_def(((struct dmmap_dup *)data)->config_section, "cfim_on", "cfimon");
return 0;
}
static int set_ServicesVoiceServiceCallControlCallingFeaturesSet_CFIMOn(char *refparam, struct dmctx *ctx, void *data, char *instance, char *value, int action)
{
switch (action) {
case VALUECHECK:
if (dm_validate_string(value, -1, 32, NULL, NULL))
return FAULT_9007;
break;
case VALUESET:
dmuci_set_value_by_section(((struct dmmap_dup *)data)->config_section, "cfim_on", value);
break;
}
return 0;
}
/*#Device.Services.VoiceService.{i}.CallControl.CallingFeatures.Set.{i}.CFIMOff!UCI:asterisk/calling_features/cfim_off*/
static int get_ServicesVoiceServiceCallControlCallingFeaturesSet_CFIMOff(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
{
*value = dmuci_get_value_by_section_fallback_def(((struct dmmap_dup *)data)->config_section, "cfim_off", "cfimoff");
return 0;
}
static int set_ServicesVoiceServiceCallControlCallingFeaturesSet_CFIMOff(char *refparam, struct dmctx *ctx, void *data, char *instance, char *value, int action)
{
switch (action) {
case VALUECHECK:
if (dm_validate_string(value, -1, 32, NULL, NULL))
return FAULT_9007;
break;
case VALUESET:
dmuci_set_value_by_section(((struct dmmap_dup *)data)->config_section, "cfim_off", value);
break;
}
return 0;
}
/*#Device.Services.VoiceService.{i}.CallControl.CallingFeatures.Set.{i}.CFBSOnOn!UCI:asterisk/calling_features/cfbs_onn*/
static int get_ServicesVoiceServiceCallControlCallingFeaturesSet_CFBSOn(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
{
*value = dmuci_get_value_by_section_fallback_def(((struct dmmap_dup *)data)->config_section, "cfbs_on", "cfbson");
return 0;
}
static int set_ServicesVoiceServiceCallControlCallingFeaturesSet_CFBSOn(char *refparam, struct dmctx *ctx, void *data, char *instance, char *value, int action)
{
switch (action) {
case VALUECHECK:
if (dm_validate_string(value, -1, 32, NULL, NULL))
return FAULT_9007;
break;
case VALUESET:
dmuci_set_value_by_section(((struct dmmap_dup *)data)->config_section, "cfbs_on", value);
break;
}
return 0;
}
/*#Device.Services.VoiceService.{i}.CallControl.CallingFeatures.Set.{i}.CFBSOff!UCI:asterisk/calling_features/cfbs_off*/
static int get_SerCFBSOffvicesVoiceServiceCallControlCallingFeaturesSet_CFBSOff(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
{
*value = dmuci_get_value_by_section_fallback_def(((struct dmmap_dup *)data)->config_section, "cfbs_off", "cfbsoff");
return 0;
}
static int set_ServicesVoiceServiceCallControlCallingFeaturesSet_CFBSOff(char *refparam, struct dmctx *ctx, void *data, char *instance, char *value, int action)
{
switch (action) {
case VALUECHECK:
if (dm_validate_string(value, -1, 32, NULL, NULL))
return FAULT_9007;
break;
case VALUESET:
dmuci_set_value_by_section(((struct dmmap_dup *)data)->config_section, "cfbs_off", value);
break;
}
return 0;
}
/*#Device.Services.VoiceService.{i}.CallControl.CallingFeatures.Set.{i}.CFBOn!UCI:asterisk/calling_features/cfb_on*/
static int get_ServicesVoiceServiceCallControlCallingFeaturesSet_CFBOn(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
{
*value = dmuci_get_value_by_section_fallback_def(((struct dmmap_dup *)data)->config_section, "cfb_on", "cfbon");
return 0;
}
static int set_ServicesVoiceServiceCallControlCallingFeaturesSet_CFBOn(char *refparam, struct dmctx *ctx, void *data, char *instance, char *value, int action)
{
switch (action) {
case VALUECHECK:
if (dm_validate_string(value, -1, 32, NULL, NULL))
return FAULT_9007;
break;
case VALUESET:
dmuci_set_value_by_section(((struct dmmap_dup *)data)->config_section, "cfb_on", value);
break;
}
return 0;
}
/*#Device.Services.VoiceService.{i}.CallControl.CallingFeatures.Set.{i}.CFBOff!UCI:asterisk/calling_features/cfb_off*/
static int get_ServicesVoiceServiceCallControlCallingFeaturesSet_CFBOff(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
{
*value = dmuci_get_value_by_section_fallback_def(((struct dmmap_dup *)data)->config_section, "cfb_off", "cfboff");
return 0;
}
static int set_ServicesVoiceServiceCallControlCallingFeaturesSet_CFBOff(char *refparam, struct dmctx *ctx, void *data, char *instance, char *value, int action)
{
switch (action) {
case VALUECHECK:
if (dm_validate_string(value, -1, 32, NULL, NULL))
return FAULT_9007;
break;
case VALUESET:
dmuci_set_value_by_section(((struct dmmap_dup *)data)->config_section, "cfb_off", value);
break;
}
return 0;
}
/*#Device.Services.VoiceService.{i}.CallControl.CallingFeatures.Set.{i}.CWOn!UCI:asterisk/calling_features/cw_on*/
static int get_ServicesVoiceServiceCallControlCallingFeaturesSet_CWOn(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
{
*value = dmuci_get_value_by_section_fallback_def(((struct dmmap_dup *)data)->config_section, "cw_on", "cwon");
return 0;
}
static int set_ServicesVoiceServiceCallControlCallingFeaturesSet_CWOn(char *refparam, struct dmctx *ctx, void *data, char *instance, char *value, int action)
{
switch (action) {
case VALUECHECK:
if (dm_validate_string(value, -1, 32, NULL, NULL))
return FAULT_9007;
break;
case VALUESET:
dmuci_set_value_by_section(((struct dmmap_dup *)data)->config_section, "cw_on", value);
break;
}
return 0;
}
/*#Device.Services.VoiceService.{i}.CallControl.CallingFeatures.Set.{i}.CWOff!UCI:asterisk/calling_features/cw_off*/
static int get_ServicesVoiceServiceCallControlCallingFeaturesSet_CWOff(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
{
*value = dmuci_get_value_by_section_fallback_def(((struct dmmap_dup *)data)->config_section, "cw_off", "cwoff");
return 0;
}
static int set_ServicesVoiceServiceCallControlCallingFeaturesSet_CWOff(char *refparam, struct dmctx *ctx, void *data, char *instance, char *value, int action)
{
switch (action) {
case VALUECHECK:
if (dm_validate_string(value, -1, 32, NULL, NULL))
return FAULT_9007;
break;
case VALUESET:
dmuci_set_value_by_section(((struct dmmap_dup *)data)->config_section, "cw_off", value);
break;
}
return 0;
}
/*#Device.Services.VoiceService.{i}.CallControl.CallingFeatures.Set.{i}.CWStatus!UCI:asterisk/calling_features/cw_status*/
static int get_ServicesVoiceServiceCallControlCallingFeaturesSet_CWStatus(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
{
*value = dmuci_get_value_by_section_fallback_def(((struct dmmap_dup *)data)->config_section, "cw_status", "cwstatus");
return 0;
}
static int set_ServicesVoiceServiceCallControlCallingFeaturesSet_CWStatus(char *refparam, struct dmctx *ctx, void *data, char *instance, char *value, int action)
{
switch (action) {
case VALUECHECK:
if (dm_validate_string(value, -1, 32, NULL, NULL))
return FAULT_9007;
break;
case VALUESET:
dmuci_set_value_by_section(((struct dmmap_dup *)data)->config_section, "cw_status", value);
break;
}
return 0;
}
/*#Device.Services.VoiceService.{i}.CallControl.CallingFeatures.Set.{i}.DNDOn!UCI:asterisk/calling_features/dnd_on*/
static int get_ServicesVoiceServiceCallControlCallingFeaturesSet_DNDOn(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
{
*value = dmuci_get_value_by_section_fallback_def(((struct dmmap_dup *)data)->config_section, "dnd_on", "dndon");
return 0;
}
static int set_ServicesVoiceServiceCallControlCallingFeaturesSet_DNDOn(char *refparam, struct dmctx *ctx, void *data, char *instance, char *value, int action)
{
switch (action) {
case VALUECHECK:
if (dm_validate_string(value, -1, 32, NULL, NULL))
return FAULT_9007;
break;
case VALUESET:
dmuci_set_value_by_section(((struct dmmap_dup *)data)->config_section, "dnd_on", value);
break;
}
return 0;
}
/*#Device.Services.VoiceService.{i}.CallControl.CallingFeatures.Set.{i}.DNDOff!UCI:asterisk/calling_features/dnd_off*/
static int get_ServicesVoiceServiceCallControlCallingFeaturesSet_DNDOff(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
{
*value = dmuci_get_value_by_section_fallback_def(((struct dmmap_dup *)data)->config_section, "dnd_off", "dndoff");
return 0;
}
static int set_ServicesVoiceServiceCallControlCallingFeaturesSet_DNDOff(char *refparam, struct dmctx *ctx, void *data, char *instance, char *value, int action)
{
switch (action) {
case VALUECHECK:
if (dm_validate_string(value, -1, 32, NULL, NULL))
return FAULT_9007;
break;
case VALUESET:
dmuci_set_value_by_section(((struct dmmap_dup *)data)->config_section, "dnd_off", value);
break;
}
return 0;
}
/*#Device.Services.VoiceService.{i}.CallControl.CallingFeatures.Set.{i}.DNDStatus!UCI:asterisk/calling_features/dnd_status*/
static int get_ServicesVoiceServiceCallControlCallingFeaturesSet_DNDStatus(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
{
*value = dmuci_get_value_by_section_fallback_def(((struct dmmap_dup *)data)->config_section, "dnd_status", "dndstatus");
return 0;
}
static int set_ServicesVoiceServiceCallControlCallingFeaturesSet_DNDStatus(char *refparam, struct dmctx *ctx, void *data, char *instance, char *value, int action)
{
switch (action) {
case VALUECHECK:
if (dm_validate_string(value, -1, 32, NULL, NULL))
return FAULT_9007;
break;
case VALUESET:
dmuci_set_value_by_section(((struct dmmap_dup *)data)->config_section, "dnd_status", value);
break;
}
return 0;
}
/*#Device.Services.VoiceService.{i}.CallControl.CallingFeatures.Set.{i}.CallReturn!UCI:asterisk/calling_features/callreturn*/
static int get_ServicesVoiceServiceCallControlCallingFeaturesSet_CallReturn(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
{
*value = dmuci_get_value_by_section_fallback_def(((struct dmmap_dup *)data)->config_section, "call_return", "callreturn");
return 0;
}
static int set_ServicesVoiceServiceCallControlCallingFeaturesSet_CallReturn(char *refparam, struct dmctx *ctx, void *data, char *instance, char *value, int action)
{
switch (action) {
case VALUECHECK:
if (dm_validate_string(value, -1, 32, NULL, NULL))
return FAULT_9007;
break;
case VALUESET:
dmuci_set_value_by_section(((struct dmmap_dup *)data)->config_section, "call_return", value);
break;
}
return 0;
}
/*#Device.Services.VoiceService.{i}.CallControl.CallingFeatures.Set.{i}.Redial!UCI:asterisk/calling_features/redial*/
static int get_ServicesVoiceServiceCallControlCallingFeaturesSet_Redial(char *refparam, struct dmctx *ctx, void *data, char *instance, char **value)
{
*value = dmuci_get_value_by_section_fallback_def(((struct dmmap_dup *)data)->config_section, "redial", "redial");
return 0;
}
static int set_ServicesVoiceServiceCallControlCallingFeaturesSet_Redial(char *refparam, struct dmctx *ctx, void *data, char *instance, char *value, int action)
{
switch (action) {
case VALUECHECK:
if (dm_validate_string(value, -1, 32, NULL, NULL))
return FAULT_9007;
break;
case VALUESET:
dmuci_set_value_by_section(((struct dmmap_dup *)data)->config_section, "redial", value);
break;
}
return 0;
}
/**********************************************************************************************************************************
* OBJ & PARAM DEFINITION
***********************************************************************************************************************************/
/* *** Device.Services.VoiceService.{i}.CallControl.Extension.{i}. *** */
DMLEAF tIOPSYS_VoiceServiceCallControlExtensionParams[] = {
/* PARAM, permission, type, getvalue, setvalue, bbfdm_type*/
{BBF_VENDOR_PREFIX"ComfortNoise", &DMWRITE, DMT_STRING, get_ServicesVoiceServiceCallControlExtension_ComfortNoise, set_ServicesVoiceServiceCallControlExtension_ComfortNoise, BBFDM_BOTH},
{BBF_VENDOR_PREFIX"TXGain", &DMWRITE, DMT_STRING, get_ServicesVoiceServiceCallControlExtension_TXGain, set_ServicesVoiceServiceCallControlExtension_TXGain, BBFDM_BOTH},
{BBF_VENDOR_PREFIX"RXGain", &DMWRITE, DMT_STRING, get_ServicesVoiceServiceCallControlExtension_RXGain, set_ServicesVoiceServiceCallControlExtension_RXGain, BBFDM_BOTH},
{BBF_VENDOR_PREFIX"EchoCancel", &DMWRITE, DMT_STRING, get_ServicesVoiceServiceCallControlExtension_EchoCancel, set_ServicesVoiceServiceCallControlExtension_EchoCancel, BBFDM_BOTH},
{BBF_VENDOR_PREFIX"Type", &DMWRITE, DMT_STRING, get_ServicesVoiceServiceCallControlExtension_Type, set_ServicesVoiceServiceCallControlExtension_Type, BBFDM_BOTH},
{0}
};
/* *** Device.Services.VoiceService.{i}.CallControl.CallingFeatures.Set.{i}. *** */
DMLEAF tIOPSYS_VoiceServiceCallControlCallingFeaturesSetParams[] = {
/* PARAM, permission, type, getvalue, setvalue, bbfdm_type*/
{BBF_VENDOR_PREFIX"CBBSType", &DMWRITE, DMT_STRING, get_ServicesVoiceServiceCallControlCallingFeaturesSet_CBBSType, set_ServicesVoiceServiceCallControlCallingFeaturesSet_CBBSType, BBFDM_BOTH},
{BBF_VENDOR_PREFIX"InternalService", &DMWRITE, DMT_BOOL, get_ServicesVoiceServiceCallControlCallingFeaturesSet_InternalService, set_ServicesVoiceServiceCallControlCallingFeaturesSet_InternalService, BBFDM_BOTH},
{BBF_VENDOR_PREFIX"CallReturnEnable", &DMWRITE, DMT_BOOL, get_ServicesVoiceServiceCallControlCallingFeaturesSet_CallReturnEnable, set_ServicesVoiceServiceCallControlCallingFeaturesSet_CallReturnEnable, BBFDM_BOTH},
{BBF_VENDOR_PREFIX"MOHPassThrough", &DMWRITE, DMT_BOOL, get_ServicesVoiceServiceCallControlCallingFeaturesSet_MOHPassThrough, set_ServicesVoiceServiceCallControlCallingFeaturesSet_MOHPassThrough, BBFDM_BOTH},
{BBF_VENDOR_PREFIX"CBBSKey", &DMWRITE, DMT_STRING, get_ServicesVoiceServiceCallControlCallingFeaturesSet_CBBSKey, set_ServicesVoiceServiceCallControlCallingFeaturesSet_CBBSKey, BBFDM_BOTH},
{BBF_VENDOR_PREFIX"CBBSMaxRetry", &DMWRITE, DMT_STRING, get_ServicesVoiceServiceCallControlCallingFeaturesSet_CBBSMaxRetry, set_ServicesVoiceServiceCallControlCallingFeaturesSet_CBBSMaxRetry, BBFDM_BOTH},
{BBF_VENDOR_PREFIX"CBBSRetryTime", &DMWRITE, DMT_STRING, get_ServicesVoiceServiceCallControlCallingFeaturesSet_CBBSRetryTime, set_ServicesVoiceServiceCallControlCallingFeaturesSet_CBBSRetryTime, BBFDM_BOTH},
{BBF_VENDOR_PREFIX"CBBSWaitTime", &DMWRITE, DMT_STRING, get_ServicesVoiceServiceCallControlCallingFeaturesSet_CBBSWaitTime, set_ServicesVoiceServiceCallControlCallingFeaturesSet_CBBSWaitTime, BBFDM_BOTH},
{BBF_VENDOR_PREFIX"CFIMOn", &DMWRITE, DMT_STRING, get_ServicesVoiceServiceCallControlCallingFeaturesSet_CFIMOn, set_ServicesVoiceServiceCallControlCallingFeaturesSet_CFIMOn, BBFDM_BOTH},
{BBF_VENDOR_PREFIX"CFIMOff", &DMWRITE, DMT_STRING, get_ServicesVoiceServiceCallControlCallingFeaturesSet_CFIMOff, set_ServicesVoiceServiceCallControlCallingFeaturesSet_CFIMOff, BBFDM_BOTH},
{BBF_VENDOR_PREFIX"CFBSOn", &DMWRITE, DMT_STRING, get_ServicesVoiceServiceCallControlCallingFeaturesSet_CFBSOn, set_ServicesVoiceServiceCallControlCallingFeaturesSet_CFBSOn, BBFDM_BOTH},
{BBF_VENDOR_PREFIX"CFBSOff", &DMWRITE, DMT_STRING, get_SerCFBSOffvicesVoiceServiceCallControlCallingFeaturesSet_CFBSOff, set_ServicesVoiceServiceCallControlCallingFeaturesSet_CFBSOff, BBFDM_BOTH},
{BBF_VENDOR_PREFIX"CFBOn", &DMWRITE, DMT_STRING, get_ServicesVoiceServiceCallControlCallingFeaturesSet_CFBOn, set_ServicesVoiceServiceCallControlCallingFeaturesSet_CFBOn, BBFDM_BOTH},
{BBF_VENDOR_PREFIX"CFBOff", &DMWRITE, DMT_STRING, get_ServicesVoiceServiceCallControlCallingFeaturesSet_CFBOff, set_ServicesVoiceServiceCallControlCallingFeaturesSet_CFBOff, BBFDM_BOTH},
{BBF_VENDOR_PREFIX"CWOn", &DMWRITE, DMT_STRING, get_ServicesVoiceServiceCallControlCallingFeaturesSet_CWOn, set_ServicesVoiceServiceCallControlCallingFeaturesSet_CWOn, BBFDM_BOTH},
{BBF_VENDOR_PREFIX"CWOff", &DMWRITE, DMT_STRING, get_ServicesVoiceServiceCallControlCallingFeaturesSet_CWOff, set_ServicesVoiceServiceCallControlCallingFeaturesSet_CWOff, BBFDM_BOTH},
{BBF_VENDOR_PREFIX"CWStatus", &DMWRITE, DMT_STRING, get_ServicesVoiceServiceCallControlCallingFeaturesSet_CWStatus, set_ServicesVoiceServiceCallControlCallingFeaturesSet_CWStatus, BBFDM_BOTH},
{BBF_VENDOR_PREFIX"DNDOn", &DMWRITE, DMT_STRING, get_ServicesVoiceServiceCallControlCallingFeaturesSet_DNDOn, set_ServicesVoiceServiceCallControlCallingFeaturesSet_DNDOn, BBFDM_BOTH},
{BBF_VENDOR_PREFIX"DNDOff", &DMWRITE, DMT_STRING, get_ServicesVoiceServiceCallControlCallingFeaturesSet_DNDOff, set_ServicesVoiceServiceCallControlCallingFeaturesSet_DNDOff, BBFDM_BOTH},
{BBF_VENDOR_PREFIX"DNDStatus", &DMWRITE, DMT_STRING, get_ServicesVoiceServiceCallControlCallingFeaturesSet_DNDStatus, set_ServicesVoiceServiceCallControlCallingFeaturesSet_DNDStatus, BBFDM_BOTH},
{BBF_VENDOR_PREFIX"CallReturn", &DMWRITE, DMT_STRING, get_ServicesVoiceServiceCallControlCallingFeaturesSet_CallReturn, set_ServicesVoiceServiceCallControlCallingFeaturesSet_CallReturn, BBFDM_BOTH},
{BBF_VENDOR_PREFIX"Redial", &DMWRITE, DMT_STRING, get_ServicesVoiceServiceCallControlCallingFeaturesSet_Redial, set_ServicesVoiceServiceCallControlCallingFeaturesSet_Redial, BBFDM_BOTH},
{0}
};

View file

@ -0,0 +1,20 @@
/*
* Copyright (C) 2021 iopsys Software Solutions AB
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License version 2.1
* as published by the Free Software Foundation
*
* Author Amin Ben Ramdhane <amin.benramdhane@pivasoftware.com>
*/
#ifndef __IOPSYS_VOICESERVICECALLCONTROL_H
#define __IOPSYS_VOICESERVICECALLCONTROL_H
#include <libbbf_api/dmcommon.h>
extern DMLEAF tIOPSYS_VoiceServiceCallControlExtensionParams[];
extern DMLEAF tIOPSYS_VoiceServiceCallControlCallingFeaturesSetParams[];
#endif //__IOPSYS_VOICESERVICECALLCONTROL_H

View file

@ -15,6 +15,7 @@
#include "ethernet.h"
#include "ip.h"
#include "times.h"
#include "../tr104/servicesvoiceservicecallcontrol.h"
#include "../tr104/servicesvoiceservicecalllog.h"
#include "../tr104/servicesvoiceservicedect.h"
#include "vendor.h"
@ -31,5 +32,7 @@ DM_MAP_OBJ tVendorExtensionIOPSYS[] = {
{"Device.Services.VoiceService.{i}.CallLog.{i}.Session.{i}.Source.RTP.", NULL, tIOPSYS_VoiceServiceCallLogSessionSourceRTPParams},
{"Device.Services.VoiceService.{i}.CallLog.{i}.Session.{i}.Destination.RTP.", NULL, tIOPSYS_VoiceServiceCallLogSessionDestinationRTPParams},
{"Device.Services.VoiceService.{i}.DECT.Portable.{i}.", NULL, tIOPSYS_VoiceServiceDECTPortableParams},
{"Device.Services.VoiceService.{i}.CallControl.Extension.{i}.", NULL, tIOPSYS_VoiceServiceCallControlExtensionParams},
{"Device.Services.VoiceService.{i}.CallControl.CallingFeatures.Set.{i}.", NULL, tIOPSYS_VoiceServiceCallControlCallingFeaturesSetParams},
{0}
};

View file

@ -1,155 +1,102 @@
config asterisk 'general'
option enabled '1'
option enable '1'
option log_stderr '1'
option log_stdout '1'
config tel_line 'telline0'
option enabled '1'
option extension '0000'
option noise '0'
option vad '0'
config line 'line0'
option enable '1'
option provider 'sip0'
option calling_features 'set1'
config extension 'extension0'
option enable '1'
option extension_number '0000'
option comfort_noise '0'
option txgain '4'
option rxgain '4'
option echo_cancel '1'
option clir '0'
option sip_account 'sip0'
option callwaiting_enabled '0'
option do_not_disturb '0'
option calling_features 'set1'
option name 'DECT 1'
option type 'dect'
config tel_line 'telline1'
option enabled '1'
option extension '1111'
option noise '0'
option vad '0'
config extension 'extension1'
option enable '1'
option extension_number '1111'
option comfort_noise '0'
option txgain '4'
option rxgain '4'
option echo_cancel '1'
option clir '0'
option sip_account 'sip0'
option callwaiting_enabled '0'
option do_not_disturb '0'
option calling_features 'set1'
option name 'DECT 2'
option type 'dect'
config tel_line 'telline2'
option enabled '1'
option extension '2222'
option sip_account 'sip0'
option noise '0'
option vad '0'
config extension 'extension2'
option enable '1'
option extension_number '2222'
option comfort_noise '0'
option txgain '4'
option rxgain '4'
option echo_cancel '1'
option clir '0'
option callwaiting_enabled '0'
option do_not_disturb '0'
option calling_features 'set1'
option name 'DECT 3'
option type 'dect'
config tel_line 'telline3'
option enabled '1'
option extension '3333'
option sip_account 'sip0'
option noise '0'
option vad '0'
config extension 'extension3'
option enable '1'
option extension_number '3333'
option comfort_noise '0'
option txgain '4'
option rxgain '4'
option echo_cancel '1'
option clir '0'
option callwaiting_enabled '0'
option do_not_disturb '0'
option name 'DECT 4'
config tel_line 'telline4'
option enabled '1'
option extension '4444'
option sip_account 'sip0'
option noise '0'
option vad '0'
option txgain '4'
option rxgain '4'
option echo_cancel '1'
option clir '0'
option callwaiting_enabled '0'
option do_not_disturb '0'
option name 'Tel 2'
config tel_line 'telline5'
option enabled '1'
option extension '5555'
option sip_account 'sip0'
option noise '0'
option vad '0'
option txgain '4'
option rxgain '4'
option echo_cancel '1'
option clir '0'
option callwaiting_enabled '0'
option do_not_disturb '0'
option calling_features 'set1'
option name 'Tel 1'
option type 'fxs'
config dialplan 'custom_dialplan'
option custom_outgoing_enabled '0'
option custom_incoming_enabled '0'
option custom_hangup_enabled '0'
option custom_outgoing_enable '0'
option custom_incoming_enable '0'
option custom_hangup_enable '0'
option all_ports_extension '#123456'
option test_audio_extension '#123457'
option test_echo_extension '#123458'
option record_message_extension '#999999'
config sip_advanced 'sip_options'
option rtpstart '10000'
option rtpend '20000'
option dtmfmode 'rfc4733'
option remotehold 'yes'
option rtp_start '10000'
option rtp_end '20000'
option dtmf_mode 'rfc4733'
option remote_hold 'yes'
option tls_version 'sslv23'
option dnsmgr 'no'
option dnsmgr_refresh_interval '300'
option srvlookup 'yes'
option dns_mgr 'no'
option dns_mgr_refresh_interval '300'
option srv_lookup 'yes'
config tel_advanced 'tel_options'
option country 'se'
option jbenable 'yes'
option jbforce 'no'
option jbmaxsize '500'
option jbimpl 'adaptive'
option dialoutmsec '4000'
option jb_enable 'yes'
option jb_force 'no'
option jb_maxsize '500'
option jb_impl 'adaptive'
option dial_out_timeout '4000'
option echo_cancel '1'
config advanced_features 'call_features'
config calling_features 'set1'
option caller_id_enable '1'
option caller_name_enable '1'
option call_forward_unconditional '1'
option call_forward_on_busy '0'
option call_forward_on_no_answer '0'
option mwi_enable '0'
option anonymous_call_enable '0'
option dnd_enable '0'
option voice_mail_enable '0'
option ccbs_enable '0'
option redial_enable '1'
option cbbs_type 'internal'
option callforward_enabled '1'
option redial_enabled '1'
option callreturn_enabled '1'
option moh_passthrough '1'
option mwi_enabled '0'
option internal_service '0'
config log 'log_options'
option console 'notice,warning,error'
option messages 'error'
option syslog_facility 'local0'
config cdr 'cdr_options'
option csv_max_row '100'
config call_filter 'call_filter0'
option block_outgoing '0'
option block_incoming '0'
config codec_profile 'alaw'
option name 'G.711ALaw'
option ptime '20'
config codec_profile 'ulaw'
option name 'G.711MuLaw'
option ptime '20'
config sip_service_provider 'sip0'
option name 'account 1'
option enabled '0'
list codecs 'alaw'
list codecs 'ulaw'
option callreturn_enable '1'
option moh_passthrough '1'
option cbbs_key '5'
option cbbs_maxretry '5'
option cbbs_retrytime '300'
@ -168,9 +115,57 @@ config sip_service_provider 'sip0'
option dnd_status '*#261#'
option call_return '*69'
option redial '*66'
option is_fax '0'
option call_waiting_enable '1'
config log 'log_options'
option console 'notice,warning,error'
option messages 'error'
option syslog_facility 'local0'
config cdr 'cdr_options'
option csv_max_row '100'
config codec_profile 'alaw'
option name 'G.711ALaw'
option ptime '20'
config codec_profile 'ulaw'
option name 'G.711MuLaw'
option ptime '20'
config incoming_map 'incoming_map1'
option enable '1'
option extension 'group1'
option line 'line0'
config outgoing_map 'outgoing_map1'
option enable '1'
option extension 'group1'
option line 'line0'
config group 'group1'
list extensions 'extension0'
list extensions 'extension2'
config call_filter 'call_filter0'
option block_foreign '0'
option block_special_rate '0'
option block_outgoing '0'
option block_incoming '0'
config sip_service_provider 'sip0'
list codecs 'alaw'
list codecs 'ulaw'
option support_fax '0'
option transport 'udp'
option dtmf_mode 'rfc4733'
option encryption 'no'
option mediasec '0'
option dtmf_mode 'rfc4733'
option name '8001'
option displayname '8001'
option enable '1'
option domain '192.168.1.235'
option host '192.168.1.235'
option user '8001'
option authuser '8001'
option secret '8001'