|
@@ -427,19 +427,19 @@ static pv_export_t mod_pvs[] = {
|
|
};
|
|
};
|
|
|
|
|
|
static param_export_t params[] = {
|
|
static param_export_t params[] = {
|
|
- {"nortpproxy_str", STR_PARAM, &nortpproxy_str.s },
|
|
|
|
- {"rtpproxy_sock", STR_PARAM|USE_FUNC_PARAM,
|
|
|
|
|
|
+ {"nortpproxy_str", PARAM_STR, &nortpproxy_str },
|
|
|
|
+ {"rtpproxy_sock", PARAM_STRING|USE_FUNC_PARAM,
|
|
(void*)rtpproxy_set_store },
|
|
(void*)rtpproxy_set_store },
|
|
{"rtpproxy_disable_tout", INT_PARAM, &rtpproxy_disable_tout },
|
|
{"rtpproxy_disable_tout", INT_PARAM, &rtpproxy_disable_tout },
|
|
{"rtpproxy_retr", INT_PARAM, &rtpproxy_retr },
|
|
{"rtpproxy_retr", INT_PARAM, &rtpproxy_retr },
|
|
{"rtpproxy_tout", INT_PARAM, &rtpproxy_tout },
|
|
{"rtpproxy_tout", INT_PARAM, &rtpproxy_tout },
|
|
- {"timeout_socket", STR_PARAM, &timeout_socket_str.s },
|
|
|
|
- {"ice_candidate_priority_avp", STR_PARAM,
|
|
|
|
|
|
+ {"timeout_socket", PARAM_STR, &timeout_socket_str },
|
|
|
|
+ {"ice_candidate_priority_avp", PARAM_STRING,
|
|
&ice_candidate_priority_avp_param},
|
|
&ice_candidate_priority_avp_param},
|
|
- {"extra_id_pv", STR_PARAM, &extra_id_pv_param.s },
|
|
|
|
- {"db_url", STR_PARAM, &rtpp_db_url.s },
|
|
|
|
- {"table_name", STR_PARAM, &rtpp_table_name.s },
|
|
|
|
- {"rtp_inst_pvar", STR_PARAM, &rtp_inst_pv_param.s },
|
|
|
|
|
|
+ {"extra_id_pv", PARAM_STR, &extra_id_pv_param },
|
|
|
|
+ {"db_url", PARAM_STR, &rtpp_db_url },
|
|
|
|
+ {"table_name", PARAM_STR, &rtpp_table_name },
|
|
|
|
+ {"rtp_inst_pvar", PARAM_STR, &rtp_inst_pv_param },
|
|
{0, 0, 0}
|
|
{0, 0, 0}
|
|
};
|
|
};
|
|
|
|
|
|
@@ -916,21 +916,16 @@ mod_init(void)
|
|
}
|
|
}
|
|
memset(rtpp_set_list, 0, sizeof(struct rtpp_set_head));
|
|
memset(rtpp_set_list, 0, sizeof(struct rtpp_set_head));
|
|
|
|
|
|
- if (nortpproxy_str.s==NULL || nortpproxy_str.s[0]==0) {
|
|
|
|
|
|
+ if (nortpproxy_str.s==NULL || nortpproxy_str.len<=0) {
|
|
nortpproxy_str.len = 0;
|
|
nortpproxy_str.len = 0;
|
|
- nortpproxy_str.s = NULL;
|
|
|
|
} else {
|
|
} else {
|
|
- nortpproxy_str.len = strlen(nortpproxy_str.s);
|
|
|
|
while (nortpproxy_str.len > 0 && (nortpproxy_str.s[nortpproxy_str.len - 1] == '\r' ||
|
|
while (nortpproxy_str.len > 0 && (nortpproxy_str.s[nortpproxy_str.len - 1] == '\r' ||
|
|
nortpproxy_str.s[nortpproxy_str.len - 1] == '\n'))
|
|
nortpproxy_str.s[nortpproxy_str.len - 1] == '\n'))
|
|
nortpproxy_str.len--;
|
|
nortpproxy_str.len--;
|
|
- if (nortpproxy_str.len == 0)
|
|
|
|
- nortpproxy_str.s = NULL;
|
|
|
|
}
|
|
}
|
|
|
|
|
|
if (rtpp_db_url.s != NULL)
|
|
if (rtpp_db_url.s != NULL)
|
|
{
|
|
{
|
|
- rtpp_db_url.len = strlen(rtpp_db_url.s);
|
|
|
|
init_rtpproxy_db();
|
|
init_rtpproxy_db();
|
|
if (rtpp_sets > 0)
|
|
if (rtpp_sets > 0)
|
|
{
|
|
{
|
|
@@ -974,7 +969,6 @@ mod_init(void)
|
|
}
|
|
}
|
|
|
|
|
|
if (rtp_inst_pv_param.s) {
|
|
if (rtp_inst_pv_param.s) {
|
|
- rtp_inst_pv_param.len = strlen(rtp_inst_pv_param.s);
|
|
|
|
rtp_inst_pvar = pv_cache_get(&rtp_inst_pv_param);
|
|
rtp_inst_pvar = pv_cache_get(&rtp_inst_pv_param);
|
|
if ((rtp_inst_pvar == NULL) ||
|
|
if ((rtp_inst_pvar == NULL) ||
|
|
((rtp_inst_pvar->type != PVT_AVP) &&
|
|
((rtp_inst_pvar->type != PVT_AVP) &&
|
|
@@ -986,7 +980,6 @@ mod_init(void)
|
|
}
|
|
}
|
|
|
|
|
|
if (extra_id_pv_param.s && *extra_id_pv_param.s) {
|
|
if (extra_id_pv_param.s && *extra_id_pv_param.s) {
|
|
- extra_id_pv_param.len = strlen(extra_id_pv_param.s);
|
|
|
|
if(pv_parse_format(&extra_id_pv_param, &extra_id_pv) < 0) {
|
|
if(pv_parse_format(&extra_id_pv_param, &extra_id_pv) < 0) {
|
|
LM_ERR("malformed PV string: %s\n", extra_id_pv_param.s);
|
|
LM_ERR("malformed PV string: %s\n", extra_id_pv_param.s);
|
|
return -1;
|
|
return -1;
|