|
@@ -152,16 +152,16 @@ static cmd_export_t commands[] = {
|
|
|
};
|
|
|
|
|
|
static param_export_t parameters[] = {
|
|
|
- {"init", STR_PARAM | USE_FUNC_PARAM, parse_param_init},
|
|
|
- {"start", STR_PARAM | USE_FUNC_PARAM, parse_param_start},
|
|
|
- {"stop", STR_PARAM | USE_FUNC_PARAM, parse_param_stop},
|
|
|
+ {"init", PARAM_STRING | USE_FUNC_PARAM, parse_param_init},
|
|
|
+ {"start", PARAM_STRING | USE_FUNC_PARAM, parse_param_start},
|
|
|
+ {"stop", PARAM_STRING | USE_FUNC_PARAM, parse_param_stop},
|
|
|
{"disable", INT_PARAM, &disable},
|
|
|
- {"socket_name", STR_PARAM, &(callcontrol_socket.name)},
|
|
|
+ {"socket_name", PARAM_STRING, &(callcontrol_socket.name)},
|
|
|
{"socket_timeout", INT_PARAM, &(callcontrol_socket.timeout)},
|
|
|
{"diverter_avp_id", INT_PARAM, &diverter_avp_id},
|
|
|
- {"canonical_uri_avp", STR_PARAM, &(canonical_uri_avp.spec.s)},
|
|
|
- {"signaling_ip_avp", STR_PARAM, &(signaling_ip_avp.spec.s)},
|
|
|
- {"sip_application_avp", STR_PARAM, &(sip_application_avp.spec.s)},
|
|
|
+ {"canonical_uri_avp", PARAM_STR, &(canonical_uri_avp.spec)},
|
|
|
+ {"signaling_ip_avp", PARAM_STR, &(signaling_ip_avp.spec)},
|
|
|
+ {"sip_application_avp", PARAM_STR, &(sip_application_avp.spec)},
|
|
|
{0, 0, 0}
|
|
|
};
|
|
|
|
|
@@ -1067,11 +1067,11 @@ mod_init(void)
|
|
|
|
|
|
|
|
|
// initialize the canonical_uri_avp structure
|
|
|
- if (canonical_uri_avp.spec.s==NULL || *(canonical_uri_avp.spec.s)==0) {
|
|
|
+ if (canonical_uri_avp.spec.s==NULL || canonical_uri_avp.spec.len<=0) {
|
|
|
LOG(L_ERR, "missing/empty canonical_uri_avp parameter. using default.\n");
|
|
|
canonical_uri_avp.spec.s = CANONICAL_URI_AVP_SPEC;
|
|
|
}
|
|
|
- canonical_uri_avp.spec.len = strlen(canonical_uri_avp.spec.s);
|
|
|
+
|
|
|
if (pv_parse_spec(&(canonical_uri_avp.spec), &avp_spec)==0 || avp_spec.type!=PVT_AVP) {
|
|
|
LOG(L_CRIT, "invalid AVP specification for canonical_uri_avp: `%s'\n", canonical_uri_avp.spec.s);
|
|
|
return -1;
|
|
@@ -1082,11 +1082,11 @@ mod_init(void)
|
|
|
}
|
|
|
|
|
|
// initialize the signaling_ip_avp structure
|
|
|
- if (signaling_ip_avp.spec.s==NULL || *(signaling_ip_avp.spec.s)==0) {
|
|
|
+ if (signaling_ip_avp.spec.s==NULL || signaling_ip_avp.spec.len<=0) {
|
|
|
LOG(L_ERR, "missing/empty signaling_ip_avp parameter. using default.\n");
|
|
|
signaling_ip_avp.spec.s = SIGNALING_IP_AVP_SPEC;
|
|
|
}
|
|
|
- signaling_ip_avp.spec.len = strlen(signaling_ip_avp.spec.s);
|
|
|
+
|
|
|
if (pv_parse_spec(&(signaling_ip_avp.spec), &avp_spec)==0 || avp_spec.type!=PVT_AVP) {
|
|
|
LOG(L_CRIT, "invalid AVP specification for signaling_ip_avp: `%s'\n", signaling_ip_avp.spec.s);
|
|
|
return -1;
|
|
@@ -1097,11 +1097,11 @@ mod_init(void)
|
|
|
}
|
|
|
|
|
|
// initialize the sip_application_avp structure
|
|
|
- if (sip_application_avp.spec.s==NULL || *(sip_application_avp.spec.s)==0) {
|
|
|
+ if (sip_application_avp.spec.s==NULL || sip_application_avp.spec.len<=0) {
|
|
|
LOG(L_ERR, "missing/empty sip_application_avp parameter. using default.\n");
|
|
|
sip_application_avp.spec.s = SIP_APPLICATION_AVP_SPEC;
|
|
|
}
|
|
|
- sip_application_avp.spec.len = strlen(sip_application_avp.spec.s);
|
|
|
+
|
|
|
if (pv_parse_spec(&(sip_application_avp.spec), &avp_spec)==0 || avp_spec.type!=PVT_AVP) {
|
|
|
LOG(L_CRIT, "invalid AVP specification for sip_application_avp: `%s'\n", sip_application_avp.spec.s);
|
|
|
return -1;
|