Voice: fix segfault and add dependency to asterisk config file

This commit is contained in:
Amin Ben Ramdhane 2020-09-18 15:05:28 +01:00
parent 26f5f2ec3d
commit 0390d3b152
2 changed files with 6 additions and 6 deletions

View file

@ -240,8 +240,8 @@ static int set_service_alias(char *refparam, struct dmctx *ctx, void *data, char
***********************************************************************************************************************************/
/* *** Device.Services. *** */
DMOBJ tServicesObj[] = {
/* OBJ, permission, addobj, delobj, checkobj, browseinstobj, forced_inform, notification, nextdynamicobj, nextobj, leaf, linker, bbfdm_type*/
{"VoiceService", &DMREAD, NULL, NULL, NULL, browseVoiceServiceInst, NULL, NULL, NULL, tServicesVoiceServiceObj, tServicesVoiceServiceParams, NULL, BBFDM_BOTH},
/* OBJ, permission, addobj, delobj, checkdep, browseinstobj, forced_inform, notification, nextdynamicobj, nextobj, leaf, linker, bbfdm_type*/
{"VoiceService", &DMREAD, NULL, NULL, "file:/etc/config/asterisk", browseVoiceServiceInst, NULL, NULL, NULL, tServicesVoiceServiceObj, tServicesVoiceServiceParams, NULL, BBFDM_BOTH},
{0}
};

View file

@ -20,11 +20,11 @@ static int get_reserved_port_range(char **value)
dmuci_get_option_value_string("asterisk", "sip_options", "rtpstart", &start);
dmuci_get_option_value_string("asterisk", "sip_options", "rtpend", &end);
if (start && *start && end && *end)
if (start && *start && end && *end) {
dmasprintf(value, "%s-%s", start, end);
dmfree(start);
dmfree(end);
dmfree(start);
dmfree(end);
}
return 0;
}